Welcome Guest! To enable all features please Login or Register.

### Notification

Error

 14 Pages<1234>»
 Previous Topic Next Topic
 kilele #21 Posted : 07 September 2012 22:20:39(UTC) Rank: Advanced MemberGroups: Registered Joined: 30/03/2011(UTC)Posts: 393Was thanked: 132 time(s) in 113 post(s) 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
 kilele #22 Posted : 08 September 2012 00:12:51(UTC) Rank: Advanced MemberGroups: Registered Joined: 30/03/2011(UTC)Posts: 393Was thanked: 132 time(s) in 113 post(s) Originally Posted by: omorr I also agree about the mentioned observation on the 20-page of your reference. This is up to the user. A simple advice is to rearrange the function f(x)= 0 by avoiding division of terms when denominator can be close to zero. On that paper (20-page and following) the author also mentions "homotopy continuation methods" to get a good initial guess value. Since initial guess values on multidimensional non-linear systems can be difficult to find and a bad initial guess may cause divergence, maybe it'd be useful to make some initialization function for this golden plugin that w3b5urf3r is preparing Some simple continuation method would suffice for a good initial value.
 omorr #23 Posted : 08 September 2012 17:28:39(UTC) Rank: AdministrationGroups: Registered, Advanced MemberJoined: 23/06/2009(UTC)Posts: 1,740Was thanked: 318 time(s) in 268 post(s) Hello w3b5urf3rOriginally Posted by: w3b5urf3r_reloaded ...about eval(), you cannot use it where there are undefined variables because the function "force" the numeric evalutation.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 wayf(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 hereBisection(f(x#),-9,0,10^{-5},50)=#@#If we remove eval(), everything is finef(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,RadovanEdited by user 08 September 2012 17:59:00(UTC)  | Reason: Not specified When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
 Davide Carpi #24 Posted : 08 September 2012 19:54:27(UTC) Rank: Advanced MemberGroups: Registered, Advanced MemberJoined: 13/01/2012(UTC)Posts: 2,668Location: ItalyWas thanked: 1352 time(s) in 886 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 w3b5urf3rOriginally 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 wayf(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 hereBisection(f(x#),-9,0,10^{-5},50)=#@#If we remove eval(), everything is finef(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,Radovandoing 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,w3b5urf3rEdited by user 18 September 2012 01:32:07(UTC)  | Reason: Not specifiedFile Attachment(s): Primer65aa_debug.sm (56kb) downloaded 50 time(s). eval.sm (6kb) downloaded 49 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. on 08/09/2012(UTC)
 omorr #25 Posted : 08 September 2012 21:56:32(UTC) Rank: AdministrationGroups: Registered, Advanced MemberJoined: 23/06/2009(UTC)Posts: 1,740Was thanked: 318 time(s) in 268 post(s) Hello w3b5urf3r,Thank you for your explanation and the updated plugin ancing: Best Wishes,Radovan When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
 omorr #26 Posted : 09 September 2012 15:30:33(UTC) Rank: AdministrationGroups: Registered, Advanced MemberJoined: 23/06/2009(UTC)Posts: 1,740Was thanked: 318 time(s) in 268 post(s) Hello,Here is another file attached. I was struggling with it and it suits me quite well for my classes. As this plugin is about nonlinear solvers, I used in my file a simple Levenberg-Marqurdt based procedure to obtain curve fitting nonlinear in the unknown parameters. It is quite unsophisticated, I have to play with dumping parameters - but it is solving my problem.As one of my files motivated this plugin, I really hope that this one will do the same as well I would not mind some derivation free optimization (minimization) functions in the plugin like BFGS or Nelder-Mead . Regards,RadovanEdited by user 09 September 2012 16:04:47(UTC)  | Reason: Not specifiedFile Attachment(s): NLMinimization-3.sm (80kb) downloaded 80 time(s). When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
 Davide Carpi #27 Posted : 10 September 2012 21:15:57(UTC) Rank: Advanced MemberGroups: Registered, Advanced MemberJoined: 13/01/2012(UTC)Posts: 2,668Location: ItalyWas thanked: 1352 time(s) in 886 post(s) Plugin updated.Added the Newton-Raphson method for Nonlinear systems of equations and the Bisected Direct Quadratic Regula Falsi method.regards,w3b5urf3r 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. on 10/09/2012(UTC)
 kilele #28 Posted : 10 September 2012 22:52:45(UTC) Rank: Advanced MemberGroups: Registered Joined: 30/03/2011(UTC)Posts: 393Was thanked: 132 time(s) in 113 post(s) Originally Posted by: omorr I would not mind some derivation free optimization (minimization) functions in the plugin like BFGS or Nelder-Mead . There you have more matlab code by Kelley for Nelder-Mead and BFGS( see bfgswopt.m ; nelder.m ; simpgrad.m ) As for "homotopy continuation methods" I've found this mathematica code.However I don't know if this method is interesting or too difficult to code, I read that works very well for polynomial systems as well.EDIT:More fortran and pseudocode about continuation methods on this pdfEdited by user 11 September 2012 01:13:43(UTC)  | Reason: Not specified 2 users thanked kilele for this useful post. on 10/09/2012(UTC),  on 11/09/2012(UTC)
 omorr #29 Posted : 10 September 2012 23:05:09(UTC) Rank: AdministrationGroups: Registered, Advanced MemberJoined: 23/06/2009(UTC)Posts: 1,740Was thanked: 318 time(s) in 268 post(s) Hello w3b5urf3r,Do not have anything to say, but keep up this way I hope you would not mind if I suggest you to change your convergence criterion in the root finding functions.The convergence criterion at the moment is that the absolute function value in some iteration to be smaller than epsilonabs(f(P3))
 omorr #30 Posted : 10 September 2012 23:08:45(UTC) Rank: AdministrationGroups: Registered, Advanced MemberJoined: 23/06/2009(UTC)Posts: 1,740Was thanked: 318 time(s) in 268 post(s) Originally Posted by: kilele Originally Posted by: omorr I would not mind some derivation free optimization (minimization) functions in the plugin like BFGS or Nelder-Mead . There you have more matlab code by Kelley for Nelder-Mead and BFGS( see bfgswopt.m ; nelder.m ; simpgrad.m ) As for "homotopy continuation methods" I've found this mathematica code.However I don't know if this method is interesting or too difficult to code, I read that works very well for polynomial systems as well.Thank you, but the second link is broken (mathematica code). Could you check it out.Regards,Radovan When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
 Davide Carpi #31 Posted : 11 September 2012 00:24:26(UTC) Rank: Advanced MemberGroups: Registered, Advanced MemberJoined: 13/01/2012(UTC)Posts: 2,668Location: ItalyWas thanked: 1352 time(s) in 886 post(s) Originally Posted by: w3b5urf3r_reloaded Plugin updated.Added the Newton-Raphson method for Nonlinear systems of equations and the Bisected Direct Quadratic Regula Falsi method.regards,w3b5urf3r I've forgot to swap the indices of the jacobian derivatives after the debugging, plugin reupdated...Originally Posted by: omorr Hello w3b5urf3r,Do not have anything to say, but keep up this way I hope you would not mind if I suggest you to change your convergence criterion in the root finding functions.The convergence criterion at the moment is that the absolute function value in some iteration to be smaller than epsilonabs(f(P3))
 kilele #32 Posted : 11 September 2012 01:15:46(UTC) Rank: Advanced MemberGroups: Registered Joined: 30/03/2011(UTC)Posts: 393Was thanked: 132 time(s) in 113 post(s) Originally Posted by: omorr the second link is broken (mathematica code). Could you check it out.Link corrected and added another pdf resource
 omorr #33 Posted : 11 September 2012 08:19:16(UTC) Rank: AdministrationGroups: Registered, Advanced MemberJoined: 23/06/2009(UTC)Posts: 1,740Was thanked: 318 time(s) in 268 post(s) Originally Posted by: w3b5urf3r_reloaded I know, but I'm trying to pay attention to the management of functions with unit of measurement... although I have not advertised this behavior, actually all solvers shown below works also with units. Introducing new covengence criteria preserving this aspect implies a more advanced error handling (and developping time)...You are right and I respect that Regards,Radovan When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
 Davide Carpi #34 Posted : 13 September 2012 01:35:32(UTC) Rank: Advanced MemberGroups: Registered, Advanced MemberJoined: 13/01/2012(UTC)Posts: 2,668Location: ItalyWas thanked: 1352 time(s) in 886 post(s) Originally Posted by: kilele Originally Posted by: omorr As for "homotopy continuation methods" I've found this mathematica code.However I don't know if this method is interesting or too difficult to code, I read that works very well for polynomial systems as well.EDIT:More fortran and pseudocode about continuation methods on this pdflittle experiments in SMath with Homotopy... it's a very interesting and powerful tool regards,w3b5urf3rDavide 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. on 13/09/2012(UTC)
 omorr #35 Posted : 13 September 2012 15:51:55(UTC) Rank: AdministrationGroups: Registered, Advanced MemberJoined: 23/06/2009(UTC)Posts: 1,740Was thanked: 318 time(s) in 268 post(s) Hello,Some more testings and surprises. I attached one of my files and tried all the nonlinear solvers including the SMath solve, roots() and all of them made by w3b5urf3r up to now I attached a part of my file (primer63w.sm). Here is another situation regarding SMath optimization. The first picture is when the Symbolic Optimization of the function is applied. Everything seems to be fine (although two functions failed - roots(),NewtonRaphosn()). Strangely, when the Optimization is none, numeric - all of them failed and just look at the second picture - now the result of f(1000) is a vector and not scalar as before. This is due to the situation where we have the product of two vector - the result should be a scalar (scalar product of two vectors). When we change some Optimization in the file we can even get the result as in the third picture - solve() gave the result but the other two solvers have different results than solve(). Something must be strange here because other solvers failed. The main problem here is that SMath sometimes returns scalar and sometimes vector depending on optimization applied (fourth and fifth picture on the next post). I think I made some mistakes but can not figure out what happened here. Could someone take a look at this please.Regards,RadovanEdited by user 13 September 2012 18:51:49(UTC)  | Reason: Not specifiedFile Attachment(s): Primer63w.sm (34kb) downloaded 46 time(s).omorr attached the following image(s): When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
 omorr #36 Posted : 13 September 2012 15:57:18(UTC) Rank: AdministrationGroups: Registered, Advanced MemberJoined: 23/06/2009(UTC)Posts: 1,740Was thanked: 318 time(s) in 268 post(s) Continuing from the post above with two pictures - the result is scalar or vector of scalar product of two vectors - depending on optimization. Do not know why?.Edited by user 13 September 2012 16:05:44(UTC)  | Reason: Not specifiedomorr attached the following image(s): When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
 Davide Carpi #37 Posted : 13 September 2012 21:12:44(UTC) Rank: Advanced MemberGroups: Registered, Advanced MemberJoined: 13/01/2012(UTC)Posts: 2,668Location: ItalyWas thanked: 1352 time(s) in 886 post(s) Hi omorr seems there are many little issues (see the attachment)...if you use a line in the definition of funh(T), the behavior changes further regards,w3b5urf3rFile Attachment(s): Primer63w_debug.sm (103kb) downloaded 47 time(s). If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
 omorr #38 Posted : 13 September 2012 21:42:58(UTC) Rank: AdministrationGroups: Registered, Advanced MemberJoined: 23/06/2009(UTC)Posts: 1,740Was thanked: 318 time(s) in 268 post(s) Hello w3b5urf3r,Thank you for checking this out . I can join you with "don't know why" statements about this. I am not sure but I think that has something to this Transpose-functions-bug I hope that Andrey will have some time to check this out as well.Regards,RadovanEDIT: I might be completely wrong here but I think if eval() could be used in funh():=eval(...) many of the numerical problems might be overcome.Edited by user 14 September 2012 10:57:57(UTC)  | Reason: Not specified When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
 Davide Carpi #39 Posted : 14 September 2012 13:25:16(UTC) Rank: Advanced MemberGroups: Registered, Advanced MemberJoined: 13/01/2012(UTC)Posts: 2,668Location: ItalyWas thanked: 1352 time(s) in 886 post(s) Plugin updated.added HRE(...) and HRE.B(...) (Homotopy root estimation using NewtonRaphson and Broyden, respectively);fixed issues of internal variable parser with differentiations.EDIT: Plugin reuploaded with support for unassigned variables named with apostrophe (f.e. x')regards,w3bsurf3rEdited by user 15 September 2012 00:19:20(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 1 user thanked Davide Carpi for this useful post. on 14/09/2012(UTC)
 omorr #40 Posted : 14 September 2012 23:07:35(UTC) Rank: AdministrationGroups: Registered, Advanced MemberJoined: 23/06/2009(UTC)Posts: 1,740Was thanked: 318 time(s) in 268 post(s) Hello w3bsurf3r,Let's go again with testing I attached a file where all solvers failed. Do not understand why. Could you take a look at it please.Regards,Radovan File Attachment(s): Primer43w.sm (34kb) downloaded 45 time(s).omorr attached the following image(s): When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
 Users browsing this topic
 14 Pages<1234>»
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.