javax.robotics.ode
Class Euler

java.lang.Object
  extended by javax.robotics.ode.Euler
All Implemented Interfaces:
DerivableFunction, Solver
Direct Known Subclasses:
Heun, RungeKutta4th

public class Euler
extends java.lang.Object
implements Solver, DerivableFunction

This class implements forward Euler integration method.

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

Field Summary
 
Fields inherited from interface javax.robotics.ode.Solver
startTime
 
Constructor Summary
Euler(double dt, RVector initialCondition, DerivableFunction target)
          Defines numerical integration for x' = f(x) differential equation.
 
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).
 RVector xDot(RVector x)
          Derivate prime function x' = f(x).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Euler

public Euler(double dt,
             RVector initialCondition,
             DerivableFunction target)
Defines numerical integration for x' = f(x) differential equation.

Parameters:
dt - time interval of integration [sec]
initialCondition - initial condition at time zero x(0).
target - differential equation to be integrated
Method Detail

setSampleTime

public final void setSampleTime(double dt)
Description copied from interface: Solver
Sets the interval of integration.

Specified by:
setSampleTime in interface Solver
Parameters:
dt - interval [sec]

getSampleTime

public final double getSampleTime()
Description copied from interface: Solver
Gets the interval of integration.

Specified by:
getSampleTime in interface Solver
Returns:
the dt interval [sec]

setInitialCondition

public final void setInitialCondition(RVector initialCondition)
Description copied from interface: Solver
Sets the initial condition for position x(0) = x0.

Specified by:
setInitialCondition in interface Solver

getInitialCondition

public final RVector getInitialCondition()
Description copied from interface: Solver
Gets the initial condition for position x(0).

Specified by:
getInitialCondition in interface Solver
Returns:
the initialCondition

getLastValue

public final RVector getLastValue()
Description copied from interface: Solver
Gets the current value of position x computed by step function.

Specified by:
getLastValue in interface Solver
Returns:
the current position.

getTime

public final double getTime()
Description copied from interface: Solver
Gets current time of integration.

Specified by:
getTime in interface Solver
Returns:
the current time [sec]

step

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

Specified by:
step in interface Solver
Parameters:
x - argument of f(x)

xDot

public RVector xDot(RVector x)
Description copied from interface: DerivableFunction
Derivate prime function x' = f(x).

Specified by:
xDot in interface DerivableFunction
Parameters:
x - indipendent variable
Returns:
derivate prime