1. (65 points) Write a Python program to draw Bode plots for a pathway of arbitrary length. The program should use the transfer function equation (SI - A)¹B that we discussed in class to compute the amplitude and phase plots. A python function to compute B is provided for you. See end of assignment. The program should be split into python functions rather than be one block of code. For exam- ple, you might have specific functions to compute the amplitude and phase given a complex number, you might have a function that does the actual plotting of the Bode plots. Use the subplot feature of matplotlib to plot the amplitude and phase plots side by side. Add appropriate labeling to the x and y axis and make sure each plot has a title to indicate what kind of plot it is. Here is an example of what a plot might look like: Decibels Amplitude Plot Phase Plot 0 0 -10 -25 -20 -50 -30 -40 Degrees -75 -100 -50 -125 -60 -150 -70 -175 -80 10-5 10-3 10-1 Frequency, rad/sec 10¹ 10-5 10-3 10-1 Frequency, rad/sec 10¹ For extra credit you can also add a grid to both plots. You should test and confirm that your program gives the correct Bode plots for a first order model such as: r te.loada (')) ''') $Xo -> x1; k1*Xo x1 ->%; k2*x1 Xo = 1 k1 0.6; k2 = 1.8%; You can use WolframAlpha to confirm that your program is working correctly. For example, the following command will generate the Bode plots for a first-order transfer function. Bode plot of the transfer function 3/(s+1) Obviously to do this you will need to derive the transfer function in order to obtain the coeffi- cients.

Delmar's Standard Textbook Of Electricity
7th Edition
ISBN:9781337900348
Author:Stephen L. Herman
Publisher:Stephen L. Herman
Chapter15: Alternating Current
Section: Chapter Questions
Problem 4RQ: 4. What is frequency?
icon
Related questions
Question

Help with homework, with the extra portion part too please

1. (65 points) Write a Python program to draw Bode plots for a pathway of arbitrary length.
The program should use the transfer function equation (SI - A)¹B that we discussed in class
to compute the amplitude and phase plots.
A python function to compute B is provided for you. See end of assignment.
The program should be split into python functions rather than be one block of code. For exam-
ple, you might have specific functions to compute the amplitude and phase given a complex
number, you might have a function that does the actual plotting of the Bode plots.
Use the subplot feature of matplotlib to plot the amplitude and phase plots side by side. Add
appropriate labeling to the x and y axis and make sure each plot has a title to indicate what
kind of plot it is. Here is an example of what a plot might look like:
Decibels
Amplitude Plot
Phase Plot
0
0
-10
-25
-20
-50
-30
-40
Degrees
-75
-100
-50
-125
-60
-150
-70
-175
-80
10-5
10-3 10-1
Frequency, rad/sec
10¹
10-5
10-3
10-1
Frequency, rad/sec
10¹
For extra credit you can also add a grid to both plots.
You should test and confirm that your program gives the correct Bode plots for a first order
model such as:
r te.loada ('))
''')
$Xo -> x1; k1*Xo
x1 ->%; k2*x1
Xo = 1
k1
0.6; k2 = 1.8%;
You can use WolframAlpha to confirm that your program is working correctly. For example,
the following command will generate the Bode plots for a first-order transfer function.
Bode plot of the transfer function 3/(s+1)
Obviously to do this you will need to derive the transfer function in order to obtain the coeffi-
cients.
Transcribed Image Text:1. (65 points) Write a Python program to draw Bode plots for a pathway of arbitrary length. The program should use the transfer function equation (SI - A)¹B that we discussed in class to compute the amplitude and phase plots. A python function to compute B is provided for you. See end of assignment. The program should be split into python functions rather than be one block of code. For exam- ple, you might have specific functions to compute the amplitude and phase given a complex number, you might have a function that does the actual plotting of the Bode plots. Use the subplot feature of matplotlib to plot the amplitude and phase plots side by side. Add appropriate labeling to the x and y axis and make sure each plot has a title to indicate what kind of plot it is. Here is an example of what a plot might look like: Decibels Amplitude Plot Phase Plot 0 0 -10 -25 -20 -50 -30 -40 Degrees -75 -100 -50 -125 -60 -150 -70 -175 -80 10-5 10-3 10-1 Frequency, rad/sec 10¹ 10-5 10-3 10-1 Frequency, rad/sec 10¹ For extra credit you can also add a grid to both plots. You should test and confirm that your program gives the correct Bode plots for a first order model such as: r te.loada (')) ''') $Xo -> x1; k1*Xo x1 ->%; k2*x1 Xo = 1 k1 0.6; k2 = 1.8%; You can use WolframAlpha to confirm that your program is working correctly. For example, the following command will generate the Bode plots for a first-order transfer function. Bode plot of the transfer function 3/(s+1) Obviously to do this you will need to derive the transfer function in order to obtain the coeffi- cients.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Delmar's Standard Textbook Of Electricity
Delmar's Standard Textbook Of Electricity
Electrical Engineering
ISBN:
9781337900348
Author:
Stephen L. Herman
Publisher:
Cengage Learning
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
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
EBK ELECTRICAL WIRING RESIDENTIAL
EBK ELECTRICAL WIRING RESIDENTIAL
Electrical Engineering
ISBN:
9781337516549
Author:
Simmons
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Electric Motor Control
Electric Motor Control
Electrical Engineering
ISBN:
9781133702818
Author:
Herman
Publisher:
CENGAGE L