Skip to content

Commit 6e54448

Browse files
committed
missing test file (was referred to in ChangeLog, but handn't been committed
1 parent ef9a7da commit 6e54448

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

examples/test-response.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# test-response.py - Unit tests for system response functions
2+
# RMM, 11 Sep 2010
3+
4+
from matplotlib.pyplot import * # Grab MATLAB plotting functions
5+
from control.matlab import * # Load the controls systems library
6+
from scipy import arange # function to create range of numbers
7+
8+
# Create several systems for testing
9+
sys1 = tf([1], [1, 2, 1])
10+
sys2 = tf([1, 1], [1, 1, 0])
11+
12+
# Generate step responses
13+
(T1a, y1a) = step(sys1)
14+
(T1b, y1b) = step(sys1, T = arange(0, 10, 0.1))
15+
(T1c, y1c) = step(sys1, X0 = [1, 0])
16+
(T2a, y2a) = step(sys2, T = arange(0, 10, 0.1))
17+
18+
plot(T1a, y1a, T1b, y1b, T1c, y1c, T2a, y2a)

0 commit comments

Comments
 (0)