Ejemplo n.º 1
0
def plot_3d():
	from numpy import array
	from stark import stark
	import matplotlib.pyplot as plt
	from mpl_toolkits.mplot3d import Axes3D
	from pylab import xlabel, ylabel, xlim, ylim, subplot, title, rc, linspace, plot, xticks, yticks, grid
	rc('text', usetex=True)
	npoints = 1000
	fig = plt.figure()
	ax = fig.add_subplot(121, projection='3d')
	s = stark(.08,[1.,0.,.05],[0,1,.02])
	title(r'(a)')
	r = linspace(0,s.T_xi*2,npoints)
	states = array([s.cart_state(tau) for tau in r])
	ax.plot([_.real for _ in states[:,0]],[_.real for _ in states[:,1]],[_.real for _ in states[:,2]],'k-',linewidth=2)
	ax.set_zlim(0,0.3)
	ax = fig.add_subplot(122, projection='3d')
	s = stark(.1793,[1.,0.,.05],[0,1,.02])
	title(r'(b)')
	r = linspace(0,s.T_xi*2,npoints)
	states = array([s.cart_state(tau) for tau in r])
	ax.plot([_.real for _ in states[:,0]],[_.real for _ in states[:,1]],[_.real for _ in states[:,2]],'k-',linewidth=2)
Ejemplo n.º 2
0
def plot_quasi_periodic():
	from numpy import array
	from stark import stark
	import matplotlib.pyplot as plt
	from mpl_toolkits.mplot3d import Axes3D
	from pylab import xlabel, ylabel, xlim, ylim, subplot, title, rc, linspace, plot, xticks, yticks, grid
	rc('text', usetex=True)
	npoints = 1000
	x0,v0,eps = [1.0, 0, 6.123233995736766e-17],[-0.2833431329044651, 0.8928727330044925, 0.34957175101847515],0.0612722970737
	s = stark(eps,x0,v0)
	T = 3.4589043219148699*5
	r = linspace(0,T*3,npoints)
	states = array([s.cart_state(_) for _ in r])
	fig = plt.figure()
	ax = fig.add_subplot(121, projection='3d')
	title(r'(a)')
	ax.plot([_.real for _ in states[:,0]],[_.real for _ in states[:,1]],[_.real for _ in states[:,2]],'k-',linewidth=2)
	ax = fig.add_subplot(122, projection='3d')
	title(r'(b)')
	ax.plot([_.real for _ in states[:,0]],[_.real for _ in states[:,1]],[_.real for _ in states[:,2]],'k-',linewidth=2)
Ejemplo n.º 3
0
def plot_periodic():
	from mpmath import mpf
	from numpy import array
	from stark import stark
	import matplotlib.pyplot as plt
	from mpl_toolkits.mplot3d import Axes3D
	from pylab import xlabel, ylabel, xlim, ylim, subplot, title, rc, linspace, plot, xticks, yticks, grid
	rc('text', usetex=True)
	npoints = 2000
	x0,v0,eps =  [1.0, 0, 6.123233995736766e-17], [0.020495878242533995, 1.1180786341556543, 0.05717527804838409], 0.080969489037
	s = stark(eps,x0,v0)
	T =  43.335885307166
	r = linspace(0,T,npoints)
	states = array([s.cart_state(_) for _ in r])
	fig = plt.figure()
	ax = fig.add_subplot(121, projection='3d')
	title(r'(a)')
	ax.plot([_.real for _ in states[:,0]],[_.real for _ in states[:,1]],[_.real for _ in states[:,2]],'k-',linewidth=2)
	ax = fig.add_subplot(122, projection='3d')
	title(r'(b)')
	ax.plot([_.real for _ in states[:,0]],[_.real for _ in states[:,1]],[_.real for _ in states[:,2]],'k-',linewidth=2)
Ejemplo n.º 4
0
def plot_bound_vs_unbound():
	from pylab import xlabel, ylabel, xlim, ylim, subplot, title, rc, linspace, plot, xticks, yticks, grid
	from stark import stark
	rc('text', usetex=True)
	npoints = 1000
	s = stark(.07,[1.,1.,.3],[.1,.4,.6])
	r = linspace(-s.T_xi*2,s.T_xi*2,npoints)
	subplot(241)
	title(r'(a)')
	plot(r,[s.xi(tau).real for tau in r],'k-',linewidth=2)
	xlabel(r'$\tau$')
	ylabel(r'$\xi\left(\tau\right)$')
	xticks([0],[''])
	yticks([0],[''])
	xlim(float(r[0]),float(r[-1]))
	#ylim(-.1,4)
	grid()
	subplot(242)
	title(r'(b)')
	plot(r,[s.eta(tau).real for tau in r],'k-',linewidth=2)
	xlabel(r'$\tau$')
	ylabel(r'$\eta\left(\tau\right)$')
	xticks([0],[''])
	yticks([0],[''])
	xlim(float(r[0]),float(r[-1]))
	#ylim(-.1,4)
	grid()
	subplot(243)
	title(r'(c)')
	plot(r,[s.phi(tau).real for tau in r],'k-',linewidth=2)
	xlabel(r'$\tau$')
	ylabel(r'$\phi\left(\tau\right)$')
	xticks([0],[''])
	yticks([0],[''])
	xlim(float(r[0]),float(r[-1]))
	#ylim(-.1,4)
	grid()
	subplot(244)
	title(r'(d)')
	plot(r,[s.t(tau).real for tau in r],'k-',linewidth=2)
	xlabel(r'$\tau$')
	ylabel(r'$t\left(\tau\right)$')
	xticks([0],[''])
	yticks([0],[''])
	xlim(float(r[0]),float(r[-1]))
	#ylim(-.1,4)
	grid()
	s = stark(.1,[1.,1.,.3],[.1,.4,.6])
	r = linspace(-s.T_xi*2,s.T_xi*2,npoints)
	subplot(245)
	title(r'(e)')
	plot(r,[s.xi(tau).real for tau in r],'k-',linewidth=2)
	xlabel(r'$\tau$')
	ylabel(r'$\xi\left(\tau\right)$')
	xticks([0],[''])
	yticks([0],[''])
	xlim(float(r[0]),float(r[-1]))
	#ylim(-.1,4)
	grid()
	subplot(246)
	title(r'(f)')
	plot(r,[s.eta(tau).real for tau in r],'k-',linewidth=2)
	xlabel(r'$\tau$')
	ylabel(r'$\eta\left(\tau\right)$')
	xticks([0],[''])
	yticks([0],[''])
	xlim(float(r[0]),float(r[-1]))
	#ylim(-.1,4)
	grid()
	subplot(247)
	title(r'(g)')
	plot(r,[s.phi(tau).real for tau in r],'k-',linewidth=2)
	xlabel(r'$\tau$')
	ylabel(r'$\phi\left(\tau\right)$')
	xticks([0],[''])
	yticks([0],[''])
	xlim(float(r[0]),float(r[-1]))
	#ylim(-.1,4)
	grid()
	subplot(248)
	title(r'(h)')
	plot(r,[s.t(tau).real for tau in r],'k-',linewidth=2)
	xlabel(r'$\tau$')
	ylabel(r'$t\left(\tau\right)$')
	xticks([0],[''])
	yticks([0],[''])
	xlim(float(r[0]),float(r[-1]))
	#ylim(-.1,4)
	grid()