フィルターのクリア

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 Center および File ExchangeLinear Algebra についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by