# mdubery/masters architecture

> Architecture diagram of the GitHub repository mdubery/masters, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mdubery/masters
- Repository: https://github.com/mdubery/masters

## Overview

This is a research codebase for simulating photoevaporative loss of a planet’s hydrogen envelope, with separate machine-learning experiments on simulation outcomes. The main workflow configures a planet, integrates its envelope fraction over time, recalculates its structure and mass loss, and plots radius and envelope history. A compiled fast path supports final-state runs; the repository also includes Aiolos rate tables and a 6D classifier/regressor experiment. Relationships for unsampled scripts and data-generation stages are omitted where their wiring is not evidenced.

Main entry points: [`evolution_model/mass_fraction_evolver.py`](https://github.com/mdubery/masters/blob/main/evolution_model/mass_fraction_evolver.py) (Envelope Integrator), [`evolution_model/main.py`](https://github.com/mdubery/masters/blob/main/evolution_model/main.py) (Evolution Demo), [`evolution_model/fast_evolver.py`](https://github.com/mdubery/masters/blob/main/evolution_model/fast_evolver.py) (Fast Integrator), [`evolution_model/aiolos_mass_loss.py`](https://github.com/mdubery/masters/blob/main/evolution_model/aiolos_mass_loss.py) (Aiolos Rates)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_simulation["Planet Evolution"]
  node_main["Evolution Demo<br/>[main.py]"]
  node_evolver["Envelope Integrator"]
  node_fast["Fast Integrator<br/>[fast_evolver.py]"]
  node_rk["Cash-Karp Stepper<br/>[RKF45.py]"]
  node_plot["Evolution Plots<br/>[main.py]"]
  node_exploration["Period Sweep<br/>[M_test_1.py]"]
end

subgraph group_physics["Physical Models"]
  node_structure["Planet Structure"]
  node_loss["Aiolos Rates"]
  node_constants["Physical Constants<br/>[constants.py]"]
end

subgraph group_data["Model Data"]
  node_aiolos_data["Aiolos CSV Grid"]
  node_training_data["6D Training Data"]
end

subgraph group_ml["ML Experiments"]
  node_ml_script["6D ML Experiment<br/>[6D_test_MLPR.py]"]
end

node_researcher(("Researcher"))

node_researcher -->|"configures"| node_main
node_main -->|"runs evolution"| node_evolver
node_main -->|"plots history"| node_plot
node_evolver -->|"steps with"| node_rk
node_evolver -->|"computes radii"| node_structure
node_evolver -->|"evaluates rates"| node_loss
node_evolver -->|"dispatches to"| node_fast
node_evolver -->|"uses constants"| node_constants
node_structure -->|"uses constants"| node_constants
node_fast -->|"uses rates"| node_loss
node_fast -->|"uses constants"| node_constants
node_loss -.->|"loads tables"| node_aiolos_data
node_researcher -->|"runs sweep"| node_exploration
node_exploration -->|"runs evolution"| node_evolver
node_researcher -->|"runs experiment"| node_ml_script
node_ml_script -->|"reads data"| node_training_data

click node_main "https://github.com/mdubery/masters/blob/main/evolution_model/main.py"
click node_evolver "https://github.com/mdubery/masters/blob/main/evolution_model/mass_fraction_evolver.py"
click node_fast "https://github.com/mdubery/masters/blob/main/evolution_model/fast_evolver.py"
click node_rk "https://github.com/mdubery/masters/blob/main/evolution_model/RKF45.py"
click node_structure "https://github.com/mdubery/masters/blob/main/evolution_model/planet_structure.py"
click node_loss "https://github.com/mdubery/masters/blob/main/evolution_model/aiolos_mass_loss.py"
click node_constants "https://github.com/mdubery/masters/blob/main/evolution_model/constants.py"
click node_aiolos_data "https://github.com/mdubery/masters/tree/main/evolution_model/Aiolos%20mass%20loss%20rates/V2"
click node_ml_script "https://github.com/mdubery/masters/blob/main/evolution_model/6D_test_MLPR.py"
click node_training_data "https://github.com/mdubery/masters/blob/main/evolution_model/training_data_6D.csv"
click node_plot "https://github.com/mdubery/masters/blob/main/evolution_model/main.py"
click node_exploration "https://github.com/mdubery/masters/blob/main/evolution_model/M_test_1.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_evolver,node_fast,node_rk,node_plot,node_exploration toneBlue
class node_structure,node_loss,node_constants toneAmber
class node_aiolos_data,node_training_data toneMint
class node_ml_script toneRose
class node_researcher toneIndigo
```

## Components

### Planet Evolution

- [Evolution Demo](https://github.com/mdubery/masters/blob/main/evolution_model/main.py): `evolution_model/main.py`
- [Envelope Integrator](https://github.com/mdubery/masters/blob/main/evolution_model/mass_fraction_evolver.py): `evolution_model/mass_fraction_evolver.py`
- [Fast Integrator](https://github.com/mdubery/masters/blob/main/evolution_model/fast_evolver.py): `evolution_model/fast_evolver.py`
- [Cash-Karp Stepper](https://github.com/mdubery/masters/blob/main/evolution_model/RKF45.py): `evolution_model/RKF45.py`
- [Evolution Plots](https://github.com/mdubery/masters/blob/main/evolution_model/main.py): `evolution_model/main.py`
- [Period Sweep](https://github.com/mdubery/masters/blob/main/evolution_model/M_test_1.py): `evolution_model/M_test_1.py`

### Physical Models

- [Planet Structure](https://github.com/mdubery/masters/blob/main/evolution_model/planet_structure.py): `evolution_model/planet_structure.py`
- [Aiolos Rates](https://github.com/mdubery/masters/blob/main/evolution_model/aiolos_mass_loss.py): `evolution_model/aiolos_mass_loss.py`
- [Physical Constants](https://github.com/mdubery/masters/blob/main/evolution_model/constants.py): `evolution_model/constants.py`

### Model Data

- [Aiolos CSV Grid](https://github.com/mdubery/masters/tree/main/evolution_model/Aiolos%20mass%20loss%20rates/V2): `evolution_model/Aiolos mass loss rates/V2`
- [6D Training Data](https://github.com/mdubery/masters/blob/main/evolution_model/training_data_6D.csv): `evolution_model/training_data_6D.csv`

### ML Experiments

- [6D ML Experiment](https://github.com/mdubery/masters/blob/main/evolution_model/6D_test_MLPR.py): `evolution_model/6D_test_MLPR.py`

### Other components

- **Researcher**

## Connections

- Researcher → Evolution Demo: configures (evidence: `evolution_model/main.py`)
- Evolution Demo → Envelope Integrator: runs evolution (evidence: `evolution_model/main.py`)
- Evolution Demo → Evolution Plots: plots history (evidence: `evolution_model/main.py`)
- Envelope Integrator → Cash-Karp Stepper: steps with (evidence: `evolution_model/mass_fraction_evolver.py`)
- Envelope Integrator → Planet Structure: computes radii (evidence: `evolution_model/mass_fraction_evolver.py`)
- Envelope Integrator → Aiolos Rates: evaluates rates (evidence: `evolution_model/mass_fraction_evolver.py`)
- Envelope Integrator → Fast Integrator: dispatches to (evidence: `evolution_model/mass_fraction_evolver.py`)
- Envelope Integrator → Physical Constants: uses constants (evidence: `evolution_model/mass_fraction_evolver.py`)
- Planet Structure → Physical Constants: uses constants (evidence: `evolution_model/planet_structure.py`)
- Fast Integrator → Aiolos Rates: uses rates (evidence: `evolution_model/fast_evolver.py`)
- Fast Integrator → Physical Constants: uses constants (evidence: `evolution_model/fast_evolver.py`)
- Aiolos Rates → Aiolos CSV Grid: loads tables
- Researcher → Period Sweep: runs sweep (evidence: `evolution_model/M_test_1.py`)
- Period Sweep → Envelope Integrator: runs evolution (evidence: `evolution_model/M_test_1.py`)
- Researcher → 6D ML Experiment: runs experiment (evidence: `evolution_model/6D_test_MLPR.py`)
- 6D ML Experiment → 6D Training Data: reads data (evidence: `evolution_model/6D_test_MLPR.py`)
