Skip to content

giuliovv/ball_beam

Repository files navigation

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:
mex s_function.c f.c

Note that IPOPT is not directly supported. To use IPOPT see: https://web.casadi.org/blog/mpc-simulink2/

About

Casadi MPC to matlab S-Function example

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published