Code for 2 dimesional Newtons method.

Click For Summary
SUMMARY

The discussion focuses on implementing Newton's method for two dimensions using Mathematica. The user seeks assistance in coding the algorithm, which involves an initial matrix input {x0,y0} and the equation {x1,y1}={x0,y0}-A^-1*F{x0,y0}, where A represents the matrix of mixed partial derivatives and F{x,y} is the function vector {f1,f2}. The user has prior experience with single-variable Newton's method but struggles with matrix inputs and function definitions in Mathematica.

PREREQUISITES
  • Understanding of Newton's method for multivariable functions
  • Familiarity with Mathematica programming language
  • Knowledge of matrix operations, specifically matrix inversion
  • Concept of mixed partial derivatives in calculus
NEXT STEPS
  • Learn how to define functions that accept matrix inputs in Mathematica
  • Study the implementation of matrix inversion in Mathematica
  • Explore examples of multivariable Newton's method in computational mathematics
  • Review the use of gradient vectors in optimization problems
USEFUL FOR

Mathematics students, software developers working with numerical methods, and anyone interested in implementing optimization algorithms in Mathematica.

iceblits
Messages
111
Reaction score
0
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 can't get x to be a general matrix in the 2d example.

Any help at all with the coding or anything would be awesome
 
Physics news on Phys.org
Remembering the gradient from multivariable calculus might get you started.
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 16 ·
Replies
16
Views
4K
  • · Replies 36 ·
2
Replies
36
Views
6K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K