MPC
===
Solves a condensed QP every clock step (A, B, Q, R, N, u bounds from a JSON file).
``mpc`` · control · no feedthrough: a feedback loop may pass through it
.. raw:: html
MPCfn
file
max_time0
max_iter4000
.. container:: pb-prose
The model is a JSON file on the block:
.. code-block:: json
{ "A": [[1]], "B": [[1]], "Q": [[1]], "R": [[0.1]], "N": 20, "u_min": [-1], "u_max": [1] }
It is condensed into one QP over the horizon ``N`` and solved by the optimization toolkit every step.
Inputs
------
.. list-table::
:header-rows: 1
* - Port
- Type
- Unit
- Components
* - ``y``
- numbers
- —
- —
* - ``ref``
- numbers
- —
- —
* - ``x0``
- numbers
- —
- —
Outputs
-------
.. list-table::
:header-rows: 1
* - Port
- Type
- Unit
- Components
* - ``u``
- numbers
- —
- —
* - ``status``
- text
- —
- —
* - ``iterations``
- signal
- —
- —
* - ``solve_time``
- signal
- —
- —
Parameters
----------
.. list-table::
:header-rows: 1
* - Param
- Type
- Default
- Options or unit
* - ``file``
- file
- —
- —
* - ``max_time``
- number
- ``0.0``
- —
* - ``max_iter``
- number
- ``4000.0``
- —