OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Differential equations which cannot be solved by substituion in Sympy

  • Thread starter Thread starter Prateek Sonthalia
  • Start date Start date
P

Prateek Sonthalia

Guest
These 2 differential equations taken from the book Advanced Mathematics by Mr. Spiegel, cannot be solved by Sympy. I have checked the documentation of Sympy on solving ODEs a lot. These equations can be solved by substituing y'= p and then sperating variables in p and y:
1st Equation
2nd Equation


I am trying to solve various kinds of ODEs using sympy and have been able to get around some issues using hints, but I haven't been able to solve this one.

Trying to solve some ODEs using Sympy but could not do it

Code:
import sympy as sp
#p = sp.Symbol('p')
y = sp.Function('y')(x)
#p = sp.Function('p')
#p = sp.diff(y,x)
diff_eqn = sp.Eq(1+y*sp.diff(y,x,x)+sp.diff(y,x)**2,0)
diff_eqn
#Since x is not there in the equation we substitute y' = p
sp.dsolve(diff_eqn, y)#.subs(p,y.diff(x)).simplify()
<p>These 2 differential equations taken from the book Advanced Mathematics by Mr. Spiegel, cannot be solved by Sympy. I have checked the documentation of Sympy on solving ODEs a lot. These equations can be solved by substituing y'= p and then sperating variables in p and y:
<img src="https://i.sstatic.net/QDGVJqnZ.png" alt="1st Equation" />
<img src="https://i.sstatic.net/kZDsx2lb.png" alt="2nd Equation" /></p>
<p>I am trying to solve various kinds of ODEs using sympy and have been able to get around some issues using hints, but I haven't been able to solve this one.</p>
<p>Trying to solve some ODEs using Sympy but could not do it</p>
<pre><code>import sympy as sp
#p = sp.Symbol('p')
y = sp.Function('y')(x)
#p = sp.Function('p')
#p = sp.diff(y,x)
diff_eqn = sp.Eq(1+y*sp.diff(y,x,x)+sp.diff(y,x)**2,0)
diff_eqn
#Since x is not there in the equation we substitute y' = p
sp.dsolve(diff_eqn, y)#.subs(p,y.diff(x)).simplify()
</code></pre>
 

Latest posts

Top