org.opensourcephysics.sip.ch03
Class FallingParticleODE

java.lang.Object
  extended by org.opensourcephysics.sip.ch03.FallingParticleODE
All Implemented Interfaces:
ODE

public class FallingParticleODE
extends java.lang.Object
implements ODE

FallingParticleODE models a falling particle by implementing the ODE interface.


Constructor Summary
FallingParticleODE(double y, double v)
          Constructs the FallingParticleODE model with the given intial postion and velocity.
 
Method Summary
 void getRate(double[] state, double[] rate)
          Gets the rate array.
 double[] getState()
          Gets the state array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FallingParticleODE

public FallingParticleODE(double y,
                          double v)
Constructs the FallingParticleODE model with the given intial postion and velocity.

Parameters:
y - double
v - double
Method Detail

getState

public double[] getState()
Gets the state array. Required to implement ODE interface

Specified by:
getState in interface ODE
Returns:
double[]

getRate

public void getRate(double[] state,
                    double[] rate)
Gets the rate array. Required to implement ODE interface The rate is computed using the given state, not the object's state.

Specified by:
getRate in interface ODE
Parameters:
state - double[]
rate - double[]