Class method.

do_mpc.controller.MPC.set_rterm(self, **kwargs)

Set the penality factor for the inputs. Call this function with keyword argument refering to the input names in model and the penalty factor as the respective value.

We define for \(i \in \mathbb{I}\), where \(\mathbb{I}\) is the set of inputs and all \(k=0,\dots, N\) where \(N\) denotes the horizon:

\[\Delta u_{k,i} = u_{k,i} - u_{k-1,i}\]

and add:

\[\sum_{k=0}^N \sum_{i \in \mathbb{I}} r_{i}\Delta u_{k,i}^2,\]

the weighted squared cost to the MPC objective function.


# in model definition:
Q_heat = model.set_variable(var_type='_u', var_name='Q_heat')
F_flow = model.set_variable(var_type='_u', var_name='F_flow')

# in MPC configuration:
MPC.set_rterm(Q_heat = 10)
MPC.set_rterm(F_flow = 10)
# or alternatively:
MPC.set_rterm(Q_heat = 10, F_flow = 10)

In the above example we set \(r_{Q_{\text{heat}}}=10\) and \(r_{F_{\text{flow}}}=10\).


For \(k=0\) we obtain \(u_{-1}\) from the previous solution.

This page is auto-generated. Page source is not available on Github.