Skip to content

Commit 6e7480e

Browse files
authored
example file with sisotool use (python-control#415)
1 parent 5005159 commit 6e7480e

1 file changed

Lines changed: 46 additions & 0 deletions

File tree

‎examples/sisotool_example.py‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/usr/bin/env python3
2+
# -*- coding: utf-8 -*-
3+
"""sisotooldemo.py
4+
5+
Shows some different systems with sisotool.
6+
7+
All should produce smooth root-locus plots, also zoomable and clickable,
8+
with proper branching
9+
"""
10+
11+
#%%
12+
import matplotlib.pyplot as plt
13+
from control.matlab import *
14+
15+
# first example, aircraft attitude equation
16+
s = tf([1,0],[1])
17+
Kq = -24
18+
T2 = 1.4
19+
damping = 2/(13**.5)
20+
omega = 13**.5
21+
H = (Kq*(1+T2*s))/(s*(s**2+2*damping*omega*s+omega**2))
22+
plt.close('all')
23+
sisotool(-H)
24+
25+
#%%
26+
27+
# a simple RL, with multiple poles in the origin
28+
plt.close('all')
29+
H = (s+0.3)/(s**4 + 4*s**3 + 6.25*s**2)
30+
sisotool(H)
31+
32+
#%%
33+
34+
# a branching and emanating example
35+
b0 = 0.2
36+
b1 = 0.1
37+
b2 = 0.5
38+
a0 = 2.3
39+
a1 = 6.3
40+
a2 = 3.6
41+
a3 = 1.0
42+
43+
plt.close('all')
44+
H = (b0 + b1*s + b2*s**2) / (a0 + a1*s + a2*s**2 + a3*s**3)
45+
46+
sisotool(H)

0 commit comments

Comments
 (0)