|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.math.ode.jacobians.FirstOrderIntegratorWithJacobians.StepInterpolatorWrapper
private static class FirstOrderIntegratorWithJacobians.StepInterpolatorWrapper
Wrapper for step interpolators.
Field Summary | |
---|---|
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 Summary | |
---|---|
FirstOrderIntegratorWithJacobians.StepInterpolatorWrapper()
Simple constructor. |
|
FirstOrderIntegratorWithJacobians.StepInterpolatorWrapper(StepInterpolator interpolator,
int n,
int k)
Simple constructor. |
Method Summary | |
---|---|
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(ObjectInput in,
double[] array)
Read an array. |
private static void |
readArray(ObjectInput in,
double[][] array)
Read an array. |
void |
readExternal(ObjectInput in)
|
void |
setInterpolatedTime(double time)
Set the time of the interpolated point. |
private static void |
writeArray(ObjectOutput out,
double[] array)
Write an array. |
private static void |
writeArray(ObjectOutput out,
double[][] array)
Write an array. |
void |
writeExternal(ObjectOutput out)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private StepInterpolator interpolator
private double[] y
private double[][] dydy0
private double[][] dydp
private double[] yDot
private double[][] dydy0Dot
private double[][] dydpDot
Constructor Detail |
---|
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 parametersMethod Detail |
---|
public 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(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
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(ObjectOutput out, double[] array) throws IOException
out
- output streamarray
- array to write
IOException
- if array cannot be readprivate static void writeArray(ObjectOutput out, double[][] array) throws IOException
out
- output streamarray
- array to write
IOException
- if array cannot be readprivate static void readArray(ObjectInput in, double[] array) throws IOException
in
- input streamarray
- array to read
IOException
- if array cannot be readprivate static void readArray(ObjectInput in, double[][] array) throws IOException
in
- input streamarray
- array to read
IOException
- if array cannot be read
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |