<jupyter_start><jupyter_text>NOLAN ROTHCOMPUTATION PROJECTTOPIC: VOSTOK ICE CORE AND MILANKOVICH CYCLESDo large-scale astrodynamics significantly influence Earth's temperature procession?Can multiple periodic astrodynamic functions build a Fourier series near-ish to theVostok ice core c02 concentration data?Astrodynamic processes:ObliquityEccentricityAxial PrecessionApsidal Precession<jupyter_code>import pandas as pd
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
import numpy as np

df = pd.read_csv("vostokdata.txt", sep="\t")
df.head()
plt.figure(figsize=[20,10])

plt.plot(df["Age-of-Ice"],df["co2-con"])
plt.xlabel('Age of Ice (yr)')
plt.ylabel('C02 Concentration (ppmv)')
plt.title("C02 Concentration vs. Time")


def sinefit(x,a,b,c,d):
    return a*np.sin(b*x+c)+d

params, params_covariance = curve_fit(sinefit, df['Age-of-Ice'], df['co2-con'])
t = np.linspace(0,df['Age-of-Ice'].max(),len(df['Age-of-Ice']))
plt.plot(df['Age-of-Ice'],sinefit(t,*params))<jupyter_output><empty_output><jupyter_text>First: ObliquityAxial tilt, the second of the three Milankovitch Cycles, is the inclination of the Earth's axis in relation to its plane of orbit around the Sun. Oscillations in the degree of Earth's axial tilt occur on a periodicity of 41,000 years from 21.5 to 24.5 degrees.-Indiana University thingPeriodicity:21.5 -> 24.5 -> 21.5 over 41000 years; 1 degree / 6833.33 yearsCalibration: Right now, Earth's obliquity is approximitely 23.4 degrees and decreasing, so we need to shift our wave by the difference from least-oblique (21.5 degrees, mapped to -1.00 on the y-axis), which is 1.9 degrees.<jupyter_code>a = 1.5
##omega = (3)/20500
omega = (2*np.pi)*(2.439e-5)
t = np.linspace(0,df['Age-of-Ice'].max(),363)
obliquity = a*np.sin(omega*t+0.269)+23

plt.figure(figsize=[20,10])
plt.plot(t,obliquity)
plt.xlabel('Age (yr)')
plt.ylabel('Obliquity (degrees)')
plt.title('Earth\'s Obliquity vs Time')<jupyter_output><empty_output><jupyter_text>Second: EccentricityThe shape of the Earth's orbit varies between nearly circular (with the lowest eccentricity of 0.000055) and mildly elliptical (highest eccentricity of 0.0679)[3] Its geometric or logarithmic mean is 0.0019. The major component of these variations occurs with a period of 413,000 years (eccentricity variation of ±0.012). Other components have 95,000-year and 125,000-year cycles (with a beat period of 400,000 years). They loosely combine into a 100,000-year cycle (variation of −0.03 to +0.02).-WikipediaPeriodicity: 0.0055% eccentric to 6.79% eccentric cyclic over 100000 years. One extreme to the next in 50000 years; periodicity of 6.7845/50000Calibration: Right now, the Earth's eccentricity is approximitely 0.0167, or 1.67%. Thus, we need to shift the sine wave to start its 0th year point at 1.67.<jupyter_code>a = 3.3922
#omega = (6.7845)/(50000)
omega = (2*np.pi)*(1e-5)
t = np.linspace(0,df['Age-of-Ice'].max(),363)
eccentricity = a*np.sin(omega*t-.5321)+3.392

plt.figure(figsize=[20,10])
plt.plot(t,eccentricity)
plt.xlabel('Age (yr)')
plt.ylabel('Eccentricity (%)')
plt.title('Earth\'s Eccentricity vs Time')<jupyter_output><empty_output><jupyter_text>Third: Axial PrecessionAxial precession is the trend in the direction of the Earth's axis of rotation relative to the fixed stars, with a period of 25,771.5 years.Periodicity: One precession every 25771.5 years; half-precession in 12885.25 years. Thus, the Earth's axial precession brings it from one extreme to the other in 12885.25 years.Calibration: Right now, Earth is approximitely half way through its precession to maximum irradiation, so the shift only needs to represent that the precession is moving towards the opposite-than-default extreme. The precession is moving in a way that in approximitely 13,000 years, the Earth will be at its "hottest" extreme, with the north pole pointing directly at the sun.Mapping: This sine wave is mapped between -1.00 and 1.00, where -1.00 represents the year at which Earth is at its "coldest" extreme, or the north pole is pointed directly away from the sun, and 1.00 represents the year at which Earth was at its "hottest" extreme, or the pole is pointed direclty at the sun.<jupyter_code>a = 1
omega = (2*np.pi)*(3.8803e-5)
t = np.linspace(0,df['Age-of-Ice'].max(),363)
axialprecesion = a*np.sin(omega*t-np.pi)

plt.figure(figsize=[20,10])
plt.plot(t,axialprecesion)
plt.xlabel('Age (yr)')
plt.ylabel('Axial Precession (% of cycle)')
plt.title('Earth\'s Axial Precession vs Time')
wavesum=obliquity+axialprecesion+eccentricity
plt.figure(figsize=[20,10])
plt.plot(t,wavesum)
plt.xlabel('Age (yr)')
plt.ylabel('Axial Precession (% of cycle)')
plt.title('Earth\'s Axial Precession vs Time')
# Create some mock data

fig, ax1 = plt.subplots(figsize=[20,10])

ax1.set_xlabel('Time (yr)')
ax1.set_ylabel('Wave Sum (Unitless)')
ax1.plot(t, wavesum)
ax1.tick_params(axis='y')

ax2 = ax1.twinx()  # instantiate a second axes that shares the same x-axis

color = 'tab:red'
ax2.set_ylabel('sin', color=color)  # we already handled the x-label with ax1
ax2.plot(t, df['co2-con'], color=color)
ax2.tick_params(axis='y', labelcolor=color)

fig.tight_layout()  # otherwise the right y-label is slightly clipped
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12185833968012186, 'fraction_numerical': 0.05616907844630617, 'mean_word_length': 5.640960809102402, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '562139', 'license': 'MIT', 'n_tokens_mistral': 2090, 'n_tokens_neox': 1773, 'n_words': 575, 'path': 'physics/comp-phys/projectbook.ipynb', 'repo_name': 'soundofives/hpu-classes', 'size': '5252'}