Commit 02bdfdc9 authored by Antoine RAVETTA's avatar Antoine RAVETTA

work on the HSCN

parent 54726ff3
......@@ -3,9 +3,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
......@@ -14,10 +12,11 @@
"lambd = 0.7e-6\n",
"\n",
"k = 2 * np.pi / lambd\n",
"k_2 = 2e-28\n",
"#k_2 = 2e-28\n",
"k_2 = 2e-30\n",
"\n",
"w0 = 1e-3\n",
"tp = 17e-15\n",
"tp = 17e-16\n",
"#tp = 1\n",
"Pin = 1\n",
"\n",
......@@ -51,14 +50,12 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"crank = CrankNicolsonDisp()\n",
"\n",
"crank.set_grid(r_max=1e-2, n_r=100, z_min=0, z_max=10, n_z=100, t_min=-5e-13, t_max=5e-13, n_t=100)\n",
"crank.set_grid(r_max=1e-2, n_r=100, z_min=0, z_max=10, n_z=100, t_min=-5e-14, t_max=5e-14, n_t=400)\n",
"crank.set_parameters(Dr=diff_coeff, Dt=disp_coeff, V=potential)\n",
"\n",
"crank.solve(initial_enveloppe(crank.r_pts, crank.t_pts, w0, tp, Pin))"
......@@ -67,9 +64,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"np.save(\"../HSCN_E.npy\", np.abs(crank.E_matrix))\n",
......@@ -81,9 +76,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": []
}
......@@ -104,7 +97,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
"version": "3.7.3"
}
},
"nbformat": 4,
......
......@@ -25,8 +25,8 @@
" fig, ax = plt.subplots(figsize=(15,7))\n",
" mesh = ax.pcolormesh(z_pts, r_pts, E_matrix)\n",
" ax.set_title(\"Diffraction of a gaussian beam propagating along z and starting from (r,z) = (0,0)\", size=20)\n",
" ax.set_xlabel('z', size=20)\n",
" ax.set_ylabel('r', size=20)\n",
" ax.set_xlabel('z (m)', size=20)\n",
" ax.set_ylabel('r (m)', size=20)\n",
" ax.set_ylim([-0.005, 0.005])\n",
" plt.colorbar(mesh, ax=ax)\n",
" fig.show()"
......
......@@ -11,6 +11,13 @@
"TODO : make a movie out of it"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Imports"
]
},
{
"cell_type": "code",
"execution_count": null,
......@@ -22,7 +29,15 @@
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"import matplotlib.animation as animation\n",
"from mpl_toolkits.axes_grid1 import make_axes_locatable"
"from mpl_toolkits.axes_grid1 import make_axes_locatable\n",
"from scipy.optimize import curve_fit"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Load Data"
]
},
{
......@@ -45,6 +60,13 @@
"E_matrix, r_pts, z_pts, t_pts = import_data(data_path)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Evolution of the intensity in the middle of the beam along z against t"
]
},
{
"cell_type": "code",
"execution_count": null,
......@@ -62,6 +84,13 @@
"ani = animation.FuncAnimation(fig, update, frames=E_matrix.shape[2], interval=100, repeat=True)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Maximum of the central intensity against t"
]
},
{
"cell_type": "code",
"execution_count": null,
......@@ -73,6 +102,13 @@
"ax.plot(t_pts, [max(E_matrix[:,0,i]) for i in range(len(t_pts))])"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Study of the data"
]
},
{
"cell_type": "code",
"execution_count": null,
......@@ -82,6 +118,192 @@
"full_r_pts = np.concatenate((np.flip(-r_pts), r_pts))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Functions to be fitted"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"def gaussian(x, sigma, amplitude):\n",
" return amplitude * np.exp(-x ** 2 / (2 * sigma ** 2))\n",
"\n",
"def gaussian_temp(t, w0=1, tp=1, Pin=1):\n",
" return np.sqrt(2*Pin/(np.pi*w0**2)) * np.exp(-t** 2/(tp**2))\n",
"\n",
"def gaussian_space(r, w0=1, Pin=1):\n",
" return np.sqrt(2*Pin/(np.pi*w0**2)) * np.exp(-r** 2/(w0**2))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Evolution of the wavepacket along t at r=0 against z"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"print(E_matrix[0,0,200])"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"fig, ax = plt.subplots(figsize=(8,8))\n",
"ax.plot(t_pts, E_matrix[0,0,:])\n",
"ax.set_title(\"Beam temporal extension at z=0\")\n",
"ax.set_xlabel('t (s)')\n",
"ax.set_ylabel('E (unit ??)')\n",
"\n",
"popt, pcov = curve_fit(gaussian_temp, t_pts, E_matrix[0,0,:], p0=[1e-3, 17e-16, 1])\n",
"ax.plot(t_pts, [gaussian_temp(t, *popt) for t in t_pts], '--')\n",
"\n",
"temp_sigmas = []\n",
" \n",
"\n",
"def update(i):\n",
" ax.cla()\n",
" ax.plot(t_pts, E_matrix[i,0,:])\n",
" ax.set_title(\"Beam temporal extension at z=%d\" %i)\n",
" ax.set_xlabel('t (s)')\n",
" ax.set_ylabel('E (unit ??)')\n",
" popt, pcov = curve_fit(gaussian_temp, t_pts, E_matrix[i,0,:], p0=[1e-3, 17e-16, 1])\n",
" ax.plot(t_pts, [gaussian_temp(t, *popt) for t in t_pts], '--')\n",
" temp_sigmas.append(popt[1])\n",
"\n",
" \n",
"ani = animation.FuncAnimation(fig, update, frames=E_matrix.shape[0], interval=100, repeat=False)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Check the theory of the evolution of the gaussian sigma\n",
"\n",
"We find a characteristic length which is 4 times smaller than expected\n",
"Bad theoretical definition 4 = 2 ** 2"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"fig, ax = plt.subplots()\n",
"\n",
"ax.plot(z_pts, temp_sigmas[1:])\n",
"\n",
"def func(x, a, c):\n",
" return c * np.sqrt(1 + a * x ** 2)\n",
"\n",
"popt, pcov = curve_fit(func, z_pts, temp_sigmas[1:])\n",
"\n",
"ax.plot(z_pts, [func(z, *popt) for z in z_pts], '--')\n",
"\n",
"print(popt)\n",
"print(1/np.sqrt(popt[0]))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"fig, ax = plt.subplots(figsize=(8,8))\n",
"ax.plot(full_r_pts, np.concatenate((np.flip(E_matrix[0,:,E_matrix.shape[2]//2], axis=0), E_matrix[0,:,E_matrix.shape[2]//2])))\n",
"ax.set_title(\"Beam spatial extension at z=0\")\n",
"ax.set_xlabel('r (m)')\n",
"ax.set_ylabel('E (unit ??)')\n",
"\n",
"popt, pcov = curve_fit(gaussian_space, full_r_pts, np.concatenate((np.flip(E_matrix[0,:,E_matrix.shape[2]//2], axis=0), E_matrix[0,:,E_matrix.shape[2]//2])), p0=[1e-3, 1])\n",
"ax.plot(full_r_pts, [gaussian_space(r, *popt) for r in full_r_pts], '--')\n",
"\n",
"space_sigmas = []\n",
"\n",
"def update(i):\n",
" ax.cla()\n",
" ax.plot(full_r_pts, np.concatenate((np.flip(E_matrix[i,:,E_matrix.shape[2]//2], axis=0), E_matrix[i,:,E_matrix.shape[2]//2])))\n",
" ax.set_title(\"Beam spatial extension at z=%d\" %i)\n",
" ax.set_xlabel('r (r)')\n",
" ax.set_ylabel('E (unit ??)')\n",
" popt, pcov = curve_fit(gaussian_space, full_r_pts, np.concatenate((np.flip(E_matrix[i,:,E_matrix.shape[2]//2], axis=0), E_matrix[i,:,E_matrix.shape[2]//2])), p0=[1e-3, 1])\n",
" ax.plot(full_r_pts, [gaussian_space(r, *popt) for r in full_r_pts], '--')\n",
" space_sigmas.append(popt[0])\n",
"\n",
" \n",
"ani = animation.FuncAnimation(fig, update, frames=E_matrix.shape[0], interval=100, repeat=False)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"fig, ax = plt.subplots()\n",
"\n",
"ax.plot(z_pts, space_sigmas[1:])\n",
"\n",
"def func(x, a, c):\n",
" return c * np.sqrt(1 + a * x ** 2)\n",
"\n",
"popt, pcov = curve_fit(func, z_pts, space_sigmas[1:])\n",
"\n",
"ax.plot(z_pts, [func(z, *popt) for z in z_pts], '--')\n",
"\n",
"print(popt)\n",
"print(1/np.sqrt(popt[0]))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"fig, ax = plt.subplots(figsize=(10,8))\n",
"cm = ax.pcolormesh(t_pts, full_r_pts, np.concatenate((np.flip(E_matrix[0,:,:], axis=0), E_matrix[0,:,:])))\n",
"ax.set_title(\"Beam spatio-temporal extension at z=0\")\n",
"ax.set_xlabel('t (s)')\n",
"ax.set_ylabel('r (m)')\n",
"fig.colorbar(cm)\n",
"\n",
"plt.savefig('diffraction_init.png')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"fig, ax = plt.subplots(figsize=(10,8))\n",
"cm = ax.pcolormesh(t_pts, full_r_pts, np.concatenate((np.flip(E_matrix[-1,:,:], axis=0), E_matrix[-1,:,:])))\n",
"ax.set_title(\"Beam spatio-temporal extension at z=10m\")\n",
"ax.set_xlabel('t (s)')\n",
"ax.set_ylabel('r (m)')\n",
"fig.colorbar(cm)\n",
"\n",
"plt.savefig('diffraction_end.png')"
]
},
{
"cell_type": "code",
"execution_count": null,
......@@ -89,7 +311,7 @@
"outputs": [],
"source": [
"fig, ax = plt.subplots()\n",
"ax.pcolormesh(t_pts, full_r_pts, np.concatenate((np.flip(E_matrix[0,:,:], axis=0), E_matrix[0,:,:])), cmap=plt.cm.RdBu)\n",
"ax.pcolormesh(t_pts, full_r_pts, np.concatenate((np.flip(E_matrix[0,:,:], axis=0), E_matrix[0,:,:])))\n",
"ax.set_title('Position=%d' % 0)\n",
"\n",
"div = make_axes_locatable(ax)\n",
......@@ -97,7 +319,7 @@
"\n",
"\n",
"def update(i):\n",
" cm = ax.pcolormesh(t_pts, full_r_pts, np.concatenate((np.flip(E_matrix[i,:,:], axis=0), E_matrix[i,:,:])), cmap=plt.cm.RdBu)\n",
" cm = ax.pcolormesh(t_pts, full_r_pts, np.concatenate((np.flip(E_matrix[i,:,:], axis=0), E_matrix[i,:,:])))\n",
" ax.set_title('Position=%d' % i)\n",
" cax.cla()\n",
" fig.colorbar(cm, cax=cax)\n",
......
This source diff could not be displayed because it is too large. You can view the blob instead.
figures/CCCN/CCCN.png

157 KB | W: | H:

figures/CCCN/CCCN.png

165 KB | W: | H:

figures/CCCN/CCCN.png
figures/CCCN/CCCN.png
figures/CCCN/CCCN.png
figures/CCCN/CCCN.png
  • 2-up
  • Swipe
  • Onion skin
figures/CCCN/check_theory_power.png

151 KB | W: | H:

figures/CCCN/check_theory_power.png

160 KB | W: | H:

figures/CCCN/check_theory_power.png
figures/CCCN/check_theory_power.png
figures/CCCN/check_theory_power.png
figures/CCCN/check_theory_power.png
  • 2-up
  • Swipe
  • Onion skin
figures/CCCN/check_theory_sigma.png

269 KB | W: | H:

figures/CCCN/check_theory_sigma.png

277 KB | W: | H:

figures/CCCN/check_theory_sigma.png
figures/CCCN/check_theory_sigma.png
figures/CCCN/check_theory_sigma.png
figures/CCCN/check_theory_sigma.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -281,17 +281,23 @@ We then have to check if our result matches the theoretical calculations. We thu
\begin{figure}[h]
\centering
\includegraphics[scale=0.3]{../figures/CCCN/check_theory_sigma.png}
\caption{TO FILL}
\caption{The data used to draw this graph is the same as the one used for the diffraction image}
\end{figure}
\begin{figure}[h]
\centering
\includegraphics[scale=0.3]{../figures/CCCN/check_theory_power.png}
\caption{TO FILL}
\caption{The data used to draw this graph is the same as the one used for the diffraction image}
\end{figure}
\subsection{Diffraction and Dispersion}
\paragraph{}
We then added the time dependency to the equation, thus going from a 2D problem to a 3D one. To visualize both the space diffraction
and the time dispersion, we coded some animations which can be found in the "analyse" folder, the file is called "data\_plot\_3D.ipynb".
\paragraph{}
If we just look at the value of $|E|$ in the $(r,t)$ plane for each position $z$, we clearly see that the time dispersion and the space diffraction occur on different and uncorrelated scales.
% Animation ?
% Two independent variation scales
......@@ -299,7 +305,7 @@ We then have to check if our result matches the theoretical calculations. We thu
\subsection{Kerr Effect}
% Kerr Collapse
% Comparison with theoretical P -> z_c(P)
% Comparison with theoretical P -> z_c(P) (loi marburger, attention ! marche pour Dt = 0)
\subsection{Filamentation}
......
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