import numpy as np import matplotlib.pyplot as plt c = 3e8 l0 = 1e-9 t0 = l0/c x = np.arange(-5, 5, 0.1) y = np.arange(-5, 5, 0.1) xx, yy = np.meshgrid(x, y, sparse=True) z = np.sin(xx**2 + yy**2) / (xx**2 + yy**2) h = plt.contourf(x,y,z) plt.show()

import numpy as np import matplotlib.pyplot as plt import math c=3e8 l0 = 1e-9 t0 = l0/c sigma = l0 z = np.linspace(-5*l0,5 *l0, 100) Ez=np.exp(-0.5*(z/sigma)*(z/sigma)) plt.plot(z,Ez)

t = np.linspace(-5*t0,5*t0, 100) Et=np.exp(-0.5*((c*t)/sigma)*((c*t)/sigma)) plt.plot(t,Et)

zz, tt = np.meshgrid(z, t, sparse=True) E = np.exp( -(0.5/(sigma*sigma))*(zz-c*tt)*(zz-c*tt)) plt.contourf(z,t,E)
