필터 지우기
필터 지우기

How would I enter the Differential Equation y''+100y=2sin(4t)

조회 수: 3 (최근 30일)
Andrew Serrano
Andrew Serrano 2019년 5월 5일
답변: Star Strider 2019년 5월 5일
the correct answer should be C1cos10t + C2sin10t + (1/42)sin4t
I tried this code and got a crazy answer.
dsolve ('D2y+100*y=2*sin(4*t)','t')
ans =
(3*sin(8*t)*((6*cos(4*t))/35 + (2*cos(8*t))/35 + 11/105))/8 - (sin(4*t)*((6*cos(4*t))/35 + (2*cos(8*t))/35 + 11/105))/8 - (3*sin(12*t)*((6*cos(4*t))/35 + (2*cos(8*t))/35 + 11/105))/8 + (sin(16*t)*((6*cos(4*t))/35 + (2*cos(8*t))/35 + 11/105))/8 + sin(10*t)*(cos(6*t)/60 - cos(14*t)/140) + C9*cos(10*t) - C10*sin(10*t)

답변 (2개)

Omer N
Omer N 2019년 5월 5일
Try like so:
syms y(t)
simplify( dsolve(diff(y,2)+100*y==2*sin(4*t),t) )
ans =
sin(4*t)/42 + C1*cos(10*t) - C2*sin(10*t)

Star Strider
Star Strider 2019년 5월 5일
Use the simplify function:
syms t y(t) Dy0 y0
Dy = diff(y);
D2y = diff(y,2);
Eqn = D2y + 100*y == 2*sin(4*t);
ys = dsolve(Eqn, Dy(0)==Dy0, y(0)==y0);
ys = simplify(ys, 'Steps',50)
producing:
ys =
sin(4*t)/42 - sin(10*t)/105 + y0*cos(10*t) + (Dy0*sin(10*t))/10
I specified the initial conditions here, so they will appear as ‘y0’ and ‘Dy0’ in the integrated equation.

카테고리

Help CenterFile Exchange에서 Linear Algebra에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by