## org.apache.commons.math.ode.nonstiff
Class GillStepInterpolator

    java.lang.Object
      org.apache.commons.math.ode.sampling.AbstractStepInterpolator
          org.apache.commons.math.ode.nonstiff.RungeKuttaStepInterpolator
              org.apache.commons.math.ode.nonstiff.GillStepInterpolator

All Implemented Interfaces:
  java.io.Externalizable, java.io.Serializable, StepInterpolator

     class GillStepInterpolator

extends RungeKuttaStepInterpolator

This class implements a step interpolator for the Gill fourth order Runge-Kutta integrator.

This interpolator allows to compute dense output inside the last step computed. The interpolation equation is consistent with the integration scheme :

       y(t_n + theta h) = y (t_n + h)
                        - (1 - theta) (h/6) [ (1 - theta) (1 - 4 theta) y'_1
                                            + (1 - theta) (1 + 2 theta) ((2-q) y'_2 + (2+q) y'_3)
                                            + (1 + theta + 4 theta^2) y'_4
                                            ]

where theta belongs to [0 ; 1], q = sqrt(2) and where y'_1 to y'_4 are the four evaluations of the derivatives already computed during the step.

Since:
  1.2
Version:
  $Revision: 811827 $ $Date: 2009-09-06 11:32:50 -0400 (Sun, 06 Sep 2009) $
See Also:
  `GillIntegrator`

Field Summary
`private static long` `serialVersionUID` Serializable version identifier
`private static double` `TWO_MINUS_SQRT_2` First Gill coefficient.
`private static double` `TWO_PLUS_SQRT_2` Second Gill coefficient.

Fields inherited from class org.apache.commons.math.ode.nonstiff.RungeKuttaStepInterpolator
`integrator, yDotK`

Fields inherited from class org.apache.commons.math.ode.sampling.AbstractStepInterpolator
`currentState, currentTime, h, interpolatedDerivatives, interpolatedState, interpolatedTime, previousTime`

Constructor Summary
`GillStepInterpolator()` Simple constructor.
`GillStepInterpolator(GillStepInterpolator interpolator)` Copy constructor.

Method Summary
`protected void` `computeInterpolatedStateAndDerivatives(double theta, double oneMinusThetaH)` Compute the state and derivatives at the interpolated time.
`protected StepInterpolator` `doCopy()` Really copy the finalized instance.

Methods inherited from class org.apache.commons.math.ode.nonstiff.RungeKuttaStepInterpolator
`readExternal, reinitialize, writeExternal`

Methods inherited from class org.apache.commons.math.ode.sampling.AbstractStepInterpolator
`copy, doFinalize, finalizeStep, getCurrentTime, getInterpolatedDerivatives, getInterpolatedState, getInterpolatedTime, getPreviousTime, isForward, readBaseExternal, reinitialize, setInterpolatedTime, shift, storeTime, writeBaseExternal`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### TWO_MINUS_SQRT_2

    private static final double TWO_MINUS_SQRT_2

  First Gill coefficient.

### TWO_PLUS_SQRT_2

    private static final double TWO_PLUS_SQRT_2

  Second Gill coefficient.

### serialVersionUID

    private static final long serialVersionUID

  Serializable version identifier

  See Also:
    Constant Field Values

Constructor Detail

### GillStepInterpolator

    public GillStepInterpolator()

  Simple constructor. This constructor builds an instance that is not usable yet, the `AbstractStepInterpolator.reinitialize(double[], boolean)` method should be called before using the instance in order to initialize the internal arrays. This constructor is used only in order to delay the initialization in some cases. The `RungeKuttaIntegrator` class uses the prototyping design pattern to create the step interpolators by cloning an uninitialized model and later initializing the copy.

### GillStepInterpolator

    public GillStepInterpolator(GillStepInterpolator interpolator)

  Copy constructor.

  Parameters:
    `interpolator` - interpolator to copy from. The copy is a deep copy: its arrays are separated from the original arrays of the instance

Method Detail

### doCopy

    protected StepInterpolator doCopy()

  Really copy the finalized instance.

  This method is called by `AbstractStepInterpolator.copy()` after the step has been finalized. It must perform a deep copy to have an new instance completely independent for the original instance.

  Specified by:
    `doCopy` in class `AbstractStepInterpolator`
  Returns:
    a copy of the finalized instance

### computeInterpolatedStateAndDerivatives

    protected void computeInterpolatedStateAndDerivatives(double theta,
                                                          double oneMinusThetaH)
                                                   throws DerivativeException

  Compute the state and derivatives at the interpolated time. This is the main processing method that should be implemented by the derived classes to perform the interpolation.

  Specified by:
    `computeInterpolatedStateAndDerivatives` in class `AbstractStepInterpolator`
  Parameters:
    `theta` - normalized interpolation abscissa within the step (theta is zero at the previous time step and one at the current time step)
    `oneMinusThetaH` - time gap between the interpolated time and the current time
  Throws:
    `DerivativeException` - this exception is propagated to the caller if the underlying user function triggers one

Copyright (c) 2003-2011 Apache Software Foundation