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

Notification

Icon
Error

Login


7 Pages«<23456>»
Options
Go to last post Go to first unread
Offline ola_nicolas  
#61 Posted : 06 July 2018 14:35:30(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 think it would not be bad for Davide to verify my algorithm (it does not correspond in any case to the syntactic precepts used in SMath) to append it and add it to its other models, from where I saw the Levenberg-Marquardt method missing . I will not have claims. What Martin has suggested to me is useless in this case. In the file below I tried to apply LevenbergMarquardt(3) to the simple example of 3 unknown 3 equations that appears in the picture in message # 54. An error occurred.

Nicolas
Untitled.sm (6kb) downloaded 21 time(s).

Edited by user 06 July 2018 15:50:13(UTC)  | Reason: Not specified

Offline uni  
#62 Posted : 06 July 2018 16:02:17(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)
You can try Maple region from MapleWrapper plugin (updated).

2018-07-06_18-03-00.png
2018-07-06_18-00-22.png

Code:

with(stats):
ans:=op(2,fit[leastsquare[[x,y],y=a*x^2+b*x+c]]([[10,15,17,19],[3,4,5,6]])):
Russia ☭ forever
Viacheslav N. Mezentsev
thanks 2 users thanked uni for this useful post.
on 06/07/2018(UTC),  on 06/07/2018(UTC)
Offline Jean Giraud  
#63 Posted : 06 July 2018 17:43:20(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
Hello.

I think it would not be bad for Davide to verify my algorithm (it does not correspond in any case to the syntactic precepts used in SMath) to append it and add it to its other models, from where I saw the Levenberg-Marquardt method missing . I will not have claims.What Martin has suggested to me is useless in this case. In the file below I tried to apply LevenbergMarquardt(3) to the simple example of 3 unknown 3 equations that appears in the picture in message # 54. An error occurred.

Nicolas


Your About LM algorithm is not ready for publishing.
seemingly you got result in 6671, but fails 6179.
norme(,) looks strange 6671 ... and unknown
norme(,) 6179 is by the bible books.

This example gives 9 decimals in native Smath.

Solve GivenFind MCD Example.sm (22kb) downloaded 21 time(s).

Levenberg-Marquardt [Nicolas].sm (39kb) downloaded 25 time(s).

Offline mkraska  
#64 Posted : 06 July 2018 23:20:23(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,980
Germany

Was thanked: 1120 time(s) in 718 post(s)
In the given case LM works with symbolic optimization, but not with numeric. Also, z=0 does not work as initial value.

lm.png
lm.sm (6kb) downloaded 24 time(s).

Edited by user 06 July 2018 23:21:58(UTC)  | Reason: Not specified

Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline Jean Giraud  
#65 Posted : 07 July 2018 02:03: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: mkraska Go to Quoted Post
In the given case LM works with symbolic optimization, but not with numeric. Also, z=0 does not work as initial value.


Thanks Martin,

Will surely be useful in real applications.
Beats Mathcad in simplicity !

Jean
Offline omorr  
#66 Posted : 07 July 2018 09:37:06(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)
Originally Posted by: mkraska Go to Quoted Post
In the given case LM works with symbolic optimization, but not with numeric. Also, z=0 does not work as initial value.

lm.png
lm.sm (6kb) downloaded 24 time(s).


The same problem could be solved with many other functions in NonlinearSolvers plugin including the intended FindRoot() as the principal one. Unfortunately, it seems that strictly numerical problems are still problematic and questionable.

Regards,
Radovan

lmext.sm (17kb) downloaded 28 time(s).
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline Jean Giraud  
#67 Posted : 07 July 2018 16:34:26(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
The same problem could be solved with many other functions in NonlinearSolvers plugin including the intended FindRoot() as the principal one. Unfortunately, it seems that strictly numerical problems are still problematic and questionable.

Regards,
Radovan


Of all those plugin solvers, they all work ± equivalent.
In this examples , FindRoot(,,,) = Mathcad.
But only Broyden solves for both sets of solutions
Yes, there are two sets of solutions because of z^2
Thanks Radovan.

Broyden.PNG

Solve GivenFind Broyden.sm (24kb) downloaded 20 time(s).

Offline omorr  
#68 Posted : 07 July 2018 19:00:17(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)
Sorry Jean, that was not my point. I thought on something like this one.

nlinsys.PNG

SMath can not solve strictly numerically this and similar problems. I wish I was wrong, but I mentioned this quite a lot of times. I am not sure if I was not understood or simply SMath can not cope with this.

Regards,
Radovan

EDIT: Actually, Davide mentioned this in this post

Edited by user 08 July 2018 13:11:12(UTC)  | Reason: Not specified

When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline ola_nicolas  
#69 Posted : 07 July 2018 19:41:40(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.

From the point of view of symbolic, versus numeric optimization, something should be done to automate such a choice. From the point of view of the algorithms, I am very little experienced. If the algorithm proposed by me can be processed, including with the help of the skilled ones, then fine. My point of view is that SMath is still a non-livelier ground in terms of resolving non-linear systems containing more than two equations. Practically my skill is to effectively use such algorithms and not to produce them. I just launched a challenge and I would be happy if something new in SMath emerged.

Nicolas

Edited by user 07 July 2018 20:01:00(UTC)  | Reason: Not specified

thanks 1 user thanked ola_nicolas for this useful post.
on 07/07/2018(UTC)
Offline ola_nicolas  
#70 Posted : 07 July 2018 21:37:15(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)
Originally Posted by: mkraska Go to Quoted Post
In the given case LM works with symbolic optimization, but not with numeric. Also, z=0 does not work as initial value. ...

I do not even achieve symbolic optimization.

LM_.PNG

Edited by user 07 July 2018 21:46:09(UTC)  | Reason: Not specified

Offline Jean Giraud  
#71 Posted : 08 July 2018 00:26:30(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 do not even achieve symbolic optimization.


Try FindRoot NUMERIC. It solves for 3 sets of initials.

FindRoot3sets.PNG
Offline ola_nicolas  
#72 Posted : 08 July 2018 11:29:33(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)
Bonjour Jean Giraud

I think it was a mere chance that the FindRoot algorithm solved that system. Try the system in the first picture. You will get the error "Cannot solve. Try using a more specific algorithm". Actually, that's what it is all about. Taking into account all the existing plugins, you need to test a wide variety of possible "more specific" algorithms. But by putting six equations of my system in the form of the image, I finally managed to get a first result using the LevenbergMarquardt algorithm (3) - even if I had to wait almost a minute and 37 seconds. It is illustrated in the second image. What did I actually do? I actually chose three disparate points on the first curve (one with a special shape) and three more on the second curve and formed a system of 6 equations. I have managed to solve it, as shown in the second picture, but the solution is far from the (very precise) found by MathCAD. As soon as I have attached another equation (the seventh) that actually represents a constraint on the system, I have not gotten anything, as shown in the third image. In this sense, it is also necessary to work in SMath. First of all you need to find more efficient algorithms for constrained systems. Then you must necessarily find a way for the program to automatically choose between all possible algorithms, only the applicable one. Let's look at things in the following way. The FindRoot algorithm in SMath could be the GivenFind algorithm in MathCAD. This must actually be a special algorithm to choose the applicable method. Among the applicable methods algorithms with constraints should also be included. Only in this way the work of a researcher using SMath as a tool can be effective. It must be borne in mind that the researcher is not necessarily an excellent mathematician of analysis, but perhaps only one of the occasions, who only attempts to obtain the results that interest him in a particular process. Otherwise, all my respect for everyone, and all the best.

Nicolas.

X1.PNG

X2.PNG

X3.PNG

Edited by user 08 July 2018 13:25:19(UTC)  | Reason: Not specified

Offline Jean Giraud  
#73 Posted : 08 July 2018 16:20:19(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 have managed to solve it, as shown in the second picture, but the solution is far from the (very precise) found by MathCAD.


1. What is Levenberg-Marquardt ?
An invented gadget solver for some of the casual case of their researchers.
2. Please attach the Smath for the 2nd 6 var example.
3. Mathcd 11 GivenFind solves for 299 simple demand [finite differences DE]
4. The most exhaustive algebraic case MCD 11 solved 22 ... it toke weeks
It had to be associated with lot of < ...> . Straight equalities aren't
solvable by simple algebra.
5. Your base model is not algebraic, thus you can expect infinitely many sols.
That is so true that your LM apparent solution is just one of infinitely many.
6. FindRoot solves your 1rst example.

In your examples, there is the common pitfall ... Explain:
You can't have more accuracy than the given, in this case example [1]
FindRoot epsilon 0.00001. The LM 10^-15 has no meaning at all
Two different results that do sanity identical.
What is the accuracy of pi*0.123 ? Answer => 3 decimals
What is the accuracy of pi *(123/1000) ? Answer => as many decimals as pi

Cheers Nicolas ... Jean

Page1 Nicolas.sm (20kb) downloaded 22 time(s).


thanks 1 user thanked Jean Giraud for this useful post.
on 08/07/2018(UTC)
Offline Jean Giraud  
#74 Posted : 08 July 2018 19:27:12(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)
... here is your 2nd example.
Two solvers => two sets of solutions among infinitely many possible
from not available infinitely many not yet invented solvers.
What is ! true ! in your proposal ? two sets of experimental values
The model you fabricate may be correct, but not enough experimental data.
If projects are secret or not allowed to be public, public forum
is not the place to expect productive help.

page2Nicolas.PNG

Page2 Nicolas.sm (42kb) downloaded 17 time(s).
Offline omorr  
#75 Posted : 08 July 2018 21:46:17(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)
Another solver from Alglib. I just copied from this post.

al_nleqaolve-corr.PNG

al_nleqsolve-corr.sm (20kb) downloaded 22 time(s).

This is a gradient algorithm. You need Jacobian, unfortunately, which might be quite complicated sometimes and often can give us headaches.

Regards,
Radovan

When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline ola_nicolas  
#76 Posted : 08 July 2018 23:03:51(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.

You do not have to mind Jean Giraud. In the last two posts you made me understand a lot of things. In fact, that's what I wanted from this topic. Thank you very much. Thank you all.

Nicolas.
Offline Jean Giraud  
#77 Posted : 09 July 2018 01:48:19(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
Another solver from Alglib. I just copied from this post.


Thanks Radovan, interesting.
Levenberg-Marquardt is one solver, that fails this example.
You can only conclude you have solved if there is a way to
sanity out of doubt. In short, solving is more than some numbers

Jean

Solve Given_Find [CO2_6179].sm (39kb) downloaded 18 time(s).
Offline omorr  
#78 Posted : 09 July 2018 11:07:45(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)
You are welcome Jean,

We should not forget roots() which was one of the first functions in SMath of its kind.

roots.GIF

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline Jean Giraud  
#79 Posted : 09 July 2018 16:01:59(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
You are welcome Jean,

We should not forget roots() which was one of the first functions in SMath of its kind.


Thanks Radovan,

... refreshed/updated both versions.

Solve Given_Find [CO2_6179].sm (37kb) downloaded 20 time(s).
Offline Ber7  
#80 Posted : 09 July 2018 22:22:53(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)
Determination of the coordinates of the links of spatial
mechanisms by the Alglib solver


PrimerAlgib.sm (64kb) downloaded 32 time(s).
thanks 3 users thanked Ber7 for this useful post.
on 09/07/2018(UTC),  on 10/07/2018(UTC),  on 10/07/2018(UTC)
Users browsing this topic
7 Pages«<23456>»
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.