Rank: Administration Groups: Registered, Advanced Member Joined: 23/06/2009(UTC) Posts: 1,740 Was thanked: 318 time(s) in 268 post(s)
|
Hello Gilberto, Originally Posted by: gurro After I posted my earlier message highlighting the use of "fNewtonm", I found your posting about using "roots", and I'm convinced it's a simpler approach. I'm winding down the use of "fNewtonm" in my classes and replacing it with "roots". At the same time we posted here, there were few additional nonlinear solvers posted here Non-Linear solvers . You might find them useful as I do By the way, If you want to use your fNewtonm() function without the mentioned restriction about the vector of variables names (must be "x" ), here is a bit changed version. There is one parameter excluded (vector of unknows). fNewtonm(f(x#),x0,ε,Nmax):line(fJ(f(x#),x#):line(n:length(x#),for(i,range(1,n),for(j,range(1,n),el(J,i,j)iff(el(f(x#),i),el(x#,j)))),J,3,1),k:0,xG:x0,while(((k≤Nmax)&(NormE(f(xG))>ε)),line(JJ:eval(fJ(f(x#),xG)),JJI:eval(invert(JJ)),fxG:eval(f(xG)),DxG:eval(JJI*fxG),xGp1:eval(xG-DxG),k:k+1,xG:xGp1,7,1)),mat(xG,k,2,1),5,1)F(X):mat(el(X,1)+el(X,2)+el(X,3)-6,el(X,1)*el(X,2)*el(X,3)-6,el(X,1)^2+el(X,2)^2+el(X,3)^2-14,3,1)fNewtonm(F(x#),x0,ε,Nmax)=mat(mat(2,1,3,3,1),5,2,1)Regards, Radovan Edited by user 09 September 2012 17:29:40(UTC)
| Reason: Not specified |
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!" |