analyseScript/Joschka/Function testing.ipynb

340 lines
61 KiB
Plaintext
Raw Normal View History

2023-07-26 09:41:51 +02:00
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": true,
"ExecuteTime": {
"end_time": "2023-07-25T12:34:53.272379700Z",
"start_time": "2023-07-25T12:34:52.798126900Z"
}
},
"outputs": [],
"source": [
"import numpy as np\n",
"import matplotlib.pyplot as plt"
]
},
{
"cell_type": "code",
"execution_count": 54,
"outputs": [],
"source": [
"def find_fwhm(f_x, x):\n",
" ind = 0\n",
" for i in range(0, len(f_x)):\n",
" if f_x[i] > np.max(f_x)/2 and ind ==0:\n",
" a = i\n",
" ind = 1\n",
"\n",
" if f_x[i] < np.max(f_x)/2 and ind ==1:\n",
" b = i\n",
" break\n",
" return x[b] - x[a]\n",
"\n",
"\n",
"def gaussian(x, x0, sigma, A):\n",
" return A * np.exp(-0.5 * (x-x0)**2 / sigma**2)\n",
"\n",
"def thermal(x, x0, amp, sigma):\n",
" order = 15\n",
" res = np.exp(-0.5 * (x-x0)**2 / sigma**2)\n",
" return amp/1.6 * polylog(2, res)\n",
"\n",
"def Thomas_Fermi_1d(x, x0, amp, sigma):\n",
" res = (1-(( x - x0 ) / sigma) **2) **(3/2)\n",
" return amp * np.where(res > 0, res, 0)\n",
"\n",
"def density_1d(x, x0_bec, x0_th, amp_bec, amp_th, sigma_bec, sigma_th):\n",
" return thermal(x, x0_th, amp_th, sigma_th) + Thomas_Fermi_1d(x, x0_bec, amp_bec, sigma_bec)\n",
"\n",
"\n",
"def polylog(pow, x):\n",
" order = 500\n",
" sum = 0\n",
" for k in range(1,order):\n",
" sum += x ** k /k **pow\n",
" return sum\n",
"\n",
"def ThomasFermi_2d(x, y=0.0, centerx=0.0, centery=0.0, amplitude=1.0, sigmax=1.0, sigmay=1.0):\n",
" res = (1- ((x-centerx)/sigmax)**2 - ((y-centery)/sigmay)**2)**(3 / 2)\n",
" return amplitude * np.where(res > 0, res, 0)\n",
" # return amplitude * 5 / 2 / np.pi / max(tiny, sigmax * sigmay) * np.where(res > 0, res, 0)\n",
"\n",
"def polylog2_2d(x, y=0.0, centerx=0.0, centery=0.0, amplitude=1.0, sigmax=1.0, sigmay=1.0):\n",
" ## Approximation of the polylog function with 2D gaussian as argument. -> discribes the thermal part of the cloud\n",
" return amplitude/1.643 * polylog(2, np.exp( -((x-centerx)**2/(2 * (sigmax)**2))-((y-centery)**2/( 2 * (sigmay)**2)) ))\n",
" # return amplitude / 2 / np.pi / 1.20206 / max(tiny, sigmax * sigmay) * polylog(2, np.exp( -((x-centerx)**2/(2 * (sigmax)**2))-((y-centery)**2/( 2 * (sigmay)**2)) ))\n",
"\n",
"\n",
"def density_profile_BEC_2d(x, y=0.0, amp_bec=1.0, amp_th=1.0, x0_bec=0.0, y0_bec=0.0, x0_th=0.0, y0_th=0.0,\n",
" sigmax_bec=1.0, sigmay_bec=1.0, sigmax_th=1.0, sigmay_th=1.0):\n",
" return ThomasFermi_2d(x=x, y=y, centerx=x0_bec, centery=y0_bec,\n",
" amplitude=amp_bec, sigmax=sigmax_bec, sigmay=sigmay_bec\n",
" ) + polylog2_2d(x=x, y=y, centerx=x0_th, centery=y0_th,\n",
" amplitude=amp_th, sigmax=sigmax_th, sigmay=sigmay_th)\n",
"\n"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-07-25T13:13:41.713691200Z",
"start_time": "2023-07-25T13:13:41.678934700Z"
}
}
},
{
"cell_type": "code",
"execution_count": 55,
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\Jianshun Gao\\AppData\\Local\\Temp\\ipykernel_13296\\3599946220.py:38: RuntimeWarning: invalid value encountered in power\n",
" res = (1- ((x-centerx)/sigmax)**2 - ((y-centery)/sigmay)**2)**(3 / 2)\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"FWHM TF = 1.2161216121612153\n",
"FWHM Thermal = 1.8241824182418238\n"
]
},
{
"data": {
"text/plain": "<Figure size 640x480 with 1 Axes>",
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAiMAAAGdCAYAAADAAnMpAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAABK+UlEQVR4nO3de3hU5bk3/u+aSWZyPpCQEwYCqCAiB7WkwXraplJrbW13LaW+xc1WWy10W2NbpVVSdVesVXS3mxa1Ir4/a0XdrT1oYVMq+iJRlEOrCCjHcMpAgGQmk2QmM/P8/liz5kBmklkza81aM/l+rivXDJN1eMaR5OZ+7ud+JCGEABEREZFBLEYPgIiIiEY2BiNERERkKAYjREREZCgGI0RERGQoBiNERERkKAYjREREZCgGI0RERGQoBiNERERkqByjB5CIQCCAo0ePori4GJIkGT0cIiIiSoAQAi6XC3V1dbBY4uc/MiIYOXr0KOrr640eBhERESXh0KFDOOuss+J+PyOCkeLiYgDymykpKTF4NERERJQIp9OJ+vr60O/xeDIiGFGmZkpKShiMEBERZZjhSixYwEpERESGYjBCREREhmIwQkRERIZiMEJERESGYjBCREREhmIwQkRERIZiMEJERESGYjBCREREhmIwQkRERIZSHYy89dZbuO6661BXVwdJkvDqq68Oe86GDRtw4YUXwm634+yzz8aqVauSGCoRERFlI9XBiNvtxvTp07F8+fKEjt+/fz+uvfZaXHnlldi+fTu+973v4ZZbbsHatWtVD5aIiIiyj+q9aa655hpcc801CR+/YsUKjB8/Ho899hgA4LzzzsPGjRvx+OOPY86cOWpvT0RERFlG95qRtrY2NDc3R702Z84ctLW1xT3H4/HA6XRGfRFR9jnuOIaNz92HrRv+YPRQiMhAuu/a29HRgerq6qjXqqur4XQ60dfXh/z8/EHnLF26FPfff7/eQyMiA/V5fHA89WV8xr8TgX0S3ha5uOTKLxg9LCIygClX0yxevBjd3d2hr0OHDhk9JCLS2Ma//xEX+HcCACySgLTxcQQCwuBREZERdA9Gampq4HA4ol5zO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wgF8fAaRqikYDBCBHpJxiMHBEVqlbSAEBZgQ1Hgl1YOU1DlN0YjBCRfkINzypRrqLHCBDMjCirabqPAEJoPToiMgkGI0Skn2BG45ioQLnKaZqompEBN9B3WuvREZFJMBghIv2EgpFRqrqvAkBJXg48sOGkKA5ei23hibIVgxEi0o/zGADAgXKUqawZybFaUJKXA4cyVeM6pvXoiMgkGIwQkX6CAUSHGKV6mgaQi1g7RLn8B2ZGiLIWgxEi0ofHBXh7AAAOUa66gBUAygtyw8EIMyNEWYvBCBHpIzhF4xL56EWe6qW9AFBaYAtP0zAzQpS1GIwQkT4ipmgAJDVNU16Qiw6wZoQo2zEYISJ9BIMHhygDABTnJVEzkp8LR6hmhMEIUbZiMEJE+ghOqzgwCsX2HFgtiW+Sp5ALWJXMCKdpiLIVgxEi0oerAwDQIcpRkq8+KwLIXVhDBay9JwGfR6vREZGJMBghIn0EMxmOFIKR8gIbulAEL4Lns26EKCsxGCEifSgNz8QolObnJHWJ0oJcABJOWiqirklE2SWpYGT58uVoaGhAXl4eGhsbsXnz5iGPf+KJJzBp0iTk5+ejvr4ed955J/r7+5MaMBFliMhpmiSKVwGgNJhRcYB1I0TZTHUwsnr1arS0tKC1tRVbt27F9OnTMWfOHBw/fjzm8S+88ALuuecetLa2YufOnXjmmWewevVq/OhHP0p58ERkUoEA0CMHIw5RHgoq1FKCmGMBrqghymaqg5Fly5bh1ltvxYIFCzBlyhSsWLECBQUFWLlyZczjN23ahEsuuQTf+MY30NDQgKu
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"x = np.linspace(-10, 10, 10000)\n",
"\n",
"TF = ThomasFermi_2d(x, y=0, centerx=0, centery=0, amplitude=1, sigmax=1,sigmay=1)\n",
"th = polylog2_2d(x, sigmax=1)\n",
"\n",
"print(f'FWHM TF = {find_fwhm(TF, x)}')\n",
"print(f'FWHM Thermal = {find_fwhm(th, x)}')\n",
"\n",
"plt.plot(x, TF)\n",
"plt.plot(x, th)\n",
"plt.show()"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-07-25T13:13:46.864959500Z",
"start_time": "2023-07-25T13:13:46.226243500Z"
}
}
},
{
"cell_type": "code",
"execution_count": 57,
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\Jianshun Gao\\AppData\\Local\\Temp\\ipykernel_13296\\3599946220.py:23: RuntimeWarning: invalid value encountered in power\n",
" res = (1-(( x - x0 ) / sigma) **2) **(3/2)\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"FWHM TF = 1.2161216121612153\n",
"FWHM Thermal = 1.8241824182418238\n"
]
},
{
"data": {
"text/plain": "<Figure size 640x480 with 1 Axes>",
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAiMAAAGdCAYAAADAAnMpAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAABSVUlEQVR4nO3deXxU9b3/8ddMkpnsCRCyYdgEwRVQJA1eq15T0Vqr7W2l6K9aarW20Kpor9IquFTxWkRsLxW7qO1tbV2u2l61WkqLK24groCCrEICCGQlmWTm/P44c2Yhk2RmMnvez8cjj5nMnHPmOwwkHz7fz/fztRmGYSAiIiKSJPZkD0BEREQGNwUjIiIiklQKRkRERCSpFIyIiIhIUikYERERkaRSMCIiIiJJpWBEREREkkrBiIiIiCRVdrIHEA6Px8OuXbsoKirCZrMlezgiIiISBsMwaGlpobq6Gru99/xHWgQju3btoqamJtnDEBERkSjs2LGDI444otfn0yIYKSoqAsw3U1xcnOTRiIiISDiam5upqanx/R7vTVoEI9bUTHFxsYIRERGRNNNfiYUKWEVERCSpFIyIiIhIUikYERERkaRKi5oRERGJPcMw6O7uxu12J3sokqaysrLIzs4ecNsNBSMiIoOQy+Vi9+7dtLe3J3sokuby8/OpqqrC4XBEfQ0FIyIig4zH42HLli1kZWVRXV2Nw+FQQ0mJmGEYuFwu9u7dy5YtWxg/fnyfjc36omBERGSQcblceDweampqyM/PT/ZwJI3l5eWRk5PDtm3bcLlc5ObmRnUdFbCKiAxS0f4vViRQLP4e6W+iiIiIJJWCEREREUkqBSMiIpIRVq1ahc1m4+DBg8keSkb51re+xQUXXBDX11AwIiIiKc9ms/X5dfPNNyd7iDFlBVaHf914440JH8u9997LQw89FNfX0GoaEUme9v2w5iGomgTjzkz2aCSF7d6923f/kUceYcGCBWzcuNH3WGFhIW+99VYyhhZXGzduDNogtrCwMKrruFyuqPuAlJSURHVeJJQZEZHkMAx4eCasvAX+8B+wbXWyRzRoGYZBu6s7KV+GYYQ1xsrKSt9XSUkJNpst6LHAX9Jr1qxh6tSp5OfnM3369KCgBeC+++7jyCOPxOFwMGHCBP7nf/4n6Hmbzcb999/Pl770JfLz8zn66KNZvXo1mzZt4vTTT6egoIDp06ezefNm3zmbN2/m/PPPp6KigsLCQk4++WT+8Y9/BF33l7/8JePHjyc3N5eKigq+9rWv9fu+y8vLQ77PHTt2cOGFF1JaWsrQoUM5//zz2bp1q+88a2rl9ttvp7q6mgkTJrB161ZsNhuPPvoop556Knl5eZx88sl89NFHvPnmm0ydOpXCwkLOOecc9u7d2+Na8aTMiIgkx7ZXYOcb3m8MePkeGFWX1CENVoe63Byz4PmkvPaHt84g3xHbX0U/+clPuPvuuxk+fDhXXnkl3/72t3nllVcAePLJJ7nqqqtYunQp9fX1PP3008yePZsjjjiCM844w3eN2267jSVLlrBkyRKuv/56LrroIsaOHcv8+fMZOXIk3/72t5k7dy5/+9vfAGhtbeWLX/wit99+O06nk9///vecd955bNy4kZEjR/LWW2/xwx/+kP/5n/9h+vTp7N+/n5deeimq99fV1cWMGTOoq6vjpZdeIjs7m5/+9KecffbZvPvuu74MyMqVKykuLmbFihVB5y9cuJClS5f63sdFF11EUVER9957L/n5+Vx44YUsWLCA++67L6rxRUPBiIgkx7uPmrejTjEDk03/gI4myI1/Slgy2+23385pp50GwA033MC5555LR0cHubm5LF68mG9961t8//vfB2DevHm89tprLF68OCgYmT17NhdeeCEA119/PXV1ddx0003MmDEDgKuuuorZs2f7jp80aRKTJk3yfX/bbbfx5JNP8te//pW5c+eyfft2CgoK+NKXvkRRURGjRo1iypQp/b6XI444Iuj7bdu28be//Q2Px8NvfvMbX+fcBx98kNLSUlatWsVZZ50FQEFBAb/5zW98wYmVObnuuuuC3sesWbNYuXIlp5xyCgCXXXZZ3GtEDqdgRESS45NV5u0pV0PbXtj3EWz+Jxz7lWSOalDKy8niw1tnJO21Y+2EE07w3a+qqgJgz549jBw5kvXr13PFFVcEHX/KKadw77339nqNiooKAI4//vigxzo6Omhubqa4uJjW1lZuvvlmnnnmGXbv3k13dzeHDh1i+/btAHzhC19g1KhRjB07lrPPPpuzzz6br3zlK/12wH3ppZcoKiryfT9kyBDeeecdNm3aFPQ4QEdHR9DU0fHHHx+yTiSc97Znz54+xxVrCkZEJPH2b4GD28CeDaOmw7h6MxjZ+rKCkSSw2WwxnypJppycHN99K3Pg8XgGfI2+rnvdddexYsUKFi9ezLhx48jLy+NrX/saLpcLgKKiItauXcuqVav4+9//zoIFC7j55pt58803KS0t7XUcY8aM6fF8a2srJ510En/84x97HD98+HDf/YKCgqjfW6R/XgMVcQHriy++yHnnnUd1dTU2m42nnnqq33NWrVrFiSeeiNPpZNy4cQlP/4hIitnuLVYdMRWchVAzzfx+Z+athpDUcvTRR/vqRyyvvPIKxxxzzICu+8orr/Ctb32Lr3zlKxx//PFUVlYGFZQCZGdnU19fz1133cW7777L1q1b+ec//xnxa5144ol8/PHHlJeXM27cuKCvRKx8iYeIg5G2tjYmTZrEsmXLwjp+y5YtnHvuuZxxxhmsW7eOq6++mu985zs8/3xyiqVEJAXsfse8HXGSeXvEyeZt4/vg0pb2Ej8/+tGPeOihh7jvvvv4+OOPWbJkCU888QTXXXfdgK47fvx4nnjiCdatW8c777zDRRddFJRdePrpp/n5z3/OunXr2LZtG7///e/xeDxMmDAh4te6+OKLKSsr4/zzz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{},
"output_type": "display_data"
}
],
"source": [
"x = np.linspace(-10, 10, 10000)\n",
"\n",
"TF = Thomas_Fermi_1d(x, x0=0, amp=1, sigma=1)\n",
"th = thermal(x, x0=0, amp=1, sigma=1)\n",
"\n",
"print(f'FWHM TF = {find_fwhm(TF, x)}')\n",
"print(f'FWHM Thermal = {find_fwhm(th, x)}')\n",
"\n",
"plt.plot(x, TF, label='Thomas Fermi')\n",
"plt.plot(x, th)\n",
"plt.legend()\n",
"plt.show()"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-07-25T13:13:56.638668600Z",
"start_time": "2023-07-25T13:13:55.916676900Z"
}
}
},
{
"cell_type": "code",
"execution_count": 42,
"outputs": [
{
"data": {
"text/plain": "1.6110390064904865"
},
"execution_count": 42,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"thermal(0, x0=0, amp=1, sigma=1)"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-07-25T13:02:21.123800100Z",
"start_time": "2023-07-25T13:02:21.081333500Z"
}
}
},
{
"cell_type": "code",
"execution_count": 34,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0.5\n"
]
}
],
"source": [
"print(1**3/2)"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-07-25T12:58:17.116863300Z",
"start_time": "2023-07-25T12:58:17.096107400Z"
}
}
},
{
"cell_type": "code",
"execution_count": 43,
"outputs": [
{
"data": {
"text/plain": "1.0"
},
"execution_count": 43,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"x0 = 0\n",
"sigma = 1\n",
"\n",
"np.exp(-0.5 * (0-x0)**2 / sigma**2)"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-07-25T13:03:00.095225200Z",
"start_time": "2023-07-25T13:03:00.053138800Z"
}
}
},
{
"cell_type": "code",
"execution_count": 53,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"1.642932065514894\n"
]
}
],
"source": [
"print(polylog(2,1))"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-07-25T13:06:46.781843300Z",
"start_time": "2023-07-25T13:06:46.758628100Z"
}
}
},
{
"cell_type": "code",
"execution_count": 59,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"1.2166174009154453\n"
]
}
],
"source": [
"print(np.sqrt(1-4**(-1/3))*2)"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-07-25T13:23:29.360679300Z",
"start_time": "2023-07-25T13:23:29.311184700Z"
}
}
},
{
"cell_type": "code",
"execution_count": null,
"outputs": [],
"source": [],
"metadata": {
"collapsed": false
}
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 0
}