private class FirstOrderIntegratorWithJacobians.FiniteDifferencesWrapper extends java.lang.Object implements ODEWithJacobians
Modifier and Type | Field and Description |
---|---|
private double[] |
hP
Step sizes to use for computing the jacobian df/dp.
|
private double[] |
hY
Step sizes to use for computing the jacobian df/dy.
|
private ParameterizedODE |
ode
Raw ODE without jacobians computation.
|
private double[] |
p
Parameters array (may be null if parameters dimension from original problem is zero)
|
private double[] |
tmpDot
Temporary array for state derivatives used to compute jacobians.
|
Constructor and Description |
---|
FirstOrderIntegratorWithJacobians.FiniteDifferencesWrapper(ParameterizedODE ode,
double[] p,
double[] hY,
double[] hP)
Simple constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
computeDerivatives(double t,
double[] y,
double[] yDot)
Get the current time derivative of the state vector.
|
void |
computeJacobians(double t,
double[] y,
double[] yDot,
double[][] dFdY,
double[][] dFdP)
Compute the partial derivatives of ODE with respect to state.
|
int |
getDimension()
Get the dimension of the problem.
|
int |
getParametersDimension()
Get the number of parameters.
|
private final ParameterizedODE ode
private final double[] p
private final double[] hY
private final double[] hP
private final double[] tmpDot
public FirstOrderIntegratorWithJacobians.FiniteDifferencesWrapper(ParameterizedODE ode, double[] p, double[] hY, double[] hP)
ode
- original ODE problem, without jacobians computationsp
- parameters array (may be null if parameters dimension from original problem is zero)hY
- step sizes to use for computing the jacobian df/dyhP
- step sizes to use for computing the jacobian df/dppublic int getDimension()
getDimension
in interface FirstOrderDifferentialEquations
public void computeDerivatives(double t, double[] y, double[] yDot) throws DerivativeException
computeDerivatives
in interface FirstOrderDifferentialEquations
t
- current value of the independent time variabley
- array containing the current value of the state vectoryDot
- placeholder array where to put the time derivative of the state vectorDerivativeException
- this user-defined exception should be used if an error is
is triggered by user codepublic int getParametersDimension()
getParametersDimension
in interface ODEWithJacobians
public void computeJacobians(double t, double[] y, double[] yDot, double[][] dFdY, double[][] dFdP) throws DerivativeException
computeJacobians
in interface ODEWithJacobians
t
- current value of the independent time variabley
- array containing the current value of the state vectoryDot
- array containing the current value of the time derivative of the state vectordFdY
- placeholder array where to put the jacobian of the ODE with respect to the state vectordFdP
- placeholder array where to put the jacobian of the ODE with respect to the parametersDerivativeException
- this exception is propagated to the caller if the
underlying user function triggers oneCopyright (c) 2003-2013 Apache Software Foundation