libhybrid
A library for discretized Hybrid Dynamical Systems
|
Go to the source code of this file.
Macros | |
#define | HYB_MODEL_SOURCE "model.c" |
To include the mex wrappe in your project you MUST define MATLAB_WRAPPER. More... | |
#define | MATLAB_SYSTEM_IDENTIFICATION |
MATLAB System Identification wrapper and common wrapper are different. More... | |
Functions | |
void | error_message (hyb_errorcode c) |
handler for errors from hyb_main_loop function More... | |
void | mexFunction (int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) |
Entry point for MATLAB Api. More... | |
Definition in file mex_wrapper.c.
#define HYB_MODEL_SOURCE "model.c" |
To include the mex wrappe in your project you MUST define MATLAB_WRAPPER.
Name of the model to wrap
Please provide the name of source of the model to wrap. It will be included in the wrapper for compilation. The model should include at least:
Definition at line 49 of file mex_wrapper.c.
#define MATLAB_SYSTEM_IDENTIFICATION |
MATLAB System Identification wrapper and common wrapper are different.
The System Identification Wrapper and the common wrapper are different. The normal wrapper returns for each step, and it does not matter if the step is a either flow step or jump step. In the System Identification wrapper the function returns only in case of flow step. If there is more than one jump step it is not reported to the MATLAB engine. This forces the user to carefully decide which Jump Horizon to use. Reaching an horizon forces the raise of an error. This wrapper separation allows to keep always the flow time state synchronized with the System Identification sim time. This avoid the insertion of a delay \( e^{-T_s s} \) for each jump in the flow dynamic. For the System identification wrapper, simply define MATLAB_SYSTEM_IDENTIFICATION. If MATLAB_SYSTEM_IDENTIFICATION is not defined, the common wrapper is generated.
Definition at line 70 of file mex_wrapper.c.
|
inline |
handler for errors from hyb_main_loop function
This function handles the error code from the hyb_main_loop function. Any returning value different from HYB_SUCCESS raises a mexErrMsgIdAndTxt with a convenient error message.
c | the error code from the hyb_main_loop function |
Definition at line 85 of file mex_wrapper.c.
void mexFunction | ( | int | nlhs, |
mxArray * | plhs[], | ||
int | nrhs, | ||
const mxArray * | prhs[] | ||
) |
Entry point for MATLAB Api.
The compilation and linking of a mex function generates a shared object that is dynamically loaded in MATLAB. The entry point for such library is the function mexFunction that is always called with the following arguments:
nlhs | number of elements in the pointer for the output (lhs = left hand side) |
plhs | pointer for data in the left hand side |
nrhs | number of elements in the pointer for the input arguments (rhs = right hand side) |
prhs | pointer for input data for the function |
Definition at line 129 of file mex_wrapper.c.