-
Notifications
You must be signed in to change notification settings - Fork 0
/
readme.txt
17 lines (14 loc) · 1.28 KB
/
readme.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
An example of how to use CasADi's QRQP QP solver for MPC in Simulink.
main.m - A demonstration script. After adding CasADi to the path this file should run without errors.
LMPC.c - the Level-2 C S-Function definition; needs to be compiled together with MPC_step.c
MPC_step.c/h - self-contained c code generated by generate_block.m
generate_block.m - A CasADi-Matlab function that constructs a QP solve step in a symbolic way, codegenerates and compiles to MPC_step.c
demo.slx - A demonstration of a block that uses LMPC, and a 'mask' that automatically calls generate_block with appropriate parameters
Caveats:
- C/D matrices are not used at the moment.
- Status information is very limited for: only boolean success/fail, no statistics. There is a verbose mode for debugging though.
- Beware of indefinite Hessians (Q,R)!
- For exploiting minimal active set changes in an MPC setting, do connect (x->x_initial),(lam_x->lam_x_initial),(lam_g->lam_g_initial)
Otherwise, feed zeros.
- The mex command in generate_block does not specify compiler optimization flags. They are highly recommended.
- Bottleneck assumed to be in QP. There is overhead involved in using the QP solver in an expression-oriented way as opposed to working with (sparse) matrices directly.