Commit 6ffe76f2 by Mathieu RASSON

### Multifilamentation script

parent 5cd20043
 #----------------------------------------------- #------------ Functions ------------------------ #----------------------------------------------- def potential(r): try: return diff_coeff / r except ZeroDivisionError: return 0 def gaussian(r, t, r0=0, w0=1, t0=0, tp=1, Pin=1): return np.sqrt(2*Pin/(np.pi*w0**2)) * np.exp(-(r-r0)** 2/(w0**2) - (t-t0)** 2/(tp**2)) def initial_enveloppe(r_pts, t_pts, w0, tp, Pin): return np.array([[gaussian(r_pts[i], t_pts[j], w0=w0, tp=tp, Pin=Pin) for j in range(len(t_pts))] \ for i in range(len(r_pts))]) #----- Non linearities -------------- def kerr(E): return 1j * k * n2 * np.abs(E)**2 * E def answer(t): pass def kerr_delay(E): pass def kerr_MPA(E): return 1j*k*n2*np.abs(E)**2 * E - beta/2 * np.abs(E)**(2*K-2) * E #----------------------------------------------- #------------ Imports ------------------------ #----------------------------------------------- import numpy as np import matplotlib.pyplot as plt from FCN import CrankNicolsonFilamentation #----------------------------------------------- #------------ Parameters ------------------------ #----------------------------------------------- # Physics c = 3e8 mu = 4*np.pi*1e-7 # Beam lambd = 0.7e-6 # 0.775e-6 w0 = 1e-3 # 0.7e-3 tp = 85e-15 Pcr = 1.7e9 # Dispersion k = 2 * np.pi / lambd k_2 = 2e-28 # 0.2e-28 # Kerr Effect n2 = 5.57e-23 # MPA K = 7 beta = 6.5e-104 # Density omega0 = k * c ofi = 8.84e-71/omega0 ava = 2.9e-6 sigma = 5.1e-24 tau = 3.5e-13 # CN parameters diff_coeff = 1j*1/(2 * k) disp_coeff = -1j*k_2/2 #----------------------------------------------- #------------ Instantiation ------------------------ #----------------------------------------------- # Integration parameters delta_z = 2e-4 z_max = 4 n_z = int(z_max/delta_z) #--------------- Solver ---------------- # Initial power Pin = 6*Pcr # Instantiation crank = CrankNicolsonFilamentation() crank.set_grid(r_max=3e-3, n_r=225, z_min=0, z_max=z_max, n_z=n_z, t_min=-3e-13, t_max=3e-13, n_t=450) crank.set_parameters(Dr=diff_coeff, Dt=disp_coeff, V=potential, ofi=ofi, ava=ava, K=K, sigma=sigma, omega0=omega0, tau=tau, f=kerr_MPA) crank.solve(initial_enveloppe(crank.r_pts, crank.t_pts, w0, tp, Pin)) #------------ Save ------------------ np.savetxt('multi_E.dat', crank.E_matrix)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!