RK45Integrator

class RK45Integrator : public rr::Integrator

A Runge-Kutta Fehlberg method for roadrunner.

Uses the Fehlberg method, an adaptive step method, to integrate models.

Author

KC

Public Functions

RK45Integrator(ExecutableModel *m)

Constructor: takes an executable model, does not own the pointer.

Author

KC

virtual ~RK45Integrator()

Destructor.

Author

KC

virtual void syncWithModel(ExecutableModel *m)

Called whenever a new model is loaded to allow integrator to reset internal state.

Author

JKM

virtual double integrate(double t, double h)

implement Integrator interface

Integrates the model from t to t + h.

Author

CC

Attempts to find the state std::vector at t + h, and returns time t + h if successful. If the integrator does not find a convergent solution, the state std::vector is not updated and t is returned. Also calculates a new timestep and saves it to a member variable for future use.

virtual void restart(double t0)

Restarts the integrator.

virtual std::string getName() const

Get the name for this integrator.

Author

JKM

Note

Delegates to getName

virtual std::string getDescription() const

Get the description for this integrator.

Author

JKM

Note

Delegates to getDescription

virtual std::string getHint() const

Get the hint for this integrator.

Author

WBC

Note

Delegates to getHint

virtual Solver *construct(ExecutableModel *executableModel) const

Constructs a new Solver of a given type.

the caller is responsible for deleting memory associated with the returned Solver*.

Author

JKM, WBC

virtual Setting getValue(std::string key)
virtual IntegrationMethod getIntegrationMethod() const

Always deterministic for RK45.

Author

JKM

virtual void resetSettings()

Reset all integrator settings to their respective default values.

Author

JKM

virtual void setListener(IntegratorListenerPtr)

the integrator can hold a single listener.

If clients require multicast, they can create a multi-cast listener.

virtual IntegratorListenerPtr getListener()

get the integrator listener

explicit Integrator(ExecutableModel *model)
Integrator()

Public Static Functions

static std::string getRK45Name()

Get the name for this integrator.

Author

JKM

static std::string getRK45Description()

Get the description for this integrator.

Author

JKM

static std::string getRK45Hint()

Get the hint for this integrator.

Author

JKM

Private Functions

void testRootsAtInitialTime()
void applyEvents(double timeEnd, std::vector<unsigned char> &previousEventStatus)

Private Members

unsigned stateVectorSize
double *k1

arrays to store function eval values.

double *k2
double *k3
double *k4
double *y
double *ytmp
double hCurrent
double hmin
double hmax
double *k5
double *k6
double *err