Second order differential equation

I am trying to solve a second order differential equation using the code below, but whenever I insert the additional condition of diff(y(0),t,2) == g (g is a negative value by the way) into the equation, Matlab says: "Explicit solution could not be found." I know that this has a real, exact solution containing constants of c and g only. Should I be using another method? Thanks in advance.
syms c g y(t);
eqn = diff(y(t),t,2)== g+(c*(diff(y(t),t))*(diff(y(t),t)));
cond = [y(0) == 1000, diff(y(0),t) == 0];
ySol(t) = dsolve(eqn, cond)
v(t) = diff(ySol(t),t)
a(t) = diff(v(t),t)

 採用された回答

Walter Roberson
Walter Roberson 2017 年 10 月 28 日

0 投票

syms c positive
syms g negative
eqn = diff(y(t),t,2)== g+(c*(diff(y(t),t))*(diff(y(t),t)));
cond = [y(0) == 1000, diff(y(0),t) == 0];
ySol(t) = dsolve(eqn, cond)
MATLAB finds four solutions.

3 件のコメント

Jay
Jay 2017 年 10 月 29 日
Thanks for this, but the goal is to produce a single exact solution, so that I can follow this up with a plot command from the live script. The exact solution has no additional constants, and results in diff(y(0),t,2)==g.
Walter Roberson
Walter Roberson 2017 年 10 月 29 日
There was a boundary condition expression problem.
syms y(t)
syms c positive
syms g negative
eqn = diff(y(t),t,2)== g+(c*(diff(y(t),t))*(diff(y(t),t)));
cond = [y(0) == 1000, subs(diff(y,t),t,0) == 0];
ySol(t) = dsolve(eqn, cond)
ySol(0)
v(t) = diff(ySol(t),t);
a(t) = diff(v(t),t);
a(0)
back_subs = simplify(subs(eqn,y,ySol))
isAlways(back_subs, 'Unknown', 'false')
Jay
Jay 2017 年 10 月 29 日
Perfect! Thanks again.

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangePhysics についてさらに検索

質問済み:

Jay
2017 年 10 月 28 日

コメント済み:

Jay
2017 年 10 月 29 日

Community Treasure Hunt

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

Start Hunting!

Translated by