PyAdvancedControl icon indicating copy to clipboard operation
PyAdvancedControl copied to clipboard

some bug ?

Open longjianquan opened this issue 4 years ago • 3 comments

when i run mpc_path_tracking and mpc_sample

Traceback (most recent call last): File "main.py", line 177, in Main() File "main.py", line 129, in Main ustar, xstar, cost = CalcInput(A, B, C, x, u) File "main.py", line 84, in CalcInput constr = [x[:, t + 1] == A * x[:, t] + B * u[:, t] + C] File "/usr/local/lib/python3.5/dist-packages/cvxpy/expressions/expression.py", line 46, in cast_op return binary_op(self, other) File "/usr/local/lib/python3.5/dist-packages/cvxpy/expressions/expression.py", line 452, in add return cvxtypes.add_expr()([self, other]) File "/usr/local/lib/python3.5/dist-packages/cvxpy/atoms/affine/add_expr.py", line 33, in init super(AddExpression, self).init(arg_groups) File "/usr/local/lib/python3.5/dist-packages/cvxpy/atoms/atom.py", line 45, in init self._shape = self.shape_from_args() File "/usr/local/lib/python3.5/dist-packages/cvxpy/atoms/affine/add_expr.py", line 41, in shape_from_args return u.shape.sum_shapes([arg.shape for arg in self.args]) File "/usr/local/lib/python3.5/dist-packages/cvxpy/utilities/shape.py", line 49, in sum_shapes len(shapes)" %s" % tuple(shapes)) ValueError: Cannot broadcast dimensions (4,) (4, 1)

longjianquan avatar Sep 11 '19 02:09 longjianquan

same problem

xsy786912649 avatar Oct 17 '19 22:10 xsy786912649

I revised to constr = [x[:, [t + 1]] == A * x[:, [t]] + B * u[:,[t]] + C] and seems solve the problem. But prob.constriants += at line 99 raised the error of "Attribute error: can's set attribute"

wangyixu14 avatar Mar 09 '20 02:03 wangyixu14

any updates on this problem?

DongChen06 avatar Apr 26 '20 18:04 DongChen06