please help me (dsolve)

1 回表示 (過去 30 日間)
Melika Eft
Melika Eft 2021 年 1 月 16 日
コメント済み: Melika Eft 2021 年 1 月 16 日
im sure its correct but it doesnt work
w=dsolve('D2y+0.5*Dy+y=3','y(0)=0.5,Dy(0)=0');
matlab 2018
im grateful for your help

採用された回答

Star Strider
Star Strider 2021 年 1 月 16 日
The single quotation marks are likely the problem.
Try this slightly edited version:
syms y(t)
Dy = diff(y);
D2y = diff(Dy);
w = dsolve( D2y+0.5*Dy+y == 3, y(0) == 0.5, Dy(0) == 0 );
w = simplify(w, 'Steps',250)
figure
fplot(w, [0 30])
grid
xlabel('t')
ylabel('w(t)')
ltxw = latex(w);
title(['$w(t) = ' ltxw '$'], 'Interpreter','latex')
producing:
.
  1 件のコメント
Melika Eft
Melika Eft 2021 年 1 月 16 日
Thank you

サインインしてコメントする。

その他の回答 (1 件)

Mischa Kim
Mischa Kim 2021 年 1 月 16 日
Use instead
syms y(t)
eqn = diff(y,t,2) + 0.5*diff(y,t) + y == 3;
Dy = diff(y,t);
cond = [y(0) == 0.5, Dy(0) == 0];
w = dsolve(eqn,cond)
  1 件のコメント
Melika Eft
Melika Eft 2021 年 1 月 16 日
Thank you

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeConversion Between Symbolic and Numeric についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by