Control System Practical File
Control System Practical File
PRACTICAL FILE
ON
01 Introduction to MATLAB
2
INTRODUCTION TO MATLAB
(CONTROL SYSTEM LAB)
Experiment No. 1
Software/Hardware used:
After logging into your account, you can enter MATLAB by double-clicking
on the MATLAB shortcut icon (MATLAB 7.8.0) on your Windows desktop:
When you start MATLAB, a special window called the MATLAB desktop
appears. The desktop is a window that contains other windows. The major
tools within or accessible from the desktop are:
Command Window
Command History
Editor Window
Workspace
Current Directory
3
Help Browser
4
Figure 1.2: Editor Window
Control Systems
Computational Finance
Computational Biology
5
3. Type the program
6. If any error occurs in the program correct the error and run it again
6
Figure 1.3: LTI Viewer
7
Experiment No. 2
Object: Determine transpose inverse values of given matrix.
Software/Hardware used:
Matlab Code:
X = [1 0 2; -1 5 0; 0 3 -9]
Y = inv(X)
transpose(X)
Results:
X =
1 0 2
-1 5 0
0 3 -9
8
Y =
ans =
1 -1 0
0 5 3
2 0 -9
9
Experiment No. 3
Object: Plot the pole-zero configurations in s-plane for the given transfer function
H(s)=(2S2+5S+1)/(S2+3S+5).
Software/Hardware used:
MATLAB Code:
Result:
10
Thus the MATLAB Program to plot the pole zero mapping in s-plane using
MATLAB function is written and the results are successfully obtained.
11
Experiment No. 4
Software/Hardware used:
MATLAB Code:
K=2
G=tf([1 2],[1 0.5 3])
H=feedback(G,K)
H2=G/(1+G*K)
zpk(H2)
Results:
K =
Transfer function:
12
s + 2
---------------
s^2 + 0.5 s + 3
Transfer function:
s + 2
---------------
s^2 + 2.5 s + 7
Transfer function:
s^3 + 2.5 s^2 + 4 s + 6
-----------------------------------
s^4 + 3 s^3 + 11.25 s^2 + 11 s + 21
Zero/pole/gain:
(s+2) (s^2 + 0.5s + 3)
---------------------------------
(s^2 + 0.5s + 3) (s^2 + 2.5s + 7)
>>
13
Experiment No. 5
Object: Plot the unit step response, impulse response of transfer function.
Software/Hardware used:
MATLAB Code:
14
Result:
Experiment No. 6
Object: Plot root locus of given transfer function.
Software/Hardware used:
MATLAB Code:
Result:
15
Experiment No. 7
Object: Plot bode plot of given transfer function and find phase and gain margin
Software/Hardware used:
MATLAB Code:
Result:
Transfer function:
8 s^2 + 18 s + 32
-----------------------
s^3 + 6 s^2 + 14 s + 24
>>
16
Experiment No. 8
Software/Hardware used:
MATLAB Code:
s=tf('s')
G=-((2*s+1)/(s^2+3*s+2))
k=0.5
T=feedback(G*k,1)
nyquist(T)
grid on
axis([-2 0 -1 1])
Result:
Transfer function:
17
s
Transfer function:
-2 s - 1
-------------
s^2 + 3 s + 2
k =
0.5000
Transfer function:
-s - 0.5
---------------
s^2 + 2 s + 1.5
>>
18
Experiment No. 9
Object:
Software/Hardware used:
MATLAB Code:
19