In [1]:

```
# Importing module
import math
# Variable declaration
mp=1 # For convenience,mass is assumed to be unity
rp=1 # For convenience,sun-planet distance at perihelton is assumed to be unity
vp=1 # For convenience,speed of the planet at perihelton is assumed to be unity
ra=1 # For convenience,sun-planet distance at aphelton is assumed to be unity
va=1 # For convenience,speed of the planet at aphelton is assumed to be unity
Lp=mp*rp*vp # Angular momentum at perihelton
La=mp*ra*va # Angular momentum at ahelton
# Result
# From angular momentum conservation, mp*rp*vp = mp*ra*va or vp/va = rp/ra
# From Kepler’s second law, equal areas are swept in equal times
print(" The planet will take a longer time to traverse BAC than CPB")
```

In [2]:

```
# Importing module
import math
# Variable declaration
G=6.67*pow(10,-11) # Gravitational constant
m=1 # For convenience,mass is assumed to be unity
x=30 # The angle between GC and the positive x-axis is 30° and so is the angle between GB and the negative x-axis
y=math.radians(x) # The angle in radians
a=math.cos(y)
b=math.sin(y)
v1=(0,1,0)
v2=(-a,-b,0)
v3=(a,-b,0)
c=(2*G*pow(m,2))/1 # 2Gm²/1
# Calculation
#(a)
F1=[y * c for y in v1] # F(GA)
F2=[y * c for y in v2] # F(GB)
F3=[y * c for y in v3] # F(GC)
# From the principle of superposition and the law of vector addition, the resultant gravitational force FR on (2m) is given by
Fa=[sum(x) for x in zip(F1,F2,F3)]
#(b)
# By symmetry the x-component of the force cancels out and the y-component survives
Fb=4-2 # 4Gm² j - 2Gm² j
# Result
print("(a) The force acting =",Fa,"≈ 0")
print("(b) The force acting =",Fb,"Gm²")
```

In [3]:

```
# Importing module
import math
# Variable declaration
G=6.67*pow(10,-11) # Gravitational constant
m=1 # For convenience,mass is assumed to be unity
l=1 # For convenience,side of the square is assumed to be unity
c=(G*pow(m,2))/l
n=4 # Number of particles
# Calculation
d=math.sqrt(2)
# If the side of a square is l then the diagonal distance is √2l
# We have four mass pairs at distance l and two diagonal pairs at distance √2l
# Since the Potential Energy of a system of four particles is -4Gm²/l) - 2Gm²/dl
w=(-n-(2/d))
# If the side of a square is l then the diagonal distance from the centre to corner is
# Since the Gravitational Potential at the centre of the square
u=-n*(2/d)
# Result
print ("Potential energy of a system of four particles =",w,"Gm²/l")
print("The gravitational potential at the centre of the square =",u,"Gm²/l")
```

In [4]:

```
# Importing module
import math
# Variable declaration
R=1 # For convenience,radii of both the spheres is assumed to be unity
M=1 # For convenience,mass is assumed to be unity
m1=M # Mass of the first sphere
m2=6*M # Mass of the second sphere
m=1 # Since the mass of the projectile is unknown,take it as unity
d=6*R # Distance between the centres of both the spheres
r=1 # The distance from the centre of first sphere to the neutral point N
G=6.67*pow(10,-11) # Gravitational constant
# Calculation
# Since N is the neutral point; GMm/r² = 4GMm/(6R-r)² and we get
r=2*R
# The mechanical energy at the surface of M is; Et = m(v^2)/2 - GMm/R - 4GMm/5R
# The mechanical energy at N is; En = -GMm/2R - 4GMm/4R
# From the principle of conservation of mechanical energy; Et = En and we get
v_sqr=2*((4/5)-(1/2))
# Result
print("Minimum speed of the projectile to reach the surface of the second sphere =","(",round(v_sqr,5),"GM/R",")","^(1/2)")
```

In [5]:

```
# Importing module
import math
# Variable declaration
π=3.14 # Constant pi
G=6.67*pow(10,-11) # Gravitational constant
R=9.4*pow(10,3) # Orbital radius of Mars in km
T=459*60
Te=365 # Period of revolution of Earth
r=1.52 # Ratio of Rms/Res, where Rms is the mars-sun distance and Res is the earth-sun distance.
# Calculation
# (i)
R=R*pow(10,3)
# Using Kepler's 3rd law:T²=4π²(R^3)/GMm
Mm=(4*pow(π,2)*pow(R,3))/(G*pow(T,2))
# (ii)
# Using Kepler's 3rd law: Tm²/Te² = (Rms^3/Res^3)
Tm=pow(r,(3/2))*365
# Result
print("(i) Mass of Mars =",Mm,"kg")
print("(ii) Period of revolution of Mars =",Tm,"days")
```

In [6]:

```
# Importing module
import math
# Variable declaration
g=9.81 # Acceleration due to gravity
G=6.67*pow(10,-11) # Gravitational constant
Re=6.37*pow(10,6) # Radius of Earth in m
R=3.84*pow(10,8) # Distance of Moon from Earth in m
T=27.3 # Period of revolution of Moon in days
π=3.14 # Constant pi
# Calculation
# I Method
# Using Newton's 2nd law of motion:g = F/m = GMe/Re²
Me1=(g*pow(Re,2))/G
# II Method
# Using Kepler's 3rd law: T²= 4π²(R^3)/GMe
T1=T*24*60*60
Me2=(4*pow(π,2)*pow(R,3))/(G*pow(T1,2))
#Result
print("Mass of the Earth =",Me1,"kg")
print("Mass of the Earth =",Me2,"kg")
```

In [7]:

```
# Importing module
import math
# Variable declaration
k=pow(10,-13) # A constant = 4π² / GME
Re=3.84*pow(10,5) # Distance of the Moon from the Earth in m
# Calculation
k=pow(10,-13)*(pow(1/(24*60*60),2))*(1/pow((1/1000),3))
T2=k*pow(Re,3)
T=math.sqrt(T2) # Period of revolution of Moon in days
# Result
print("Period of revolution of Moon =",round(T,1),"days")
```

In [8]:

```
# Importing module
import math
# Variable declaration
m=400 # Mass of satellite in kg
Re=6.37*pow(10,6) # Radius of Earth in m
g=9.81 # Acceleration due to gravity
# Calculation
# Change in energy is E=Ef-Ei
ΔE=(g*m*Re)/8 # Change in Total energy
# Since Potential Energy is twice as the change in Total Energy (V = Vf - Vi)
ΔV=2*ΔE # Change in Potential Energy in J
# Result
print("Change in Kinetic Energy =",round(ΔE,4),"J")
print("Change in Potential Energy =",round(ΔV,4),"J")
```