Packageorg.MARS.dynamics.ode
Interfacepublic interface IODE
ImplementorsAbstractSolver, Euler, RigidBody, RK4, Robot, SimpleParticle

Imposes a structure that allows an IODESolver to advance its state. ODE stands for "Ordinary Differential Equation."

Although we sacrifice a decent amount of efficiency by stuffing our states and derivatives into Arrays, we gain a tremendous amount of modularity and extensibility. Provided an object implements IODE, and adheres to its structure, a completely swappable IODESolver can advance its state. In other words, it effectively decouples integration.

This implementation is a simplified interpretation of the one presented in Open-Source Physics: http://www.opensourcephysics.org/

See also

IODESolver
SimpleParticle


Public Properties
 PropertyDefined by
  state : Array
[read-only] Gets the state of the differential equation

Consider a particle with position x and velocity v.

IODE
Public Methods
 MethodDefined by
  
getDerivative(state:Array, derivative:Array):void
Populates the derivative according to the given state.
IODE
Property detail
stateproperty
state:Array  [read-only]

Gets the state of the differential equation

Consider a particle with position x and velocity v. We want to integrate this state with respect to time. The position and velocity are pushed into the particle's state Array and solved by an IODESolver. By abstracting the process this far, we make it easy to swap solvers for different tasks.

Implementation
    public function get state():Array

See also

Method detail
getDerivative()method
public function getDerivative(state:Array, derivative:Array):void

Populates the derivative according to the given state.

The IODESolver asks the IODE for its derivative- depending on the order and structure of the solver, this could happen numerous times per time step. It is the IODE's job to use that state to determine its derivative.

The derivative's indices map to the state's.

Parameters
state:Array — state with which to evaluate derivative
 
derivative:Array — Array to populate given state's derivatives with

See also

state
IODESolver
SimpleParticle