0% found this document useful (0 votes)
33 views9 pages

ET213012

Null
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views9 pages

ET213012

Null
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Name: Rakib Uddin Ahammed ID: ET213012

MATLAB Basics for Polynomial, Laplace Transform, and Transfer Function

Introduction – The abbreviations for MATLAB


refers to "Matrix Laboratory". MATLAB is an
essential software program for engineering
learners as well as practitioners to master. It
enhances the speed, accuracy, and precision of Figure 1.1: MATLAB Command and Output
calculation using mathematics, design, analysis,
and optimization (both of which structural and 2. To evaluate y = 9s2 + 4s + 5 at s = 2, use
mathematical). It presents a flexible yet polyval(), a built-in function in MATLAB
straightforward structure to facilitate numerical that evaluates polynomials at specific
calculating, data analysis, visualization, and points.
algorithm development.

Objectives:
The Objectives of this experiment are:

➢ Handling Polynomial in MATLAB.


➢ Laplace Transform using MATLAB
➢ Transfer Function and Pole Zero Map.
➢ Response of a system through Transfer Figure 1.2: MATLAB Command and Output
Function.
3. To find the roots of 49s2 + 4s + 9 = 0; roots ()
APPARATUS/ UTILITY SOFTWARE is a MATLAB build in function which is used to
Finds the roots of a polynomial
We have used one software in this experiment:
➢ MATLAB

COMMAND DESCRIPTION:

The following commands cover basic MATLAB


functions:

➢ Handling Polynomial in MATLAB


Figure 1.3: MATLAB Command and Output
1. To represent, p(s)= 2s4 +49s3+94s2-4s +9
A polynomial is represented by a row
vector. Only the coefficients of the
polynomials are entered through keyboard.

Page 1 of 9
Name: Rakib Uddin Ahammed ID: ET213012

4.To find the products of two polynomials (4s+10)


and (4s2+9s+9); conv () is a MATLAB build in
function which is used to Multiply two
polynomials.

Figure 1.6: MATLAB Command and Output

Thus, the quadratic equation is, s2 - 18s +97 = 0

7.Determine the characteristic equation of a


matrix. poly( ) is a MATLAB build in function
which is used to find the characteristics equation
of a matrix.
Figure 1.4: MATLAB Command and Output

Thus, the product is 16s3 +76s2 +126s +90

5.Divide the polynomial z by y if, z = 4s3 + 4s2


+49s +4 and, y = s2 + 9s + 4 ; deconv () is a
MATLAB build in function which is used to
division of two polynomials.
Figure 1.7: MATLAB Command and Output

Thus the characteristics equation is s3-6s2 -42s


+27= 0

8.Print the fraction (9s+4)/( s2 +9s +49); tf() is a


MATLAB build in function which is used to
form a transfer function from its numerator and
denominator.

Figure 1.5: MATLAB Command and Output

Note: x is quotient and r is remainder.

6.Determine the quadratic equation whose roots


are 9+4i and 9-4i. poly ( ) is a MATLAB build in
function which is used to form a polynomial
equation from it’s roots.

Page 2 of 9
Name: Rakib Uddin Ahammed ID: ET213012
Figure 1.8: MATLAB Command and Output
9(i) Resolve the polynomial (s3+9s +1)/( s3+s2
+4s +49) into partial fraction. residue( ) is a
MATLAB build in function which is used to
expand a rational fraction to partial fraction:
[r,p,k] = residue(r,p,k)

Figure 1.9(ii): MATLAB Command and Output

➢ Laplace Transform Using MATLAB

1. Find the Laplace Transform of the


function f (t)= e−2t (10− sin t) syms t is a
MATLAB build in function which is used
to constructs a symbolic object for time
variable t. laplace (ft) is also a MATLAB
build in function which is used to finds the
Laplace Transform of ft.

Figure 1.9(i): MATLAB Command and Output

9(ii)Find the original Function from the from the


partial fractions Figure 1.10: MATLAB Command and Output
1-1.3678i 1+1.3678i 3
1+ -------------- + -------------- - -------
s-1.4145i S+1.4145i s+1
residue( ) is a MATLAB build in function which
is used to get back the rational fraction from the
partial fractions:
[n,d] = residue(r,p,k)

Page 3 of 9
Name: Rakib Uddin Ahammed ID: ET213012
2. Find the Inverse Laplace Transform of the Figure 1.12: MATLAB Command and Output
function (49s+9)/2s(s2 + 4s + 6). ilaplace(fs) is a
MATLAB build in function which is used to finds
the inverse Laplace transform of fs.

Figure 1.11: MATLAB Command and Output


Figure 1.13: Pole Zero Plot
➢ Transfer Function and Pole-Zero map
Note: Poles of the system are indicated in the plot
1. Find the location of zeros and poles and plot the by an X while the zeros are indicated by a circle
pole-zero maps of the system, whose transfer or O.
function is given by, (s2+2s+2)/( s4+5s3+ 6s2+2s 2. Constructs transfer function from given
+ 2) zero pole in a system:
tf2zp() and pzmap() is a MATLAB build in Zeros are at s = -4,-1
function which is used to Finds the pole zero and Poles are at s = -2,-5,-6
gains of a transfer function & Plots the pole zero The gain is 5
map of the transfer function. zp2tf( ) () is a MATLAB build in function which
is used to Constructs transfer function from given
zero pole.

Figure 1.14: MATLAB Command and Output

Page 4 of 9
Name: Rakib Uddin Ahammed ID: ET213012
iii) Step response of a system
➢ Response of a System Through Transfer
Function Transfer function is given by, (4s2+5s + 2)/(6s3+
5s2+3s + 2)
i) Create a TF object for the system.
(ii) Plot the impulse response of the system

Transfer function is given by, (s2+2s + 2)/(5s3+


6s2+2s + 2)

Figure 1.17: MATLAB Command and Output

Figure 1.15: MATLAB Command and Output

Figure 1.18: Step Response

(iv) Response to a general input

Figure 1.16: Impulse Response Transfer function is given by, (4s2+5s + 2)/(6s3+
5s2+3s + 2)

Page 5 of 9
Name: Rakib Uddin Ahammed ID: ET213012

Figure 1.21: MATLAB Command

Figure 1.22: Output


Figure 1.19: MATLAB Command and Output
1.2 obtain the Laplace transform of the following
f(t) using MATLAB

i. f(t) = e−3tcos 4t
ii.f(t) = 1-2e-4t +e-5t

i)Solution

Figure 1.20: General input response of a


system

V. HOME WORK

1.1 Find the Laplace Transform of 12 𝑑2f


𝑑𝑡2
Figure 1.23: MATLAB Command and Output
Solution:

(ii)Solution

Page 6 of 9
Name: Rakib Uddin Ahammed ID: ET213012
1.4 Given the zeros, poles and gain K of
B(s)/A(s). Obtain the function B(s)/A(s).

i.There is no zero.Poles are at -1 + 2j and -1 -


2j.K=10
ii. A zero is at -1. Poles are at -2, -4 and -8. K =
12.
iii.Zeros are at -1 and -2. Poles are at 0,-4 and -
6.K=5
iv. A zero is at 0. Poles are at -1 + 2j and -1- 2j.
Figure 1.24: MATLAB Command and Output K =10

1.3 Obtain the inverse Laplace transform of the (i)Solution:


following F(s).
i. F(s) = (s5 + 8 s4 + 23s3 + 35s2 + 28s + 3) / (s3
+ 6 s2 + 8s)
ii. F(s) = [10(s + 2) (s +4)] / [( s + 1) (s + 3) (s +
5)2]

(i) Solution:

Figure 1.27: MATLAB Command and Output


Figure 1.25: MATLAB Command and Output
(ii)Solution:
(ii) Solution:

Figure 1.26: MATLAB Command and Output

Figure 1.28: MATLAB Command and Output

Page 7 of 9
Name: Rakib Uddin Ahammed ID: ET213012

iii)Solution: 1.5 Find the transfer Function of the following


system

Figure 1.31: Circuit Diagram of the system

Solution:

Figure 1.29: MATLAB Command and Output

(iv)Solution:

Figure 1.30: MATLAB Command and Output

Figure 1.32: Solution of Transfer function of the


system

Transfer function =(-0.1S-1)/(0.5S+1)

Page 8 of 9
Name: Rakib Uddin Ahammed ID: ET213012

VI. DISCUSSION

MATLAB, which is a significant program which


numerous students of engineering and
professionals need to comprehend. It enhances
mathematical computation, design, analysis, and
optimization, resulting in faster, more accurate,
and precise solutions. This lab experiment taught
me how to find the Laplace transform of a
function, as well as its inverse, or Laplace
transform. For determining the functional transfer
function of a system, to identify the poles and
zeros of a system, and to plot them
Figure 1.33: MATLAB Command and Output
using MATLAB, which Finally, I practiced
determining the different outcomes of a system,
1.6 Obtain a plot of the ramp response of the
such as the ramp reaction. Step and Impulse
system whose transfer function is shown below:
responses. In order to build an apparatus like a
G(s)=(3s+2)/(2s3+4s2+5s+1)
filter, for example, we must first understand how
the system responds. Learning from this
Solution:
experiment will enhance my understanding of the
design process. I am optimistic that the
understanding gained from this experiment will
inform future experiments in this course.

Figure 1.34: MATLAB Command

Figure 1.35: Ramp Response of the system G(s)

Page 9 of 9

You might also like