Q.1: Use MATLAB to find the Laplace transform of the following time functions:
a. f(t)=5t2cos(3t+45o).
b. f(t)=5te-2tsin(4t+60o).
MATLAB CODE:
syms t;
‘part a’
f=2*t^2cos(9*t+45);
pretty(f)
F=laplace(f);
pretty(f)
‘part b’
f=3*t*exp(-2*t)*sin(5*t+45);
pretty(f)
F=laplace(f);
pretty(F)
,Q.2: Use MATLAB to find the inverse Laplace transform of the following frequency functions:
a. G(s)=(9s2+s+6)(2s+1)/(8s+1)(4s+6)(3s2+9s+44).
b. G(s)=(6s3+8s2+9s+4)/(8s+4)(s2+3s+6)(2s2+4s+1).
MATLAB CODE:
syms s;
‘part a’
num=(9*s^2+s+6)*(2*s+1);
den=(8*s+1)*(4*s+6)*(3*s^2+9*s+44);
pretty(num);
pretty(den);
g=num/den;
pretty(g);
F=ilaplace(g);
pretty(g);
pretty(f);
‘part b’
num=(6*s^3+8*s^2+9*s+4);
den=(8*s+4)*(s^2+3*s+6)*(2*s^2+4*s+1);
pretty(num);
pretty(den);
g=num/den;
pretty(g);
F=ilaplace(g);
pretty(g);
pretty(F)
, Q.3: Use MATLAB to generate the transfer function
G(s)=9(s+1)(s+6)/s(9s2+s+8).
In the following ways;
a. the ratio of the factors.
b. the ratio of the polynomials.
MATLAB CODE:
z=[-1 -6];
r=roots([9 1 8]);
p=[0 0 r’];
‘part a’
g=zpk(z,p,9)
‘part b’
f=tg(g)
a. f(t)=5t2cos(3t+45o).
b. f(t)=5te-2tsin(4t+60o).
MATLAB CODE:
syms t;
‘part a’
f=2*t^2cos(9*t+45);
pretty(f)
F=laplace(f);
pretty(f)
‘part b’
f=3*t*exp(-2*t)*sin(5*t+45);
pretty(f)
F=laplace(f);
pretty(F)
,Q.2: Use MATLAB to find the inverse Laplace transform of the following frequency functions:
a. G(s)=(9s2+s+6)(2s+1)/(8s+1)(4s+6)(3s2+9s+44).
b. G(s)=(6s3+8s2+9s+4)/(8s+4)(s2+3s+6)(2s2+4s+1).
MATLAB CODE:
syms s;
‘part a’
num=(9*s^2+s+6)*(2*s+1);
den=(8*s+1)*(4*s+6)*(3*s^2+9*s+44);
pretty(num);
pretty(den);
g=num/den;
pretty(g);
F=ilaplace(g);
pretty(g);
pretty(f);
‘part b’
num=(6*s^3+8*s^2+9*s+4);
den=(8*s+4)*(s^2+3*s+6)*(2*s^2+4*s+1);
pretty(num);
pretty(den);
g=num/den;
pretty(g);
F=ilaplace(g);
pretty(g);
pretty(F)
, Q.3: Use MATLAB to generate the transfer function
G(s)=9(s+1)(s+6)/s(9s2+s+8).
In the following ways;
a. the ratio of the factors.
b. the ratio of the polynomials.
MATLAB CODE:
z=[-1 -6];
r=roots([9 1 8]);
p=[0 0 r’];
‘part a’
g=zpk(z,p,9)
‘part b’
f=tg(g)