Posts

Showing posts from March, 2026

Life on a Lava World: Decoding the Physics of Kepler-10b

Image
Imagine a world where a "year" lasts less than an Earth day, the ground beneath your feet is a shifting ocean of molten lava, and the gravity is so intense it would make you feel more than twice your normal weight. This isn't science fiction—it’s Kepler-10b. Located about 560 light-years away, Kepler-10b was the first rocky planet ever confirmed by NASA’s Kepler mission, proving that Earth-sized worlds exist elsewhere in the cosmos. But the similarities end there. By applying the fundamental laws of orbital mechanics and Newtonian gravity, we can strip away the mystery of this "iron planet" and see the extreme numbers that define its existence. In this post, we’re using Python to break down the orbital velocity, surface gravity, and sheer kinetic energy of this cosmic speedster. Let’s dive into the code and see what it really takes to survive on one of the most hostile planets ever discovered. import math # Constants G = 6.67430e-11 # Universal gravitation...

The Power of the Point: Decoding Earthquake Magnitudes Through Code

Image
Yesterday, we took a deep dive into the math behind the ground shaking beneath our feet. While we often hear numbers like "7.0" or "8.0" on the news, those small decimals hide a staggering reality of exponential growth. ​Using Python and numpy, we mapped out exactly how much the world moves—and how much energy is released—when the Richter scale ticks upward. ​The Logarithmic Reality ​The Richter scale isn't linear; it’s logarithmic. This means a magnitude 8.0 isn't just "a bit stronger" than a 7.0—it represents significantly more ground displacement and a massive leap in energy. import numpy as np def ground_movement(r): # Represents relative ground displacement in meters return 1e-06 * 10**r def energy_produced(r): # Approximation of energy in tons of TNT return 3 * 10**(1.5 * (r - 3.5)) ritcher_values = { "Hand grenade": 0.2, "1 stick dynamite": 1.2, "Chernobyl": 3.9, "20...

Mapping the Invisible: Visualizing Earth’s Magnetosphere with Python

Image
Imagine trying to map a massive, invisible ocean of electricity surrounding our planet. That is exactly what NASA’s IMAGE mission set out to do using the Radio Plasma Imager (RPI). Instead of using visible light, the RPI acts like a long-range "cosmic sonar," sending powerful radio pulses into the Earth's magnetosphere. By measuring how these pulses bounce off clouds of charged particles (plasma), scientists can "see" the structure of space weather that is normally hidden from our eyes. In this post, we’re going to use Python to take raw RPI sounding data and reconstruct a 2D map of these plasma densities, revealing the dense "inner shell" of our planet's atmosphere. import numpy as np import matplotlib.pyplot as plt # --- PHYSICS CALCULATIONS --- def get_electron_density(freq_hz): """ Applies the Plasma Frequency formula: f_p ≈ 9000 * sqrt(Ne). Returns density in electrons per cubic centimeter (e-/cc). "...

Detecting the Invisible: A Python Simulation of Dark Matter

Image
  The "Missing Mass" Problem When astronomers use the Hubble Space Telescope to observe massive galaxy clusters, they encounter a startling discrepancy. By counting the stars and galaxies, we can calculate the Visible Mass (M_{vis}). However, when we measure the speed at which these galaxies orbit the cluster's center, they move far faster than the visible gravity should allow. This script uses the Orbital Velocity formula to reveal the "Mass Gap." According to the laws of gravitation, if a cluster is stable and not flying apart, the mass required to hold it together must be: Mass=vel**2 *R/G where vel= velocity R=radius G= universal gravitational constant The difference between this Mass and our calculated Mass is the physical proof of Dark Matter. The Python Implementation import math # Constants G = 6.672e-11 LY_TO_M = 9.4e15 AVG_STAR_MASS = 2e30 def get_velocity(m, r): """Returns escape velocity in m/s""" r...

Universe is Really Mind Boggling

Image
NASA Hubble eXtreme Deep Field (XDF) scanned the sky to find galaxies in the universe. Despite being the extreme technology it covers a tiny patch of 2.3 x 2.0 arcminutes of the sky. To study the entire sky, we will need: Total XDF patches to cover sky:32,539,707 From this it is that the Estimated Total Galaxies are 178,968,388,500. And number of Ancient Galaxies (> 9 BY ago) is 107,381,033,100.  We wrote the code in python to accomplish these calculations. From the rectangular patch, it's area was calculated in square degrees. Since the sky sphere is covered entirely by 1 radian, it was converted to degrees and surface area of entire sky was calculated. It is estimated that there are 5500 Galaxies in one patch. Code is given below. """ PROJECT: ESTIMATING THE TOTAL GALAXIES IN THE OBSERVABLE UNIVERSE DATA SOURCE: NASA Hubble eXtreme Deep Field (XDF) The XDF is a tiny 'keyhole' view of the sky. By calculating how many of these 'keyholes' fit i...

Cracking the Cosmic Code: Fermi’s Latest Gamma-Ray Map

The universe is a noisy place, but much of that noise is invisible to the human eye. Recently, the Fermi team released its second catalog from the Large Area Telescope (LAT), providing a massive inventory of 1,873 gamma-ray point-sources. While mapping these high-energy beacons is a huge milestone, the real challenge lies in the "unidentified" sources—the cosmic ghosts that show up on the map but don't have a name. The Mystery of the Unidentified 572 Out of the nearly 1,900 sources detected, 572 remained a mystery. To narrow the search, the Japanese Suzaku X-ray Observatory zoomed in on a small sample of 11 unidentified sources. The results were a major win for deep-space detective work: * The Big Winners: 6 were identified as pulsars (dense, spinning remnants of exploded stars). * The Galactic Guest: 1 was a blazar, a galaxy powered by a massive black hole. * The Local: 1 was a standard flaring star. * The Holdouts: 3 sources still refuse to be identified. Why This M...

Is Space "Lumpy"? Probing Quantum Gravity with Python

This Python script explores a frontier of modern physics known as Lorentz Invariance Violation (LIV) , which investigates whether the "smooth" fabric of Einstein's spacetime becomes "lumpy" or "foamy" at incredibly small scales. By calculating the arrival time differences of gamma rays from distant cosmic sources like quasars, the code determines a characteristic length scale for this spatial graininess. While classical physics assumes all light travels at exactly $c$ in a vacuum, quantum gravity theories suggest that higher-energy photons might "bump" into the quantum foam of space, causing a measurable lag over billions of light-years. The Python Implementation To ensure Google and other search engines can "read" this code, I have embedded it as text within a preformatted block. This allows the logic to be searchable while remaining easy to read. # Constants C = 29979245800.0 # Spe...

Applications of Elemental Properties

This code in python demonstrates how to calculate molecular weights, physical properties like mole fractions, partial pressure calculations using the mixture composition and application like making molar solutions and calculation of gas solubilities using Henry's law. First of all, a dictionary of all elements and their atomic weights was created. Then from the name and number of atoms present in the formula, molecular weights were calculated. These were stored in a dictionary to access them later on. The code is profusely commented and explained using # and f-string. It is free to use and I hope it will be useful tonthe students of physical chemistry. Now for the code Author: My name is Ranjit Singh. I am retired from a petroleum company and a coding enthusiast. I am trying coding chemistry, physics and astronomy problems.

The Physics of a Gas Mixture: Analyzing the Air We Breathe

Today, I’m using modern code to solve fundamental chemistry problems, and I hope this series of posts will help students and enthusiasts bridge the gap between abstract equations and practical, logical solutions. Problem: We know that the atmosphere isn't just a mix of 78% Nitrogen and 21% Oxygen. It is a complex mixture of at least 12 significant gases. Our goal is to use this Volume Percentage to calculate the Average Molecular Weight (\bar{M}) and the Density (\rho) of dry air at Standard Temperature and Pressure (STP). To do this, we rely on a fundamental constant from physical chemistry: the molar volume of an ideal gas at STP, which is 22,400 cc/mol (cm^3/mol). The Logical Steps (The "Math" before the Code) Instead of just asking an AI for the answer, we will build a logical script that mirrors a scientific calculation: * Define the knowns: We create a dictionary to store the Volume Percentage and Molecular Weight of each gas (Nitrogen, Oxygen, CO_2, etc.). * ...