T - the type of the field elementspublic class AdamsNordsieckFieldTransformer<T extends RealFieldElement<T>> extends Object
This class is used by Adams-Bashforth and
Adams-Moulton integrators to convert between
classical representation with several previous first derivatives and Nordsieck
representation with higher order scaled derivatives.
We define scaled derivatives si(n) at step n as:
s1(n) = h y'n for first derivative
s2(n) = h2/2 y''n for second derivative
s3(n) = h3/6 y'''n for third derivative
...
sk(n) = hk/k! y(k)n for kth derivative
With the previous definition, the classical representation of multistep methods uses first derivatives only, i.e. it handles yn, s1(n) and qn where qn is defined as:
qn = [ s1(n-1) s1(n-2) ... s1(n-(k-1)) ]T
Another possible representation uses the Nordsieck vector with higher degrees scaled derivatives all taken at the same step, i.e it handles yn, s1(n) and rn) where rn is defined as:
rn = [ s2(n), s3(n) ... sk(n) ]T
Taylor series formulas show that for any index offset i, s1(n-i) can be computed from s1(n), s2(n) ... sk(n), the formula being exact for degree k polynomials.
s1(n-i) = s1(n) + ∑j>0 (j+1) (-i)j sj+1(n)
qn = s1(n) u + P rn
[ -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 Adams-Bashforth method, the Nordsieck vector
at step n+1 is computed from the Nordsieck vector at step n as follows:
[ 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 Adams-Moulton method, the predicted Nordsieck vector
at step n+1 is computed from the Nordsieck vector at step n as follows:
We observe that both methods use similar update formulas. In both cases a P-1u 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.
| Modifier and Type | Method | Description |
|---|---|---|
static <T extends RealFieldElement<T>> |
getInstance(Field<T> field,
int nSteps) |
Get the Nordsieck transformer for a given field and number of steps.
|
Array2DRowFieldMatrix<T> |
initializeHighOrderDerivatives(T h,
T[] t,
T[][] y,
T[][] yDot) |
Initialize the high order scaled derivatives at step start.
|
Array2DRowFieldMatrix<T> |
updateHighOrderDerivativesPhase1(Array2DRowFieldMatrix<T> highOrder) |
Update the high order scaled derivatives for Adams integrators (phase 1).
|
void |
updateHighOrderDerivativesPhase2(T[] start,
T[] end,
Array2DRowFieldMatrix<T> highOrder) |
Update the high order scaled derivatives Adams integrators (phase 2).
|
public static <T extends RealFieldElement<T>> AdamsNordsieckFieldTransformer<T> getInstance(Field<T> field, int nSteps)
T - the type of the field elementsfield - field to which the time and state vector elements belongnSteps - number of steps of the multistep method
(excluding the one being computed)public Array2DRowFieldMatrix<T> initializeHighOrderDerivatives(T h, T[] t, T[][] y, T[][] yDot)
h - step size to use for scalingt - first steps timesy - first steps statesyDot - first steps derivativespublic Array2DRowFieldMatrix<T> updateHighOrderDerivativesPhase1(Array2DRowFieldMatrix<T> highOrder)
The complete update of high order derivatives has a form similar to:
rn+1 = (s1(n) - s1(n+1)) P-1 u + P-1 A P rn
highOrder - high order scaled derivatives
(h2/2 y'', ... hk/k! y(k))updateHighOrderDerivativesPhase2(RealFieldElement[], RealFieldElement[], Array2DRowFieldMatrix)public void updateHighOrderDerivativesPhase2(T[] start, T[] end, Array2DRowFieldMatrix<T> highOrder)
The complete update of high order derivatives has a form similar to:
rn+1 = (s1(n) - s1(n+1)) P-1 u + P-1 A P rn
Phase 1 of the update must already have been performed.
start - first order scaled derivatives at step startend - first order scaled derivatives at step endhighOrder - high order scaled derivatives, will be modified
(h2/2 y'', ... hk/k! y(k))updateHighOrderDerivativesPhase1(Array2DRowFieldMatrix)Copyright © 2003–2017 The Apache Software Foundation. All rights reserved.