Kernel: Python 2 (SageMath)
Modelling Stellar Interiors: Jupyter Notebook
In [1]:
Part 1
Lane emden equation:
In [2]:
In [3]:
In [4]:
Values of xi at theta = 0 for various n are as follows
n=0: 2.448
n=1: 3.141
n=2: 4.353
n=3: 6.900
n=4: 14.993
n=5: unknown, as it never crosses the x-axis
Part 2
Standard Solar Model
In [5]:
Alpha:
In [6]:
Radius:
In [7]:
[4.12580014e-04 8.21075077e-04 1.22957014e-03 ... 9.99183010e-01
9.99591505e-01 1.00000000e+00]
Density
Central Density:
Density:
Log Density:
In [8]:
In [9]:
/ext/sage/sage-8.6_1804/local/lib/python2.7/site-packages/ipykernel/__main__.py:30: RuntimeWarning: invalid value encountered in log10
/ext/sage/sage-8.6_1804/local/lib/python2.7/site-packages/ipykernel/__main__.py:32: RuntimeWarning: invalid value encountered in log10
In [10]:
Mass
Mass:
In [11]:
In [12]:
Pressure
Pressure:
K:
Combining these 2 equations:
In [13]:
/ext/sage/sage-8.6_1804/local/lib/python2.7/site-packages/ipykernel/__main__.py:13: RuntimeWarning: invalid value encountered in log10
/ext/sage/sage-8.6_1804/local/lib/python2.7/site-packages/ipykernel/__main__.py:15: RuntimeWarning: invalid value encountered in log10
/ext/sage/sage-8.6_1804/local/lib/python2.7/site-packages/ipykernel/__main__.py:17: RuntimeWarning: invalid value encountered in log10
In [14]:
Temperature
Equate the equation of state of an ideal gas with the polytropic equation of state:
Rearrange and substitute with density equation.
Input the K equation:
In [15]:
In [16]:
0.6825000000000001
In [17]:
/ext/sage/sage-8.6_1804/local/lib/python2.7/site-packages/ipykernel/__main__.py:10: RuntimeWarning: invalid value encountered in log10
/ext/sage/sage-8.6_1804/local/lib/python2.7/site-packages/ipykernel/__main__.py:11: RuntimeWarning: invalid value encountered in log10
/ext/sage/sage-8.6_1804/local/lib/python2.7/site-packages/ipykernel/__main__.py:12: RuntimeWarning: invalid value encountered in log10
/ext/sage/sage-8.6_1804/local/lib/python2.7/site-packages/ipykernel/__main__.py:13: RuntimeWarning: invalid value encountered in log10
/ext/sage/sage-8.6_1804/local/lib/python2.7/site-packages/ipykernel/__main__.py:14: RuntimeWarning: invalid value encountered in log10
In [18]:
Plotting
In [19]:
In [20]:
In [21]:
In [22]:
In [23]:
In [24]:
From the above figures it can be seen that the n=3 polytrope is the best fit to the standard solar model, more analysis of the data can be found in the report.
In [25]:
In [26]:
In [27]:
central density n=0: 1409.6224013661824
surface density n=0: 1409.6224013661824
central mass n=0: 2.085196890921245e-10
surface mass n=0: 0.9999999999999996
central pressure n=0: 134551543657213.67
surface pressure n=0: -2219201009.021052
central temperature n=0: 7896785.156978242
surface temperature n=0: -130.24416600551606
In [28]:
central density n=1: 4640.393479871425
surface density n=1: -0.9391604491021224
central mass n=1: 3.2496091098874176e-10
surface mass n=1: 1.0
central pressure n=1: 442844127970057.06
surface pressure n=1: 18139314.23118434
central temperature n=1: 7895152.321344089
surface temperature n=1: -1597.884927648124
In [29]:
central density n=2: 16092.908044829437
surface density n=2: 6.952243848535457e-05
central mass n=2: 4.2339940396405507e-10
surface mass n=2: 1.0000000000000002
central pressure n=2: 1848752684800063.0
surface pressure n=2: -524.9458634614224
central temperature n=2: 9504050.138644136
surface temperature n=2: -624.6747506957851
In [30]:
central density n=3: 76561.0741050157
surface density n=3: -9.593438873378746e-10
central mass n=3: 5.057594412168205e-10
surface mass n=3: 1.0000000000000002
central pressure n=3: 1.2490142139297048e+16
surface pressure n=3: 0.003635150874981288
central temperature n=3: 13496581.881126745
surface temperature n=3: -313.48196386374104
In [31]:
central density n=4: 881912.540230316
surface density n=4: 3.95630100226574e-19
central mass n=4: 5.678643458752823e-10
surface mass n=4: 1.0000000000000002
central pressure n=4: 2.808113010443602e+17
surface pressure n=4: -1.0309659968824032e-13
central temperature n=4: 26342288.05137631
surface temperature n=4: -21.558544987223293
In [32]:
central density n=5: 2195902.9241341255
surface density n=5: 10.582294117181593
central mass n=5: 5.956738137340104e-10
surface mass n=5: 0.9999999999999999
central pressure n=5: 8.153165227918121e+17
surface pressure n=5: 339536347569.56964
central temperature n=5: 30716910.857173055
surface temperature n=5: 2654427.545914755
In [33]:
central density SSM: 151000.0
surface density SSM: 0.9460000000000001
central mass SSM: 4e-07
surface mass SSM: 0.9999897
central pressure SSM: 2.34e+16
surface pressure SSM: 970000000.0
central temperature SSM: 15500000.0
surface temperature SSM: 81200.0
In [0]: