You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Fix fval bound and activate equality constraints in setup_ldp (#46)
* Make fval_bound consistent with internal objective function
* Activate equality constraints inside update_ldp
* Update CI
* Fix python interface when blower and sense are not given (#47)
* Add function to remove redundant constraints in polyhedron (#48)
* Add minrep to Python interface (#49)
* Set target_include_directories and modify Cmake export (#53)
* Set target_include_directories
* Simulink Interface (#42)
* Correctly generate code for RinvD
* Do not explicitly store v and scaling in generated code
---------
Co-authored-by: Christopher Schulte <38617646+Don-Chris@users.noreply.github.com>
In Simulink, an s-function block can be used to solve a quadratic program. The s-function needs to link to the compiled c-code called "daqp_sfunc". To compile the c-code, the following matlab-script can be used in the terminal:
15
+
16
+
```matlab
17
+
make_sfunc()
18
+
```
19
+
20
+
_Note_: Please make sure to have a C-compiler installed on your system and linked in matlab. This can be checked by running ``mex -setup`` in the terminal:
21
+
22
+
After the c-code has been compiled, a new file called ``daqp_sfunc.mexw64`` (windows) or ``daqp_sfunc.mexa64`` (linux, mac) should be found.
23
+
24
+
The corresponding S-function block has the following inputs:
25
+
| Inputs | Description | Size |
26
+
| --- | --- | --- |
27
+
| $H$ | The Hessian matrix of the quadratic objective function |[$n$ x $n$]|
28
+
| $f$ | The linear part of the objective function | [$n$ x 1]
29
+
| $A$ | The matrix of linear constraints | [$m_g$ x $n$]
30
+
| $b_l$ | The lower bound of the linear constraints | [$m$ x 1]
31
+
| $b_u$ | The upper bound of the linear constraints | [$m$ x 1]
32
+
| sense | The type of the constraints | [$m$ x 1]
33
+
34
+
_Note_: When $b_u$ and $b_l$ have more elements than the number of rows in $A$, the first elements in $b_u$ and $b_l$ are interpreted as simple bounds.
35
+
36
+
The following parameters are used to set up the problem and need to be set in the mask of the s-function block:
37
+
38
+
| Parameters | Description | Size |
39
+
| --- | --- | --- |
40
+
| maxIter | Maximum number of iterations | 1 |
41
+
42
+
The block has the following outputs:
43
+
44
+
| Outputs | Description | Size |
45
+
| --- | --- | --- |
46
+
| $x$ | The optimal solution |[$n$ x 1]|
47
+
| $\lambda$ | The optimal Lagrange multipliers |[$m$ x 1]|
48
+
| $f_{val}$ | The optimal value of the objective function | 1 |
49
+
| exitflag | The exit flag of the solver | 1 |
50
+
| iter | The number of iterations used by the solver | 1 |
0 commit comments