Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


7 Pages«<4567>
Options
Go to last post Go to first unread
Offline Jean Giraud  
#101 Posted : 14 July 2018 17:58:28(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: ola_nicolas Go to Quoted Post
I would be interested in doing some tests on this method. Unfortunately, I do not know how to do this.


have you tried this:
1. Close PC
2. Open PC
3. Open Smath ... do nothing
4. Menu bar => Options => Interface => Arguments separator => period, coma, semicolon
5. check OK
6. Close PC.
7. Open PC
8. Open Smath, Code by hand Ber7 Primer or try to open.

Coma.PNG

Offline ola_nicolas  
#102 Posted : 14 July 2018 23:29:16(UTC)
ola_nicolas


Rank: Advanced Member

Groups: Registered
Joined: 21/11/2017(UTC)
Posts: 112
Romania
Location: Olt county

Was thanked: 1 time(s) in 1 post(s)
Thanks Jean Giraud

It went without restarting the computer. I just restarted SMath after choosing the comma. However, a logical explanation should exist. I'm not saying that the algorithm depends on which separator is used. Will there be any bug or any algorithm problem in this case?!

Thanks Ber7 for the example cascade and for the effort to attach the pdf file as well.

Nicolas

Edited by user 14 July 2018 23:39:24(UTC)  | Reason: Not specified

Offline Jean Giraud  
#103 Posted : 15 July 2018 02:54:18(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: ola_nicolas Go to Quoted Post
It went without restarting the computer. I just restarted SMath after choosing the comma. However, a logical explanation should exist. I'm not saying that the algorithm depends on which separator is used. Will there be any bug or any algorithm problem in this case?!


This algorithm is from public domain, most probably coded for [,]
as this library may use [;] for other coding ... simplist, makes sense.
Thanks Nicolas for confirming the Doctor has saved the patient.

Jean
Offline ola_nicolas  
#104 Posted : 15 July 2018 07:58:41(UTC)
ola_nicolas


Rank: Advanced Member

Groups: Registered
Joined: 21/11/2017(UTC)
Posts: 112
Romania
Location: Olt county

Was thanked: 1 time(s) in 1 post(s)
Hello.

The doctor saves a patient suffering. It does not matter what the patient says, because the alternative is unfavorable to himself. If the patient makes the effort to confirm, this is primarily a service to science. Thank you Jean Giraud.

Nicolas

Edited by user 15 July 2018 11:25:32(UTC)  | Reason: Not specified

Offline Ber7  
#105 Posted : 15 July 2018 13:26:40(UTC)
Ber7


Rank: Advanced Member

Groups: Registered
Joined: 15/07/2010(UTC)
Posts: 437
Man
Israel
Location: Beer-Sheva

Was thanked: 520 time(s) in 288 post(s)
Underdetermined nonlinear system of equations.Three equations with four unknowns.
Visualization of finding the roots

Visual.sm (17kb) downloaded 34 time(s).

Edited by user 15 July 2018 19:11:08(UTC)  | Reason: Not specified

Offline Ber7  
#106 Posted : 15 July 2018 19:24:29(UTC)
Ber7


Rank: Advanced Member

Groups: Registered
Joined: 15/07/2010(UTC)
Posts: 437
Man
Israel
Location: Beer-Sheva

Was thanked: 520 time(s) in 288 post(s)
Underdetermined nonlinear system of equations.Five equations with six unknowns.


Underdetermined.sm (53kb) downloaded 27 time(s).
thanks 2 users thanked Ber7 for this useful post.
on 16/07/2018(UTC),  on 29/07/2018(UTC)
Offline ola_nicolas  
#107 Posted : 16 July 2018 22:30:32(UTC)
ola_nicolas


Rank: Advanced Member

Groups: Registered
Joined: 21/11/2017(UTC)
Posts: 112
Romania
Location: Olt county

Was thanked: 1 time(s) in 1 post(s)
Hello

I did some tests. The method is recommended for a system where the number of equations is equal to the number of unknowns. My interest focuses on a method where the number of equations is m, and the number of unknowns is n, with m>n. I'm staying in the study. I'll come back if I find new ideas. Thank you Ber7.

Nicolas
Offline omorr  
#108 Posted : 17 July 2018 10:52:00(UTC)
omorr


Rank: Administration

Groups: Registered, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

Was thanked: 318 time(s) in 268 post(s)
Hello Nicolas
Originally Posted by: ola_nicolas Go to Quoted Post
Hello

I did some tests. The method is recommended for a system where the number of equations is equal to the number of unknowns. My interest focuses on a method where the number of equations is m, and the number of unknowns is n, with m>n. I'm staying in the study. I'll come back if I find new ideas. Thank you Ber7.

Nicolas


I hope you would not mind repeating myself. If you need to solve the system of m nonlinear equations in n unknowns (m>n) then you have to use some minimization procedure. This is a simple explanation of least square minimization.

leastsquare.GIF

One could see that if F(x) is quite close to zero, then all the f1(x), f2(x)... are also close to zero. This minimization procedure will also work with m=n, and then you will also have the solution of n equations with n unknowns as well.
I think that al_nleqsolve() can only solve the system where the number of equations is equal to the number of unknowns, which is not what you need.

Regards,
Radovan

When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline Jean Giraud  
#109 Posted : 17 July 2018 15:33:16(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: omorr Go to Quoted Post
My interest focuses on a method where the number of equations is m, and the number of unknowns is n, with m>n

I'm not aware of such methods, but don't deny such inventions.
Let's leave al_nleqsolve on the side for the moment, and revisit the more common
real life where n data points must be fitted via some of so many existing methods.
Like Radovan mentioned, the methods revert to minimizing the SSD [SumSquareDifferences].
At this point, it is essential to learn about the extraordinary property of the Cholesky
solver, not new but so vividely visible in Smath.
It fits directly Lagrange polynomials on minimized SSD.
For more complicated models, in Smath, the refined fit is iterative Conjugate Gradient.

Please, take the time to read the minimalist introduction 7 documents.

Jean

Genfit Rational.sm (56kb) downloaded 21 time(s).
Polynomial fit Methods [linfitCheby].sm (43kb) downloaded 20 time(s).
Genfit Rational Type J_8.sm (58kb) downloaded 19 time(s).
PolyFit QUICK.sm (25kb) downloaded 22 time(s).
Genfit Kirby_2 [Transmute].sm (42kb) downloaded 20 time(s).
Solve al_nleqsolve CSTR.sm (39kb) downloaded 25 time(s).
Polynomial fit Methods [ Rational linfit].sm (63kb) downloaded 22 time(s).

Offline Jean Giraud  
#110 Posted : 17 July 2018 16:39:38(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: ola_nicolas Go to Quoted Post
My interest focuses on a method where the number of equations is m, and the number of unknowns is n, with m>n


Look closely at this Curvator, not so easy to fit an overall data set.
In fact, the system is 16 equations for 4 data points.
The derivative adjusts the curvature.

Jean

Spline Curvator.sm (28kb) downloaded 25 time(s).

Offline Jean Giraud  
#111 Posted : 17 July 2018 17:12:13(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
... revisit Cholesky SSD solver.

Cholesky.PNG
Offline uni  
#112 Posted : 18 July 2018 02:37:48(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,493
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
Originally Posted by: omorr Go to Quoted Post
I think that al_nleqsolve() can only solve the system where the number of equations is equal to the number of unknowns


2018-07-18_04-30-59.png
Russia ☭ forever
Viacheslav N. Mezentsev
Offline Jean Giraud  
#113 Posted : 18 July 2018 06:10:21(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post
... revisit Cholesky SSD solver.


This version is an adaptive fit, worth the visit.

Jean

Polynomial fit_Cholesky.sm (48kb) downloaded 30 time(s).
Offline ola_nicolas  
#114 Posted : 21 July 2018 20:22:16(UTC)
ola_nicolas


Rank: Advanced Member

Groups: Registered
Joined: 21/11/2017(UTC)
Posts: 112
Romania
Location: Olt county

Was thanked: 1 time(s) in 1 post(s)
Hello.

I have insisted on the LM algorithm and I chose three points on each of the different curves represented by the vectors used as data. I wanted to see how far SMath could go by solving a system of nonlinear equations. I have arrived at the system in the image, taking the basis of the first four vectors, namely a1, b1, c1, d1. I have not tried other combinations, for example vectors a1, b1, c1, e1, etc. Under these circumstances, I can say that the results obtained are satisfactory to the good. Based on a 10-point rating system, I would write the result between 7 and 8. What first of all thanks me is that the algorithm could find this solution, starting from a sufficiently remote approximation. With the approximate solution in the picture, the calculation lasted about four and a half minutes. I still do not have the skill to use graphics. I would be glad if someone would recommend examples and tutorials in this regard. For the moment I made the graphical comparisons using the results obtained with SMath in MathCAD. Any equation added to the system in the image leads to errors, including system constraint. I'll continue the tests. Regards.

Nicolas.

Test.PNG

LM1_.sm (14kb) downloaded 22 time(s).

Edited by user 21 July 2018 20:24:40(UTC)  | Reason: Not specified

Offline Jean Giraud  
#115 Posted : 23 July 2018 05:26:16(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: ola_nicolas Go to Quoted Post
I would be glad if someone would recommend examples and tutorials in this regard. For the moment I made the graphical comparisons using the results obtained with SMath in MathCAD.


The model function looks out the blue, at least can't be proved valid.
What do you get from Mathcad ?
If you get better sanity check from Mathcad, then Smath LM is under-designed.

LM1_.sm (36kb) downloaded 20 time(s).
Offline ola_nicolas  
#116 Posted : 23 July 2018 10:49:10(UTC)
ola_nicolas


Rank: Advanced Member

Groups: Registered
Joined: 21/11/2017(UTC)
Posts: 112
Romania
Location: Olt county

Was thanked: 1 time(s) in 1 post(s)
Hello.

I continued the tests and wanted to see how SMath could lead. I have tried to define the function in a recurring way, as in the attached picture. The first observation was (as in the other test) that for more distant values of the Ug parameter the algorithm gives errors. Then, although I was able to solve a system of 18 equations (even 19 in one of the attempts), the increase of the number over 20 is also accompanied by errors. A sign that the solution is close to reality is the value of the variable from the exponent, which is naturally very close to 1.5. I think the convergence criteria should be strengthened for the LM algorithm in SMath. Although I have succeeded in introducing several equations in the calculation, however, the result of the first test was better. This is because the equations in that case have been selected based on the results already known to me in MathCAD.

Originally Posted by: Jean Giraud Go to Quoted Post
... If you get better sanity check from Mathcad, then Smath LM is under-designed.


I did not mean to say that. But just as for the Levenberg-Marquardt algorithm in SMath, there is still room for improvement.

Originally Posted by: Jean Giraud Go to Quoted Post

The model function looks out the blue, at least can't be proved valid.


A mathematical program should not only be considered for those with the highest mathematical skills. If you know how many engineers put on the scale just the empirical arguments revealed by the most palpable practice and run away when it comes to math! That's why I consider MathCAD an excellent program for wide categories of professionals. It's easy to drive even for the most inexperienced. I use the method of viewing on the graph rather for checking. I find it easier to compare two graphical curves than two inexpressive vectors. Therefore, being very little experienced in this regard regarding SMath, I preferred a check in MathCAD. Otherwise, all the best.

Nicolas.

Test._.PNG

LM1__.sm (45kb) downloaded 20 time(s).

Edited by user 23 July 2018 11:07:03(UTC)  | Reason: Not specified

Offline Jean Giraud  
#117 Posted : 23 July 2018 16:40:35(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: ola_nicolas Go to Quoted Post
I find it easier to compare two graphical curves than two inexpressive vectors.


... then: why not resume the project with some plot ?

ia.PNG
Offline ola_nicolas  
#118 Posted : 23 July 2018 21:38:00(UTC)
ola_nicolas


Rank: Advanced Member

Groups: Registered
Joined: 21/11/2017(UTC)
Posts: 112
Romania
Location: Olt county

Was thanked: 1 time(s) in 1 post(s)
Hello.

Originally Posted by: Jean Giraud Go to Quoted Post
... then: why not resume the project with some plot ?...


I just said it. Because I have not yet formed the necessary skills for SMath.

Nicolas.
Offline Ber7  
#119 Posted : 24 July 2018 16:29:58(UTC)
Ber7


Rank: Advanced Member

Groups: Registered
Joined: 15/07/2010(UTC)
Posts: 437
Man
Israel
Location: Beer-Sheva

Was thanked: 520 time(s) in 288 post(s)
ola_nicolas, I just slightly reduced the code of your program.


Nicolas.sm (13kb) downloaded 24 time(s).

Edited by user 27 July 2018 16:42:55(UTC)  | Reason: Not specified

Offline Ber7  
#120 Posted : 24 July 2018 19:38:41(UTC)
Ber7


Rank: Advanced Member

Groups: Registered
Joined: 15/07/2010(UTC)
Posts: 437
Man
Israel
Location: Beer-Sheva

Was thanked: 520 time(s) in 288 post(s)
However, AlgLib Solver works faster and depends little on X0 matrix.See # 29
https://en.smath.info/forum/yaf_topics32_Extensions.aspx
Overdetermined.sm (16kb) downloaded 35 time(s).
Users browsing this topic
7 Pages«<4567>
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.