https://github.com/giuliovv/ball_beam
Casadi MPC to matlab S-Function example
https://github.com/giuliovv/ball_beam
casadi mpc s-function
Last synced: 7 months ago
JSON representation
Casadi MPC to matlab S-Function example
- Host: GitHub
- URL: https://github.com/giuliovv/ball_beam
- Owner: giuliovv
- License: mit
- Created: 2022-05-06T15:27:21.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-06-07T17:31:06.000Z (over 3 years ago)
- Last Synced: 2025-01-21T12:30:09.570Z (9 months ago)
- Topics: casadi, mpc, s-function
- Language: Jupyter Notebook
- Homepage:
- Size: 1.56 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CasaDi MPC to S-Function
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:
```Matlab
mex s_function.c f.c
```
Note that IPOPT is not directly supported. To use IPOPT see: https://web.casadi.org/blog/mpc-simulink2/