简体   繁体   中英

How to solve a Second order and Second Degree Differential Equation ( in python )?

I have came across a second order as well as second degree differential equation in study of cosmic inflation. The full equations is quite messy so let me give a prototye:

A(x) y''(x)^2 + B(x) y(x) + C(x) = 0, y'(0) = a, y(0) = b

What I usually do in this type of cases is to ask Mathematica to solve it. And she usually solve it. But, sometimes mathematica show some error, for instance "singularity or stiffness at x=d". Now, I am trying to solve them in some basic language ( read python ). But, the way we solve 2nd order differential equation is not applicable here, ie, writing it as two first order differential equations. Can any one provide me with an algorithm for solving the problem and/or direct me to the literature where I can learn more about the methods.

Thanks in advance.

I believe that "Newmarks Method" is an applicalbe method for numerical integration of second order ODE's.

https://en.wikipedia.org/wiki/Newmark-beta_method

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM