Commit 16c378a1 authored by Antoine RAVETTA's avatar Antoine RAVETTA

Merge remote-tracking branch 'origin/master'

parents 949a1c9f e430cf44
......@@ -81,7 +81,7 @@
"#tp = 1\n",
"Pcr = 1.8e9\n",
"#Pin = 5 * Pcr\n",
"Pin = 2*Pcr\n",
"Pin = 6*Pcr\n",
"\n",
"# Dispersion\n",
"k = 2 * np.pi / lambd\n",
......@@ -143,13 +143,13 @@
"metadata": {},
"outputs": [],
"source": [
"delta_z = 3e-4\n",
"z_max = 4\n",
"delta_z = 2e-4\n",
"z_max = 3\n",
"n_z = int(z_max/delta_z)\n",
"\n",
"crank = CrankNicolsonFilamentation()\n",
"\n",
"crank.set_grid(r_max=4e-3, n_r=300, z_min=0, z_max=z_max, n_z=n_z, t_min=-4e-13, t_max=4e-13, n_t=600)\n",
"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)\n",
"crank.set_parameters(Dr=diff_coeff, Dt=disp_coeff, V=potential, ofi=ofi, ava=ava ,K=K, sigma=sigma, \\\n",
" omega0=omega0, tau=tau, f=kerr_MPA)\n",
"\n",
......@@ -366,13 +366,13 @@
"# Field squared at given z,t along r\n",
"\n",
"plt.figure()\n",
"p1, = plt.plot(1000*np.real(crank.r_pts), 1/(c*mu)*np.abs(crank.E_matrix[7800,:,295])**2)\n",
"p2, = plt.plot(1000*np.real(crank.r_pts), 1/(c*mu)*np.abs(crank.E_matrix[7800,:,276])**2)\n",
"p1, = plt.plot(1000*np.real(crank.r_pts), 1/(c*mu)*np.abs(crank.E_matrix[9000,:,232])**2)\n",
"p2, = plt.plot(1000*np.real(crank.r_pts), 1/(c*mu)*np.abs(crank.E_matrix[9000,:,271])**2)\n",
"plt.xlim(-0.01, 1)\n",
"plt.xlabel('Radius (mm)')\n",
"plt.ylabel('Intensity ($W \\cdot m^{-2}$)')\n",
"plt.legend((p1, p2), ('Between pulses', 'On pulse'))\n",
"#plt.savefig('field_radius_2P.png', dpi=300)\n",
"#plt.savefig('field_radius3rd_6P.png', dpi=300)\n",
"plt.show()"
]
},
......@@ -386,14 +386,14 @@
"\n",
"plt.figure()\n",
"#plt.plot(np.log(np.abs(E[8300,0,:])**2))\n",
"p1, = plt.plot(1e15*np.real(crank.t_pts), 1/(c*mu)*np.abs(crank.E_matrix[7500,0,:])**2)\n",
"p2, = plt.plot(1e15*np.real(crank.t_pts), 1/(c*mu)*np.abs(crank.E_matrix[7900,0,:])**2)\n",
"p3, = plt.plot(1e15*np.real(crank.t_pts), 1/(c*mu)*np.abs(crank.E_matrix[8300,0,:])**2)\n",
"plt.xlim(-100, 100)\n",
"p1, = plt.plot(1e15*np.real(crank.t_pts), 1/(c*mu)*np.abs(crank.E_matrix[5000,0,:])**2)\n",
"p2, = plt.plot(1e15*np.real(crank.t_pts), 1/(c*mu)*np.abs(crank.E_matrix[7500,0,:])**2)\n",
"p3, = plt.plot(1e15*np.real(crank.t_pts), 1/(c*mu)*np.abs(crank.E_matrix[9000,0,:])**2)\n",
"#plt.xlim(50, 75)\n",
"plt.xlabel('Time (fs)')\n",
"plt.ylabel('Intensity ($W \\cdot m^{-2}$)')\n",
"plt.legend((p1, p2, p3), ('First maximum', 'Minimum', 'Second maximum'))\n",
"#plt.savefig('field_time_2P.png', dpi=300)\n",
"plt.legend((p1, p2, p3), ('First filament', 'Second filament', 'Third filament'))\n",
"#plt.savefig('field_time_6P.png', dpi=300)\n",
"plt.show()"
]
},
......
......@@ -38,9 +38,13 @@ def kerr_MPA(E):
#-----------------------------------------------
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mat
from FCN import CrankNicolsonFilamentation
# Set backend
mat.use('Agg')
import matplotlib.pyplot as plt
#-----------------------------------------------
#------------ Parameters ------------------------
......@@ -85,7 +89,7 @@ disp_coeff = -1j*k_2/2
# Integration parameters
delta_z = 2e-4
z_max = 2e-2
z_max = 3
n_z = int(z_max/delta_z)
#--------------- Solver ----------------
......@@ -112,11 +116,11 @@ print("End of solving")
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)
fig, ax = plt.subplots()
ax.plot(E_max)
ax.set_xlabel("Propagation index")
ax.set_ylabel("Intensity ($W \cdot m^{-2}$)")
fig.savefig("FCN_check_E.png", dpi=300)
print("Check plot saved as: FCN_check_E.png")
......@@ -170,23 +174,23 @@ while not end:
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)
fig, ax = plt.subplots()
ax.plot(np.real(crank.r_pts), 1/(c*mu) * np.abs(crank.E_matrix[z_plot, :, t_plot])**2)
ax.set_xlim(r_min, r_max)
ax.set_xlabel("Radius (m)")
ax.set_ylabel("Intensity ($W \cdot m^{-2}$)")
fig.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)
fig, ax = plt.subplots()
ax.plot(np.real(crank.r_pts), 1/(c*mu) * np.abs(crank.E_matrix[z_plot, :, t_plot])**2)
ax.set_xlabel("Radius (m)")
ax.set_ylabel("Intensity ($W \cdot m^{-2}$)")
fig.savefig(save_name + ".png", dpi=300)
print("Radial plot saved as: " + save_name + ".png")
......@@ -216,23 +220,23 @@ while not end:
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)
fig, ax = plt.subplots()
ax.plot(np.real(crank.t_pts), 1/(c*mu) * np.abs(crank.E_matrix[z_plot, r_plot, :])**2)
ax.set_xlim(t_min, t_max)
ax.set_xlabel("Time (s)")
ax.set_ylabel("Intensity ($W \cdot m^{-2}$)")
fig.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)
fig, ax = plt.subplots()
ax.plot(np.real(crank.t_pts), 1/(c*mu) * np.abs(crank.E_matrix[z_plot, r_plot, :])**2)
ax.set_xlabel("Time (s)")
ax.set_ylabel("Intensity ($W \cdot m^{-2}$)")
fig.savefig(save_name + ".png", dpi=300)
print("Time plot saved as: " + save_name + ".png")
......
......@@ -15,3 +15,7 @@ Integration data are saved in .npy files thanks to the save function of Numpy. T
## Filamentation Loop
In order to integrate the filamentation equation for various input powers, the script /codes/production/CN_classes/filamentation_loop.py can be run. A list of entire multiples of the critical power can be chosen and filamentation is calculated with those values. Resulting matrices are not stored but plots of maximum field intensity and charge density are saved.
## Multifilamentation
In order to integrate the filamentation equation for high input powers on an external computer, the script /codes/production/CN_classes/multi_filamentation.py can be run. It contains a simple console interface which makes it possible to adjust plots without using Jupyter graphic interface.
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