PyDeePC
PyDeePC copied to clipboard
Bug of the cvxpy variables with cp.reshape
Describe the bug There is a small issue in deepc.py lines 139 and 140 with the following lines: u = cp.reshape(u, (self.horizon, self.M)) y = cp.reshape(y, (self.horizon, self.P)) This may lead to a bug in the constraints when using multiple inputs or outputs, because the cp.reshape is Fortran type by default.
To Fix This can be fixed by simply forcing the C type reshape as follows: u = cp.reshape(u, (self.horizon, self.M), 'C') y = cp.reshape(y, (self.horizon, self.P), 'C')
** Other comments** Please do more tests if you can to make sure the reshape doesn't affect other things in the code.