-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDCAM_model_sim.py
More file actions
65 lines (51 loc) · 2.66 KB
/
Copy pathDCAM_model_sim.py
File metadata and controls
65 lines (51 loc) · 2.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import math
def simulate_chemically_derived_soil_disk():
# --- Physical Constants ---
M_max = 10000.0 # Max electrical surface sites per unit area
sigma_min = 0.2 # Coiled DNA footprint (Dry/High Salt)
sigma_max = 2.0 # Extended DNA footprint (Wet/Low Salt)
kappa = 5.0 # Conformation sensitivity factor
# --- New Chemical Constants (Arrhenius Engine) ---
R = 8.314 # Universal gas constant (J / mol*K)
T = 298.15 # Temperature in Kelvin (25°C)
E_a = 100000.0 # Activation energy for DNA hydrolysis (J / mol)
A = 1.5e16 # Frequency factor (scaled to per-day basis)
beta = 3.0 # Steric hindrance exponent for coiled DNA protection
# --- Kinetic Rates ---
I_in = 500.0 # Constant influx of dying cell DNA per day
alpha = 0.05 # Adsorption affinity constant
# --- Initial States ---
D_surf = 1500.0 # Starting amount of bound base pairs
print(f"{'Day':<6}{'Soil State':<12}{'Ionic (I)':<10}{'Footprint (σ)':<15}{'Memory Stored (D)':<20}")
print("-" * 65)
for day in range(1, 45):
# Weather profile
if day <= 30:
soil_state = "Drying"
I = 0.1 + (0.9 * (day / 30.0))
B_live = 1.0 - (0.9 * (day / 30.0))
else:
soil_state = "Flooded"
I = 0.05
B_live = 2.0
# 1. Calculate the dynamic footprint size of DNA based on Ionic Strength
sigma = sigma_min + (sigma_max - sigma_min) * math.exp(-kappa * I)
# 2. Calculate available space left on the hard drive (theta)
theta_clay = max(0.0, 1.0 - (D_surf * sigma / M_max))
# 3. Microbes consuming/retrieving data
V_max = 0.1
K_m = 500.0
phi_microbe = (V_max * B_live) / (K_m + D_surf)
# 4. UPDATE: Chemically derived Arrhenius decay with structural shielding
base_chemical_rate = A * math.exp(-E_a / (R * T))
p_exposed = (sigma / sigma_max) ** beta
protected_decay = base_chemical_rate * p_exposed
decay = (protected_decay + phi_microbe) * D_surf
# 5. Run the differential loop (dD/dt)
absorption = alpha * I_in * theta_clay
dD_dt = absorption - decay
D_surf += dD_dt # Step forward 1 day
# Print matching intervals for exact comparison
if day in [1, 10, 20, 30, 31, 35, 44]:
print(f"{day:<6}{soil_state:<12}{I:<10.2f}{sigma:<15.4f}{D_surf:<20.2f}")
simulate_chemically_derived_soil_disk()