public interface DerivativeFunction
The interface encapsulates the derivatives of one or more state variables, x, as:
xdot = f{t, x, u}
where
An implementing class should enforce:
Modifier and Type | Method and Description |
---|---|
int |
evaluateDerivatives(Time time,
double[] xx,
double[] uu,
double[] xdot)
Evaluate the derivative function.
|
int |
evaluateDerivatives(Time time,
double[] dtSample,
double[] xdot,
double[] xdotSample,
double[] xdotSample2,
int stOrd)
Evaluate the derivative function for event indicator.
|
double |
evaluateDirectionalDerivatives(int idx,
double[] xx_dot,
double[] uu_dot)
Evaluate directional derivative function.
|
int |
eventIndicatorDerivativeInputs(Time time,
double[] xx,
double[] uu,
Time timeSample,
double[] xxSample,
double[] uuSample,
double dtSample,
Time timeSample2,
double[] xxSample2,
double[] uuSample2,
double dtSample2,
Time timeSample3,
double[] xxSample3,
double[] uuSample3,
double dtSample3,
Time timeSample4,
double[] xxSample4,
double[] uuSample4,
double dtSample4,
Time timeSample5,
double[] xxSample5,
double[] uuSample5,
double dtSample5,
int stateModelOrder)
Provide inputs to evaluate the derivative
function using finite difference methods.
|
int |
getEventIndicatorCount()
Return the number of event indicators.
|
int |
getInputVariableCount()
Return the count of input variables.
|
boolean |
getProvidesDirectionalDerivatives()
Indicate existence of directional derivatives.
|
int |
getStateCount()
Return the count of state variables.
|
int evaluateDerivatives(Time time, double[] dtSample, double[] xdot, double[] xdotSample, double[] xdotSample2, int stOrd) throws IllegalActionException
time
- The time.dtSample
- The delta time used to approximate first derivative.xdot
- The vector of time rates of change of the state variables at time
.xdotSample
- The vector of time rates of change of the state variables
at a sample time.xdotSample2
- The vector of time rates of change of the state variables
at a sample time.stOrd
- The state model order.IllegalActionException
- If derivatives cannot be evaluated.int evaluateDerivatives(Time time, double[] xx, double[] uu, double[] xdot) throws IllegalActionException
Expected implementation conventions:
uu
.uu == null
.time
- Simulation time.xx
- The vector of state variables at time
.uu
- The vector of input variables at time
.xdot
- The vector of time rates of change of the state variables at time
.IllegalActionException
- If derivatives cannot be evaluated.double evaluateDirectionalDerivatives(int idx, double[] xx_dot, double[] uu_dot) throws IllegalActionException
idx
- The state derivative index.xx_dot
- The vector of state derivatives.uu_dot
- The vector of input derivatives.IllegalActionException
- If directional derivatives cannot be evaluated.int eventIndicatorDerivativeInputs(Time time, double[] xx, double[] uu, Time timeSample, double[] xxSample, double[] uuSample, double dtSample, Time timeSample2, double[] xxSample2, double[] uuSample2, double dtSample2, Time timeSample3, double[] xxSample3, double[] uuSample3, double dtSample3, Time timeSample4, double[] xxSample4, double[] uuSample4, double dtSample4, Time timeSample5, double[] xxSample5, double[] uuSample5, double dtSample5, int stateModelOrder) throws IllegalActionException
time
- Simulation time.xx
- The vector of state variables at time
.uu
- The vector of input variables at time
.timeSample
- Simulation time.xxSample
- The vector of state variables at timeSample
.uuSample
- The vector of input variables at timeSample
.dtSample
- The delta between timeSample
and time
.timeSample2
- Simulation time.xxSample2
- The vector of state variables at timeSample2
.uuSample2
- The vector of input variables at timeSample2
.dtSample2
- The delta between timeSample2
and time
.timeSample3
- Simulation time.xxSample3
- The vector of state variables at timeSample3
.uuSample3
- The vector of input variables at timeSample3
.dtSample3
- The delta between timeSample3
and time
.timeSample4
- Simulation time.xxSample4
- The vector of state variables at timeSample4
.uuSample4
- The vector of input variables at timeSample4
.dtSample4
- The delta between timeSample4
and time
.
variables at time
.timeSample5
- Simulation time.xxSample5
- The vector of state variables at timeSample5
.uuSample5
- The vector of input variables at timeSample5
.dtSample5
- The delta between timeSample5
and time
.
variables at time
.stateModelOrder
- The order of the model.IllegalActionException
- If derivatives cannot be evaluated.int getEventIndicatorCount()
int getInputVariableCount()
Expect 0 ≤ this.getInputVarCt()
.
boolean getProvidesDirectionalDerivatives()
Prescribed by interface DerivativeFcn
.
int getStateCount()
Expect 0 < this.getStateCt()
.