Commit 7532fff9 authored by Mathieu RASSON's avatar Mathieu RASSON

Multifilamentation interface

parent 67875c83
# Multifilamentation integration
## Parameters for final integration
**To be checked with Info version**
delta_z = 2e-4
z_max = 4
r_max = 3e-3
n_r = 225
t_max = +- 3e-13
n_t = 450
## Use
The script multi_filamentation.py is implemented to run a heavy integration at high intensity, with a console interface to adjust r and t plots with other parameters fixed.
* Integration;
* Check plot of intensity to identify filamentation;
* Plots along t or r.
Recommended steps:
1. Use the check plot to localise filaments;
2. Plot along t to localise the multiple time pulses;
3. Plot along r with the precedent parameters;
4. Ajust grid if necessary.
**Warning:**
* Indices refers to table indices, integers;
* Plots grids are adapted with physical quantities (USI);
* Do not put extensions in saving names;
* **Input errors are not all treated. Be careful, or the script can crash and the integration data lost**.
......@@ -85,7 +85,7 @@ disp_coeff = -1j*k_2/2
# Integration parameters
delta_z = 2e-4
z_max = 4
z_max = 2e-2
n_z = int(z_max/delta_z)
#--------------- Solver ----------------
......@@ -100,11 +100,147 @@ 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,
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.save('multi_E.npy', crank.E_matrix)
print("End of solving")
#-----------------------------------------------
#------------ Analysis ------------------------
#-----------------------------------------------
# Check plot
E_max = 1/(c*mu) * np.array([np.amax(np.abs(crank.E_matrix[i,:,:])**2) for i in range(crank.n_z)])
plt.figure()
plt.plot(E_max)
plt.xlabel("Propagation index")
plt.ylabel("Intensity ($W \cdot m^{-2}$)")
plt.savefig("FCN_check_E.png", dpi=300)
print("Check plot saved as: FCN_check_E.png")
# Interaction for analysis
# Choice beteween radial and time plots
# Time needs to be set first to chose peak for radial
# Loop for multiple choices
end = False
while not end:
# Possible entry check
correct_enter = False
# Loop entry until correct
print("Radial (radius) or Time (time) plot?")
while not correct_enter:
type_plot = input()
# Repeat if mistaken
if type_plot in ["radius", "time"]:
correct_enter = True
else:
print("Type radius or time")
# Radial plot
if type_plot == "radius":
# Parameters
print("Propagation index to be plotted? (between 0 and " + str(crank.n_z-1) + ")")
z_plot = int(input())
print("Time index to be plotted? (between 0 and " + str(crank.n_t-1) + ")")
t_plot = int(input())
# Saving name
print("Name of saved plot?")
save_name = input()
# Grid parameters
print("Set grid? (yes / no)")
check_grid = input()
if check_grid == "yes":
# Set parameters
print("Type r_min:")
r_min = float(input())
print("Type r_max:")
r_max = float(input())
# Plot
plt.figure()
plt.plot(np.real(crank.r_pts), 1/(c*mu) * np.abs(crank.E_matrix[z_plot, :, t_plot])**2)
plt.xlim(r_min, r_max)
plt.xlabel("Radius (m)")
plt.ylabel("Intensity ($W \cdot m^{-2}$)")
plt.savefig(save_name + ".png", dpi=300)
print("Radial plot saved as: " + save_name + ".png")
else:
# Plot
plt.figure()
plt.plot(np.real(crank.r_pts), 1/(c*mu) * np.abs(crank.E_matrix[z_plot, :, t_plot])**2)
plt.xlabel("Radius (m)")
plt.ylabel("Intensity ($W \cdot m^{-2}$)")
plt.savefig(save_name + ".png", dpi=300)
print("Radial plot saved as: " + save_name + ".png")
# Time plot
if type_plot == "time":
# Parameters
print("Propagation index to be plotted? (between 0 and " + str(crank.n_z-1) + ")")
z_plot = int(input())
print("Radius index to be plotted? (between 0 and " + str(crank.n_r-1) + ")")
r_plot = int(input())
# Saving name
print("Name of saved plot?")
save_name = input()
# Grid parameters
print("Set grid? (yes / no)")
check_grid = input()
if check_grid == "yes":
# Set parameters
print("Type t_min:")
t_min = float(input())
print("Type t_max:")
t_max = float(input())
# Plot
plt.figure()
plt.plot(np.real(crank.t_pts), 1/(c*mu) * np.abs(crank.E_matrix[z_plot, r_plot, :])**2)
plt.xlim(t_min, t_max)
plt.xlabel("Time (s)")
plt.ylabel("Intensity ($W \cdot m^{-2}$)")
plt.savefig(save_name + ".png", dpi=300)
print("Time plot saved as: " + save_name + ".png")
else:
# Plot
plt.figure()
plt.plot(np.real(crank.t_pts), 1/(c*mu) * np.abs(crank.E_matrix[z_plot, r_plot, :])**2)
plt.xlabel("Time (s)")
plt.ylabel("Intensity ($W \cdot m^{-2}$)")
plt.savefig(save_name + ".png", dpi=300)
print("Time plot saved as: " + save_name + ".png")
# Set end
print("Another plot? (yes / no)")
check_other = input()
if check_other == "no":
end = True
print("End of Analysis")
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment