slow ilapalce calculation for systems with higher polynomial orders
조회 수: 7 (최근 30일)
이전 댓글 표시
Is it possible to calculate the output o(t) of a system h(s) for the input x(s) faster than following codes? Why the following codes run extremely slow? What is wrong?
syms s t
time=linspace(0,4/1e09,401);
h=((5034923382327397*s^3)/627710173538668076383578942320766641610235544446403451289600 + (6766076405664713*s^2)/71362384635297994052914298472474756819137331200 + (210759975314673*s)/64903710731685345356631204115251200 + 376686340223973/281474976710656000000000000)/((5034923382327397*s^3)/12554203470773361527671578846415332832204710888928069025792 + (2284590225627523*s^2)/356811923176489970264571492362373784095686656 + (7512718920571563*s)/649037107316853453566312041152512 + 765850114395651/37778931862957161709568);
x=(100e-03/s)*(1-exp(-s/(2*1e09)))/(1+exp(-s/(2*1e09)));
y=ilaplace(x*h,s,t);
o=subs(y,t,time);
plot(time,o)
댓글 수: 2
Walter Roberson
2019년 2월 6일
your expression for h is either incorrect or meaningless. Numbers with that many digits will be approximated with floating point which will introduce false behaviour with roots and poles in different places than you expect .
Chances are high that you should be using symbolic constants not floating point .
sym('26271892563873553613')
채택된 답변
Walter Roberson
2019년 2월 6일
subs(vpa(y,16),t,time)
No point in calculating with large numbers to indefinite precision only to throw away that precision since plot() only has single precision resolution according to some tests I have done.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Calculus에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!