File:NewtonHook.f90: Difference between revisions

From openpipeflow.org
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 6: Line 6:


For each iteration, $\vec{x}_{i+1} = \vec{x}_i + \vec{\delta x}$,  
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{F}(\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 linear problem \[\left.\frac{\vec{dF}}{\vec{dx}}\right|_{\vec{x}_i}\,\vec{\delta x}=-\vec{F}(\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}$, where $A$ is an $n\times n$ matrix, and is solved using the Krylov-subspace method, GMRES(m).  See [[File:GMRESm.f90]].


== The code ==
== The code ==

Revision as of 06:00, 13 December 2016

$ \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}$ and $\vec{F}$ are $n$-vectors, 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{F}(\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}$, where $A$ is an $n\times n$ matrix, 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/TimeDimensionsUserComment
current04: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 ...