How To Draw Bode Diagram, Polar Plot and Nyquist Diagram For Control Systems Via MATLAB
How To Draw Bode Diagram, Polar Plot and Nyquist Diagram For Control Systems Via MATLAB
com
How to draw Bode Diagram, Polar Plot and Nyquist Diagram for Control Systems via
MATLAB
Nima Fouladinejad
1. Example (6.8)
To draw the bode diagram in MATLAB we simply write these in the command window of MATLAB.
Transfer function:
Transfer function:
5 s + 10
-------------------------
20 s^3 + 12 s^2 + s
And here is the MATLAB Bode diagram for this exercise. You can see the Gain Margin, Phase
Margin, correspond frequency and the stability of the system in the figure.
By: Nima Fouladinejad Mat. No: MM081053 Email: [email protected]
Exercise 6.1:
Draw the polar plot of the frequency response diagram for the system shown bellow.
u y
We can simply use this transfer function and draw the Nyquist diagram in MATLAB as follow.
>> s=tf('s') %to identify the transfer function variable
Transfer function:
s
>> G=(1/s)*(10/(1+0.1*s))*(1/(1+0.02*s)) %write the transfer function in MATLAB
Transfer function:
10
------------------------------
By: Nima Fouladinejad Mat. No: MM081053 Email: [email protected]
And here is the MATLAB Nyquist diagram for this exercise. You can see the Gain Margin, Phase
Margin, correspond frequency and the stability of the system in the figure.
Exercise 6.2:
For the control system shown below, plot the Nyquist diagram for K=1, and obtain the gain margin
and phase margin. Verify the answer by calculation.
We can simply use this transfer function and draw the Nyquist diagram in MATLAB as follow.
>> s=tf('s') %to identify the transfer function variable
Transfer function:
s
>> G=10/((s*(1+0.1*s)*(1+0.02*s))+10) %write the transfer function in MATLAB
Transfer function:
By: Nima Fouladinejad Mat. No: MM081053 Email: [email protected]
10
------------------------------
0.002 s^3 + 0.12 s^2 + s+10
>> nyquist(G) %command to Draw the Nyquist diagram
And here is the MATLAB Nyquist diagram for this exercise. You can see the Gain Margin, Phase
Margin, correspond frequency, Minimum Stability Margin, Peak Gain and the stability of the system
in the figure.
Exercise 6.3:
For the control system shown bellow, draw the Bode diagram for K=1. From the bode diagram, obtain
the gain and phase margin.
u y
We can simply use this transfer function and draw the Bode diagram in MATLAB as follow.
>> s=tf('s') %to identify the transfer function variable
Transfer function:
s
>> >> G=40/((s*(s+4)*(s+5))+40) %write the transfer function in MATLAB
By: Nima Fouladinejad Mat. No: MM081053 Email: [email protected]
Transfer function:
40
----------------------------
s^3 + 9 s^2 + 20 s + 40
And here is the MATLAB Bode diagram for this exercise. You can see the Gain Margin, Phase
Margin, correspond frequency, Peak Gain and the stability of the system in the figure.