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

Class container for the system of implicit ODEs/DAEs. More...

#include <Implicit.hh>

Public Types

using Type = enum class Type : Integer {IMPLICIT = 0, EXPLICIT = 1, SEMIEXPLICIT = 1}
using Pointer = std::shared_ptr<Implicit<Real, N, M>>
using VectorF = Eigen::Vector<Real, N>
using MatrixJF = Eigen::Matrix<Real, N, N>
using VectorH = Eigen::Vector<Real, M>
using MatrixJH = Eigen::Matrix<Real, M, N>

Public Member Functions

 Implicit ()
 Implicit (std::string t_name)
virtual ~Implicit ()
Type type () const
bool is_implicit () const
bool is_explicit () const
bool is_semiexplicit () const
std::string & name ()
std::string const & name () const
Integer equations_number () const
Integer invariants_number () const
virtual VectorF F (VectorF const &x, VectorF const &x_dot, Real t) const =0
virtual MatrixJF JF_x (VectorF const &x, VectorF const &x_dot, Real t) const =0
virtual MatrixJF JF_x_dot (VectorF const &x, VectorF const &x_dot, Real t) const =0
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

Protected Member Functions

 Implicit (Type t_type, std::string t_name)

Private Attributes

Type m_type {Type::IMPLICIT}
std::string m_name

Detailed Description

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

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

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

Member Typedef Documentation

◆ MatrixJF

template<typename Real, Integer N, Integer M = 0>
using Sandals::Implicit< Real, N, M >::MatrixJF = Eigen::Matrix<Real, N, N>

Templetized matrix type.

◆ MatrixJH

template<typename Real, Integer N, Integer M = 0>
using Sandals::Implicit< Real, N, M >::MatrixJH = Eigen::Matrix<Real, M, N>

Templetized matrix type.

◆ Pointer

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

Shared pointer to an implicit ODE system.

◆ Type

template<typename Real, Integer N, Integer M = 0>
using Sandals::Implicit< Real, N, M >::Type = enum class Type : Integer {IMPLICIT = 0, EXPLICIT = 1, SEMIEXPLICIT = 1}

< Basic constants. System type enumeration.

◆ VectorF

template<typename Real, Integer N, Integer M = 0>
using Sandals::Implicit< Real, N, M >::VectorF = Eigen::Vector<Real, N>

Templetized vector type.

◆ VectorH

template<typename Real, Integer N, Integer M = 0>
using Sandals::Implicit< Real, N, M >::VectorH = Eigen::Vector<Real, M>

Templetized vector type.

Constructor & Destructor Documentation

◆ Implicit() [1/3]

template<typename Real, Integer N, Integer M = 0>
Sandals::Implicit< Real, N, M >::Implicit ( Type t_type,
std::string t_name )
inlineprotected

Class constructor for an implicit ODE/DAE system.

Parameters
[in]t_typeThe type of the implicit ODE/DAE system.
[in]t_nameThe name of the implicit ODE/DAE system.

◆ Implicit() [2/3]

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

Class constructor for an implicit ODE/DAE system.

◆ Implicit() [3/3]

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

Class constructor for an implicit ODE/DAE system.

Parameters
[in]t_nameThe name of the implicit ODE/DAE system.

◆ ~Implicit()

template<typename Real, Integer N, Integer M = 0>
virtual Sandals::Implicit< Real, N, M >::~Implicit ( )
inlinevirtual

Class destructor for an implicit ODE/DAE system.

Member Function Documentation

◆ equations_number()

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

Get the number of equations of the ODE/DAE system.

Returns
The number of equations of the ODE/DAE system.

◆ F()

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

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

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) \).

Implemented in Sandals::Explicit< Real, N, M >, Sandals::Explicit< Real, N, 0 >, Sandals::Explicit< Real, N, M >, Sandals::ImplicitWrapper< Real, N, M >, Sandals::Linear< Real, N, M >, Sandals::Linear< Real, N, 0 >, Sandals::SemiExplicit< Real, N, M >, and Sandals::SemiExplicit< Real, N, 0 >.

◆ F_reverse()

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

Time reversal of the implicit ODE system function \( \mathbf{F}(\mathbf{x}, \mathbf{x}^{ \prime}, t) = -\mathbf{F}(\mathbf{x}, -\mathbf{x}^{\prime}, -t) \).

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

◆ h()

template<typename Real, Integer N, Integer M = 0>
virtual VectorH Sandals::Implicit< Real, N, M >::h ( VectorF const & x,
Real t ) const
pure virtual

Evaluate the ODE/DAE system invariants \( \mathbf{h}(\mathbf{x}, t) \).

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

Implemented in Sandals::ExplicitWrapper< Real, N, M >, Sandals::ImplicitWrapper< Real, N, M >, Sandals::LinearWrapper< Real, N, M >, and Sandals::SemiExplicitWrapper< Real, N, M >.

◆ in_domain()

template<typename Real, Integer N, Integer M = 0>
virtual bool Sandals::Implicit< Real, N, M >::in_domain ( VectorF const & x,
Real t ) const
pure virtual

Return true if the values \( \mathbf{F}(\mathbf{x}, \mathbf{x}^{\prime}, t) \) is in the domain of the ODE/DAE system.

Parameters
[in]xStates \( \mathbf{x} \).
[in]tIndependent variable (or time) \( t \).
Returns
True if \( \mathbf{F}(\mathbf{x}, t) \) is in the domain of the ODE/DAE system.

Implemented in Sandals::ExplicitWrapper< Real, N, M >, Sandals::ImplicitWrapper< Real, N, M >, Sandals::LinearWrapper< Real, N, M >, and Sandals::SemiExplicitWrapper< Real, N, M >.

◆ invariants_number()

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

Get the number of invariants of the ODE/DAE system.

Returns
The number of invariants of the ODE/DAE system.

◆ is_explicit()

template<typename Real, Integer N, Integer M = 0>
bool Sandals::Implicit< Real, N, M >::is_explicit ( ) const
inline

Check if the ODE/DAE system is explicit.

Returns
True if the ODE/DAE system is explicit, false otherwise.

◆ is_implicit()

template<typename Real, Integer N, Integer M = 0>
bool Sandals::Implicit< Real, N, M >::is_implicit ( ) const
inline

Check if the ODE/DAE system is implicit.

Returns
True if the ODE/DAE system is implicit, false otherwise.

◆ is_semiexplicit()

template<typename Real, Integer N, Integer M = 0>
bool Sandals::Implicit< Real, N, M >::is_semiexplicit ( ) const
inline

Check if the ODE/DAE system is semi-explicit.

Returns
True if the ODE/DAE system is semi-explicit, false otherwise.

◆ JF_x()

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

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}} \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) \).

Implemented in Sandals::Explicit< Real, N, M >, Sandals::Explicit< Real, N, 0 >, Sandals::Explicit< Real, N, M >, Sandals::ImplicitWrapper< Real, N, M >, Sandals::Linear< Real, N, M >, Sandals::Linear< Real, N, 0 >, Sandals::SemiExplicit< Real, N, M >, and Sandals::SemiExplicit< Real, N, 0 >.

◆ JF_x_dot()

template<typename Real, Integer N, Integer M = 0>
virtual MatrixJF Sandals::Implicit< Real, N, M >::JF_x_dot ( VectorF const & x,
VectorF const & x_dot,
Real t ) const
pure virtual

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}} \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) \).

Implemented in Sandals::Explicit< Real, N, M >, Sandals::Explicit< Real, N, 0 >, Sandals::Explicit< Real, N, M >, Sandals::ImplicitWrapper< Real, N, M >, Sandals::Linear< Real, N, M >, Sandals::Linear< Real, N, 0 >, Sandals::SemiExplicit< Real, N, M >, and Sandals::SemiExplicit< Real, N, 0 >.

◆ JF_x_dot_reverse()

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

Time reversal of the Jacobian of the implicit ODE 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) \).

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

◆ JF_x_reverse()

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

Time reversal of the Jacobian of the implicit ODE 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) \).

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

◆ Jh_x()

template<typename Real, Integer N, Integer M = 0>
virtual MatrixJH Sandals::Implicit< Real, N, M >::Jh_x ( VectorF const & x,
Real t ) const
pure virtual

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

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

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

Implemented in Sandals::ExplicitWrapper< Real, N, M >, Sandals::ImplicitWrapper< Real, N, M >, Sandals::LinearWrapper< Real, N, M >, and Sandals::SemiExplicitWrapper< Real, N, M >.

◆ name() [1/2]

template<typename Real, Integer N, Integer M = 0>
std::string & Sandals::Implicit< Real, N, M >::name ( )
inline

Get the ODE/DAE system name reference.

Returns
The ODE/DAE system name reference.

◆ name() [2/2]

template<typename Real, Integer N, Integer M = 0>
std::string const & Sandals::Implicit< Real, N, M >::name ( ) const
inline

Get the ODE/DAE system name const reference.

Returns
The ODE/DAE system name const reference.

◆ type()

template<typename Real, Integer N, Integer M = 0>
Type Sandals::Implicit< Real, N, M >::type ( ) const
inline

Get the enumeration type of the ODE/DAE system.

Returns
The enumeration type of the ODE/DAE system.

Member Data Documentation

◆ m_name

template<typename Real, Integer N, Integer M = 0>
std::string Sandals::Implicit< Real, N, M >::m_name
private

Name of the ODE/DAE system.

◆ m_type

template<typename Real, Integer N, Integer M = 0>
Type Sandals::Implicit< Real, N, M >::m_type {Type::IMPLICIT}
private

ODE/DAE system type.


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