0% found this document useful (0 votes)
28 views5 pages

Solution:: Matlab Code

This document contains the solutions to several Laplace transform problems using MATLAB code. For each problem, the code takes the Laplace transform of the input function, sets up the differential equation relating the input and output, solves for the output function in the s-domain, and computes the inverse Laplace transform to find the output function in the time domain. Graphs of the output functions are also plotted.

Uploaded by

Hamza Zaheer
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views5 pages

Solution:: Matlab Code

This document contains the solutions to several Laplace transform problems using MATLAB code. For each problem, the code takes the Laplace transform of the input function, sets up the differential equation relating the input and output, solves for the output function in the s-domain, and computes the inverse Laplace transform to find the output function in the time domain. Graphs of the output functions are also plotted.

Uploaded by

Hamza Zaheer
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 5

(DRILL PROBLEMS)

Q#2.1(A)

SOLUTION:
MATLAB CODE:
Syms s t y
m=18;
d=laplace(m,t,s)
k=s*y-10
ans=solve(k+3*y-d,y)
answer=ilaplace(ans,s,t)

Simulation Result:
d=18/s
k=s*y-10
ans=2*(5*s+9)/s/(s+3)
answer=4*exp(-3*t)+6

Graph:
t=0:0.1:10;
y=6+(4*exp(-3*t));
plot(t,y)
title(Ques#2(a))
xlabel(Time axis)
ylabel(Y(t))

Part(c)

MATLAB CODE:
Syms s t y
m=7*s;
d=laplace(m,t,s)
k=s*y-4
ans=solve(k+1000*y-d,y)
answer=ilaplace(ans,s,t)

Simulation Result:
d=7
k=s*y-4
ans=11/(s+1000)

answer=11*exp(1000*t)

Graph:
t=-100:0.1:100;
y=11*(exp(-1000*t));
plot(t,y)
title(Ques#2(c))

xlabel(Time axis)
ylabel(Y(t))

Part d
MATLAB CODE:
Syms s t y
m=8*sin(100*t);
d=laplace(m,t,s)
k=s*y+10
ans=solve(k+300*y-d*20*s,y)
answer=ilaplace(ans,s,t)

Simulation Result:
d=800/(s^2+10000)
k=s*y+10
ans==-10*(s^2+10000-1600*s)/(s^2+10000)/(s+300)
answer=-58*exp(-300*t)+48*cos(100*t)+16*sin(100*t)

Graph:
t=0:0.1:10;
y=-58*exp(-300*t)
+48*cos(100*t)
+16*sin(100*t)
plot(t,y)
title(Ques#2(d))

xlabel(Time axis)
ylabel(Y(t))

Part e
MATLAB CODE:
Syms s t y
m=10;
d=laplace(m,t,s)
k=s*y
ans=solve(k+300*y-(d*(-4*s+20)),y)
answer=ilaplace(ans,s,t)

Simulation Result:
d=10/s
k=s*y
ans=-40*(s-5)/s/s+300)
answer=2/3-(122/3*exp(-300*t))

Graph:
t=-10:0.1:10;
y=2/3-(122/3*exp(-300*t));
plot(t,y)
title(Ques#2(e))
xlabel(Time axis)

ylabel(Y(t))

You might also like