public abstract class DifferentialEquation extends nl.tudelft.simulation.event.EventProducer implements DifferentialEquationInterface
(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.
| Modifier and Type | Field and Description |
|---|---|
protected double |
timeStep
a timeStep
|
protected double |
x0
the first x value to start integration
|
protected double[] |
y0
the initial value array
|
| Constructor and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
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
|
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, getEventTypes, removeAllListeners, removeAllListeners, removeListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdyprotected double[] y0
protected double timeStep
protected double x0
public DifferentialEquation(double timeStep)
timeStep - the timeStep to use.public DifferentialEquation(double timeStep,
NumericalIntegrator integrator)
timeStep - the timeStep to use.integrator - the integrator to use.public DifferentialEquation(double timeStep,
short integrationMethod)
timeStep - the timeStep to use.integrationMethod - the integrator to use.public void initialize(double x,
double[] y)
DifferentialEquationInterfaceinitialize in interface DifferentialEquationInterfacex - the x-valuey - the y-valueDifferentialEquationInterface.initialize(double,
double[])public double[] y(double x)
DifferentialEquationInterfacey in interface DifferentialEquationInterfacex - the x-valueDifferentialEquationInterface.y(double)protected double[] integrateY(double x,
double initialX,
double[] initialY)
x - the x-valueinitialX - the initial X valueinitialY - the initial Y valuepublic NumericalIntegrator getIntegrator()
public void setIntegrator(NumericalIntegrator integrator)
integrator - The integrator to set.Copyright © 2002-2012 Delft University of Technology, the Netherlands. All Rights Reserved.