Transfer Functions with Python - halvorsen.blog
Transcript of Transfer Functions with Python - halvorsen.blog
Hans-Petter Halvorsen
https://www.halvorsen.blog
Transfer Functions with Python
https://www.halvorsen.blog/documents/programming/python/
Free Textbook with lots of Practical Examples
Additional Python Resources
https://www.halvorsen.blog/documents/programming/python/
β’ Introduction to Control Systemsβ’ Transfer Functionsβ’ Step Responseβ’ Poles and Zerosβ’ Python ExamplesβSciPy (SciPy.signal)βThe Python Control Systems Library
Contents
Control System
Controller Process
Sensors
Actuators
Filtering
π π’π
β
π₯
π£Reference Value
Control Signal
Noise/Disturbance
Process Output
π¦
Control Systemβ’ π β Reference Value, SP (Set-point), SV (Set Value)β’ π¦ β Measurement Value (MV), Process Value (PV)β’ π β Error between the reference value and the
measurement value (π = π β π¦)β’ π£ β Disturbance, makes it more complicated to control
the processβ’ π’ - Control Signal from the Controller
Control System
Controller Processπ π’π
β
π¦
Reference Value
Control Signal
Measurementsπ¦
Simplified Control System:
π»!(π ) π»"(π )
The Controller is typically a PID Controller that has πΎ", π#and π$ as Tuning Parameters
The purpose with the controller is to make sure the process stays on a desired level, e.g., it could be level in a liquid tank or the temperature at a specific value, e.g., 30β
β’ Transfer functions are a model form based on the Laplace transform. β’ Transfer functions are very useful in
analysis and design of linear dynamic systems.
Transfer Functions
Transfer FunctionsA general Transfer function is on the form:
π» π =π¦(π )π’(π )
Where π¦ is the output and π’ is the input.s is the Laplace operator
π» π π’(π ) π¦(π )
Transfer FunctionsA general transfer function can be written on the following general form:
π» π =ππ’πππππ‘ππ(π )πππππππππ‘ππ(π )
=π-π - + π-./π -./ +β―+ π/ π + π0π1π 1 + π1./π 1./ +β―+ π/ π + π0
The Numerators of transfer function models describe the locations of the zeros of the system, while the Denominators of transfer function models describe the locations of the poles of the system.
Transfer Functions - Examples
π»(π ) =3
π (2π + 1)π»(π ) =1
3π + 1
π» π = !"#$%
π&'# π»(π ) =4
3π ' β 2π + 1
1. Order System:
1. Order System with Time Delay: 2. Order System:
1. Order System with Integrator:
Transfer Functions - Pythonπ» π = 2
3 435/ = 243!53π»(π ) =
23π + 1
π»(π ) =4
3π % β 2π + 1
import numpy as npimport control
num = np.array ([2])den = np.array ([3 , 1])
H = control.tf(num , den)
print ('H(s) =', H)
import numpy as npimport control
num = np.array ([3])den = np.array ([2 , 1, 0])
H = control.tf(num , den)
print ('H(s) =', H)
import numpy as npimport control
num = np.array ([4])den = np.array ([3 , -2, 1])
H = control.tf(num , den)
print ('H(s) =', H)π»(π ) =
4π + 12π % + 5π β 2
import numpy as npimport control
num = np.array ([4, 1])den = np.array ([2 , 5, -2])
H = control.tf(num , den)
print ('H(s) =', H)
Transfer Functions1.order Transfer Function:
π»(π ) =πΎ
ππ + 1
π»(π ) =πΎπ
Integrator:
π»(π ) =πΎ
ππ + 1π.=3π»(π ) = π.=3
Transfer Function for Time Delay:1. order Transfer Function with Time Delay:
2. order Transfer Function: π»(π ) =πΎ
ππ 4 + ππ + π
π»(π ) =πΎ
(π/ + 1)(π4π + 1)
or:
More about the different types of Transfer Functions later in this Tutorial
Control System
Controller Process
Sensors
Actuators
Filtering
π π’π
β
π₯
π£Reference Value
Control Signal
Noise/Disturbance
Process Output
π¦
π»( π
π») π π»# π
π»* π π»+ π
Back to the Control System: Each block can be described by a Transfer Function:
Hans-Petter Halvorsen
https://www.halvorsen.blog
Python Examples
Python Examplesβ’ SciPy (SciPy.signal)β Included with Anaconda Distributionβ Limited Functions and Features for Control Systems
β’ Python Control Systems Libraryβ I will refer to it as the βControlβ Libraryβ Very similar features as the MATLAB Control System
Toolboxβ You need to install it (βpip install controlβ)
Hans-Petter Halvorsen
https://www.halvorsen.blog
SciPy.signal
β’ The SciPy.signal contains Signal Processing functionsβ’ SciPy is also included with the Anaconda distribution β’ If you have installed Python using the Anaconda
distribution, you donβt need to install anythingβ’ https://docs.scipy.org/doc/scipy/reference/signal.html
SciPy.signal
Python import numpy as npimport scipy.signal as signalimport matplotlib.pyplot as plt
# Define Transfer Functionnum = np.array([2])den = np.array([3 , 1])
H = signal.TransferFunction(num , den)
print ('H(s) =', H)
# Step Responset, y = signal.step(H)
# Plottingplt.plot(t, y)plt.title("Step Response")plt.xlabel("t")plt.ylabel("y")plt.grid()plt.show()
π»(π ) =2
3π + 1
Transfer Function:
H(s) = TransferFunctionContinuous(array([0.66666667]),array([1., 0.33333333]),dt: None)
Comments to Results
π»(π ) =2
3π + 1
Transfer Function:
H(s) = TransferFunctionContinuous(array([0.66666667]),array([1., 0.33333333]),dt: None)
π»(π ) =23
33 π +
13
π»(π ) =0.67
π + 0.33
Hans-Petter Halvorsen
https://www.halvorsen.blog
Python Control Systems Library
β’ The Python Control Systems Library (control) is a Python package that implements basic operations for analysis and design of feedback control systems.
β’ Existing MATLAB user? The functions and the features are very similar to the MATLAB Control Systems Toolbox.
β’ Python Control Systems Library Homepage: https://pypi.org/project/control
β’ Python Control Systems Library Documentation: https://python-control.readthedocs.io
Python Control Systems Library
The Python Control Systems Library package may be installed using pip:
Installation
pip install control
β’ PIP is a Package Manager for Python packages/modules.
β’ You find more information here: https://pypi.org
β’ Search for βcontrolβ.β’ The Python Package Index (PyPI) is a
repository of Python packages where you use PIP in order to install them
Anaconda PromptIf you have installed Python with Anaconda Distribution, use the Anaconda Prompt in order to install it (just search for it using the Search field in Windows).
pip install control
pip list
Command Prompt - PIP
C:\Users\hansha\AppData\Local\Programs\Python\Python37-32\Scripts\pip install control
Example: Install Python package βcamelCaseβ:
pip install control
pip list or βPython37_64β for Python 64bits
Python Control Systems Library - FunctionsFunctions for Model Creation and Manipulation:β’ tf()- Create a transfer function systemβ’ ss()- Create a state space systemβ’ c2d()- Return a discrete-time systemβ’ tf2ss()- Transform a transfer function to a state space systemβ’ ss2tf()- Transform a state space system to a transfer function.β’ series()- Return the series of 2 or more subsystemsβ’ parallel()- Return the parallel of 2 or more subsystemsβ’ feedback()- Return the feedback of systemβ’ pade()- Creates a Pade Aproxomation, which is a Transfer function
representation of a Time Delay
Python Control Systems Library - FunctionsFunctions for Model Simulations:β’ step_response()- Step response of a linear systemβ’ lsim()- Simulate the output of a linear systemFunctions for Stability Analysis:β’ step_response()- Step response of a linear systemβ’ lsim()- Simulate the output of a linear systemβ’ pole()- Compute system polesβ’ zero()- Compute system zerosβ’ pzmap()- Plot a pole/zero map for a linear systemβ’ margin()- Calculate gain and phase margins and frequenciesβ’ stability_margins()- Calculate stability margins and frequencies+++ Many more Functions β¦
Python
π»(π ) =2
3π + 1
import controlimport numpy as npimport matplotlib.pyplot as plt
num = np.array([2])den = np.array([3 , 1])
H = control.tf(num , den)print ('H(s) =', H)
t, y = control.step_response(H)
plt.plot(t,y)plt.title("Step Response")plt.grid()
Transfer Function:
Alternative
π»(π ) =2
3π + 1
import controlimport matplotlib.pyplot as plt
s = control.TransferFunction.s
H = (2)/(3*s + 1)
print ('H(s) =', H)
t, y = control.step_response(H)
plt.plot(t,y)plt.title("Step Response")plt.grid()
Transfer Function:
Alternative
π»(π ) =6π + 1
π ! + 4π + 8
import controlimport matplotlib.pyplot as plt
s = control.TransferFunction.s
H = (6*s + 1)/(s**2 + 4*s + 8)
print ('H(s) =', H)
t, y = control.step_response(H)
plt.plot(t,y)plt.title("Step Response")plt.grid()
Transfer Function:
Which approach you should use is a matter of taste and what kind of system you are implementing, etc.
Hans-Petter Halvorsen
https://www.halvorsen.blog
Types of Transfer Functions
Types of Transfer Functionsβ’ 1. order Transfer Functionsβ’ Integrator β’ Time Delayβ’ 1. order Transfer Function with Time Delayβ’ 2. order Transfer Functions
Hans-Petter Halvorsen
https://www.halvorsen.blog
1.order Transfer Function
1.order Transfer Functions
π» π =π¦(π )π’(π )
=πΎ
ππ + 1
A 1.order transfer function is given by:
Where πΎ is the Gain and π is the Time constant
In the time domain we get the following equation (using Inverse Laplace):
π¦ π‘ = πΎπ(1 β π"#$)
(After a Step π for the input signal π’(π ))
1.order β Step Response100%
63%
πΎπ
π‘π
π¦ π‘ = πΎπ(1 β π.?@)
π» π =π¦(π )π’(π )
=πΎ
ππ + 1
π¦(π‘)
Why π = 63%?
π¦ π‘ = πΎπ(1 β π.?@)
We have:
π» π =π¦(π )π’(π )
=πΎ
ππ + 1
We set π‘ = π:
π¦ π‘ = πΎπ 1 β π!"" = πΎπ 1 β π!# = πΎπ 1 β 0.37 = 0.63 9 πΎπ
This means the step response has reached 63% after π seconds
Python import numpy as npimport matplotlib.pyplot as pltimport control
K = 3T = 4
num = np.array ([K])den = np.array ([T , 1])
H = control.tf(num , den)print ('H(s) =', H)
t, y = control.step_response(H)
plt.plot(t,y)plt.title("Step Response")plt.grid()
π»(π ) =3
4π + 1
Transfer Function:
1.order Transfer Functions
π» π =π¦(π )π’(π )
=πΎ
ππ + 1
A 1.order transfer function is given by:
Where πΎ is the Gain and π is the Time constant
In the time domain we get the following equation (using Inverse Laplace):
π¦ π‘ = πΎπ(1 β π"#$)
(After a Step π for the input signal π’(π ))
Time Constant πimport numpy as npimport controlimport matplotlib.pyplot as plt
K = 10Tarray = [5, 10, 30, 50]
start = 0stop = 200step = 0.1t = np.arange(start, stop, step)
for T in Tarray:#Create Transfer Functionnum = np.array ([K])den = np.array ([T , 1])
H = control.tf(num , den)
print ('H(s) =', H)# Step Responset, y = control.step_response(H, t)# Plotplt.plot(t, y)
plt.title("Step Response for different T")plt.xlabel("t")plt.ylabel("y")plt.legend(Tarray)plt.grid()plt.show()
Conclusion:Larger π β Slower SystemSmaller π β Faster System
Transfer Function:
π» π =π¦(π )π’(π ) =
10ππ + 1 We try with
different values for π
π¦ π‘ = πΎπ(1 β π.?@)
Step Response:
Gain Kimport numpy as npimport controlimport matplotlib.pyplot as plt
T = 10Karray = [1, 3, 5, 10]
start = 0stop = 60step = 0.1t = np.arange(start, stop, step)
for K in Karray:#Create Transfer Functionnum = np.array ([K])den = np.array ([T , 1])
H = control.tf(num , den)
print ('H(s) =', H)# Step Responset, y = control.step_response(H, t)# Plotplt.plot(t, y)
plt.title("Step Response for different K")plt.xlabel("t")plt.ylabel("y")plt.legend(Karray)plt.grid()plt.show()
Transfer Function;
π» π =π¦(π )π’(π ) =
πΎ10π + 1 We try with
different values for πΎ
Steady State Response:
π¦ π‘ = πΎπ(1 β π.?@)
π¦& = lim'β)
π¦ π‘ = πΎπ
(We used π = 1 in the simulations)
Step Response:
Hans-Petter Halvorsen
https://www.halvorsen.blog
Integrator
Integrator
π» π =π¦(π )π’(π )
=πΎπ
A Transfer Function for an Integrator is given by:
Where πΎ is the Gain
In the time domain we get the following equation (using Inverse Laplace):
π¦ π‘ = πΎππ‘π»(π ) =πΎπ
(After a Step π for the unput signal π’(π ))
Example of an Integrator: A Water/Liquid Tank
Python import numpy as npimport matplotlib.pyplot as pltimport control
K = 3
num = np.array ([K])den = np.array ([1, 0])
H = control.tf(num , den)print ('H(s) =', H)
t, y = control.step_response(H)
plt.plot(t,y)plt.title("Step Response")plt.grid()
π»(π ) =πΎπ
π»(π ) =3π
We set πΎ = 3 in this example:
Hans-Petter Halvorsen
https://www.halvorsen.blog
Time Delay
Time Delay
π» π =π¦(π )π’(π )
=πΎ
ππ + 1π"%&
π» π =π¦(π )π’(π ) = π!"#
Transfer Function for Time Delay:
1. order Transfer Function with Time Delay:
Time Delay
π»(π ) = π!"#Transfer Function for Time Delay:
Step Response for Time Delay:
ππ‘
1
PadΓ© ApproximationIn some situations, it is necessary to substitute π*+& with an approximation, e.g., the PadΓ© Approximation:
π*+& β1 β π,π + π%π % +β― Β± π-π -
1 + π,π + π%π % +β―+ π-π -
π»(π ) = π*+&Transfer Function for Time Delay:
1.order PadΓ© Approximation: 2.order PadΓ© Approximation:
π!$% β1 β π#π 1 + π#π
=βπ#π + 1π#π + 1
Where π, =+%
Where n is the order of the approximation and π,, π%, β¦ are constants
π.=3 β /.K"35K!3!
/5K"35K!3!
Where π, =+%
and π% =+!
,%etc.
PadΓ© Approx.import numpy as npimport matplotlib.pyplot as pltimport control
# Time DelayTau = 2
# Approximation OrderN = 5
[num_pade,den_pade] = control.pade(Tau,N)Hpade = control.tf(num_pade,den_pade)print ('Hpade(s) =', Hpade)
start = 0stop = 10step = 0.1
t = np.arange(start, stop, step)
t, y = control.step_response(Hpade, t)
plt.plot(t,y)title = "Pade Aprroximation, N=" + str(N)plt.title(title)plt.grid()
π»(π ) = π&'#
We can use the pade()Function:
If you want a more accurate approximation, you can increase the order N. PadΓ© approximations with order π > 10 should be avoided.
PadΓ© Approx.import numpy as npimport matplotlib.pyplot as pltimport control
# Time DelayTau = 2
N = 5
start = 0stop = 10step = 0.1t = np.arange(start, stop, step)
N = [1, 2, 3, 5, 10]
for n in N:[num_pade,den_pade] = control.pade(Tau,n)Hpade = control.tf(num_pade,den_pade)print ('Hpade(s) =', Hpade)
t, y = control.step_response(Hpade, t)
plt.plot(t,y)
plt.title("Pade Aprroximations") plt.legend(N)plt.grid()
π»(π ) = π&'#
We plot PadΓ© Approximations with different orders in the same Plot:
1. order with Time Delay
π»(π ) =πΎ
ππ + 1π"%&
1. order Transfer Function with Time Delay:
Where πΎ is the Gain, π is the Time constant and π is the Time Delay
1. order with Time DelayStep Response
100%
63%
πΎπ
π‘
ππ
π»(π ) =πΎ
ππ + 1π"%&
Pythonimport numpy as npimport matplotlib.pyplot as pltimport control
K = 3T = 4
num = np.array ([K])den = np.array ([T , 1])
H1 = control.tf(num , den)print ('H1(s) =', H1)
Tau = 2N = 5 # Order of the Approximation[num_pade,den_pade] = control.pade(Tau,N)Hpade = control.tf(num_pade,den_pade)print ('Hpade(s) =', Hpade)
H = control.series(H1, Hpade)print ('H(s) =', H)
t, y = control.step_response(H)
plt.plot(t,y)plt.title("H(s)")plt.grid()
π»(π ) = '(&)*
π"!&Transfer Function:
Hans-Petter Halvorsen
https://www.halvorsen.blog
2.order Transfer Function
2.order Transfer Functions
π»(π ) =πΎ
ππ 4 + ππ + ππ»(π ) =
πΎ(π/π + 1)(π4π + 1)
2. order Transfer Function can be given on the following form:
Or like this:
Or like this:
Where π, and π% are Time Constants
πΎ is the gainπ zeta is the relative damping factorπ![rad/s] is the undamped resonance frequency
π» π =πΎπ&'
π ' + 2ππ&π + π&'=
πΎπ π&
'+ 2π π
π&+ 1
2.order Transfer FunctionsSpecial case: When π > 0 and the poles are real and distinct we have:
π»(π ) =πΎ
(π,π + 1)(π%π + 1)
We see that this system can be considered as two 1.order systems in series:
π» π = π», π π», π =πΎ
(π,π + 1)N
1(π%π + 1)
=πΎ
(π,π + 1)(π%π + 1)
Python import numpy as npimport scipy.signal as signalimport matplotlib.pyplot as plt
# Define Transfer Functionnum = np.array([4])den = np.array([3 , 2, 1])
H = signal.TransferFunction(num , den)
print ('H(s) =', H)
# Step Responset, y = signal.step(H)
# Plottingplt.plot(t, y)plt.title("Step Response")plt.xlabel("t")plt.ylabel("y")plt.grid()plt.show()
π»(π ) =4
3π ' + 2π + 1
SciPy.signal
Python import controlimport numpy as npimport matplotlib.pyplot as plt
# Define Transfer Functionnum = np.array([4])den = np.array([3 , 2, 1])
H = control.tf(num , den)print ('H(s) =', H)
# Step Responset, y = control.step_response(H)
# Plottingplt.plot(t, y)plt.title("Step Response")plt.xlabel("t")plt.ylabel("y")plt.grid()plt.show()
π»(π ) =4
3π ' + 2π + 1
The Python Control Systems Library
Hans-Petter Halvorsen
https://www.halvorsen.blog
Poles and Zeros
Transfer FunctionsA general transfer function can be written on the following general form:
π» π =ππ’πππππ‘ππ(π )πππππππππ‘ππ(π )
=π-π - + π-./π -./ +β―+ π/ π + π0π1π 1 + π1./π 1./ +β―+ π/ π + π0
The Numerators of transfer function models describe the locations of the Zerosof the system, while the Denominators of transfer function models describe the locations of the Poles of the system.
Transfer FunctionsA general transfer function can be written on the following general form:
π» π =π1/π + 1 π14π + 1 β― π1Kπ + 1πO/π + 1 πO4π + 1 β― πO-π + 1
π» π =πππππ πππππ
Example:
π» π =π + 1 2π + 13π + 1 4π + 1
Zeros:
Poles:
π + 1 = 0
2π + 1 = 0
3π + 1 = 04π + 1 = 0
π§, = β1
π§% = β0.5
π, = β0.33
π% = β0.25
Pythonimport numpy as npimport control
num = np.array([1, 1])den = np.array([3 , 1])H1 = control.tf(num , den)
num = np.array([2, 1])den = np.array([4 , 1])H2 = control.tf(num , den)
H = control.series(H1,H2)print ('H(s) =', H)
z = control.zero(H)print ('z =', z)
p = control.pole(H)print ('p =', p)
control.pzmap(H)
Transfer Function:
π» π =π + 1 2π + 13π + 1 4π + 1 π» π =
π + 13π + 1 N
2π + 14π + 1
Alternatively we can multiply:
π» π =2π % + π + 2π + 112π % + 3π + 4π + 1 =
2π % + 3π + 112π % + 7π + 1
num = np.array([2, 3, 1])den = np.array([12 , 7, 1])H = control.tf(num , den) num1 = np.array([1, 1])
num2 = np.array([2, 1])num = np.convolve(num1, num2)
den1 = np.array([3 , 1])den2 = np.array([4 , 1])den = np.convolve(den1, den2)
H = control.tf(num , den)
Or we can use the np.convolve() function:
Resultsπ» π =
π + 1 2π + 13π + 1 4π + 1
π§, = β1
π§% = β0.5
π, = β0.33
π% = β0.25
control.pzmap(H)
z = [-1. -0.5]
z = control.zero(H)
p = control.pole(H)
p = [-0.33333333 -0.25]
Poles and Stability of the SystemThe poles are important when analyzing the stability of a system. The Figure below gives an overview of the poles impact on the stability of a system.
Unstable System
(right side)Stable System
(left side) Re
ImWe have 3 different Alternatives:1. Asymptotically Stable System2. Marginally Stable System3. Unstable System
Poles and Stability
π‘ π‘
lim(β*
π¦ π‘ = β
π‘
0 < lim(β*
π¦ π‘ < βlim(β*
π¦ π‘ = π
Re
ImPoles:
Step Response:
Re
Im
Re
Im
Asymptotically Stable System Marginally Stable System Unstable System
Asymptotically Stable System
Re
Im
Each of the poles of the transfer function lies strictly in the left half plane (has strictly negative real part)
π‘
lim(β*
π¦ π‘ = π
Python import controlimport numpy as npimport matplotlib.pyplot as plt
# Define Transfer Functionnum = np.array([2])den = np.array([3 , 1])
H = control.tf(num , den)print ('H(s) =', H)
# Polesp = control.pole(H)print ('p =', p)
# Step Responset, y = control.step_response(H)
plt.plot(t,y)plt.title("Step Response")plt.grid()
control.pzmap(H)
Transfer Function:
π» π =π¦(π )π’(π )
=2
3π + 1
p = [-0.33333333]
lim(β*
π¦ π‘ = π
Asymptotically Stable System
Marginally Stable System
Re
Im
π‘
0 < lim(β*
π¦ π‘ < β
One or more poles lies on the imaginary axis (have real part equal to zero), and all these poles are distinct. Besides, no poles lie in the right half plane.
Python import controlimport numpy as npimport matplotlib.pyplot as plt
# Define Transfer Functionnum = np.array([3])den = np.array([1, 0, 1])
H = control.tf(num , den)print ('H(s) =', H)
# Polesp = control.pole(H)print ('p =', p)
# Step Responsetstart = 0; tstop = 20; tstep = 0.1t = np.arange(tstart, tstop, tstep)t, y = control.step_response(H, t)
plt.plot(t,y)plt.title("Step Response")plt.grid()
control.pzmap(H)
Transfer Function:
π»(π ) =3
π % + 1
Marginally Stable System
Unstable System
Re
Im
Re
Im
or
π‘
lim(β*
π¦ π‘ = β
At least one pole lies in the right half plane (has real part greater than zero).
Or: There are multiple and coincident poles on the imaginary axis.Example: double integrator π»(π ) = ,
&!
Python import controlimport numpy as npimport matplotlib.pyplot as plt
# Define Transfer Functionnum = np.array([2])den = np.array([3 , -1])
H = control.tf(num , den)print ('H(s) =', H)
# Polesp = control.pole(H)print ('p =', p)
# Step Responset, y = control.step_response(H)
plt.plot(t,y)plt.title("Step Response")plt.grid()
control.pzmap(H)
Transfer Function:
π»(π ) =2
3π β 1
Unstable System
lim(β*
π¦ π‘ = β
Pythonimport controlimport numpy as npimport matplotlib.pyplot as plt
# Define Transfer Functionnum = np.array([2, 1])den = np.array([3 , -1, -2])
H = control.tf(num , den)print ('H(s) =', H)
# Polesp = control.pole(H)print ('p =', p)
# Step Responset, y = control.step_response(H)
plt.plot(t,y)plt.title("Step Response")plt.grid()
control.pzmap(H)
Transfer Function:
π» π =2π + 1
3π % β π β 2
Unstable System
lim(β*
π¦ π‘ = β
Pythonimport controlimport numpy as npimport matplotlib.pyplot as plt
# Define Transfer Functionnum = np.array([2])den = np.array([1, 0, 0])
H = control.tf(num , den)print ('H(s) =', H)
# Polesp = control.pole(H)print ('p =', p)
# Step Responset, y = control.step_response(H)
plt.plot(t,y)plt.title("Step Response")plt.grid()
control.pzmap(H)
Transfer Function:
π»(π ) =2π 4
Unstable System
π, = 0, π% = 0
Additional Python Resources
https://www.halvorsen.blog/documents/programming/python/
Hans-Petter Halvorsen
University of South-Eastern Norwaywww.usn.no
E-mail: [email protected]: https://www.halvorsen.blog