Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified doc/guide.pdf
Binary file not shown.
8 changes: 7 additions & 1 deletion doc/guide.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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*}
Expand All @@ -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}
Expand Down