Anda di halaman 1dari 3

LAB No 2: EPE

Title: Laplace Transform and Solution of Differential Equations .

Objectives: Learning the methods to solve Transforms and differential


Equations in MATLAB.
clc; % clear screen..
clear all; %%% clears all variables in work space.
TASK 1
%%%%%%%% working with polynomials
P ( s ) 5s 3 2 s 2 9 s 11 In MATLAB THIS POLYNOMIAL IS EXPRESSED AS
p = [5 2 9 11]; %%%%%%% EXPRESSING A POLYNOMIAL
Roots_P= roots(p) %%%TO FIND THE ROOTS OF POLYNOMIAL
PP=poly(Roots_P) %%%% TO FIND POLYNOMIAL, WHEN THE ROOTS ARE GIVEN
%%%CONSIDER P1 ( s ) 5s 3 2 s 2 9 s 11 AND P2 ( s ) 5s 2 12 s 8 THEN THEIR
PRODUCT IS FOUND AS,
a = [5 2 9 11]; b = [5 12 8];
c = conv(a,b);
%%%%%%Use deconvolution to divide a(s) back out of the product:
[q,r] = deconv(c,a);
%%%%% TO FIND THE PARTIAL FRACTION OF A LAPLACE TRANSFROM USE THE FUNCTION
RESIDUE() [ SEE MATLAB HELP AND FIND THE PARTIAL FRACTION OF
FOLLOWING POLYNOMIAL..]
5s 2 4 s 9
3s 3 6 s 2 7 s 4
TASK 2
%%%% FINDING THE INVERSE LAPLACE TRANSFORM.
GIVEN THE FOLLOWING LAPLACE TRANSFORM. TO FIND ITS SOLUTION(INVERSE) IN TIME
DOMAIN
5s 2 4 s 9
3s 6 s 2 7 s 4
3

>> num=[4 5 9]; %%%% DECLARE THE NUMERATOR AS POLYNOMIAL...


>> den=[3 6 7 4];%%%% DECLARE THE DENUMERATOR AS POLYNOMIAL...
>> transform=tf(num,den)

%%%%% TO FIND THE SOLUTION FOR UNIT IMPULSE


>> impulse(transform).
%%%%% TO FIND THE SOLUTION FOR UNIT STEP
>> step(transform)
%%%%%% TO FIND THE SOLUTION FOR ANY GIVEN INPUT USE THE
FUNCTION (lsim)
>> [u,t] = gensig('square',4,20,0.1);
>> figure(2)
>> [u,t] = gensig('square',4,20,0.1);%%% Generate a square wave
%%%%%%% with period 4 seconds, duration 20 seconds, and
sampling every 0.1 second.
>> lsim(transform,u,t)
%%%%%You can use the following method to generate input of your
%%%%%choice
>> t=0:0.1:10;
>> u=cos(10*t);
>> figure(3)
>> lsim(transform,u,t)
Task 3
3 2 2
d y d y dy d x dx
3
12 2 44 48 y 2 x(t ) Find the solution (in the
dt dt dt dt dt
form of plots) of this differential equation for
1. x(t)=unit impulse
2. x(t)= unit step input.
3. x(t)=square wave of period 0.3sec, for up to 3 sec.
4. x(t)= pulse train of 2 sec repetition time , For up to 10 sec.
5. x(t)= saw tooth wave form, chose frequency urself.

Given a Laplace Transform

Anda mungkin juga menyukai