Commit 7833e65b authored by Antoine RAVETTA's avatar Antoine RAVETTA

ready for merge

parents 6d64ba7e aa863ccc
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -29,9 +29,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
......@@ -169,7 +167,7 @@
},
{
"cell_type": "code",
"execution_count": 37,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
......@@ -189,10 +187,10 @@
" self.z_pts, self.delta_z = np.linspace(z_min, z_max, n_z, retstep=True, endpoint=False)\n",
" \n",
" # Parameters of the scheme\n",
" def set_parameters(self, D, V, f):\n",
" def set_parameters(self, D, V):\n",
" \n",
" # V has to be vectorised\n",
" self.D, self.V, self.f = D, V, f\n",
" self.D, self.V = D, V\n",
" \n",
" \n",
" \n",
......@@ -221,18 +219,11 @@
" B[0,1] = 2*sig\n",
" \n",
" # Propagate\n",
" E = E_init\n",
" E = E_init.copy()\n",
" for n in range(self.n_z):\n",
" self.E_matrix[n,:] = E\n",
" fE = self.f(E)\n",
" # Non linear term at origin\n",
" if n==0:\n",
" fE_old = fE\n",
" \n",
" # Non linear term with half sum\n",
" E = la.solve_banded((1,1),A, B.dot(E) + self.delta_z * (1.5 * fE - 0.5 * fE_old),\\\n",
" check_finite=False)\n",
" fE_old = fE\n",
" \n",
" E = la.solve_banded((1,1),A, B.dot(E), check_finite=False)\n",
" \n",
" \n",
" \n",
......@@ -283,15 +274,23 @@
},
{
"cell_type": "code",
"execution_count": 38,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"lambd = 628 * 10 ** -9\n",
"c = 299792458\n",
"lambd = 0.7e-6\n",
"\n",
"k = 2 * np.pi / lambd\n",
"\n",
"diff_coeff = 1j/(2 * k)\n",
"w0 = 1e-3\n",
"Pin = 1\n",
"\n",
"diff_coeff = 1j*1/(2 * k)\n",
"#diff_coeff = 0\n",
"#diff_coeff = 1e-4\n",
"\n",
"print('diff :', diff_coeff)\n",
"\n",
"\n",
"def potential(r):\n",
......@@ -301,12 +300,12 @@
" return 0\n",
"\n",
"\n",
"def gaussian(r, mu=0, sigma=1e-3, amplitude=1):\n",
" return amplitude * np.exp(-(r - mu) ** 2 / (2 * sigma ** 2))\n",
"def gaussian(r, r0=0, w0=1, Pin=1):\n",
" return np.sqrt(2*Pin/(np.pi*w0**2)) * np.exp(-(r-r0)** 2/(w0**2))\n",
"\n",
"\n",
"def initial_enveloppe(r_pts):\n",
" return gaussian(r_pts)"
"def initial_enveloppe(r_pts, w0, Pin):\n",
" return np.array([gaussian(r_pts[i], w0=w0, Pin=Pin) for i in range(len(r_pts))])"
]
},
{
......@@ -318,28 +317,16 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {},
"outputs": [
{
"ename": "NameError",
"evalue": "name 'CrankNicolson' is not defined",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-1-e251e79e49fb>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mcrank\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mCrankNicolson\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0mcrank\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mset_grid\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mr_max\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m0.005\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mn_r\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m100\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mz_min\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mz_max\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m20\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mn_z\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m200\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0mcrank\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mset_parameters\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mD\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mdiff_coeff\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mV\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mpotential\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mf\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mlambda\u001b[0m \u001b[0mx\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 5\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mNameError\u001b[0m: name 'CrankNicolson' is not defined"
]
}
],
"outputs": [],
"source": [
"crank = CrankNicolson()\n",
"\n",
"crank.set_grid(r_max=0.005, n_r=100, z_min=0, z_max=20, n_z=200)\n",
"crank.set_parameters(D=diff_coeff, V=potential, f=lambda x:0)\n",
"crank.set_grid(r_max=1e-2, n_r=100, z_min=0, z_max=10, n_z=100)\n",
"crank.set_parameters(D=diff_coeff, V=potential)\n",
"\n",
"crank.solve(initial_enveloppe(crank.r_pts))"
"crank.solve(initial_enveloppe(crank.r_pts, w0, Pin))"
]
},
{
......@@ -351,14 +338,74 @@
},
{
"cell_type": "code",
"execution_count": 50,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"np.savetxt(\"../../data/CN_cylindric_complex_E.dat\", np.abs(crank.E_matrix))\n",
"np.savetxt(\"../../data/CN_cylindric_complex_r_pts.dat\", crank.r_pts)\n",
"np.savetxt(\"../../data/CN_cylindric_complex_z_pts.dat\", crank.z_pts)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"mat = initial_enveloppe(crank.r_pts, w0, Pin)\n",
"\n",
"import matplotlib.pyplot as plt\n",
"%matplotlib inline\n",
"\n",
"plt.figure()\n",
"plt.plot(mat)\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"E = crank.get_E()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"np.savetxt(\"../data/CN_cylindric_complex_E.dat\", np.abs(crank.E_matrix))\n",
"np.savetxt(\"../data/CN_cylindric_complex_r_pts.dat\", crank.r_pts)\n",
"np.savetxt(\"../data/CN_cylindric_complex_z_pts.dat\", crank.z_pts)"
"fig, ax = plt.subplots()\n",
"mesh = ax.pcolormesh(np.real(crank.r_pts), np.real(crank.z_pts), np.abs(E[:,:])**2)\n",
"plt.colorbar(mesh, ax=ax)\n",
"#ax.set_xlim(0,5e-4)\n",
"fig.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Energy evolution\n",
"\n",
"ener = np.array([crank.delta_r*np.sum(np.abs(E[i,:])**2) for i in range(crank.n_z)])\n",
"\n",
"plt.figure()\n",
"plt.plot(ener)\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
......
This diff is collapsed.
No preview for this file type
......@@ -8,7 +8,7 @@
%Colonnes
\usepackage{multicol}
\setlength{\columnsep}{0.75cm}
\setlength{\columnsep}{0.5cm}
\usepackage{graphicx,tikz}
......@@ -21,7 +21,7 @@
\setlength{\parindent}{0.5cm}
\setlength{\parskip}{2pt}
\usepackage{setspace}
\setstretch{1.2}
\setstretch{1.1}
%Document information
\title{Laser Filamentation}
......@@ -196,6 +196,32 @@ Try to compare numerical results with known analytical evolutions (hyperbolic di
\item Introduce the half-step integration method to add the dispersion chirp term.
\end{itemize}
\section*{Wednesday 20th}
Cylindrical diffraction is checked regarding theory: evolution of $z \mapsto w(z)$ with a constant power input. Diffraction - Dispersion algorithm does end with diffraction and dispersion visible: $(r,z) \mapsto |\mathcal{E}(z,r,t=0)|^2$ or $r \mapsto |\mathcal{E}(z,r,t=0)|^2$ at $z_{\rm min}$ and at $z_{\rm max}$. Diffraction - Dispersion - Non Linear algorithm does end with diffraction comparable to the Cylindrical diffraction.
Rectangular summation for energy calculation does not work even for cylindrical diffraction. Side would be losses too important to be accountable.
Non linear algorithm does end with Kerr effect. Creation of a concentration point but fast dissipation afterwards without any divergence. Numerical errors or loss mechanism?
\subsection*{Bonus}
\begin{itemize}
\item Try to vectorise the multi-step solver including the operator $\mathcal{U}_r$ (resp. $\mathcal{U}_t$) for each $t$ (resp. $r$) in a big unique block matrix by concatenating the vectors along the free variable;
\item Try $k_0^{(2)} = 0.20 \, {\rm fs^2 \cdot cm^{-1}}$ and $t_p \mapsto \sqrt{2} t_p$ to reproduce quantitatively the results of the paper.
\end{itemize}
\subsection*{To Be Done}
\begin{itemize}
\item Perform energy conservation check;
\item Check step coefficients in multiple steps method;
\item Quantitative comparison between Non Linear and Cylindrical diffraction;
\item Understand Kerr dissipation;
\item Add defocusing terms.
\end{itemize}
\end{multicols}
\end{document}
\ No newline at end of file
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