필터 지우기
필터 지우기

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

조회 수: 2 (최근 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 CenterFile Exchange에서 Digital Filter Analysis에 대해 자세히 알아보기

제품


릴리스

R2014a

Community Treasure Hunt

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

Start Hunting!

Translated by