|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmath.numerics.Verlet
public class Verlet
Verlet method ODE solver. The Verlet algorithm is a third order algorithm that uses the acceleration to estimate the final position. Note that the velocity plays no part in the integration of the equations. x(n+1) = 2*x(n) - x(n-1) + a(n)*dt*dt v(n+1) = (x(n+1) - x(n-1))/(2 dt) + a(n)*dt CAUTION! You MUST call the initialize if the state array is changed. The Verlet algorithm is not self-starting. The current state and a prior state must both be known to advance the solution. Since the prior state is not known for the initial conditions, a prior state is estimated when the initialize method is invoked. CAUTION! This implementation assumes that the state vector has 2*N + 1 variables. These variables alternate between position and velocity with the last variable being time. That is, the state vector is ordered as follows: x1, d x1/dt, x2, d x2/dt, x3, d x3/dt ..... xN, d xN/dt, t
Constructor Summary | |
---|---|
Verlet(ODE _ode)
Constructs the VelocityVerlet ODESolver for a system of ordinary differential equations. |
Method Summary | |
---|---|
double |
getStepSize()
Gets the step size. |
void |
initialize(double _stepSize)
Initializes the ODE solver. |
void |
setStepSize(double _stepSize)
Sets the step size. |
double |
step()
Steps (advances) the differential equations by the stepSize. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Verlet(ODE _ode)
_ode
- the system of differential equations.Method Detail |
---|
public void initialize(double _stepSize)
initialize
in interface ODESolver
_stepSize
- public double step()
step
in interface ODESolver
public void setStepSize(double _stepSize)
setStepSize
in interface ODESolver
_stepSize
- public double getStepSize()
getStepSize
in interface ODESolver
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |