private static class FirstOrderIntegratorWithJacobians.StepInterpolatorWrapper extends java.lang.Object implements StepInterpolatorWithJacobians
Modifier and Type | Field and Description |
---|---|
private double[][] |
dydp
Jacobian with respect to parameters dy/dp.
|
private double[][] |
dydpDot
Time derivative of the jacobian with respect to parameters dy/dp.
|
private double[][] |
dydy0
Jacobian with respect to initial state dy/dy0.
|
private double[][] |
dydy0Dot
Time derivative of the sacobian with respect to initial state dy/dy0.
|
private StepInterpolator |
interpolator
Wrapped interpolator.
|
private double[] |
y
State array.
|
private double[] |
yDot
Time derivative of the state array.
|
Constructor and Description |
---|
FirstOrderIntegratorWithJacobians.StepInterpolatorWrapper()
Simple constructor.
|
FirstOrderIntegratorWithJacobians.StepInterpolatorWrapper(StepInterpolator interpolator,
int n,
int k)
Simple constructor.
|
Modifier and Type | Method and Description |
---|---|
StepInterpolatorWithJacobians |
copy()
Copy the instance.
|
private static void |
copyArray(double[][] src,
double[][] dest)
Copy an array.
|
private static void |
copyArray(double[] src,
double[] dest)
Copy an array.
|
double |
getCurrentTime()
Get the current grid point time.
|
double[][] |
getInterpolatedDyDp()
Get the partial derivatives of the state vector with respect to
the ODE parameters of the interpolated point.
|
double[][] |
getInterpolatedDyDpDot()
Get the time derivatives of the jacobian of the state vector
with respect to the ODE parameters of the interpolated point.
|
double[][] |
getInterpolatedDyDy0()
Get the partial derivatives of the state vector with respect to
the initial state of the interpolated point.
|
double[][] |
getInterpolatedDyDy0Dot()
Get the time derivatives of the jacobian of the state vector
with respect to the initial state of the interpolated point.
|
double |
getInterpolatedTime()
Get the time of the interpolated point.
|
double[] |
getInterpolatedY()
Get the state vector of the interpolated point.
|
double[] |
getInterpolatedYDot()
Get the time derivatives of the state vector of the interpolated point.
|
double |
getPreviousTime()
Get the previous grid point time.
|
boolean |
isForward()
Check if the natural integration direction is forward.
|
private static void |
readArray(java.io.ObjectInput in,
double[] array)
Read an array.
|
private static void |
readArray(java.io.ObjectInput in,
double[][] array)
Read an array.
|
void |
readExternal(java.io.ObjectInput in) |
void |
setInterpolatedTime(double time)
Set the time of the interpolated point.
|
private static void |
writeArray(java.io.ObjectOutput out,
double[] array)
Write an array.
|
private static void |
writeArray(java.io.ObjectOutput out,
double[][] array)
Write an array.
|
void |
writeExternal(java.io.ObjectOutput out) |
private StepInterpolator interpolator
private double[] y
private double[][] dydy0
private double[][] dydp
private double[] yDot
private double[][] dydy0Dot
private double[][] dydpDot
public FirstOrderIntegratorWithJacobians.StepInterpolatorWrapper()
This constructor is used only for externalization. It does nothing.
public FirstOrderIntegratorWithJacobians.StepInterpolatorWrapper(StepInterpolator interpolator, int n, int k)
interpolator
- wrapped interpolatorn
- dimension of the original ODEk
- number of parameterspublic void setInterpolatedTime(double time)
Setting the time outside of the current step is now allowed, but should be used with care since the accuracy of the interpolator will probably be very poor far from this step. This allowance has been added to simplify implementation of search algorithms near the step endpoints.
Setting the time changes the instance internal state. If a
specific state must be preserved, a copy of the instance must be
created using StepInterpolatorWithJacobians.copy()
.
setInterpolatedTime
in interface StepInterpolatorWithJacobians
time
- time of the interpolated pointpublic boolean isForward()
This method provides the integration direction as specified by the integrator itself, it avoid some nasty problems in degenerated cases like null steps due to cancellation at step initialization, step control or discrete events triggering.
isForward
in interface StepInterpolatorWithJacobians
public double getPreviousTime()
getPreviousTime
in interface StepInterpolatorWithJacobians
public double getInterpolatedTime()
StepInterpolatorWithJacobians.setInterpolatedTime(double)
has not been called, it returns
the current grid point time.getInterpolatedTime
in interface StepInterpolatorWithJacobians
public double[] getInterpolatedY() throws DerivativeException
The returned vector is a reference to a reused array, so it should not be modified and it should be copied if it needs to be preserved across several calls.
getInterpolatedY
in interface StepInterpolatorWithJacobians
StepInterpolatorWithJacobians.getInterpolatedTime()
DerivativeException
- if this call induces an automatic
step finalization that throws oneStepInterpolatorWithJacobians.getInterpolatedYDot()
public double[][] getInterpolatedDyDy0() throws DerivativeException
The returned vector is a reference to a reused array, so it should not be modified and it should be copied if it needs to be preserved across several calls.
getInterpolatedDyDy0
in interface StepInterpolatorWithJacobians
StepInterpolatorWithJacobians.getInterpolatedTime()
DerivativeException
- if this call induces an automatic
step finalization that throws oneStepInterpolatorWithJacobians.getInterpolatedY()
public double[][] getInterpolatedDyDp() throws DerivativeException
The returned vector is a reference to a reused array, so it should not be modified and it should be copied if it needs to be preserved across several calls.
getInterpolatedDyDp
in interface StepInterpolatorWithJacobians
StepInterpolatorWithJacobians.getInterpolatedTime()
DerivativeException
- if this call induces an automatic
step finalization that throws oneStepInterpolatorWithJacobians.getInterpolatedY()
public double[] getInterpolatedYDot() throws DerivativeException
The returned vector is a reference to a reused array, so it should not be modified and it should be copied if it needs to be preserved across several calls.
getInterpolatedYDot
in interface StepInterpolatorWithJacobians
StepInterpolatorWithJacobians.getInterpolatedTime()
DerivativeException
- if this call induces an automatic
step finalization that throws oneStepInterpolatorWithJacobians.getInterpolatedY()
public double[][] getInterpolatedDyDy0Dot() throws DerivativeException
The returned vector is a reference to a reused array, so it should not be modified and it should be copied if it needs to be preserved across several calls.
getInterpolatedDyDy0Dot
in interface StepInterpolatorWithJacobians
StepInterpolatorWithJacobians.getInterpolatedTime()
DerivativeException
- if this call induces an automatic
step finalization that throws oneStepInterpolatorWithJacobians.getInterpolatedY()
public double[][] getInterpolatedDyDpDot() throws DerivativeException
The returned vector is a reference to a reused array, so it should not be modified and it should be copied if it needs to be preserved across several calls.
getInterpolatedDyDpDot
in interface StepInterpolatorWithJacobians
StepInterpolatorWithJacobians.getInterpolatedTime()
DerivativeException
- if this call induces an automatic
step finalization that throws oneStepInterpolatorWithJacobians.getInterpolatedY()
public double getCurrentTime()
getCurrentTime
in interface StepInterpolatorWithJacobians
public StepInterpolatorWithJacobians copy() throws DerivativeException
The copied instance is guaranteed to be independent from the original one. Both can be used with different settings for interpolated time without any side effect.
copy
in interface StepInterpolatorWithJacobians
DerivativeException
- if this call induces an automatic
step finalization that throws oneStepInterpolatorWithJacobians.setInterpolatedTime(double)
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException
private static void copyArray(double[] src, double[] dest)
src
- source arraydest
- destination arrayprivate static void copyArray(double[][] src, double[][] dest)
src
- source arraydest
- destination arrayprivate static void writeArray(java.io.ObjectOutput out, double[] array) throws java.io.IOException
out
- output streamarray
- array to writejava.io.IOException
- if array cannot be readprivate static void writeArray(java.io.ObjectOutput out, double[][] array) throws java.io.IOException
out
- output streamarray
- array to writejava.io.IOException
- if array cannot be readprivate static void readArray(java.io.ObjectInput in, double[] array) throws java.io.IOException
in
- input streamarray
- array to readjava.io.IOException
- if array cannot be readprivate static void readArray(java.io.ObjectInput in, double[][] array) throws java.io.IOException
in
- input streamarray
- array to readjava.io.IOException
- if array cannot be readCopyright (c) 2003-2016 Apache Software Foundation