|
ON7AMI Amateur Radio, Meteology and Astronomy website. JO10UX |
|
|
|
In [1]:
import numpy as np
import pandas as pd
PlanetName = ['Mercury','Venus', 'Earth', 'Mars', 'Jupiter', 'Saturnus', 'Uranus', 'Neptunus', 'Pluto']
DistanceSun = [57.9e6, 108.0e6, 150.0e6, 228.0e6, 778.0e6, 1430.0e6, 2870.0e6, 4500.0e6, 5890.0e6]
OrbitalPeriod = [0.241, 0.615, 1, 1.88, 11.9, 29.5, 84, 165, 248]
Mass = [3.3e23, 4.87e24, 5.98e24, 6.42e23, 1.9e27, 5.67e26, 8.7e25, 1.03e26, 1.5e22]
Radius = [2439, 6052, 6378, 3393, 71399, 60000, 25400, 24300, 1500]
Gravity = [0.38, 0.91, 1, 0.38, 2.53, 1.07, 0.92, 1.19, 0.045]
RotationPeriod = [58.6, 243, 0.997, 1.026, 0.41, 0.43, 0.65, 0.77, 6.39]
PlanetDataSet = list(zip(PlanetName,DistanceSun,OrbitalPeriod,Mass,Radius,Gravity,RotationPeriod))
df = pd.DataFrame(data = PlanetDataSet, columns=['PlanetName','DistanceSun','OrbitalPeriod','Mass','Radius','Gravity','RotationPeriod'])
df.set_index('PlanetName', inplace=True)
df
Out[1]:
Question:¶
Solution:¶To calcculate density Rho, we use the formula: $$ \textrm{Density}\;\varrho =\;\frac{\textrm{Weight}\;\left(\textrm{in}\;\textrm{kg}\right)}{\textrm{Volume}\;\left(\textrm{in}\;m^3 \right)} $$ Therfore, we need the volume of each planet $$ \textrm{Volume}\;v\;=\frac{4}{3}*\pi \;r^3 $$ In [2]:
# Add two columns
df['Volume'] = 0
df['Density'] = 0
#iterate the dataset and calculate volume and density
for index, row in df.iterrows():
Volume = (4/3) * np.pi * (row["Radius"]*1000)**3
df.loc[index,['Volume']] = Volume # add values to the table
Density = (row['Mass']*1e3) / (Volume * 1e6) # in g/cm3
df.loc[index,['Density']] = Density
print(f'For planet {index} the density is {Density:.2g} g/cm3')
df.sort_values(by=['Density'], ascending = False)
Out[2]:
b) Density is decresing if planets are further from the sun but not in a linear way so this can be a coincidence. |
|
سُوۡرَةُ حٰمٓ السجدة / فُصّلَت
Surah Fussilat: Thereafter turned He to the heaven and it was as smoke, and said Unto it and Unto the earth: come ye twain, willingly or loth. They said: we come willingly. (11) Then He decreed them as seven heavens in two days, and revealed Unto each heaven the command thereof; and We bedecked the nether heaven with lamps and placed therein a guard. That is the ordinance of the Mighty, the Knower. (12) De hemelen en aarde (waren) een samenhangende massa. Wij hebben ze toen van elkaar gescheiden… Wij hebben de hemel tot een beschermend dak gemaakt … en de dag en de nacht, de zon en de maan geschapen. (Koran 41 11:12)
|