Class AdamsNordsieckTransformer
 java.lang.Object

 org.apache.commons.math4.legacy.ode.nonstiff.AdamsNordsieckTransformer

public final class AdamsNordsieckTransformer extends Object
Transformer to Nordsieck vectors for Adams integrators.This class is used by
AdamsBashforth
andAdamsMoulton
integrators to convert between classical representation with several previous first derivatives and Nordsieck representation with higher order scaled derivatives.We define scaled derivatives s_{i}(n) at step n as:
s_{1}(n) = h y'_{n} for first derivative s_{2}(n) = h^{2}/2 y''_{n} for second derivative s_{3}(n) = h^{3}/6 y'''_{n} for third derivative ... s_{k}(n) = h^{k}/k! y^{(k)}_{n} for k^{th} derivative
With the previous definition, the classical representation of multistep methods uses first derivatives only, i.e. it handles y_{n}, s_{1}(n) and q_{n} where q_{n} is defined as:
(we omit the k index in the notation for clarity).q_{n} = [ s_{1}(n1) s_{1}(n2) ... s_{1}(n(k1)) ]^{T}
Another possible representation uses the Nordsieck vector with higher degrees scaled derivatives all taken at the same step, i.e it handles y_{n}, s_{1}(n) and r_{n}) where r_{n} is defined as:
(here again we omit the k index in the notation for clarity)r_{n} = [ s_{2}(n), s_{3}(n) ... s_{k}(n) ]^{T}
Taylor series formulas show that for any index offset i, s_{1}(ni) can be computed from s_{1}(n), s_{2}(n) ... s_{k}(n), the formula being exact for degree k polynomials.
The previous formula can be used with several values for i to compute the transform between classical representation and Nordsieck vector at step end. The transform between r_{n} and q_{n} resulting from the Taylor series formulas above is:s_{1}(ni) = s_{1}(n) + ∑_{j>0} (j+1) (i)^{j} s_{j+1}(n)
where u is the [ 1 1 ... 1 ]^{T} vector and P is the (k1)×(k1) matrix built with the (j+1) (i)^{j} terms with i being the row number starting from 1 and j being the column number starting from 1:q_{n} = s_{1}(n) u + P r_{n}
[ 2 3 4 5 ... ] [ 4 12 32 80 ... ] P = [ 6 27 108 405 ... ] [ 8 48 256 1280 ... ] [ ... ]
Changing i into +i in the formula above can be used to compute a similar transform between classical representation and Nordsieck vector at step start. The resulting matrix is simply the absolute value of matrix P.
For
AdamsBashforth
method, the Nordsieck vector at step n+1 is computed from the Nordsieck vector at step n as follows: y_{n+1} = y_{n} + s_{1}(n) + u^{T} r_{n}
 s_{1}(n+1) = h f(t_{n+1}, y_{n+1})
 r_{n+1} = (s_{1}(n)  s_{1}(n+1)) P^{1} u + P^{1} A P r_{n}
[ 0 0 ... 0 0  0 ] [ +] [ 1 0 ... 0 0  0 ] A = [ 0 1 ... 0 0  0 ] [ ...  0 ] [ 0 0 ... 1 0  0 ] [ 0 0 ... 0 1  0 ]
For
AdamsMoulton
method, the predicted Nordsieck vector at step n+1 is computed from the Nordsieck vector at step n as follows: Y_{n+1} = y_{n} + s_{1}(n) + u^{T} r_{n}
 S_{1}(n+1) = h f(t_{n+1}, Y_{n+1})
 R_{n+1} = (s_{1}(n)  s_{1}(n+1)) P^{1} u + P^{1} A P r_{n}
 y_{n+1} = y_{n} + S_{1}(n+1) + [ 1 +1 1 +1 ... ±1 ] r_{n+1}
 s_{1}(n+1) = h f(t_{n+1}, y_{n+1})
 r_{n+1} = R_{n+1} + (s_{1}(n+1)  S_{1}(n+1)) P^{1} u
We observe that both methods use similar update formulas. In both cases a P^{1}u vector and a P^{1} A P matrix are used that do not depend on the state, they only depend on k. This class handles these transformations.
 Since:
 2.0


Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static AdamsNordsieckTransformer
getInstance(int nSteps)
Get the Nordsieck transformer for a given number of steps.int
getNSteps()
Deprecated.as of 3.6, this method is not used anymoreArray2DRowRealMatrix
initializeHighOrderDerivatives(double h, double[] t, double[][] y, double[][] yDot)
Initialize the high order scaled derivatives at step start.Array2DRowRealMatrix
updateHighOrderDerivativesPhase1(Array2DRowRealMatrix highOrder)
Update the high order scaled derivatives for Adams integrators (phase 1).void
updateHighOrderDerivativesPhase2(double[] start, double[] end, Array2DRowRealMatrix highOrder)
Update the high order scaled derivatives Adams integrators (phase 2).



Method Detail

getInstance
public static AdamsNordsieckTransformer getInstance(int nSteps)
Get the Nordsieck transformer for a given number of steps. Parameters:
nSteps
 number of steps of the multistep method (excluding the one being computed) Returns:
 Nordsieck transformer for the specified number of steps

getNSteps
@Deprecated public int getNSteps()
Deprecated.as of 3.6, this method is not used anymoreGet the number of steps of the method (excluding the one being computed). Returns:
 number of steps of the method (excluding the one being computed)

initializeHighOrderDerivatives
public Array2DRowRealMatrix initializeHighOrderDerivatives(double h, double[] t, double[][] y, double[][] yDot)
Initialize the high order scaled derivatives at step start. Parameters:
h
 step size to use for scalingt
 first steps timesy
 first steps statesyDot
 first steps derivatives Returns:
 Nordieck vector at start of first step (h^{2}/2 y''_{n}, h^{3}/6 y'''_{n} ... h^{k}/k! y^{(k)}_{n})

updateHighOrderDerivativesPhase1
public Array2DRowRealMatrix updateHighOrderDerivativesPhase1(Array2DRowRealMatrix highOrder)
Update the high order scaled derivatives for Adams integrators (phase 1).The complete update of high order derivatives has a form similar to:
this method computes the P^{1} A P r_{n} part.r_{n+1} = (s_{1}(n)  s_{1}(n+1)) P^{1} u + P^{1} A P r_{n}
 Parameters:
highOrder
 high order scaled derivatives (h^{2}/2 y'', ... h^{k}/k! y(k)) Returns:
 updated high order derivatives
 See Also:
updateHighOrderDerivativesPhase2(double[], double[], Array2DRowRealMatrix)

updateHighOrderDerivativesPhase2
public void updateHighOrderDerivativesPhase2(double[] start, double[] end, Array2DRowRealMatrix highOrder)
Update the high order scaled derivatives Adams integrators (phase 2).The complete update of high order derivatives has a form similar to:
this method computes the (s_{1}(n)  s_{1}(n+1)) P^{1} u part.r_{n+1} = (s_{1}(n)  s_{1}(n+1)) P^{1} u + P^{1} A P r_{n}
Phase 1 of the update must already have been performed.
 Parameters:
start
 first order scaled derivatives at step startend
 first order scaled derivatives at step endhighOrder
 high order scaled derivatives, will be modified (h^{2}/2 y'', ... h^{k}/k! y(k)) See Also:
updateHighOrderDerivativesPhase1(Array2DRowRealMatrix)

