File:NewtonHook.f90
NewtonHook.f90 (file size: 6 KB, MIME type: text/plain)
$ \renewcommand{\vec}[1]{ {\bf #1} } \newcommand{\bnabla}{ \vec{\nabla} } \newcommand{\Rey}{Re} \def\vechat#1{ \hat{ \vec{#1} } } \def\mat#1{#1} $
The method
Implements the Newton-Raphson-Krylov method for solving \[\vec{F}(\vec{x})=\vec{0},\] where $\vec{x}$ is an $n$-vector, using a Hookstep-Trust-region approach.
For each iteration, $\vec{x}_{i+1} = \vec{x}_i + \vec{\delta x}$, the linear problem \[\left.\frac{\vec{dF}}{\vec{dx}}\right|_{\vec{x}_i}\vec{\delta x}=-\vec{x}_i \] is solved for the step $\vec{\delta x}$ subject to the condition that it be smaller than some magnitude $\delta$, where $\delta$ is the size of the trust region. This problem is in the form $A\vec{x}=\vec{b}$, and is solved using the Krylov-subspace method, GMRES(m). See File:GMRESm.f90.
The code
To download, click the link above.
new_x(:) and new_fx(:) need to be allocated the dimension $n$, and new_x(:) assigned the initial guess, prior to calling the subroutine newtonhook(...). The vector new_x(:) is updated with improved vectors (smaller new_f(:)) as the calculation proceeds.
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Dimensions | User | Comment | |
---|---|---|---|---|
current | 04:50, 26 June 2019 | (6 KB) | Apwillis (talk | contribs) | Minor edits in comments only. |
05:32, 13 December 2016 | (6 KB) | Apwillis (talk | contribs) | == The method == Implements the Newton-Raphson method for solving \[\vec{F}(\vec{x})=\vec{0}\] with a Hookstep-Trust-region approach. At each iteration, the linear problem for the step in $\vec{x}$ is solved subject to the condition that the step be ... |
You cannot overwrite this file.
File usage
The following 4 pages use this file: