"""Zu Aufgabe2: Bifurkatiosdiagramm Van der Pol Oszillator""" from scipy.integrate import odeint import numpy as np import pylab as pl k=1.0 omega=1.0 #Bifurkationsparameter A = np.linspace(-1,1, 100) # Van der Pol system def F(X, t): x, y = X return [y, -k*(x*x-a)*y-omega*omega*x] #Anfangsbedingungen x0 = 0.1 y0 = 0 dt = .01 #Zeitschritt tmax=15000 t = np.linspace(0, tmax, tmax/dt,endpoint=False) #print t maximum=[] for a in A: erg, info = odeint(F, (x0, y0), t, full_output=True) #Integration der DGL x, y = erg.transpose() # print int(1000/dt) #print x[int(1000/dt):] maximum.append(np.max(x[int(10000/dt):])) #Maximum suchen, ersten 100 Zeiteinheiten als Transiente betrachten #Plot pl.plot(A,maximum) pl.xlabel('$a$',size=25) pl.ylabel('$x$',size=25) pl.show()