Ember
Loading...
Searching...
No Matches
ExplicitIntegrator Class Reference

Integrates an ODE defined as ydot = f(t,y) using the explicit Euler method. More...

#include <integrator.h>

Inheritance diagram for ExplicitIntegrator:
[legend]

Public Member Functions

 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.
 
- Public Member Functions inherited from Integrator
 Integrator ()
 
virtual ~Integrator ()
 
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 void integrateToTime (double tEnd)
 Take as many steps as necessary to reach tEnd without stepping past it.
 

Private Attributes

ODE & myODE
 
dvec ydot
 

Additional Inherited Members

- Public Attributes inherited from Integrator
dvec y
 solution vector
 
dvec ydot
 derivative of state vector
 
double t
 current time
 
- Protected Attributes inherited from Integrator
double h
 timestep
 
size_t N
 Dimension of y.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ExplicitIntegrator()

ExplicitIntegrator::ExplicitIntegrator ( ODE & ode)

◆ ~ExplicitIntegrator()

ExplicitIntegrator::~ExplicitIntegrator ( )
inline

Member Function Documentation

◆ 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.

Member Data Documentation

◆ myODE

ODE& ExplicitIntegrator::myODE
private

◆ ydot

dvec ExplicitIntegrator::ydot
private

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