numerical-collection-cpp 0.10.0
A collection of algorithms in numerical analysis implemented in C++
Loading...
Searching...
No Matches
num_prob_collect::ode::spring_movement_problem Class Reference

Class of test problem to spring movement. More...

#include <num_prob_collect/ode/spring_movement_problem.h>

+ Collaboration diagram for num_prob_collect::ode::spring_movement_problem:

Public Types

using jacobian_type = Eigen::Matrix2d
 Type of Jacobian.
 
using scalar_type = double
 Type of scalars.
 
using variable_type = Eigen::Vector2d
 Type of variables.
 

Public Member Functions

 spring_movement_problem ()
 Constructor.
 
auto diff_coeff () const noexcept -> const variable_type &
 Get the differential coefficient.
 
void evaluate_on (scalar_type, const variable_type &variable, num_collect::ode::evaluation_type)
 Evaluate on a (time, variable) pair.
 
auto jacobian () const noexcept -> const jacobian_type &
 Get the Jacobian.
 

Static Public Attributes

static constexpr auto allowed_evaluations
 Allowed evaluations.
 

Private Attributes

variable_type diff_coeff_ {}
 Differential coefficient.
 
jacobian_type jacobian_ {}
 Jacobian.
 

Detailed Description

Class of test problem to spring movement.

This solves the following equation of motion of a spring:

\[ \ddot{x} = -x \]

In this class, the following equation is used to solve the above equation:

\[ \frac{d}{dt} \begin{pmatrix} \dot{x} \\ x \end{pmatrix} = \begin{pmatrix} -x \\ \dot{x} \end{pmatrix} \]

Definition at line 42 of file spring_movement_problem.h.

Member Typedef Documentation

◆ jacobian_type

Type of Jacobian.

Definition at line 51 of file spring_movement_problem.h.

◆ scalar_type

Type of scalars.

Definition at line 48 of file spring_movement_problem.h.

◆ variable_type

Type of variables.

Definition at line 45 of file spring_movement_problem.h.

Constructor & Destructor Documentation

◆ spring_movement_problem()

num_prob_collect::ode::spring_movement_problem::spring_movement_problem ( )
inline

Constructor.

Definition at line 60 of file spring_movement_problem.h.

Member Function Documentation

◆ diff_coeff()

auto num_prob_collect::ode::spring_movement_problem::diff_coeff ( ) const -> const variable_type&
inlinenodiscardnoexcept

Get the differential coefficient.

Returns
Differential coefficient.

Definition at line 77 of file spring_movement_problem.h.

◆ evaluate_on()

void num_prob_collect::ode::spring_movement_problem::evaluate_on ( scalar_type ,
const variable_type & variable,
num_collect::ode::evaluation_type  )
inline

Evaluate on a (time, variable) pair.

Parameters
[in]variableVariable.

Definition at line 67 of file spring_movement_problem.h.

◆ jacobian()

auto num_prob_collect::ode::spring_movement_problem::jacobian ( ) const -> const jacobian_type&
inlinenodiscardnoexcept

Get the Jacobian.

Returns
Jacobian.

Definition at line 86 of file spring_movement_problem.h.

Member Data Documentation

◆ allowed_evaluations

auto num_prob_collect::ode::spring_movement_problem::allowed_evaluations
staticconstexpr
Initial value:
=
num_collect::ode::evaluation_type{.diff_coeff = true, .jacobian = true}
Struct to specify types of evaluations.

Allowed evaluations.

Definition at line 54 of file spring_movement_problem.h.

◆ diff_coeff_

variable_type num_prob_collect::ode::spring_movement_problem::diff_coeff_ {}
private

Differential coefficient.

Definition at line 92 of file spring_movement_problem.h.

◆ jacobian_

jacobian_type num_prob_collect::ode::spring_movement_problem::jacobian_ {}
private

Jacobian.

Definition at line 95 of file spring_movement_problem.h.


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