Skip to content

Commit a995655

Browse files
Bugfix in matrix multiplication in output computation in iosys.LinearIOSystem
1 parent 66bee9d commit a995655

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

control/iosys.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -656,8 +656,10 @@ def _rhs(self, t, x, u):
656656
return np.array(xdot).reshape((-1,))
657657

658658
def _out(self, t, x, u):
659-
y = self.C * np.reshape(x, (-1, 1)) + self.D * np.reshape(u, (-1, 1))
660-
return np.array(y).reshape((self.noutputs,))
659+
# Convert input to column vector and then change output to 1D array
660+
y = np.dot(self.C, np.reshape(x, (-1, 1))) \
661+
+ np.dot(self.D, np.reshape(u, (-1, 1)))
662+
return np.array(y).reshape((-1,))
661663

662664

663665
class NonlinearIOSystem(InputOutputSystem):

0 commit comments

Comments
 (0)