Skip to content

Commit dab8ff6

Browse files
authored
Merge pull request python-control#375 from francescoseccamonte/master
Bugfix in matrix multiplication in output computation in iosys.LinearIOSystem good catch!
2 parents 66bee9d + a995655 commit dab8ff6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

control/iosys.py

Lines changed: 4 additions & 2 deletions
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)