Skip to content

Commit

Permalink
release and recpature
Browse files Browse the repository at this point in the history
  • Loading branch information
hoodjd committed Aug 18, 2021
1 parent b6bee05 commit dc18bc3
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@

.ipynb_checkpoints/Binningv1.0-checkpoint.ipynb
.ipynb_checkpoints/release_and_recapture-checkpoint.ipynb
6 changes: 6 additions & 0 deletions .ipynb_checkpoints/release_and_recapture-checkpoint.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"cells": [],
"metadata": {},
"nbformat": 4,
"nbformat_minor": 4
}
102 changes: 102 additions & 0 deletions release_and_recapture.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"13.404117851496652\n"
]
}
],
"source": [
"import numpy as np\n",
"\n",
"kHz = 10**3\n",
"hbar = 1.054*10**-34\n",
"h = 2*np.pi*hbar\n",
"kB = 1.3806*10**-23\n",
"uK = 10**-6\n",
"mK = 10**-3\n",
"\n",
"\n",
"omega_trap = 2*np.pi*150*kHz\n",
"T = 100*uK\n",
"nbar = 1/(np.exp(hbar*omega_trap/(kB*T))-1)\n",
"print(nbar)"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([1. , 1. , 0.97593045, 1. , 1. ,\n",
" 1. , 0.16286988, 1. , 1. , 1. ])"
]
},
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import scipy.stats as st\n",
"nbar = 13\n",
"\n",
"class my_pdf(st.rv_continuous):\n",
" def _pdf(self,x):\n",
" return nbar**x/(1+nbar)**(x+1) # Normalized over its range, in this case [0,1]\n",
"\n",
"my_cv = my_pdf(a=0, b=1, name='my_pdf')\n",
"my_cv.rvs(size=10)"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<__main__.my_pdf at 0x143b3e9ee50>"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.5"
}
},
"nbformat": 4,
"nbformat_minor": 4
}

0 comments on commit dc18bc3

Please sign in to comment.