|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmath.numerics.VelocityVerlet
public class VelocityVerlet
VelocityVerlet: A velocity Verlet method ODE solver. The velocity Verlet algorithm is a self-starting equivalent of the Verlet algorithm. It assumes a constant acceleration to estimate the final position and an average accleration to estimate the final velocity. The position is first updated, the force is calcualted affineTransform the new position, and then the velocity is updated. x(n+1) = x(n) + v(n)* dt + a(n)*dt*dt/2 a_est=F(x(n+1),v(n),t)/m v(n+1) = v(n) + (a(n)+a_est)*dt/2 CAUTION! The ODE interface produces an inefficient implementation of the velocity Verlet algorithm since the force is evaluated twice. The velocity Verlet algorithm is usually coded directly into the model so that the force need only be evaluated once. 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 | |
---|---|
VelocityVerlet(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 VelocityVerlet(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 |