Rank: Advanced Member Groups: Registered, Advanced Member Joined: 13/01/2012(UTC) Posts: 2,713 Location: Italy Was thanked: 1378 time(s) in 902 post(s)
|
Plugin updated, Added new functions (Secant/Brent/Ridder) The issue of the last post was in the evaluation of the number of functions, now is fixed. Originally Posted by: omorr Hello w3b5urf3r Originally Posted by: w3b5urf3r_reloaded ...about eval(), you cannot use it where there are undefined variables because the function "force" the numeric evaluation. I am trying to figure out this regarding eval(). I do not get it. It is quite not logical to me. For instance, we can make a function in this way f(x):line(a:x,y:eval(a^2+5*a-3),2,1)We can call it and get the result f(-2)=-9 f(2)=11But can not use it here Bisection(f(x#),-9,0,10^{-5},50)=#@#If we remove eval(), everything is fine f(x):line(a:x,y:a^2+5*a-3,2,1)Bisection(f(x#),-9,0,10^{-5},50)=-5.5414There are functions like Bisection() that actually need the function value regardless the expression behind that function. Moreover, eval() has proven to be sometimes very useful in order to increase the calculation speed dramatically. I think this would be quite a restriction if we could not use it in the situation like these. I suppose that is due to the SMath design and its symbolic engine. I think this is quite a disadvantage regarding the strictly numerical computations and just hope that something could be done about it. Regards, Radovan doing a few tests seem that the eval() function force a "local" numeric evaluation... when a 1st function call a 2nd nested function that contains the eval(), SMath first attempt to evaluate the eval() inside the 2nd function, or something similar... f.e. look the attachment eval.sm, f1a() can't be evaluated simbolically. As for Primer65aa, the Broyden function is not bugged... the f() function contains logharitms and the Broyden function shoot solutions in the undefined domain (see the attachments). Originally Posted by: kilele hey w3b5urf3e, I see on the pic that you want to implement Brent, what about the BDQRF method mentioned on your Bisection testings file? they state that BDQRF is better than Brent
I've seen the BDQRF pseudocode, I think that could be implemented in the next plugin relase, as well as the Zhengqiu Zhang Improvement to the Brent’s Methodregards, w3b5urf3r Edited by user 18 September 2012 01:32:07(UTC)
| Reason: Not specified File Attachment(s): eval.sm (6kb) downloaded 50 time(s). Davide Carpi attached the following image(s): |
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects |
1 user thanked Davide Carpi for this useful post.
|
|