Hi, I am having problem using diff command. I am trying to differentiate following function and matlab is missing 2nd part of answer.
a=90.0 - 90.0*exp(-0.167*t)*cos(1.99*t) - 7.53*exp(-0.167*t)*sin(1.99*t); b=diff(90.0 - 90.0*exp(-0.167*t)*cos(1.99*t) - 7.53*exp(-0.167*t)*sin(1.99*t); vpa(b,3)
ans 181.0*exp(-0.167*t)*sin(1.99*t)
it is missing 0.453e-1*exp(-.167*t)*cos(1.99*t).
Full complete answer which i found using maple is
0.453e-1*exp(-.167*t)*cos(1.99*t)+180.35751*exp(-.167*t)*sin(1.99*t).
Will you please help to figure this out. I am with Matlab.
Thank you,
Adnan

답변 (1개)

Roger Stafford
Roger Stafford 2015년 1월 25일

0 개 추천

I am guessing that your difficulty is due to the low number of digits accuracy, namely only 3, that you requested. Write
vpa(b,100)
and see what you get.
Asking for only three decimal digits will probably produce terribly inaccurate results and some terms might be missing altogether. Why have you done this?

카테고리

도움말 센터File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

질문:

2015년 1월 25일

답변:

2015년 1월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by