OPHI PALEOCLIMATE DRIFT TEST Browser-safe (Pyodide compatible)
output
1:49:59 AM
OPHI PALEOCLIMATE DRIFT TEST
Browser-safe (Pyodide compatible)
import random
from datetime import datetime
print("Starting OPHI Paleoclimate Drift Test")
---- PALEOCLIMATE MODEL ----
Temperature anomaly relative to baseline (°C)
def climate_step(temp, forcing, noise, alpha):
return temp + alpha * (forcing + noise)
---- OPHI-STYLE GATES ----
STABILITY = {
"max_temp_change": 2.0, # °C per step
"max_variance": 1.5, # instability threshold
}
---- SIMULATION ----
def run_paleoclimate_sim(steps=20, alpha=0.6):
temp = 0.0 # baseline anomaly
history = []
for step in range(steps):
# Milankovitch-like slow forcing
forcing = 0.3 * random.choice([-1, 1])
# Climate noise (volcanic, oceanic, etc.)
noise = random.uniform(-0.4, 0.4)
new_temp = climate_step(temp, forcing, noise, alpha)
delta = abs(new_temp - temp)
status = "STABLE"
if delta > STABILITY["max_temp_change"]:
status = "UNSTABLE"
record = {
"step": step,
"timestamp": datetime.utcnow().isoformat() + "Z",
"forcing": round(forcing, 3),
"noise": round(noise, 3),
"temperature_anomaly": round(new_temp, 3),
"delta": round(delta, 3),
"status": status
}
history.append(record)
temp = new_temp
return history
---- RUN TEST ----
results = run_paleoclimate_sim()
print("PALEOCLIMATE RECORD:")
for r in results:
print(r)
Starting OPHI Paleoclimate Drift Test
PALEOCLIMATE RECORD:
{'step': 0, 'timestamp': '2026-01-09T06:49:59.051000Z', 'forcing': -0.3, 'noise': 0.084, 'temperature_anomaly': -0.129, 'delta': 0.129, 'status': 'STABLE'}
{'step': 1, 'timestamp': '2026-01-09T06:49:59.058000Z', 'forcing': -0.3, 'noise': 0.367, 'temperature_anomaly': -0.089, 'delta': 0.04, 'status': 'STABLE'}
{'step': 2, 'timestamp': '2026-01-09T06:49:59.059000Z', 'forcing': 0.3, 'noise': -0.041, 'temperature_anomaly': 0.066, 'delta': 0.155, 'status': 'STABLE'}
{'step': 3, 'timestamp': '2026-01-09T06:49:59.059000Z', 'forcing': 0.3, 'noise': -0.36, 'temperature_anomaly': 0.03, 'delta': 0.036, 'status': 'STABLE'}
{'step': 4, 'timestamp': '2026-01-09T06:49:59.060000Z', 'forcing': 0.3, 'noise': -0.259, 'temperature_anomaly': 0.054, 'delta': 0.025, 'status': 'STABLE'}
{'step': 5, 'timestamp': '2026-01-09T06:49:59.060000Z', 'forcing': -0.3, 'noise': -0.324, 'temperature_anomaly': -0.32, 'delta': 0.374, 'status': 'STABLE'}
{'step': 6, 'timestamp': '2026-01-09T06:49:59.061000Z', 'forcing': 0.3, 'noise': 0.378, 'temperature_anomaly': 0.087, 'delta': 0.407, 'status': 'STABLE'}
{'step': 7, 'timestamp': '2026-01-09T06:49:59.061000Z', 'forcing': -0.3, 'noise': 0.304, 'temperature_anomaly': 0.089, 'delta': 0.003, 'status': 'STABLE'}
{'step': 8, 'timestamp': '2026-01-09T06:49:59.062000Z', 'forcing': -0.3, 'noise': 0.318, 'temperature_anomaly': 0.1, 'delta': 0.011, 'status': 'STABLE'}
{'step': 9, 'timestamp': '2026-01-09T06:49:59.063000Z', 'forcing': 0.3, 'noise': -0.388, 'temperature_anomaly': 0.047, 'delta': 0.053, 'status': 'STABLE'}
{'step': 10, 'timestamp': '2026-01-09T06:49:59.064000Z', 'forcing': 0.3, 'noise': -0.382, 'temperature_anomaly': -0.002, 'delta': 0.049, 'status': 'STABLE'}
{'step': 11, 'timestamp': '2026-01-09T06:49:59.065000Z', 'forcing': -0.3, 'noise': -0.391, 'temperature_anomaly': -0.417, 'delta': 0.415, 'status': 'STABLE'}
{'step': 12, 'timestamp': '2026-01-09T06:49:59.065000Z', 'forcing': 0.3, 'noise': -0.062, 'temperature_anomaly': -0.274, 'delta': 0.143, 'status': 'STABLE'}
{'step': 13, 'timestamp': '2026-01-09T06:49:59.066000Z', 'forcing': 0.3, 'noise': 0.109, 'temperature_anomaly': -0.029, 'delta': 0.245, 'status': 'STABLE'}
{'step': 14, 'timestamp': '2026-01-09T06:49:59.066000Z', 'forcing': -0.3, 'noise': 0.158, 'temperature_anomaly': -0.114, 'delta': 0.085, 'status': 'STABLE'}
{'step': 15, 'timestamp': '2026-01-09T06:49:59.067000Z', 'forcing': -0.3, 'noise': 0.042, 'temperature_anomaly': -0.269, 'delta': 0.155, 'status': 'STABLE'}
{'step': 16, 'timestamp': '2026-01-09T06:49:59.067000Z', 'forcing': 0.3, 'noise': -0.297, 'temperature_anomaly': -0.267, 'delta': 0.002, 'status': 'STABLE'}
{'step': 17, 'timestamp': '2026-01-09T06:49:59.067000Z', 'forcing': 0.3, 'noise': -0.165, 'temperature_anomaly': -0.185, 'delta': 0.081, 'status': 'STABLE'}
{'step': 18, 'timestamp': '2026-01-09T06:49:59.067000Z', 'forcing': -0.3, 'noise': 0.057, 'temperature_anomaly': -0.331, 'delta': 0.146, 'status': 'STABLE'}
{'step': 19, 'timestamp': '2026-01-09T06:49:59.067000Z', 'forcing': 0.3, 'noise': -0.235, 'temperature_anomaly': -0.293, 'delta': 0.039, 'status': 'STABLE'}
Comments
Post a Comment