SMath Studio Forum
»
SMath Studio
»
Samples
»
solve, roots, RootSecant, Dichotomy
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
This Smath document is hot from bakery. A must to start getting used. Inversing a function is also 'solving', from another Smath document. Thanks Alex for your function x^1/3. It puzzled me a bit why it does not plot in q(x)-g(x). Finally, eval(,) rescues the plot and enables RootSecant to work fine, presented here as a "utility". About numerical solvers for this type of application, everything has been invented, even the square wheel! that runs flat on cycloidal road. Why so many ? Because maths are so many, so much. Enjoy, please post your "difficult solve". Jean Solve roots_solve RootSecant.sm (39kb) downloaded 51 time(s).
|
1 user thanked Jean Giraud for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 03/03/2014(UTC) Posts: 418 Was thanked: 125 time(s) in 96 post(s)
|
does not evaluate
|
1 user thanked Alex M. for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 13/01/2012(UTC) Posts: 2,647 Location: Italy Was thanked: 1329 time(s) in 875 post(s)
|
Originally Posted by: Alex M. does not evaluate You have to change the argument Φ into Φ(1) in both the algorithms (RootSecant and Dichotomy) Not sure why it magically works in 5346, however in this way has the same behavior in both the versions. Edited by user 26 November 2016 01:55:35(UTC)
| Reason: Not specified |
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects |
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: Davide Carpi Not sure why it magically works in 5346 5346 is much closer to Mathcad algo by name which is also closely related to Maple "expression".
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 13/01/2012(UTC) Posts: 2,647 Location: Italy Was thanked: 1329 time(s) in 875 post(s)
|
Found the cause In the original algorithm, functions is not passed by the argument (both in 5346 and the latest), because first argument is not declared to be a function (to figure it, you can replace first argument in RootSecant/Dichotomy definition with a non existing variable, like zzz, you will see the worksheet still works in the same way). The link with the functions in the worksheet is given by this definition, just below RootSecant: Here is the cause of the different behaviors: - In SS 0.97, f(x) is kept as symbolical definition even if f(x) already exists, hence when you call the algorithms the function Φ(x) to solve in the algorithms is the last f(x) defined before the use.
- In SS 0.98, the definition stores the content of f(x), hence then you ask the algorithms to solve always the same function, bracketed in different locations (wrong bracket -> infinite loop).
Edited by user 26 November 2016 03:03:56(UTC)
| Reason: Not specified |
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects |
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Thanks Davide, Good doctoring for those users post 5346. In the attached, added "Newton-Raphson Root Derivative method". 1/1 Mathcad code, works great to augment this useful document. Cheers, Jean Solve roots_solve RootSecant.sm (119kb) downloaded 25 time(s).
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
|
|
|
|
Rank: Administration Groups: Registered, Advanced Member Joined: 23/06/2009(UTC) Posts: 1,740 Was thanked: 318 time(s) in 268 post(s)
|
I think that using functions without brackets as arguments in defining (or calling) another functions wich uses them (like in Mathcad) is generally a bad idea in SMath The reason is relatively simple. You can have variables and functions having different number of arguments but all with the same name in SMath. That is not possible in Mathcad. I suppose different side effects might be present in SMath by copying Mathcad files - like the one Jean presented. In one version of SMath it might work while in the other version the calculation might be performed indefinitely long.
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)
|
Hello Radovan, Your comment is well posed. However, if it would reveal that some of the coding attached wouldn't work in recent Smath build: that is a problem, obliging many work sheets to be doctored. These three are typical of various algo constructions. Jean 0Algo Explain.sm (58kb) downloaded 29 time(s). Genfit Minimize MODEL [Gauss ERRstem].sm (63kb) downloaded 22 time(s). Image Fourier Zoom Smath.sm (436kb) downloaded 25 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)
|
Hello Jean,
It seems your files are working well (no errors reported). The most important thing is that they are good for you and they could be used (or changed) by the other users.
Best Regards, Radovan |
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!" |
|
|
|
SMath Studio Forum
»
SMath Studio
»
Samples
»
solve, roots, RootSecant, Dichotomy
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.