Software Simulation For Bode Plot
Software Simulation For Bode Plot
Student Name
Roll Number
Grade and Subject
Teacher’s Signature
Bode plot is the representation of the magnitude and phase of G(j*w) (where the frequency
vector w contains only positive frequencies). To see the Bode plot of a transfer function, you
can use the Matlab bode command. For example,
bode(50,[1 9 30 40])
displays the Bode plots for the transfer function:
Page |1
Gain and Phase Margin
Let's say that we have the following system:
Where K is a variable (constant) gain and G(s) is the plant under consideration.
The gain margin is defined as the change in open loop gain required to make the system
unstable. Systems with greater gain margins can withstand greater changes in system
parameters before becoming unstable in closed loop. Keep in mind that unity gain in
magnitude is equal to a gain of zero in dB.
The phase margin is defined as the change in open loop phase shift required for making a
closed loop system unstable.
The phase margin is the difference in phase between the phase curve and -180 deg at the point
corresponding to the frequency that gives us a gain of 0dB (the gain cross over frequency,
Wgc).
Page |2
Likewise, the gain margin is the difference between the magnitude curve and 0dB at the point
corresponding to the frequency that gives us a phase of -180 deg (the phase cross over
frequency, Wpc).
We can find the gain and phase margins for a system directly, by using Matlab. Just enter the
margin command. This command returns the gain and phase margins, the gain and phase cross
over frequencies, and a graphical representation of these on the Bode plot. Let's check it out:
margin(50,[1 9 30 40])
Page |3
Basics of Root Locus
Root locus plot of dynamic system
Syntax
rlocus(sys)
rlocus(sys1,sys2,...)
[r,k] = rlocus(sys)
r = rlocus(sys,k)
Description
Rlocus computes the root locus of a SISO open-loop model. The root locus gives the closed-
loop pole trajectories as a function of the feedback gain k (assuming negative feedback). Root
loci are used to study the effects of varying feedback gains on closed-loop pole locations. In
turn, these locations provide indirect information on the time and frequency responses.
rlocus (sys) calculates and plots the root locus of the open-loop SISO model sys. This function
can be applied to any of the following negative feedback loops by setting sys appropriately.
Page |4
rlocus(sys1,'r',sys2,'y:',sys3,'gx').
[r,k] = rlocus(sys) and r = rlocus(sys,k) return the vector k of selected gains and the complex
root locations r for these gains. The matrix r has length(k) columns and its jth column lists the
closed-loop roots for the gain k(j).
Examples
Root Locus Plot of Dynamic System
Plot the root-locus of the following system.
You can use the right-click menu for rlocus to add grid lines, zoom in or out, and invoke the
Property Editor to customize the plot. Also, click anywhere on the curve to activate a data
marker that displays the gain value, pole, damping, overshoot, and frequency at the selected
point.
ALGORITHM:
Page |5
FLOWCHART:
clc; clc;
clear all; clear all;
close all; close all;
s=tf('s'); …declaration of function variable s=tf('s'); …declaration of function variable
subplot(2,2,4)
bode(tf4) bode plot for T.F. 4
margin(tf4)
grid on
Page |6
RESULTS: BODE PLOT
ROOT LOCUS
Page |7
CONCLUSION:
Page |8