I'm trying to use dsolve to solve this differential equation, but it does not work

20 ビュー (過去 30 日間)
Robin
Robin 2011 年 7 月 24 日
コメント済み: Abeda 2023 年 8 月 1 日
I'm trying to solve this differential equation using dsolve in matlab, so this is what Im trying to run:
eqn = 'Dy=-exp(y)/(t*exp(y)-sin(y))';
dsolve(eqn,'t')
I know that there is no explicit solution to it, but I was taught that matlab should return a implicit solution. However it doesn't. I've tried it on different versions of matlab, but still no luck. Can someone please help me out?
**this is the error it returns:
??? Error using ==> mupadmex
Error in MuPAD command: wrong 2nd argument [normal]
Error in ==> sym.sym>sym.mupadmexnout at 2003
out = mupadmex(fcn,args{:});
Error in ==> dsolve>mupadDsolve at 190
[var_list,R] = mupadmexnout('mllib::dsolve',sys,x,ignor
Error in ==> dsolve at 97
[R,vars] = mupadDsolve(ignoreConstraints,varargin{1
  1 件のコメント
Robin
Robin 2011 年 7 月 24 日
this was the original question asked on the assignment btw:
consider the differential equation e^y+(t*e^y - sin(y))*(dy/dt)=0
using dsolve, observe that the solution is given in the form f(t,y)=C
(however I cannot get matlab to give me a solution at all)

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

採用された回答

Walter Roberson
Walter Roberson 2011 年 7 月 24 日
Do you want to solve for y(t) rather than for t ? dsolve() really isn't suitable for solving for variables.
  8 件のコメント
Robin
Robin 2011 年 7 月 25 日
I tried it on a an older version of Matlab (2008) and it somehow worked, it gave me the RootOf(_Z-log(-(cos(_Z)-C1)/t)); where _z is the y. C1 is just some arbitrary constant...
Walter Roberson
Walter Roberson 2011 年 7 月 25 日
That must have been a Maple based symbolic toolbox. We can tell that by the fact that it used _Z as the dummy variable for the RootOf(), which is Maple style; MuPad generates an arbitrary variable name that does not start with '_', and MuPad includes that dummy variable name as the second parameter of the RootOf().
It seems, then, that what has been tried works on the Maple symbolic engine, but not on MuPad. Unfortunately I do not have MuPad to test with.

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

その他の回答 (1 件)

Rohith
Rohith 2022 年 10 月 9 日
For me, I found that you need to add an option setting Implicit to true.
syms y(t)
eqn = exp(y) + (t*exp(y) - sin(y))*diff(y,t) == 0;
dsolve(eqn, 'Implicit', true)
ans = 
The output was:
- cos(y(t)) - t*exp(y(t)) == C1
  3 件のコメント
Abeda
Abeda 2023 年 8 月 1 日
Is there any other solution?
Abeda
Abeda 2023 年 8 月 1 日
Is it run on matlab 2021a version? Because, dsolve normally doesn't run on my laptop. Please, help me.

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

カテゴリ

Help Center および File ExchangeUtilities for the Solver についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by