Using example for MATLAB code in part 2
syms t
syms s
syms Fa(s)
syms Fb(s)
syms Fc(s)
syms Fd(s)
syms Fe(s)
syms fa(t)
syms fb(t)
syms fc(t)
syms fd(t)
syms fe(t)
% for function (a)
Fa(s)=s/(s*(s+1)*(s+5));
% for function (b)
Fb(s)=(3*s+2)/(s^2+2*s+10);
% for function (c)
Fc(s)=(3*s^2+6*s+6)/((s+1)*(s^2+10));
% for function (d)
Fd(s)=exp(-s)/(s^2);
% for function (e)
Fe(s)=((s^2+3*s+10)*(s+5))/((s+3)*(s+4)*(s^2+2*s+100));
% inverse of laplace function (a)
f(t)=ilaplace(Fa);
fa(t)=simplify(f);
% inverse of laplace function (b)
f(t)=ilaplace(Fb);
fb(t)=simplify(f);
% inverse of laplace function (c)
f(t)=ilaplace(Fc);
fc(t)=simplify(f);
% inverse of laplace function (d)
f(t)=ilaplace(Fd);
fd(t)=simplify(f);
% inverse of laplace function (e)
f(t)=ilaplace(Fe);
fe(t)=simplify(f);
% pretty(f) of function (a)
fprintf('Inverse laplace for function (a)\n');
pretty(fa);
% pretty(f) of function (b)
fprintf('Inverse laplace for function (b)\n');
pretty(fb);
% pretty(f) of function (c)
fprintf('Inverse laplace for function (c)\n');
pretty(fc);
% pretty(f) of function (d)
fprintf('Inverse laplace for function (d)\n');
pretty(fd);
% pretty(f) of function (e)
fprintf('Inverse laplace for function (e)\n');
pretty(fe);
% for graph create T and S
T=linspace(0,10,101);
S=linspace(1,25,101);
% for corresponding f(t) using T [ for function (a) ]
fa_t=zeros(1,length(T));
% for corresponding f(t) using T [ for function (b) ]
fb_t=zeros(1,length(T));
% for corresponding f(t) using T [ for function (c) ]
fc_t=zeros(1,length(T));
% for corresponding f(t) using T [ for function (d) ]
fd_t=zeros(1,length(T));
% for corresponding f(t) using T [ for function (e) ]
fe_t=zeros(1,length(T));
% for corresponding F(s) using S [ for function (a) ]
Fa_s=zeros(1,length(S));
% for corresponding F(s) using S [ for function (b) ]
Fb_s=zeros(1,length(S));
% for corresponding F(s) using S [ for function (c) ]
Fc_s=zeros(1,length(S));
% for corresponding F(s) using S [ for function (d) ]
Fd_s=zeros(1,length(S));
% for corresponding F(s) using S [ for function (e) ]
Fe_s=zeros(1,length(S));
% calculate all f(t)
for c=1:length(T)
fa_t(c)=eval(fa(T(c)));
fb_t(c)=eval(fb(T(c)));
fc_t(c)=eval(fc(T(c)));
fd_t(c)=eval(fd(T(c)));
fe_t(c)=eval(fe(T(c)));
end
% calculate all F(s)
for c=1:length(S)
Fa_s(c)=eval(Fa(S(c)));
Fb_s(c)=eval(Fb(S(c)));
Fc_s(c)=eval(Fc(S(c)));
Fd_s(c)=eval(Fd(S(c)));
Fe_s(c)=eval(Fe(S(c)));
end
% plot f(t) and F(s) for (a)
figure(1)
subplot(1,2,1);
plot(T,fa_t);
ylabel('f(t)');
xlabel('t');
title('f(t) vs t for (a)');
subplot(1,2,2);
plot(S,Fa_s);
ylabel('F(s)');
xlabel('s');
title('F(s) vs s for (a)');
% plot f(t) and F(s) for (b)
figure(2)
subplot(1,2,1);
plot(T,fb_t);
ylabel('f(t)');
xlabel('t');
title('f(t) vs t for (b)');
subplot(1,2,2);
plot(S,Fb_s);
ylabel('F(s)');
xlabel('s');
title('F(s) vs s for (b)');
% plot f(t) and F(s) for (c)
figure(3)
subplot(1,2,1);
plot(T,fc_t);
ylabel('f(t)');
xlabel('t');
title('f(t) vs t for (c)');
subplot(1,2,2);
plot(S,Fc_s);
ylabel('F(s)');
xlabel('s');
title('F(s) vs s for (c)');
% plot f(t) and F(s) for (d)
figure(4)
subplot(1,2,1);
plot(T,fd_t);
ylabel('f(t)');
xlabel('t');
title('f(t) vs t for (d)');
subplot(1,2,2);
plot(S,Fd_s);
ylabel('F(s)');
xlabel('s');
title('F(s) vs s for (d)');
% plot f(t) and F(s) for (e)
figure(5)
subplot(1,2,1);
plot(T,fe_t);
ylabel('f(t)');
xlabel('t');
title('f(t) vs t for (e)');
subplot(1,2,2);
plot(S,Fe_s);
ylabel('F(s)');
xlabel('s');
title('F(s) vs s for (e)');
Using example for MATLAB code in part 2 When using inverse Laplace uses the ilaplase module...
2. Calculate the Laplace inverse transform using Matlab and simplify their results, and also solve them manually. [20pts] F(s)= 6/s -1/(s-8) + 4/(s-3) H(s)=19/(s+2) -1/(3s-5) + 7/(s5) F(s)= 6s/(s2+25) + 3/(s2+25) G(s)= 8/(3s2+12) + 3/(s2-49)
In MATLAB Use symbolic math to solve and plot Laplace Problem 3.17. Problem 3.17 Obtain the inverse Laplace transform of each of the following 4(s-4) x1(s) 22+16) a. 4 4s b. x2s) (s2+9) (s+5)e 25 x3(s)(s+1)(s+3) c. In MATLAB Use symbolic math to solve and plot Laplace Problem 3.17. Problem 3.17 Obtain the inverse Laplace transform of each of the following 4(s-4) x1(s) 22+16) a. 4 4s b. x2s) (s2+9) (s+5)e 25 x3(s)(s+1)(s+3) c.
Question-2 The diff () command in MATLAB is only used for solving linear differentiational equations. Select one: True False Question-3 The diff () command in MATLAB can solve only up to third order differentiational equation. Select one: True False Question-4 The symbolic variable must be defined in the MATLAB to use diff (), laplace and ilaplace commands. Select one: True False Question-5 The “s” is the pre-defined symbolic variable MATLAB variable for solving inverse Laplace in MATLAB. Select one: True...
MATLAB c. Determine the Partial Fraction Expansion and the Laplace Inverse) of the following ace Inverse (fo)) of the following function F(s), using MATLAB: F( s) = (s+ 2) (s+ 4) (s + 6)2
Problem 5. Determine the inverse Laplace transform of Problem 6. Determine the inverse Laplace transform of 2s2 4s 10 9(s) = 2(s+1) Problem 7. Determine the inverse Laplace transform of 2s 10
Fill in the table with the appropriate Laplace or inverse Laplace transforms. You may use the Laplace Transform table located on D2L in the same folder as this quiz. f(t) = C-'{F(*)} F(s) = {{f(t)} eU(t - 3) e-2 cosh(41) S- 2 $2 + 2s + 10
1292) Determine the Inverse Laplace Transform of F (S) (14s 18)/(s 2+34+ The answer is f (t)-Q*exp (-alpha*t) *sin(w*t+phi). Answers are: A,alpha, w,phi where w is in rad/sec and phi is in rad ans:4 1292) Determine the Inverse Laplace Transform of F (S) (14s 18)/(s 2+34+ The answer is f (t)-Q*exp (-alpha*t) *sin(w*t+phi). Answers are: A,alpha, w,phi where w is in rad/sec and phi is in rad ans:4
problem 3: I need help with #4 using Matlab. 4. Given that the input x(t) in problem 3 above is a step function of magnitude 2 [x = 2 u(t), find the output y() by fnding the inverse Laplace transform of Y (s) by the method of partial fraction expansion by MATLAB as explained on page 8 of Handout 2 (ilaplace command).
d and f only Obtain the inverse Laplace transform f () for the following: 2.8 5 6 4s a. $2+9 $2+4 s2+4 5 6 d. s(s +3) 2s +8 с. s2+4s+ 13 10 f. (s+3)(s+7 е. (s+3)(s +7)
help 1. (10 points) Find the inverse Laplace f(t) = --'{F} of the following: 4 6 1 a) 2 F(s) + S 8 +8 S b) 2 F(s) c) 2 F(8) (8 - 1)(8-2) 8 +3 $2 + 2s +5 7s2 + 23s + 30 (8-2)(82 +2s + 5) d) F(s)