org.opensourcephysics.sip.ch19
Class ConstraintsApp

java.lang.Object
  extended by org.opensourcephysics.controls.AbstractAnimation
      extended by org.opensourcephysics.controls.AbstractSimulation
          extended by org.opensourcephysics.sip.ch19.ConstraintsApp
All Implemented Interfaces:
java.lang.Runnable, Animation, Simulation, ODE

public class ConstraintsApp
extends AbstractSimulation
implements ODE


Field Summary
 
Fields inherited from class org.opensourcephysics.controls.AbstractSimulation
control, showStepsPerDisplay, stepCounter, stepsPerDisplay
 
Fields inherited from class org.opensourcephysics.controls.AbstractAnimation
animationThread, decimalFormat, delayTime, mainFrame
 
Constructor Summary
ConstraintsApp()
           
 
Method Summary
 void doStep()
          Does an animation step.
 void getRate(double[] state, double[] rate)
          Gets the rate of change using the argument's state variables.
 double[] getState()
          Gets the state variables.
 void initialize()
          Initializes the simulation.
static void main(java.lang.String[] args)
           
 void reset()
          Resets the simulation to its default state.
 void startRunning()
          Performs an action before executing one or more animation steps.
 
Methods inherited from class org.opensourcephysics.controls.AbstractSimulation
enableStepsPerDisplay, getControl, getLoader, getStepCounter, getStepsPerDisplay, initializeAnimation, resetAnimation, run, setControl, setStepsPerDisplay, start, startAnimation, startSimulation, stepAnimation, stop, stopAnimation, stopRunning, stopSimulation
 
Methods inherited from class org.opensourcephysics.controls.AbstractAnimation
addChildFrame, clearChildFrames, getChildFrames, getDelayTime, getMainFrame, getOSPApp, isRunning, setDelayTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.opensourcephysics.controls.Simulation
isRunning
 

Constructor Detail

ConstraintsApp

public ConstraintsApp()
Method Detail

getState

public double[] getState()
Description copied from interface: ODE
Gets the state variables. The getState method is invoked by an ODESolver to obtain the initial state of the system. The ODE solver advances the solution and then copies new values into the state array at the end of the solution step.

Specified by:
getState in interface ODE
Returns:
state the state

getRate

public void getRate(double[] state,
                    double[] rate)
Description copied from interface: ODE
Gets the rate of change using the argument's state variables. This method may be invoked many times with different intermediate states as an ODESolver is carrying out the solution.

Specified by:
getRate in interface ODE
Parameters:
state - the state array
rate - the rate array

initialize

public void initialize()
Description copied from class: AbstractSimulation
Initializes the simulation. Override this method to initialize a concrete simulation.

Overrides:
initialize in class AbstractSimulation

doStep

public void doStep()
Description copied from class: AbstractAnimation
Does an animation step.

Specified by:
doStep in class AbstractAnimation

startRunning

public void startRunning()
Description copied from class: AbstractSimulation
Performs an action before executing one or more animation steps.

Overrides:
startRunning in class AbstractSimulation

reset

public void reset()
Description copied from class: AbstractSimulation
Resets the simulation to its default state. Override this method to set the simulation's parameters.

Overrides:
reset in class AbstractSimulation

main

public static void main(java.lang.String[] args)