Class NewtonFixed¶
Defined in File NewtonFixed.m
Class Documentation¶
-
class NewtonFixed : public handle¶
-
Class container for a dumped Newton’s method with affine invariant step.
Solution Algorithm:
Given a zeros of a vectorial function problem of the form \( \mathbf{F} (\mathbf{x}) = \mathbf{0} \), where \( \mathbf{F}: \mathbb{R}^n \rightarrow \mathbb{R}^n \), then the Newton’s method is defined as:
\[ \mathbf{JF}(\mathbf{x}_k)\mathbf{h} = -\mathbf{F}(\mathbf{x}_k). \]The dumped step is defined as:
\[ \mathbf{x}_{k+1} = \mathbf{x}_k + \alpha_k \mathbf{h} \]where \( \alpha_k \) is a dumping coefficient that satisfies:
\[ \left\| \mathbf{JF}(\mathbf{x}_k)^{-1} \mathbf{F}(\mathbf{x}_{k+1}) \right\| \leq \left(1 - \dfrac{\alpha_k}{2}\right) \left\| \mathbf{JF}(\mathbf{x}_k)^{-1} \mathbf{F}(\mathbf{x}_k) \right\| = \left(1 - \dfrac{\alpha_k}{2} \right) \left\| \mathbf{h} \right\|. \]Note:
For more details on the Newton’s method with affine invariant step refer to: https://www.zib.de/deuflhard/research/algorithm/ainewton.en.html.
Public Functions
-
function NewtonFixed()¶
-
Newton’s solver class constructor.
- Returns
-
The Newton’s solver object.
-
function set_tolerance(t_tolerance)¶
-
Set algorithm tolerance.
- Parameters
-
t_tolerance – The algorithm tolerance.
-
function get_tolerance()¶
-
Get algorithm tolerance.
- Returns
-
The algorithm tolerance.
-
function set_max_iterations(t_max_iterations)¶
-
Set maximum allowed algorithm iterations.
- Parameters
-
t_max_iterations – The maximum allowed algorithm iterations.
-
function get_max_iterations()¶
-
Set maximum allowed algorithm iterations.
- Returns
-
The maximum allowed algorithm iterations.
-
function enable_verbose()¶
-
Enable verbose mode.
- Parameters
-
t_alpha – The relaxation factor.
-
function disable_verbose()¶
-
Disable verbose mode.
- Parameters
-
t_alpha – The relaxation factor.
-
function out_iterations()¶
-
Get algorithm iterations.
- Returns
-
The algorithm iterations.
-
function out_function_evaluations()¶
-
Set function evaluations.
- Returns
-
The function evaluations.
-
function out_jacobian_evaluations()¶
-
Set Jacobian evaluations.
- Returns
-
The Jacobian evaluations.
-
function out_residuals()¶
-
Get function evaluations.
- Returns
-
The function evaluations.
-
function out_converged()¶
-
Get convergence boolean value.
- Returns
-
The convergence boolean value.
-
function solve_handle(t_function_handle, t_jacobian_handle, x_ini)¶
-
Solve non-linear system of equations \( \mathbf{F}(\mathbf{x}) = \mathbf{0} \)
- Parameters
-
t_function_handle – The function handle.
t_jacobian_handle – The Jacobian handle.
x_ini – The initial guess vector \( \mathbf{x} \).
- Returns
-
The solution vector \( \mathbf{x} \).
-
function reset()¶
-
Reset solver internal counter and variables.
- Parameters
-
t_function_handle – The function handle.
-
function eval_function(x)¶
-
Perform function \( \mathbf{F}(\mathbf{x}) \) evaluation.
- Parameters
-
x – The input vector \( \mathbf{x} \).
- Returns
-
The function value \( \mathbf{F}(\mathbf{x}) \).
-
function eval_jacobian(x)¶
-
Perform function \( \mathbf{JF}(\mathbf{x}) \) evaluation.
- Parameters
-
x – The input vector \( \mathbf{x} \).
- Returns
-
The Jacobian value \( \mathbf{JF}(\mathbf{x}) \).
-
function solve(x_ini)¶
-
Solve non-linear system of equations \( \mathbf{F} (\mathbf{x}) = \mathbf{0} \).
- Parameters
-
x_ini – The initial guess for the vector \( \mathbf{x} \).
- Returns
-
The solution \( \mathbf{x} \) and the output flag: \( 0 \) = success, \( 1 \) = failed because of bad initial point, \( 2 \) = failed because of bad dumping (step got too short).
-
function NewtonFixed()¶