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개)

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 = 

카테고리

Help CenterFile Exchange에서 Number Theory에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by