By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,213 Members | 1,086 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,213 IT Pros & Developers. It's quick & easy.

A question about using odeint to solve Van der Pol equation

P: 2
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:vaderpol.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(start,end,numsteps)
from scipy import integrate
y0=array([0.01,0.0])
y=integrate.odeint(deriv,y0,time,hmax=0.2,hmin=0.0 01)
plot(time,y[:,0])
show()
Mar 1 '08 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.