#include <RKExplicit_fwd.hpp>
Class representing an explicit Runge-Kutta method.
Scalar | type of scalars to use for calculations, e.g. double |
num_stages | number of stages of the method |
Usage example:
Definition at line 32 of file RKExplicit_fwd.hpp.
Public Member Functions | |
RKExplicit (const Eigen::Matrix< scalar_t, stages, 1 > &alpha, const Eigen::Matrix< scalar_t, stages, stages > &beta, const Eigen::Matrix< scalar_t, stages, 1 > &gamma) | |
Construct a Runge-Kutta method with tableau \( \begin{array}{l|l} \alpha & \beta \\ \hline & \gamma^\mathsf{T} \end{array} \). More... | |
template<typename func_t > | |
Integrator< func_t > | solve (const func_t &func, scalar_t t0, scalar_t t_max, scalar_t dt, const Eigen::VectorXd &y0) const |
Returns a solver using this method. More... | |
Public Types | |
enum | { stages = num_stages } |
typedef Scalar | scalar_t |
Floating point type used in the computations. More... | |
Classes | |
class | Integrator |
Integrator class for RK methods. More... | |
Friends | |
template<typename Scalar2 , int num_steps2> | |
class | AdamsBashforth |
Implements Adams Bashforth multistep methods. More... | |
template<typename scalar_t , int stages> | |
std::ostream & | operator<< (std::ostream &os, const RKExplicit< scalar_t, stages > &) |
Output the method's tableau for debugging. More... | |
Private Member Functions | |
template<typename func_t > | |
Eigen::VectorXd | step (const func_t &func, scalar_t t, const Eigen::VectorXd &y, scalar_t dt) const |
Returns next value. More... | |
Private Attributes | |
Eigen::Matrix< scalar_t, stages, 1 > | alpha_ |
Left row of the tableau. More... | |
Eigen::Matrix< scalar_t, stages, stages > | beta_ |
Central matrix of the tableau. More... | |
Eigen::Matrix< scalar_t, stages, 1 > | gamma_ |
Bottom row of the tableau. More... | |
anonymous enum |
Enumerator | |
---|---|
stages | number of stages |
Definition at line 35 of file RKExplicit_fwd.hpp.
|
inline |
Construct a Runge-Kutta method with tableau \( \begin{array}{l|l} \alpha & \beta \\ \hline & \gamma^\mathsf{T} \end{array} \).
alpha | Vector of size stages . |
beta | Matrix of size stages times stages . Only strictly lower triangular part is used. |
gamma | Vector of size stages . |
Definition at line 56 of file RKExplicit_fwd.hpp.
|
inline |
Returns a solver using this method.
func | Function to integrate. |
t0 | Start time. |
t_max | End time. |
dt | Time step. |
y0 | Initial value. |
t_max
. The number of steps is calculated as std::ceil((t_max - t0)/dt)
. Definition at line 204 of file RKExplicit_fwd.hpp.
|
inlineprivate |
Returns next value.
Definition at line 212 of file RKExplicit_fwd.hpp.
|
friend |
Implements Adams Bashforth multistep methods.
Definition at line 230 of file RKExplicit_fwd.hpp.
|
friend |
Output the method's tableau for debugging.
|
private |
Left row of the tableau.
Definition at line 38 of file RKExplicit_fwd.hpp.
|
private |
Central matrix of the tableau.
Definition at line 39 of file RKExplicit_fwd.hpp.
|
private |
Bottom row of the tableau.
Definition at line 40 of file RKExplicit_fwd.hpp.