0% found this document useful (0 votes)
63 views23 pages

Control System Lab Using MATLAB: (ELE 302L)

This document summarizes the content and structure of a control system lab course using MATLAB. It includes 9 labs covering topics like transfer functions, time response analysis, root locus, Nyquist and Bode plots. It describes the assessment structure, which includes 40% for continuous assessment based on attendance, lab records, and exams, and 60% for end semester assessment. It also provides an introduction to MATLAB and describes its basic functionality for numerical computation, data analysis, and visualization.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views23 pages

Control System Lab Using MATLAB: (ELE 302L)

This document summarizes the content and structure of a control system lab course using MATLAB. It includes 9 labs covering topics like transfer functions, time response analysis, root locus, Nyquist and Bode plots. It describes the assessment structure, which includes 40% for continuous assessment based on attendance, lab records, and exams, and 60% for end semester assessment. It also provides an introduction to MATLAB and describes its basic functionality for numerical computation, data analysis, and visualization.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 23

Control System Lab using MATLAB

(ELE 302L)

Hemant Kumar
Assistant Professor,Department of Electronics
Banasthali Vidyapith, Banasthali, Rajasthan

1
Approach
• Lab1- Basics of MATLAB
• Lab2- Signal and System
• Lab3- Signal and System//Learning by doing
• Lab4- Control System [Transfer Function]
• Lab5- Control System [Polynomial, Partial fraction]
• Lab6- Control System [Time Response of System]
• Lab7- Control system [Root Locus, Nyquist Plot]
• Lab8- Control System [Bode plot and study related
experiments]
• Lab9- Revision/Continuous Assessment of Lab
2
Banasthali Vidyapith Rajasthan
Assessment Evaluation Policy
Max. Marks: 100 (CA: 40 + ESA: 60)

Continuous Assessment CA:40


Component Maximum
Marks
Attendance 15
Lab Record 10
Internal exam and viva. 15
Total 40

Banasthali Vidyapith Rajasthan 3


Introduction to MATLAB

• MATLAB -MATrix LABoratory, developed by the MathWorks Inc.


• Widely used in many of science and engineering fields for numerical computation and
data visualization.
•Supported on Unix, Macintosh, and Windows environments.
•MATLAB integrates mathematical computing, visualization, and a powerful language
to provide a flexible environment for technical computing.

• Typical uses include:

 Numeric computation and algorithm development


Symbolic computation (with the built-in Symbolic Math functions)
 Modeling, simulation, and prototyping
 Data analysis and signal processing
 Engineering graphics and scientific visualization Contd….4
Banasthali Vidyapith Rajasthan
Basics of MATLAB
•To start MATLAB click on the MATLAB icon
•MATLAB has three display windows. They are
 Command Window-Used to enter commands and data to display plots and
graphs.
 Graphics Window - Used to display plots and graphs
 Edit Window- Used to create and modify M-files (contain a program/script of
MATLAB commands)
•Entering Commands- MATLAB commands are case sensitive and lower case letters
are used throughout.
•To execute an M-file (such as Project_1.m), simply enter the name of the file without
its extension (as in Project_1).
•To see some of the MATLAB capabilities, enter the demo command
•The Semicolon (;)- output of the command is not displayed
•Typing % - typed in the beginning of a line, the line is designated as a comment.
5
•clc Command - clear window
•Statements and Variables- >> variable = expression
•>> A = [1 2 ; 3 4]
A=
12
34
Arithmetic operations

Arithmetic Symbol Example


Operation
Addition + 6+3=9

Subtraction – 6–3=3
Multiplication * 6 * 3 = 18
Right division / 6/3=2
Left division \ 6\3=3/6=1/2
Exponentiation ^ 6 ^ 3 = 6*6*6=216

Banasthali Vidyapith Rajasthan 6


Different screen output formats

Banasthali Vidyapith Rajasthan 7


Elementary math functions

8
9
Banasthali Vidyapith Rajasthan
Banasthali Vidyapith Rajasthan 10
Predefined Variables

11
General Command
Help

Workspace
information

Directory information

12
Banasthali Vidyapith Rajasthan 13
Arrays
• One-dimensional array-
 Row Vector x = [7 – 1 2 – 5 8]
 Column Vector x = [7 ; – 1 ; 2 ; – 5 ; 8]
• Two-dimensional array – Matrix
 >>A = [1 3 – 4 ; 0 – 2 8]
 >>B = [1 2 3 4; 5 6 7 8]
• Addressing Arrays – colon (:) can be used to address a range of
elements in a vector or a matrix
 Colon for a vector
 Va(:) – refers to all the elements of the vector Va
 Va(m : n) – refers to elements m through n of the vector Va.
>>V = [2 5 -1 11 8 4 7 -3 11];
>>u = V(2 : 8);
u = 5 -1 11 8 4 7 -3
Banasthali Vidyapith Rajasthan 14
•Colon for a matrix

•Adding Elements to a Vector or a Matrix


>> a= [1 2 3] >> b= [4 5 6] >> c= [a, b] c1= [a; b]
a =1 2 3 b =4 5 6 c=1 2 3 4 5 6 c1 = 1 2 3
4 5 6
•Deleting Elements >>V = [2 5 -1 11 8 4 7 -3 11];
>> V(2:4)= [ ]
V = 2 8 4 7 -3 11
Banasthali Vidyapith Rajasthan 15
16
Operations with Arrays

•Addition and Subtraction of Matrices


•Dot Product- computed from two vectors of the same size dot(A,
B)
>> a=[1 2 3] >> b=[4 5 6] >> dot(a,b) (ans 32)
>> a= [1 2 3; 4 5 6] >> b = [3 2 1; 1 2 3] >> dot(a,b) ans=7
14 21
(If A and B are matrices, the dot product is a row vector containing
the dot products for the corresponding columns of A and B.)
•Array Multiplication
•Array Division [ Left Div. >>x = B\A and Right Div >>x= B/A]
•Identity Matrix (all the diagonal elements are 1’s, and remaining
elements 0’s.) eye(n) nxn matrix
•Inverse of a Matrix (AB = BA = I; A and B inverse matrix)
•Transpose (>>A’)
•Determinant (>> det(A))
17
Banasthali Vidyapith Rajasthan
•Element-by-element operations
A = [3 9 5];
•* Array multiplication
B = [2 1 5];
•^ Array exponentiation C = A . /B . ^2
•/ Array Division C=
0.7500 9.0000 0.2000

C = (A. /B). ^2
C=
2.2500 81.0000 1.0000

•Built-in Functions for Arrays


>> a = [3 7 2 16 9 5 18 13 0 4] min(a) {0}
•mean(a) {7.7} [d, n] = min (a) {d=0, n=9}
•sum(a) {77, vector sum} sort (a)
{column sum for matrix) median (a) {6}
•length (a) {10} std (a) {6.1473}
•max(a) {18} inv (a)
•[d, n] = max (A) {d=18, n=7} eig (a) 18
Random Numbers

19
Banasthali Vidyapith Rajasthan
Polynomial
•conv(a, b)
•[q, r] = deconv(n, d)
•roots(a)
•poly(r)
•polyval (a, x)

20
UTILITY MATRICES

•Relational and Logical Operators (2.16)


•Order of Precedence
A = [0 1 1 0 1]; Adobe Acrobat
B = [1 1 0 0 1]; Document

A & B = 01001
A | B = 11101
~A = 10010 Banasthali Vidyapith Rajasthan
xor(A,B) = 10100 21
•Magic(n) {n x n matrix whose row/column/ diagonal sum same}
1 2 3
•a=[1 2 3; 4 5 6; 7 8 9]; 4 5 6
sum(a) {12 15 18} 7 8 9
Y=fliplr(a) {3 2 1 z= flipud(a) 7 8 9
6 5 4 4 5 6
9 8 7 1 2 3
Diag (a) 1 diag(Y) 3
5 5
9 7

min(a)//max(a) 1 2 3//7 8 9 min(min(a))//max(max(a)) 1//9


a= [1 2 3 4 3 2 4 5 6 3 ];
Unique(a) {1 2 3 4}

Banasthali Vidyapith Rajasthan 22


Graphics

plot(z)
plot(z, 'r')

linspace(0,180) {bydefault 100 steps from 0 to 100)


linspace(0, 180,3) { 0 to 180 in 3 steps}
logspace(a,b,n) { 10^a to 10^b in n steps}

Discuss Example2.5, 2.6 of pdf object already added, okey

Banasthali Vidyapith Rajasthan 23

You might also like