Package org.apache.commons.math3.ode
Class ParameterizedWrapper
- java.lang.Object
-
- org.apache.commons.math3.ode.ParameterizedWrapper
-
- All Implemented Interfaces:
Parameterizable
,ParameterizedODE
class ParameterizedWrapper extends java.lang.Object implements ParameterizedODE
Wrapper class enablingbasic simple
ODE instances to be used when processingJacobianMatrices
.- Since:
- 3.0
-
-
Field Summary
Fields Modifier and Type Field Description private FirstOrderDifferentialEquations
fode
Basic FODE without parameter.
-
Constructor Summary
Constructors Constructor Description ParameterizedWrapper(FirstOrderDifferentialEquations ode)
Simple constructor.
-
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 of the underlying FODE.int
getDimension()
Get the dimension of the underlying FODE.double
getParameter(java.lang.String name)
Get parameter value from its name.java.util.Collection<java.lang.String>
getParametersNames()
Get the names of the supported parameters.boolean
isSupported(java.lang.String name)
Check if a parameter is supported.void
setParameter(java.lang.String name, double value)
Set the value for a given parameter.
-
-
-
Field Detail
-
fode
private final FirstOrderDifferentialEquations fode
Basic FODE without parameter.
-
-
Constructor Detail
-
ParameterizedWrapper
ParameterizedWrapper(FirstOrderDifferentialEquations ode)
Simple constructor.- Parameters:
ode
- original first order differential equations
-
-
Method Detail
-
getDimension
public int getDimension()
Get the dimension of the underlying FODE.- Returns:
- dimension of the underlying FODE
-
computeDerivatives
public void computeDerivatives(double t, double[] y, double[] yDot) throws MaxCountExceededException, DimensionMismatchException
Get the current time derivative of the state vector of the underlying FODE.- 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
-
getParametersNames
public java.util.Collection<java.lang.String> getParametersNames()
Get the names of the supported parameters.- Specified by:
getParametersNames
in interfaceParameterizable
- Returns:
- parameters names
- See Also:
Parameterizable.isSupported(String)
-
isSupported
public boolean isSupported(java.lang.String name)
Check if a parameter is supported.Supported parameters are those listed by
Parameterizable.getParametersNames()
.- Specified by:
isSupported
in interfaceParameterizable
- Parameters:
name
- parameter name to check- Returns:
- true if the parameter is supported
- See Also:
Parameterizable.getParametersNames()
-
getParameter
public double getParameter(java.lang.String name) throws UnknownParameterException
Get parameter value from its name.- Specified by:
getParameter
in interfaceParameterizedODE
- Parameters:
name
- parameter name- Returns:
- parameter value
- Throws:
UnknownParameterException
- if parameter is not supported
-
setParameter
public void setParameter(java.lang.String name, double value)
Set the value for a given parameter.- Specified by:
setParameter
in interfaceParameterizedODE
- Parameters:
name
- parameter namevalue
- parameter value
-
-