Commit b7b98cd0 authored by NUNEZ Arturo's avatar NUNEZ Arturo

Automatic commit jeudi 2 août 2018, 16:30:01 (UTC+0200)

parent 4e99b883
......@@ -2,11 +2,20 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 46,
"metadata": {
"collapsed": true
"collapsed": false
},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"The autoreload extension is already loaded. To reload it, use:\n",
" %reload_ext autoreload\n"
]
}
],
"source": [
"%matplotlib notebook\n",
"%load_ext autoreload\n",
......@@ -15,7 +24,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 47,
"metadata": {
"collapsed": true
},
......@@ -62,7 +71,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 48,
"metadata": {
"collapsed": false
},
......@@ -89,12 +98,12 @@
"myhydro = wkbl.Galaxy_Hound(hydro.path)\n",
"print myhydro.dm.pos3d[:,0].max()\n",
"myhydro.center_shift(hydro.c_dm_com)\n",
"myhydro.r_virial(600,n=2.5)"
"myhydro.r_virial(600,n=15)"
]
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 49,
"metadata": {
"collapsed": false
},
......@@ -103,7 +112,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"34308117 34308117\n"
"145702773 145702773\n"
]
}
],
......@@ -123,7 +132,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": null,
"metadata": {
"collapsed": true
},
This diff is collapsed.
......@@ -104,7 +104,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 30,
"metadata": {
"collapsed": false
},
......@@ -113,15 +113,50 @@
"name": "stdout",
"output_type": "stream",
"text": [
"With Delta_x = 35.285949707 as in Roskar 2013 we reproduce the value for p_j = n_h = 18.3080473755\n",
"and Teq = 1168.55454942\n"
"With Delta_x = 152.587890625 as in Roskar 2013 we reproduce the value for p_j = n_h = 2.59866886906\n",
"and Teq = 3101.66245078\n"
]
}
],
"source": [
"# reproducing Roskar 2013\n",
"levelmax = 17\n",
"Delta_x = (20e6 / 2.**levelmax)\n",
"\n",
"n_h, aux=5., 20.\n",
"i=0\n",
"while (np.abs(n_h-aux)/n_h ) > 1e-4:\n",
" aux = np.copy(n_h)\n",
" n_h = (2*np.pi*k_b*1e4*np.sqrt(0.3))/\\\n",
" (G* m_mg*np.sqrt(aux)*(4*Delta_x*pctocm/100)**2)\n",
" n_h /= (m_p*1e6)#\n",
"\n",
"Teq = 5000/np.sqrt(n_h)\n",
" \n",
"print \"With Delta_x = {0} as in Roskar 2013 we reproduce the value for p_j = n_h = {1}\".format(Delta_x,n_h)\n",
"print \"and Teq = {0}\".format(Teq)"
]
},
{
"cell_type": "code",
"execution_count": 29,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"With Delta_x = 34.0595245361 as in Roskar 2013 we reproduce the value for p_j = n_h = 19.1922557107\n",
"and Teq = 1141.31885925\n"
]
}
],
"source": [
"# reproducing Roskar 2013\n",
"levelmax = 20\n",
"Delta_x = (37e6 / 2.**levelmax)\n",
"Delta_x = (35.714e6 / 2.**levelmax)\n",
"\n",
"n_h, aux=5., 20.\n",
"i=0\n",
......@@ -137,6 +172,28 @@
"print \"and Teq = {0}\".format(Teq)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"35.714285714285715"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"25/0.7"
]
},
{
"cell_type": "markdown",
"metadata": {},
......@@ -147,7 +204,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 27,
"metadata": {
"collapsed": false
},
......@@ -157,15 +214,15 @@
"output_type": "stream",
"text": [
"the resulting values for my sim are: \n",
"p_j = 4.863 m_h / cc\n",
"n_star = 8.336 m_H / cc\n"
"p_j = 2.599 m_h / cc\n",
"n_star = 4.454 m_H / cc\n"
]
}
],
"source": [
"# my box\n",
"levelmax = 18# max reached by Zoom DMO\n",
"box_len = 25e6 # parsec\n",
"levelmax = 17# max reached by Zoom DMO\n",
"box_len = 20e6 # parsec\n",
"Delta_x = (box_len / 2.**levelmax)\n",
"n_h, aux=5., 20.\n",
"i=0\n",
......@@ -188,7 +245,7 @@
},
{
"cell_type": "code",
"execution_count": 20,
"execution_count": 18,
"metadata": {
"collapsed": true
},
......@@ -199,7 +256,7 @@
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": 19,
"metadata": {
"collapsed": false
},
......@@ -207,10 +264,10 @@
{
"data": {
"text/plain": [
"7.612191598560314e-16"
"9.514354866889036e-17"
]
},
"execution_count": 21,
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
}
......@@ -221,7 +278,7 @@
},
{
"cell_type": "code",
"execution_count": 22,
"execution_count": 20,
"metadata": {
"collapsed": false
},
......@@ -229,10 +286,10 @@
{
"data": {
"text/plain": [
"7.612191598560314e-16"
"9.514354866889036e-17"
]
},
"execution_count": 22,
"execution_count": 20,
"metadata": {},
"output_type": "execute_result"
}
......@@ -243,7 +300,7 @@
},
{
"cell_type": "code",
"execution_count": 23,
"execution_count": 21,
"metadata": {
"collapsed": false
},
......@@ -251,10 +308,10 @@
{
"data": {
"text/plain": [
"190.73486328125"
"76.2939453125"
]
},
"execution_count": 23,
"execution_count": 21,
"metadata": {},
"output_type": "execute_result"
}
......@@ -263,6 +320,15 @@
"Delta_x\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
......
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