File:Van der pols equation phase portrait.svg

Summary

Description
English: Phase portrait of Van der Pol oscillator. Created in python using scipy, numpy and matplotlib libraries.
Date
Source Own work
Author Krishnavedala
Other versions File:Van_der_pols_equation_phase_portrait.jpg and w:File:Vdppp.jpg
SVG development
InfoField
Source code
InfoField

Python code

Source code
from numpy import *
from scipy import *
from scipy.integrate import odeint
from matplotlib.pyplot import *
from mpl_toolkits.axes_grid.axislines import SubplotZero

def myFun(u,t=0.,mu=.5):
	x = u[0]
	v = u[1]
	dx = v
	dv = mu*(1.-x**2)*v-x
	return (dx,dv)

t = linspace(-5.5,5.5,300)
u0 = array([1.,1.])
mu = [.1, .2, .5, 1., 1.5, 2.0]
fig = figure(figsize=(5.5,7))
ax = SubplotZero(fig,111)
fig.add_subplot(ax)
ax.grid(True)
for direction in ["right","top"]:
        ax.axis[direction].set_visible(False)
for m in mu:
	u = odeint(myFun,u0,t,args=(m,))
	ax.plot(u[:,0],u[:,1],lw=1.5,label=r'$\mu=%.1f$'%m)
x = linspace(-3,3,15)
y = linspace(-4,4,15)
x,y = meshgrid(x,y)
X,Y = myFun([x,y])
M = (hypot(X,Y))
M[M==0]=1.
X,Y = X/M, Y/M
ax.quiver(x,y,X,Y,M,pivot='mid',cmap=cm.jet)
ax.minorticks_on()
ax.legend(handletextpad=0,loc='upper left')
setp(ax.get_legend().get_texts(),fontsize=12)
fig.savefig("Van_der_pols_equation_phase_portrait.svg",bbox_inches="tight",\
        pad_inches=.15)

Licensing

I, the copyright holder of this work, hereby publish it under the following licenses:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
Category:CC-BY-SA-3.0#Van%20der%20pols%20equation%20phase%20portrait.svg
GNU head Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled GNU Free Documentation License.
Category:License migration redundant#Van%20der%20pols%20equation%20phase%20portrait.svgCategory:GFDL#Van%20der%20pols%20equation%20phase%20portrait.svg
You may select the license of your choice.
Category:Self-published work Category:Van der Pol oscillator Category:Phase plots Category:Images with Python source code Category:SVG created with Matplotlib Category:Vector fields
Category:CC-BY-SA-3.0 Category:GFDL Category:Images with Python source code Category:License migration redundant Category:Phase plots Category:SVG created with Matplotlib Category:Self-published work Category:Valid SVG created with Matplotlib code Category:Van der Pol oscillator Category:Vector fields