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

20 visualizaciones (últimos 30 días)
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 comentario
Robin
Robin el 24 de Jul. de 2011
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)

Iniciar sesión para comentar.

Respuesta aceptada

Walter Roberson
Walter Roberson el 24 de Jul. de 2011
Do you want to solve for y(t) rather than for t ? dsolve() really isn't suitable for solving for variables.
  8 comentarios
Robin
Robin el 25 de Jul. de 2011
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 el 25 de Jul. de 2011
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.

Iniciar sesión para comentar.

Más respuestas (1)

Rohith
Rohith el 9 de Oct. de 2022
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 comentarios
Abeda
Abeda el 1 de Ag. de 2023
Is it run on matlab 2021a version? Because, dsolve normally doesn't run on my laptop. Please, help me.

Iniciar sesión para comentar.

Community Treasure Hunt

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

Start Hunting!

Translated by