# [petsc-dev] How to implement the damped Newton method

Matthew Knepley knepley at gmail.com
Sat Feb 7 08:52:53 CST 2015

```On Sat, Feb 7, 2015 at 2:39 AM, Lulu Liu <lulu.liu at kaust.edu.sa> wrote:

> X is the current approximate solution, Y is the Newton direction
>
> Step 1. the unknown X=[phi,omega,S], the third component S in [0,1].
> Hence, we firstly compute a multiplier alpha such that
>
> X1= X-alpha*Y, and the component S of X1 is still in [0,1].
> In step1, we need access the component S to calculate multiplier.
>
> Step 2. Let the damping factor damp=1;
>
> for n=1:N
>
>     lambda=alpha*damp;
>     X1=X-lambda*Y;
>
>      Solve J(X1)Y1 = F(X1);
>
>      if ||Y1||<||Y||
>            break;
>       else
>             damp = damp/2;
>        end
> endfor
>
> the norm || || is weighted norm, and we need access each component and
> compute some weights based on each component.
>

This is just a line search, so first it should be implemented as a
SNESLineSearch. Second, you should really
try the new nleqerr line search that Patrick Farrell just implemented
Third, if that weight norm is important, I think you just use that norm in
nleqerr.

Thanks,

Matt

> How to implement the damped Newton method above? Is it a easier way to do
> it?
>
> Thanks!
>
>
>
> ------------------------------
> This message and its contents, including attachments are intended solely
> for the original recipient. If you are not the intended recipient or have
> received this message in error, please notify me immediately and delete
> this message from your computer system. Any unauthorized use or
> distribution is prohibited. Please consider the environment before printing
> this email.

--
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their