Integrates an ODE defined as ydot = f(t,y)
using the explicit Euler method.
More...
#include <integrator.h>
|
| ExplicitIntegrator (ODE &ode) |
|
| ~ExplicitIntegrator () |
|
void | set_y0 (const dvec &y0) |
| Set the initial condition for the problem.
|
|
const dvec & | get_ydot () |
| Get the time derivative of the current state vector.
|
|
void | step () |
| Take a single step using the current step size.
|
|
| Integrator () |
|
virtual | ~Integrator () |
|
virtual void | set_y0 (const dvec &y0) |
| Set the initial condition for the problem.
|
|
virtual void | initialize (const double t0, const double h) |
| Set up parameters and problem-dependent data structures for the solver.
|
|
double | get_h () const |
| Get the last step size used.
|
|
double | get_t () const |
| Get the current time reached by the integrator.
|
|
virtual const dvec & | get_y () const |
| Get the current state vector.
|
|
virtual const dvec & | get_ydot ()=0 |
| Get the time derivative of the current state vector.
|
|
virtual void | step ()=0 |
| Take a single step using the current step size.
|
|
virtual void | integrateToTime (double tEnd) |
| Take as many steps as necessary to reach tEnd without stepping past it.
|
|
|
dvec | y |
| solution vector
|
|
dvec | ydot |
| derivative of state vector
|
|
double | t |
| current time
|
|
double | h |
| timestep
|
|
size_t | N |
| Dimension of y.
|
|
Integrates an ODE defined as ydot = f(t,y)
using the explicit Euler method.
This class exists mostly as a demonstration of how to implement Integrator.
◆ ExplicitIntegrator()
ExplicitIntegrator::ExplicitIntegrator |
( |
ODE & |
ode | ) |
|
◆ ~ExplicitIntegrator()
ExplicitIntegrator::~ExplicitIntegrator |
( |
| ) |
|
|
inline |
◆ set_y0()
void ExplicitIntegrator::set_y0 |
( |
const dvec & |
y0 | ) |
|
|
virtual |
Set the initial condition for the problem.
Must be called before starting integration.
Reimplemented from Integrator.
◆ get_ydot()
const dvec & ExplicitIntegrator::get_ydot |
( |
| ) |
|
|
virtual |
Get the time derivative of the current state vector.
Implements Integrator.
◆ step()
void ExplicitIntegrator::step |
( |
| ) |
|
|
virtual |
Take a single step using the current step size.
Implements Integrator.
◆ myODE
ODE& ExplicitIntegrator::myODE |
|
private |
◆ ydot
dvec ExplicitIntegrator::ydot |
|
private |
The documentation for this class was generated from the following files: