Commit 7f1f9758 authored by Antoine RAVETTA's avatar Antoine RAVETTA

working with graphics

parent 8c012b8d
......@@ -15,9 +15,17 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"diff : 5.570423008216336e-08j\n"
]
}
],
"source": [
"import numpy as np\n",
"from CCCN import CrankNicolson\n",
......@@ -60,9 +68,20 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/antoine/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:20: RuntimeWarning: divide by zero encountered in true_divide\n",
"/home/antoine/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:20: RuntimeWarning: invalid value encountered in true_divide\n",
"/home/antoine/Desktop/PHY571/codes/CN_classes/CCCN.py:42: RuntimeWarning: invalid value encountered in multiply\n",
" nu = lambda x: - self.delta_z / 4. / self.delta_r * self.V(x) # minus sign for V convention\n"
]
}
],
"source": [
"crank = CrankNicolson()\n",
"\n",
......@@ -81,7 +100,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
......
......@@ -2,9 +2,18 @@
"cells": [
{
"cell_type": "code",
"execution_count": null,
"execution_count": 23,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"diff : 5.570423008216336e-08j\n",
"disp : -1e-28j\n"
]
}
],
"source": [
"import numpy as np\n",
"from HSCN import CrankNicolsonDisp\n",
......@@ -15,7 +24,7 @@
"k_2 = 2e-28\n",
"\n",
"w0 = 1e-3\n",
"tp = 85e-15\n",
"tp = 17e-15\n",
"#tp = 1\n",
"Pin = 1\n",
"\n",
......@@ -23,7 +32,7 @@
"#diff_coeff = 0\n",
"#diff_coeff = 1e-4\n",
"disp_coeff = -1j*k_2/2\n",
"disp_coeff = 1j * 1e-27\n",
"#disp_coeff = 1j * 1e-27\n",
"#disp_coeff = 0\n",
"\n",
"print('diff :', diff_coeff)\n",
......@@ -48,9 +57,18 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 26,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/antoine/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:27: RuntimeWarning: divide by zero encountered in true_divide\n",
"/home/antoine/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:27: RuntimeWarning: invalid value encountered in true_divide\n"
]
}
],
"source": [
"crank = CrankNicolsonDisp()\n",
"\n",
......@@ -62,7 +80,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 27,
"metadata": {},
"outputs": [],
"source": [
......@@ -77,14 +95,7 @@
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"fig, ax = plt.subplots()\n",
"mesh = ax.pcolormesh(z_pts, r_pts, E_matrix.T)\n",
"ax.set_xlabel('z')\n",
"ax.set_ylabel('r')\n",
"plt.colorbar(mesh, ax=ax)\n",
"fig.show()"
]
"source": []
}
],
"metadata": {
......
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
The figures of this folder were made using data coming from the CCCN class which was instantiated the following way :
lambda = 700nm
w0 = 1e-3
Pin = 1
D_diff = i/(2k)
the grid for the Crank-Nicolson scheme was the following :
along r : 100 steps between 0 and 1e-2
along z : 200 steps between 0 and 10
the potential was D_diff / r
\ No newline at end of file
No preview for this file type
......@@ -265,9 +265,30 @@ Thus, all effects leading to the saturation of the intensity autofocused, to its
\subsection{Cylindrical diffraction}
% 2D plot
% Comparison with theoretical diffraction w(z)
\paragraph{}
We already had coded a Crank-Nicolson scheme during the course and the first step of our project was to adapt it to the simplest
case of our problem. We thus had to go from cartesian to cylindric coordinates and to work with complex values to observe the diffraction of a gaussian beam.
The following figure shows what we obtained :
\begin{figure}[h]
\centering
\includegraphics[scale=0.3]{../figures/CCCN/CCCN.png}
\caption{Visualisation of the intensity ($\frac{|E|^2}{c \mu_0}$) of a diffracting gaussian beam propogating along $z$. The figure was obtained with $\lambda = 700$nm, $w_0 = 1$mm, $P_{in} = 1$W, $D_{diff} = \frac{i}{2k}$, the Crank-Nicolson grid had 100 points between 0 and 1 cm along r and 200 points between 0 and 10m along z. The potential was $V(r) = \frac{D_{diff}}{r}$}
\end{figure}
We then have to check if our result matches the theoretical calculations. We thus have calculated the theoretical evolution of the beam width and amplitude according to Wikipedia. We then fitted for each z the beam profile along r to a gaussian and plotted these results against the theoretical ones :
\begin{figure}[h]
\centering
\includegraphics[scale=0.3]{../figures/CCCN/check_theory_sigma.png}
\caption{TO FILL}
\end{figure}
\begin{figure}[h]
\centering
\includegraphics[scale=0.3]{../figures/CCCN/check_theory_power.png}
\caption{TO FILL}
\end{figure}
\subsection{Diffraction and Dispersion}
......
......@@ -45,4 +45,10 @@ journal={Optics Letters},
volume={20},
number={1},
year={1995}
}
@misc
{wikiCCCN,
title={Gaussian Beam}
note={https://en.wikipedia.org/wiki/Gaussian_beam}
}
\ No newline at end of file
......@@ -14,6 +14,8 @@
headheight=15pt,footskip=1cm]{geometry}
% Personnalisation
\usepackage{fancyhdr,sectsty}
% Insertion d'images
\usepackage{graphicx}
% Infos du document
......
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