Professional Documents
Culture Documents
Laboratory Report
For
ME3602-L Control System
Sixth Semester
Spring 2024
Group No.:
Lab Rules
1. Students must thoroughly read the assigned work. It will be assumed that they have studied the
assigned work and have understood the majority of the material and technical terms before the start
of the experiments.
2. All the original data have to be recorded in a Report sheet during the laboratory sessions. Data
recording on rough sheets of papers are not allowed. In order to check for the originality of the data,
ball pen or inerasable pen should be used. If correction has to be made, just cross it out. They must
hand over the Report sheet to the demonstrator for their signature after data count.
3. For safety reasons, students are requested not to leave their equipment unattended during the lab.
Session. In the case of special circumstances, please seek the support of the class
teachers/demonstrators
4. All practical contribute to the final results of the sessional course. Thus any absent laboratory session
automatically means lost marks for the final grade. Under special circumstances (supported by
documentary proof), e.g. illness and other reasonable causes a laboratory session may be re-
scheduled upon approval of the head of the department.
5. During the class, students will be continuously assessed by performance test on each and every
experiment.
6. To ensure your fellow students can proceed with their experiments in a degree of comfort and
without undue noise and other disturbances, keep the noise level down and stay in your own
laboratory bench area. Mobile phones should be switched off during the experiments
Front Page:
• Name of the Student
• Student ID No.
• Name of the Department
• Group
• Batch No.
• Date of Allotment
• Date of Performance
• Date of Submission
Inside Page:
Calculations
Relevant formulae should be stated, i.e., only those used to calculate experimental results. Great
care should be exercised in performing simple arithmetic operations and the calculation should be
thoroughly checked. Result
Discussion
Students should write discussion on the overall accuracy of your results and on any systematic errors
in the experiment or agreement/discrepancy with expected values.
Index
S. Page
Date Topic Detail Remarks
No No.
S. Page
Date Topic Detail Remarks
No No.
Experiment # 1
Task 01: To perform following matrix algebra using Matlab.
I. A+B
II. A+C
III. AXB
IV. DXC
V. CXD
VI. A/C
C=>3x3 matrix
Coding:
A=randi (9,3)
b=[4 4;5 5;6 6]
c= randi (6,3)
d=randi (4,2)
ab=a+b
ac=a+c
ba=a*b
dc=d*c
cd=c*d
ca=a/c
Result:
ans =
4 9 8
9 6 9
8 1 7
ans =
5 4 1
5 2 2
3 5 1
ans =
1 3
4 2
ac=a+c
ac =
10 10 10
10 10 10
10 10 10
>> dc=d*c
dc =
32 32
77 77
122 122
Error using *
Incorrect dimensions for matrix multiplication. Check that the number of columns in
the
first matrix matches the number of rows in the second matrix. To perform
elementwise
multiplication, use '.*'.
Related documentation
>> ab=a*b
ab =
32 32
77 77
122 122
>> dc=d*c
Error using *
Incorrect dimensions for matrix multiplication. Check that the number of columns in
the
first matrix matches the number of rows in the second matrix. To perform
elementwise
multiplication, use '.*'.
Related documentation
>> cd=c*d
Error using *
Incorrect dimensions for matrix multiplication. Check that the number of columns in
the
first matrix matches the number of rows in the second matrix. To perform
elementwise
multiplication, use '.*'.
Related documentation
>> ca=a/c
Warning: Matrix is close to singular or badly scaled. Results may be inaccurate.
RCOND
= 2.312965e-18.
ca =
Coding:
tt=inv (a)
tt=inv (b)
tt=inv (c)
tt=inv (d)
Result:
tt =
1.0e+16 *
tt =
1.0e+15 *
tt =
Inf Inf
Inf Inf
Coding:
dd=det(d)
Result:
dd=det(a)
dd =
-9.5162e-16
>> dd=det(b)
Error using det
Matrix must be square.
>> dd=det(c)
dd =
-1.3323e-15
>> dd=det(d)
dd =
Coding:
t=a'
t=b'
t=c'
t=d'
Result:
t=a'
t=
1 4 7
2 5 8
3 6 9
>> t=b'
t=
4 5 6
4 5 6
>> t=c'
t=
9 6 3
8 5 2
7 4 1
>> t=d'
t=
1 1
1 1
Task 05: Plot a sine wave with different given step size in a single Graph, using hold, grid and
legend command and differentiate respective wave using different styles (‘o’,’+’,’— ‘)
I. 0:1:10
II. 0:0.1:10
III. 0:0.01:10
Coding:
t=0:1:10
x=cos (t)
plot (t,x)
u=0:0.5:10
y=cos (u)
plot (u,y)
v=0:0.1:10
z=cos (v)
plot (v,z)
Result:
t=0:1:10
x=cos (t)
plot (t,x)
t=
0 1 2 3 4 5 6 7 8 9 10
x=
Columns 1 through 8
Columns 9 through 11
>> u=0:0.5:10
y=cos (u)
plot (u,y)
u=
Columns 1 through 8
Columns 9 through 16
Columns 17 through 21
y=
Columns 1 through 8
Columns 9 through 16
Columns 17 through 21
v=0:0.1:10
z=cos (v)
plot (v,z)
v=
Columns 1 through 8
Columns 9 through 16
Columns 17 through 24
Columns 25 through 32
Columns 33 through 40
Columns 41 through 48
Columns 49 through 56
Columns 57 through 64
Columns 65 through 72
Columns 73 through 80
Columns 81 through 88
Columns 89 through 96
z=
Columns 1 through 8
Columns 9 through 16
Columns 17 through 24
Columns 25 through 32
Columns 33 through 40
Columns 41 through 48
Columns 49 through 56
Columns 57 through 64
Columns 65 through 72
Columns 73 through 80
Columns 81 through 88
Columns 89 through 96
1
step size of 1
0.8 step size of 0.5
step size of 0.1
0.6
0.4
0.2
-0.2
-0.4
-0.6
-0.8
-1
0 1 2 3 4 5 6 7 8 9 10
step size of 1
step size of 0.5
step size of 0.1
-0.5
-0.6
-0.7
-0.8
-0.9
-1
2 2.5 3 3.5 4 4.5
π π
Task 06: Plot a tangent wave using appropriate range (HINT: - to + ).
2 2
Coding:
clf;clear all;clc
x=linspace(-pi/2+0.01,pi/2-0.01);
y=tan(x);
plot (x,y);
Result:
100
80
60
40
20
-20
-40
-60
-80
-100
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
Task 07: Using MATLAB help creates an identity, a unit and a null matrix. (Used dedicated
command)
Coding:
identity=eye(3)
unit=ones(3)
null=zeros(3)
Result:
>> identity=eye(3)
unit=ones(3)
null=zeros(3)
identity =
1 0 0
0 1 0
0 0 1
unit =
1 1 1
1 1 1
1 1 1
null =
0 0 0
0 0 0
0 0 0
Task 08: Find Eigen value and corresponding vector, trace and rank of the given matrix
[ ] [ ]
2 0 0 6 0 −8
A= −9 −8 −1 B= 1 8 11
0 8 1 0 7 −7
Coding:
a=[2 0 0; -9 -8 -1; 0 8 1]
b=[6 0 -8; 1 8 11; 0 -7 7]
t1=trace(a)
r1=rank(a)
[c1,d1]=eig(a)
t2=trace(b)
r2=rank(b)
[c2,d2]=eig(b)
Result:
a=
2 0 0
-9 -8 -1
0 8 1
b=
6 0 -8
1 8 11
0 -7 7
t1 =
-5
r1 =
c1 =
0 0 0.2408
-0.1240 0.7071 -0.1204
0.9923 -0.7071 -0.9631
d1 =
0 0 0
0 -7 0
0 0 2
t2 =
21
r2 =
c2 =
d2 =
>>
Appendix:
Complete at your end, all command has to be list down. (must be Hand Written)
Command Description
randi Create Uniformly distributed pseudorandom integers
inv
det
plot
eig
eye
zeros
ones
hold on
grid
sin
cos
xlabel
ylabel
title
A‘