How can I go from a transfer function to a inverse Laplace transform?
Show older comments
I have written the following code. I would like to go directly to a time domain function without reentering a tf as shown in the last line. Can this be done?
clc
clear all
close
disp('Step responses for transfer functions')
Step = [1 0];
v = [1 2];
den = conv(Step,v);
num = [2];
syms s
H = tf(num,den)
Poles = pole(H)
Zeros = zero(H)
figure(2)
pzmap(H)
axis([-3,.5,-.1,.1])
sgrid
ilaplace(H2/(s^2+2*s))
%ilaplace(2/(s^2+2*s))nd
Answers (2)
Azzi Abdelmalek
on 28 Mar 2014
syms s
h=ilaplace(2/(s^2+2*s))
3 Comments
Azzi Abdelmalek
on 29 Mar 2014
Edited: Azzi Abdelmalek
on 29 Mar 2014
Is this an answer or a comment? To add a comment click on [comment on this answer]
Try also to make your question clear
mnbaig94
on 29 Nov 2020
Hello Azzi,
I have a transfer function:
num1 = [Li*Lg*Lx*C*Rl Rl*C*Li*Lg+Rl*C*Rd*Lx*Li+Rl*C*Rd*Lx*Lg Rl*Rd*Rg*C*Li+Rl*Rd*Rg*C*Lg+Rl*Lx*Li+Rl*Lx*Lg Rg*Rl*Li+Rg*Rl*Lg 0]
den1 = [Li*Lg*Lx*C Li*Lg*C*Rl+C*Li*Lg*C*Rg+C*Rd*Lx*Li+C*Rd*Lx*Lg Rd*Rl*C*Li+Rd*Rl*C*Lg+Rd*Rg*C*Li+Rd*Rg*C*Lg+Lx*Li+Lx*Lg Rl*Li+Rl*Lg+Rg*Li+Rg*Lg+Lx Rg+Rl]
sys1 = tf(num1,den1)
I want to take inverse laplace of it, can you please help??
mnbaig94:
If you try to do this directly, the calculation will take too long. Instead, find the general solution and then substitute the actual expressions into the general solution.
syms s
syms N0 N1 N2 N3 N4
syms D0 D1 D2 D3 D4
n1s = poly2sym([N4 N3 N2 N1 N0],s);
d1s = poly2sym([D4 D3 D2 D1 D0],s);
sys1s = n1s/d1s;
ILs = ilaplace(sys1s, s);
syms C Lg Li Lx Rd Rg Rl
num1 = [Li*Lg*Lx*C*Rl Rl*C*Li*Lg+Rl*C*Rd*Lx*Li+Rl*C*Rd*Lx*Lg Rl*Rd*Rg*C*Li+Rl*Rd*Rg*C*Lg+Rl*Lx*Li+Rl*Lx*Lg Rg*Rl*Li+Rg*Rl*Lg 0];
den1 = [Li*Lg*Lx*C Li*Lg*C*Rl+C*Li*Lg*C*Rg+C*Rd*Lx*Li+C*Rd*Lx*Lg Rd*Rl*C*Li+Rd*Rl*C*Lg+Rd*Rg*C*Li+Rd*Rg*C*Lg+Lx*Li+Lx*Lg Rl*Li+Rl*Lg+Rg*Li+Rg*Lg+Lx Rg+Rl];
IL = subs(ILs, [N4 N3 N2 N1 N0 D4 D3 D2 D1 D0], [num1, den1]);
IL
The expression you get back will have symsum() of a term involving root() of an expression that is a polynomial of degree 4.
It is possible to convert those root() expressions into closed form; I think I wrote some lines that did that, but I cannot seem to find that now.
However... converting the roots of a degree 4 polynomial into closed form expression gives you a result that is effectively unreadable.
Categories
Find more on MATLAB 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!