Solving Second Order diff eqn.
이전 댓글 표시

I want to solve this second order differential equation with MATLAB , but i cannot do it. Could u do it and help me please ?
답변 (1개)
Star Strider
2020년 12월 21일
Use the Symbolic Math Toolbox.
Start by defining:
syms x(t)
Dx = diff(x);
Dx2 = diff(x,2);
I leave the rest to you.
댓글 수: 4
Timur Camliova
2020년 12월 21일
Star Strider
2020년 12월 21일
This appears to be a homework assignment, and our policy here is to only give hints for homework assignments, not full code.
Timur Camliova
2020년 12월 21일
Star Strider
2020년 12월 21일
Since it is not homework, here is the full code, complete with a fplot call so you can see the output:
syms x(t)
Dx = diff(x);
Dx2 = diff(x,2);
Eqn = Dx2 +6 + 18*x == exp(-t);
ics = [x(0)==0, Dx(0)==0];
xsln = simplify(dsolve(Eqn, ics), 'Steps',500);
ltxeqn = latex(xsln);
figure
fplot(xsln, [0 6*pi])
grid
xlabel('t')
ylabel('x(t)')
title(['$x(t) =' ltxeqn '$'], 'Interpreter','latex')
.
카테고리
도움말 센터 및 File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!