The table printed inside the book cover gives the radii of the orbits of the planers (mean distance from the Sun) and the times required for moving around the orbit (period of revolution).
a) Calculate the speed of motion of each of the nine planets in its orbit around the Sun. Assume that the orbits are circular.
b) In a logarithmic graph of speed vs. radius, plot the logarithm of the speed of each planet and the logarithm of its radial distance from the Sun as a point. Draw a curve through the nine points. Can you represent this curve by a simple equation?
The table:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
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
The length of the orbid is the circumference with the given Distance from the sun.
$$ s_{orbit}=2.\pi.r^2 $$
The speed of each planet is: $$ v_{planet}=\frac{s_{orbit}}{Orbital Period_{(in years)}} $$
So we first add two colums to the table and than fill in the calculated values
# Add two columns
df['Circumference'] = 0
df['Speed(m/s)'] = 0
#iterate the dataset and calculate volume and density
for index, row in df.iterrows():
Circ = 2 * np.pi * (row["DistanceSun"]*1000)
df.loc[index,['Circumference']] = Circ # add values to the table
Speed = (Circ) / (row['OrbitalPeriod'] * 365.24 * 24 * 3600) # in m/s
df.loc[index,['Speed(m/s)']] = Speed
print(f'For planet {index} the speed is {Speed:.2e} m/s')
df.sort_values(by=['Speed(m/s)'], ascending = False)
v = df['Speed(m/s)'].values
s = df['Circumference'].values
plt.figure(figsize=(8,8))
plt.plot(s.tolist(), v.tolist())
plt.grid()
plt.title('The speed of the planet in function of the distance')
plt.xlabel('v - speed')
plt.ylabel('s - distance')
plt.show()
This looks like a hyperbolic function.
If we now make the axes logarithmic
plt.figure(figsize=(8,8))
plt.plot(s.tolist(), v.tolist())
plt.grid()
plt.title('The speed of the planet in function of the distance')
plt.xlabel('v - speed')
plt.ylabel('s - distance')
plt.yscale('log')
plt.xscale('log')
plt.show()
This confirmed our suspicion that the speed is a logaritmic function of the distance to the sun
The slope of the line is $a = \frac{\bigtriangleup\log(v)}{\bigtriangleup\log(s)}$
The Equation of the line is $y = slope.x + c$
So we first determine the slope by using two arbitrary points
a = (np.log(df.loc['Venus',['Circumference']].values[0])-np.log(df.loc['Saturnus',['Circumference']].values[0]))
b = (np.log(df.loc['Venus',['Speed(m/s)']].values[0])-np.log(df.loc['Saturnus',['Speed(m/s)']].values[0]))
slope = b/a
print(f'The slope is: {slope:.2f}')
So the equation of the line is: $$ \log{v}=-0.5\log{s}+\log{c} $$
$$ \implies\log{v}= \log{s^{-\frac{1}{2}}}+\log{c} $$
$$ \implies \log{v}= \log{c.s^{-\frac{1}{2}}} $$
$$ \implies v = c.s^{-\frac{1}{2}} $$
$$ \implies v = \frac{c}{\sqrt{r}} $$