Lab Test 1 Formula sheet
Second order response characteristics
For pole at s = −σd ± jωd ,
σd = ζωn
p
ωd = ωn 1 − ζ 2
q
ωn = σd2 + ωd2
π
Tp =
ωd
4
Ts ∼
=
σd
p
%OS = exp(−ζπ/ 1 − ζ 2 ) × 100
−σd π
%OS = exp
× 100
ωd
−ln(%OS/100)
ζ=q
π 2 + ln2 (%OS/100)
General form of second order system: T (s) =
b
s2 + as + b
,
where b = ωn2 , and a = 2ζωn .
Python syntax
Start your program with the following import statements:
import numpy as np
import matplotlib.pyplot as plt
import control as ct
import math as mt
Useful functions:
ct.tf (num, den)
Create LTI transfer function
ct.feedback( )
Find equivalent transfer function for those in feedback
np.poly ( )
Create polynomial from list of roots
page 1 of 2
ct.poles ( )
Find poles of given system
ct.zeros ( )
Find zeros of given system
ct.pzmap ( )
Plot poles and zeros of system
ct.step info ( )
Find the characteristics of the output response for system
t,c = ct.step response ( )
Find step response of given system
plt.plot (t,c)
Plot c against t
plt.figure ()
Open new figure window
plt.show ( )
Show figure window
np.real ( )
Find real part of complex number
np.imag ( )
Find imaginary part of complex number
np.pi
Value for π
np.exp ( )
Exponential function
np.log ( )
Natural log function
np.sqrt ( )
Find square root of number
ct.dcgain ()
Find DC gain of system (as s → 0)
ct.minreal ()
Pole–Zero cancellation
**2
Find square of a number
abs ( )
Find magnitude of number
int(input())
Wait for user input and store entered integer
Vals = np.linspace(0, 20, 100) Returns vector of 100 values ranging from 0 to 20
Template also includes the following function:
K, Pt = rlocfind(GH, Kvals, [-10,0.1],[-5,5],Zeta)
which plots root locus with overlayed line of constant damping for given system and range
of gain values given by Kvals. Function returns K and Pt from mouse click.
page 2 of 2