How to get a inverse laplace of a tf?

319 visualizzazioni (ultimi 30 giorni)
Bruno Souza
Bruno Souza il 19 Ago 2018
Commentato: Vinit il 9 Dic 2023
Hello, I need to find the inverse laplace of a generic tf. How could I do It in an easy way?
close all
clc
num = input('Insira o Polinomio do Numerador: ');
[3 7] % for example
den = input('Insira o Polinomio do Denominador: ');
[1 2 5] % for example
%function [z,p] = (num,den)
z= roots(num)
p= roots(den)
FT = tf(num,den)
h = zpk(num,den,1)
How Can I use the ilaplace function now? thanks

Risposta accettata

Star Strider
Star Strider il 19 Ago 2018
You can derive inverse Laplace transforms with the Symbolic Math Toolbox. It will first be necessary to convert the ‘num’ and ‘den’ vectors to their symbolic equivalents. (You may first need to use the partfrac function to do a partial fraction expansion on the transfer function expressed as a symbolic fraction. That step is not necessary in R2018a.) Then use the ilaplace function. After that, use the simplify and collect functions to produce a compact result:
num = [3 7];
den = [1 2 5];
FT = tf(num,den); % Transfer Function Object
syms s t % Invoke Symbolic Math Toolbox
snum = poly2sym(num, s) % Symbolic Numerator Polynomial
sden = poly2sym(den, s) % Symbolic Denominator Polynomial
FT_time_domain = ilaplace(snum/sden) % Inverse Laplace Transform
FT_time_domain = simplify(FT_time_domain, 'Steps',10) % Simplify To Get Nice Result
FT_time_domain = collect(FT_time_domain, exp(-t)) % Optional Further Factorization
producing:
FT_time_domain =
(3*cos(2*t) + 2*sin(2*t))*exp(-t)
Note that if you want only the time-domain impulse (or step) response of your system, you can get those directly with the impulse and step functions with your ‘FT’ system. It is not necessary to get an analytic expression of your transfer function object first, in that instance.
  4 Commenti
Vinit
Vinit il 9 Dic 2023
clc;clear all;close all;
n1=[4];
d1=[1];
n2=[1 0];
d2=[0 1];
[n3,d3]=parallel(n1,d1,n2,d2);
printsys(n3,d3)
n4=[0 0 1];
d4=[1 2 0];
[n5,d5]=series(n4,d4,n3,d3);
printsys(n5,d5)
n6=[0.5];
d6=[1];
[n7,d7]=feedback(n5,d5,n6,d6,-1);
printsys(n7,d7)
[n8,d8]=cloop(n7,d7,-1);
t=tf(n8,d8)
syms s
sn= poly2sym(n8,s);
sd= poly2sym(d8,s);
z=ilaplace(sn/sd)
Vinit
Vinit il 9 Dic 2023
clc
clear all
close all
num=[4 1];
den=[4 0 0];
printsys(num,den)
[n d]=cloop(num,den,-1)
a=tf(n,d)
subplot(2,1,1);
impulse(a)
subplot(2,1,2);
step(a)
n1=[1];
d1=[1];
n2=[1];
d2=[1 0];
u1=tf(n1,d1)
u2=tf(n2,d2)
r1=a.*u1
r2=a.*u2
syms s
r1= (4.*s+1)/((2.*s+1).*(s+1));
r2= (4.*s+1)/(s.*(2.*s+1).*(s+1));
rt1=ilaplace(r1)
rt2=ilaplace(r2)

Accedi per commentare.

Più risposte (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by