This folder contains some examples on how to use CasaDi to generate an S-Function. The examples are specific for the Ball And Beam model.
- Run mpc.ipynb to generate f.c and f.h
- Inside f.c edit casadi_real_min definition from not defined to a low value (for ex 1e-8)
- Open MATLAB and run:
mex s_function.c f.c
Note that IPOPT is not directly supported. To use IPOPT see: https://web.casadi.org/blog/mpc-simulink2/