CppNoddy  0.92
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
CppNoddy::Example::Lorenz_equations Class Reference

Define the Lorenz equations by inheriting Equation base class. More...

Inheritance diagram for CppNoddy::Example::Lorenz_equations:
CppNoddy::Equation< double > CppNoddy::Residual_with_coords< _Type, _Xtype > CppNoddy::Residual< _Type >

Public Member Functions

 Lorenz_equations ()
 Construct a 3rd order ODE. More...
 
void residual_fn (const DenseVector< double > &z, DenseVector< double > &f) const
 We implement the equation as 3 first-order ODEs. More...
 
- Public Member Functions inherited from CppNoddy::Equation< double >
 Equation (const unsigned &order)
 Constructor for equation class. More...
 
virtual ~Equation ()
 An empty destructor, virtual since we have virtual methods. More...
 
- Public Member Functions inherited from CppNoddy::Residual_with_coords< _Type, _Xtype >
 Residual_with_coords (const unsigned &order, const unsigned &ncoords)
 Constructor for a 'square' residual object that is, N residuals for N unknowns. More...
 
 Residual_with_coords (const unsigned &order, const unsigned &nvars, const unsigned &ncoords)
 Constructor for a 'non-square' residual object that is, there are less residual constraints than unknowns. More...
 
virtual ~Residual_with_coords ()
 An empty destructor. More...
 
_Xtype & coord (const unsigned &i)
 General handle access to the coordinates. More...
 
const _Xtype & coord (const unsigned &i) const
 General handle access to the coordinates. More...
 
- Public Member Functions inherited from CppNoddy::Residual< _Type >
 Residual (const unsigned &order)
 Constructor for a 'square' residual object that is, N residuals for N unknowns. More...
 
 Residual (const unsigned &order, const unsigned &nvars)
 Constructor for a 'non-square' residual object that is, there are less residual constraints than unknowns. More...
 
virtual ~Residual ()
 An empty destructor, virtual since we have virtual methods. More...
 
void update (const DenseVector< _Type > &state)
 Update the Residual object for the current set of state variables. More...
 
const DenseVector< _Type > & residual () const
 Return a handle to the residuals corresponding to the last update state. More...
 
const DenseMatrix< _Type > & jacobian () const
 Retrun a handle to the Jacobian of the residual corresponding to the last update state. More...
 
_Type & delta ()
 
const _Type & delta () const
 
unsigned get_order () const
 Get the order of the residual vector. More...
 
unsigned get_number_of_vars () const
 Get the number of variables that this residual condition is defined for. More...
 
virtual void residual_fn (const DenseVector< _Type > &state, DenseVector< _Type > &f) const
 A blank virtual residual function method. More...
 

Public Attributes

double a
 The usual 3 parameters of the Lorenz eqns. More...
 
double b
 
double c
 

Additional Inherited Members

- Protected Member Functions inherited from CppNoddy::Residual< _Type >
virtual void jacobian (const DenseVector< _Type > &state, DenseMatrix< _Type > &jac) const
 Because the residual evaluation at the current state is assumed to have already been done by the 'update' method, this routine is protected. More...
 
- Protected Attributes inherited from CppNoddy::Residual_with_coords< _Type, _Xtype >
std::vector< _Xtype > coords
 The coordinates stored for this residual. More...
 
- Protected Attributes inherited from CppNoddy::Residual< _Type >
DenseMatrix< _Type > JAC_AT_LAST_STATE
 Jacobian for the last state vector. More...
 
DenseVector< _Type > FN_AT_LAST_STATE
 Residual for the last state vector. More...
 
DenseVector< _Type > LAST_STATE
 The last state vector. More...
 
_Type DELTA
 A default step for FD computation of the Jacobian. More...
 
unsigned ORDER_OF_SYSTEM
 The order of the system of equations. More...
 
unsigned NUMBER_OF_VARS
 The number of elements in the state vector. More...
 

Detailed Description

Define the Lorenz equations by inheriting Equation base class.

Definition at line 17 of file IVPLorenz.cpp.

Constructor & Destructor Documentation

◆ Lorenz_equations()

CppNoddy::Example::Lorenz_equations::Lorenz_equations ( )
inline

Construct a 3rd order ODE.

Definition at line 22 of file IVPLorenz.cpp.

22: Equation<double>( 3 ) {};
An equation object base class used in the BVP/IVP classes.
Definition: Equation.h:22

Member Function Documentation

◆ residual_fn()

void CppNoddy::Example::Lorenz_equations::residual_fn ( const DenseVector< double > &  z,
DenseVector< double > &  f 
) const
inline

We implement the equation as 3 first-order ODEs.

Definition at line 25 of file IVPLorenz.cpp.

26 {
27 f[ 0 ] = a * ( z[ 1 ] - z[ 0 ] );
28 f[ 1 ] = z[ 0 ] * ( b - z[ 2 ] ) - z[ 1 ];
29 f[ 2 ] = -c * z[ 2 ] + z[ 0 ] * z[ 1 ];
30 }
@ f
Definition: BVPBerman.cpp:15
double a
The usual 3 parameters of the Lorenz eqns.
Definition: IVPLorenz.cpp:33

References a, b, c, f, and CppNoddy::Example::z().

Member Data Documentation

◆ a

double CppNoddy::Example::Lorenz_equations::a

The usual 3 parameters of the Lorenz eqns.

Definition at line 33 of file IVPLorenz.cpp.

Referenced by main(), and residual_fn().

◆ b

double CppNoddy::Example::Lorenz_equations::b

Definition at line 33 of file IVPLorenz.cpp.

Referenced by main(), and residual_fn().

◆ c

double CppNoddy::Example::Lorenz_equations::c

Definition at line 33 of file IVPLorenz.cpp.

Referenced by main(), and residual_fn().


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

© 2012

R.E. Hewitt