Commit 4b6d792f authored by Mathieu RASSON's avatar Mathieu RASSON

Report update

parents de03e81f 614e82a1
......@@ -81,7 +81,7 @@
" ax.set_title('Time=%d' % i)\n",
"\n",
" \n",
"ani = animation.FuncAnimation(fig, update, frames=E_matrix.shape[2], interval=100, repeat=True)"
"ani = animation.FuncAnimation(fig, update, frames=E_matrix.shape[2], interval=100, repeat=False)"
]
},
{
......@@ -148,15 +148,6 @@
"## 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,
......@@ -167,7 +158,7 @@
"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",
"ax.set_ylabel('E (V/m)')\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",
......@@ -180,7 +171,7 @@
" 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",
" ax.set_ylabel('E (V/m)')\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",
......@@ -205,19 +196,24 @@
"metadata": {},
"outputs": [],
"source": [
"fig, ax = plt.subplots()\n",
"fig, ax = plt.subplots(figsize=(9,7))\n",
"\n",
"ax.plot(z_pts, temp_sigmas[1:])\n",
"ax.plot(z_pts, temp_sigmas[1:], label=\"fitted waists\")\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",
"ax.plot(z_pts, [func(z, *popt) for z in z_pts], '--', label=\"tp * (1 + (z/zT)^2)^(1/2) \\n tp = {:e} m \\n zT = {:f} m\".format(popt[1], 1/np.sqrt(popt[0])))\n",
"\n",
"ax.set_title(\"Beam temporal width evolution along z and its fit\")\n",
"ax.set_ylabel(\"tp(z) (m)\")\n",
"ax.set_xlabel(\"z (m)\")\n",
"\n",
"ax.legend()\n",
"\n",
"print(popt)\n",
"print(1/np.sqrt(popt[0]))"
"fig.savefig(\"temp_characteristic_length.png\", dpi=300)"
]
},
{
......@@ -230,7 +226,7 @@
"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",
"ax.set_ylabel('E (V/m)')\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",
......@@ -242,7 +238,7 @@
" 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",
" ax.set_ylabel('E (V/m)')\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",
......@@ -257,19 +253,24 @@
"metadata": {},
"outputs": [],
"source": [
"fig, ax = plt.subplots()\n",
"fig, ax = plt.subplots(figsize=(9,7))\n",
"\n",
"ax.plot(z_pts, space_sigmas[1:])\n",
"ax.plot(z_pts, space_sigmas[1:], label=\"fitted waists\")\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",
"ax.plot(z_pts, [func(z, *popt) for z in z_pts], '--', label=\"w0 * (1 + (z/zR)^2)^(1/2) \\n w0 = {:f} m \\n zR = {:f} m\".format(popt[1], 1/np.sqrt(popt[0])))\n",
"\n",
"ax.set_title(\"Beam spatial width evolution along z and its fit\")\n",
"ax.set_ylabel(\"w(z) (m)\")\n",
"ax.set_xlabel(\"z (m)\")\n",
"\n",
"ax.legend()\n",
"\n",
"print(popt)\n",
"print(1/np.sqrt(popt[0]))"
"fig.savefig(\"space_characteristic_length.png\", dpi=300)"
]
},
{
......@@ -278,14 +279,15 @@
"metadata": {},
"outputs": [],
"source": [
"fig, ax = plt.subplots(figsize=(10,8))\n",
"fig, ax = plt.subplots(figsize=(9,7))\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",
"cb = fig.colorbar(cm)\n",
"cb.set_label('E (V/m)')\n",
"\n",
"plt.savefig('diffraction_init.png')"
"plt.savefig('diffraction_init.png', dpi=300)"
]
},
{
......@@ -294,14 +296,15 @@
"metadata": {},
"outputs": [],
"source": [
"fig, ax = plt.subplots(figsize=(10,8))\n",
"fig, ax = plt.subplots(figsize=(9,7))\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",
"cb = fig.colorbar(cm)\n",
"cb.set_label('E (V/m)')\n",
"\n",
"plt.savefig('diffraction_end.png')"
"plt.savefig('diffraction_end.png', dpi=300)"
]
},
{
......
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