nl.tudelft.simulation.jstats.ode.integrators
Class CachingNumericalIntegrator

java.lang.Object
  extended by nl.tudelft.simulation.jstats.ode.integrators.NumericalIntegrator
      extended by nl.tudelft.simulation.jstats.ode.integrators.CachingNumericalIntegrator
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
Adams, Milne

public abstract class CachingNumericalIntegrator
extends NumericalIntegrator

The CachingNumericalIntegrator is the basis for an integrator that needs access to previously calculated values of y', e.g. y'_(k-1), y'_(k-2), etc.
(c) copyright 2002-2005-2004 Delft University of Technology , the Netherlands.
See for project information www.simulation.tudelft.nl
License of use: Lesser General Public License (LGPL) , no warranty.

Version:
$Revision: 1.1 $ $Date: 2007/01/06 13:25:42 $
Author:
Alexander Verbraeck
See Also:
Serialized Form

Field Summary
protected  NumericalIntegrator startingIntegrator
          the primer integrator
protected  int startingSubSteps
          the substeps to use when starting the integrator
 
Fields inherited from class nl.tudelft.simulation.jstats.ode.integrators.NumericalIntegrator
ADAMS, DEFAULT_INTEGRATOR, equation, error, EULER, GILL, HEUN, MILNE, RUNGEKUTTA3, RUNGEKUTTA4, RUNGEKUTTACASHCARP, RUNGEKUTTAFEHLBERG, timeStep
 
Constructor Summary
CachingNumericalIntegrator(double timeStep, DifferentialEquationInterface equation, int cachePlaces, short integrationMethod, int startingSubSteps)
          constructs a new CachingNumericalIntegrator with a fixed number of cache places.
 
Method Summary
 double[] getDY(int numberDown)
          get a cached dY-value,
 double[] getY(int numberDown)
          get a cached Y-value,
abstract  double[] next(double x)
          The integrators that extend the CachingNumericalIntegrator calculate the value of y(x+timeStep) just based on the x-value.
 double[] next(double x, double[] y)
          computes the next value
 void setTimeStep(double timeStep)
           
 
Methods inherited from class nl.tudelft.simulation.jstats.ode.integrators.NumericalIntegrator
add, add, add, add, add, getError, getTimeStep, multiply, resolve
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

startingIntegrator

protected NumericalIntegrator startingIntegrator
the primer integrator


startingSubSteps

protected int startingSubSteps
the substeps to use when starting the integrator

Constructor Detail

CachingNumericalIntegrator

public CachingNumericalIntegrator(double timeStep,
                                  DifferentialEquationInterface equation,
                                  int cachePlaces,
                                  short integrationMethod,
                                  int startingSubSteps)
constructs a new CachingNumericalIntegrator with a fixed number of cache places.

Parameters:
timeStep - the timeStep
equation - the differentialEquation
cachePlaces - the number of cache places to store
integrationMethod - the primer integrator to use
startingSubSteps - the number of substeps per timestep during starting of the integrator
Method Detail

setTimeStep

public void setTimeStep(double timeStep)
Overrides:
setTimeStep in class NumericalIntegrator
Parameters:
timeStep - The timeStep to set.
See Also:
NumericalIntegrator.setTimeStep(double)

next

public double[] next(double x,
                     double[] y)
Description copied from class: NumericalIntegrator
computes the next value

Specified by:
next in class NumericalIntegrator
Parameters:
x - the x value corresponding to the last y-value computed
y - the last y value
Returns:
the new value
See Also:
NumericalIntegrator.next(double, double[])

getY

public double[] getY(int numberDown)
get a cached Y-value,

Parameters:
numberDown - the number of the previous value we want
Returns:
the corresponding Y-value

getDY

public double[] getDY(int numberDown)
get a cached dY-value,

Parameters:
numberDown - the number of the previous value we want
Returns:
the corresponding dY-value

next

public abstract double[] next(double x)
The integrators that extend the CachingNumericalIntegrator calculate the value of y(x+timeStep) just based on the x-value. They retrieve y(x), y(x-timeStep), etc. or y(k), y(k-1) all from the cache.

Parameters:
x - the x-value to use in the calculation
Returns:
the value of y(x+timeStep)


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