A question about using odeint to solve Van der Pol equation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • yingzaji
    New Member
    • Mar 2008
    • 2

    A question about using odeint to solve Van der Pol equation

    hi
    I was wondering about the odeint function in scipy.
    While I was solving the Van der pol equations, I found the function odeint
    is not suitable. I know there are some differences between Runge-kutta method and RKF method, and only the RKF method can be used to solve the Van der Pol system.
    But what should I do by the scipy function 'odeint'?
    Thanks a lot!

    The python program is given as follow,



    #! /usr/bin/python
    # Filename:vaderp ol.py


    from scipy import *
    from pylab import *
    u=0.1
    deriv= lambda y,t :array([y[1],y[0]-u*(y[0]**2-1)*y[1]])

    start=0
    end=20000
    numsteps=100000
    time=linspace(s tart,end,numste ps)
    from scipy import integrate
    y0=array([0.01,0.0])
    y=integrate.ode int(deriv,y0,ti me,hmax=0.2,hmi n=0.0 01)
    plot(time,y[:,0])
    show()
Working...