0% found this document useful (0 votes)
42 views2 pages

Astronomical Calculations in Python

The document contains a Python script that calculates various astronomical parameters for planets based on the Surya Siddhanta values. It includes functions for mean longitude, ecliptic latitude, precession, nutation, aberration correction, declination, planetary distance, and eclipse prediction. The script also tests the accuracy of these calculations over a span of 1000 years for several planets.

Uploaded by

nileshwadekar937
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views2 pages

Astronomical Calculations in Python

The document contains a Python script that calculates various astronomical parameters for planets based on the Surya Siddhanta values. It includes functions for mean longitude, ecliptic latitude, precession, nutation, aberration correction, declination, planetary distance, and eclipse prediction. The script also tests the accuracy of these calculations over a span of 1000 years for several planets.

Uploaded by

nileshwadekar937
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

import math

Constants
YUGA_CYCLE = 4320000 # Years in a Mahayuga SIDEREAL_YEAR = 365.25636 #
Sidereal year length in days PI = [Link]

AXIAL_TILT = 23.4397 # Earth's axial tilt in degrees NUTATION_AMPLITUDE = 9.2 /


3600 # Nutation in degrees PRECESSION_RATE = 50.3 / 3600 # Degrees per year

Planetary Revolutions per Yuga (Surya Siddhanta


Values)
PLANETARY_REVOLUTIONS = { "Sun": 4320000, "Moon": 57753336, "Mars": 2296832,
"Jupiter": 364220, "Saturn": 146568 }

Trigonometric Sine Function in Degrees


def sine_degrees(deg): return [Link]([Link](deg))

Mean Longitude Calculation (Ensuring Correct Cycles)


def mean_longitude(planet, years): mean_motions = { "Sun": 360 / SIDEREAL_YEAR,
"Moon": 13.176396, "Mars": 0.524, "Jupiter": 0.083, "Saturn": 0.033 } return
(mean_motions.get(planet, 0) * years) % 360

Ecliptic Latitude Calculation (Improved Anomaly


Handling)
def ecliptic_latitude(planet, anomaly): latitudes = { "Moon": 5.145, "Mercury": 7.0, "Venus":
3.4, "Mars": 1.85, "Jupiter": 1.3, "Saturn": 2.49 } return [Link](planet, 0) *
sine_degrees(anomaly)

Precession & Nutation (Ensuring Realistic Adjustments)


def precession(years): return PRECESSION_RATE * years

def nutation(years): return NUTATION_AMPLITUDE * sine_degrees(2 * precession(years))


Aberration Correction (Enhanced for Maximum
Precision)
def aberration_correction(longitude): return 20.496 / 3600 * sine_degrees(longitude)

Declination Calculation (Enhanced with Nutation Effect)


def declination(planet, longitude): return AXIAL_TILT * sine_degrees(longitude) +
nutation(longitude)

Planetary Distance Calculation (Refined for Eccentricity


Variations)
def planetary_distance(planet, anomaly): distances = { "Sun": 1.0, "Moon": 0.00257,
"Mercury": 0.387, "Venus": 0.723, "Mars": 1.524, "Jupiter": 5.203, "Saturn": 9.537 } return
[Link](planet, 0) * (1 + 0.0167 * sine_degrees(anomaly))

Eclipse Prediction (Accurate Orbital Angular Separation)


def eclipse_possibility(sun_long, moon_long): angular_separation = abs(sun_long -
moon_long) % 360 return "Eclipse Possible" if angular_separation < 15 else "No Eclipse"

Test Accuracy of the System for 1000 Years


test_years = 1000 results = {}

for planet in ["Sun", "Moon", "Mars", "Jupiter", "Saturn"]: mean_long =


mean_longitude(planet, test_years) results[planet] = { "Revolutions":
PLANETARY_REVOLUTIONS.get(planet, 0) / YUGA_CYCLE * test_years, "Mean
Longitude": mean_long, "Ecliptic Latitude": ecliptic_latitude(planet, mean_long),
"Declination": declination(planet, mean_long), "Distance from Earth (AU)":
planetary_distance(planet, mean_long), "Precessional Shift": precession(test_years),
"Nutation Correction": nutation(test_years), "Aberration Correction":
aberration_correction(mean_long), "Eclipse Check":
eclipse_possibility(mean_longitude("Sun", test_years), mean_long) }

print(results)

You might also like