libode
Easy to compile, fast ODE integrators as C++ classes
Loading...
Searching...
No Matches
ode::OdeNewton Class Referenceabstract

Newton's method for nonlinear systems of equations. More...

#include <ode_newton.h>

Inheritance diagram for ode::OdeNewton:
ode::OdeNewtonBridge< OdeBackwardEuler > ode::OdeNewtonBridge< OdeGauss6 > ode::OdeNewtonBridge< OdeGeng5 > ode::OdeNewtonBridge< OdeLobattoIIIC6 > ode::OdeNewtonBridge< OdeRadauIIA5 > ode::OdeNewtonBridge< OdeSDIRK43 > ode::OdeNewtonBridge< Integrator > ode::OdeNewtonIRK< OdeBackwardEuler > ode::OdeNewtonIRK< OdeGauss6 > ode::OdeNewtonIRK< OdeGeng5 > ode::OdeNewtonIRK< OdeLobattoIIIC6 > ode::OdeNewtonIRK< OdeRadauIIA5 > ode::OdeNewtonSDIRK< OdeSDIRK43 > ode::OdeNewtonIRK< Integrator > ode::OdeNewtonSDIRK< Integrator >

Public Member Functions

 OdeNewton (unsigned long n)
 constructs
 
virtual ~OdeNewton ()
 destructs
 
unsigned long get_n ()
 gets the size of the system
 
double get_tol_Newton ()
 gets the L infinity tolerance
 
unsigned long get_iter_Newton ()
 gets iteration counter
 
int get_iJLU ()
 gets the LU decomposition interval
 
unsigned long get_nJLU ()
 gets the LU decomposition counter
 
unsigned long get_n_solve_LU ()
 gets the LU solve counter
 
bool get_modified ()
 gets whether modified Newtion's is being used
 
bool get_ignore_JLU ()
 gets whether no LU decompositions should be done
 
void set_tol_Newton (double tol_Newton)
 sets the L infinity tolerance
 
void set_iter_Newton (unsigned long iter_Newton)
 sets the iteration counter
 
void set_iJLU (int iJLU)
 sets the LU decomposition interval
 
void set_modified (bool modified)
 sets whether modified Newtion's is being used
 
void set_ignore_JLU (bool ignore_JLU)
 sets whether no LU decompositions should be done
 
int solve_Newton (double *x)
 Solve the system of equations.
 

Protected Member Functions

virtual void f_Newton (double *x, double *f)=0
 evaluates the function being zeroed
 
virtual void J_Newton (double *x, double **J)=0
 evaluates the Jacobian matrix of the function being zeroed
 

Detailed Description

Newton's method for nonlinear systems of equations.

This class implements Newton's method for nonlinear systems of equations. The virtual functions F_Newton and Jac_Newton allow a derived class to implement the system of equations and its Jacobian matrix.

Definition at line 18 of file ode_newton.h.

Constructor & Destructor Documentation

◆ OdeNewton()

ode::OdeNewton::OdeNewton ( unsigned long n)

constructs

Parameters
[in]nsize of system

Definition at line 7 of file ode_newton.cc.

◆ ~OdeNewton()

ode::OdeNewton::~OdeNewton ( )
virtual

destructs

Definition at line 38 of file ode_newton.cc.

Member Function Documentation

◆ f_Newton()

virtual void ode::OdeNewton::f_Newton ( double * x,
double * f )
protectedpure virtual

evaluates the function being zeroed

Parameters
[in]xcurrent values of system
[out]fevaluated system of equation

◆ get_ignore_JLU()

bool ode::OdeNewton::get_ignore_JLU ( )
inline

gets whether no LU decompositions should be done

Definition at line 47 of file ode_newton.h.

◆ get_iJLU()

int ode::OdeNewton::get_iJLU ( )
inline

gets the LU decomposition interval

Definition at line 39 of file ode_newton.h.

◆ get_iter_Newton()

unsigned long ode::OdeNewton::get_iter_Newton ( )
inline

gets iteration counter

Definition at line 37 of file ode_newton.h.

◆ get_modified()

bool ode::OdeNewton::get_modified ( )
inline

gets whether modified Newtion's is being used

Definition at line 45 of file ode_newton.h.

◆ get_n()

unsigned long ode::OdeNewton::get_n ( )
inline

gets the size of the system

Definition at line 33 of file ode_newton.h.

◆ get_n_solve_LU()

unsigned long ode::OdeNewton::get_n_solve_LU ( )
inline

gets the LU solve counter

Definition at line 43 of file ode_newton.h.

◆ get_nJLU()

unsigned long ode::OdeNewton::get_nJLU ( )
inline

gets the LU decomposition counter

Definition at line 41 of file ode_newton.h.

◆ get_tol_Newton()

double ode::OdeNewton::get_tol_Newton ( )
inline

gets the L infinity tolerance

Definition at line 35 of file ode_newton.h.

◆ J_Newton()

virtual void ode::OdeNewton::J_Newton ( double * x,
double ** J )
protectedpure virtual

evaluates the Jacobian matrix of the function being zeroed

Parameters
[in]xcurrent values of system
[out]Jevaluated Jacobian of the system

◆ set_ignore_JLU()

void ode::OdeNewton::set_ignore_JLU ( bool ignore_JLU)
inline

sets whether no LU decompositions should be done

Definition at line 58 of file ode_newton.h.

◆ set_iJLU()

void ode::OdeNewton::set_iJLU ( int iJLU)
inline

sets the LU decomposition interval

Definition at line 54 of file ode_newton.h.

◆ set_iter_Newton()

void ode::OdeNewton::set_iter_Newton ( unsigned long iter_Newton)
inline

sets the iteration counter

Definition at line 52 of file ode_newton.h.

◆ set_modified()

void ode::OdeNewton::set_modified ( bool modified)
inline

sets whether modified Newtion's is being used

Definition at line 56 of file ode_newton.h.

◆ set_tol_Newton()

void ode::OdeNewton::set_tol_Newton ( double tol_Newton)
inline

sets the L infinity tolerance

Definition at line 50 of file ode_newton.h.

◆ solve_Newton()

int ode::OdeNewton::solve_Newton ( double * x)

Solve the system of equations.

Solve for a root of the function f_Newton using the jacobian J_Newton, both of which must be implemented in derived classes

Parameters
xinitial guess for the root and final value at root
Returns
success code, which takes values 0. success!
  1. failure...too many iterations
  2. failure...solution contains nan(s)
  3. failure...solution contains inf(s)

Definition at line 84 of file ode_newton.cc.


The documentation for this class was generated from the following files: