1 Pages (10 items)
solve, roots, RootSecant, Dichotomy - solve, roots, RootSecant, Dichotomy - Messages
#1 Posted: 11/25/2016 1:22:30 PM
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 (38 KiB) downloaded 77 time(s).
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 (38 KiB) downloaded 77 time(s).
1 users liked this post
Davide Carpi 11/25/2016 7:49:00 PM
#3 Posted: 11/25/2016 7:51:16 PM
Wrotedoes 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.
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#4 Posted: 11/25/2016 8:08:26 PM
WroteNot sure why it magically works in 5346
5346 is much closer to Mathcad algo by name
which is also closely related to Maple "expression".
#5 Posted: 11/25/2016 8:48:28 PM
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:
![2016-11-26 00_39_01-SMath Studio Desktop - [Solve%20roots_solve%20RootSecant.sm_].png](/en-US/file/GSCbK6/2016-11-26-00_39_01-SMath-Studio-Desktop---_Solve_20roots_solve_20RootSecant_sm___png)
Here is the cause of the different behaviors:

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).
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#6 Posted: 11/26/2016 1:03:15 AM
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 (118 KiB) downloaded 51 time(s).
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 (118 KiB) downloaded 51 time(s).
#7 Posted: 11/26/2016 2:21:40 AM
... the cleaned version for your "Numerical solve" classroom.
Solve roots_solve RootSecant.sm (117 KiB) downloaded 65 time(s).
Solve roots_solve RootSecant.sm (117 KiB) downloaded 65 time(s).
#8 Posted: 11/26/2016 5:36:56 AM
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
Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#9 Posted: 12/1/2016 9:53:00 PM
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 (57 KiB) downloaded 53 time(s).
Genfit Minimize MODEL [Gauss ERRstem].sm (62 KiB) downloaded 49 time(s).
Image Fourier Zoom Smath.sm (435 KiB) downloaded 50 time(s).
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 (57 KiB) downloaded 53 time(s).
Genfit Minimize MODEL [Gauss ERRstem].sm (62 KiB) downloaded 49 time(s).
Image Fourier Zoom Smath.sm (435 KiB) downloaded 50 time(s).
#10 Posted: 12/2/2016 4:52:30 AM
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
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!"
1 Pages (10 items)
-
New Posts
-
No New Posts