javax.robotics.ode
Interface Solver

All Known Implementing Classes:
Euler, Heun, RungeKutta4th

public interface Solver

This class is an interface for differents numerical integration methods of first order differential equations.
The implementation of a solver could be done writing:

 ...
 public MyODESolver implements DerivableFunction
 {
      ...
      RVector x0 = new RVector(n);
      // Creating the solver
      Solver mySolver = Euler(0.1, // time interval integration
                              x0,  // initial condition 
                              this // function xDot is passed to Solver
                             );
      ...
      
      // integration at time t+dt of x' = f(x) implemented by xDot(x) function
      x_dt = mySolver.step(x_t);
      
      // current time integration
      t_dt = mySolver.getTime();
      
      // current integrated value
      x_dt = mySolver.getLastValue();
      
      ...
      
      // implementation of x' = f(x)
      public RVector xDot(RVector x)
      {
          ...
          // code to calculate x' = f(x)
          ...
          return xdot;
      }
 }
 

Since:
1.0.0
Version:
09/11/2005
Author:
Carmine Lia

Field Summary
static double startTime
           
 
Method Summary
 RVector getInitialCondition()
          Gets the initial condition for position x(0).
 RVector getLastValue()
          Gets the current value of position x computed by step function.
 double getSampleTime()
          Gets the interval of integration.
 double getTime()
          Gets current time of integration.
 void setInitialCondition(RVector initialCondition)
          Sets the initial condition for position x(0) = x0.
 void setSampleTime(double dt)
          Sets the interval of integration.
 void step(RVector x)
          Computes step integration from time t to t+dt of x' = f(x).
 

Field Detail

startTime

static final double startTime
See Also:
Constant Field Values
Method Detail

setSampleTime

void setSampleTime(double dt)
Sets the interval of integration.

Parameters:
dt - interval [sec]

getSampleTime

double getSampleTime()
Gets the interval of integration.

Returns:
the dt interval [sec]

getTime

double getTime()
Gets current time of integration.

Returns:
the current time [sec]

setInitialCondition

void setInitialCondition(RVector initialCondition)
Sets the initial condition for position x(0) = x0.

Parameters:
initialCondition -

getInitialCondition

RVector getInitialCondition()
Gets the initial condition for position x(0).

Returns:
the initialCondition

getLastValue

RVector getLastValue()
Gets the current value of position x computed by step function.

Returns:
the current position.

step

void step(RVector x)
Computes step integration from time t to t+dt of x' = f(x). The params last value position is modified.

Parameters:
x - argument of f(x)