EMI_CB_CalculateProjectedStates (EMI Function)
- Updated2023-03-14
- 1 minute(s) read
EMI_CB_CalculateProjectedStates (EMI Function)
Owning Class: Callbacks
Requires: Control Design and Simulation Module
Prototype
void EMI_CB_CalculateProjectedStates(emiRef model);
Description
Calculates the projected continuous states of an external model. When you use an ordinary differential equation (ODE) solver to solve a differential algebraic equation, you might need to project the continuous states of the model onto the integral constraint surface at each accepted major step. Use the EMI_GetProjectedContinuousStates function within the EMI_CB_CalculateProjectedStates function to modify the continuous states directly. The LabVIEW Control Design and Simulation Module calls this function after completing any minor steps and before the next accepted major step.
Inputs
| Name | Description |
|---|---|
| model | Specifies a reference to the external model. Use this reference as an input to other EMI functions. Do not modify model directly. |
Examples
void EMI_CB_CalculateProjectedStates(emiRef model) {
double* xc = EMI_GetProjectedContinuousStates(model);
if (xc[0] > 5.0) {
xc[0] = 5.0
}
}