code for 2 dimesional newtons method.


by iceblits
Tags: code, dimesional, method, newtons
iceblits
iceblits is offline
#1
Mar5-12, 08:34 AM
P: 113
Hey,
I'm trying to figure out how to do newtons method in 2 dimensions. That is, I want it to take in an input of my initial matrix {x0,y0} and then follow the algorithm to find the solution to f1(x,y)=0, f2(x,y)=0. The algorithm is {x1,y1}={x0,y0}-A^-1*F{x0,y0}
where A is the matrix of mixed partials and F{x,y} is the matrix of {f1,f2} evaluated at {x0,y0}.

I'm new at mathematica so I'm having more trouble on the coding side than the logic side. I was able to figure out how to do the code for single variable newton's method, but I don't know how to let it take in a matrix as an input. I know that matrices are written with brackets, but I don't know how to let a function be a matrix. Like in the one dimensional case I had:

g[x_] := x - f[x]/(D[f[t], t] /. t -> x)

but I cant get x to be a general matrix in the 2d example.

Any help at all with the coding or anything would be awesome
Phys.Org News Partner Science news on Phys.org
Better thermal-imaging lens from waste sulfur
Hackathon team's GoogolPlex gives Siri extra powers
Bright points in Sun's atmosphere mark patterns deep in its interior
Bill Simpson
Bill Simpson is offline
#2
Mar5-12, 12:18 PM
P: 972
Remembering the gradient from multivariable calculus might get you started.


Register to reply

Related Discussions
Newtons method? Calculus & Beyond Homework 2
Newtons Method - A little help Calculus & Beyond Homework 3
newtons method. Calculus 2
newtons method Calculus & Beyond Homework 3
newtons method Calculus 5