Matlab dsolve function issue with format.

I tried to do
>> eqn = '2*D2x + 2.2*Dx + 0.4*x = 0';
>> sol = dsolve(eqn);
>> pretty(sol)
/ / sqrt(41) 11 \ \
C1 exp| -t | -------- + -- | | + C2
\ \ 20 20 / /
/ / sqrt(41) 11 \ \
exp| t | -------- - -- | |
\ \ 20 20 / /
How can I get the answer as C1exp(-0.280*t) +C2 exp(-0.870t) rather than the format shown above. Thanks.

 채택된 답변

Star Strider
Star Strider 2020년 7월 1일

0 개 추천

My (R2020a) version requires slightly different symbolic convetions.
Try this:
syms x(t)
Dx = diff(x);
D2x = diff(Dx);
eqn = 2*D2x + 2.2*Dx + 0.4*x == 0;
sol = dsolve(eqn);
sol = vpa(sol,4);
pretty(sol)
producing:
C1 exp(-0.8702 t) + C2 exp(-0.2298 t)
.

댓글 수: 2

Sushil
Sushil 2020년 7월 2일
Thanks
Star Strider
Star Strider 2020년 7월 2일
As always, my pleasure!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Installation and Operational Settings에 대해 자세히 알아보기

제품

태그

질문:

2020년 7월 1일

댓글:

2020년 7월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by