PRACTICAL MATLAB® FOR ENGINEERS PRACTICAL MATLAB

(sharon) #1

366 Practical MATLAB® Applications for Engineers


disp(‘*******************************’)
disp(‘****Solutions using Matlab****’)
disp(‘*******************************’)
disp(‘(a) Example(#1), the time function f(t) is:’)
ft = 5+2*exp(-3*t)+10*sin(3*t)+5*exp(-2*t)*cos(7*t);
pretty(ft)
disp (‘its Laplace transform F(s) is given by:’)
Fsa = laplace(ft);
pretty(Fsa)
disp(‘*******************************’)
disp(‘(b) Example(#2), the frequency function F(s) is:’)
Fsb = 10/s+20/s^2+30/(s+3);
pretty(Fsb)
disp(‘its inverse Laplace transform is, f(t):’)
ftb=ilaplace(Fsb);
pretty(ftb)
disp(‘*******************************’)
disp(‘(c)Example(#3), the frequency function F(s) is:’)
Fsc = (8*s+30)/(s^2+25);
pretty(Fsc)
disp(‘its inverse Laplace transform, f(t) is:’)
ftc = ilaplace(Fsc);
pretty(ftc)
disp(‘*******************************’)
disp(‘(d) Example(#4), the frequency function Y(s) is:’)
Y = (4*s+10)/(s*(s+1)*(s+2));
pretty(Y)
disp(‘its inverse Laplace transform, y(t) is given by:’)
yt = ilaplace(Y);
pretty(yt)
disp(‘*******************************’)

The script fi le solve_DE is executed and the results are as follows:


>> solve _ DE

**************************************
****** Solutions using Matlab ******
**************************************
(a) Example(#1), the time function f(t) is:
5 + 2 exp(-3 t) + 10 sin(3 t) + 5 exp(-2 t) cos(7 t)
its Laplace transform F(s) is given by :
2 30 s + 2
5/s + ----- + ------ + 5 -------------
s + 3 2 2
s + 9 (s + 2) + 49
************************************
(b) Example(#2), the frequency function F(s) is:
10 20 30
---- + ---- + -----
s 2s s + 3
its inverse Laplace transform is, f(t):
10 + 20 t + 30 exp(-3 t)
************************************
Free download pdf