473,321 Members | 1,708 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

how to solve Van der Pol equation using 'odeint'

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,
Expand|Select|Wrap|Line Numbers
  1. #! /usr/bin/python
  2. # Filename:vaderpol.py
  3.  
  4.  
  5. from scipy import *
  6. from pylab import *
  7. u=0.1
  8. deriv= lambda y,t :array([y[1],y[0]-u*(y[0]**2-1)*y[1]])
  9.  
  10. start=0
  11. end=20000
  12. numsteps=100000
  13. time=linspace(start,end,numsteps)
  14. from scipy import integrate
  15. y0=array([0.01,0.0])
  16. y=integrate.odeint(deriv,y0,time,hmax=0.2,hmin=0.001)
  17. plot(time,y[:,0])
  18. show()
Mar 1 '08 #1
1 4942
NeoPa
32,556 Expert Mod 16PB
I'm assuming this is a Python question so moved it over. I found it in the Cafe.
Mar 1 '08 #2

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

Similar topics

17
by: Just | last post by:
While googling for a non-linear equation solver, I found Math::Polynomial::Solve in CPAN. It seems a great little module, except it's not Python... I'm especially looking for its poly_root()...
5
by: FLChamp | last post by:
I was wondering what numerical method the odeint function is based on. I have checked the documentation but couldnt find anything. I would be very grateful if someone could answer this question for...
9
by: Stud Muffin | last post by:
Hey Basically, I'm trying to take objects created in microsoft word using equation editor (for creating clean looking math/physics equations) and putting them into some sort of webpage format....
27
by: John Salerno | last post by:
Ok, here's a problem I've sort of assigned to myself for fun, but it's turning out to be quite a pain to wrap my mind around. It's from a puzzle game. It will help if you look at this image: ...
7
by: sptutx | last post by:
Write a C program that uses Newton's Method to solve an equation in one variable. Try solving x^x = ln2 the deriviative of x^x is x^x(lnx + 1). The 'ln' function in C is log(), and the...
6
by: Trev17 | last post by:
Hello, I am new to C++ and i have tried for several hours to make a program my teacher has given me as a lab. Here is the Lab question: the roots of the quadratic equation ax^2 + bx + c = 0, a...
2
by: beambohus | last post by:
please how do i solve this........ To write an algorithm to solve quadratic equation using almighty formular. please your respond will very much appreciated
0
by: yingzaji | last post by:
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...
2
by: purple | last post by:
Could you guys do me a favor for solving a equation set? Z=d/4*(1-SIN(X)/X) X=8q/(D^2*Y)+SIN(X) Y=1/n*Z^(2/3)*i^(1/2) In this equation set, X,Y&Z are the unkown parameters, the others say,...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.