#!/usr/bin/env python # -*- coding: utf-8 -*- """ Tracé des solutions kink et antikink de l'équation de sine-Gordon """ __author__ = "Dominique Lefebvre" __copyright__ = "Copyright 2020 - TangenteX.com" __version__ = "1.0" __date__ = "17 mars 2020" __email__ = "dominique.lefebvre@tangentex.com" from scipy import arange, arctan, exp, sqrt, pi from matplotlib.pylab import figure,plot,grid, title, xlabel, ylabel, legend # paramètres spatiaux l = 10.0 dx = 0.05 Nx = int(l/dx) x = (arange(Nx) - Nx/2.)*dx # paramètres temporels T = 10.0 dt = 0.05 Nt = int(T/dt) t = arange(Nt)*dt # paramètre du soliton z0 = 0. c0 = 1.0 omega0 = 5.0 # définition de la vitesse du soliton v = 0.01 D = (c0/omega0)*sqrt(1 - (v/c0)**2) # définition de la solution soliton (kink) def kink(z,z0): k = 4*arctan(exp((z - z0)/D)) return k # définition de la solution antisoliton (antikink) def antikink(z,z0): k = 4*arctan(exp(-(z - z0)/D)) return k # calcul des solutions kink et antikink z = x - v*t SolKink = kink(z,z0) SolAntiKink = antikink(z,z0) # Tracé des solutions kink et antikink fig1 = figure(figsize=(10,8)) grid(True) title(u'Soliton de sine-Gordon') xlabel(u'z') ylabel(r'$\theta/2\pi$') plot(z,SolKink/(2*pi),'r', label = 'kink') plot(z,SolAntiKink/(2*pi),'b', label = 'antikink') legend(loc='upper right')