Rank: Advanced Member Groups: Registered
Joined: 21/11/2017(UTC) Posts: 114 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
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,494 Was thanked: 1274 time(s) in 745 post(s)
|
You can try Maple region from MapleWrapper plugin (updated). 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 |
2 users thanked uni for this useful post.
|
on 06/07/2018(UTC), on 06/07/2018(UTC)
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: ola_nicolas 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).
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 15/04/2012(UTC) Posts: 1,986 Was thanked: 1124 time(s) in 721 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.sm (6kb) downloaded 24 time(s).Edited by user 06 July 2018 23:21:58(UTC)
| Reason: Not specified |
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: mkraska 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
|
|
|
|
Rank: Administration Groups: Registered, Advanced Member Joined: 23/06/2009(UTC) Posts: 1,740 Was thanked: 318 time(s) in 268 post(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!" |
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: omorr 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. Solve GivenFind Broyden.sm (24kb) downloaded 20 time(s).
|
|
|
|
Rank: Administration Groups: Registered, Advanced Member Joined: 23/06/2009(UTC) Posts: 1,740 Was thanked: 318 time(s) in 268 post(s)
|
Sorry Jean, that was not my point. I thought on something like this one. 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 postEdited 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!" |
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 21/11/2017(UTC) Posts: 114 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
|
1 user thanked ola_nicolas for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 21/11/2017(UTC) Posts: 114 Location: Olt county Was thanked: 1 time(s) in 1 post(s)
|
Originally Posted by: mkraska 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. Edited by user 07 July 2018 21:46:09(UTC)
| Reason: Not specified
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: ola_nicolas I do not even achieve symbolic optimization. Try FindRoot NUMERIC. It solves for 3 sets of initials.
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 21/11/2017(UTC) Posts: 114 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. Edited by user 08 July 2018 13:25:19(UTC)
| Reason: Not specified
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: ola_nicolas 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).
|
1 user thanked Jean Giraud for this useful post.
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 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. Page2 Nicolas.sm (42kb) downloaded 17 time(s).
|
|
|
|
Rank: Administration Groups: Registered, Advanced Member Joined: 23/06/2009(UTC) Posts: 1,740 Was thanked: 318 time(s) in 268 post(s)
|
Another solver from Alglib. I just copied from this post. 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!" |
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 21/11/2017(UTC) Posts: 114 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.
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: omorr 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).
|
|
|
|
Rank: Administration Groups: Registered, Advanced Member Joined: 23/06/2009(UTC) Posts: 1,740 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. Regards, Radovan |
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!" |
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: omorr 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).
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 15/07/2010(UTC) Posts: 437 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).
|
3 users thanked Ber7 for this useful post.
|
on 09/07/2018(UTC), on 10/07/2018(UTC), on 10/07/2018(UTC)
|
|
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.