Sandals  v0.0.0
A C++ library for ODEs/DAEs integration
Loading...
Searching...
No Matches
Sandals::SemiExplicit< Real, N, M > Class Template Referenceabstract

Class container for the system of semi-explicit ODEs/DAEs. More...

#include <SemiExplicit.hh>

Inherits Sandals::Explicit< Real, N, 0 >.

Public Types

using Pointer = std::shared_ptr<SemiExplicit<Real, N, M>>
using VectorF = typename Explicit<Real, N, M>::VectorF
using MatrixJF = typename Explicit<Real, N, M>::MatrixJF
using MatrixA = typename Explicit<Real, N, M>::MatrixJF
using TensorTA = typename std::vector<MatrixJF>
using VectorB = typename Explicit<Real, N, M>::VectorF
using MatrixJB = typename Explicit<Real, N, M>::MatrixJF
using Type = typename Explicit<Real, N, M>::Type
Public Types inherited from Sandals::Explicit< Real, N, 0 >
using Pointer
using VectorF
using MatrixJF
using Type
Public Types inherited from Sandals::Implicit< Real, N, M >
using Type
using Pointer
using VectorF
using MatrixJF
using VectorH
using MatrixJH

Public Member Functions

 SemiExplicit ()
 SemiExplicit (std::string t_name)
VectorF F (VectorF const &x, VectorF const &x_dot, Real t) const override
MatrixJF JF_x (VectorF const &x, VectorF const &x_dot, Real t) const override
MatrixJF JF_x_dot (VectorF const &x, VectorF const &, Real t) const override
VectorF f (VectorF const &x, Real t) const override
MatrixJF Jf_x (VectorF const &x, VectorF const &x_dot, Real t) const
MatrixJF Jf_x (VectorF const &x, Real t) const override
virtual MatrixA A (VectorF const &x, Real t) const =0
virtual TensorTA TA_x (VectorF const &x, Real t) const =0
virtual VectorB b (VectorF const &x, Real t) const =0
virtual MatrixJB Jb_x (VectorF const &x, Real t) const =0
Public Member Functions inherited from Sandals::Explicit< Real, N, 0 >
VectorF f_reverse (VectorF const &x, Real t) const
MatrixJF Jf_x_reverse (VectorF const &x, Real t) const
VectorF F_reverse (VectorF const &x, VectorF const &x_dot, Real t) const
MatrixJF JF_x_reverse (VectorF const &x, VectorF const &, Real t) const
MatrixJF JF_x_dot_reverse (VectorF const &, VectorF const &, Real) const
Public Member Functions inherited from Sandals::Implicit< Real, N, M >
virtual ~Implicit ()
Type type () const
bool is_implicit () const
bool is_explicit () const
bool is_semiexplicit () const
std::string & name ()
Integer equations_number () const
Integer invariants_number () const
virtual VectorH h (VectorF const &x, Real t) const=0
virtual MatrixJH Jh_x (VectorF const &x, Real t) const=0
virtual bool in_domain (VectorF const &x, Real t) const=0
VectorF F_reverse (VectorF const &x, VectorF const &x_dot, Real t) const
MatrixJF JF_x_reverse (VectorF const &x, VectorF const &x_dot, Real t) const
MatrixJF JF_x_dot_reverse (VectorF const &x, VectorF const &x_dot, Real t) const

Private Attributes

Eigen::FullPivLU< MatrixAm_lu

Additional Inherited Members

Protected Member Functions inherited from Sandals::Explicit< Real, N, 0 >
 Explicit (Type t_type, std::string t_name)
Protected Member Functions inherited from Sandals::Implicit< Real, N, M >
 Implicit (Type t_type, std::string t_name)

Detailed Description

template<typename Real, Integer N, Integer M = 0>
class Sandals::SemiExplicit< Real, N, M >

Class container for the system of semi-explicit ordinary differential equations (ODEs) or differential algebraic equations (DAEs)of the type \( \mathbf{A}(\mathbf{x}, t) \mathbf{x}^{\prime} = \mathbf{b}(\mathbf{x}, t) \), with invariants manifold \( \mathbf{h}( \mathbf{x}, t) = \mathbf{0} \).

Template Parameters
RealThe scalar number type.
NThe dimension of the semi-explicit ODE system.
MThe dimension of the invariants manifold.

Member Typedef Documentation

◆ MatrixA

template<typename Real, Integer N, Integer M = 0>
using Sandals::SemiExplicit< Real, N, M >::MatrixA = typename Explicit<Real, N, M>::MatrixJF

Templetized matrix type.

◆ MatrixJB

template<typename Real, Integer N, Integer M = 0>
using Sandals::SemiExplicit< Real, N, M >::MatrixJB = typename Explicit<Real, N, M>::MatrixJF

Templetized vector type.

◆ MatrixJF

template<typename Real, Integer N, Integer M = 0>
using Sandals::SemiExplicit< Real, N, M >::MatrixJF = typename Explicit<Real, N, M>::MatrixJF

Templetized matrix type.

◆ Pointer

template<typename Real, Integer N, Integer M = 0>
using Sandals::SemiExplicit< Real, N, M >::Pointer = std::shared_ptr<SemiExplicit<Real, N, M>>

< Basic constants. Shared pointer to a semi-explicit ODE/DAE system.

◆ TensorTA

template<typename Real, Integer N, Integer M = 0>
using Sandals::SemiExplicit< Real, N, M >::TensorTA = typename std::vector<MatrixJF>

Templetized matrix type.

◆ Type

template<typename Real, Integer N, Integer M = 0>
using Sandals::SemiExplicit< Real, N, M >::Type = typename Explicit<Real, N, M>::Type

System type enumeration.

◆ VectorB

template<typename Real, Integer N, Integer M = 0>
using Sandals::SemiExplicit< Real, N, M >::VectorB = typename Explicit<Real, N, M>::VectorF

Templetized vector type.

◆ VectorF

template<typename Real, Integer N, Integer M = 0>
using Sandals::SemiExplicit< Real, N, M >::VectorF = typename Explicit<Real, N, M>::VectorF

Templetized vector type.

Constructor & Destructor Documentation

◆ SemiExplicit() [1/2]

template<typename Real, Integer N, Integer M = 0>
Sandals::SemiExplicit< Real, N, M >::SemiExplicit ( )
inline

Class constructor for the semi-explicit ODE/DAE system.

◆ SemiExplicit() [2/2]

template<typename Real, Integer N, Integer M = 0>
Sandals::SemiExplicit< Real, N, M >::SemiExplicit ( std::string t_name)
inline

Class constructor for the semi-explicit ODE/DAE system.

Parameters
[in]t_nameThe name of the semi-explicit ODE/DAE system.

Member Function Documentation

◆ A()

template<typename Real, Integer N, Integer M = 0>
virtual MatrixA Sandals::SemiExplicit< Real, N, M >::A ( VectorF const & x,
Real t ) const
pure virtual

Evaluate the semi-explicit ODE/DAE system mass matrix \( \mathbf{A}(\mathbf{x}, t) \).

Parameters
[in]xStates \( \mathbf{x} \).
[in]tIndependent variable (or time) \( t \).
Returns
The system function \( \mathbf{A}(\mathbf{x}, t) \).

Implemented in Sandals::SemiExplicitWrapper< Real, N, M >.

◆ b()

template<typename Real, Integer N, Integer M = 0>
virtual VectorB Sandals::SemiExplicit< Real, N, M >::b ( VectorF const & x,
Real t ) const
pure virtual

Evaluate the semi-explicit ODE/DAE system right-hand-side function \( \mathbf{b}(\mathbf{x}, t) \).

Parameters
[in]xStates \( \mathbf{x} \).
[in]tIndependent variable (or time) \( t \).
Returns
The system function \( \mathbf{b}(\mathbf{x}, t) \).

Implemented in Sandals::SemiExplicitWrapper< Real, N, M >.

◆ F()

template<typename Real, Integer N, Integer M = 0>
VectorF Sandals::SemiExplicit< Real, N, M >::F ( VectorF const & x,
VectorF const & x_dot,
Real t ) const
inlineoverridevirtual

Evaluate the ODE/DAE system \( \mathbf{F}(\mathbf{x}, \mathbf{x}^{\prime}, t) \)

\[\mathbf{F}(\mathbf{x}, \mathbf{x}^{\prime}, t) = \mathbf{A}(\mathbf{x}, t)\mathbf{x}^{\prime} - \mathbf{b}(\mathbf{x}, t) \text{.} \]

Parameters
[in]xStates \( \mathbf{x} \).
[in]x_dotStates derivative \( \mathbf{x}^{\prime} \).
[in]tIndependent variable (or time) \( t \).
Returns
The system function \( \mathbf{F}(\mathbf{x}, \mathbf{x}^{\prime}, t) \).

Reimplemented from Sandals::Explicit< Real, N, 0 >.

◆ f()

template<typename Real, Integer N, Integer M = 0>
VectorF Sandals::SemiExplicit< Real, N, M >::f ( VectorF const & x,
Real t ) const
inlineoverridevirtual

Evaluate the explicit ODE/DAE system function \( \mathbf{f}(\mathbf{x}, t) \) as

\[\mathbf{f}(\mathbf{x}, t) = \mathbf{A}(\mathbf{x}, t)^{-1} \mathbf{b}(\mathbf{x}, t) \text{.} \]

Parameters
[in]xStates \( \mathbf{x} \).
[in]tIndependent variable (or time) \( t \).
Returns
The system function \( \mathbf{f}(\mathbf{x}, t) \).

Implements Sandals::Explicit< Real, N, 0 >.

◆ Jb_x()

template<typename Real, Integer N, Integer M = 0>
virtual MatrixJB Sandals::SemiExplicit< Real, N, M >::Jb_x ( VectorF const & x,
Real t ) const
pure virtual

Evaluate the Jacobian of the semi-explicit ODE/DAE system right-hand-side function \( \mathbf{b} (\mathbf{x}, t) \) with respect to the states \( \mathbf{x} \)

\[\mathbf{Jb}_{\mathbf{x}}(\mathbf{x}, t) = \displaystyle\frac{\partial\mathbf{b}(\mathbf{x}, t)}{\partial\mathbf{x}} \text{.} \]

Parameters
[in]xStates \( \mathbf{x} \).
[in]tIndependent variable (or time) \( t \).
Returns
The Jacobian \( \mathbf{Jb}_{\mathbf{x}}(\mathbf{x}, t) \).

Implemented in Sandals::SemiExplicitWrapper< Real, N, M >.

◆ JF_x()

template<typename Real, Integer N, Integer M = 0>
MatrixJF Sandals::SemiExplicit< Real, N, M >::JF_x ( VectorF const & x,
VectorF const & x_dot,
Real t ) const
inlineoverridevirtual

Evaluate the Jacobian of the ODE/DAE system function \( \mathbf{F}(\mathbf{x}, \mathbf{x}^{ \prime}, t) \) with respect to the states \( \mathbf{x} \)

\[\mathbf{JF}_{\mathbf{x}}(\mathbf{x}, \mathbf{x}^{\prime}, t) = \displaystyle\frac{\partial\mathbf{F}(\mathbf{x}, \mathbf{x}^{\prime}, t)}{\partial\mathbf{x}} = -\displaystyle\frac{\partial\mathbf{f}(\mathbf{x}, \mathbf{x}^{\prime}, t)}{\partial\mathbf{x}} = -\mathbf{Jf}_{\mathbf{x}}(\mathbf{x}, t) = -\mathbf{A}(\mathbf{x}, t)^{-1}(\mathbf{Jb}_{ \mathbf{x}}(\mathbf{x}, t) - \mathbf{TA}_{\mathbf{x}}(\mathbf{x}, t) \mathbf{x}^\prime) \text{.} \]

Parameters
[in]xStates \( \mathbf{x} \).
[in]x_dotStates derivative \( \mathbf{x}^{\prime} \).
[in]tIndependent variable (or time) \( t \).
Returns
The Jacobian \( \mathbf{JF}_{\mathbf{x}}(\mathbf{x}, \mathbf{x}^{\prime}, t) \).

Reimplemented from Sandals::Explicit< Real, N, 0 >.

◆ Jf_x() [1/2]

template<typename Real, Integer N, Integer M = 0>
MatrixJF Sandals::SemiExplicit< Real, N, M >::Jf_x ( VectorF const & x,
Real t ) const
inlineoverridevirtual

Evaluate the Jacobian of the explicit ODE/DAE system function \( \mathbf{f}(\mathbf{x}, t) \) with respect to the states \( \mathbf{x} \)

\[\mathbf{Jf}_{\mathbf{x}}(\mathbf{x}, t) = \displaystyle\frac{\partial\mathbf{f}( \mathbf{x}, t)}{\partial\mathbf{x}} = \mathbf{A}(\mathbf{x}, t)^{-1}( \mathbf{Jb}_{\mathbf{x}} (\mathbf{x}, t) - \mathbf{TA}_{\mathbf{x}}(\mathbf{x}, t) \mathbf{f}(\mathbf{x}, t)) \text{.} \]

Parameters
[in]xStates \( \mathbf{x} \).
[in]tIndependent variable (or time) \( t \).
Returns
The Jacobian \( \mathbf{Jf}_{\mathbf{x}}(\mathbf{x}, t) \).

Implements Sandals::Explicit< Real, N, 0 >.

◆ Jf_x() [2/2]

template<typename Real, Integer N, Integer M = 0>
MatrixJF Sandals::SemiExplicit< Real, N, M >::Jf_x ( VectorF const & x,
VectorF const & x_dot,
Real t ) const
inline

Evaluate the Jacobian of the explicit ODE/DAE system function \( \mathbf{f}(\mathbf{x}, t) \) with respect to the states \( \mathbf{x} \)

\[\mathbf{Jf}_{\mathbf{x}}(\mathbf{x}, \mathbf{x}^\prime, t) = \displaystyle\frac{\partial \mathbf{f}(\mathbf{x}, t)}{\partial\mathbf{x}} = \mathbf{A}(\mathbf{x}, t)^{-1}(\mathbf{Jb}_{ \mathbf{x}}(\mathbf{x}, t) - \mathbf{TA}_{\mathbf{x}}(\mathbf{x}, t) \mathbf{x}^\prime) \text{.} \]

Parameters
[in]xStates \( \mathbf{x} \).
[in]x_dotStates derivative \( \mathbf{x}^{\prime} \).
[in]tIndependent variable (or time) \( t \).
Returns
The Jacobian \( \mathbf{Jf}_{\mathbf{x}}(\mathbf{x}, \mathbf{x}^\prime, t) \).

◆ JF_x_dot()

template<typename Real, Integer N, Integer M = 0>
MatrixJF Sandals::SemiExplicit< Real, N, M >::JF_x_dot ( VectorF const & x,
VectorF const & ,
Real t ) const
inlineoverridevirtual

Evaluate the Jacobian of the ODE/DAE system function \( \mathbf{F}(\mathbf{x}, \mathbf{x}^{\prime}, t) \) with respect to the states derivative \( \mathbf{x}^{\prime} \)

\[\mathbf{JF}_{\mathbf{x}^{\prime}}(\mathbf{x}, \mathbf{x}^{\prime}, t) = \displaystyle \frac{\partial\mathbf{F}(\mathbf{x}, \mathbf{x}^{\prime}, t)}{\partial\mathbf{x}^{\prime}} = \mathbf{A}(\mathbf{x}, t) \text{.} \]

Parameters
[in]xStates \( \mathbf{x} \).
[in]x_dotStates derivative \( \mathbf{x}^{\prime} \).
[in]tIndependent variable (or time) \( t \).
Returns
The Jacobian \( \mathbf{JF}_{\mathbf{x}^{\prime}}(\mathbf{x}, \mathbf{x}^{\prime}, t) \).

Reimplemented from Sandals::Explicit< Real, N, 0 >.

◆ TA_x()

template<typename Real, Integer N, Integer M = 0>
virtual TensorTA Sandals::SemiExplicit< Real, N, M >::TA_x ( VectorF const & x,
Real t ) const
pure virtual

Evaluate the tensor of the semi-explicit ODE/DAE system mass matrix \( \mathbf{A}(\mathbf{x}, t) \) with respect to the states \( \mathbf{x} \)

\[\mathbf{TA}_{\mathbf{x}}(\mathbf{x}, t) = \displaystyle\frac{\partial\mathbf{A}(\mathbf{x}, t)}{\partial\mathbf{x}} \text{.} \]

Parameters
[in]xStates \( \mathbf{x} \).
[in]tIndependent variable (or time) \( t \).
Returns
The Jacobian \( \mathbf{TA}_{\mathbf{x}}(\mathbf{x}, t) \).

Implemented in Sandals::SemiExplicitWrapper< Real, N, M >.

Member Data Documentation

◆ m_lu

template<typename Real, Integer N, Integer M = 0>
Eigen::FullPivLU<MatrixA> Sandals::SemiExplicit< Real, N, M >::m_lu
mutableprivate

LU decomposition.


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