Processing math: 100%
Sandals  v0.0.0
A C++ library for ODEs/DAEs integration
All Classes Namespaces Files Functions Variables Typedefs Macros Pages
Sandals::Linear< N, M > Class Template Referenceabstract

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

#include <Linear.hxx>

Inherits Sandals::Explicit< N, 0 >.

Public Types

using Pointer = std::shared_ptr<SemiExplicit<N, M>>
 
using VectorF = typename Explicit<N, M>::VectorF
 
using MatrixJF = typename Explicit<N, M>::MatrixJF
 
using MatrixE = typename Explicit<N, M>::MatrixJF
 
using MatrixA = typename Explicit<N, M>::MatrixJF
 
using VectorB = typename Explicit<N, M>::VectorF
 
using Type = typename Explicit<N, M>::Type
 
- Public Types inherited from Sandals::Explicit< N, 0 >
using Pointer
 
using VectorF
 
using MatrixJF
 
using Type
 
- Public Types inherited from Sandals::Implicit< N, M >
using Type = enum class Type : Integer {IMPLICIT=0, EXPLICIT=1, SEMIEXPLICIT=1}
 
using Pointer = std::shared_ptr<Implicit<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

 Linear ()
 
 Linear (std::string t_name)
 
VectorF F (VectorF const &x, VectorF const &x_dot, Real t) const override
 
MatrixJF JF_x (VectorF const &, VectorF const &, Real t) const override
 
MatrixJF JF_x_dot (VectorF const &, VectorF const &, Real t) const override
 
VectorF f (VectorF const &x, Real t) const override
 
MatrixJF Jf_x (VectorF const &, Real t) const override
 
virtual MatrixE E (Real t) const =0
 
virtual MatrixA A (Real t) const =0
 
virtual VectorB b (Real t) const =0
 
- Public Member Functions inherited from Sandals::Explicit< N, 0 >
 Explicit ()
 
 Explicit (std::string t_name)
 
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< N, M >
 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 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< MatrixEm_lu
 

Additional Inherited Members

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

Detailed Description

template<Integer N, Integer M = 0>
class Sandals::Linear< N, M >

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

Template Parameters
NThe dimension of the semi-explicit ODE system.
MThe dimension of the invariants manifold.

Member Typedef Documentation

◆ MatrixA

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

Templetized matrix type.

◆ MatrixE

template<Integer N, Integer M = 0>
using Sandals::Linear< N, M >::MatrixE = typename Explicit<N, M>::MatrixJF

Templetized matrix type.

◆ MatrixJF

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

Templetized matrix type.

◆ Pointer

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

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

◆ Type

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

System type enumeration.

◆ VectorB

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

Templetized vector type.

◆ VectorF

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

Templetized vector type.

Constructor & Destructor Documentation

◆ Linear() [1/2]

template<Integer N, Integer M = 0>
Sandals::Linear< N, M >::Linear ( )
inline

Class constructor for the linear ODE/DAE system.

◆ Linear() [2/2]

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

Class constructor for the linear ODE/DAE system.

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

Member Function Documentation

◆ A()

template<Integer N, Integer M = 0>
virtual MatrixA Sandals::Linear< N, M >::A ( Real t) const
pure virtual

Evaluate the linear ODE/DAE system matrix \mathbf{A}(t) .

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

◆ b()

template<Integer N, Integer M = 0>
virtual VectorB Sandals::Linear< N, M >::b ( Real t) const
pure virtual

Evaluate the linear ODE/DAE system vector \mathbf{b}(t) .

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

◆ E()

template<Integer N, Integer M = 0>
virtual MatrixE Sandals::Linear< N, M >::E ( Real t) const
pure virtual

Evaluate the linear ODE/DAE system mass matrix \mathbf{E}(t) .

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

◆ F()

template<Integer N, Integer M = 0>
VectorF Sandals::Linear< 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{E}(t) \mathbf{x}^{\prime} - \mathbf{A}(t) \mathbf{x} - \mathbf{b}(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) .

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

◆ f()

template<Integer N, Integer M = 0>
VectorF Sandals::Linear< 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{E}(t)^{-1}(\mathbf{A}(t)\mathbf{x} + \mathbf{b}(t))

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

Implements Sandals::Explicit< N, 0 >.

◆ JF_x()

template<Integer N, Integer M = 0>
MatrixJF Sandals::Linear< N, M >::JF_x ( VectorF const & ,
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 \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}} = -\mathbf{A}(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}}(\mathbf{x}, \mathbf{x}^{\prime}, t) .

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

◆ Jf_x()

template<Integer N, Integer M = 0>
MatrixJF Sandals::Linear< N, M >::Jf_x ( VectorF const & ,
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{E}(t)^{-1} \mathbf{A}(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< N, 0 >.

◆ JF_x_dot()

template<Integer N, Integer M = 0>
MatrixJF Sandals::Linear< N, M >::JF_x_dot ( VectorF const & ,
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{E}(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< N, 0 >.

Member Data Documentation

◆ m_lu

template<Integer N, Integer M = 0>
Eigen::FullPivLU<MatrixE> Sandals::Linear< N, M >::m_lu
private

LU decomposition.


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