# theburkelab/msi architecture

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

- Interactive diagram: https://gitdiagram.com/theburkelab/msi
- Repository: https://github.com/theburkelab/msi

## Overview

This repository is a development-stage chemical-kinetics simulation and mechanism-optimization package. Its principal workflow is to parse experiment descriptions, run reactor simulations against a Cantera mechanism, compare simulated outputs with experimental observations, assemble sensitivity/target matrices, and optimize mechanism parameters; optional branches cover absorbance and master-equation treatment. The sampled runner and instrument code support the simulation and sensitivity links shown. The README documents no capabilities, and several modules were not sampled, so links to those subsystems are limited to relationships supported by the tree and sampled imports.

Main entry points: [`optimization/opt_runner.py`](https://github.com/theburkelab/msi/blob/main/optimization/opt_runner.py) (Experiment runner), [`optimization/optimization_shell_chebyshev.py`](https://github.com/theburkelab/msi/blob/main/optimization/optimization_shell_chebyshev.py) (Chebyshev optimizer), [`simulations/instruments/shock_tube.py`](https://github.com/theburkelab/msi/blob/main/simulations/instruments/shock_tube.py) (Shock tube), [`cti_core/cti_processor.py`](https://github.com/theburkelab/msi/blob/main/cti_core/cti_processor.py) (Mechanism processor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Experiment inputs"]
  node_yaml["Experiment parser<br/>[yaml_parser.py]"]
  node_absorbdata["Absorbance curves"]
end

subgraph group_simulation["Reactor simulation"]
  node_base["Simulation base<br/>[simulation.py]"]
  node_shock["Shock tube<br/>[shock_tube.py]"]
  node_ignition["Ignition delay<br/>[ignition_delay.py]"]
  node_jsr["JSR reactor<br/>[jsr_steadystate.py]"]
  node_flow["Flow reactor<br/>[flow_reactor.py]"]
  node_rcm["RCM<br/>[RCM.py]"]
  node_flames["Flame simulation<br/>[flames.py]"]
  node_variable["Variable-pressure shock"]
  node_absorb["Absorbance modeling"]
end

subgraph group_optimization["Parameter optimization"]
  node_runner["Experiment runner<br/>[opt_runner.py]"]
  node_shell["Chebyshev optimizer"]
  node_matrix["Sensitivity matrices<br/>[matrix_loader.py]"]
  node_master["Master equation<br/>[master_equation.py]"]
end

subgraph group_mechanism["Mechanism processing"]
  node_processor["Mechanism processor<br/>[cti_processor.py]"]
  node_combine["Mechanism combiner<br/>[cti_combine.py]"]
  node_writer["CTI writer<br/>[soln2cti_py3.py]"]
end

node_user(("Researcher"))
node_mechanismfile["Kinetic mechanism"]
node_result["Optimized parameters"]

node_user -->|"configures"| node_shell
node_shell -->|"dispatches experiments"| node_runner
node_runner -->|"parses inputs"| node_yaml
node_runner -->|"runs reactor"| node_shock
node_runner -->|"runs delay"| node_ignition
node_runner -->|"runs reactor"| node_jsr
node_runner -->|"runs reactor"| node_flow
node_runner -->|"runs reactor"| node_rcm
node_runner -->|"runs flames"| node_flames
node_runner -->|"runs reactor"| node_variable
node_shell -->|"builds matrices"| node_matrix
node_shell -->|"builds master matrix"| node_master
node_shell -->|"produces"| node_result
node_runner -->|"uses absorbance data"| node_absorbdata
node_runner -->|"superimposes curves"| node_absorb
node_absorb -->|"uses time history"| node_shock
node_shock -->|"inherits"| node_base
node_ignition -->|"inherits"| node_base
node_shock -->|"uses mechanism"| node_processor
node_ignition -->|"uses mechanism"| node_processor
node_processor -->|"loads"| node_mechanismfile
node_processor -->|"writes mechanism"| node_writer
node_matrix -->|"uses equations"| node_master
node_combine -->|"combines reactions"| node_mechanismfile

click node_yaml "https://github.com/theburkelab/msi/blob/main/simulations/yaml_parser.py"
click node_absorbdata "https://github.com/theburkelab/msi/blob/main/simulations/absorbance/curve_superimpose.py"
click node_runner "https://github.com/theburkelab/msi/blob/main/optimization/opt_runner.py"
click node_shell "https://github.com/theburkelab/msi/blob/main/optimization/optimization_shell_chebyshev.py"
click node_matrix "https://github.com/theburkelab/msi/blob/main/optimization/matrix_loader.py"
click node_master "https://github.com/theburkelab/msi/blob/main/master_equation/master_equation.py"
click node_base "https://github.com/theburkelab/msi/blob/main/simulations/simulation.py"
click node_shock "https://github.com/theburkelab/msi/blob/main/simulations/instruments/shock_tube.py"
click node_ignition "https://github.com/theburkelab/msi/blob/main/simulations/instruments/ignition_delay.py"
click node_jsr "https://github.com/theburkelab/msi/blob/main/simulations/instruments/jsr_steadystate.py"
click node_flow "https://github.com/theburkelab/msi/blob/main/simulations/instruments/flow_reactor.py"
click node_rcm "https://github.com/theburkelab/msi/blob/main/simulations/instruments/RCM.py"
click node_flames "https://github.com/theburkelab/msi/blob/main/simulations/instruments/flames.py"
click node_variable "https://github.com/theburkelab/msi/blob/main/simulations/instruments/variable_pressure_shock_tube.py"
click node_absorb "https://github.com/theburkelab/msi/blob/main/simulations/absorbance/curve_superimpose.py"
click node_processor "https://github.com/theburkelab/msi/blob/main/cti_core/cti_processor.py"
click node_combine "https://github.com/theburkelab/msi/blob/main/cti_core/cti_combine.py"
click node_writer "https://github.com/theburkelab/msi/blob/main/utilities/soln2cti_py3.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_yaml,node_absorbdata toneBlue
class node_base,node_shock,node_ignition,node_jsr,node_flow,node_rcm,node_flames,node_variable,node_absorb toneAmber
class node_runner,node_shell,node_matrix,node_master toneMint
class node_processor,node_combine,node_writer toneRose
class node_user,node_mechanismfile,node_result toneIndigo
```

## Components

### Experiment inputs

- [Experiment parser](https://github.com/theburkelab/msi/blob/main/simulations/yaml_parser.py): `simulations/yaml_parser.py`
- [Absorbance curves](https://github.com/theburkelab/msi/blob/main/simulations/absorbance/curve_superimpose.py): `simulations/absorbance/curve_superimpose.py`

### Reactor simulation

- [Simulation base](https://github.com/theburkelab/msi/blob/main/simulations/simulation.py): `simulations/simulation.py`
- [Shock tube](https://github.com/theburkelab/msi/blob/main/simulations/instruments/shock_tube.py): `simulations/instruments/shock_tube.py`
- [Ignition delay](https://github.com/theburkelab/msi/blob/main/simulations/instruments/ignition_delay.py): `simulations/instruments/ignition_delay.py`
- [JSR reactor](https://github.com/theburkelab/msi/blob/main/simulations/instruments/jsr_steadystate.py): `simulations/instruments/jsr_steadystate.py`
- [Flow reactor](https://github.com/theburkelab/msi/blob/main/simulations/instruments/flow_reactor.py): `simulations/instruments/flow_reactor.py`
- [RCM](https://github.com/theburkelab/msi/blob/main/simulations/instruments/RCM.py): `simulations/instruments/RCM.py`
- [Flame simulation](https://github.com/theburkelab/msi/blob/main/simulations/instruments/flames.py): `simulations/instruments/flames.py`
- [Variable-pressure shock](https://github.com/theburkelab/msi/blob/main/simulations/instruments/variable_pressure_shock_tube.py): `simulations/instruments/variable_pressure_shock_tube.py`
- [Absorbance modeling](https://github.com/theburkelab/msi/blob/main/simulations/absorbance/curve_superimpose.py): `simulations/absorbance/curve_superimpose.py`

### Parameter optimization

- [Experiment runner](https://github.com/theburkelab/msi/blob/main/optimization/opt_runner.py): `optimization/opt_runner.py`
- [Chebyshev optimizer](https://github.com/theburkelab/msi/blob/main/optimization/optimization_shell_chebyshev.py): `optimization/optimization_shell_chebyshev.py`
- [Sensitivity matrices](https://github.com/theburkelab/msi/blob/main/optimization/matrix_loader.py): `optimization/matrix_loader.py`
- [Master equation](https://github.com/theburkelab/msi/blob/main/master_equation/master_equation.py): `master_equation/master_equation.py`

### Mechanism processing

- [Mechanism processor](https://github.com/theburkelab/msi/blob/main/cti_core/cti_processor.py): `cti_core/cti_processor.py`
- [Mechanism combiner](https://github.com/theburkelab/msi/blob/main/cti_core/cti_combine.py): `cti_core/cti_combine.py`
- [CTI writer](https://github.com/theburkelab/msi/blob/main/utilities/soln2cti_py3.py): `utilities/soln2cti_py3.py`

### Other components

- **Researcher**
- **Kinetic mechanism**
- **Optimized parameters**

## Connections

- Researcher → Chebyshev optimizer: configures
- Chebyshev optimizer → Experiment runner: dispatches experiments
- Experiment runner → Experiment parser: parses inputs
- Experiment runner → Shock tube: runs reactor
- Experiment runner → Ignition delay: runs delay
- Experiment runner → JSR reactor: runs reactor
- Experiment runner → Flow reactor: runs reactor
- Experiment runner → RCM: runs reactor
- Experiment runner → Flame simulation: runs flames
- Experiment runner → Variable-pressure shock: runs reactor
- Chebyshev optimizer → Sensitivity matrices: builds matrices
- Chebyshev optimizer → Master equation: builds master matrix
- Chebyshev optimizer → Optimized parameters: produces
- Experiment runner → Absorbance curves: uses absorbance data
- Experiment runner → Absorbance modeling: superimposes curves
- Absorbance modeling → Shock tube: uses time history
- Shock tube → Simulation base: inherits
- Ignition delay → Simulation base: inherits
- Shock tube → Mechanism processor: uses mechanism
- Ignition delay → Mechanism processor: uses mechanism
- Mechanism processor → Kinetic mechanism: loads
- Mechanism processor → CTI writer: writes mechanism
- Sensitivity matrices → Master equation: uses equations
- Mechanism combiner → Kinetic mechanism: combines reactions
