Effacer les filtres
Effacer les filtres

the reult is different using `ilaplace` and `lsim `

2 vues (au cours des 30 derniers jours)
dcydhb dcydhb
dcydhb dcydhb le 23 Déc 2019
Commenté : David Goodmanson le 23 Déc 2019
i just want to get the output when i know the input signal and trans fer function however when i use 2 methods they are different,codes are as this
method 1
syms t s
gs=(s)/(s^2 + 2*s +1);
us= laplace(sin(t + pi/6), t, s);
xs = us*gs;
xt = ilaplace(xs, s, t)
t=0:0.1:50;
xt2=cos(t)/4 + sin(t)/4 - (3^(1/2)*cos(t))/4 + (3^(1/2)*sin(t))/4 + exp(-t)*(3^(1/2)/4 - 1/4);
plot(t,xt2,'b')
method 2
num=[1,0];
den=[1,2,1]
sys=tf(num, den);
t=0:0.1:50;
u=sin(t+pi/6);
y=lsim(sys, u,t);
plot(t,y,'r')
and when i plot them together the result is as this together.png
  1 commentaire
David Goodmanson
David Goodmanson le 23 Déc 2019
Hi d^2,
I'm not sure where xt2 is coming from, but in the first method, plotting xt gives a result that looks very close to the lsim method. I don't have access to lsim so I can't say if the agreement is identical but it looks really close.
xt2 doesn't look right because gs has a double pole and xt2 does not have a t*e^(-t) term, whereas xt does.

Connectez-vous pour commenter.

Réponses (0)

Produits


Version

R2014a

Community Treasure Hunt

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

Start Hunting!

Translated by