Waseem

5 Reputation

0 Badges

0 years, 83 days

MaplePrimes Activity


These are questions asked by Waseem

restart:
NewtonRaphsonSYS:=proc(X,F,X0,TOL,itmax)
local Xn,H,FX,J,i,m,n,Err;
m:=LinearAlgebra[Dimension](Vector(X));
Xn:=Vector(m);
H:=Vector(m);
FX:=Vector(m);
J:=Matrix(m,m);
Xn:=X0;

for n to itmax do
    FX:=eval(F,[seq(X[i]=Xn[i],i=1..m)]);
    J:=evalf(VectorCalculus[Jacobian](F,X=convert(Xn,list)));
H:=-Inverse(J).Vector(FX);
Xn:=Xn+H;

printf("%3d %.8f",n,Xn[1]);
 
for i from 2 to m do;
 printf("%.8f",Xn[i]);

end do;
for i from 1 to m do;
 printf("%.3g",H[i]);

end do;
printf("\n");
if (LinearAlgebra[VectorNorm](H,2)<TOL) then break end if;
end do;
end proc:
F:=[xy-z^2-1,xyz+y^2-x^2-2,e^x+z-e^y-3];
X:=[x,y,z];
X0:= <1,1,1>;
TOL:=0.00000001;
itmax:=10;

      [  2             2    2             x        y    ]
      [-z  + xy - 1, -x  + y  + xyz - 2, e  + z - e  - 3]
                           [x, y, z]
                Vector[column](%id = 4442374402)
                                 -8
                             1 10  
                               10
NewtonRaphsonSYS(X,F,X0,TOL,itmax);

 

Page 1 of 1