简体   繁体   中英

Solve ordinary differential equations using SciPy

I have a following ordinary differential equation and numeric parameters Sigma =0.4, x(0) = 4 and dx(0)/dt = 0
My task is to get Cauchy problem solution (Initial value problem solution) of differential equation using ode function
Can someone help me? I don't even know how to write equation and especially numeric parameters in correct way for SciPy.
PS Sorry for not posting images, I've just registered.

Like Warren said, scipy.integrate.odeint is the 'SciPy' way to solve this.

But before you take your problem to SciPy (or whatever solver you end up using) you'll want to convert your 2nd order ODE to a first order ODE using something like: http://tutorial.math.lamar.edu/Classes/DE/SystemsDE.aspx

To get things into SciPy you need to get your equation looking like:

y' = f(y)

But right now your equation is written like:

y'' = f(y, y')

The solution is to add more variables to your system, but the link will explain it more thoroughly.

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