フィルターのクリア

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

1 回表示 (過去 30 日間)
dcydhb dcydhb
dcydhb dcydhb 2019 年 12 月 23 日
コメント済み: David Goodmanson 2019 年 12 月 23 日
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 件のコメント
David Goodmanson
David Goodmanson 2019 年 12 月 23 日
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.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeDigital Filter Analysis についてさらに検索

製品


リリース

R2014a

Community Treasure Hunt

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

Start Hunting!

Translated by