# Newtonian Gravity 
This notebook introduces the Newtonian theory of gravity, using the mathematical framework provided by the previous sections.

Newton was famous for introducing a theory of universal gravitation which is still useful to this day. While the theory tends to degrade in accuracy in extreme situations (Black holes, appreciable fractions of c, etc.) it is still used in modern science due to its close approximation of the truth in most situations. 

This is the theory of gravity which we'll use to convincingly simulate the solar system in our project. 

Below is a common diagram used to illustrate the values involved.



## Forces

This theory, as with much of Newton's work, hinges around the concept of Forces. And to truly understand the real world applications of this theory of gravity, you'll need an introduction to Forces. Newton's second law of motion is as follows:



This indicates, that the rate of change of an object's velocity (Which we now understand to be it's acceleration) is determined by the Force applied to it, and moderated by it's mass. 

## Exercise 1.1

To set up some examples, we have 2 orbs in deep space. (So there are no other forces acting on them)

Orb_1 has a mass of 10kg. And Orb_2 has a mass of 5kg.

If you were to apply a force of 10 Newtons (The unit of force) to Orb_1, what would it's acceleration be? Hint, a Newton is also kg / (m / s)


```python
## Values

Orb_1_mass = 10
Ex_1_force = 10
Orb_2_mass = 10
```


```python
# Using the equation above, what is a
print()
```

    


## Exercise 1.2
Now what would happen if you were to apply the same force to Orb_2?


```python
# using the same equation, what would the acceleration for Orb_2 be?
print()
```

    


## Inverse Square attraction

The kind of behaviour in Newtonian gravity is called an inverse square law. These exist all throughout physics. It means that the force between two objects goes down extremely quickly as the distance between them reduces. Take a look at what happens when we plot an inverse square value as r increases


```python
from sympy import *
from sympy.plotting import plot
```


```python
r = symbols('r')
f_r = 1/(r*r)

plot(f_r, ylabel = "f_r", xlim = [0.2,5], ylim = [0,10])
```


    <Figure size 640x480 with 1 Axes>





    <sympy.plotting.plot.Plot at 0x38d3a90>



As you can see the effect is much more extreme when something is closer to an object. In fact there is an extremely brief time when the multiplying factor is between 0.5 and 2. (The time when proximity less than doubles or halves the effect) the rest of the time it is extreme. 

It is exactly this feature which allows planets to have moons, instead of all things merely orbiting the sun, even though the sun is vastly more massive than any planet. The gravity of the sun is still intense, but by the time it has made it all the way to the earth, the earth actually exerts a stronger gravitational pull. 

Exercise 2.1

Using the inverse square law above, can we calculate the point beween the sun and the earth which will the gravity from each one cancelled out. 

Ie when 
\begin{equation}
F_{sun} = F_{earth}
\end{equation}




```python
m_earth = 5.9722*pow(10,24) #Kg
m_sun = 1.98847*pow(10,30) #Kg
m_satellite = 1 #Kg
earth_r = r - 149598023
G =  6.674*pow(10,-11) 
f_sun = G * m_sun * m_satellite * (1/(r*r))
# f_earth = 
```


```python
solveset(f_sun-f_earth)
```




$\displaystyle \left\{149339212.72898, 149857731.883518\right\}$




```python
print("Orbital Radius of the L1 lagrange point of earth = " + str(149598023 - 1500000 ))
```

    Orbital Radius of the L1 lagrange point of earth = 148098023



```python

```

6bb6abbea588d19ff59baf66043921a9fd37f897
ipynb
Jupyter Notebook
tutorials/05-Newtonian_Gravity.ipynb
JDOsborne1/python-orrery-lesson
edc3f538fcb33eb57dddf1eb87e9106db18eb028
MIT
tutorials/05-Newtonian_Gravity.ipynb
JDOsborne1/python-orrery-lesson
edc3f538fcb33eb57dddf1eb87e9106db18eb028
MIT
2020-04-30T17:47:41.000Z
2020-04-30T19:11:31.000Z
tutorials/05-Newtonian_Gravity.ipynb
JDOsborne1/python-orrery-lesson
edc3f538fcb33eb57dddf1eb87e9106db18eb028
MIT
Qwen/Qwen-72B
1. YES
2. YES