template<class X> class adevs::rk4
This class can be used to simulate a set of ordinary differential
equations with state and time events.
Inheritance:
Public Methods
-
rk4(int num_state_vars, double h_max, int zero_crossing_funcs = 1)
-
The constructor requires the number of continuous state variables and
the maximum allowed integration time step.
-
void init(int i, double q0)
-
Initialize the ith state variable
-
virtual void der_func(const double* q, double* dq) = 0
-
Compute the derivative function using the supplied state variable values
The derivatives should be stored in dq
-
virtual void state_event_func(const double* q, double* z) = 0
-
This function should fill the array z with the value of the zero crossing
functions.
-
virtual double time_event_func(const double* q) = 0
-
This method is used to schedule time event.
-
virtual void discrete_action(double* q, const Bag<X>& xb) = 0
-
This function is called when an event occurs.
-
virtual void discrete_output(const double* q, Bag<X>& yb) = 0
-
This output function is evaluated when internal events occur.
-
void evolve_func(double h)
-
double next_event_func(bool& is_event)
-
void discrete_action_func(const Bag<X>& xb)
-
void discrete_output_func(Bag<X>& yb)
-
~rk4()
- Destructor
Inherited from DESS:
Public Methods
-
void delta_int()
-
void delta_ext(double e, const Bag<X>& xb)
-
void delta_conf(const Bag<X>& xb)
-
void output_func(Bag<X>& yb)
-
double ta()
Inherited from Atomic:
Public Methods
-
virtual void gc_output(Bag<X>& g)
-
Atomic<X> * typeIsAtomic()
Protected Methods
-
double getLastEventTime() const
Inherited from Devs:
Public Methods
-
virtual Network<X> * typeIsNetwork()
-
const Network<X> * getParent() const
-
Network<X> * getParent()
-
void setParent(Network<X>* parent)
-
virtual bool model_transition()
Documentation
This class can be used to simulate a set of ordinary differential
equations with state and time events. This classes uses a fourth
order Runge-Kutta integration scheme and interval halving for
event detection.
rk4(int num_state_vars, double h_max, int zero_crossing_funcs = 1)
-
The constructor requires the number of continuous state variables and
the maximum allowed integration time step. The number of zero crossing
functions in this system are supplied with the last argument (the
default value is 1).
void init(int i, double q0)
-
Initialize the ith state variable
virtual void der_func(const double* q, double* dq) = 0
-
Compute the derivative function using the supplied state variable values
The derivatives should be stored in dq
virtual void state_event_func(const double* q, double* z) = 0
-
This function should fill the array z with the value of the zero crossing
functions. The z array will have a number of entries equal to the zero_crossing_funcs
argument that was passed to the constructor. An event occurs when any of these
functions are equal to zero.
virtual double time_event_func(const double* q) = 0
-
This method is used to schedule time event. The returned value is the
time remaining until the next time event.
virtual void discrete_action(double* q, const Bag<X>& xb) = 0
-
This function is called when an event occurs. The event can be due to
the zero crossing function reaching zero or because of an external
input. The continuous and discrete variables can be updated here. The
q array contains continuous state when the event occurs, and can be modified
if desired.
virtual void discrete_output(const double* q, Bag<X>& yb) = 0
-
This output function is evaluated when internal events occur. Output events
should be placed into the bag yb.
void evolve_func(double h)
double next_event_func(bool& is_event)
void discrete_action_func(const Bag<X>& xb)
void discrete_output_func(Bag<X>& yb)
~rk4()
- Destructor
- This class has no child classes.
Alphabetic index HTML hierarchy of classes or Java
This page was generated with the help of DOC++.