Yura Paniv
Yura Paniv

Reputation: 3

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.
P.S. Sorry for not posting images, I've just registered.

Upvotes: 0

Views: 1612

Answers (1)

spamduck
spamduck

Reputation: 351

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.

Upvotes: 1

Related Questions