nl.tudelft.simulation.jstats.ode
Class DifferentialEquation

java.lang.Object
  extended by nl.tudelft.simulation.event.EventProducer
      extended by nl.tudelft.simulation.jstats.ode.DifferentialEquation
All Implemented Interfaces:
Serializable, EventProducerInterface, DifferentialEquationInterface

public abstract class DifferentialEquation
extends EventProducer
implements DifferentialEquationInterface

The DifferentialEquation is the abstract basis for

(c) copyright 2002-2005 Delft University of Technology , the Netherlands.
See for project information www.simulation.tudelft.nl
License of use: Lesser General Public License (LGPL) , no warranty.

Since:
1.4
Version:
$Revision: 1.1 $ $Date: 2007/01/06 13:25:44 $
Author:
Peter Jacobs
See Also:
Serialized Form

Field Summary
protected  double timeStep
          a timeStep
protected  double x0
          the first x value to start integration
protected  double[] y0
          the initial value array
 
Fields inherited from class nl.tudelft.simulation.event.EventProducer
listeners
 
Fields inherited from interface nl.tudelft.simulation.event.EventProducerInterface
FIRST_POSITION, LAST_POSITION
 
Constructor Summary
DifferentialEquation(double timeStep)
          constructs a new DifferentialEquation with default integrator.
DifferentialEquation(double timeStep, NumericalIntegrator integrator)
          constructs a new DifferentialEquation with a user-specified integrator.
DifferentialEquation(double timeStep, short integrationMethod)
          constructs a new DifferentialEquation with a preselected integrator.
 
Method Summary
 NumericalIntegrator getIntegrator()
           
 void initialize(double x, double[] y)
          initializes the differential equation
protected  double[] integrateY(double x, double initialX, double[] initialY)
          integrates Y
 void setIntegrator(NumericalIntegrator integrator)
           
 double[] y(double x)
          returns y as a function of x
 
Methods inherited from class nl.tudelft.simulation.event.EventProducer
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, getEventTypes, removeAllListeners, removeAllListeners, removeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface nl.tudelft.simulation.jstats.ode.DifferentialEquationInterface
dy
 

Field Detail

y0

protected double[] y0
the initial value array


timeStep

protected double timeStep
a timeStep


x0

protected double x0
the first x value to start integration

Constructor Detail

DifferentialEquation

public DifferentialEquation(double timeStep)
constructs a new DifferentialEquation with default integrator.

Parameters:
timeStep - the timeStep to use.

DifferentialEquation

public DifferentialEquation(double timeStep,
                            NumericalIntegrator integrator)
constructs a new DifferentialEquation with a user-specified integrator.

Parameters:
timeStep - the timeStep to use.
integrator - the integrator to use.

DifferentialEquation

public DifferentialEquation(double timeStep,
                            short integrationMethod)
constructs a new DifferentialEquation with a preselected integrator.

Parameters:
timeStep - the timeStep to use.
integrationMethod - the integrator to use.
Method Detail

initialize

public void initialize(double x,
                       double[] y)
Description copied from interface: DifferentialEquationInterface
initializes the differential equation

Specified by:
initialize in interface DifferentialEquationInterface
Parameters:
x - the x-value
y - the y-value
See Also:
DifferentialEquationInterface.initialize(double, double[])

y

public double[] y(double x)
Description copied from interface: DifferentialEquationInterface
returns y as a function of x

Specified by:
y in interface DifferentialEquationInterface
Parameters:
x - the x-value
Returns:
y
See Also:
DifferentialEquationInterface.y(double)

integrateY

protected double[] integrateY(double x,
                              double initialX,
                              double[] initialY)
integrates Y

Parameters:
x - the x-value
initialX - the initial X value
initialY - the initial Y value
Returns:
the new Y value

getIntegrator

public NumericalIntegrator getIntegrator()
Returns:
Returns the integrator.

setIntegrator

public void setIntegrator(NumericalIntegrator integrator)
Parameters:
integrator - The integrator to set.


Copyright © 2002-2011 Delft University of Technology, the Netherlands. All Rights Reserved.