# -*- coding: utf-8 -*- """ Created on Sat Sep 6 08:43:08 2014 @author: larat """ import pylab as py import numpy as np close('all') N = 100 nu = 0.33 theta = np.linspace(0,2*np.pi,N+1) E = np.exp(theta*1j) Delta = (-2+10*E+E*E)*nu**2 LambdaPlus = -2*nu-nu*E+np.sqrt(Delta) LambdaMoins = -2*nu-nu*E-np.sqrt(Delta) NPrecis = 4*N ThetaPrecis = np.roll(np.arange(NPrecis)*2*np.pi/NPrecis,-1) EPrecis = np.exp(ThetaPrecis*1j) FE = EPrecis -1.0 RK2 = np.zeros(NPrecis)+1j RK2[:NPrecis/2] = np.sqrt(-1-2*EPrecis[::2])-1.0 RK2[NPrecis/2:] = -np.sqrt(-1-2*EPrecis[::2])-1.0 #RK2[NPrecis/2+1:] = -np.sqrt(-1-2*EPrecis[::2])-1.0 #RK2 = np.sqrt(-1-2*np.exp(1j*np.linspace(0,4*np.pi,NPrecis+1)))-1.0 py.plot(np.real(LambdaPlus),np.imag(LambdaPlus),label='LambdaPlus') py.plot(np.real(LambdaMoins),np.imag(LambdaMoins),label='LambdaMoins') py.plot(np.real(FE),np.imag(FE),label='FE') py.plot(np.real(RK2),np.imag(RK2),label='RK2') py.legend()