dsolve - Unable to find implicit solution

1 回表示 (過去 30 日間)
Jazmine Sydney Tanay
Jazmine Sydney Tanay 2020 年 7 月 18 日
コメント済み: Walter Roberson 2020 年 7 月 18 日
>> syms y(t)
>> eqn = diff(y) == y+exp(-y)
eqn(t) =
diff(y(t), t) == exp(-y(t)) + y(t)
>> sol = dsolve(eqn)
Warning: Unable to find explicit solution. Returning implicit
solution instead.
> In dsolve (line 197)
sol =
lambertw(0, -1)
>> sol = dsolve(eqn,'Implicit',true)
Error using char
Conversion to char from logical is not possible.
Error in dsolve>mupadDsolve (line 274)
if isvarname(char(args{end}))
Error in dsolve (line 183)
sol = mupadDsolve(args, options);
  1 件のコメント
Walter Roberson
Walter Roberson 2020 年 7 月 18 日
Which release are you using? When I dsolve() I do not get the warning for the first case, and the second case does not give me an error (but the result is a bit odd)

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

回答 (1 件)

Star Strider
Star Strider 2020 年 7 月 18 日
That is not very illumiunating.
Try this:
syms y(t) T Y
eqn = diff(y) == y+exp(-y);
[VF,Subs] = odeToVectorField(eqn);
eqnfcn = matlabFunction(VF, 'Vars',{T,Y});
[t,y] = ode45(eqnfcn, [0 1], 1);
figure
plot(t, y)
grid
Choose appropriate values for the time interval ([0 1] here) and initial condition (here 1).

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by