soft4pes.control.mpc.solvers.mpc_bnb#

Branch-and-bound solver for model predictive control (MPC).

Classes#

MpcBnB

Branch-and-bound (BnB) solver for model predictive control (MPC).

Module Contents#

class soft4pes.control.mpc.solvers.mpc_bnb.MpcBnB(conv)[source]#

Branch-and-bound (BnB) solver for model predictive control (MPC).

Parameters:

conv (converter object) – Converter model.

J_min[source]#

Minimum cost.

Type:

float

U_seq[source]#

Sequence of three-phase switch positions (switching sequence) with the lowest cost.

Type:

1 x 3*Np ndarray of ints

U_temp[source]#

Temporary array for incumbent swithing sequence.

Type:

1 x 3*Np ndarray of ints

SW_COMB[source]#

All possible three-phase switch positions.

Type:

1 x conv.nl^3 ndarray of ints

__call__(sys, ctr, y_ref)[source]#

Solve MPC problem by using a simple BnB method.

Parameters:
  • sys (system object) – System model.

  • ctr (controller object) – Controller object.

  • y_ref (ndarray of floats) – Reference vector [p.u.].

Returns:

u_abc – The three-phase switch position.

Return type:

1 x 3 ndarray of ints

solve(sys, ctr, x_ell, y_ref, u_ell_abc_prev, ell=0, J_prev=0)[source]#

Recursively compute the cost for different switching sequences.

Parameters:
  • sys (object) – System model.

  • ctr (object) – Controller object.

  • x_ell (ndarray of floats) – State vector [p.u.].

  • y_ref (ndarray of floats) – Reference vector [p.u.].

  • u_ell_abc_prev (1 x 3 ndarray of ints) – Previous three-phase switch position.

  • ell (int) – Prediction step. The default is 0.

  • J_prev (float) – Previous cost. The default is 0.