Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dsolve unable to solve differential equation #16387

Open
RituRajSingh878 opened this issue Mar 22, 2019 · 10 comments
Open

dsolve unable to solve differential equation #16387

RituRajSingh878 opened this issue Mar 22, 2019 · 10 comments

Comments

@RituRajSingh878
Copy link
Contributor

RituRajSingh878 commented Mar 22, 2019


In [17]: str(eq)                                                                      
Out[17]: 'Eq(x**7*Derivative(f(x), x) + 5*x**3*f(x)**2 - (2*x**2 + 2)*f(x)**3, 0)'

In [13]: eq                                                                     
Out[13]: 
 7 d             3  2      ⎛   2    ⎞  3       
x ⋅──(f(x)) + 5⋅x ⋅f (x) - ⎝2⋅x  + 2⎠⋅f (x) = 0
   dx                                          

In [14]: classify_ode(eq)                                                       
Out[14]: ('lie_group',)

ode is classified as 'lie_group' but dsolve is not able to solve. It is going into a infinte loop in the line-

r = pdsolve(rpde, func=f(x, y)).rhs

from there I find that this partial differential equation is hanging-

In [15]: rpde                                                         
Out[15]: 
   7 ∂                                                 
  x ⋅──(f(x, y))   ⎛           2  3      3⎞            
     ∂x            ⎜ 3  2   2⋅x ⋅y    2⋅y ⎟ ∂          
- ────────────── + ⎜x ⋅y  - ─────── - ────⎟⋅──(f(x, y)) 
        5          ⎝           5       5  ⎠ ∂y         

In [16]: classify_pde(rpde)                                                     
Out[16]: ('1st_linear_variable_coeff',)
In [8]: pdsolve(rpde)
stuck


I don't know much about pde so if you can help.

@oscarbenjamin
Copy link
Contributor

This kind of error comes up a lot from the Lie Group solvers. There are many places where solve is assumed to return a single solution.

What are the equations that solve has failed on?

Do you know whether the Lie group solver should be able to solve this?

@oscarbenjamin
Copy link
Contributor

Sorry I didn't mean to close it!

@RituRajSingh878
Copy link
Contributor Author

Ping @oscarbenjamin

@oscarbenjamin
Copy link
Contributor

I'm not sure why you're pinging me...

@RituRajSingh878
Copy link
Contributor Author

I'm not sure why you're pinging me...

I have edited the issue and it is hanging somewhere in solving pde so If you can solve the issue because I don't know much about pde.

@oscarbenjamin
Copy link
Contributor

I don't know SymPy's PDE code so well myself. The PDE in question looks like one that I would manually solve with the method of characteristics but I don't know if that is implemented in SymPy:
https://en.wikipedia.org/wiki/Method_of_characteristics

@oscarbenjamin
Copy link
Contributor

Also do you know that there is a closed form analytic solution to this ODE?

@RituRajSingh878
Copy link
Contributor Author

Also do you know that there is a closed form analytic solution to this ODE?

I don't know the solution but it is hanging in solving so It is a problem.

@jksuom
Copy link
Member

jksuom commented Aug 6, 2019

It is going into a infinte loop

It seems that this is what happens: There is no easy solution for the nonlinear differential equation, and the Lie group method is attempted as a kind of last resort. That will necessitate calling pdsolve for solving a first order partial differential equation. For the solution, pdsolve calls dsolve for solving a suitable ordinary differential equation. That equation is essentially the same as the original equation, only some variable names have changed and the whole equation has been divided by a known function. Hence the same code will be run again ad infinitum.

@oscarbenjamin
Copy link
Contributor

I find the idea of the Lie group method strange. The method of characteristics reduces an PDE to a system of ODEs which seems like a simplification to me. Turning an ODE into a PDE feels like the wrong direction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants