Thursday, December 31, 2020

Gravity(Part 2)

Simple Circular Orbit

Consider an object with mass m orbiting a planet with mass M, at a distance r from the planet, in a circular orbit, with velocity v.  
 

 

 
You  may see a VPython animation of a circular orbit here:
 
Or a little video of the program running:
 


 
 
There are two forces acting on the object:
  • Gravity, pulling inwards towards the planet
  • Centrifugal force, acting outward

In a circular orbit, the distance r remains the same, meaning there is no acceleration outwards or inwards.

According to Newton's Second Law:

$F_{total} = ma$

gravity + centrifugal = 0

$-\frac{GMm}{r^2} + \frac{mv^2}{r} =0$

$\frac{mv^2}{r} = \frac{GMm}{r^2}$

$v^2 = \frac{GM}{r}$

We obtain the velocity of the object orbiting in a circular orbit:  

$v = \sqrt{\frac{GM}{r}}$

This velocity must be tangential to the orbit, or at right angles to the vector r between the object and the planet.

Orbital Period

The orbital period T is the time taken to complete one full orbit. In physics, the result of the calculation will be in seconds.
 
If we multiply the orbital velocity v with the orbital period T, we get the total distance traveled, which is equal to the circumference of a circle.

$vT = 2\pi r$
 
$T = \frac{2 \pi r }{v}$
 
But  $v = \sqrt{\frac{GM}{r}}$
 
$T = 2 \pi r \sqrt{\frac{r}{GM}} $ 

So we arrive at the orbital period:

$T = \frac{2 \pi}{\sqrt{GM}} r^{3/2}$

We can calculate the orbital period T if we know the mass of the central mass M and the distance r.
 

But we can also use it to calculate the mass of a planet, if we can measure the orbital period of its satellite and the orbital distance. 

This is how the masses of planets and other stars were calculated; astronomers observed something that orbited them. Astronomers measured the time for the satellite to complete one orbit, and measured the separation between the satellite and the planet.

$T^2 = \frac{4 \pi^2}{ GM }r^3 $
$M = \frac{4\pi^2}{GT^2}r^3$
 
There is a moon called Ganymede orbiting the planet Jupiter. Its orbital period is 172 hours, and it orbits 1,070,400 km from Jupiter.

$T = 172 \times 60 \times 60 s = 6.19 \times 10^{5} s$
$r = 1.07 \times 10^9 m$

$G = 6.67 \times 10^{-11}$

Mass of planet Jupiter:
$M = \frac{4\pi^2}{6.67 \times 10^{-11} \times (6.19\times 10^5)^2}\times (1.07\times 10^9)^3 = 1.89\times10^{27}kg$
 
 
This is in good agreement with the value in Wikipedia: $1.898 \times 10^{27} kg$

Do the following:
 
 
Google distance of the Moon from Earth, orbital period T of the Moon around Earth. 
  • Convert to meters and seconds.
  • Calculate the mass of Earth using the equation above. 
  • Compare with the mass of Earth according to Google. 
Google distance of Earth to the Sun, and the orbital period.
  • Convert to meters and seconds.
  • Calculate the mass of the Sun using the equation above. 
  • Compare with the mass of Sun according to Google.

 

Friday, December 25, 2020

Gravity (Part 1)

Newton's Law of Gravitation is given by:

$F = -G \frac{Mm}{r^2}$

Where M and m are the masses of the two objects, r is the distance between them, and  is the gravitational constant.

You can express it as a vector (in fact if you are simulating motion in a gravitational field you need to express it as a vector):

$\textbf{F}= -G \frac{Mm}{r^2}\hat{\textbf{r}}$
 
where $\hat{\textbf{r}}$ is the unit vector in the direction from the mass M to m.

Gravitational Potential Energy

Gravitational potential energy is defined as the work done to bring an object from a distance r to infinity.

$U =  \int^\infty_r F dr $

$U = \int^\infty_r \frac{-GMm}{r^2} dr$

$U = -GMm \int^\infty_r r^{-2} dr$

$U = -GMm [-r^{-1}]^\infty_r$

$U = GMm \left[\frac{1}{r}\right]^\infty_r$

$U = GMm [0 - 1/r]$

$U = -\frac{GMm}{r}$ 


Conservation of Energy
An object of mass m moving with velocity $v_1$ at distance $r_1$ from a massive body of mass M has the combined gravitational potential energy U and kinetic energy K:
 
$U + K =-G\frac{Mm}{r_1} + \frac{1}{2}mv_1^2$

If no energy is added into the system by using an engine, this total is conserved. At distance $r_2$ and velocity $v_2$ we will find the total is the same.

$-G\frac{Mm}{r_1} + \frac{1}{2}mv_1^2 = -G\frac{Mm}{r_2} + \frac{1}{2}mv_2^2$

If we know the speed of an object at one distance, we can predict the velocity when the object is at a different distance.

Escape Velocity

Imagine you are standing on the surface of the Earth, and tossed a ball up. You will see the ball gradually slow down, briefly stopping in the air, and then come down again. If you throw the ball hard enough, the ball will slow down, and it will stop at infinity! This means the ball has completely escaped. The velocity that you throw the ball so that it escapes is called the escape velocity.

When you are standing on the Earth, the surface is about 6371 km from the centre.

$r_1 = 6.37 \times 10^6 m$

When the ball reaches infinity, the velocity is zero:

$r_2 =\infty$

$v_2 = 0$

We want to find the escape velocity, $v_1$.

Using the principle of conservation of energy:

$-\frac{GMm}{r_1} + \frac{1}{2} mv_1^2 = \frac{GMm}{\infty} + \frac{1}{2}m (0)^2 $

$ \frac{1}{2} mv_1^2 = \frac{GMm}{r_1}$

$ \frac{1}{2} v_1^2 = \frac{GM}{r_1}$

$ v_1^2 = 2\frac{GM}{r_1}$

$ v_1 = \sqrt{2\frac{GM}{r_1}}$

Putting in the numbers, with $G = 6.67 \times 10^{-11} m^3 kg^{-1} s^{-2}$ and mass of Earth $M=5.97\times10^{24}$:

$v_1 = \sqrt{\frac{2 \times 6.67\times 10^{-11}  \times 5.97\times 10^{24} }{ 6.37\times 10^6}} = 1.09\times 10^4 ms^{-1}$

That is 39,240 km/h.

What if you are already in space, at some distance away from the Earth? Let's say at a distance where $r_1 = 20000 km$? I invite you to try calculating it.

You can also try to calculate the escape velocity from the surface of other planets such as:


Planet mass radius
Mars $6.39 \times 10^{24} kg$ 3389.5 km
Jupiter $1.898 \times 10^{27} kg$ 69911 km
Asteroid Ceres $9.38 \times 10^{20}$ kg 470 km

Wednesday, December 23, 2020

MathJax Test

I've been struggling to include Mathjax in Blogger properly to write proper mathematical equations. A lot of people saying "paste this here", but this is the only one that worked:

http://holdenweb.blogspot.com/2011/11/blogging-mathematics.html

So here's a little test:

$x^2$

The Fourier Transform is given as:

$F(k) = \int^{\infty}_{-\infty} f(t) e^{-2 \pi k t} dt$

 ...and I happy.

For Blogger, you need to open the Theme, then Cutomize->Edit HTML 

Then copy and paste the code kindly provided in the link above, which I have copied below. Use Ctrl-F to find < /head >. You need to paste it before the < /head >

Kosh: Who Are You?

 I am a... well, mainly a physicist. 

What does a physicist do? That's the question isn't it? What do we do? 

I am, mainly, a physicist. I can code.

I like to model and simulate physical systems. Oscillating springs, solar system animations. I use Vpython for that. In this example, I simulated a problem in Orbital Mechanics. Suppose you want to travel from one planet to another? Your flight will not be in a straight line because of the Sun's gravitational pull. It will follow an elliptical path, which in this case is called the Hohmann Transfer.

https://www.glowscript.org/#/user/zorniy/folder/Public/program/newhohmann

 

 

 

 

 

 

I also am interested in machine learning. How a computer can tell the difference between several images, for example. Below, I show some things I did for fun. The first is a brute-force hand-coded Nearest Neighbor Classifier. Slow, but I'm proud of it. I know there's a library in Python that can implement Nearest Neighbour faster, but let me have my moment. Imagine how proud the caveman was who invented the wheel!


KNN is a form of unsupervised learning used for clustering elements (in this case, clustering pixels of similar colour). The pixels are assigned to the "centroids" closest to them. Then the average of the pixels associated with a centroid is calculated and used to update the centroid, so the centroid shifts a bit, and the process is repeated for several iterations or until the cetroids more or less stop moving.

Support Vector Machine (SVM) is a supervised classifier method, where a "machine" is taught to associate training data, which are subsets of a main data set, with certain targets. This trained machine can then be used to classify the main data set. 

Imagine you have two flocks of sheep, black and white. You want to build a fence that is an optimal straight line between them. So you pick out some black and some white sheep and use their positions to determine the best fence position and orientation. When you build the fence, hopefully it will separate the two flocks completely! 

What if you have three flocks, A, B and C? Then you need to determine the fences of A vs (B,C), B vs (A,C), and C vs (A,B).

SVM using Python scikit-learn or sklearn This is a program to illustrate how Python can be used for machine learning. sklearn is a Python library which can implement machine learning. There are others such as the more famous tensorflow and keras and PyTorch. I found Jupyter Notebook and Jupyter Lab to "excellente" for this kind of project.



I have also performed wavelet analysis of signals, optimizing the wavelet denoising parameters using the signal's noise statistics. A lot of computer-heavy stuff.

So... am I a programmer, or "merely" a physicist who can code? Am I human, or am I dancer?


Starting again

I haven't blogged in such a long time. Maybe I will start again. This blog will be mainly focused on mainly science and technology.


Bab 2