- Notifications
You must be signed in to change notification settings - Fork441
fix _isstatic() to use nstates==0#790
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -41,6 +41,9 @@ class TSys: | ||
[[-1, 1], [0, -2]], [[0, 1], [1, 0]], | ||
[[1, 0], [0, 1]], np.zeros((2, 2))) | ||
# Create a static gain linear system | ||
T.staticgain = ct.StateSpace([], [], [], 1) | ||
# Create simulation parameters | ||
T.T = np.linspace(0, 10, 100) | ||
T.U = np.sin(T.T) | ||
@@ -51,7 +54,7 @@ class TSys: | ||
def test_linear_iosys(self, tsys): | ||
# Create an input/output system from the linear system | ||
linsys = tsys.siso_linsys | ||
iosys = ios.LinearIOSystem(linsys).copy() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. is it obvious why this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Definitely not obvious, but this gets rid of a warning later on since the | ||
# Make sure that the right hand side matches linear system | ||
for x, u in (([0, 0], 0), ([1, 0], 0), ([0, 1], 0), ([0, 0], 1)): | ||
@@ -66,6 +69,11 @@ def test_linear_iosys(self, tsys): | ||
np.testing.assert_array_almost_equal(lti_t, ios_t) | ||
np.testing.assert_allclose(lti_y, ios_y, atol=0.002, rtol=0.) | ||
# Make sure that a static linear system has dt=None | ||
# and otherwise dt is as specified | ||
assert ios.LinearIOSystem(tsys.staticgain).dt is None | ||
assert ios.LinearIOSystem(tsys.staticgain, dt=.1).dt == .1 | ||
def test_tf2io(self, tsys): | ||
# Create a transfer function from the state space system | ||
linsys = tsys.siso_linsys | ||