org.opensourcephysics.numerics.dde_solvers.interpolation
Class IntervalData

java.lang.Object
  extended by org.opensourcephysics.numerics.dde_solvers.interpolation.IntervalData
Direct Known Subclasses:
EulerIntervalData, EulerRichardsonIntervalData, ExtraStepsIntervalData, HermiteIntervalData, InitialConditionData

public abstract class IntervalData
extends java.lang.Object

An IntervalData keeps information of an ODE state in an interval [left, right] and uses it to interpolate the state in that interval. The left value cannot be changed, the right value can be adjusted in case the solver finds a discontinuity.

Version:
Feb 2011
Author:
Francisco Esquembre, Maria Jose Cano

Constructor Summary
IntervalData()
           
 
Method Summary
 boolean endsAtDiscontinuity()
          Whether the interval ends at a discontinuity of the solution
 double getLeft()
          Returns the left side of the interval
 double getRight()
          Returns the right side of the interval
 double[] interpolate(double time, double[] state)
          Returns the interpolation of the complete state at the given time
abstract  double[] interpolate(double time, double[] state, int beginIndex, int length)
          Returns the interpolation of the state at the given time only for the given indexes
abstract  double interpolate(double time, int index)
          Returns the interpolation of one index of the state at the given time
 void setEndsAtDiscontinuity(double right)
          Changes the right side of the interval
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntervalData

public IntervalData()
Method Detail

getLeft

public final double getLeft()
Returns the left side of the interval

Returns:

getRight

public final double getRight()
Returns the right side of the interval

Returns:

setEndsAtDiscontinuity

public void setEndsAtDiscontinuity(double right)
Changes the right side of the interval

Parameters:
rightSide -

endsAtDiscontinuity

public boolean endsAtDiscontinuity()
Whether the interval ends at a discontinuity of the solution

Returns:

interpolate

public abstract double interpolate(double time,
                                   int index)
Returns the interpolation of one index of the state at the given time

Parameters:
time - the time for the interpolation

interpolate

public final double[] interpolate(double time,
                                  double[] state)
Returns the interpolation of the complete state at the given time

Parameters:
time - the time for the interpolation
state - a placeholder for the returned state

interpolate

public abstract double[] interpolate(double time,
                                     double[] state,
                                     int beginIndex,
                                     int length)
Returns the interpolation of the state at the given time only for the given indexes

Parameters:
time - the time for the interpolation
state - a placeholder for the returned state