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

Class container for an boundary value problem (BVP) of ODEs/DAEs. More...

#include <BVP.hh>

Public Types

using VectorF = typename Implicit<Real, N, M>::VectorF
using Pointer = std::shared_ptr<Implicit<Real, N, M>>
using NewtonB = Optimist::RootFinder::Newton<Real, N>

Public Member Functions

 BVP (std::string t_name)
RungeKutta< Real, N, M > & rk ()
RungeKutta< Real, N, M > const & rk () const
virtual VectorF b (VectorF const &x_ini, VectorF const &x_end) const =0
virtual MatrixJF Jb_x_ini (VectorF const &x_ini, VectorF const &x_end) const =0
virtual MatrixJF Jb_x_end (VectorF const &x_ini, VectorF const &x_end) const =0
bool solve_single_shooting (VectorX const &t_mesh, VectorN const &ics, Solution< Real, N, M > &sol) const

Private Attributes

NewtonB m_newton
RungeKutta< Real, N, M > m_rk
std::string m_name

Detailed Description

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

Class container for an boundary value problem (BVP) of ordinary differential equations (ODEs) or differential algebraic equations (DAEs).

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

Member Typedef Documentation

◆ NewtonB

template<typename Real, Integer N, Integer M = 0>
using Sandals::BVP< Real, N, M >::NewtonB = Optimist::RootFinder::Newton<Real, N>

Templetized Newton solver for the boundary conditions.

◆ Pointer

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

Shared pointer to an implicit ODE system.

◆ VectorF

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

Templetized vector type.

Constructor & Destructor Documentation

◆ BVP()

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

Class constructor for the boundary value problem (BVP).

Parameters
[in]t_nameThe name of the BVP

Member Function Documentation

◆ b()

template<typename Real, Integer N, Integer M = 0>
virtual VectorF Sandals::BVP< Real, N, M >::b ( VectorF const & x_ini,
VectorF const & x_end ) const
pure virtual

Evaluate the boundary conditions function of the problem \( \mathbf{b}(\mathbf{x}_{\text{ini}}, \mathbf{x}_{\text{end}}) \).

Parameters
[in]x_iniInitial states \( \mathbf{x}_{\text{ini}} \).
[in]x_endFinal states \( \mathbf{x}_{\text{end}} \).
Returns
The residual of the boundary conditions.

◆ Jb_x_end()

template<typename Real, Integer N, Integer M = 0>
virtual MatrixJF Sandals::BVP< Real, N, M >::Jb_x_end ( VectorF const & x_ini,
VectorF const & x_end ) const
pure virtual

Evaluate the Jacobian of the boundary conditions function \( \mathbf{b}(\mathbf{x}_{\text{ini}}, \mathbf{x}_{\text{end}}) \) with respect to the final states \( \mathbf{x}_{\text{end}} \).

Parameters
[in]x_iniInitial states \( \mathbf{x}_{\text{ini}} \).
[in]x_endFinal states \( \mathbf{x}_{\text{end}} \).
Returns
The Jacobian \( \mathbf{Jb}_{\mathbf{x}_{\text{end}}}(\mathbf{x}_{\text{ini}}, \mathbf{x}_{\text{end}}) \).

◆ Jb_x_ini()

template<typename Real, Integer N, Integer M = 0>
virtual MatrixJF Sandals::BVP< Real, N, M >::Jb_x_ini ( VectorF const & x_ini,
VectorF const & x_end ) const
pure virtual

Evaluate the Jacobian of the boundary conditions function \( \mathbf{b}(\mathbf{x}_{\text{ini}}, \mathbf{x}_{\text{end}}) \) with respect to the initial states \( \mathbf{x}_{\text{ini}} \).

Parameters
[in]x_iniInitial states \( \mathbf{x}_{\text{ini}} \).
[in]x_endFinal states \( \mathbf{x}_{\text{end}} \).
Returns
The Jacobian \( \mathbf{Jb}_{\mathbf{x}_{\text{ini}}}(\mathbf{x}_{\text{ini}}, \mathbf{x}_{\text{end}}) \).

◆ rk() [1/2]

template<typename Real, Integer N, Integer M = 0>
RungeKutta< Real, N, M > & Sandals::BVP< Real, N, M >::rk ( )
inline

Get the Runge-Kutta method reference.

Returns
The Runge-Kutta method reference.

◆ rk() [2/2]

template<typename Real, Integer N, Integer M = 0>
RungeKutta< Real, N, M > const & Sandals::BVP< Real, N, M >::rk ( ) const
inline

Get the Runge-Kutta method const reference.

Returns
The Runge-Kutta method const reference.

◆ solve_single_shooting()

template<typename Real, Integer N, Integer M = 0>
bool Sandals::BVP< Real, N, M >::solve_single_shooting ( VectorX const & t_mesh,
VectorN const & ics,
Solution< Real, N, M > & sol ) const
inline

Solve the boundary value problem (BVP) using the Runge-Kutta method uning a single shooting method.

Parameters
[in]t_meshIndependent variable (or time) mesh \( \mathbf{t} \).
[in]icsInitial conditions \( \mathbf{x}(t = 0) \).
[out]solThe solution of the system over the mesh of independent variable.
Returns
True if the system is successfully solved, false otherwise.
Warning
Do not use the solution for internal backtracking, as the step callback may directly modify the solution.

Member Data Documentation

◆ m_name

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

Name of the ODE/DAE system.

◆ m_newton

template<typename Real, Integer N, Integer M = 0>
NewtonB Sandals::BVP< Real, N, M >::m_newton
mutableprivate

Newton solver for the boundary conditions.

◆ m_rk

template<typename Real, Integer N, Integer M = 0>
RungeKutta<Real, N, M> Sandals::BVP< Real, N, M >::m_rk
private

Runge-Kutta method for the BVP.


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