Write python program to plot the zeros and poles if a user provides the coefficients for the numerator and denominator of the transfer function. Since the zeros and poles can be complex, this plot is essentially and argand diagram, where the x axis is the real component and the y axis the imaginary component of a given zero or pole. Create a method called plot-poles zeros(num, den) which takes two lists containing the coefficients. Here is an example and the resulting plot. num [1, 3, 7] # yields zeros at -1.5 +/- 2.17945j den = [1, 4, 5, 3] # yields poles at -2.46557, -0.7672143 +/- 0.7925519j plot_poles_zeros(num, den) Imaginary Page 2 Pole-Zero Plot 3 Zeros × Poles 2 1 -2 1 * Real When you write your code you are only allowed to use the packages numpy and matplotlib. Make sure you label the axes, provide a legend and give a title to your plot (See the example plot). Hint: numpy has a method called roots. When given a list of numbers corresponding to the coefficients of a polynomial, it will find the solutions. Make sure you use cross symbol for poles and filled circles for zeros. You can use what ever colors you like. The numpy methods real and imag will let you extract the real and imaginary part of a zero or pole.

Power System Analysis and Design (MindTap Course List)
6th Edition
ISBN:9781305632134
Author:J. Duncan Glover, Thomas Overbye, Mulukutla S. Sarma
Publisher:J. Duncan Glover, Thomas Overbye, Mulukutla S. Sarma
Chapter6: Power Flows
Section: Chapter Questions
Problem 6.22P
icon
Related questions
Question
Write python program to plot the zeros and poles if a user provides the coefficients for
the numerator and denominator of the transfer function. Since the zeros and poles can be
complex, this plot is essentially and argand diagram, where the x axis is the real component
and the y axis the imaginary component of a given zero or pole.
Create a method called plot-poles zeros(num, den) which takes two lists containing the
coefficients. Here is an example and the resulting plot.
num
[1, 3, 7] # yields zeros at -1.5 +/- 2.17945j
den = [1, 4, 5, 3] # yields poles at -2.46557, -0.7672143 +/- 0.7925519j
plot_poles_zeros(num, den)
Imaginary
Page 2
Pole-Zero Plot
3
Zeros
× Poles
2
1
-2
1
*
Real
When you write your code you are only allowed to use the packages numpy and matplotlib.
Make sure you label the axes, provide a legend and give a title to your plot (See the example
plot).
Hint: numpy has a method called roots. When given a list of numbers corresponding to the
coefficients of a polynomial, it will find the solutions.
Make sure you use cross symbol for poles and filled circles for zeros. You can use what ever
colors you like.
The numpy methods real and imag will let you extract the real and imaginary part of a zero
or pole.
Transcribed Image Text:Write python program to plot the zeros and poles if a user provides the coefficients for the numerator and denominator of the transfer function. Since the zeros and poles can be complex, this plot is essentially and argand diagram, where the x axis is the real component and the y axis the imaginary component of a given zero or pole. Create a method called plot-poles zeros(num, den) which takes two lists containing the coefficients. Here is an example and the resulting plot. num [1, 3, 7] # yields zeros at -1.5 +/- 2.17945j den = [1, 4, 5, 3] # yields poles at -2.46557, -0.7672143 +/- 0.7925519j plot_poles_zeros(num, den) Imaginary Page 2 Pole-Zero Plot 3 Zeros × Poles 2 1 -2 1 * Real When you write your code you are only allowed to use the packages numpy and matplotlib. Make sure you label the axes, provide a legend and give a title to your plot (See the example plot). Hint: numpy has a method called roots. When given a list of numbers corresponding to the coefficients of a polynomial, it will find the solutions. Make sure you use cross symbol for poles and filled circles for zeros. You can use what ever colors you like. The numpy methods real and imag will let you extract the real and imaginary part of a zero or pole.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Power System Analysis and Design (MindTap Course …
Power System Analysis and Design (MindTap Course …
Electrical Engineering
ISBN:
9781305632134
Author:
J. Duncan Glover, Thomas Overbye, Mulukutla S. Sarma
Publisher:
Cengage Learning
Delmar's Standard Textbook Of Electricity
Delmar's Standard Textbook Of Electricity
Electrical Engineering
ISBN:
9781337900348
Author:
Stephen L. Herman
Publisher:
Cengage Learning
EBK ELECTRICAL WIRING RESIDENTIAL
EBK ELECTRICAL WIRING RESIDENTIAL
Electrical Engineering
ISBN:
9781337516549
Author:
Simmons
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Electricity for Refrigeration, Heating, and Air C…
Electricity for Refrigeration, Heating, and Air C…
Mechanical Engineering
ISBN:
9781337399128
Author:
Russell E. Smith
Publisher:
Cengage Learning
Electric Motor Control
Electric Motor Control
Electrical Engineering
ISBN:
9781133702818
Author:
Herman
Publisher:
CENGAGE L