Complete the code to import the function that finds poles and zeros of a system.
from scipy.signal import [1]
The tf2zpk function returns zeros, poles, and gain of a transfer function.
Complete the code to find poles of the system given numerator and denominator coefficients.
zeros, poles, gain = tf2zpk(num, [1])The denominator coefficients den define the poles of the system.
Fix the error in the code to check if all poles are inside the unit circle for stability.
is_stable = all(abs(p) [1] 1 for p in poles)
For discrete systems, stability requires all poles to have magnitude less than 1.
Fill both blanks to create a dictionary of poles and zeros magnitudes.
magnitudes = {'poles': [abs(p) for p in [1]], 'zeros': [abs(z) for z in [2]]}We calculate magnitudes of poles and zeros from their respective lists.
Fill all three blanks to filter stable poles and zeros with magnitude less than 1.
stable_poles = [p for p in [1] if abs(p) [2] 1] stable_zeros = [z for z in [3] if abs(z) [2] 1]
We select poles and zeros with magnitude less than 1 to identify stable ones.