Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some bug ? #3

Open
longjianquan opened this issue Sep 11, 2019 · 3 comments
Open

some bug ? #3

longjianquan opened this issue Sep 11, 2019 · 3 comments
Assignees

Comments

@longjianquan
Copy link

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)

@xsy786912649
Copy link

same problem

@wangyixu14
Copy link

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"

@DongChen06
Copy link

any updates on this problem?

@AtsushiSakai AtsushiSakai self-assigned this Apr 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants