diff --git a/doc/guide.pdf b/doc/guide.pdf index c193c75e..29f41053 100644 Binary files a/doc/guide.pdf and b/doc/guide.pdf differ diff --git a/doc/guide.tex b/doc/guide.tex index 17721d37..e1d4ffdd 100644 --- a/doc/guide.tex +++ b/doc/guide.tex @@ -48,7 +48,7 @@ \chapter{Dense QP} \min_{v,s} & \quad \frac 1 2 \begin{bmatrix} v \\ 1 \end{bmatrix}^T \begin{bmatrix} H & g \\ g^T & 0 \end{bmatrix} \begin{bmatrix} v \\ 1 \end{bmatrix} + \frac 1 2 \begin{bmatrix} s^l \\ s^u \\ 1 \end{bmatrix}^T \begin{bmatrix} Z^l & 0 & z^l \\ 0 & Z^u & z^u \\ (z^l)^T & (z^u)^T & 0 \end{bmatrix} \begin{bmatrix} s^l \\ s^u \\ 1 \end{bmatrix} \\ s.t. & \quad A v = b \\ & \quad \begin{bmatrix} \underline v \\ \underline d \end{bmatrix} \leq \begin{bmatrix} J_{b,v} \\ C \end{bmatrix} v + \begin{bmatrix} J_{s,v} \\ J_{s,g} \end{bmatrix} s^l \\ -& \quad \begin{bmatrix} J_{b,v} \\ C_n \end{bmatrix} v - \begin{bmatrix} J_{s,v} \\ J_{s,g} \end{bmatrix} s^u \leq \begin{bmatrix} \overline v \\ \overline d \end{bmatrix} \\ +& \quad \begin{bmatrix} J_{b,v} \\ C_n \end{bmatrix} v - \begin{bmatrix} J_{s,v} \\ J_{s,g} \end{bmatrix} s^u \leq \begin{bmatrix} \overline v \\ \overline d \end{bmatrix} & \quad s^l\geq 0 \\ & \quad s^u\geq 0 \end{align*} @@ -72,9 +72,15 @@ \chapter{OCP QP} \end{align*} where $u_n$ are the control inputs, $x_n$ are the states, $s^l_n$ ($s^u_n$) are the slack variables of the soft lower (upper) constraints. The matrices $J_{\dots,n}$ are made of rows from identity matrices. +The matrices $J_{s,\dots}$ are made of rows from an identity matrix of size $n_s$ or of zeros. +So there may well be no soft constraints ($n_s=0$), or only on some constraints (and then the other constraints have a row of zeros in $J_{s,\dots}$.) +\texttt{idxs[j]=i} means that the element \texttt{[i,j]} of the stacked $J_{s,\dots}$ matrix is one. + Note that all quantities can vary stage-wise. Furthermore, note that the constraint matrix with respect to $u$ and $x$ is the same for the upper and the lower constraints. + + \begin{verbatim} int d_memsize_ocp_qp(int N, int *nx, int *nu, int *nb, int *ng, int *ns); \end{verbatim}