You are on page 1of 16

Institute of Engineering & Science, IPS Academy Indore

Department of Electronics & Communication Engg


Software Lab-III (EC- 506)

Experiment No. 01

INTRODUCTION TO MATLAB

The name MATLAB stands for MATrix LABoratory. MATLAB was


written originally to provide easy access to matrix software developed by the
LINPACK (linear system package) and EISPACK (Eigen system package)
projects.

MATLAB is a high-performance language for technical computing. It


integrates computation, visualization, and programming environment.
Furthermore, MATLAB is a modern programming language environment. It
has sophisticated data structures, contains built-in editing and debugging
tools, and supports object-oriented programming. These factors make
MATLAB an excellent tool for teaching and research.

MATLAB has many advantages compared to conventional computer


languages (e.g., C, FORTRAN) for solving technical problems. MATLAB is
an interactive system whose basic data element is an array that does not
require dimensioning. The software package has been commercially
available since 1984 and is now considered as a standard tool at most
universities and industries worldwide.

It has powerful built-in routines that enable a very wide variety of


computations. It also has easy to use graphics commands that make the
visualization of results immediately available. Specific applications are
collected in packages referred to as toolbox. There are toolboxes for signal
processing, symbolic computation, control theory, simulation, optimization,
and several other fields of applied science and engineering.

MATLAB family of programs includes a base program and a variety of


toolboxes. MATLAB and control system toolbox provide the user to design
and analyze the control system. The various toolboxes available
commercially are e.g., fuzzy and neural network, Identification techniques,
power system toolbox, DSP toolbox etc. The MATLAB software is the most
common an industry wide standard software in the analysis and design of
modern control system.

Software lab-III
(EC-506) Lab Manual
Institute of Engineering & Science, IPS Academy Indore
Department of Electronics & Communication Engg
Software Lab-III (EC- 506)

Experiment No. 02
Aim: - Determine transpose, inverse values of given matrix.

Apparatus required: - MATLAB(7.9.0.529).

Theory: -

The commands are given as follows:


Tranpose of matrix

A = [1 2 0; 2 5 -1; 4 10 -1]
A=

1 2 0
2 5 -1
4 10 -1

B = A'
B=

1 2 4
2 5 10
0 -1 -1

Inverse of matrix

X = inv(A)
X=

5 2 -2
-2 -1 1
0 -2 1

Software lab-III
(EC-506) Lab Manual
Institute of Engineering & Science, IPS Academy Indore
Department of Electronics & Communication Engg
Software Lab-III (EC- 506)

Experiment No. 03
Aim: - Plot the pole-zero configurations in s-plane for the given transfer
function.

Apparatus required: - MATLAB(7.9.0.529).

Theory: -

Let the given transfer function be:

8( + 3)( + 4)
() =
( + 2)( 2 + 2 + 5)

The numerator and denominator polynomials is s for given transfer function


are as

1 = 8 2 + 56 + 96

1 = 4 + 4 3 + 9 2 + 5
The commands are given as follows:

>> p1 = [8 56 96] ; q1 = [1 4 9 10 0]

Q1=

1 4 9 10 0

>> sys4 = tf (p1, q1)

Transfer function :

8s2 + 56s + 96
4 + 4s3 + 9 2 + 10s

>> pzmap (sys4)

Software lab-III
(EC-506) Lab Manual
Institute of Engineering & Science, IPS Academy Indore
Department of Electronics & Communication Engg
Software Lab-III (EC- 506)

Experiment No. 04
Aim: - Determine the transfer function for given closed loop system in block
diagram representation.

Apparatus required: - MATLAB(7.9.0.529).

Theory: - The commands are given as follows:

>> n = [1] : d1 = [1 2 0]:

>> printsys (n1, d1)

num/den =

1
2 + 2

>> n2 = [4]; d2 = [0 1];

>> printsys (n2, d2)

num/den =

4
1

Software lab-III
(EC-506) Lab Manual
Institute of Engineering & Science, IPS Academy Indore
Department of Electronics & Communication Engg
Software Lab-III (EC- 506)

>> n3 = [1 0] ; d3 = [0 1];

>> [n4, d4] = parallel (n2, d2, n3, d3);

>> printsys (n4, d4)

num/den =

+4
1

>> [n5, d5] = series (n1, d1, n4, d4);

>> printsys (n5, d5)

num/den =

+4
2 +2

>> n6 = [0.5]; d6 = [0.1];

>> [n7, d7] = cloop (n5, d5, n6, d6 -1);

>> [n7, d7] = feedback (n5, d5, n6, d6, -1);

>> printsys (n7, d7)

+4
num/den =
2 +2.5+2

>> [n8, d8] = cloop (n7, d7, -1);

>> printsys (n8, d8)

+4
Num/den =
2 +3.5+6

Software lab-III
(EC-506) Lab Manual
Institute of Engineering & Science, IPS Academy Indore
Department of Electronics & Communication Engg
Software Lab-III (EC- 506)

Experiment No. 05
Aim: - Plot unit step response of given transfer function and find peak
overshoot, peak time.

() 4+4
= 2
() +2+5

Apparatus required: - MATLAB(7.9.0.529).

Theory: -

The commands are given as follows:


>> num = [4 4]

num =

4 4

>> den = [1 2 5]

den =

1 2 5

>> sys4 = tf(num, den)

Transfer function :

4 + 4
2 + 2 + 5

>> step (sys4)

Software lab-III
(EC-506) Lab Manual
Institute of Engineering & Science, IPS Academy Indore
Department of Electronics & Communication Engg
Software Lab-III (EC- 506)

Experiment No. 06
Aim: - Plot unit step response and to find rise time and delay time.

+2
() =
( + 1)

Apparatus required: - MATLAB(7.9.0.529).

Theory: - The commands are given as follows:


>> [n3] = [1 2]; [d3] = [1 1 0];

>> printsys ( n3, d3);

num/den =

+2
2 +

>> [n4, d4] = cloop ( n3, d3, -1)

n4 =

0 1 2

d4 =

1 2 2

>> printsys ( n4, d4 )

num/den =

+2
2 +2+2

>> step (n4, d4); grid

Software lab-III
(EC-506) Lab Manual
Institute of Engineering & Science, IPS Academy Indore
Department of Electronics & Communication Engg
Software Lab-III (EC- 506)

Experiment No 7

Aim: - The open loop transfer function of a unity feedback system is given
below:


() =
( + 2)( 2 + 2 + 2)

Plot the root locus to determine the value of gain K

(1) at the breakaway point

(2)for the marginal stability.

Apparatus required: - MATLAB(7.9.0.529).

Theory:-

The commands are given as follows:


>>P=1

P=1

>>q= [1 4 6 4 0]

Q=

1 4 6 4 0

>> sys 5 =tf(p,q)


Software lab-III
(EC-506) Lab Manual
Institute of Engineering & Science, IPS Academy Indore
Department of Electronics & Communication Engg
Software Lab-III (EC- 506)

Transfer function:
1
4 +43 +62 +4

>>rlocus (sys 5)

Software lab-III
(EC-506) Lab Manual
Institute of Engineering & Science, IPS Academy Indore
Department of Electronics & Communication Engg
Software Lab-III (EC- 506)

Experiment No 8

Aim: - Sketch the root locus plot for open-loop transfer function


()() =
( + 1)( + 3)

Determine (1)the value of K at s= -4

(2)the frequency of sustained oscillations.

Apparatus required: - MATLAB(7.9.0.529).

Theory:-

The commands are given as follows:

>>P=1

P=1

>>q=[1 4 3 0]

Q= 1 4 3 0

>>sys 3=tf(p,q)

Transfer function :

1
3 +4 2 +3

>>rlocus (p,q)

Software lab-III
(EC-506) Lab Manual
Institute of Engineering & Science, IPS Academy Indore
Department of Electronics & Communication Engg
Software Lab-III (EC- 506)

Experiment No 9
Aim: - A unity feedback control system has its forward path transfer function as

210
() =
( + 2)( 2 + 12 + 6)

Give a MATLAB programme to determine

(a)The roots of the characteristics equation

(b)The Bode plot for open-loop transfer function.

Apparatus required: - MATLAB(7.9.0.529).

Theory:-

The commands are given as follows:


>>n1 = 210 ; d1 = [1 44 390 192 0]

D1= 1 44 390 192 0

>>sys=tf(n1,d1)

Transfer function:

210
4 + 44 3 + 390 2 + 192
>>[num.den]=cloop(n1,d1)

Num =

0 0 0 0 210

Den=

1 44 390 192 210


Software lab-III
(EC-506) Lab Manual
Institute of Engineering & Science, IPS Academy Indore
Department of Electronics & Communication Engg
Software Lab-III (EC- 506)

>>sys1=tf(num,den)

Transfer function:

210
4 + 44 3 + 390 2 + 192 + 210
>>roots (den)

Ans=

-31.9898

-11.5578

-0.2262+0.71891

-0.2262-0.71891

>>sisotool(sys)

Software lab-III
(EC-506) Lab Manual
Institute of Engineering & Science, IPS Academy Indore
Department of Electronics & Communication Engg
Software Lab-III (EC- 506)

Experiment No 10
Aim: - sketch the Bode plot for the transfer function given below.

2( + 0.25)
()() =
2 ( + 1)( + 0.5)

From the Bode plot determine:

(a)The phase crossover frequency (b)The gain crossover frequency

(c)The gain margin (d)The phase margin

Apparatus required: - MATLAB(7.9.0.529).

Theory:-

The commands are given as follows:


>>num=[ 2 0.5]

Num= 20000 0.5000

>>den=[1 1.5 0.5 0.0]

Den=

1.0000 1.5000 0.5000 0 0

>>sys1=tf(num,den)

Software lab-III
(EC-506) Lab Manual
Institute of Engineering & Science, IPS Academy Indore
Department of Electronics & Communication Engg
Software Lab-III (EC- 506)

Transfer function:

2 + 0.5
4 + 1.5 3 + 0.5 2

>>margin(sys1)

Software lab-III
(EC-506) Lab Manual
Institute of Engineering & Science, IPS Academy Indore
Department of Electronics & Communication Engg
Software Lab-III (EC- 506)

Experiment No. 11
Aim: - Draw the Nyquist plot for the open loop transfer function given below
and Comments on closed-loop stability

2.2
()() =
( 2 + 2 + 2)( + 1)

Apparatus required: - MATLAB(7.9.0.529).

Theory:-

The commands are given as follows:


>>num=2.2

Num=2.2000

>>den=[1 3 4 2 0]

Den=1 3 4 2 0

>>sys 4 = tf(num,den)

Transfer function:

2.2
4 + 3 3 + 4 2 + 2
>>load ltiexamples

>>ltiview

Software lab-III
(EC-506) Lab Manual
Institute of Engineering & Science, IPS Academy Indore
Department of Electronics & Communication Engg
Software Lab-III (EC- 506)

Experiment No. 12
Aim: - Plot the Nyquist plot for given transfer function and to discuss closed
loop stability, gain and phase margin.

( 1)
()() =
( + 2)( + 3)

Apparatus required: - MATLAB Software.

Theory: -

The commands are given as follows:


>>n1=[10-10]

n1=

10-10

>>d1=[1 5 6]

d1=1 5 6

>>sys 5 =tf ( n1, d1)

Transfer function:

10 10
2 + 5 + 6
>>load ltiexamples

>>ltiview

Software lab-III
(EC-506) Lab Manual

You might also like