I would like to take the inverse laplace transform of a transfer function.
9 views (last 30 days)
Show older comments
Andres Cardenas
on 24 Apr 2022
Commented: Star Strider
on 25 Apr 2022
I got a transfer function using MATLAB's tf command.
I need to take the inverse laplace transform of said transfer function but I can't seem to get it.
My code looks like this
%-Element values
R(1) = 100000;
R(2) = R(1);
L = 4.7*10^-3;
C = 0.001*10^-9;
for i = 1:2
G(i) = 1/R1;
end
%-Define constants
a = G(i)*G(i)/C;
b = (G(i)+G(i));
e = L*C;
c = (G(i)*G(i)*L+C)/(e);
d = G(i)/e;
f = 0
numerator = [a f];
denominator = [b c d];
transfer_function = tf(numerator, denominator)
transfer_function= F;
syms s t
g = ilaplace(F)
[response , time] = step(transfer_function);
plot(time, response)
xlabel('Time(s)');
ylabel('Magnitude(V)');
axis([time(1) time(end) min(response) 1.05*max(response)]);
grid;
grid minor;
I get the following error "Check for incorrect argument data type or missing argument in call to function 'ilaplace'.
Error in ME330Assignment2 (line 27)
g = ilaplace(F)"
Any guidance is appreciated. Thank you!
2 Comments
Accepted Answer
Star Strider
on 24 Apr 2022
The Control System Toolbox tf objects cannot directly be used as symbolic objects. So it has to be re-defined as a symbolic fraction.
There were a few other problems that I corrected.
%-Element values
R(1) = 100000;
R(2) = R(1);
L = 4.7E-3;
C = 0.001E-9;
for i = 1:2
G(i) = 1/R(i);
end
%-Define constants
a = G(i)*G(i)/C;
b = (G(i)+G(i));
e = L*C;
c = (G(i)*G(i)*L+C)/(e);
d = G(i)/e;
f = 0
numerator = [a f];
denominator = [b c d];
transfer_function = tf(numerator, denominator)
% F = transfer_function;
syms s t
F = poly2sym([a f],s) / poly2sym([b c d],s)
F = simplifyFraction(F)
g = ilaplace(F)
g = simplifyFraction(g)
gstep = ilaplace(F * laplace(heaviside(t))) % Provide An Input
gstep = simplifyFraction(gstep)
figure
fplot(gstep, [0 1E-6])
grid
[response , time] = step(transfer_function);
figure
plot(time, response)
xlabel('Time(s)');
ylabel('Magnitude(V)');
axis([time(1) time(end) min(response) 1.05*max(response)]);
grid;
grid minor;
.
0 Comments
More Answers (0)
See Also
Categories
Find more on Calculus in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!





