Zeros of $f:R^2 \rightarrow R$ with Newton-Raphson?

52 Views Asked by At

I would like to find zeros of $f:R^2\rightarrow R$ applying the Newton-Raphson method but I got stuck in solving the linear approximation equation for $\textbf{x}$.

Let $\textbf{x}\equiv(x,y)$ and $\textbf{a}\equiv(x_0,y_0)$ denote respectively our variable vector and a starting point in the neighborhood of the solution.

Taking a linear approximaton of $f$ around $\textbf{a}$ we get:

$$ f(\textbf{x}) = f(\textbf{a})+\nabla^tf(\textbf{a})(\textbf{x}-\textbf{a}) $$

Doing the algebra and setting $f(\textbf{x})=0$ we get:

$$ \nabla^tf(\textbf{a})\textbf{x}=\nabla^tf(\textbf{a})\textbf{a}-f(\textbf{a}) $$

which don't know how to solve for $\textbf{x}$.

It seems to me that the problem does not arise when $f$ is a vector-valued function, eg. $\textbf{f}:R^n\rightarrow R^n$ because $\nabla \textbf{f}(\textbf{a})=J(\textbf{a})$ is the jacobian matrix in $\textbf{a}$ for which $J^{-1}$ may exists.

Is there something that i'm missing?

2

There are 2 best solutions below

0
On BEST ANSWER

The gradient of $f$ at $\mathbf a_0$ points in the direction of greatest increase of $f$, and its length is the slope of $f$ in that direction.

So if $f(\mathbf a_0)$ is positive, we want to go in the opposite of that direction (if $f(\mathbf a_0)$ is negative we want to go in the direction of the gradient). And the distance we want to move is $\frac{f(\mathbf a_0)}{\|\nabla^t f(\mathbf a_0)\|}$. This yields $$ \mathbf a_1=\mathbf a_0-\frac{f(\mathbf a_0)}{\|\nabla^tf(\mathbf a_0)\|}\cdot\frac{\nabla^tf(\mathbf a_0)}{\|\nabla^tf(\mathbf a_0)\|} $$

0
On

Beware that the equation

$$f(\mathbf x)=0$$ describes an implicit curve and has infinitely many solutions. Depending on your application, you may consider adding a second condition such as $g(\mathbf x)=0$ (which makes it a vector problem with a Jacobian and a discrete number of solutions), or finding the closest solution to your starting point (this will involve the Hessian of the function), or tracing the whole curve by gridding or other methods.