Matlab: differential equation: starting conditions are wrong?

1 回表示 (過去 30 日間)
Niklas Kurz
Niklas Kurz 2021 年 5 月 9 日
コメント済み: Niklas Kurz 2021 年 5 月 12 日
I solved manually: with
but if I solve it with Matlab:
syms v(t) g alpha m v0;
D = diff(v,t) == g - alpha/m*v;
c1 = v;
cond = c1(0) == v0;
S = dsolve(D,cond);
pretty(S)
I get a different solution, even if I'm sure mine is right.
I know this topic is a little vast, but maybe some of you talented people has time to investigate

採用された回答

Cris LaPierre
Cris LaPierre 2021 年 5 月 9 日
編集済み: Cris LaPierre 2021 年 5 月 9 日
I'm no expert, but isn't the integral equal to
That way, the algebra works out to match the result MATLAB is giving you
syms v(t) g alpha m v0;
D = diff(v,t) == g - alpha/m*v;
cond = v(0) == v0;
S = dsolve(D,cond)
S = 
which simplifies to
  1 件のコメント
Cris LaPierre
Cris LaPierre 2021 年 5 月 9 日
Here's more details on the derivation

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

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2021 年 5 月 9 日
syms v(t) g alpha m v0;
D = diff(v,t) == g - alpha/m*v;
c1 = v;
cond = c1(0) == v0;
S = dsolve(D,cond);
sum(cellfun(@(X) collect(X,[g,m,alpha]), children((collect(expand(S),g)))))
ans = 
  1 件のコメント
Niklas Kurz
Niklas Kurz 2021 年 5 月 12 日
as always you're the master of formatation

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

カテゴリ

Help Center および File ExchangeNumber Theory についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by