Skip to content

Binary console application to calculate the age of the universe based on observations,

License

Notifications You must be signed in to change notification settings

Arkiralor/HubbleConstant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hubble Constant

A binary application written in Rust to calculate the Hubble Constant and use it to calculate the age of the observed universe.

Theory

The Big Bang Theory, extrapolated from the works of Edwin Powell Hubble and Georges Lemaître, basically describes that at t0-n, the universe was a single, infinitely dense singularity that somehow, spontaneously started explosively expanding at t0.

Vesto Slipher first made the observations in the early years of the 20th century, when he observed that all the light (electromagnatic radiation) from distant galaxies was redshifted i.e, all the light was stretched/elongated, hence, the sources of those waves were moving away from us1, although it is not clear if he comprehended the full ramifications of his observations.

Hence, if all objects in the known universe were speeding away from each other then it was logical to conclude that at one point in time, all matter and energy were one, infinitely dense singularity, which recently, was calculated to be approximately 1.38x1011 years ago.2

Based on further research, it was discovered that the further away two points were in the universe (in scales that can be calculated in MegaParsecs), the faster they were speeding away from each other3. From this observation, spawned the Hubble–Lemaître law.

The Hubble Constant can be defined as the rate at which the speed of separation changes as the distance between two objects increases. For any object significantly far away, it is described as

$$h_0 = {v \over d}$$

Where v is the Helio Radial velocity of a distant galaxy denoted in Km/s and d is the distance of the distant galaxy from the Earth, denoted in Mpc.

Its unit is Km s-1 Mpc-1 i.e, Kilometres per Second per Megaparsec.

  • It can be explained/used as "The speed of separation between two sufficiently far away objects A and B increases by X Km sec-1 for every 1 Mpc increase in the distance between A and B".

Further reading on the subject is recommended and this link can be used as a starting point for laypersons; the more academically inclined may refer to the Pensylvania State University's dossier on the subject.

Usage

There are two steps to use this application. First, we have to build the binary for the system that we need to run the application on; then we can run the binary itself.

Pre-Requistes

There are a few pre-requisites to run this application as the source code makes some assumptions about the platform it is expected to run on.

  1. Console: BASH for UNIX-based operating Systems
    • GitBash for Windows-based Operating Systems
  2. Language Compiler: This application was written using the RuctC compiler v1.69.
    • Package Manager: The package manager for Rust, Cargo is required; if not installed during the installation of the compiler, kindly rectify.

1. Build

This step compiles the source code into a platform specific executable.

Build Syntax

sh scripts/build.sh `buildType` 
  • The buildType can be: release | debug | both
    • both will obviously build both targets sequentially.

Build Example

sh scripts/build.sh both

2. Run

This step runs the compiled executable.

A data (JSON) file will be needed to calculate the Hubble Constant based on the distances and velocities of individual distant galaxies (distance ~>= 1 Megaparsec).

An example is provided in data/galaxies.json.

Run Syntax

sh scripts/run.sh `executableType` `pathToDataFile` ?`show`
  • The executableType can be: release | debug.

  • The pathToDataFile can either be the absolute path to the file or the relative path from Cargo.toml

    • If not set, the example file $(PWD)/data/galaxies.json is used and a notice is displayed on the console.
  • If "show" is presented, then the list of galaxies will be printed out on screen.

Run Example

sh scripts/run.sh release user/home/HubbleConstant/data/galaxies.json show

Compile

This step combines the two previous steps into one.

Compile Syntax

sh scripts/compile.sh ?`executableType` ?`pathToDataFile` ?`show`

As denoted in the syntax, all three arguments are optional here and if an argument is not provided, the program will be provided with a default value for the argument.

  1. executableType = release
  2. pathToDataFile = data/galaxies.json

Compile Example(s)

sh scripts/compile.sh
sh scripts/compile.sh '' '' show
sh scripts/compile.sh release data/json

Improvements & Enhancements

This codebase will be periodically updated as and when the original creator deems necessary but will not be actively maintained except for on special request by persons of interest.

However, you may send requests for enhancements and improvements to the original author for consideration.

  • Do NOT create issues for improvements or enhancements; they will NOT be entertained and you WILL be Blocked.

For bugfixes, you can create a new Github issue for the repository.

Author Details

For miscellaneous queries or correction requests for the documentation (including this README), you may contact the original author via the following channels.

Footnotes

  1. Slipher, Vesto (1917). "Nebulae". Proceedings of the American Philosophical Society. 56: 403–409. Bibcode:1917PAPhS..56..403S.

  2. Planck Collaboration (2020). "Planck 2018 results. VI. Cosmological parameters". Astronomy & Astrophysics. 641. page A6 (see PDF page 15, Table 2: "Age/Gyr", last column). arXiv:1807.06209. Bibcode:2020A&A...641A...6P. doi:10.1051/0004-6361/201833910. S2CID 119335614.

  3. "Hubble Flow". The Swinburne Astronomy Online Encyclopedia of Astronomy. Swinburne University of Technology. Retrieved 2013-05-14.

About

Binary console application to calculate the age of the universe based on observations,

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published