Transfer Function

English translation

Learning objectives

Even with the same coefficients, responses depend on the interconnection and cancellation conditions. Practice predicting behavior from coefficients.

Execution conditions

Find poles and zeros using python-control's ctl.poles and ctl.zeros.

If the module is missing, run %pip install control==0.10.2 in a Colab or Jupyter code cell.

From coefficients to poles and zeros

Starting conditions

Procedure

  1. Run A as the baseline example. Write the numerator and denominator as polynomials, and calculate using np.roots and ctl.poles/ctl.zeros.
  2. Apply the same procedure to B and C. Distinguish numerator and denominator degrees from the number of finite zeros, and record both real and imaginary parts of complex roots.
  3. Plot the poles and zeros of all three models on one complex plane. Use × for poles and ○ for zeros, with a different color for each model.

Results to retain

import numpy as np
import matplotlib.pyplot as plt
import control as ctl
s = ctl.tf('s')
models = {'A':([2],[5,1]), 'B':([1,2],[1,3,2]), 'C':([1,1],[1,2,5])}
H_A = ctl.tf(*models['A'])
print(H_A, ctl.poles(H_A), ctl.zeros(H_A), ctl.dcgain(H_A))
# TODO: Complete the tables and complex-plane plots for B, C.

Record results and self-check

Model:

H(s):

Pole:

Finite zeros:

DC Gain:

Points to check

Comparing series, parallel, and feedback connections

Starting conditions

H1(s)=2sH_1(s)=\frac2s, H2(s)=34s+1H_2(s)=\frac3{4s+1}. Use negative unity feedback for H1H2H_1H_2.

Procedure

  1. Derive expressions for Hs=H1H2H_s=H_1H_2, Hp=H1+H2H_p=H_1+H_2, and T=Hs1+HsT=\frac{H_s}{1+H_s}.
  2. Use ctl.series, ctl.parallel, ctl.feedback to build the same models, and compare with the directly derived expressions at ω=[0.1,1,10] rad/s.
  3. Plot the unit-step response of T over 0≤t≤500\le t\le 50 s. Distinguish the poles at the origin of Hs and Hp from the meaning of DC gain.

Results to retain

import numpy as np
import matplotlib.pyplot as plt
import control as ctl
s = ctl.tf('s')
H1=ctl.tf([2],[1,0]); H2=ctl.tf([3],[4,1])
Hs=ctl.series(H1,H2); Hp=ctl.parallel(H1,H2); T=ctl.feedback(Hs,1)
print(Hs, Hp, T)
t=np.linspace(0,50,2501)
t,y=ctl.step_response(T,t)
plt.plot(t,y); plt.xlabel('Time [s]'); plt.ylabel('Output'); plt.grid()
# TODO: Compare frequency responses with the directly calculated models.

Record results and self-check

Interconnection:

Derived numerator:

Derived denominator:

Maximum frequency-response error:

Points to check

Cancellation and small coefficient changes

Starting conditions

Create model D by changing B's numerator from [1,2] to [1,2.1]. Both models have denominator [1,3,2].

Procedure

  1. Record the original pole–zero maps of B and D alongside the models simplified with minreal.
  2. Plot the difference between the two responses to the same unit-step input over 0≤t≤100\le t\le 10 s.
  3. Distinguish exact from near cancellation, and explain why the model before cancellation should also be retained.

Results to retain

import numpy as np
import matplotlib.pyplot as plt
import control as ctl
s = ctl.tf('s')
B=ctl.tf([1,2],[1,3,2]); D=ctl.tf([1,2.1],[1,3,2])
print(ctl.minreal(B),ctl.minreal(D))
# TODO: Examine both responses and their difference on the same time axis.

Record results and self-check

Model:

Original order:

Order after simplification:

Maximum response difference:

Points to check