Package org.apache.commons.math3.ode
Class JacobianMatrices.MainStateJacobianWrapper
- java.lang.Object
-
- org.apache.commons.math3.ode.JacobianMatrices.MainStateJacobianWrapper
-
- All Implemented Interfaces:
FirstOrderDifferentialEquations
,MainStateJacobianProvider
- Enclosing class:
- JacobianMatrices
private static class JacobianMatrices.MainStateJacobianWrapper extends java.lang.Object implements MainStateJacobianProvider
Wrapper class to compute jacobian matrices by finite differences for ODE which do not compute them by themselves.
-
-
Field Summary
Fields Modifier and Type Field Description private double[]
hY
Steps for finite difference computation of the jacobian df/dy w.r.t.private FirstOrderDifferentialEquations
ode
Raw ODE without jacobians computation skill to be wrapped into a MainStateJacobianProvider.
-
Constructor Summary
Constructors Constructor Description MainStateJacobianWrapper(FirstOrderDifferentialEquations ode, double[] hY)
Wrap aFirstOrderDifferentialEquations
into aMainStateJacobianProvider
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
computeDerivatives(double t, double[] y, double[] yDot)
Get the current time derivative of the state vector.void
computeMainStateJacobian(double t, double[] y, double[] yDot, double[][] dFdY)
Compute the jacobian matrix of ODE with respect to main state.int
getDimension()
Get the dimension of the problem.
-
-
-
Field Detail
-
ode
private final FirstOrderDifferentialEquations ode
Raw ODE without jacobians computation skill to be wrapped into a MainStateJacobianProvider.
-
hY
private final double[] hY
Steps for finite difference computation of the jacobian df/dy w.r.t. state.
-
-
Constructor Detail
-
MainStateJacobianWrapper
MainStateJacobianWrapper(FirstOrderDifferentialEquations ode, double[] hY) throws DimensionMismatchException
Wrap aFirstOrderDifferentialEquations
into aMainStateJacobianProvider
.- Parameters:
ode
- original ODE problem, without jacobians computation skillhY
- step sizes to compute the jacobian df/dy- Throws:
DimensionMismatchException
- if there is a dimension mismatch between the steps arrayhY
and the equation dimension
-
-
Method Detail
-
getDimension
public int getDimension()
Get the dimension of the problem.- Specified by:
getDimension
in interfaceFirstOrderDifferentialEquations
- Returns:
- dimension of the problem
-
computeDerivatives
public void computeDerivatives(double t, double[] y, double[] yDot) throws MaxCountExceededException, DimensionMismatchException
Get the current time derivative of the state vector.- Specified by:
computeDerivatives
in interfaceFirstOrderDifferentialEquations
- Parameters:
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 vector- Throws:
MaxCountExceededException
- if the number of functions evaluations is exceededDimensionMismatchException
- if arrays dimensions do not match equations settings
-
computeMainStateJacobian
public void computeMainStateJacobian(double t, double[] y, double[] yDot, double[][] dFdY) throws MaxCountExceededException, DimensionMismatchException
Compute the jacobian matrix of ODE with respect to main state.- Specified by:
computeMainStateJacobian
in interfaceMainStateJacobianProvider
- Parameters:
t
- current value of the independent time variabley
- array containing the current value of the main state vectoryDot
- array containing the current value of the time derivative of the main state vectordFdY
- placeholder array where to put the jacobian matrix of the ODE w.r.t. the main state vector- Throws:
MaxCountExceededException
- if the number of functions evaluations is exceededDimensionMismatchException
- if arrays dimensions do not match equations settings
-
-