InvertedPendulumMPCControl: fixed deprecated waring about using * for matrix multiplication (#631)

This commit is contained in:
Trung Kien
2022-01-23 17:35:54 +07:00
committed by GitHub
parent 058addd2ba
commit c066a9420e

View File

@@ -77,7 +77,7 @@ def mpc_control(x0):
for t in range(T):
cost += cvxpy.quad_form(x[:, t + 1], Q)
cost += cvxpy.quad_form(u[:, t], R)
constr += [x[:, t + 1] == A * x[:, t] + B * u[:, t]]
constr += [x[:, t + 1] == A @ x[:, t] + B @ u[:, t]]
constr += [x[:, 0] == x0[:, 0]]
prob = cvxpy.Problem(cvxpy.Minimize(cost), constr)