SciForge

A comprehensive scientific computing library written in pure Rust — zero dependencies, 11 modules, 96 600+ lines of code.

Rust Edition 2024 MIT License Zero Dependencies 815 Tests Passing

Project Documentation

Interactive documentation viewer: select a tab, then choose a document from the left panel to render it directly in this page.

SciForge

A comprehensive scientific computing library written in pure Rust with zero external dependencies.

License: MIT

Rust Edition

Dependencies

Tests

Clippy

Homepage · Repository · Documentation

Overview

SciForge is a scientific computing library covering 11 domains — mathematics, physics, chemistry, biology, geology, astronomy, meteorology — all in a single, dependency-free Rust crate.

It also provides a centralized orchestration system (Hub), a benchmark engine with multi-format export, a parser supporting 6 file formats, and a complete periodic table dataset (118 elements, IUPAC 2024).

Key Figures

Rust source files804
Test files172
Unit and integration tests814
Scientific submodules126
Published physical constants~527
Periodic table elements118
External dependencies0
Clippy warnings0
`#[allow]` directives0

Principles

  • Zero dependencies — everything is implemented in pure Rust, including parsers, the HTTP server, and binary encoding.
  • **Zero comments** — code is designed to be self-explanatory; documentation lives in docs/.
  • **Zero warnings** — no `#[allow]` directives, no clippy warnings tolerated.
  • Pure functions — clear signatures, no hidden state, no side effects.

Installation

[dependencies]
sciforge = "0.0.3"

Modules

Constants — Physical Constants and Element Data

6 submodules. ~527 published constants covering CODATA fundamental constants ($c$, $G$, $h$, $\hbar$, $k_B$, $N_A$, $e$, $\varepsilon_0$, $\mu_0$, $\sigma_{SB}$, $\alpha$, Planck units), astronomical constants (AU, parsec, solar/Earth parameters, Hubble constant), atomic constants (particle masses, Bohr radius, Rydberg energy, magnetons), unit conversion factors (eV↔J, cal↔J, atm↔Pa, deg↔rad, barn, ångström), and the full periodic table (118 elements loaded from YAML via OnceLock).

Mathematics — Numerical Methods and Pure Mathematics

17 submodules: complex arithmetic, linear algebra (Gauss elimination, LU/Cholesky decomposition, eigenvalues), calculus (symbolic differentiation, Simpson/Gauss quadrature, automatic differentiation), ODE solvers (Euler, RK4, adaptive RK45), Fourier and Laplace transforms, statistics (descriptive, distributions, hypothesis testing), probability, number theory (primes, GCD, modular arithmetic), combinatorics, set theory, graph theory (BFS, DFS, Dijkstra, Kruskal), geometry (2D/3D transforms, convex hull), trigonometry, polynomial operations, vector calculus (gradient, divergence, curl, Stokes' theorem), and special functions (Gamma, Beta, Bessel, error function).

Physics — Classical and Modern Physics

12 submodules: acoustics (wave equation, Doppler, decibels, resonance), electrodynamics (Maxwell's equations, Lorentz force, Poynting vector), electronics (Ohm's law, RC/RL/RLC circuits, transistors, op-amps), fluid mechanics (Navier-Stokes, Bernoulli, Reynolds number, drag), materials science (stress-strain, Young's modulus, Hooke, creep), nucleosynthesis (binding energy, decay chains, pp-chain, CNO cycle), optics (Snell, thin lenses, diffraction, interference, polarization), quantum mechanics (Schrödinger equation, particle-in-a-box, harmonic oscillator, hydrogen atom, tunneling), relativity (Lorentz transforms, $E = mc^2$, time dilation, Schwarzschild metric), solid mechanics (beam bending, torsion, Mohr's circle, buckling), thermodynamics (laws of thermodynamics, Carnot cycle, entropy, heat transfer, blackbody radiation), and particle physics (Planck units, Hawking temperature, weak/strong couplings, QCD running, Compton time).

Chemistry — Physical, Analytical, and Computational Chemistry

26 submodules: acid-base equilibria (Henderson-Hasselbalch, polyprotic titrations), kinetics (Arrhenius, Eyring, Lindemann), electrochemistry (Nernst, Butler-Volmer, Tafel), thermochemistry (Hess's law, Kirchhoff), gas laws (van der Waals, virial, compressibility), quantum chemistry (Hartree-Fock, DFT, Slater determinants), crystallography (Bragg's law, Miller indices, 14 Bravais lattices), molecular modeling (Lennard-Jones, Morse potential, VSEPR), colloids (DLVO theory, Stokes-Einstein), green chemistry (atom economy, E-factor), and environmental chemistry (Henry's law, BOD/COD).

Biology — The Largest Scientific Module

44 submodules covering: aging (Gompertz/Weibull mortality, telomere dynamics), bioelectricity (Nernst, Goldman-Hodgkin-Katz, Hodgkin-Huxley), bioenergetics (ATP yield, Kleiber's law), biomechanics (Poiseuille flow, Hill muscle model), biophysics (Helfrich membrane, WLC, FRET), biostatistics (Kaplan-Meier, meta-analysis), ecology (Lotka-Volterra, Rosenzweig-MacArthur), enzyme kinetics (Michaelis-Menten, Hill, inhibition), evolution (molecular clock, dN/dS, coalescent), genetics (Hardy-Weinberg, $F_{ST}$), immunology (affinity maturation), neuroscience (integrate-and-fire), pharmacology (PK/PD, hepatic clearance), population dynamics (Leslie matrix, SIR/SEIR), synthetic biology (toggle switch, repressilator, FBA), virology (quasispecies, error catastrophe), and 28 more submodules.

Geology — Earth Sciences and Geophysics

10 submodules: radiometric dating (decay law $N(t) = N_0 e^{-\lambda t}$, half-life conversion, isochron method, $^{14}$C calibration), petrology (CIPW norm, magma viscosity, Stokes settling, crystallization sequences), seismology (P/S/surface wave propagation, Gutenberg-Richter, Omori aftershock law, magnitude scales $M_L$/$M_W$/$m_b$, focal mechanisms), tectonics (plate velocity on a sphere, Euler poles, Byerlee's friction law, thermal subsidence), erosion, geomorphology, glaciology, hydrology, mantle dynamics, and volcanism.

Astronomy — Astrophysics and Cosmology

9 submodules: celestial mechanics (ecliptic/equatorial/galactic coordinate transforms, Julian date, sidereal time, nutation), cosmology (direct $E(z)$ parameterizations, $H(z)$ evaluation, comoving/luminosity/angular-diameter distances in ΛCDM/wCDM/CPL, dark-energy equation-of-state models), orbital dynamics (Kepler's laws, vis-viva, Hohmann transfers, orbital perturbations), stellar physics (HR diagram, luminosity-mass-radius relations, main-sequence lifetime, stellar nucleosynthesis), galactic dynamics, impacts, planetary science, rotation and tides.

Meteorology — Atmospheric Sciences

8 submodules: atmosphere (barometric formula, ISA standard layers, pressure altitude, scale height, lapse rates), dynamics (geostrophic/gradient wind, Rossby number, vorticity, thermal wind, Ekman spiral, CAPE/CIN, Richardson number), precipitation (Clausius-Clapeyron, Köhler theory, Marshall-Palmer DSD, $Z$–$R$ relations, terminal velocity, Bergeron process), radiation (Planck blackbody, Wien's law, Stefan-Boltzmann, solar zenith angle, Beer-Lambert atmospheric extinction, albedo, greenhouse radiative forcing $\Delta F = 5.35 \ln(C/C_0)$), cloud microphysics, ocean-atmosphere interactions, storms, and winds.

Hub — Centralized Orchestration

The Hub is SciForge's central orchestration layer. It provides a unified API for running scientific experiments across all domains through a dispatch system.

Architecture

ComponentRole
APICLI, DTOs (ComputeRequest/ComputeResponse), HTTP server (TcpListener), routes
DomainDispatchers for all 7 scientific modules + cross-domain (astrochemistry, geophysics, astrophysics, biochemistry, biophysics, geochemistry, astrobiology, etc.)
EngineExperiment builder, ExperimentRunner, DynamicalSystem (ODE), scheduler with topological sort, campaign batch execution
ToolsArena allocator, profiler, determinism, validation, visualization
PreludeErgonomic re-exports

Supported Domains

19 domains:

Maths · Physics · Chemistry · Biology · Astronomy · Geology · Meteorology
Astrochemistry · Geophysics · Astrophysics · Biochemistry · Biophysics
Geochemistry · Astrobiology · AtmosphericChemistry · AtmosphericPhysics
PlanetaryGeology · Biomathematics · MathematicalPhysics

Parameter Types

14 parameter types:

Scalar(f64) · Integer(i64) · Vector(Vec<f64>) · Matrix(Vec<Vec<f64>>)
Boolean(bool) · Text(String) · Complex(f64, f64) · ComplexVector
Polynomial · IntVector · IntMatrix · EdgeList · Sparse · Tensor

Usage Example

use sciforge::hub::prelude::*;

let experiment = Experiment::new(DomainType::Astronomy, "hubble_at_z_lcdm")
    .param("h0", ParameterValue::Scalar(67.4))
    .param("omega_m", ParameterValue::Scalar(0.315))
    .param("z", ParameterValue::Scalar(1.0));

let result = ExperimentRunner::new().run(&experiment)?;

Parser — Zero-Dependency Multi-Format Parsing

6 supported formats, 26 source files, layered Cursor<'a> architecture with zero-copy &'a str borrowing.

FormatStandardDetails
CSVRFC 4180CsvValue (Table/Record/Field), quoted field handling, writer
JSONRFC 8259JsonValue (6 variants), number/string submodules
YAMLYamlValue, indent-based LineCursor, scalar type auto-detection — used to load periodic table data
HTMLHtmlValue (Document/Element/Text/Comment), named entity decoding — used by Benchmark export
MarkdownMdValue (9 block-level variants), inline emphasis, links, code
TOML10 functions, 5 structs, 3 enums, 3 constants

Benchmark — Performance Engine and Export

The benchmark module provides a complete performance measurement engine with:

  • BenchmarkMetrics: 30+ field struct with statistical aggregation
  • Compact binary encoding (magic header, LE layout, 168+ byte records)
  • Zero-copy decoding via BenchmarkMetricsView
  • Simulation framework with SimState/SimConfig/StepFn traits
  • Multi-format report generation (CSV, Markdown, HTML, JSON, YAML, TOML)
  • Interactive HTML dashboard with IUPAC 2024 periodic table grid, click-to-detail element cards, SVG chart visualizations, tabbed file browser

Periodic Table

118 YAML data files organized by IUPAC category under tableau-periodique/:

tableau-periodique/
├── actinides/
├── elements-superlourds/
├── gaz-nobles/
├── halogenes/
├── lanthanides/
├── metalloides/
├── metaux-alcalino-terreux/
├── metaux-alcalins/
├── metaux-de-transition/
├── metaux-post-transition/
└── non-metaux/

Data is loaded at runtime by the Constants module via the internal YAML parser and cached with OnceLock.

Documentation

Documentation is organized in two complementary layers:

LayerPathContent
Scientificdocs/modules/Concepts, formulas, assumptions, modeled phenomena
Implementationdocs/code/Rust API, structs, signatures, execution flow
Indexdocs/Summary.mdEntry point mapping each module guide to its code guide

Start with docs/modules/ for scientific context, then docs/code/ for implementation details.

Project Structure

src/
├── lib.rs
├── constants/          6 submodules — physical constants and element data
├── maths/             17 submodules — numerical methods and pure mathematics
├── physics/           12 submodules — classical and modern physics
├── chemistry/         26 submodules — physical, analytical, computational chemistry
├── biology/           44 submodules — computational biology
├── geology/           10 submodules — earth sciences
├── astronomy/          9 submodules — astrophysics and cosmology
├── meteorology/        8 submodules — atmospheric sciences
├── hub/                5 components — centralized orchestration
├── benchmark/          6 submodules — benchmark engine and exports
└── parser/             6 submodules — multi-format parsing

tests/
├── scientific_validation.rs     scientific reference validation suite
├── scientific_properties.rs     property/invariant validation suite
├── benchmark/                   benchmark integration tests
├── parser/                      parser integration tests
├── constants/                   constants tests
├── maths/                       mathematics tests
├── physics/                     physics tests
├── chemistry/                   chemistry tests
├── biology/                     biology tests
├── geology/                     geology tests
├── astronomy/                   astronomy tests
├── meteorology/                 meteorology tests
└── hub/                         orchestration and cross-domain tests

tableau-periodique/              118 YAML element files (IUPAC 2024)
docs/                            scientific and API documentation
output/                          benchmark outputs, organized per domain:
    astronomy/                   bmk/ csv/ json/ toml/ yaml/ + .html .md
    benchmark/                   bmk/ csv/ json/ toml/ yaml/ + .html .md
    biology/                     bmk/ csv/ json/ toml/ yaml/ + .html .md
    chemistry/                   bmk/ csv/ json/ toml/ yaml/ + .html .md
    constants/                   bmk/ csv/ json/ toml/ yaml/ + .html .md
    geology/                     bmk/ csv/ json/ toml/ yaml/ + .html .md
    hub/                         bmk/ csv/ json/ toml/ yaml/ + .html .md
    maths/                       bmk/ csv/ json/ toml/ yaml/ + .html .md
    meteorology/                 bmk/ csv/ json/ toml/ yaml/ + .html .md
    parser/                      bmk/ csv/ json/ toml/ yaml/ + .html .md
    physics/                     bmk/ csv/ json/ toml/ yaml/ + .html .md
    validation/                  bmk/ csv/ json/ toml/ yaml/ + .html .md

Examples

8 runnable examples under examples/, each using the benchmark engine with multi-format export to output/examples/.

ExampleDomainDescription
periodic_tableConstants118 elements with grid positioning, multi-precision benchmark
solar_systemAstronomyOrbital mechanics (Kepler periods, orbital velocities) for 8 planets
chemical_reactionsChemistryStoichiometry and bond energies for 8 reactions
star_catalogAstronomyStellar luminosity, magnitude, spectral classification for 10 stars
weather_stationMeteorologyAtmospheric calculations (pressure, dew point) for 10 stations
radioactive_decayChemistryDecay chains and nuclear energy for radioactive isotopes
unit_converterHubSI/CGS unit conversions (length, temperature, mass, pressure)
geological_agesGeologyRadiometric dating (U-Pb, K-Ar) on geological samples
cargo run --example periodic_table
cargo run --example solar_system
cargo run --example chemical_reactions
cargo run --example star_catalog
cargo run --example weather_station
cargo run --example radioactive_decay
cargo run --example unit_converter
cargo run --example geological_ages

Building and Testing

cargo build
cargo test
cargo clippy

Dedicated test targets include: benchmark, parser, constants, maths, physics, chemistry, biology, geology, astronomy, meteorology, hub, scientific_validation, and scientific_properties.

Contributing

See Contributing.md for guidelines.

Roadmap

See ComingSoon.md for the roadmap.

Changelog

See ChangeLog.md and ChangeLog/ for detailed per-module history.

License

MIT

Changelog

All notable changes to SciForge are documented in this file.

Each module has a detailed ChangeLog with full function tables.

Detailed ChangeLogs

ModuleChangeLog
AstronomyBenchmarkBiologyChemistry
ConstantsCosmologyDocumentationGeology
HubMathematicsMeteorologyParser
Periodic TablePhysicsTesting

[0.0.3] - 2026-04-11

ModuleChanges
AstronomyNew galactic submodule (21 pub fn)
BenchmarkRefactored export.rsexport/ (8 files)
ConstantsRestructured 5 flat files → 6 domain submodules (20 files, ~527 pub const)
CosmologyExpanded 91 → 124 pub fn (+33), replaced hardcoded constants
DocumentationUpdated 14/23 docs files, added 15 ChangeLog files
GeologyNew erosion (5 fn) and geomorphology (20 fn) submodules
HubRefactored dispatch → per-domain (~190 files), new astrobiology cross-domain
Mathematics10 new functions (integration/quadrature +8, probability/distributions +2)
MeteorologyNew clouds submodule (21 fn) + new functions across submodules
ParserNew TOML parser (10 fn, 5 structs, 3 enums, 3 consts)
PhysicsNew particle submodule (35 pub fn)
Testing369 → 814 tests (+445), 46 → 172 test files (+126)
Examples8 runnable examples — periodic_table, solar_system, chemical_reactions, star_catalog, weather_station, radioactive_decay, unit_converter, geological_ages
RefactoringSplit files > 600 lines (src/benchmark/*/, tests/parser.rs, tests/benchmark.rs)
DocumentationComplete API reference for all public functions
TestingComplete test coverage in less-covered scientific submodules
ValidationScientific validation pipeline with blocking thresholds
HubCross-domain scenarios (astrochemistry, geophysics, …) with numeric validations
BenchmarkReadable .bmk in HTML benchmark reports
ConstantsDeleted duplicate SPEED_OF_LIGHT (C) across the codebase

[0.0.2] - 2026-03-24

  • Documentation — consolidated under docs/ (paired modules/ + code/ guides)
  • Testing — scientific validation and property-based suites, expanded integration coverage
  • Astronomy / Hub — extended cosmology E(z), H(z) helpers and Hub dispatch integration
  • Bumped crate version to 0.0.2

[0.0.1] - 2026-03-23

Initial release — Rust edition 2024, zero external dependencies, 575 source files, 48 600+ lines.

ModuleScope
ConstantsCODATA physical constants, astrophysical/atomic constants, unit conversions, 118 elements
Mathematics17 submodules — complex, tensor, vector, polynomial, linalg, sparse, integration, interpolation, ODE, PDE, FFT, optimization, statistics, probability, signal, graph, non-euclidean
Physics11 submodules — relativity, quantum, thermo, electrodynamics, fluids, solids, optics, acoustics, nucleosynthesis, electronics, materials
Chemistry26 submodules — kinetics, equilibrium, electro/thermo-chemistry, molecular, organic, inorganic, analytical, quantum, solutions, gas laws, nuclear, polymers, spectroscopy, crystallography, etc.
Biology44 submodules — population dynamics, genetics, genomics, enzyme kinetics, neuroscience, ecology, evolution, bioinformatics, microbiology, etc.
Geology4 submodules — seismology, radiometric dating, petrology, plate tectonics
Astronomy4 submodules — orbital mechanics, stellar astrophysics, cosmology, celestial mechanics
Meteorology4 submodules — atmospheric modeling, radiation transfer, dynamics, precipitation
HubCentral dispatch API (api, domain, engine, tools) + prelude
Benchmark6 submodules — engine, encode/decode, simulation, report, export (HTML dashboard, multi-format)
Parser5 submodules — CSV, JSON, YAML, Markdown, HTML
Periodic Table118 element data files by category
Testing94 tests (28 benchmark + 66 parser), zero warnings
ChangeLog/

Coming Soon

SciForge — pure Rust (edition 2024, zero dependencies) scientific computing library.

Current State (According to 0.0.1 Version)

AreaItemStatusCode/Docs EvidenceRemaining Coverage
DocumentationFull API reference with input/output examples for every public functionPartialdocs/code/*.md, docs/modules/*.mdGenerate an exhaustive reference for all public functions (benchmark, hub, parser) with runnable examples
DocumentationTutorials and guided workflows (simulation, data analysis, cross-domain)PartialREADME.md, docs/Add end-to-end scenario tutorials with expected inputs/outputs
DocumentationModule-level scientific model guidesImplementeddocs/modules/Astronomy.md, docs/modules/Physics.md, docs/modules/Biology.md, and othersOngoing maintenance and enrichment
Extended TestingUnit and integration tests for all scientific modulesPartialtests/constants/*, tests/maths/*, tests/physics/*, tests/chemistry/*, tests/biology/*, tests/geology/*, tests/astronomy/*, tests/meteorology/*Close remaining coverage gaps in less-tested submodules
Extended TestingProperty-style testing and edge-case validationImplementedtests/scientific_properties.rs, tests/scientific_validation.rsExpand invariant coverage per domain
Extended TestingCross-module integration testsImplementedtests/hub/cross_domain.rs, tests/hub/main.rsAdd more multi-step cross-domain scenarios
Hub ExpansionUnified dispatch API through HubImplementedsrc/hub/engine/dispatch/*.rsContinue signature normalization
Hub ExpansionErgonomic prelude re-exportsImplementedsrc/hub/prelude.rsStabilize naming conventions
Hub ExpansionDomain query engine and tool pipelinesImplementedsrc/hub/engine/query.rs, src/hub/engine/pipeline/flow.rs, src/hub/engine/worker/scheduler.rsAdd more predefined pipeline templates
Computational EnhancementsPerformance benchmarking across scientific modulesPartialsrc/benchmark/*, tests/benchmark.rs, output/*/bmk/Complete a benchmark matrix for all major subdomains
Computational EnhancementsMemory-optimized structures for large-scale workloadsPartialsrc/hub/tools/arena.rs, src/hub/tools/profiler.rsAdd systematic memory/performance evidence
Computational EnhancementsDeterministic and reproducible execution pathsImplementedsrc/hub/tools/deterministic.rsExtend reproducibility assertions in tests
Future FeaturesInteractive visualization utilitiesImplementedsrc/hub/tools/visualization.rs, src/benchmark/export.rsAdd more visualization templates
Future FeaturesExtended cross-domain analysis tools (astrochem, geophysics, bioinformatics, etc.)Partialsrc/biology/bioinformatics/*, cross-domain dispatch paths in src/hub/engine/dispatch/*Expand explicit coupled-domain coverage (astrochem/geophysics)
Future FeaturesAdditional export formats and reportingImplementedHTML/MD/CSV/JSON/YAML/TOML export via src/benchmark/export.rs and output/Add cross-format validation schemas
Future FeaturesAutomated scientific validation pipelinePartialtests/scientific_validation.rs + output/validation/ artifactsFormalize a single pipeline command with gating thresholds

Quantitative Summary

StatusCount
Implemented9
Partial8
Remaining0

0.0.3 — Backlog

  1. Refactor files > 600 lines (split src/benchmark/*/, tests/parser.rs, tests/benchmark.rs)
  2. Complete API reference for all public functions
  3. Complete test coverage in less-covered scientific submodules
  4. Scientific validation pipeline with blocking thresholds
  5. Cross-domain scenarios (astrochemistry, geophysics, …) with numeric validations
  6. Readable .bmk in HTML benchmark reports
  7. Delete duplicate SPEED_OF_LIGHT (C) across the codebase
  8. TOML parser — full TOML v1.0 spec parser (keys, tables, arrays, multi-line strings, dates)

0.0.4 — Next Priorities

  1. Uncertainty quantification (Monte Carlo, bootstrap, error propagation)
  2. Heuristic optimization (simulated annealing, genetic algorithms, PSO)
  3. Wavelet and spectral analysis (astronomy, seismology, meteorology)
  4. Lightweight Bayesian inference (data exploration, inverse problems)
  5. PCA and clustering (dimensionality reduction, structure discovery)
  6. New constants and functions — details:
  • Constants — fundamental physics, astronomy (planets, satellites, dark matter, galactic, stellar), chemistry, units
  • Astronomy functions — tidal physics, rotational dynamics, general relativity corrections, impact/cratering
  • Meteorology functions — atmospheric physics, winds & storms, oceanography
  • Geology functions — hydrology, glaciology, erosion & weathering
  1. Convert every f32 to f64 precision

0.0.5 — Future Features

0.0.6 — Demo & Tutorials

  1. Reproducible guided tutorials (Hub + Parser + Benchmark)
  2. Small demo exercising the full crate

Planned Modules

  • Symbolic expressions — expression tree, eval, simplify, differentiate, LaTeX conversion
  • Dimensional analysis — type-safe Quantity with SI dimensions, compile-time checks
  • Data table — lightweight DataTable structure with column stats, filter, sort, CSV/JSON bridges
  • Parallel execution — native thread pool, scoped parallel_for, parallel scheduler
  • APK creation — Android packaging via JNI bridge, touch-enabled 3D viewer
  • Performance: pure Rust CPU rasterizer, optional SIMD for scanline fill and matrix ops, benchmark via BenchmarkMetrics (ns/frame, pixels/s), target resolution 800×600+
ComingSoon/

Contributing to SciForge

**Email:** The email associated with my [crates.io] account : https://crates.io/users/rayanmorel381-beep

Discord: The official discod's servor ascociated wiith the SciForge project : https://discord.com/channels/1485418062718173226/1489547778286813244

Project Overview

SciForge is a pure Rust (edition 2024) scientific computing library with zero external dependencies. It currently spans 11 modules, 575 source files, and 48 600+ lines of code covering mathematics, physics, chemistry, biology, geology, astronomy, meteorology, benchmarking, parsing, and a central hub.

How to Contribute

  1. Propose your change or idea — describe the problem you want to solve or the improvement you envision.
  2. Include your suggestions for APIs — indicate what functions, structs, or modules you think are necessary or redundant.
  3. Provide examples or code snippets where possible — even small snippets or pseudocode help.

I will review your proposal and provide feedback. If approved, we can coordinate how I'll integrate it.

Types of Contributions

  • Bug fixes — identify and propose solutions to issues.
  • Optimizations — suggest ways to improve performance, memory usage, or runtime behavior.
  • New features — propose additional analysis capabilities, APIs, or tools.
  • Documentation — help clarify usage, examples, or internal logic.
  • Testing — provide sample files, expected outputs, or validation scripts.
  • Logo & visual identity — if you can improve or refine the SciForge logo, your contribution is very welcome.

Code Conventions

SciForge follows strict conventions. All contributions must adhere to:

  • Zero dependencies — no external crates allowed.
  • Zero comments — code must be self-explanatory through clear naming and structure.
  • **No `#[allow]` directives** — all clippy and compiler warnings must be resolved, not suppressed.
  • Edition 2024 — use current Rust idioms and features.
  • **Zero clippy warnings** — cargo clippy must pass cleanly.
  • **All tests pass** — cargo test must succeed (currently 94 tests: 28 benchmark + 66 parser).

Proposal Guidelines

When proposing improvements, please include:

  • A clear description of the problem or opportunity
  • The API surface you envision (functions, structs, modules)
  • Any considerations about backward compatibility or potential side effects
  • Optional: performance trade-offs or optimizations you foresee

Even rough ideas or pseudocode are welcome — detailed implementation can come later.

API Discussion

I value input on:

  • Which APIs should be public and necessary
  • Which APIs are redundant or unnecessary
  • Any abstractions that could simplify usage or improve performance

Your suggestions help shape a stable and ergonomic API for SciForge.

Testing & Validation

  • Whenever possible, provide example files and expected outputs
  • Suggest how proposed changes can be validated in sandbox or test environments
  • Testing helps ensure new contributions integrate safely and correctly

Reporting Issues

If you encounter a bug or unexpected behavior:

  1. Describe the steps to reproduce it
  2. Provide expected vs. actual behavior
  3. Include relevant environment details (OS, Rust version, platform)

Please send reports via email or the discord.

Code of Conduct

I value respect, collaboration, and constructive feedback. Keep discussions professional and welcoming.

Thank you for helping make SciForge better. Your contributions — big or small — are always appreciated.

SciForge — Documentation

SciForge is a scientific computing library written in pure Rust, with no external dependencies. It covers a wide range of domains — from classical physics to molecular biology — organized into independent modules, each exposing both a domain specification and a Rust implementation.


Chapter 1 - Documentation Scope

Purpose

This page explains how the documentation is organized, what each section is meant to provide, and how to move between scientific explanations and Rust APIs.

Reading Strategy

  1. Start with the module page in docs/modules/ to understand the scientific scope and models.
  2. Continue with the matching page in docs/code/ to inspect the implementation layout and public-facing API.
  3. Use the repository structure overview at the end of this page to locate the relevant files quickly.

Reading Guide

Goal

This page acts as the entry point for the documentation set and maps each scientific area to its conceptual guide and code guide.

How To Read This Document

  • Use the module summaries below to identify the relevant scientific area.
  • Open the paired modules/ and code/ pages depending on whether you need theory or implementation details.
  • Use the repository tree at the end as a navigation shortcut.

Conventions

  • modules/ pages focus on scientific models, assumptions, and equations.
  • code/ pages focus on source layout, exported APIs, and execution flow.
  • Paths are written relative to the repository root.

Each module has two complementary pages:

  • Modules/ — describes the scientific concepts, formulas, and phenomena the module covers. Start here to understand *what* a module models.
  • Code/ — describes the Rust API: structs, functions, inputs/outputs. Go here when you want to *use* a module.

Chapter 2 - Modules at a Glance

Astronomy

Celestial mechanics, astrophysics, and cosmology (4 submodules). Covers orbital dynamics (Kepler's laws, vis-viva, Hohmann transfers, orbital perturbations), stellar physics (HR diagram, luminosity-mass-radius relations, main-sequence lifetime, stellar nucleosynthesis), cosmology (direct E(z) parameterizations, H(z) evaluation, comoving/luminosity/angular-diameter distances in LCDM/general/wCDM/CPL, dark-energy equation-of-state models, analytical LCDM shortcuts), and celestial mechanics (ecliptic/equatorial/galactic coordinate transforms, Julian date, sidereal time, nutation).

Module spec · Rust API


Benchmark

Performance measurement infrastructure for SciForge (6 submodules). Covers a 30+ field BenchmarkMetrics engine with statistical aggregation and CSV export, a compact binary encoding format (magic header, LE layout, 168+ byte records), zero-copy decoding via BenchmarkMetricsView, a simulation framework with SimState/SimConfig/StepFn traits, multi-format report generation (CSV, Markdown, HTML, JSON, YAML, TOML), and a file-based export orchestrator with periodic-table-themed CSS.

Module spec · Rust API


Biology

The largest scientific module (44 submodules, 176 source files). Covers aging (Gompertz/Weibull mortality, telomere dynamics), bioelectricity (Nernst, Goldman–Hodgkin–Katz, Hodgkin–Huxley), bioenergetics (ATP yield, Kleiber's law), biomechanics (Poiseuille flow, Hill muscle model), biophysics (Helfrich membrane, WLC, FRET), biostatistics (Kaplan–Meier, meta-analysis), ecology (Lotka–Volterra, Rosenzweig–MacArthur), enzyme kinetics (Michaelis–Menten, Hill, inhibition), evolution (molecular clock, dN/dS, coalescent), genetics (Hardy–Weinberg, $F_{ST}$), immunology (affinity maturation), neuroscience (integrate-and-fire), pharmacology (PK/PD, hepatic clearance), population dynamics (Leslie matrix, SIR/SEIR), synthetic biology (toggle switch, repressilator, FBA), virology (quasispecies, error catastrophe), and 28 more submodules.

Module spec · Rust API


Chemistry

Physical, analytical, inorganic, and computational chemistry (26 submodules). Covers acid–base equilibria (Henderson–Hasselbalch, polyprotic titrations), kinetics (Arrhenius, Eyring, Lindemann), electrochemistry (Nernst, Butler–Volmer, Tafel), thermochemistry (Hess's law, Kirchhoff), gas laws (van der Waals, virial, compressibility), quantum chemistry (Hartree–Fock, DFT concepts, Slater determinants), crystallography (Bragg's law, Miller indices, 14 Bravais lattices), molecular modeling (Lennard-Jones, Morse potential, VSEPR), colloids (DLVO theory, Stokes–Einstein), green chemistry (atom economy, E-factor), and environmental chemistry (Henry's law, BOD/COD).

Module spec · Rust API


Constants

Curated registry of physical constants, astronomical data, atomic properties, and unit conversions (5 submodules). Includes 16 CODATA fundamental constants ($c$, $G$, $h$, $\hbar$, $k_B$, $N_A$, $e$, $\varepsilon_0$, $\mu_0$, $\sigma_{SB}$, $\alpha$, Planck units), 10 astronomical constants (AU, parsec, solar/Earth parameters, Hubble constant), 13 atomic constants (particle masses, Bohr radius, Rydberg energy, magnetons), the full periodic table (118 elements loaded from YAML with OnceLock), and 12 unit conversion factors (eV↔J, cal↔J, atm↔Pa, deg↔rad, barn, ångström, fermi).

Module spec · Rust API


Geology

Earth sciences and geophysics (4 submodules). Covers radiometric dating (decay law $N(t) = N_0 e^{-\lambda t}$, half-life conversion, isochron method, $^{14}$C calibration), petrology (CIPW norm, magma viscosity, Stokes settling, crystallization sequences), seismology (P/S/surface wave propagation, Gutenberg–Richter, Omori aftershock law, magnitude scales $M_L$/$M_W$/$m_b$, focal mechanisms), and tectonics (plate velocity on a sphere, Euler poles, Byerlee's friction law, thermal subsidence).

Module spec · Rust API


Hub

Central orchestration layer (5 areas: API, Domain, Engine, Tools, Prelude — 35 source files). Provides a zero-dependency HTTP server (TcpListener-based), structured DTOs (ComputeRequest/ComputeResponse with 8 result types), domain dispatchers for all 7 scientific modules, direct astronomy-cosmology routing (E(z), H(z), and distance functions) through the Hub, an Experiment builder with 15 ParameterValue variants (Scalar through Tensor), a DynamicalSystem trait for ODE simulations (with built-in HarmonicOscillator/LotkaVolterra), priority-based task scheduling with dependency-aware topological sort, campaign batch execution, and tooling (Config, Logger, Metrics).

Module spec · Rust API


Mathematics

Numerical methods and pure mathematics (17 submodules). Covers complex arithmetic, linear algebra (Gauss elimination, LU/Cholesky decomposition, eigenvalues), calculus (symbolic differentiation, Simpson/Gauss quadrature, automatic differentiation), ODE solvers (Euler, RK4, adaptive RK45), Fourier and Laplace transforms, statistics (descriptive, distributions, hypothesis testing), probability, number theory (primes, GCD, modular arithmetic), combinatorics, set theory, graph theory (BFS, DFS, Dijkstra, Kruskal), geometry (2D/3D transforms, convex hull), trigonometry, polynomial operations, vector calculus (gradient, divergence, curl, Stokes' theorem), and special functions (Gamma, Beta, Bessel, error function).

Module spec · Rust API


Meteorology

Atmospheric science and weather physics (4 submodules). Covers atmosphere (barometric formula, ISA standard layers, pressure altitude, scale height, lapse rates), dynamics (geostrophic/gradient wind, Rossby number, vorticity, thermal wind, Ekman spiral, CAPE/CIN, Richardson number), precipitation (Clausius–Clapeyron, Köhler theory, Marshall–Palmer DSD, $Z$–$R$ relations, terminal velocity, Bergeron process), and radiation (Planck blackbody, Wien's law, Stefan–Boltzmann, solar zenith angle, Beer–Lambert atmospheric extinction, albedo, greenhouse radiative forcing $\Delta F = 5.35 \ln(C/C_0)$).

Module spec · Rust API


Parser

Multi-format data parsing library with zero dependencies (5 formats, 26 source files). Covers CSV (RFC 4180, CsvValue enum with Table/Record/Field, quoted field handling, writer), JSON (RFC 8259, JsonValue with 6 variants, number/string submodules), YAML (YamlValue with indent-based LineCursor, scalar type auto-detection for booleans/numbers/null — used by the Constants module for periodic table data), HTML (HtmlValue with Document/Element/Text/Comment, named entity decoding — used by Benchmark export), and Markdown (MdValue with 9 block-level variants, inline emphasis/links/code processing). All formats share a layered Cursor<'a> architecture with zero-copy &'a str borrowing and const fn constructors.

Module spec · Rust API


Physics

Classical and modern physics (11 submodules). Covers acoustics (wave equation, Doppler, decibel scale, resonance), electrodynamics (Maxwell's equations, Lorentz force, electromagnetic waves, Poynting vector), electronics (Ohm's law, RC/RL/RLC circuits, transistor models, op-amp configurations), fluid mechanics (Navier–Stokes, Bernoulli, Reynolds number, drag), materials science (stress–strain, Young's modulus, Hooke's law, creep), nucleosynthesis (binding energy, decay chains, cross-sections, pp-chain, CNO cycle), optics (Snell's law, thin lens, diffraction, interference, polarization), quantum mechanics (Schrödinger equation, particle-in-a-box, harmonic oscillator, hydrogen atom, tunneling), relativity (Lorentz transforms, $E = mc^2$, time dilation, gravitational redshift, Schwarzschild metric), solid mechanics (beam bending, torsion, Mohr's circle, buckling), and thermodynamics (laws of thermodynamics, Carnot cycle, entropy, heat transfer, blackbody radiation).

Module spec · Rust API


Chapter 3 - Repository Structure

docs/
├── Summary.md          # This file
├── modules/            # Scientific domain documentation (concepts & formulas)
│   ├── Astronomy.md
│   ├── Benchmark.md
│   ├── Biology.md
│   ├── Chemistry.md
│   ├── Constants.md
│   ├── Geology.md
│   ├── Hub.md
│   ├── Mathematics.md
│   ├── Meteorology.md
│   ├── Parser.md
│   └── Physics.md
└── code/               # Rust implementation documentation (API reference)
    ├── Astronomy.md
    ├── Benchmark.md
    ├── Biology.md
    ├── Chemistry.md
    ├── Constants.md
    ├── Geology.md
    ├── Hub.md
    ├── Mathematics.md
    ├── Meteorology.md
    ├── Parser.md
    └── Physics.md

SciForge — Documentation

SciForge is a scientific computing library written in pure Rust, with no external dependencies. It covers a wide range of domains — from classical physics to molecular biology — organized into independent modules, each exposing both a domain specification and a Rust implementation.


Chapter 1 - Documentation Scope

Purpose

This page explains how the documentation is organized, what each section is meant to provide, and how to move between scientific explanations and Rust APIs.

Reading Strategy

  1. Start with the module page in docs/modules/ to understand the scientific scope and models.
  2. Continue with the matching page in docs/code/ to inspect the implementation layout and public-facing API.
  3. Use the repository structure overview at the end of this page to locate the relevant files quickly.

Reading Guide

Goal

This page acts as the entry point for the documentation set and maps each scientific area to its conceptual guide and code guide.

How To Read This Document

  • Use the module summaries below to identify the relevant scientific area.
  • Open the paired modules/ and code/ pages depending on whether you need theory or implementation details.
  • Use the repository tree at the end as a navigation shortcut.

Conventions

  • modules/ pages focus on scientific models, assumptions, and equations.
  • code/ pages focus on source layout, exported APIs, and execution flow.
  • Paths are written relative to the repository root.

Each module has two complementary pages:

  • Modules/ — describes the scientific concepts, formulas, and phenomena the module covers. Start here to understand *what* a module models.
  • Code/ — describes the Rust API: structs, functions, inputs/outputs. Go here when you want to *use* a module.

Chapter 2 - Modules at a Glance

Astronomy

Celestial mechanics, astrophysics, and cosmology (4 submodules). Covers orbital dynamics (Kepler's laws, vis-viva, Hohmann transfers, orbital perturbations), stellar physics (HR diagram, luminosity-mass-radius relations, main-sequence lifetime, stellar nucleosynthesis), cosmology (direct E(z) parameterizations, H(z) evaluation, comoving/luminosity/angular-diameter distances in LCDM/general/wCDM/CPL, dark-energy equation-of-state models, analytical LCDM shortcuts), and celestial mechanics (ecliptic/equatorial/galactic coordinate transforms, Julian date, sidereal time, nutation).

Module spec · Rust API


Benchmark

Performance measurement infrastructure for SciForge (6 submodules). Covers a 30+ field BenchmarkMetrics engine with statistical aggregation and CSV export, a compact binary encoding format (magic header, LE layout, 168+ byte records), zero-copy decoding via BenchmarkMetricsView, a simulation framework with SimState/SimConfig/StepFn traits, multi-format report generation (CSV, Markdown, HTML, JSON, YAML, TOML), and a file-based export orchestrator with periodic-table-themed CSS.

Module spec · Rust API


Biology

The largest scientific module (44 submodules, 176 source files). Covers aging (Gompertz/Weibull mortality, telomere dynamics), bioelectricity (Nernst, Goldman–Hodgkin–Katz, Hodgkin–Huxley), bioenergetics (ATP yield, Kleiber's law), biomechanics (Poiseuille flow, Hill muscle model), biophysics (Helfrich membrane, WLC, FRET), biostatistics (Kaplan–Meier, meta-analysis), ecology (Lotka–Volterra, Rosenzweig–MacArthur), enzyme kinetics (Michaelis–Menten, Hill, inhibition), evolution (molecular clock, dN/dS, coalescent), genetics (Hardy–Weinberg, $F_{ST}$), immunology (affinity maturation), neuroscience (integrate-and-fire), pharmacology (PK/PD, hepatic clearance), population dynamics (Leslie matrix, SIR/SEIR), synthetic biology (toggle switch, repressilator, FBA), virology (quasispecies, error catastrophe), and 28 more submodules.

Module spec · Rust API


Chemistry

Physical, analytical, inorganic, and computational chemistry (26 submodules). Covers acid–base equilibria (Henderson–Hasselbalch, polyprotic titrations), kinetics (Arrhenius, Eyring, Lindemann), electrochemistry (Nernst, Butler–Volmer, Tafel), thermochemistry (Hess's law, Kirchhoff), gas laws (van der Waals, virial, compressibility), quantum chemistry (Hartree–Fock, DFT concepts, Slater determinants), crystallography (Bragg's law, Miller indices, 14 Bravais lattices), molecular modeling (Lennard-Jones, Morse potential, VSEPR), colloids (DLVO theory, Stokes–Einstein), green chemistry (atom economy, E-factor), and environmental chemistry (Henry's law, BOD/COD).

Module spec · Rust API


Constants

Curated registry of physical constants, astronomical data, atomic properties, and unit conversions (5 submodules). Includes 16 CODATA fundamental constants ($c$, $G$, $h$, $\hbar$, $k_B$, $N_A$, $e$, $\varepsilon_0$, $\mu_0$, $\sigma_{SB}$, $\alpha$, Planck units), 10 astronomical constants (AU, parsec, solar/Earth parameters, Hubble constant), 13 atomic constants (particle masses, Bohr radius, Rydberg energy, magnetons), the full periodic table (118 elements loaded from YAML with OnceLock), and 12 unit conversion factors (eV↔J, cal↔J, atm↔Pa, deg↔rad, barn, ångström, fermi).

Module spec · Rust API


Geology

Earth sciences and geophysics (4 submodules). Covers radiometric dating (decay law $N(t) = N_0 e^{-\lambda t}$, half-life conversion, isochron method, $^{14}$C calibration), petrology (CIPW norm, magma viscosity, Stokes settling, crystallization sequences), seismology (P/S/surface wave propagation, Gutenberg–Richter, Omori aftershock law, magnitude scales $M_L$/$M_W$/$m_b$, focal mechanisms), and tectonics (plate velocity on a sphere, Euler poles, Byerlee's friction law, thermal subsidence).

Module spec · Rust API


Hub

Central orchestration layer (5 areas: API, Domain, Engine, Tools, Prelude — 35 source files). Provides a zero-dependency HTTP server (TcpListener-based), structured DTOs (ComputeRequest/ComputeResponse with 8 result types), domain dispatchers for all 7 scientific modules, direct astronomy-cosmology routing (E(z), H(z), and distance functions) through the Hub, an Experiment builder with 15 ParameterValue variants (Scalar through Tensor), a DynamicalSystem trait for ODE simulations (with built-in HarmonicOscillator/LotkaVolterra), priority-based task scheduling with dependency-aware topological sort, campaign batch execution, and tooling (Config, Logger, Metrics).

Module spec · Rust API


Mathematics

Numerical methods and pure mathematics (17 submodules). Covers complex arithmetic, linear algebra (Gauss elimination, LU/Cholesky decomposition, eigenvalues), calculus (symbolic differentiation, Simpson/Gauss quadrature, automatic differentiation), ODE solvers (Euler, RK4, adaptive RK45), Fourier and Laplace transforms, statistics (descriptive, distributions, hypothesis testing), probability, number theory (primes, GCD, modular arithmetic), combinatorics, set theory, graph theory (BFS, DFS, Dijkstra, Kruskal), geometry (2D/3D transforms, convex hull), trigonometry, polynomial operations, vector calculus (gradient, divergence, curl, Stokes' theorem), and special functions (Gamma, Beta, Bessel, error function).

Module spec · Rust API


Meteorology

Atmospheric science and weather physics (4 submodules). Covers atmosphere (barometric formula, ISA standard layers, pressure altitude, scale height, lapse rates), dynamics (geostrophic/gradient wind, Rossby number, vorticity, thermal wind, Ekman spiral, CAPE/CIN, Richardson number), precipitation (Clausius–Clapeyron, Köhler theory, Marshall–Palmer DSD, $Z$–$R$ relations, terminal velocity, Bergeron process), and radiation (Planck blackbody, Wien's law, Stefan–Boltzmann, solar zenith angle, Beer–Lambert atmospheric extinction, albedo, greenhouse radiative forcing $\Delta F = 5.35 \ln(C/C_0)$).

Module spec · Rust API


Parser

Multi-format data parsing library with zero dependencies (5 formats, 26 source files). Covers CSV (RFC 4180, CsvValue enum with Table/Record/Field, quoted field handling, writer), JSON (RFC 8259, JsonValue with 6 variants, number/string submodules), YAML (YamlValue with indent-based LineCursor, scalar type auto-detection for booleans/numbers/null — used by the Constants module for periodic table data), HTML (HtmlValue with Document/Element/Text/Comment, named entity decoding — used by Benchmark export), and Markdown (MdValue with 9 block-level variants, inline emphasis/links/code processing). All formats share a layered Cursor<'a> architecture with zero-copy &'a str borrowing and const fn constructors.

Module spec · Rust API


Physics

Classical and modern physics (11 submodules). Covers acoustics (wave equation, Doppler, decibel scale, resonance), electrodynamics (Maxwell's equations, Lorentz force, electromagnetic waves, Poynting vector), electronics (Ohm's law, RC/RL/RLC circuits, transistor models, op-amp configurations), fluid mechanics (Navier–Stokes, Bernoulli, Reynolds number, drag), materials science (stress–strain, Young's modulus, Hooke's law, creep), nucleosynthesis (binding energy, decay chains, cross-sections, pp-chain, CNO cycle), optics (Snell's law, thin lens, diffraction, interference, polarization), quantum mechanics (Schrödinger equation, particle-in-a-box, harmonic oscillator, hydrogen atom, tunneling), relativity (Lorentz transforms, $E = mc^2$, time dilation, gravitational redshift, Schwarzschild metric), solid mechanics (beam bending, torsion, Mohr's circle, buckling), and thermodynamics (laws of thermodynamics, Carnot cycle, entropy, heat transfer, blackbody radiation).

Module spec · Rust API


Chapter 3 - Repository Structure

docs/
├── Summary.md          # This file
├── modules/            # Scientific domain documentation (concepts & formulas)
│   ├── Astronomy.md
│   ├── Benchmark.md
│   ├── Biology.md
│   ├── Chemistry.md
│   ├── Constants.md
│   ├── Geology.md
│   ├── Hub.md
│   ├── Mathematics.md
│   ├── Meteorology.md
│   ├── Parser.md
│   └── Physics.md
└── code/               # Rust implementation documentation (API reference)
    ├── Astronomy.md
    ├── Benchmark.md
    ├── Biology.md
    ├── Chemistry.md
    ├── Constants.md
    ├── Geology.md
    ├── Hub.md
    ├── Mathematics.md
    ├── Meteorology.md
    ├── Parser.md
    └── Physics.md

Astronomy Module

The Astronomy module covers 9 submodules providing computational tools for astrophysics, from the mechanics of planetary orbits to the large-scale structure and evolution of the universe. Every function works in SI units unless stated otherwise, and all constants (G, c, σ) are embedded as compile-time literals.


Chapter 1 - Module Scope

Scientific Purpose

This section defines the scope: which problem this module solves, which abstraction level it targets, and which outputs are expected.

Modeling Assumptions

  • The equations are numerical models, not analytical proofs.
  • Inputs must respect the documented units.
  • Validity domains (linear regime, local approximation, and so on) should be verified by the reader.

Reading Strategy

  1. Read the module structure.
  2. Identify equations and their conditions.
  3. Map these equations to Rust functions in docs/code/.

Reading Guide

Goal

This page explains the module from a scientific perspective: assumptions, models, equations, and usage limits.

How To Read This Document

  • Start with the domain section relevant to your case.
  • Identify key equations and their usage conditions.
  • Then verify the corresponding Rust signatures in docs/code/.

Conventions

  • Units: SI unless explicitly stated.
  • Variables: standard mathematical notation for the domain.
  • Equations are presented as reference models, not formal proofs.

Chapter 2 - Submodules and Models

1. Orbits

Orbital mechanics — the mathematical description of how bodies move under gravity — is the backbone of mission planning, satellite operations, and planetary science.

Kepler's Laws — The orbital period of a body on an elliptical path is $T = 2\pi\sqrt{a^3/\mu}$, where $a$ is the semi-major axis and $\mu = GM$ is the gravitational parameter. The vis-viva equation $v^2 = \mu(2/r - 1/a)$ gives the instantaneous speed at any orbital radius, unifying circular ($a = r$), elliptical, parabolic ($a \to \infty$), and hyperbolic cases. The module computes circular velocity $v_c = \sqrt{\mu/r}$, escape velocity $v_e = \sqrt{2\mu/r}$, specific orbital energy $\varepsilon = -\mu/2a$, and specific angular momentum $h = \sqrt{\mu a(1-e^2)}$.

Orbit Geometry — Periapsis $r_p = a(1-e)$ and apoapsis $r_a = a(1+e)$ define the extremes. The conic section equation $r(\theta) = a(1-e^2)/(1+e\cos\theta)$ maps true anomaly to radius. These are the building blocks for trajectory design.

Transfer Orbits — The Hohmann transfer between two circular orbits requires two impulsive burns: $\Delta v = |v_{t1} - v_1| + |v_2 - v_{t2}|$, where $v_{t}$ comes from vis-viva evaluated on the transfer ellipse with $a_t = (r_1+r_2)/2$. This is the most fuel-efficient two-impulse transfer in a central field.

Gravitational Domains — The sphere of influence $r_{SOI} = a(m/M)^{2/5}$ defines the region where a planet's gravity dominates over the star's. The Hill sphere $r_H = a(1-e)(m/3M)^{1/3}$ bounds the region where stable satellite orbits can exist. The Roche limit $d = 2.456\,R_p(\rho_p/\rho_s)^{1/3}$ is the minimum orbital distance before tidal forces tear a fluid satellite apart.


2. Stellar Physics

Stellar astrophysics characterizes stars by their observable and intrinsic properties, connecting luminosity, temperature, mass, and evolutionary state.

Luminosity and Temperature — A star radiates as an approximate blackbody: $L = 4\pi R^2 \sigma T_{\text{eff}}^4$ (Stefan-Boltzmann law). Wien's displacement law $\lambda_{\max} = 2.898 \times 10^{-3}/T$ gives the peak emission wavelength. The module computes luminosity from radius and temperature, and the inverse.

Magnitude System — Absolute magnitude $M = m - 5\log_{10}(d/10)$ standardizes brightness at 10 pc. The distance modulus inverts this to give distance from apparent and absolute magnitudes. Stellar flux follows the inverse-square law $F = L/(4\pi d^2)$. Bolometric corrections convert visual magnitudes to total luminosity.

Mass-Luminosity Relation — On the main sequence, luminosity scales steeply with mass: $L \propto M^{2.3}$ for $M < 0.43\,M_\odot$, $L \propto M^4$ for solar-type stars, $L \propto M^{3.5}$ for intermediate masses, and $L \propto M$ for the most massive stars. Main-sequence lifetime follows as $\tau \approx 10^{10}\,M/L$ years — massive stars burn out in millions of years, while red dwarfs last trillions.

Spectral Classification — An empirical relation maps spectral index to effective temperature: $T_{\text{eff}} \approx 42000/(n+0.92)$, bridging the O-B-A-F-G-K-M sequence to physical temperature.

Compact Objects — The Schwarzschild radius $r_s = 2GM/c^2$ defines the event horizon of a non-rotating black hole. The Chandrasekhar limit ($1.4\,M_\odot$) is the maximum mass for a white dwarf supported by electron degeneracy pressure. The Eddington luminosity $L_E = 4\pi GMc/\kappa$ is the maximum luminosity before radiation pressure overcomes gravity, limiting accretion rates.


3. Cosmology

Cosmology studies the origin, structure, and evolution of the universe on the largest scales, grounded in general relativity and the Friedmann-Lemaître-Robertson-Walker metric.

Hubble's Law and H(z) — The expansion of the universe produces a recession velocity proportional to distance: $v = H_0 d$. Beyond local linear expansion, the module exposes redshift-dependent Hubble rates via $H(z) = H_0 E(z)$, including general and flat-LCDM helpers.

Redshift — Cosmological redshift $z = a_{\text{obs}}/a_{\text{emit}} - 1$ relates the scale factor at emission to the observed wavelength stretching. The scale factor is $a = 1/(1+z)$. For low redshift, $z \approx v/c$ (non-relativistic approximation).

**Friedmann and E(z) parameterizations** — The expansion rate $H(a) = H_0\sqrt{\Omega_r/a^4 + \Omega_m/a^3 + \Omega_\Lambda}$ governs cosmic dynamics. The module provides direct E(z) implementations for general models and common parameterizations: flat LCDM, LCDM with radiation, constant-$w$ dark energy (wCDM), and CPL ($w_0$-$w_a$).

Distances — Cosmological distances are not unique. The module computes line-of-sight and transverse comoving distance, luminosity distance $d_L = d_C(1+z)$, and angular diameter distance $d_A = d_C/(1+z)$ from redshift using numerical integration. Implementations are available for flat LCDM, general curved models, and flat wCDM/CPL variants.

Time and LCDM shortcuts — The module keeps approximate legacy formulas, but also includes LCDM-focused utilities such as analytical flat-LCDM age where applicable, plus numerical lookback/age functions for more general models.

CMB Temperature — The cosmic microwave background temperature scales with redshift: $T(z) = T_0(1+z)$, where $T_0 \approx 2.725$ K today.

**Hub wiring** — Cosmology APIs are directly exposed through the Hub astronomy dispatcher, so these calculations are available from Experiment::new(DomainType::Astronomy, ...) without bypassing the unified dispatch layer.


4. Celestial Mechanics

Celestial mechanics applies Newtonian gravity to multi-body systems, covering forces, tidal interactions, and observable geometry.

Gravitational Force — Newton's law $F = Gm_1m_2/r^2$ and the tidal force $F_t = 2Gm\,\Delta r/r^3$ (differential gravity across an extended body). Tidal forces explain ocean tides, tidal locking, and the Roche limit.

Two-Body Geometry — The barycenter of two masses lies at $d \cdot m_2/(m_1+m_2)$ from $m_1$. The synodic period $P_{\text{syn}} = 1/|1/P_1 - 1/P_2|$ gives the recurrence time of alignments (e.g., planetary conjunctions). Sidereal-to-solar day conversion accounts for orbital motion.

Lagrange Points and Hill Sphere — The L1 point $r_{L1} \approx d(m_2/3m_1)^{1/3}$ is the equilibrium between gravitational pulls, used for solar observatories (e.g., SOHO). The Hill sphere bounds stable satellite orbits.

Surface Properties — Surface gravity $g = GM/R^2$ determines atmospheric retention and landing dynamics. The apparent angular size $\theta = 2\arctan(d_{\text{phys}}/2D)$ gives how large an object appears in the sky. Parallax distance $d = 1/p''$ (in parsecs) is the fundamental distance ladder rung.

Habitable Zone — The circumstellar habitable zone bounds are estimated from stellar luminosity: inner edge $r_{\text{in}} = \sqrt{L/1.1}$ AU and outer edge $r_{\text{out}} = \sqrt{L/0.53}$ AU, where $L$ is in solar luminosities. These correspond to the range where liquid water can exist on a rocky surface.


5. Galactic Astrophysics

Structure, dynamics, and evolution of the Milky Way and its interaction with the Local Group.

Galactic Rotation Curve — The circular velocity at galactocentric radius $r$ follows from an enclosed-mass profile $M(r) = M_{\text{MW}}\,r/(r + R_d)$, giving $v_c(r) = \sqrt{GM(r)/r}$ where $R_d$ is the disk scale length. The flat rotation curve at large radii ($v_c \approx 220\;\text{km/s}$) is a key piece of evidence for dark matter, since visible matter alone predicts a Keplerian decline $v \propto r^{-1/2}$.

Solar Galactic Parameters — The Sun orbits at $R_\odot \approx 8.2\;\text{kpc}$ with a velocity $v_\odot \approx 220\;\text{km/s}$ and an orbital period $T_\odot \approx 225\;\text{Myr}$ (one galactic year). These are stored as CODATA/IAU-verified constants.

Sagittarius A\* — The central supermassive black hole ($M \approx 4 \times 10^6\,M_\odot$) has a Schwarzschild radius $r_s = 2GM/c^2$ and a gravitational sphere of influence $r_{\text{infl}} = GM/\sigma^2$ where $\sigma$ is the local stellar velocity dispersion (approximated here by $v_\odot$).

Milky Way – Andromeda Interaction — The approach time $t = d/v_r$ gives a first-order collision estimate from the current separation $d \approx 2.54\;\text{Mly}$ and radial approach velocity $v_r \approx 110\;\text{km/s}$. The two-body reduced mass $\mu = M_1 M_2/(M_1 + M_2)$ is used for energy-budget estimates of the merger.

Disk Density Model — The stellar mass density follows an exponential-disk profile:

$$\rho(r,z) = \frac{\Sigma_0}{2h_z}\exp\!\left(-\frac{r}{R_d}\right)\exp\!\left(-\frac{|z|}{h_z}\right)$$

where $\Sigma_0$ is the central surface density, $R_d$ the radial scale length, and $h_z$ the vertical scale height. The stellar number density uses the same functional form normalized to the total star count.

Oort Constants and Epicyclic Frequency — The Oort constants $A = \frac{1}{2}\!\left(\frac{v}{r} - \frac{dv}{dr}\right)$ and $B = -\frac{1}{2}\!\left(\frac{v}{r} + \frac{dv}{dr}\right)$ describe local differential rotation and are measured from proper motions. The epicyclic frequency $\kappa = \sqrt{-4B(A-B)}$ governs the radial oscillation of stellar orbits around their guiding center.

Galactic Escape Velocity — $v_{\text{esc}} = \sqrt{2GM(r)/r}$ determines the minimum speed for unbound orbits. The dynamical time $t_{\text{dyn}} = 2\pi r / v_c$ is the characteristic orbital crossing time.

Bulge and Tidal Radius — The bulge mass within radius $r$ uses a Hernquist-like profile: $M_b(r) = 0.15\,M_* r^3/(r^3 + r_b^3)$, where $r_b$ is the bulge scale radius. The tidal (Jacobi) radius of a star cluster at galactocentric distance $R$ is $r_t = R\,(m_c/3M_g)^{1/3}$, the boundary at which galactic tides strip cluster members.


6. Impact Cratering

Hypervelocity impact mechanics — crater formation, fireball evolution, and ejecta dynamics.

Crater Scaling — The transient crater diameter follows an energy–gravity scaling law:

$$D = K\left(\frac{\rho_i}{\rho_t}\right)^{\!\alpha} d_p^{\,\beta}\, v^{\gamma}\, g^{\delta}$$

where $K$, $\alpha$, $\beta$, $\gamma$, $\delta$ are empirical exponents from laboratory and numerical hydrocode experiments (Pi-group scaling sensu Holsapple). The density ratio accounts for the impedance mismatch between impactor and target.

Fireball Radius — The thermal emission sphere of a large impact follows a power-law in energy: $R_{\text{fb}} = K_{\text{fb}}\,E^{\alpha_{\text{fb}}}$, with $E$ expressed in kilotons TNT equivalent. This scaling derives from nuclear test analogs (Sedov-Taylor blast wave).

Ejecta Volume — Approximated as a paraboloid: $V_{\text{ej}} = \frac{\pi}{6}\,D^2\,h$ where $D$ is the crater diameter and $h$ the excavation depth.

Impact Velocity — Combining the approach velocity $v_\infty$ (hyperbolic excess) with the gravitational acceleration: $v_{\text{imp}} = \sqrt{v_\infty^2 + v_{\text{esc}}^2}$, yielding the actual surface encounter speed.

Ejecta Escape Fraction — The fraction of ejecta exceeding escape velocity: $f = \max\!\left(0,\;1 - (v_{\text{esc}}/v_{\text{ej}})^2\right)$. On low-gravity bodies (asteroids, comets), most ejecta escapes; on Earth, essentially none does.


7. Planetary Science

Interior structure, atmospheric physics, and surface thermodynamics of planets and moons.

Interior Structure — Hydrostatic pressure at depth: $P = \rho g d$. Central pressure for a uniform sphere: $P_c = \frac{3}{2}\rho g R$. The adiabatic temperature gradient $dT/dz = g/c_p$ governs the convective interior of gas giants. The moment-of-inertia factor $C/MR^2$ constrains density stratification — a uniform sphere has $C/MR^2 = 0.4$; differentiated bodies (iron core + silicate mantle) have lower values.

Tidal Physics — The Love number $k_2 = 1.5/(1 + 19\mu/(2G\rho^2 R^2/3))$ measures the body's tidal deformability, where $\mu$ is the shear rigidity. Tidal heating $\dot{E} = \frac{21}{2}\frac{k_2}{Q}\frac{G M_p^2 R^5 n}{a^6}e^2$ powers Io's volcanism and Europa's subsurface ocean ($Q$ is the tidal quality factor). The tidal locking timescale estimates when spin-orbit synchronization is reached.

Roche Limits — The fluid Roche limit $d = 2.456\,R_p(\rho_p/\rho_s)^{1/3}$ and the rigid Roche limit $d = 1.26\,R_p(\rho_p/\rho_s)^{1/3}$ bound the region inside which a satellite is torn apart. The factor difference (2.456 vs 1.26) reflects the role of material strength.

Atmospheric Physics — The equilibrium temperature $T_{\text{eq}} = \left(\frac{L(1-A)}{16\pi\sigma a^2}\right)^{1/4}$ is the blackbody temperature balanced by stellar insolation. The greenhouse surface temperature adds infrared optical depth: $T_s = T_{\text{eq}}(1 + \frac{3}{4}\tau_{\text{IR}})^{1/4}$. Atmospheric scale height $H = k_B T/(\bar{m}g)$. Jeans escape parameter $\lambda = (v_{\text{esc}}/v_{\text{th}})^2$ determines thermal atmospheric loss.

Magnetosphere — The magnetopause standoff distance $r_{\text{mp}} = \left(\frac{\mu_0\,\mathcal{M}^2}{8\pi^2\,P_{\text{sw}}}\right)^{1/6}$ balances magnetic pressure against solar wind dynamic pressure, where $\mathcal{M}$ is the planetary dipole moment.

Ring Systems — The inner Roche boundary sets the minimum ring radius. Optical depth $\tau = 3\Sigma/(4\rho_p r_p)$ relates the surface mass density $\Sigma$ to particle size. The synchronous orbit $r_{\text{sync}} = (GM/\omega^2)^{1/3}$ marks the geostationary distance.

Surface Properties — Oblateness $f = q/2$ (where $q = \omega^2 R^3/GM$), orbital precession from $J_2$, Bond–geometric albedo relation $A_B = p\,q_\phi$, thermal inertia $\Gamma = \sqrt{k\rho c_p}$, diurnal skin depth $\delta = \sqrt{\kappa P/\pi}$, and subsolar/nightside temperatures from radiative equilibrium.

Planetary Database — A lookup table for all 8 Solar System planets (Mercury–Neptune) with 14 physical and orbital parameters each (mass, radius, flattening, orbital period, semi-major axis, eccentricity, inclination, axial tilt, sidereal day, surface gravity, escape velocity, mean density, Bond albedo, orbital velocity), sourced from NASA/JPL ephemeris data.


8. Rotation

Rotational dynamics — surface velocity, Coriolis effects, precession, and photoperiod.

Surface Velocity — At latitude $\phi$, $v = \omega R \cos\phi$ gives the linear speed due to axial rotation. The centripetal acceleration is $a = \omega^2 R \cos\phi$, which reduces the effective gravity at the equator by $\sim 0.3\%$.

Coriolis Parameter — $f = 2\omega\sin\phi$ controls large-scale atmospheric and oceanic circulation. $f = 0$ at the equator and maximal at the poles. The Coriolis acceleration deflects moving objects to the right in the Northern Hemisphere and to the left in the Southern Hemisphere.

Moment of Inertia — $I = C\,MR^2$ where the dimensionless factor $C$ encodes mass distribution. $C = 0.4$ for a uniform sphere; Earth's $C \approx 0.331$ reveals a dense core. The rotational kinetic energy is $E_{\text{rot}} = \frac{1}{2}I\omega^2$.

Nutation — Small periodic oscillation of the rotation axis: $\Delta\varepsilon = A_{\text{nut}}\cos\Omega_n$ (arcseconds), where $\Omega_n$ is the longitude of the ascending node of the lunar orbit (18.6-year period). The amplitude $A_{\text{nut}} \approx 9.2''$ for the Earth.

Day Length Variation — Hours of daylight as a function of day of year, latitude, and axial tilt. The solar declination $\delta = \varepsilon\sin(2\pi(d - d_{\text{eq}})/365)$ determines the hour angle at sunrise/sunset: $h_0 = \arccos(-\tan\phi\,\tan\delta)$, giving daylight duration $D = 24\,h_0/\pi$ hours. Polar day ($D = 24$) and polar night ($D = 0$) emerge naturally.


9. Tides

Gravitational tidal interactions — potentials, bulge heights, spring/neap cycles, and dissipation.

Tidal Potential — The degree-2 tidal potential at the surface of a body:

$$\Phi = -\frac{GM r^2}{d^3}(1 + k_2)\,P_2(\cos\theta)$$

where $P_2(x) = \frac{3}{2}x^2 - \frac{1}{2}$ is the second Legendre polynomial, $d$ the distance to the perturber, $r$ the body radius, and $k_2$ the Love number. The factor $(1 + k_2)$ accounts for the body's elastic response.

Tidal Bulge Height — The equilibrium tidal displacement: $\eta = h_2\,a_{\text{tidal}}\,r/g$ where $h_2$ is the displacement Love number and $a_{\text{tidal}}$ the tidal acceleration. For the Earth-Moon system, the equilibrium oceanic tide amplitude is $\sim 0.5\;\text{m}$.

Spring and Neap Tides — When the Sun and Moon are aligned (new or full Moon), their tidal bulges add: $h_{\text{spring}} = h_{\text{Moon}} + h_{\text{Sun}}$. At quadrature (first/third quarter), they partially cancel: $h_{\text{neap}} = |h_{\text{Moon}} - h_{\text{Sun}}|$. The ratio $h_{\text{Moon}}/h_{\text{Sun}} \approx 2.17$ reflects the Moon's proximity compensating for its smaller mass.

Tidal Dissipation — Energy dissipated by tidal friction:

$$\dot{E} = \frac{21}{2}\frac{k_2\,n\,G\,M_p^2\,R^5}{Q\,d^6}$$

where $n$ is the mean motion and $Q$ the tidal quality factor. Low $Q$ (high dissipation) drives orbital circularization, spin-orbit synchronization, and satellite migration. The Moon recedes from Earth at $\sim 3.8\;\text{cm/yr}$ due to tidal dissipation in Earth's oceans.

Tidal Locking Timescale — $\tau_{\text{lock}} = \omega a^6 \mu Q / (6GM_p^2 R^5)$ estimates the time to achieve synchronous rotation, where $\mu$ is the rigidity and $\omega$ the initial spin rate. Mercury, the Moon, and most large moons in the Solar System are tidally locked.


Chapter 3 - Limits, Precision, and Validation

Numerical Limits

  • f64 rounding errors can accumulate in long simulations.
  • Extreme regimes (very large or very small scales) require explicit numerical stability checks.

Recommended Verification

  • Compare against a simple analytical case when available.
  • Check the order of magnitude of results.
  • Run sensitivity analysis on dominant parameters.

Transition to Implementation

For concrete function calls, Rust signatures and module paths are documented in docs/code/.

Benchmark Module

The benchmark module provides 6 submodules for performance measurement, binary encoding, simulation profiling, and multi-format report generation. It serves as SciForge's internal benchmarking infrastructure.


Chapter 1 - Module Scope

Scientific Purpose

This section defines the scope: which problem this module solves, which abstraction level it targets, and which outputs are expected.

Modeling Assumptions

  • The equations are numerical models, not analytical proofs.
  • Inputs must respect the documented units.
  • Validity domains (linear regime, local approximation, and so on) should be verified by the reader.

Reading Strategy

  1. Read the module structure.
  2. Identify equations and their conditions.
  3. Map these equations to Rust functions in docs/code/.

Reading Guide

Goal

This page explains the module from a scientific perspective: assumptions, models, equations, and usage limits.

How To Read This Document

  • Start with the domain section relevant to your case.
  • Identify key equations and their usage conditions.
  • Then verify the corresponding Rust signatures in docs/code/.

Conventions

  • Units: SI unless explicitly stated.
  • Variables: standard mathematical notation for the domain.
  • Equations are presented as reference models, not formal proofs.

1. Engine

Core benchmark execution framework.

The engine defines the BenchmarkMetrics struct that captures all measurable dimensions of an experiment:

FieldTypeDescription
experiment_name&strIdentifier for the benchmark
precision&strNumeric precision label (e.g. "f64", "f32")
elapsed_msu64Total wall-clock time in milliseconds
iterationsu64Number of measured iterations
avg_time_nsf32Mean time per iteration (ns)
min_time_ns / max_time_nsf32Min/max iteration time
time_stddevf32Standard deviation of iteration times
iterations_per_secf32Throughput: $1 / \bar{t}$
samples_per_secf32Data throughput
total_flopsu64Floating-point operations counted
eval_errorf32Numerical error metric
eval_accuracyf32Accuracy score
eval_r_squaredf32Coefficient of determination $R^2$
eval_maef32Mean absolute error
logical_coresu32System CPU core count

The runner uses std::hint::black_box to prevent compiler dead-code elimination, and std::time::Instant for nanosecond-precision timing. A CSV header is provided for direct row export:

experiment_name,precision,elapsed_ms,iterations,avg_time_ns,min_time_ns,max_time_ns,time_stddev,iterations_per_sec,result

Statistical aggregation. The standard deviation of timing samples quantifies measurement noise:

$$\sigma_t = \sqrt{\frac{1}{N-1} \sum_{i=1}^{N} (t_i - \bar{t})^2}$$

Coefficient of variation $\text{CV} = \sigma_t / \bar{t}$ indicates benchmark stability — values below 5% suggest reliable measurements.


2. Encode

Binary serialization of benchmark metrics into a compact binary format.

The encoding uses a **fixed-size header** (BENCHMARK_HEADER_SIZE) followed by variable-length experiment name and precision strings. The binary layout:

OffsetSizeField
0–34 bytesMagic number (BENCHMARK_MAGIC)
4–52 bytesFormat version (little-endian u16)
8–158 byteselapsed_ms (LE u64)
16–238 bytesiterations (LE u64)
24–318 bytesinput_samples (LE u64)
32–354 bytesavg_time_ns (LE f32)
......(all metrics fields in sequence)
164–1652 bytesexperiment name length
166–1672 bytesprecision string length
header+variableexperiment name + precision bytes

All multi-byte fields are **little-endian**. The encoded_size() function computes the exact buffer requirement via checked arithmetic to prevent overflow. Encode returns the number of bytes written.


3. Decode

Deserialization of binary benchmark data back into BenchmarkMetricsView.

Decoding attempts two strategies: full format (with magic+version header validation) and compact format (fallback). The decoder validates:

  • Minimum buffer size ≥ BENCHMARK_HEADER_SIZE
  • Magic bytes match BENCHMARK_MAGIC
  • Version matches BENCHMARK_VERSION
  • String length fields do not exceed buffer bounds

BenchmarkMetricsView borrows string slices directly from the input buffer (zero-copy), returning &'a str references with lifetime tied to the source bytes.


4. Simulation

Physics simulation benchmarking with configurable N-body state.

The simulation framework provides:

  • **`SimState`** — Positions and velocities for $N$ bodies in 3D: `positions: Vec<[f64; 3]>`, `velocities: Vec<[f64; 3]>`, plus current simulation time and step count.
  • **SimConfig** — Timestep $\Delta t$, maximum steps, body count.
  • **StepFn trait** — Integration interface: fn integrate(&self, state: &mut SimState, dt: f64). Any ODE integrator (Euler, RK4, Verlet) can be plugged in.
  • **RenderSink trait** — Frame callback for visualization or data collection during simulation.

The benchmark runner measures:

  • Wall-clock time per simulation step
  • Total elapsed time for the full run
  • Throughput: steps per second, bodies × steps per second
  • Scaling behavior: execution time vs. $N$ (expected $O(N^2)$ for direct N-body)

5. Report

Multi-format benchmark report generation.

From a BenchmarkMetrics instance, the report module generates three synchronized outputs:

CSV. Single-row data suitable for spreadsheet import or time-series tracking:

header_row
metrics_row,result

Markdown. Structured report with:

  • Summary table (all metrics as key-value rows)
  • FLOPS, accuracy, $R^2$ (when nonzero)
  • Fenced code block for the result output

HTML. Self-contained single-file report embedding the Markdown content, with inline CSS for readability.

Structured data. Additional generators produce:

  • **JSON** (generate_json_tagged): tagged key-value output with custom metadata
  • **YAML** (generate_yaml_tagged): human-readable structured output
  • **TOML** (generate_toml_tagged): configuration-style output

All string output uses safe escaping (push_escaped) to prevent injection in generated reports.


6. Export

File-based export orchestrator for benchmark suites.

The export() function takes a title, a slice of Entry records (each wrapping a BenchmarkMetrics with optional tags, labels, and grid coordinates), and an output directory. It produces:

  • CSV directory with per-experiment CSV files
  • **Markdown directory** with individual .md reports
  • **HTML dashboard** with a grid layout (using grid_row/grid_col placement)
  • **Binary .bench files** with encoded metrics for machine consumption

The ExportSummary struct reports: files written, HTML size (bytes), Markdown size (bytes).

Element category CSS mapping supports periodic table visualization in exported HTML dashboards, with classes for each IUPAC element category (nonmetal, noble-gas, alkali, transition, lanthanide, actinide, etc.).


Chapter 3 - Limits, Precision, and Validation

Numerical Limits

  • f64 rounding errors can accumulate in long simulations.
  • Extreme regimes (very large or very small scales) require explicit numerical stability checks.

Recommended Verification

  • Compare against a simple analytical case when available.
  • Check the order of magnitude of results.
  • Run sensitivity analysis on dominant parameters.

Transition to Implementation

For concrete function calls, Rust signatures and module paths are documented in docs/code/.

Biology Module

The biology module is the largest in SciForge, spanning 44 submodules across 176 source files. It provides computational models for molecular biology, cellular processes, organismal physiology, population dynamics, and ecological systems — from the scale of individual molecules to entire ecosystems.


Chapter 1 - Module Scope

Scientific Purpose

This section defines the scope: which problem this module solves, which abstraction level it targets, and which outputs are expected.

Modeling Assumptions

  • The equations are numerical models, not analytical proofs.
  • Inputs must respect the documented units.
  • Validity domains (linear regime, local approximation, and so on) should be verified by the reader.

Reading Strategy

  1. Read the module structure.
  2. Identify equations and their conditions.
  3. Map these equations to Rust functions in docs/code/.

Reading Guide

Goal

This page explains the module from a scientific perspective: assumptions, models, equations, and usage limits.

How To Read This Document

  • Start with the domain section relevant to your case.
  • Identify key equations and their usage conditions.
  • Then verify the corresponding Rust signatures in docs/code/.

Conventions

  • Units: SI unless explicitly stated.
  • Variables: standard mathematical notation for the domain.
  • Equations are presented as reference models, not formal proofs.

Chapter 2 - Submodules and Models

1. Aging

Models of biological aging, senescence, and mortality across the lifespan.

Telomere dynamics. Telomeres shorten with each cell division. SciForge models linear attrition:

$$L(n) = L_0 - \delta \cdot n$$

where $L_0$ is the initial telomere length, $\delta$ the loss per division, and $n$ the number of divisions. The Hayflick limit (maximum replicative capacity) is:

$$n_{\max} = \frac{L_0 - L_{\text{crit}}}{\delta}$$

When telomerase is active, an equilibrium length emerges from the balance of shortening rate $k_s$ and elongation rate $k_e$:

$$L_{\text{eq}} = \frac{k_e}{k_s}, \qquad L(t) = L_{\text{eq}} + (L_0 - L_{\text{eq}}) e^{-k_s t}$$

Mortality models. The Gompertz law describes the exponential increase of mortality with age:

$$\mu(x) = a \, e^{bx}$$

where $a$ is the baseline mortality and $b$ the rate of aging. The Gompertz–Makeham extension adds an age-independent term $c$:

$$\mu(x) = c + a \, e^{bx}$$

The mortality rate doubling time (MRDT) is $\ln 2 / b$. Survival probability follows:

$$S(x) = \exp\!\Bigl(-\frac{a}{b}(e^{bx} - 1)\Bigr)$$

The Weibull alternative gives $h(x) = \lambda k (\lambda x)^{k-1}$ with survival $S(x) = e^{-(\lambda x)^k}$.

Oxidative stress. ROS production depends on metabolic rate and mitochondrial coupling efficiency:

$$\dot{R} = M \cdot (1 - \eta)$$

Antioxidant capacity integrates SOD, catalase, and glutathione: $A = [\text{SOD}] k_1 + [\text{Cat}] k_2 + [\text{GSH}] k_3$. Net oxidative damage rate is $(\dot{R} - A)^+$. Lipid peroxidation follows a two-step initiation-propagation model, and protein carbonylation is modeled as second-order kinetics.


2. Bioelectricity

Electrical phenomena in biological membranes and tissues.

Nernst equation. The equilibrium potential for a single ion species:

$$E_{\text{ion}} = \frac{RT}{zF} \ln \frac{[\text{ion}]_{\text{out}}}{[\text{ion}]_{\text{in}}}$$

Goldman–Hodgkin–Katz equation. The resting membrane potential considering multiple permeant ions (Na⁺, K⁺, Cl⁻):

$$V_m = \frac{RT}{F} \ln \frac{P_{\text{K}}[\text{K}^+]_o + P_{\text{Na}}[\text{Na}^+]_o + P_{\text{Cl}}[\text{Cl}^-]_i}{P_{\text{K}}[\text{K}^+]_i + P_{\text{Na}}[\text{Na}^+]_i + P_{\text{Cl}}[\text{Cl}^-]_o}$$

Action potential. SciForge implements the Hodgkin–Huxley model with gating variables $m$, $h$, $n$:

$$C_m \frac{dV}{dt} = -g_{\text{Na}} m^3 h (V - E_{\text{Na}}) - g_{\text{K}} n^4 (V - E_{\text{K}}) - g_L (V - E_L) + I_{\text{ext}}$$

Propagation velocity depends on fiber diameter $d$ and membrane properties. Cable equation analysis gives the length constant $\lambda = \sqrt{r_m / r_i}$.

Bioimpedance. Tissue impedance is modeled with the Cole equation: $Z(\omega) = R_\infty + \frac{R_0 - R_\infty}{1 + (j\omega\tau)^\alpha}$, used in body composition analysis and tissue characterization.


3. Bioenergetics

Energy transformation in living systems.

ATP synthesis. The rate of mitochondrial ATP production depends on proton motive force and the P/O ratio. Energy charge quantifies the adenylate pool status:

$$\text{EC} = \frac{[\text{ATP}] + \frac{1}{2}[\text{ADP}]}{[\text{ATP}] + [\text{ADP}] + [\text{AMP}]}$$

Cells maintain EC near 0.85–0.90 for normal function.

Metabolic scaling. Basal metabolic rate scales allometrically with body mass:

$$B = B_0 M^{3/4}$$

(Kleiber's law). The metabolic theory of ecology extends this to temperature with an Arrhenius-type activation:

$$B = B_0 M^{3/4} e^{-E_a / kT}$$

Photosynthesis. Light reactions are modeled with quantum yield $\Phi$: the ratio of CO₂ fixed to photons absorbed. The light response curve follows a rectangular hyperbola:

$$A = \frac{A_{\max} \cdot I}{K_I + I} - R_d$$

where $A_{\max}$ is maximum assimilation rate, $K_I$ the half-saturation light intensity, and $R_d$ the dark respiration. Calvin cycle efficiency depends on RuBisCO kinetics (Michaelis–Menten with CO₂/O₂ competition).

Respiration. Aerobic yield: ~30–32 ATP per glucose. ATP yield from substrate-level and oxidative phosphorylation is computed stoichiometrically. Anaerobic glycolysis yields 2 ATP per glucose with lactate as end product.


4. Biogeography

Geographic distribution of species.

Island biogeography. MacArthur and Wilson's equilibrium theory models species richness as the balance of immigration rate $I$ and extinction rate $E$:

$$\frac{dS}{dt} = I_0 \left(1 - \frac{S}{P}\right) - E_0 \frac{S}{P}$$

where $P$ is the mainland species pool and $S$ the island species count. Equilibrium: $\hat{S} = P \cdot I_0 / (I_0 + E_0)$.

Species–area relationship: $S = c A^z$, where $z \approx 0.25$ for islands and $z \approx 0.15$ for continental samples.

Climate envelope models. Species occurrence probability is computed from temperature, precipitation, and altitude using Gaussian suitability functions, enabling range shift predictions under climate scenarios.


5. Bioinformatics

Computational analysis of biological sequences.

Sequence alignment. The Needleman–Wunsch algorithm (global alignment) fills a dynamic programming matrix $F$ with:

$$F_{i,j} = \max \begin{cases} F_{i-1,j-1} + s(a_i, b_j) \\ F_{i-1,j} + d \\ F_{i,j-1} + d \end{cases}$$

where $s(a_i, b_j)$ is the substitution score (from BLOSUM/PAM matrices) and $d$ the gap penalty. Smith–Waterman provides local alignment with a zero floor.

Assembly metrics. Genome assembly quality is assessed via N50 (the contig length at which 50% of the total assembly is contained in contigs of that length or longer) and coverage depth:

$$\text{Coverage} = \frac{N \cdot L}{G}$$

where $N$ is the number of reads, $L$ the read length, and $G$ the genome size.

Phred quality scores. Base-calling confidence: $Q = -10 \log_{10} P_e$. A Phred score of 30 means $P_e = 0.001$ (99.9% accuracy). SciForge converts between Phred scores and error probabilities for read filtering pipelines.

Gene expression. Fold change is $\text{FC} = \bar{X}_{\text{treated}} / \bar{X}_{\text{control}}$, typically reported as $\log_2 \text{FC}$. FPKM/TPM normalization accounts for gene length and sequencing depth.


6. Biomechanics

Mechanics of biological structures and movement.

Blood flow. The Hagen–Poiseuille law governs laminar flow in vessels:

$$Q = \frac{\pi r^4 \Delta P}{8 \mu L}$$

Wall shear stress: $\tau_w = \frac{4 \mu Q}{\pi r^3}$. Non-Newtonian effects (shear-thinning of blood) are captured via power-law or Carreau models.

Muscle mechanics. The Hill muscle model relates force and velocity:

$$(F + a)(v + b) = (F_0 + a) b$$

where $F_0$ is the isometric force, $a$ and $b$ are Hill constants. The force-length relationship follows a Gaussian around optimal sarcomere length.

Viscoelasticity. Biological tissues are modeled as:

  • Kelvin–Voigt: $\sigma = E\varepsilon + \eta \dot{\varepsilon}$ (creep behavior)
  • Maxwell: $\dot{\varepsilon} = \dot{\sigma}/E + \sigma/\eta$ (stress relaxation)
  • Standard linear solid: combines both for realistic tissue response

Locomotion. Metabolic cost of transport (COT) is energy per unit distance per unit mass. Stride frequency scales with limb length $l$: $f \propto \sqrt{g/l}$ (pendulum model). Froude number $\text{Fr} = v^2/(g l)$ determines gait transitions.


7. Biophysics

Physical principles applied to biological systems.

Membrane mechanics. The Helfrich bending energy of a lipid bilayer:

$$E = \frac{\kappa}{2} \oint (2H - C_0)^2 \, dA + \kappa_G \oint K \, dA$$

where $\kappa$ is the bending modulus, $H$ the mean curvature, $C_0$ the spontaneous curvature, $K$ the Gaussian curvature, and $\kappa_G$ the Gaussian modulus. This governs vesicle shapes, budding, and membrane fusion.

Molecular forces. The Lennard-Jones potential for van der Waals interactions:

$$V(r) = 4\varepsilon \left[\left(\frac{\sigma}{r}\right)^{12} - \left(\frac{\sigma}{r}\right)^6\right]$$

with well depth $\varepsilon$ and size parameter $\sigma$.

Polymer models. The worm-like chain (WLC) force-extension relation (Marko–Siggia interpolation):

$$F = \frac{k_B T}{L_p} \left[\frac{1}{4(1 - x/L_c)^2} - \frac{1}{4} + \frac{x}{L_c}\right]$$

where $L_p$ is persistence length, $L_c$ contour length. The freely jointed chain (FJC) uses the Langevin function: $\langle x \rangle / L_c = \coth(Fb/k_BT) - k_BT/(Fb)$.

FRET. Förster resonance energy transfer efficiency:

$$E = \frac{1}{1 + (r/R_0)^6}$$

where $R_0$ is the Förster radius (typically 2–7 nm). Used to measure intramolecular distances in proteins.

Protein folding. Two-state folding free energy: $\Delta G = -RT \ln K_{\text{eq}}$, with Ramachandran-based steric energies for backbone conformations.


8. Biostatistics

Statistical methods for biological and clinical data.

Survival analysis. The Kaplan–Meier estimator of the survival function:

$$\hat{S}(t) = \prod_{t_i \le t} \left(1 - \frac{d_i}{n_i}\right)$$

where $d_i$ is the number of events at time $t_i$ and $n_i$ the number at risk. Median survival is $t$ at $\hat{S}(t) = 0.5$.

**Clinical statistics.** Odds ratio: $\text{OR} = (a \cdot d) / (b \cdot c)$ from a 2×2 contingency table. Relative risk: $\text{RR} = [a/(a+b)] / [c/(c+d)]$. Number needed to treat: $\text{NNT} = 1/\text{ARR}$.

Meta-analysis. Combined effect size via inverse-variance weighting: $\hat{\theta} = \sum w_i \theta_i / \sum w_i$ with $w_i = 1/\sigma_i^2$. Heterogeneity is assessed with $I^2 = \max(0, (Q - \text{df})/Q \times 100\%)$, where $Q$ is Cochran's Q statistic.

Logistic regression. Probability of event: $P = 1 / (1 + e^{-(\beta_0 + \beta_1 x)})$. Log-odds: $\ln(P/(1-P)) = \beta_0 + \beta_1 x$.


9. Cancer Biology

Tumor growth, immune surveillance, and therapy modeling.

Tumor–immune dynamics. SciForge models the interaction between tumor cells $T$ and immune cells $I$:

$$\frac{dT}{dt} = r T \left(1 - \frac{T}{K}\right) - \alpha T I, \qquad \frac{dI}{dt} = s + \frac{\rho T I}{\eta + T} - \delta I$$

where $r$ is the tumor growth rate, $K$ carrying capacity, $\alpha$ the kill rate, $s$ the basal immune influx, $\rho$ the immune stimulation, $\eta$ the half-saturation constant, and $\delta$ immune cell death.

Immunoediting. The three phases (elimination, equilibrium, escape) are captured through varying $\alpha$ and $\rho$ parameters. Immunotherapy is modeled by boosting $s$ or $\alpha$.

**Gompertzian tumor growth.** $V(t) = V_0 \exp\!\left[\frac{a}{b}(1 - e^{-bt})\right]$, where growth decelerates as the tumor approaches its limiting size $V_\infty = V_0 e^{a/b}$.


10. Cell Biology

Cellular structure, division, signaling, and transport.

Cell cycle. Doubling time: $t_d = \ln 2 / \mu$, where $\mu$ is the specific growth rate. Checkpoint models use threshold concentrations of cyclins and CDKs.

**Receptor–ligand binding.** At equilibrium: $[RL] = \frac{[R]_T [L]}{K_d + [L]}$, following Michaelis–Menten-type saturation. Hill cooperativity extends this for multivalent receptors.

Fick's diffusion. Molecular transport across membranes: $J = -D \frac{dC}{dx}$. For facilitated diffusion through channels, the Goldman constant field assumption applies.

Cell adhesion. Adhesion energy is computed from contact area and surface energy density. Focal adhesion density depends on substrate stiffness (mechanotransduction).


11. Chronobiology

Biological rhythms and timing systems.

Circadian oscillators. The Goodwin oscillator models mRNA ($m$), protein ($p$), and repressor ($r$):

$$\frac{dm}{dt} = \frac{k_1}{1 + (r/K_i)^n} - d_1 m, \quad \frac{dp}{dt} = k_2 m - d_2 p, \quad \frac{dr}{dt} = k_3 p - d_3 r$$

Sustained oscillations require $n \ge 8$ for the Goodwin model. Coupled oscillators synchronize via diffusive coupling with phase-dependent coupling strengths.

Entrainment. Light pulses shift the oscillator phase according to a phase response curve (PRC). Entrainment range depends on the zeitgeber strength and the oscillator's natural period.


12. Cryobiology

Low-temperature biology and preservation.

Freezing point depression. For an ideal dilute solution: $\Delta T_f = K_f \cdot m$, where $K_f$ is the cryoscopic constant and $m$ the molality. Cryoprotectant (DMSO, glycerol) concentration modulates both osmotic stress and ice nucleation.

Ice formation. Intracellular ice formation probability follows an Arrhenius-type nucleation rate: $J = J_0 \exp(-\Delta G^* / k_B T)$. Rapid cooling increases intracellular ice risk; slow cooling causes osmotic dehydration.

Viability. Cell survival after cryopreservation follows: $V = V_0 \exp(-k \cdot t_{\text{exposure}})$, with optimal cooling rates balancing ice damage and solution effects.


13. Developmental Biology

Embryonic development and pattern formation.

Waddington landscape. Cell fate is modeled as a ball rolling on an epigenetic potential surface $U(x)$. Commitment is: $\text{CI} = 1 - \exp(-|U(x) - U(x_{\text{uncommitted}})|)$, increasing as cells descend into deep valleys.

Morphogen gradients. Exponential gradient from a localized source with diffusion $D$ and degradation $\mu$:

$$C(x) = C_0 \, e^{-x/\lambda}, \qquad \lambda = \sqrt{D/\mu}$$

The French flag model interprets positional information via threshold concentrations defining distinct cell fates.

Turing patterns. Two-component reaction–diffusion generating spatial patterns:

$$\frac{\partial u}{\partial t} = D_u \nabla^2 u + f(u,v), \qquad \frac{\partial v}{\partial t} = D_v \nabla^2 v + g(u,v)$$

Instability requires $D_v \gg D_u$ (long-range inhibition, short-range activation).

Somitogenesis clock. Periodic segmentation with period $T_{\text{clock}}$ and wavefront velocity $v_{\text{front}}$ gives somite length $L = v_{\text{front}} \times T_{\text{clock}}$.


14. Ecology

Community and ecosystem dynamics.

Lotka–Volterra competition. Two-species competitive dynamics:

$$\frac{dN_1}{dt} = r_1 N_1 \left(\frac{K_1 - N_1 - \alpha_{12} N_2}{K_1}\right), \qquad \frac{dN_2}{dt} = r_2 N_2 \left(\frac{K_2 - N_2 - \alpha_{21} N_1}{K_2}\right)$$

Coexistence requires $\alpha_{12} < K_1/K_2$ and $\alpha_{21} < K_2/K_1$ (each species more limited by intraspecific competition).

Predator–prey. The Rosenzweig–MacArthur model with saturating functional response:

$$\frac{dN}{dt} = rN\left(1 - \frac{N}{K}\right) - \frac{aNP}{1 + ahN}, \qquad \frac{dP}{dt} = e \frac{aNP}{1 + ahN} - mP$$

Functional responses. Type I: $f = aN$; Type II: $f = aN/(1+ahN)$; Type III: $f = aN^2/(1+ahN^2)$.

Diversity indices. Shannon entropy: $H' = -\sum p_i \ln p_i$. Simpson: $D = \sum p_i^2$. Evenness: $J = H'/\ln S$.


15. Endocrinology

Hormonal regulation and signaling.

Hormone clearance. First-order elimination: $C(t) = C_0 e^{-k_e t}$, with half-life $t_{1/2} = \ln 2 / k_e$. Metabolic clearance rate: $\text{MCR} = k_e \cdot V_d$.

Pulsatile secretion. Hormones like GnRH are released in pulses. Each pulse is modeled as a bolus: $C(t) = \frac{D}{V_d} e^{-k_e t}$, with interpulse interval $T_p$. The cumulative concentration from multiple pulses is the sum of decaying exponentials.

**Negative feedback.** HPA axis: cortisol suppresses ACTH release. Modeled as: $\frac{d[\text{ACTH}]}{dt} = S_0 / (1 + [\text{Cortisol}]/K_i) - k_d [\text{ACTH}]$.


16. Enzyme Kinetics

Catalytic mechanisms and regulation.

Michaelis–Menten kinetics. The fundamental equation of enzyme kinetics:

$$v = \frac{V_{\max} [S]}{K_m + [S]}$$

where $V_{\max} = k_{\text{cat}} [E]_T$ and $K_m = (k_{-1} + k_{\text{cat}})/k_1$. Catalytic efficiency: $k_{\text{cat}}/K_m$.

Inhibition modes. All four modes are implemented:

  • **Competitive**: $v = V_{\max}[S] / (K_m(1 + [I]/K_i) + [S])$
  • **Uncompetitive**: $v = V_{\max}S] / (K_m + [S)$
  • **Noncompetitive**: $v = V_{\max}[S] / ((K_m + [S])(1 + [I]/K_i))$
  • Mixed: both $K_i$ and $K_i'$ differ

**Lineweaver–Burk linearization.** $\frac{1}{v} = \frac{K_m}{V_{\max}} \cdot \frac{1}{[S]} + \frac{1}{V_{\max}}$.

**Hill equation.** For cooperative enzymes: $v = V_{\max} [S]^n / (K_{0.5}^n + [S]^n)$. Hill coefficient $n > 1$ indicates positive cooperativity.


17. Epigenetics

Heritable modifications beyond DNA sequence.

Histone modification kinetics. Dynamic balance of writers and erasers:

$$\frac{d[\text{mark}]}{dt} = k_{\text{write}} (1 - [\text{mark}]) - k_{\text{erase}} [\text{mark}]$$

Steady-state mark level: $[\text{mark}]_{\text{eq}} = k_{\text{write}} / (k_{\text{write}} + k_{\text{erase}})$.

DNA methylation. CpG methylation dynamics involve maintenance methyltransferase (DNMT1) fidelity and de novo methylation rates. Methylation clocks correlate cumulative CpG changes with biological age.


18. Ethology

Animal behavior and decision-making.

Optimal foraging theory. The marginal value theorem determines optimal patch residence time: leave when the marginal intake rate in the current patch drops to the average rate for the habitat:

$$\frac{\partial g(t)}{\partial t} = \frac{g^*}{t^* + \bar{T}}$$

where $g(t)$ is cumulative gain in the patch and $\bar{T}$ is average travel time between patches.

Optimal diet model. Prey type $i$ should be included if its profitability $e_i / h_i$ exceeds the average return from higher-ranked items. Energy per item: $e_i$; handling time: $h_i$.

Ideal free distribution. Animals distribute across habitats proportionally to resource availability: $n_i / N = r_i / R$, equalizing per-capita intake.


19. Evolution

Evolutionary processes at the molecular and population level.

Molecular clock. Substitution rate: $r = k / (2t)$, where $k$ is the observed substitutions and $t$ the divergence time. For protein-coding genes, the dN/dS ratio ($\omega$) distinguishes selection regimes:

  • $\omega < 1$: purifying selection
  • $\omega = 1$: neutral evolution
  • $\omega > 1$: positive selection

**Coalescent theory.** Expected coalescence time for two lineages in a population of effective size $N_e$: $E[T_2] = 2 N_e$ generations. Neutral diversity: $\pi = 4 N_e \mu$.

Watterson's theta. Estimated from the number of segregating sites $S$:

$$\hat{\theta}_W = \frac{S}{\sum_{i=1}^{n-1} 1/i}$$

Fixation probability. For a new mutation with selection coefficient $s$ in a diploid population: $P_{\text{fix}} \approx 2s$ (Haldane's approximation for beneficial mutations).


20. Genetics

Classical and molecular genetics.

Hardy–Weinberg equilibrium. Allele frequencies remain constant in the absence of evolutionary forces. For alleles $p$ and $q = 1-p$: genotype frequencies $p^2 : 2pq : q^2$.

F-statistics. Wright's $F_{ST}$ measures population differentiation:

$$F_{ST} = \frac{H_T - H_S}{H_T}$$

where $H_T$ is total expected heterozygosity and $H_S$ the mean within-subpopulation heterozygosity.

Nucleotide diversity. $\pi = \frac{n}{n-1} \sum_{i<j} 2 p_i p_j d_{ij}$, the average number of pairwise differences per site.

Watterson's theta from segregating sites provides an alternative estimate of $4 N_e \mu$.


21. Genomics

Genome-scale analysis.

Gene density. Genes per megabase: $\rho = n_{\text{genes}} / (L_{\text{genome}} / 10^6)$.

CpG enrichment. Observed/expected CpG ratio:

$$\text{CpG}_{o/e} = \frac{N_{\text{CpG}} \cdot L}{N_C \cdot N_G}$$

Ratios > 0.6 indicate CpG islands (associated with promoter regions).

Codon adaptation index (CAI). Measures synonymous codon usage bias relative to a reference set of highly expressed genes:

$$\text{CAI} = \exp\!\left(\frac{1}{L} \sum_{i=1}^{L} \ln w_i\right)$$

where $w_i$ is the relative adaptiveness of the $i$-th codon. High CAI correlates with high expression.


22. Immunology

Immune system modeling.

Somatic hypermutation and affinity maturation. B-cell receptor affinity evolves through iterative mutation and selection in germinal centers. Affinity after $n$ rounds: $A_n = A_0 (1 + \delta)^n$, where $\delta$ is the mean fractional improvement per round.

Antibody titer. Concentration doubling during acute response: $T(t) = T_0 \cdot 2^{t / t_d}$ during the expansion phase, followed by exponential decay: $T(t) = T_{\text{peak}} e^{-k t}$.

**Neutralization.** The fraction of pathogen neutralized: $f = \frac{[Ab]^n}{K_d^n + [Ab]^n}$ (Hill-type dose–response).

Isotype switching. Class-switch recombination probabilities depend on cytokine milieu signals (IL-4 → IgE, IFN-γ → IgG).


23. Marine Biology

Ocean ecosystems and organisms.

Phytoplankton growth. Nutrient-limited growth with Monod kinetics:

$$\mu = \mu_{\max} \frac{N}{K_N + N}$$

with extensions for light limitation (Smith function) and temperature dependence (Eppley curve: $\mu_{\max} = 0.59 e^{0.0633 T}$).

Sverdrup critical depth. A spring bloom occurs when the mixed layer depth $Z_m$ is shallower than the critical depth $Z_{cr}$:

$$Z_{cr} = \frac{I_0 (1 - e^{-k Z_{cr}})}{k \cdot I_c}$$

where $I_c$ is the compensation irradiance and $k$ the extinction coefficient.

NPZ model. Nutrient–Phytoplankton–Zooplankton coupled ODEs:

$$\frac{dN}{dt} = -\mu P + \gamma Z + m P, \quad \frac{dP}{dt} = \mu P - g P Z - m P, \quad \frac{dZ}{dt} = g P Z - \gamma Z$$


24. Microbiology

Microbial growth and interactions.

Quorum sensing. Autoinducer (AHL) dynamics:

$$\frac{d[\text{AHL}]}{dt} = k_{\text{prod}} \cdot n_{\text{cells}} - k_{\text{deg}} [\text{AHL}]$$

When $[\text{AHL}]$ exceeds a threshold $K_T$, target gene activation is: $f = [\text{AHL}]^h / (K_T^h + [\text{AHL}]^h)$ (Hill function).

Monod growth kinetics. $\mu = \mu_{\max} S / (K_s + S)$, where $S$ is the limiting substrate and $K_s$ the half-saturation constant.

Chemostat steady state. Dilution rate $D$ sets the wash-out threshold: at steady state, $\mu = D$, giving $S^* = K_s D / (\mu_{\max} - D)$.


25. Mycology

Fungal biology and ecology.

Saprotrophic decomposition. First-order exponential decay of substrate: $M(t) = M_0 e^{-k t}$, with carbon release rate $\dot{C} = k \cdot M(t)$. Decomposition rate constants $k$ vary with temperature (Q₁₀ models) and moisture.

Spore germination. Germination percentage as a function of time: $G(t) = G_{\max}(1 - e^{-r t})$. Optimal conditions are moisture > threshold and temperature in a species-specific range.

Hyphal growth. Colony radius expansion follows linear kinetics: $r(t) = r_0 + v t$. Branching frequency determines mycelial density.


26. Neuroscience

Computational neuroscience and neural systems.

Spike analysis. Mean firing rate: $\bar{r} = n_{\text{spikes}} / T$. Interspike interval (ISI) distribution characterizes regularity. The Fano factor measures spike count variability:

$$F = \frac{\text{Var}(N)}{\langle N \rangle}$$

$F = 1$ for Poisson spiking; $F < 1$ indicates regularity; $F > 1$ clustering.

Coefficient of variation of ISI: $\text{CV} = \sigma_{\text{ISI}} / \mu_{\text{ISI}}$.

Integrate-and-fire. $\tau_m \frac{dV}{dt} = -(V - V_{\text{rest}}) + R I_{\text{ext}}$. Spike when $V = V_{\text{threshold}}$; reset to $V_{\text{reset}}$.


27. Nutrition

Nutrient metabolism and dietary analysis.

First-order absorption. Plasma concentration after oral intake:

$$C(t) = \frac{D \cdot k_a}{V_d (k_a - k_e)} (e^{-k_e t} - e^{-k_a t})$$

where $k_a$ is the absorption rate, $k_e$ elimination rate, and $D$ the dose.

Gastric emptying. Exponential emptying: $V(t) = V_0 e^{-k_g t}$ for liquids; power-exponential for solids.

Glycemic index. $\text{GI} = (\text{AUC}_{\text{food}} / \text{AUC}_{\text{reference}}) \times 100$. Glycemic load: $\text{GL} = \text{GI} \times g_{\text{carb}} / 100$.


28. Paleobiology

Ancient life and deep time.

Background extinction rate. Expressed in extinctions per million species-years (E/MSY):

$$\dot{E}_{\text{bg}} = \frac{\text{extinctions}}{N \cdot \Delta t}$$

Mass extinction magnitude. Kill curve: percentage of taxa lost. $M = 1 - S_{\text{after}} / S_{\text{before}}$ where $S$ is species richness. The "Big Five" events exceeded 75% genus-level extinction.

Origination rate. $\hat{o} = \ln(N_{t+1} / N_t + E) / \Delta t$, accounting for both new appearances and losses.


29. Parasitology

Host–parasite interactions.

Anderson–May model. Macroparasite dynamics with mean burden $P$ in host population $H$:

$$\frac{dH}{dt} = (b - d) H - \alpha P, \qquad \frac{dP}{dt} = \beta H - (\mu + d + \alpha) P - \alpha \frac{k+1}{k} \frac{P^2}{H}$$

where $k$ is the negative binomial aggregation parameter (lower $k$ = more aggregated parasites).

Negative binomial distribution. Parasite burdens are overdispersed: $\text{Var} = \mu (1 + \mu/k)$. Proportion of hosts with > $n$ parasites: $P(X > n) = 1 - \text{NB}(n; k, \mu)$.


30. Pharmacology

Drug action and disposition.

Oral bioavailability. $F = f_{\text{abs}} \cdot (1 - E_{\text{gut}}) \cdot (1 - E_{\text{hepatic}})$, where $E$ represents extraction ratios.

Noyes–Whitney dissolution. $\frac{dm}{dt} = D \frac{A}{h}(C_s - C_t)$, where $A$ is surface area, $h$ diffusion layer thickness, $C_s$ solubility, $C_t$ bulk concentration.

Hepatic clearance. The well-stirred model: $CL_{\text{H}} = \frac{Q_H \cdot f_u \cdot CL_{\text{int}}}{Q_H + f_u \cdot CL_{\text{int}}}$, where $Q_H$ is hepatic blood flow, $f_u$ the unbound fraction, and $CL_{\text{int}}$ the intrinsic clearance.

One-compartment PK. IV bolus: $C(t) = (D/V_d) e^{-k_e t}$. Half-life: $t_{1/2} = 0.693 / k_e$. AUC: $D / (V_d \cdot k_e)$.


31. Phylogenetics

Evolutionary relationships and tree construction.

Jukes–Cantor distance. Corrects for multiple substitutions at the same site:

$$d = -\frac{3}{4} \ln\!\left(1 - \frac{4p}{3}\right)$$

where $p$ is the observed fraction of differing sites.

Kimura 2-parameter. Separates transitions ($P$) and transversions ($Q$):

$$d = -\frac{1}{2} \ln(1 - 2P - Q) - \frac{1}{4} \ln(1 - 2Q)$$

Tree construction. Distance matrices feed into neighbor-joining or UPGMA algorithms. Likelihood methods evaluate tree topologies using substitution model parameters.


32. Physiology

Organ system function modeling.

Frank–Starling mechanism. Stroke volume increases with end-diastolic volume:

$$SV = SV_{\max} \cdot (1 - e^{-k \cdot V_{\text{ED}}})$$

Cardiac output. $CO = HR \times SV$. Ejection fraction: $EF = SV / V_{\text{ED}}$.

Mean arterial pressure. $\text{MAP} = \text{DBP} + \frac{1}{3}(\text{SBP} - \text{DBP})$. Vascular resistance: $R = \text{MAP} / CO$.

Renal function. GFR estimation, tubular reabsorption rates, and clearance calculations.

Oxygen dissociation. Hill equation for hemoglobin: $Y = \frac{pO_2^n}{P_{50}^n + pO_2^n}$ with $n \approx 2.8$ and $P_{50} \approx 26.6$ mmHg.


33. Plant Biology

Plant physiology and ecology.

Tilman competition. Two species competing for a single resource: the species with the lower $R^*$ (minimum resource requirement) wins: $R^* = K_s \cdot m / (\mu_{\max} - m)$.

**Allelopathy.** Chemical inhibition between plants: $G = G_0 e^{-\alpha \cdot [\text{toxin}]}$.

Canopy light extinction. Beer–Lambert law through leaf layers:

$$I(L) = I_0 \, e^{-k \cdot \text{LAI}}$$

where $\text{LAI}$ is leaf area index and $k$ the extinction coefficient (~0.5 for broadleaf).


34. Population Biology

Population dynamics and structure.

Logistic growth. Density-dependent growth:

$$\frac{dN}{dt} = rN\left(1 - \frac{N}{K}\right)$$

Solution: $N(t) = K / (1 + (K/N_0 - 1)e^{-rt})$.

SIR epidemiological model. Compartmental disease dynamics solved with RK4:

$$\frac{dS}{dt} = -\frac{\beta S I}{N}, \quad \frac{dI}{dt} = \frac{\beta S I}{N} - \gamma I, \quad \frac{dR}{dt} = \gamma I$$

Basic reproduction number: $R_0 = \beta / \gamma$. Herd immunity threshold: $1 - 1/R_0$. SciForge also implements SEIR (with exposed compartment, latency rate $\sigma$).

Leslie matrix. Age-structured population projection: $\mathbf{n}_{t+1} = \mathbf{L} \cdot \mathbf{n}_t$, where $\mathbf{L}$ contains fecundities in the first row and survival probabilities on the subdiagonal. The dominant eigenvalue $\lambda$ gives the asymptotic growth rate.


35. Proteomics

Protein-level analysis.

Peptide molecular weight. Computed from amino acid residue masses:

$$M_{\text{peptide}} = \sum_i n_i \cdot M_{\text{residue},i} + M_{\text{H}_2\text{O}}$$

where the water molecule accounts for the uncondensed termini. SciForge provides a complete table of 20 amino acid average and monoisotopic masses (e.g., Gly = 57.021 Da, Trp = 186.079 Da).

Isoelectric point. Estimated by finding the pH at which net charge is zero, summing Henderson–Hasselbalch contributions from all ionizable residues.


36. Radiobiology

Radiation effects on biological systems.

DNA damage. Single-strand break probability per gray: $P_{\text{SSB}} = 1 - e^{-\alpha_{\text{SSB}} D}$. DSB probability: $P_{\text{DSB}} = 1 - e^{-\alpha_{\text{DSB}} D}$. DSBs are the critical lethal lesion.

Chromosome aberrations. Dicentric yield: $Y = \alpha D + \beta D^2$ (linear-quadratic model). This underlies biological dosimetry.

Linear-quadratic cell survival. $S(D) = e^{-\alpha D - \beta D^2}$, with $\alpha/\beta$ ratio distinguishing early-responding ($\alpha/\beta \approx 10$ Gy) from late-responding ($\alpha/\beta \approx 3$ Gy) tissues.


37. Reproduction

Reproductive biology and embryogenesis.

Cleavage timing. Embryonic cell count at time $t$: $N(t) = 2^{\lfloor t / T_{\text{cycle}} \rfloor}$, where $T_{\text{cycle}}$ is the cleavage cycle duration (~12–24 hours in mammals).

Morphogen gradients. Exponential decay from a source (see Developmental Biology). Threshold-dependent cell fate commitment determines tissue patterning.

Somitogenesis clock. Periodic gene expression drives segmentation with period $T$. Somite size $= v_{\text{wavefront}} \times T$.


38. Stem Cell Biology

Stem cell dynamics and engineering.

Waddington potential. The multipotency index quantifies a cell's distance from committed states:

$$\text{MI} = 1 - \frac{|U(x) - U_{\text{peak}}|}{U_{\text{peak}} - U_{\text{valley}}}$$

$\text{MI} = 1$ at the hilltop (fully multipotent); $\text{MI} = 0$ at a valley (fully committed).

Differentiation commitment. Commitment index: $\text{CI} = 1 - \exp(-|U(x) - U_{\text{uncommitted}}|)$.

Self-renewal vs. differentiation. Balance determines stem cell pool maintenance. Symmetric division: two stem cells or two differentiated cells. Asymmetric: one of each.


39. Structural Biology

Macromolecular structure analysis.

3D molecular geometry. Bond angles from three atomic positions using the dot product:

$$\theta = \arccos\!\left(\frac{\vec{BA} \cdot \vec{BC}}{|\vec{BA}||\vec{BC}|}\right)$$

Dihedral (torsion) angles from four atoms using the cross-product method. Ramachandran plots map backbone $\phi/\psi$ angles to identify allowed conformational regions.

RMSD. Root mean square deviation between two structures: $\text{RMSD} = \sqrt{\frac{1}{N}\sum_{i=1}^{N} d_i^2}$.


40. Synthetic Biology

Engineered biological systems.

Toggle switch. Gardner's bistable genetic circuit with mutual repression:

$$\frac{du}{dt} = \frac{\alpha_1}{1 + v^n} - \beta u, \qquad \frac{dv}{dt} = \frac{\alpha_2}{1 + u^n} - \gamma v$$

Two stable steady states exist when $n > 1$ and $\alpha_1, \alpha_2$ are sufficiently large relative to $\beta, \gamma$.

Repressilator. Three-gene ring oscillator (Elowitz & Leibler):

$$\frac{dx_i}{dt} = \frac{\alpha}{1 + x_{(i+2)\bmod 3}^n} + \alpha_0 - \beta x_i$$

Sustained oscillations emerge for appropriate parameter regimes.

CRISPR scoring. On-target efficiency depends on GC content, position-specific scores, and PAM strength: $S = S_{\text{pos}} \times f_{\text{GC}} \times \text{PAM}$. Off-target CFD (cutting frequency determination) score: $\text{CFD} = \prod (1 - p_{\text{mismatch},i})$.

Metabolic engineering. The flux balance objective maximizes a linear function: $Z = \mathbf{c}^T \mathbf{v}$ subject to stoichiometric constraints $\mathbf{S} \mathbf{v} = 0$. Theoretical yield: $Y = (\text{substrate carbons} / \text{product carbons}) \times \eta$.

Stochastic gene expression. Mean protein level: $\langle P \rangle = (k_{\text{txn}} k_{\text{tln}}) / (\delta_m \delta_p)$. Fano factor: $F = 1 + b$, where burst size $b = k_{\text{tln}} / (\delta_m + \delta_p)$. Intrinsic noise: $\eta^2_{\text{int}} = (1+b)/\langle P \rangle$.


41. Systems Biology

Whole-system modeling of biological networks.

Bistability. Toggle switch dynamics (same formalism as synthetic biology) produce hysteresis and ultrasensitivity in signaling cascades.

Flux balance analysis (FBA). Steady-state metabolic flux through stoichiometric matrix $\mathbf{S}$: $\mathbf{S} \mathbf{v} = 0$. Feasibility requires all metabolic production/consumption rates to balance within tolerance.

Boolean networks. Gene regulatory networks with discrete ON/OFF states. State update: $x_i(t+1) = f_i(x_{j_1}(t), x_{j_2}(t), \ldots)$ where $f_i$ is a Boolean rule. Attractor analysis reveals stable cell states.

Goodwin oscillator. Negative feedback loop with cooperative repression (Hill coefficient $n$). Simulated with Euler integration. The repressilator extends this to three-gene ring topology.

Sensitivity analysis. Local sensitivity: normalized partial derivative. Morris method: elementary effects screening. Sobol indices: first-order $S_i = V_i / V_T$, total-order $S_{Ti} = 1 - V_{-i}/V_T$, and partial rank correlation coefficient (PRCC) for monotonic relationships.


42. Tissue Engineering

Engineering biological tissues.

Bioreactor design. Perfusion rate: $D = Q / V$. Shear stress in parallel-plate bioreactor:

$$\tau = \frac{6 \mu Q}{w h^2}$$

where $\mu$ is viscosity, $Q$ flow rate, $w$ width, $h$ height. Oxygen transfer rate: $\text{OTR} = k_L a \cdot (C^* - C)$.

Scaffold degradation. Bulk erosion: $M(t) = M_0 e^{-kt}$. Surface erosion: $M(t) = M_0 - r \cdot A \cdot t$. Porosity: $\phi = V_{\text{void}} / V_{\text{total}}$. Mechanical stiffness degrades as $E(t) = E_0 (1 - f_d)^n$.

Krogh cylinder. Oxygen distribution around a capillary:

$$pO_2(r) = pO_{2,\text{cap}} - \frac{Q_0}{4D}(r^2 - r_c^2 - 2r_c^2 \ln(r/r_c))$$

Nutrient penetration depth: $L = \sqrt{2 D C_s / Q_0}$, limiting maximum engineered tissue thickness without vascularization.

Vascularization. VEGF concentration follows exponential decay from source: $C(x) = C_0 e^{-x/\lambda}$. Sprouting probability: Hill function of VEGF level. Optimal vessel spacing: $2\sqrt{2 D \cdot pO_{2,a} / Q_0}$.


43. Toxicology

Effects of toxic substances.

Bioconcentration factor (BCF). $\text{BCF} = C_{\text{organism}} / C_{\text{water}}$. Biomagnification factor: $\text{BMF} = C_{\text{predator}} / C_{\text{prey}}$. One-compartment toxicokinetics:

$$\frac{dC}{dt} = k_{\text{uptake}} \cdot C_{\text{exposure}} - k_{\text{elim}} \cdot C$$

LD50 estimation. Probit analysis: transform dose–response data via probit($p$) vs. $\ln(\text{dose})$, then linear regression to find the dose at probit = 5 (50% mortality).

Dose–response. Hill model: $E = E_{\max} D^n / (EC_{50}^n + D^n)$. Benchmark dose (BMD): the dose producing a specified benchmark response above background.

**Oxidative stress mechanisms.** Oxidative stress index: $\text{OSI} = \text{ROS production} / \text{antioxidant capacity}$. DNA adduct formation: $\dot{A} = k [M][DNA]$. Lipid peroxidation and protein carbonylation follow second-order kinetics.

Ecotoxicology. Species sensitivity distributions (SSD) rank species NOEC/EC50 values to derive protective concentrations (HC5 = hazardous concentration for 5% of species).


44. Virology

Virus biology and dynamics.

Target-cell limited model. Within-host viral dynamics:

$$\frac{dx}{dt} = -\beta x v, \qquad \frac{dy}{dt} = \beta x v - \delta y, \qquad \frac{dv}{dt} = p y - c v$$

where $x$ = uninfected target cells, $y$ = infected cells, $v$ = free virus, $\beta$ = infection rate, $\delta$ = infected cell death, $p$ = virus production, $c$ = clearance.

Basic reproduction number. $R_0 = \frac{\beta p x_0}{\delta c}$. Infection establishes when $R_0 > 1$. Burst size: $N = p / \delta$.

Viral load decay. Under therapy: $v(t) = v_0 e^{-ct}$, with half-life $t_{1/2} = \ln 2 / c$ (typically 6 hours for HIV).

Quasispecies theory. Fitness of the master sequence with mutation rate $\mu$ per base and genome length $L$:

$$W = w_0 (1 - \mu)^L$$

Error threshold. Maximum mutation rate compatible with selection: $\mu_{\max} = 1 - (1/\sigma)^{1/L}$ where $\sigma$ is the superiority of the master sequence.

Epidemiology. SIR and SEIR models (see Population Biology). Epidemic doubling time, generation time, and serial interval are computed for emerging pathogens.

Capsid geometry. Caspar–Klug theory: T-number triangulation gives $60T$ subunits per icosahedral capsid. Capsid radius: $R = \sqrt{N \cdot A_{\text{sub}} / (4\pi)}$. Genome packaging density: $\rho = L_{\text{genome}} / V_{\text{capsid}}$.


Chapter 3 - Limits, Precision, and Validation

Numerical Limits

  • f64 rounding errors can accumulate in long simulations.
  • Extreme regimes (very large or very small scales) require explicit numerical stability checks.

Recommended Verification

  • Compare against a simple analytical case when available.
  • Check the order of magnitude of results.
  • Run sensitivity analysis on dominant parameters.

Transition to Implementation

For concrete function calls, Rust signatures and module paths are documented in docs/code/.

Chemistry Module

The Chemistry module spans 26 submodules across 56 source files, covering analytical, physical, organic, inorganic, and computational chemistry. It provides tools for reaction modeling, equilibrium calculations, spectroscopic analysis, and materials characterization.


Chapter 1 - Module Scope

Scientific Purpose

This section defines the scope: which problem this module solves, which abstraction level it targets, and which outputs are expected.

Modeling Assumptions

  • The equations are numerical models, not analytical proofs.
  • Inputs must respect the documented units.
  • Validity domains (linear regime, local approximation, and so on) should be verified by the reader.

Reading Strategy

  1. Read the module structure.
  2. Identify equations and their conditions.
  3. Map these equations to Rust functions in docs/code/.

Reading Guide

Goal

This page explains the module from a scientific perspective: assumptions, models, equations, and usage limits.

How To Read This Document

  • Start with the domain section relevant to your case.
  • Identify key equations and their usage conditions.
  • Then verify the corresponding Rust signatures in docs/code/.

Conventions

  • Units: SI unless explicitly stated.
  • Variables: standard mathematical notation for the domain.
  • Equations are presented as reference models, not formal proofs.

Chapter 2 - Submodules and Models

1. Acid-Base Chemistry

Proton transfer equilibria govern pH, buffer behavior, and titration analysis — central to biology, environmental chemistry, and industrial processes.

**Equilibria** — The Henderson-Hasselbalch equation $\text{pH} = \text{p}K_a + \log_{10}([A^-]/[HA])$ predicts pH of buffer solutions. The module computes pH of strong acids ($\text{pH} = -\log c$), strong bases ($\text{pH} = 14 + \log c$), weak acids ($\text{pH} = \frac{1}{2}(\text{p}K_a - \log c)$), and weak bases. Interconversion between $K_a$, $\text{p}K_a$, and $\text{p}K_b$ is provided ($\text{p}K_a + \text{p}K_b = \text{p}K_w$). For polyprotic systems, the alpha fraction $\alpha_i$ gives the proportion of each protonation state as a function of [H⁺] and the successive $K_a$ values. The amphiprotic pH formula $\text{pH} \approx (\text{p}K_{a1} + \text{p}K_{a2})/2$ handles zwitterionic species.

Titrations — Equivalence point determination, half-equivalence pH (equals $\text{p}K_a$), and complete titration curve modeling for mono- and polyprotic acids.


2. Analytical Chemistry

Quantitative and qualitative techniques for chemical characterization.

Chromatography — The van Deemter equation $H = A + B/u + Cu$ models plate height as a function of mobile-phase velocity, combining eddy diffusion ($A$), longitudinal diffusion ($B/u$), and mass transfer resistance ($Cu$). Resolution $R_s$, capacity factor, retention factor, selectivity, and number of theoretical plates are all computed.

Quantitative Analysis — Gravimetric yield, volumetric titration calculations, standard addition method, and calibration curve regression.

Spectrophotometry — Beer-Lambert law $A = \varepsilon \ell c$ relates absorbance to molar absorptivity, path length, and concentration. Transmittance $T = 10^{-A}$, multi-component analysis via linear superposition of absorptivities.


3. Colloids

Chemistry of dispersed systems (nanoparticles, emulsions, foams) where interface effects dominate bulk properties.

Properties — Particle size distribution statistics, specific surface area, sedimentation rate (Stokes' law $v = 2r^2\Delta\rho g/(9\mu)$), and Brownian motion.

Stability — DLVO theory combines van der Waals attraction and electric double-layer repulsion to predict colloidal stability. The module computes zeta potential, coagulation kinetics, Schulze-Hardy rule (critical coagulation concentration scales as $z^{-6}$ for the ion valence), and flocculation rates.


4. Computational Chemistry

Numerical approaches to molecular electronic structure.

Basis Sets — Construction of Gaussian-type orbital (GTO) and Slater-type orbital (STO) basis sets for molecular calculations. Primitive and contracted Gaussian parameters.

Density Functional Theory — DFT total energy calculations using exchange-correlation functionals. Energy decomposition into kinetic, Coulomb, exchange, and correlation contributions.


5. Crystallography

Solid-state structural analysis using diffraction and lattice geometry.

Diffraction — Bragg's law $n\lambda = 2d\sin\theta$ for constructive interference of X-rays. Structure factor $F_{hkl}$ calculation, powder diffraction peak positions, reciprocal lattice vectors.

Lattice — Unit cell parameters (a, b, c, α, β, γ), the seven crystal systems, packing fractions (FCC 0.74, BCC 0.68, SC 0.52), Miller index determination, and interplanar distances $d_{hkl} = a/\sqrt{h^2+k^2+l^2}$ for cubic systems.


6. Electrochemistry

Electron transfer processes, from batteries to corrosion to electroplating.

**Cells** — The Nernst equation $E = E^0 - \frac{RT}{nF}\ln Q$ gives the cell potential under non-standard conditions. Standard electrode potentials combine as $E_{\text{cell}} = E_{\text{cathode}} - E_{\text{anode}}$. Gibbs free energy $\Delta G = -nFE$. Faraday's law of electrolysis $m = ItM/(nF)$ gives the mass deposited. The Tafel equation $\eta = a + b\log|j|$ models overpotential. The Butler-Volmer equation $j = j_0[\exp(\alpha_a F\eta/RT) - \exp(-\alpha_c F\eta/RT)]$ describes full current-overpotential behavior. Battery metrics: open-circuit voltage, energy density (Wh/kg), Faradaic efficiency, and coulombic efficiency.

Transport — Ionic conductivity, transference numbers, Debye-Hückel limiting law $\log\gamma_\pm = -A|z_+z_-|\sqrt{I}$ for activity coefficients in dilute electrolytes.


7. Environmental Chemistry

Chemistry of natural systems and pollutant fate.

Atmosphere — Ozone formation and destruction cycles, photochemical smog kinetics, greenhouse gas atmospheric lifetimes, and radiative forcing.

Water — Dissolved oxygen modeling, biological and chemical oxygen demand (BOD/COD), water hardness (Ca²⁺ + Mg²⁺ equivalents), and composite water quality indices.


8. Equilibrium

Chemical equilibrium thermodynamics.

**Constants** — Equilibrium constant expressions $K = \prod [P]^{n_p}/\prod [R]^{n_r}$, reaction quotient $Q$, Le Chatelier's principle (qualitative), and $K_p/K_c$ interconversion via $K_p = K_c(RT)^{\Delta n}$.

Ionic Equilibria — Solubility product $K_{sp}$, common ion effect on solubility, complex ion formation constants, and precipitation criteria ($Q > K_{sp}$).


9. Gas Laws

Behavior of ideal and real gases under varying conditions.

Ideal — $PV = nRT$, combined gas law $P_1V_1/T_1 = P_2V_2/T_2$, Dalton's law of partial pressures $P_{\text{total}} = \sum P_i$, Graham's law of effusion $\text{rate} \propto 1/\sqrt{M}$, and molar volume at STP.

Real — Van der Waals equation $(P + a/V_m^2)(V_m - b) = RT$ corrects for molecular attractions ($a$) and finite molecular volume ($b$). Compressibility factor $Z = PV/(nRT)$ quantifies departure from ideality. Virial coefficients for systematic correction.


10. Green Chemistry

Sustainability metrics for chemical process evaluation.

Metrics — Atom economy $= M_{\text{product}}/M_{\text{reactants}} \times 100\%$, E-factor (mass of waste per mass of product), and process mass intensity (total mass input per mass of product).

Principles — The twelve principles of green chemistry (prevention, atom economy, less hazardous synthesis, etc.) encoded as a decision framework, with solvent selection guidelines.


11. Inorganic Chemistry

Non-carbon-based chemical systems, coordination compounds, and crystal field theory.

Bonding — Ionic bond energy, Born-Landé lattice energy $U = \frac{N_A M z^+ z^- e^2}{4\pi\varepsilon_0 r_0}(1-1/n)$, and electronegativity difference classification (ionic vs. covalent).

Coordination — Complex geometry (octahedral, tetrahedral, square planar), chelate effect thermodynamics, stability constants, and isomer enumeration.

Crystal Field Theory — Octahedral splitting $\Delta_{\text{oct}} = 10Dq$, tetrahedral splitting $\Delta_{\text{tet}} = \frac{4}{9}\Delta_{\text{oct}}$. Crystal field stabilization energy (CFSE) accounting for electron occupation and pairing energy. Spin-only magnetic moment $\mu = \sqrt{n(n+2)}\,\mu_B$. Spectrochemical series (ligand $f$ × metal $g$ product). Jahn-Teller distortion prediction. Nephelauxetic ratio $\beta = B_{\text{complex}}/B_{\text{free ion}}$ measures covalency. Racah parameter extraction from electronic transitions.


12. Kinetics

Rates and mechanisms of chemical reactions — essential for reactor design, pharmacology, and environmental fate modeling.

**Rate Laws** — The Arrhenius equation $k = A e^{-E_a/RT}$ connects rate constant to activation energy. Integrated rate laws: zero-order $[A] = [A]_0 - kt$, first-order $[A] = [A]_0 e^{-kt}$, second-order $1/[A] - 1/[A]_0 = kt$, and the general $n$th-order form. Half-lives: $t_{1/2} = \ln 2/k$ (first-order), $t_{1/2} = 1/(k[A]_0)$ (second-order), $t_{1/2} = [A]_0/(2k)$ (zero-order). Activation energy extraction from two temperatures: $E_a = R\ln(k_2/k_1)/(1/T_1 - 1/T_2)$.

**Advanced Kinetics** — Eyring equation $k = \kappa(k_BT/h)\exp(-\Delta G^\ddagger/RT)$ from transition-state theory. Collision frequency from kinetic molecular theory. General rate law $r = k\prod [A_i]^{n_i}$.

Mechanisms — Elementary step analysis, rate-determining step identification, steady-state approximation for reactive intermediates.


13. Molecular Chemistry

Molecular structure, bonding, and geometry prediction.

Bonding — VSEPR theory, hybridization assignment (sp, sp², sp³, etc.), bond order, and electronegativity (Pauling, Mulliken).

Geometry — Bond angle prediction, molecular shape from electron-pair geometry, and dipole moment vector summation.


14. Nuclear Chemistry

Radioactive processes and nuclear energy.

Decay — Alpha, beta, gamma decay rate laws, decay series modeling, and nuclear transmutation calculations.

Energy — Binding energy per nucleon from mass defect, fission and fusion energy release, and mass-energy equivalence $E = \Delta m \cdot c^2$.


15. Organic Chemistry

Carbon-based molecular systems — the foundation of biochemistry and materials science.

Descriptors — Molecular weight, degree of unsaturation $\text{DoU} = (2C+2+N-H)/2$, and functional group classification.

**Reactions** — SN1 (rate $= k[\text{substrate}]$), SN2 (rate $= k[\text{substrate}][\text{nucleophile}]$), E1, and E2 kinetics. The Hammett equation $\log(k/k_0) = \rho\sigma$ quantifies substituent electronic effects via $\sigma$ constants and reaction sensitivity $\rho$. The Taft equation separates steric from electronic contributions: $\log(k/k_0) = \rho^*\sigma^* + \delta E_s$.

Structure — Constitutional and stereoisomerism, chirality, conformational analysis (Newman projections, ring strain).


16. Photochemistry

Light-driven chemical processes, fundamental to photosynthesis, solar cells, and photocatalysis.

Kinetics — Photochemical reaction rates, photosensitization, and dynamic quenching.

**Quantum Yield** — Fluorescence ($\Phi_f$) and phosphorescence yields, Stern-Volmer analysis $I_0/I = 1 + K_{SV}[Q]$ for quencher concentration dependence.


17. Polymers

Macromolecular chemistry governing plastics, fibers, and biological polymers.

Distributions — Number-average ($M_n$) and weight-average ($M_w$) molecular weight, polydispersity index $PDI = M_w/M_n$, and degree of polymerization.

**Properties** — Mark-Houwink equation $[\eta] = KM^a$ for intrinsic viscosity. End-to-end distance of a freely-jointed chain $R = l\sqrt{N}$. Radius of gyration $R_g = R/\sqrt{6}$. Fox equation for glass transition of blends. Carothers equation $\bar{X}_n = 2/(2 - p\bar{f})$ for step-growth polymerization degree.


18. Quantum Chemistry

Quantum mechanical treatment of molecular electronic structure.

Hückel MO Theory — Secular determinant construction for linear and cyclic conjugated systems. The $\alpha + x\beta$ Hamiltonian matrix encodes nearest-neighbor interactions. $\pi$-electron energies, delocalization energy, and charge density distributions from MO coefficients and occupation numbers.

Orbitals — Atomic orbital energies, electron configurations, molecular orbital construction, and orbital symmetry.


19. Reaction Engineering

Chemical reactor analysis and design for industrial-scale processes.

Design — CSTR (continuous stirred-tank reactor) design equation $V = F_{A0}X/(-r_A)$ and PFR (plug flow reactor) equation $V = F_{A0}\int_0^X dX'/(-r_A)$. Residence time, space velocity, and conversion calculations.

Reactors — Batch, continuous, and semi-batch reactor models, selectivity, and yield optimization for parallel and series reactions.


20. Solid-State Chemistry

Electronic and defect structure of crystalline materials.

Band Theory — Band gap determination, classification of conductors, insulators, and semiconductors, and Fermi level positioning.

Defects — Point defects (vacancies, interstitials), Schottky pairs ($n_s = N\exp(-E_s/2k_BT)$), Frenkel defects, and defect equilibrium thermodynamics.


21. Solutions

Dissolved species behavior and mixture thermodynamics.

Colligative Properties — Boiling point elevation $\Delta T_b = iK_bm$, freezing point depression $\Delta T_f = iK_fm$, osmotic pressure $\Pi = iMRT$, and vapor pressure lowering (Raoult's law). Molar mass determination from ebullioscopy and cryoscopy.

Mixtures — Raoult's law $P_i = x_i P_i^0$ for ideal solutions, Henry's law $P = K_H x$ for dilute solutes, activity coefficients for real mixtures, and excess Gibbs energy.


22. Spectroscopy

Interaction of electromagnetic radiation with matter for structural determination.

IR Spectroscopy — Infrared absorption frequencies mapped to functional groups. Selection rules (dipole moment change required). Characteristic group frequencies for O-H, N-H, C=O, C-H, etc.

Mass Spectrometry — Mass-to-charge ratio analysis, isotope pattern computation, fragmentation pattern prediction, and molecular ion identification.

NMR Spectroscopy — Chemical shift $\delta = (f - f_{\text{ref}})/f_{\text{spec}} \times 10^6$ ppm. Spin-spin coupling constants. Multiplicity from $n+1$ rule. Larmor frequency $\nu = \gamma B_0/(2\pi)$. Relaxation: $T_1$ (inversion recovery $M = M_0(1 - 2e^{-t/T_1})$) and $T_2$ (spin echo $M = M_0 e^{-t/T_2}$). Linewidth $\Delta\nu = 1/(\pi T_2)$. Nuclear Overhauser enhancement $\eta = 1 + \gamma_I/(2\gamma_S)$.


23. Stoichiometry

Quantitative relationships in chemical reactions.

Balancing — Chemical equation balancing using oxidation number methods and half-reaction approaches.

Calculations — Mole ratios from balanced equations, limiting reagent identification, theoretical yield, and percent yield.


24. Surface Chemistry

Interfacial phenomena controlling catalysis, adsorption, and wetting.

**Adsorption** — Langmuir isotherm $\theta = K P/(1+KP)$ (monolayer, uniform surface), Freundlich isotherm $q = K_f P^{1/n}$ (heterogeneous surface), BET isotherm $V = V_m c x/[(1-x)(1-x+cx)]$ for multilayer adsorption ($x = P/P_0$). Temkin isotherm (heat of adsorption decreases linearly with coverage). Dissociative Langmuir adsorption. BET surface area determination from monolayer volume.

Surface Tension — Surface tension, capillarity, Young-Laplace equation $\Delta P = 2\gamma/r$, and contact angle (Young's equation).


25. Thermochemistry

Energy changes in chemical processes.

Enthalpy — Hess's law (additivity of enthalpies), standard enthalpies of formation, bond enthalpies (average bond dissociation energies), and calorimetry calculations.

Entropy — Standard molar entropy, Gibbs free energy $\Delta G = \Delta H - T\Delta S$, and spontaneity criteria ($\Delta G < 0$).


26. Transport Phenomena

Mass and momentum transfer in chemical systems.

Diffusion — Fick's first law $J = -D\,dc/dx$ (steady-state flux) and second law $\partial c/\partial t = D\,\partial^2 c/\partial x^2$ (transient). Diffusion coefficients in gases and liquids.

Mass Transfer — Convective mass transfer coefficients, film theory (stagnant film model), and penetration theory (surface renewal model).


Chapter 3 - Limits, Precision, and Validation

Numerical Limits

  • f64 rounding errors can accumulate in long simulations.
  • Extreme regimes (very large or very small scales) require explicit numerical stability checks.

Recommended Verification

  • Compare against a simple analytical case when available.
  • Check the order of magnitude of results.
  • Run sensitivity analysis on dominant parameters.

Transition to Implementation

For concrete function calls, Rust signatures and module paths are documented in docs/code/.

Constants Module

The constants module provides **6 domain-organized submodules** containing **571 curated scientific constants** as compile-time pub const f64 declarations. All values are sourced from CODATA 2018, NASA/JPL, IUPAC, and IAU references. No runtime overhead — every constant is inlined at compilation. The periodic table (118 elements) is loaded separately via compile-time YAML parsing.


Chapter 1 - Module Scope

Scientific Purpose

This module centralizes every numerical constant used by the SciForge computation modules. Constants are grouped by the scientific domain they serve, ensuring that each computation module imports only from its corresponding constants subdirectory.

Modeling Assumptions

  • All values are in SI base units unless explicitly documented otherwise (e.g., AU in meters, not km).
  • Derived constants (e.g., $\mu_0 = 1/(\varepsilon_0 c^2)$) are computed from fundamental values at compile time for self-consistency.
  • Precision is limited to f64 (≈ 15-16 significant digits).

Reading Strategy

  1. Identify the scientific domain your computation belongs to.
  2. Locate the corresponding constants subdirectory below.
  3. Cross-reference with docs/code/Constants.md for the complete list of individual constant names.

Reading Guide

Goal

This page explains the scientific context, origin, and relationships of the constants from a domain perspective.

How To Read This Document

  • Each section covers one constants subdirectory and its source files.
  • Key relationships between constants are highlighted with equations.
  • For the exhaustive list of constant names and values, see docs/code/Constants.md.

Conventions

  • Units: SI unless explicitly stated.
  • Sources: CODATA 2018 for fundamental/atomic; NASA/JPL for astronomical; IUPAC for chemical/elemental.
  • All constants are pub const f64 — zero-cost compile-time inlining.

Chapter 2 - Submodules and Models

1. Physics (58 constants)

**Source files:** fundamental.rs, atomic.rs, elements.rs, units.rs

Core physical constants, atomic-scale parameters, element data infrastructure, and unit conversion factors — the foundation of the entire crate.

Fundamental Constants — Speed of light $c = 2.997\,924\,58 \times 10^8\;\text{m/s}$, gravitational constant $G = 6.674\,30 \times 10^{-11}\;\text{m}^3\text{kg}^{-1}\text{s}^{-2}$, Planck constant $h$, reduced Planck $\hbar = h/2\pi$, Boltzmann $k_B$, Avogadro $N_A$, elementary charge $e$, vacuum permittivity $\varepsilon_0$, vacuum permeability $\mu_0 = 1/(\varepsilon_0 c^2)$, Coulomb constant $k_e = 1/(4\pi\varepsilon_0)$, Stefan-Boltzmann $\sigma$, gas constant $R = k_B N_A$, Faraday constant $F = N_A e$, fine-structure constant $\alpha$, strong coupling $\alpha_s$, Fermi coupling $G_F$, Wien displacement constant $b$.

Planck Units — Natural units at the quantum-gravity boundary: $\ell_P = \sqrt{\hbar G/c^3}$, $m_P = \sqrt{\hbar c/G}$, $t_P = \ell_P/c$, $T_P = m_P c^2/k_B$. These set the scales ($10^{-35}$ m, $10^{-8}$ kg, $10^{-44}$ s, $10^{32}$ K) where general relativity and quantum mechanics simultaneously matter.

Atomic Constants — Particle masses ($m_p$, $m_n$, $m_e$, u), mass-energy equivalence ($1\;\text{u} = 931.494\;\text{MeV}/c^2$), Bohr radius $a_0 = \hbar/(m_e c\alpha)$, Rydberg energy $Ry = 13.606\;\text{eV}$, Compton wavelength $\lambda_C = h/(m_e c)$, Bohr magneton $\mu_B$, nuclear magneton $\mu_N$. Hydrogen energy levels follow $E_n = -Ry/n^2$.

**Elements** — Compile-time infrastructure for the periodic table: 118 elements loaded from YAML files in tableau-periodique/ via SciForge's built-in parser. Each element provides atomic number, symbol, standard atomic mass (IUPAC), electronegativity (Pauling), group, and period. Organized into 11 IUPAC categories (alkali metals, transition metals, lanthanides, actinides, etc.). Thread-safe lazy initialization via OnceLock.

Unit Conversions — Energy ($\text{eV} \leftrightarrow \text{J}$, $\text{cal} \to \text{J}$, $\text{erg}$, $\text{hartree}$), pressure ($\text{atm}$, $\text{bar}$, $\text{torr} \to \text{Pa}$), angular ($\text{deg} \leftrightarrow \text{rad}$), length ($\text{Å} = 10^{-10}\;\text{m}$, $\text{fm} = 10^{-15}\;\text{m}$, $\text{barn} = 10^{-28}\;\text{m}^2$), temperature shifts.


2. Astronomy (276 constants)

**Source files:** astro.rs, astrophysics.rs, darkmatter.rs, galactic.rs, stellar.rs

The largest constants subdirectory, covering the full range from solar-system scales to cosmological parameters.

Solar System — AU ($1.496 \times 10^{11}\;\text{m}$), parsec, light-year. Solar mass $M_\odot = 1.989\,1 \times 10^{30}\;\text{kg}$, radius $R_\odot$, luminosity $L_\odot$, effective temperature $T_\odot$. Earth mass $M_\oplus$, radius $R_\oplus$, gravity $g_\oplus$. Complete orbital and physical parameters for all 8 planets (Mercury–Neptune): mass, radius, flattening, orbital period, semi-major axis, eccentricity, inclination, axial tilt, sidereal day, surface gravity, escape velocity, mean density, Bond albedo, orbital velocity — sourced from NASA/JPL ephemeris.

Stellar Physics — Mass-luminosity exponents, spectral classification coefficients, Chandrasekhar limit ($1.4\,M_\odot$), Eddington luminosity prefactor. Wien constant $b = 2.898 \times 10^{-3}\;\text{m·K}$.

Cosmology — Hubble constant $H_0 = 67.4\;\text{km/s/Mpc}$, CMB temperature $T_{\text{CMB}} = 2.725\;\text{K}$, density parameters ($\Omega_m$, $\Omega_\Lambda$, $\Omega_r$, $\Omega_b$), dark energy equation-of-state $w_0$, matter-radiation equality redshift $z_{\text{eq}}$. Hubble flow velocity per Mpc.

Galactic — Milky Way mass $M_{\text{MW}}$, disk radius $R_d$, disk scale height $h_z$, stellar mass, star count, bulge radius. Solar galactocentric distance, orbital velocity, and period. Sgr A* mass and distance. M31 mass, distance, and radial approach velocity.

Dark Matter — NFW profile parameters (scale radius, central density), local dark matter density, WIMP-nucleon cross section, velocity dispersion.

Impact Cratering — Empirical scaling coefficients (crater diameter, fireball radius) with associated exponents from hydrocode simulations.


3. Biology (106 constants)

**Source files:** bioenergetics.rs, neuroscience.rs, physiology.rs, radiobiology.rs

Quantitative biology constants spanning cellular energetics, neuroscience, physiology, and radiation biology.

Bioenergetics — ATP hydrolysis free energy ($\Delta G^\circ = -30.5\;\text{kJ/mol}$), mitochondrial membrane potential, proton-motive force, electron transport chain redox potentials, photosynthetic quantum yield ($\Phi \approx 0.125$), Calvin cycle stoichiometry, metabolic scaling exponents (Kleiber's law $B \propto M^{0.75}$), enzyme kinetics reference parameters.

Neuroscience — Nernst equation constants, Goldman-Hodgkin-Katz voltage coefficients, resting membrane potential ($V_m \approx -70\;\text{mV}$), ion channel conductances ($g_{\text{Na}}$, $g_{\text{K}}$, $g_{\text{leak}}$), reversal potentials, action potential thresholds, synaptic time constants, neurotransmitter diffusion coefficients.

Physiology — Cardiac output, blood viscosity, vessel compliance parameters, respiratory volumes, gas exchange constants (O₂/CO₂ partial pressures, Henry's law coefficients for blood gases), hemoglobin binding cooperativity (Hill coefficient $n \approx 2.8$), alveolar ventilation.

Radiobiology — Linear-quadratic model coefficients ($\alpha$, $\beta$), tissue radiosensitivity parameters, oxygen enhancement ratio (OER), dose-rate constants for common isotopes, repair half-times, cell survival curve parameters.


4. Geology (56 constants)

**Source files:** impact.rs, radioactive.rs, seawater.rs

Earth-science constants for geochronology, seawater geochemistry, and impact cratering.

Radioactive Decay — Decay constants for all major geochronological systems: $\lambda_{^{238}\text{U}} = 1.551\,25 \times 10^{-10}\;\text{yr}^{-1}$, $\lambda_{^{235}\text{U}}$, $\lambda_{^{232}\text{Th}}$, $\lambda_{^{40}\text{K}}$ (total and branching ratios), $\lambda_{^{87}\text{Rb}}$, $\lambda_{^{147}\text{Sm}}$, $\lambda_{^{14}\text{C}}$. Heat production rates per unit mass for $^{238}$U, $^{232}$Th, $^{40}$K — essential for mantle thermal evolution models.

Seawater — UNESCO/TEOS-10 equation-of-state polynomial coefficients for seawater density $\rho(T,S)$: base density, thermal expansion terms ($T^1$ through $T^5$), salinity terms, cross-terms. Sound speed empirical coefficients (Medwin formula). Thermal expansion and haline contraction baseline coefficients.

Impact — Crater scaling law coefficients and exponents (density, projectile diameter, velocity, gravity). Fireball radius scaling from kiloton-equivalent energy.


5. Mathematics (57 constants)

**Source files:** approximation.rs, ode.rs, quadrature.rs

Numerical analysis constants — nodes, weights, and coefficients for integration, ODE solving, and function approximation.

Quadrature — Gauss-Legendre nodes and weights for various orders. Gauss-Kronrod extension nodes for adaptive integration with error estimation. Clenshaw-Curtis weights.

ODE Solvers — Butcher tableau coefficients for Runge-Kutta methods: RK4 (classic 4th order), Dormand-Prince 5(4) embedded pair (adaptive step control), and other multi-stage methods. The Dormand-Prince coefficients are the industry-standard choice for general-purpose adaptive ODE integration.

Approximation — Chebyshev polynomial nodes and weights for spectral interpolation. Padé approximant coefficients for rational function fitting. Remez algorithm reference constants.


6. Meteorology (18 constants)

**Source files:** atmospheric.rs

Atmospheric science constants used across all meteorology computation submodules.

Thermodynamic — Standard sea-level pressure $P_0 = 101\,325\;\text{Pa}$, sea-level air density $\rho_0 = 1.225\;\text{kg/m}^3$, specific gas constants for dry air $R_d = 287.05\;\text{J/(kg·K)}$ and water vapor $R_v = 461.5\;\text{J/(kg·K)}$, specific heat at constant pressure $c_p = 1004\;\text{J/(kg·K)}$, latent heat of vaporization $L_v = 2.501 \times 10^6\;\text{J/kg}$. Magnus formula coefficients ($A = 17.67$, $B = 243.5\;\text{°C}$) for saturation vapor pressure.

Dynamic — Earth rotation rate $\Omega = 7.292 \times 10^{-5}\;\text{rad/s}$, von Kármán constant $\kappa = 0.41$ (log-layer turbulence). Beaufort-to-m/s conversion coefficient and exponent.

Oceanographic — JONSWAP spectrum parameters ($\alpha$, $\gamma$, $\sigma_a$, $\sigma_b$, peak frequency coefficient). Phillips spectrum constants. Wave height and period empirical scaling coefficients.


Chapter 3 - Limits, Precision, and Validation

Numerical Limits

  • f64 precision limits all constants to ≈ 15-16 significant digits.
  • Derived constants computed from other constants at compile time may accumulate floating-point rounding in the last digits.

Recommended Verification

  • Cross-reference critical values against CODATA 2018, NASA/JPL Horizons, and IUPAC databases.
  • For high-precision calculations, verify that the constant precision matches your application's requirements.
  • Check units carefully: all constants are in SI base units unless documented otherwise.

Transition to Implementation

For the complete enumeration of every constant name, value, and unit, see docs/code/Constants.md.

Geology Module

The Geology module spans 10 submodules focused on Earth sciences: seismology, radiometric dating, petrology, and plate tectonics. It provides tools for seismic wave analysis, rock classification, age determination, and geodynamic modeling.


Chapter 1 - Module Scope

Scientific Purpose

This section defines the scope: which problem this module solves, which abstraction level it targets, and which outputs are expected.

Modeling Assumptions

  • The equations are numerical models, not analytical proofs.
  • Inputs must respect the documented units.
  • Validity domains (linear regime, local approximation, and so on) should be verified by the reader.

Reading Strategy

  1. Read the module structure.
  2. Identify equations and their conditions.
  3. Map these equations to Rust functions in docs/code/.

Reading Guide

Goal

This page explains the module from a scientific perspective: assumptions, models, equations, and usage limits.

How To Read This Document

  • Start with the domain section relevant to your case.
  • Identify key equations and their usage conditions.
  • Then verify the corresponding Rust signatures in docs/code/.

Conventions

  • Units: SI unless explicitly stated.
  • Variables: standard mathematical notation for the domain.
  • Equations are presented as reference models, not formal proofs.

Chapter 2 - Submodules and Models

1. Dating

Radiometric and geochronological methods for determining the age of rocks, minerals, and organic remains. These techniques exploit the predictable decay of radioactive isotopes to anchor Earth's geological timescale.

Radioactive Decay — The fundamental law $N(t) = N_0 e^{-\lambda t}$ describes the exponential decrease of a parent isotope, where $\lambda = \ln 2 / t_{1/2}$ is the decay constant. The general radiometric age from a daughter-to-parent ratio is $t = \frac{1}{\lambda}\ln\!\left(1 + \frac{D}{P}\right)$.

Carbon-14 Dating — For organic materials up to ~50 ka, the age follows $t = -8267\,\ln(R)$ where $R$ is the measured ¹⁴C/¹²C ratio relative to the modern standard. The mean life $\tau = 8267$ years corresponds to the Libby half-life of 5730 years.

Potassium-Argon (K-Ar) — Used for volcanic rocks, with $t = \frac{1}{\lambda}\ln\!\left(1 + \frac{{}^{40}\text{Ar}}{f \cdot {}^{40}\text{K}}\right)$ where $\lambda = 5.543 \times 10^{-10}\,\text{yr}^{-1}$ and $f = 0.1048$ is the electron capture branching ratio.

Uranium-Lead (U-Pb) — The most precise chronometer for ancient rocks. Age from $t = \frac{1}{\lambda_{238}}\ln\!\left(1 + \frac{{}^{206}\text{Pb}}{{}^{238}\text{U}}\right)$ with $\lambda_{238} = 1.55125 \times 10^{-10}\,\text{yr}^{-1}$. Concordia diagrams combine both U decay chains for discordance analysis.

Isochron Method — Linear regression on a plot of daughter/stable vs. parent/stable isotope ratios: the slope $m$ gives $t = \frac{1}{\lambda}\ln(1+m)$, and the y-intercept gives the initial ratio, eliminating the need for assumptions about initial daughter abundance.

Fission Track Dating — Counts spontaneous fission tracks of ²³⁸U in minerals: $t = \frac{1}{\lambda}\ln\!\left(1 + \frac{\lambda\,\rho_s\,\rho_d}{\rho_i}\right)$ where $\rho_s$, $\rho_i$, $\rho_d$ are spontaneous, induced, and dosimeter track densities.

Luminescence Dating — Equivalent dose from accumulated radiation: $\text{Age} = \text{Natural Signal} / \text{Dose Rate}$. Applicable to quartz and feldspar grains in sediments (OSL/TL).

Cosmogenic Nuclide Exposure — Surface exposure age from in-situ production of cosmogenic isotopes (¹⁰Be, ²⁶Al): $t = -\frac{1}{\lambda}\ln\!\left(1 - \frac{C\lambda}{P}\right)$ where $C$ is concentration and $P$ is the local production rate.


2. Petrology

Rock classification, igneous geochemistry, and magmatic process modeling.

CIPW Normative Mineralogy — The Cross-Iddings-Pirsson-Washington norm recasts whole-rock oxide analyses (SiO₂, Al₂O₃, FeO, MgO, CaO, Na₂O, K₂O…) into hypothetical mineral assemblages. The quartz norm $Q = \text{SiO}_2 - \text{feldspars} - \text{mafics}$ determines silica saturation (positive Q → quartz-normative; negative → nepheline-normative).

Mg Number — An index of magmatic differentiation: $\text{Mg\#} = \frac{\text{MgO}/40.3}{\text{MgO}/40.3 + \text{FeO}/71.85} \times 100$. Primitive basalts have Mg# > 70; evolved magmas < 50.

Total Alkali-Silica (TAS) — Classification of volcanic rocks by plotting $(\text{Na}_2\text{O} + \text{K}_2\text{O})$ vs. SiO₂, delineating fields for basalt, andesite, dacite, rhyolite, etc.

Alumina Saturation Index — $\text{ASI} = \frac{\text{Al}_2\text{O}_3/102}{\text{CaO}/56 + \text{Na}_2\text{O}/62 + \text{K}_2\text{O}/94}$ in molar proportions. ASI < 1 → metaluminous; ASI = 1 → peraluminous boundary; ASI > 1 → peraluminous (cordierite/garnet-bearing granites).

Differentiation Index — $DI = Q + Or + Ab + Ne$ from the CIPW norm, quantifying degree of magmatic evolution (high DI → granitic; low DI → gabbroic).

Liquidus & Solidus — Liquidus temperature interpolation from a binary phase diagram. Solidus depression by water: $T_{\text{solidus}} = T_0 - k \cdot w^{0.6}$ where $w$ is water content (wt.%).

Crystal Settling — Stokes' velocity for crystals sinking through magma: $v = \frac{2\Delta\rho\,g\,r^2}{9\mu}$. Magma viscosity follows an Arrhenius relation $\mu = A\exp(E_a/RT)$, strongly dependent on SiO₂ content and temperature.


3. Seismology

Earthquake characterization and seismic wave propagation through Earth's interior.

Body Waves — P-wave velocity $V_P = \sqrt{(K + \frac{4}{3}G)/\rho}$ and S-wave velocity $V_S = \sqrt{G/\rho}$, where $K$ is the bulk modulus, $G$ the shear modulus, and $\rho$ the density. S-waves cannot propagate in liquids ($G = 0$), which constrains the outer core to be fluid.

Magnitude Scales — The local (Richter) magnitude $M_L = \log_{10} A + 3\log_{10} d - 2.92$ relates to the amplitude $A$ (µm) and epicentral distance $d$ (km). The moment magnitude $M_w = (\log_{10} M_0 - 9.1)/1.5$ is based on the seismic moment $M_0 = \mu A D$ (rigidity × fault area × slip). Seismic energy $E = 10^{1.5M+4.8}$ (Gutenberg-Richter energy-magnitude relation).

Epicenter Location — Triangulation from $S - P$ arrival time: $\Delta = \frac{(t_S - t_P) \cdot V_P \cdot V_S}{V_P - V_S}$ requires three or more station readings.

Snell's Law (Seismic) — Refraction at layer boundaries: $\frac{\sin\theta_1}{V_1} = \frac{\sin\theta_2}{V_2}$, critical for ray-tracing through Earth's velocity structure and detecting discontinuities (Mohorovičić, Gutenberg).

Gutenberg-Richter Law — Earthquake frequency-magnitude distribution: $\log_{10} N = a - bM$ where $N$ is the annual number of earthquakes ≥ magnitude $M$, $a$ measures total seismicity and $b \approx 1$ globally.

Omori's Law — Aftershock decay rate: $n(t) = K/(t+c)^p$ where $t$ is time after the mainshock, $c$ avoids the singularity at $t = 0$, and $p \approx 1$ empirically.

Peak Ground Acceleration — Ground motion prediction equation $\text{PGA} = a \cdot e^{bM}/d$ relating magnitude and hypocentral distance to hazard, used for seismic building codes.


4. Tectonics

Plate motion, lithospheric mechanics, and thermal evolution of sedimentary basins.

Plate Velocity — Average velocity $v = d/t$ from hotspot tracks or magnetic anomaly offsets. Velocity at any point from an Euler pole: $v = \omega R \sin\theta$ where $\omega$ is the angular velocity, $R$ the Earth's radius, and $\theta$ the angular distance (colatitude) from the rotation pole.

Isostasy — Airy model: a topographic elevation $h$ is compensated by a crustal root of depth $r = h\rho_c/(\rho_m - \rho_c)$. Pratt model: density varies laterally so that $\rho(D + h) = \rho_{\text{ref}} D_{\text{ref}}$ for constant compensation depth. General isostatic equilibrium: free-board $= t_c(1 - \rho_c/\rho_m)$.

McKenzie Stretching Model — Initial subsidence of a rift basin under uniform lithospheric thinning (stretching factor $\beta$):

$$S_i = t_c \frac{\rho_m \alpha T_l}{2(\rho_m - \rho_c)}\left(1 - \frac{1}{\beta}\right)$$

where $\alpha$ is the thermal expansion coefficient and $T_l$ the basal lithosphere temperature. Subsequent thermal subsidence follows $e(t) = e_0(1 - e^{-t/\tau})$ with a thermal time constant $\tau \approx 60$ Myr.

Heat Flow — Fourier's law $q = -k\,dT/dz$ links surface heat flow to thermal conductivity and the geothermal gradient. Temperature at depth: $T(z) = T_s + \nabla T \cdot z$.

Flexural Rigidity — The bending resistance of the lithosphere: $D = \frac{E\,T_e^3}{12(1-\nu^2)}$ where $E$ is Young's modulus, $T_e$ the effective elastic thickness, and $\nu$ Poisson's ratio. Inverse calculation of $T_e$ from observed flexure constrains lithospheric strength.


5. Erosion

Surface weathering and denudation processes — the destructive counterpart to tectonic uplift.

Fluvial Erosion — Stream-power erosion rate: $\dot{e} = K\,P^{3/2}\tan\alpha\,(1 - v_c)$ where $K$ is an erodibility coefficient, $P$ the precipitation rate, $\alpha$ the slope angle, and $v_c$ the vegetation cover fraction (0 = bare, 1 = full cover). This captures the interaction between climate, topography, and land cover.

Chemical Weathering — Arrhenius-modulated dissolution: $R = A\exp(-E_a/R^*T)\,P^{0.65}$ where $A$ is a pre-exponential factor, $E_a$ the activation energy, $R^*$ the gas constant, $T$ the temperature, and $P$ the precipitation. The $P^{0.65}$ exponent reflects the kinetic role of water throughput in mineral dissolution.

Frost Weathering — Mechanical fragmentation by freeze-thaw cycles: $R = 0.001\,n_{\text{ft}}\,\phi$ where $n_{\text{ft}}$ is the annual number of freeze-thaw cycles and $\phi$ the porosity. Dominant in periglacial environments.

Wind Erosion — The Bagnold threshold friction velocity: $u_* = 0.1\sqrt{(\rho_p - \rho_a)gd / \rho_a}$ where $d$ is the grain diameter. Below this threshold, wind cannot entrain particles. Fine silt and clay require higher velocities than sand due to cohesion.

Volcanic Explosivity — Qualitative VEI classification from ejecta volume, discretized on a logarithmic scale: VEI 0 ($<10^{-5}\;\text{km}^3$) through VEI 8 ($>100\;\text{km}^3$).


6. Geomorphology

Large-scale landform evolution — from planetary hypsometry to tectonic and volcanic topography.

Hypsometric Curve — Statistical elevation distribution: $z(f) = \bar{z} + \sigma\,(2/\pi)\arcsin(2f - 1)$ where $f$ is the cumulative area fraction, $\bar{z}$ the mean elevation, and $\sigma$ the standard deviation. The bimodal Earth hypsometry (continents at $\sim 0.84\;\text{km}$, ocean floor at $\sim -3.7\;\text{km}$) reflects isostatic equilibrium of two crust types.

Ocean Basin Depth — Lithospheric cooling model: $d(t) = d_r + 2\alpha T_l(\rho_m - \rho_w)/\rho_m \sqrt{\kappa t/\pi}$ where $d_r$ is ridge crest depth, $t$ is plate age (Myr), and $\kappa$ the thermal diffusivity. The $\sqrt{t}$ dependence (Parsons-Sclater model) fits oceanic bathymetry well to $\sim 80\;\text{Ma}$.

Orogenic Elevation — Net surface uplift from the competition between convergence and erosion: $h(t) = (v_{\text{conv}} - v_{\text{eros}})(1 - \rho_c/\rho_m)\,t$, incorporating isostatic compensation. Mid-ocean ridge elevation scales with spreading rate $\propto \sqrt{v_s}$.

Stream Power Erosion — The Hack/detachment-limited model: $\dot{e} = K A^m S^n$ where $A$ is drainage area (proxy for discharge), $S$ is channel slope, and $m$, $n$ are empirical exponents ($m \approx 0.5$, $n \approx 1$). This governs channel incision and knickpoint retreat.

**Sediment Transport** — Shields parameter $\tau^* = \tau / [(\rho_s - \rho_w)gd]$ determines whether flow entrains bed material. Above the critical Shields number ($\tau^*_c \approx 0.047$), the Meyer-Peter and Müller formula gives bedload transport: $q_b \propto (\tau^* - \tau^*_c)^{3/2}$.

Impact Craters — Energy-gravity scaling for crater diameter, with a simple-to-complex transition: simple craters ($D < D_t$) have $\text{depth} = D/5$; complex craters ($D > D_t$) follow $\text{depth} \propto D_t^{0.3} D^{0.7}$ due to central rebound.

Volcanic Edifice Profiles — Shield volcano (parabolic): $h(r) = H(1 - r^2/R^2)$. Stratovolcano (concave): $h(r) = H(1 - r/R)^2$. Caldera (piecewise): subsidence bowl + raised rim with Gaussian decay.

Rift Valleys and Faults — Rift half-width from flexural rigidity: $w = \pi(4D/\rho_m g)^{1/4}$. Tectonic stress $\sigma = \eta v / h$ (viscous plate model). Fault slip rate from Coulomb failure criterion.

Weathering and Soil — Thermally activated chemical weathering (same Arrhenius form as erosion module). Soil production function: $P = P_0 \exp(-d/d^*)$ with exponential decline under thickening soil. Landscape diffusion $\partial h/\partial t = D \nabla^2 h$ (creep-dominated hillslopes). Flexural wavelength from elastic plate bending.


7. Glaciology

Ice dynamics — rheology, flow, and erosion by glaciers and ice sheets.

Glen's Flow Law — The constitutive relation for polycrystalline ice: $\dot{\varepsilon} = A\,\tau^n$ where $\dot{\varepsilon}$ is the strain rate, $\tau$ the deviatoric stress, $A$ the creep parameter (strongly temperature-dependent via Arrhenius), and $n \approx 3$ the Glen exponent. This nonlinear viscous law is the foundation of all ice-sheet models.

Shallow Ice Approximation — The vertically integrated surface velocity for a grounded ice sheet on a sloped bed:

$$u_s = \frac{2A}{n+1}(\rho g \sin\alpha)^n H^{n+1}$$

where $\alpha$ is the surface slope and $H$ the ice thickness. This assumes that longitudinal stress gradients are negligible compared to basal shear — valid for large ice sheets far from margins.

Ice Viscosity — Effective viscosity $\eta = 1/(2A\tau^{n-1})$, diverging at zero stress (rigid behavior at rest) and decreasing under load (shear-thinning). Temperature dependence causes basal ice to flow orders of magnitude faster than cold surface ice.

Glacial Erosion — Quarrying and abrasion rate: $\dot{e} = K_g v_b^l$ where $v_b$ is the basal sliding velocity and $l \approx 1$ (linear erosion law) to $l \approx 2$ (quadratic). This produces U-shaped valleys, fjords, and cirques.


8. Hydrology

Open-channel flow, dimensionless regime indicators, and stream power for fluvial geomorphology.

Manning Equation — Mean flow velocity in an open channel: $v = (1/n)\,R_h^{2/3}\,S^{1/2}$ where $n$ is Manning's roughness coefficient, $R_h$ the hydraulic radius, and $S$ the energy slope. Typical $n$ ranges from 0.012 (smooth concrete) to 0.06 (mountain streams with boulders).

Chézy Equation — An alternative open-channel formula: $v = C\sqrt{R_h S}$ where $C$ is the Chézy coefficient (related to Manning's $n$ by $C = R_h^{1/6}/n$).

Froude Number — $Fr = v/\sqrt{gd}$ characterizes the flow regime: $Fr < 1$ is subcritical (tranquil, deep), $Fr = 1$ is critical, and $Fr > 1$ is supercritical (shooting, shallow). Hydraulic jumps occur at the transition from supercritical to subcritical.

Reynolds Number — $Re = vd/\nu$ separates laminar ($Re < 2000$) from turbulent ($Re > 4000$) flow in channels. Virtually all natural river flows are fully turbulent.

Stream Power — Total stream power per unit length: $\Omega = \rho g Q S$ where $Q$ is the discharge. This is the rate of potential energy expenditure available for sediment transport and channel incision. Specific stream power $\omega = \Omega / w$ (per unit channel width) is the key parameter for predicting channel morphology.

Hjulström Curve — Empirical erosion threshold velocity as a function of grain size: sand ($d \sim 0.5\;\text{mm}$) erodes at the lowest velocity ($\sim 0.2\;\text{m/s}$); both finer (clay, due to cohesion) and coarser (gravel, due to weight) particles require higher velocities. The piecewise function captures this characteristic minimum.


9. Mantle Dynamics

Thermal convection, core evolution, and geodynamo in planetary interiors.

Rayleigh Number — The master dimensionless number for convection: $Ra = \alpha g \Delta T D^3/(\kappa\nu)$ where $\alpha$ is the thermal expansion coefficient, $\Delta T$ the temperature contrast, $D$ the mantle depth, $\kappa$ the thermal diffusivity, and $\nu$ the kinematic viscosity. Earth's mantle $Ra \sim 10^7$ — vigorous convection far above the critical value ($Ra_c \approx 10^3$).

Nusselt Number — Heat transfer enhancement by convection: $Nu = 0.195\,Ra^\beta$ where $\beta \approx 1/3$ for high-$Ra$ convection. $Nu = 1$ means purely conductive; Earth's mantle $Nu \sim 20$.

Convective Velocity — $v \sim (\kappa/D)\,Ra^{2/3}$, typically a few cm/yr for the mantle — matching observed plate velocities. The mantle overturn time $\tau = D/v \sim 100\;\text{Myr}$ is the characteristic renewal timescale.

Core Thermal Structure — Adiabatic temperature profile: $T(P) = T_0(1 + \gamma P/K)$ where $\gamma$ is the Grüneisen parameter and $K$ the bulk modulus. Inner-core radius determined by the intersection of the adiabat with the iron solidus. Core heat flux $q = k\Delta T/R_c$ and CMB heat flux $q_{\text{CMB}} = Nu\,k\Delta T/D$.

**Viscosity** — Arrhenius temperature dependence: $\eta = \eta_0 \exp[(E_a/k_B)(1/T - 1/T_0)]$. Orders-of-magnitude viscosity variation ($10^{19}$–$10^{22}\;\text{Pa\cdot s}$) across the mantle drives stagnant-lid vs. mobile-lid convection regimes.

Thermal Boundary Layer — Thickness $\delta \sim D\,Ra^{-1/3}$ at both the surface (lithosphere) and CMB (D" layer). Mantle plumes arise from thermal instabilities at the CMB boundary layer.

Plumes — Buoyancy flux $B = \alpha\rho g \Delta T\,Q_v$ and conduit radius $r \propto (B\nu/\kappa)^{1/4}$ characterize hot spots. The buoyancy flux of the Hawaiian plume is $\sim 10^4\;\text{kg/s}$.

Core Cooling and Geodynamo — Core cooling rate $dT/dt = 3q/(R_c\rho_c c_p)$. Magnetic Reynolds number $Rm = vL/\eta_m$ must exceed $\sim 40$ for dynamo action. The dipole moment scales with convective power as $\mathcal{M} \propto (\rho\Omega P_{\text{conv}} / \mu_0\sigma)^{1/2}$.

Energy Budget — Radiogenic heating from $^{238}$U, $^{232}$Th, $^{40}$K with time-dependent exponential decay. Secular cooling flux from core crystallization. Gravitational differentiation power from inner-core growth. Parameterized thermal evolution: $T_{n+1} = T_n + (H_{\text{rad}} - Q_{\text{surf}})\Delta t / (c_p M)$.

Stagnant Lid — Lid thickness $\delta_{\text{lid}} \approx D/\Theta$ where $\Theta = E_a\Delta T/(k_B T_i^2)$ is the Frank-Kamenetskii parameter. Stagnant-lid convection characterizes Venus and Mars; mobile-lid (plate tectonics) requires additional weakening mechanisms. Surface heat flux and core liquidus complete the planetary interior toolkit.


10. Volcanism

Magma transport, eruption dynamics, and volcanic hazard quantification.

Magma Viscosity — Arrhenius relation: $\mu = A\exp(E_a/R^*T)$ with viscosity spanning $10^1\;\text{Pa\cdot s}$ (basalt at $1200\;\text{°C}$) to $10^{12}\;\text{Pa\cdot s}$ (rhyolite at $800\;\text{°C}$). SiO₂ content is the dominant compositional control.

Magma Buoyancy — Net upward force on a chamber: $F = (\rho_{\text{crust}} - \rho_{\text{magma}})\,g\,V$ drives ascent when the magma is lighter than the surrounding rock.

Eruption Triggering — Overpressure threshold: eruption occurs when chamber pressure exceeds $P_{\text{lith}} + \sigma_T$ (lithostatic pressure plus tensile strength). Chamber overpressure $\Delta P = K \Delta V / V$ links magma injection volume to pressure buildup via the bulk modulus.

Conduit Flow — Poiseuille flow for effusion rate: $Q = \pi r^4 \Delta P / (8\mu L)$ — controlled by conduit radius to the fourth power, explaining why small dike widening dramatically increases lava output.

Lava Flow — Gravity-driven viscous flow on a slope: $v = \rho g \sin\alpha\,h^2/(3\mu)$, identical to the Jeffreys equation for thin-film flow. Shield volcanoes produce fast, thin basaltic flows; stratovolcanoes produce slow, thick andesitic flows.

Eruption Column — Plinian column height $H \propto \dot{Q}_T^{0.25}$ from the thermal flux (Morton-Taylor-Turner buoyant plume theory). Tephra fallout distance $x = H\,U_w/v_t$ where $U_w$ is the wind speed and $v_t$ the particle terminal velocity.

**VEI** — Volcanic Explosivity Index from ejecta volume: $\text{VEI} = \log_{10}(V_{\text{km}^3}) + 4$, clamped to $[0, 8]$. Eruptive energy $E = \frac{1}{2}m v^2 + E_{\text{thermal}}$ combines kinetic and thermal contributions.

Eruption Forecasting — Seismic-to-eruption probability via cumulative moment ratio: $P = 1 - \exp(-b\,M_0/M_c)$. Tidal triggering stress $\sigma_t = 2GMR/d^3$ from solid Earth tides. Coulomb failure stress $\text{CFS} = \tau - \mu_f(\sigma_n - P_p) - c$ for fault reactivation near volcanoes.

Magma Ascent — Stokes-like ascent velocity $v = \Delta\rho\,g\,r^2/(8\mu)$ in a cylindrical conduit. Volatile exsolution depth $z = P_{\text{sat}}/(\rho g)$ marks the onset of vesiculation. Fragmentation occurs when porosity exceeds a critical vesicularity. Degassing rate and thermal erosion (lava-substrate interaction) complete the volcanic process chain.


Chapter 3 - Limits, Precision, and Validation

Numerical Limits

  • f64 rounding errors can accumulate in long simulations.
  • Extreme regimes (very large or very small scales) require explicit numerical stability checks.

Recommended Verification

  • Compare against a simple analytical case when available.
  • Check the order of magnitude of results.
  • Run sensitivity analysis on dominant parameters.

Transition to Implementation

For concrete function calls, Rust signatures and module paths are documented in docs/code/.

Hub Module

The Hub is SciForge's central orchestration layer. It connects all scientific modules through a unified API, providing experiment dispatch, simulation execution, campaign management, and tooling infrastructure. It is the entry point for running computations programmatically or via HTTP.


Chapter 1 - Module Scope

Scientific Purpose

This section defines the scope: which problem this module solves, which abstraction level it targets, and which outputs are expected.

Modeling Assumptions

  • The equations are numerical models, not analytical proofs.
  • Inputs must respect the documented units.
  • Validity domains (linear regime, local approximation, and so on) should be verified by the reader.

Reading Strategy

  1. Read the module structure.
  2. Identify equations and their conditions.
  3. Map these equations to Rust functions in docs/code/.

Reading Guide

Goal

This page explains the module from a scientific perspective: assumptions, models, equations, and usage limits.

How To Read This Document

  • Start with the domain section relevant to your case.
  • Identify key equations and their usage conditions.
  • Then verify the corresponding Rust signatures in docs/code/.

Conventions

  • Units: SI unless explicitly stated.
  • Variables: standard mathematical notation for the domain.
  • Equations are presented as reference models, not formal proofs.

Architecture

The Hub follows a layered hexagonal architecture:

Hub
├── API           — External interface (CLI, HTTP, DTOs)
├── Domain        — Shared domain concepts (constants, errors, units)
├── Engine        — Computation core (dispatch, experiments, simulations, workers)
├── Tools         — Infrastructure (benchmarking, config, logging, metrics)
└── Prelude       — Ergonomic re-exports for common usage

The data flow for a computation request:

ComputeRequest → Router → Domain Dispatcher → Scientific Module → ComputeResponse

1. API

External interface layer for interacting with SciForge computations.

HTTP Server

A minimal TCP-based HTTP server built on std::net::TcpListener (no framework dependencies). The server:

  • Binds to a configurable address
  • Parses raw HTTP requests (method, path, body)
  • Delegates to a handler function Fn(&str, &str, &str) -> HttpResponse
  • Returns responses with proper HTTP/1.1 headers (status, content-type, content-length)
pub struct HttpResponse {
    pub status_code: u16,
    pub status_text: String,
    pub content_type: String,  // "application/json" by default
    pub body: String,
}

DTOs (Data Transfer Objects)

**ComputeRequest** — Structured experiment request:

pub struct ComputeRequest {
    pub domain: String,       // "physics", "chemistry", etc.
    pub function: String,     // "projectile_motion", "nernst_potential", etc.
    pub params: HashMap<String, ParamValue>,
}

Parameter types: Scalar(f64), Integer(i64), Text(String), Boolean(bool), Array(Vec<f64>). Builder pattern: ComputeRequest::new("physics", "free_fall").with_scalar("height", 100.0).

**ComputeResponse** — Structured computation result:

pub struct ComputeResponse {
    pub success: bool,
    pub result: Option<ResultData>,
    pub error: Option<String>,
    pub elapsed_ms: f64,
}

Result variants: Scalar, Pair, Triple, Vector, Matrix, TimeSeries { times, values }, Text, Boolean. Factory methods: ok_scalar(), ok_vector(), ok_time_series(), err().

Routes

  • **formatter.rs** — Formats ComputeResponse into different output targets (JSON, plain text, etc.)
  • **params.rs** — Parses and validates incoming request parameters with type coercion

2. Domain

Shared domain concepts used across the Hub.

Units

Strongly typed unit system with enumerations for physical quantities:

QuantityVariants
LengthUnitMeter, Kilometer, Mile, AU, Parsec, LightYear, ...
MassUnitKilogram, Gram, SolarMass, ElectronMass, AMU, ...
TimeUnitSecond, Minute, Hour, Day, Year, ...
TemperatureUnitKelvin, Celsius, Fahrenheit
EnergyUnitJoule, eV, keV, MeV, Calorie, ...
PressureUnitPascal, Atmosphere, Bar, ...
AngleUnitRadian, Degree

Errors

Unified error handling: HubError enum with variants for invalid input, dispatch failures, simulation errors, etc. HubResult<T> = Result<T, HubError>.


3. Engine

The computational core of the Hub.

Dispatch

Routes experiment requests to the correct scientific module. One dispatcher per domain:

DispatcherModuleDescription
astronomy.rsAstronomyStellar, orbital, cosmology functions
biology.rsBiology44 submodules, 176 source files
chemistry.rsChemistry26 submodules
geology.rsGeologyDating, petrology, seismology, tectonics
maths.rsMathematics17 submodules
meteorology.rsMeteorologyAtmosphere, dynamics, precipitation, radiation
physics.rsPhysics11 submodules

The astronomy dispatcher directly exposes the cosmology stack (for example e_z, e_z_lcdm, e_z_wcdm, hubble_at_z, hubble_at_z_lcdm, comoving_distance_from_z, luminosity_distance_from_z, angular_diameter_distance_from_z, and general/wCDM/CPL distance variants), so redshift-expansion and distance workflows are available through the standard Hub API.

**Parameter extraction** (params.rs) provides typed accessors from the parameter list:

  • get_f(params, "name")HubResult<f64> (scalar)
  • get_i(params, "name")HubResult<i64> (integer)
  • get_u(params, "name")HubResult<usize> (unsigned)
  • `get_v(params, "name")` → `HubResult<&[f64]>` (vector)
  • `get_m(params, "name")` → `HubResult<&[Vec<f64>]>` (matrix)
  • get_c(params, "name")HubResult<Complex> (complex number)

Experiment

The Experiment struct is a chainable builder for computation requests:

pub enum DomainType { Math, Physics, Chemistry, Biology, Astronomy, Geology, Meteorology }

pub enum ParameterValue {
    Scalar(f64), Integer(i64), Vector(Vec<f64>), Matrix(Vec<Vec<f64>>),
    Boolean(bool), Text(String), Complex(f64, f64), ComplexVector(Vec<(f64, f64)>),
    Polynomial(Vec<f64>), IntVector(Vec<usize>), IntMatrix(Vec<Vec<usize>>),
    EdgeList(Vec<(usize, usize, f64)>),
    Sparse { rows, cols, row_ptr, col_idx, values },
    Tensor { data: Vec<f64>, shape: Vec<usize> },
}

// Usage:
let exp = Experiment::new(DomainType::Physics, "projectile_range")
    .param("velocity", ParameterValue::Scalar(50.0))
    .param("angle", ParameterValue::Scalar(45.0));

The **Runner** executes experiments and returns typed RunOutput variants.

Simulation

Time-stepping numerical simulation framework.

**DynamicalSystem trait** — interface for any ODE system:

pub trait DynamicalSystem {
    fn dimension(&self) -> usize;
    fn derivatives(&self, t: f64, state: &[f64], out: &mut [f64]);
    fn initial_state(&self) -> Vec<f64>;
    fn time_span(&self) -> (f64, f64);
}

Built-in models:

  • **HarmonicOscillator**: $\ddot{x} = -\omega^2 x$ (2D state: position + velocity)
  • **LotkaVolterra**: predator-prey dynamics
  • **SimpleModel**: generic system from a boxed closure

The **Integrator** advances the state forward using numerical methods (Euler, RK4, adaptive RK45). The **Solver** orchestrates the integration loop and collects SimulationResult time series.

Pipeline

Multi-step computation workflows via the Flow module. Allows chaining computations where the output of one step feeds as input to the next.

Worker

Concurrent execution infrastructure:

  • **Scheduler** — Priority-based task scheduling with dependency resolution. Tasks have Priority levels (Low, Normal, High, Critical) and dependency lists. The scheduler performs topological sorting with priority ordering.
  • **Queue** — Task queue management
  • **Executor** — Dispatches tasks sequentially or in parallel
  • **Context** — Carries execution state, parameters, and result collection

4. Campaign

Multi-experiment batch execution. A campaign collects multiple Experiment instances for sequential dispatch and result aggregation. Enables parameter sweeps (varying one parameter across a range) and combinatorial experiment generation.


5. Tools

Infrastructure utilities.

  • **Config** — Key-value configuration store backed by HashMap<String, String>. Typed accessors: get_f64(), get_usize(), get_bool(). Builder: Config::new().set("key", "value").
  • **Logger** — Structured logging with severity levels (Debug, Info, Warn, Error). Prefixed output with timestamps for experiment tracing.
  • **Metrics** — Runtime metrics collection: execution time, iteration counts, throughput measurements.
  • **Benchmark** — Integration point with the Benchmark module for performance profiling of Hub operations.
  • **Utils** — General-purpose utility functions.

6. Prelude

Convenience re-exports for ergonomic API usage:

pub use crate::hub::domain::common::errors::{HubError, HubResult};
pub use crate::hub::domain::common::units::*;
pub use crate::hub::tools::config::Config;
pub use crate::hub::tools::logger::Level;
pub use crate::hub::engine::experience::experiment::{DomainType, Experiment, ParameterValue};
pub use crate::hub::engine::simulation::model::DynamicalSystem;
pub use crate::hub::engine::simulation::result::SimulationResult;
pub use crate::hub::api::dto::request::ComputeRequest;
pub use crate::hub::api::dto::response::ComputeResponse;

Import with use sciforge::hub::prelude::* for immediate access to all Hub types.


Chapter 3 - Limits, Precision, and Validation

Numerical Limits

  • f64 rounding errors can accumulate in long simulations.
  • Extreme regimes (very large or very small scales) require explicit numerical stability checks.

Recommended Verification

  • Compare against a simple analytical case when available.
  • Check the order of magnitude of results.
  • Run sensitivity analysis on dominant parameters.

Transition to Implementation

For concrete function calls, Rust signatures and module paths are documented in docs/code/.

Mathematics Module

The Mathematics module provides 17 submodules across 63 source files, covering core computational mathematics from linear algebra and calculus through graph theory, signal processing, and non-Euclidean geometry.


Chapter 1 - Module Scope

Scientific Purpose

This section defines the scope: which problem this module solves, which abstraction level it targets, and which outputs are expected.

Modeling Assumptions

  • The equations are numerical models, not analytical proofs.
  • Inputs must respect the documented units.
  • Validity domains (linear regime, local approximation, and so on) should be verified by the reader.

Reading Strategy

  1. Read the module structure.
  2. Identify equations and their conditions.
  3. Map these equations to Rust functions in docs/code/.

Reading Guide

Goal

This page explains the module from a scientific perspective: assumptions, models, equations, and usage limits.

How To Read This Document

  • Start with the domain section relevant to your case.
  • Identify key equations and their usage conditions.
  • Then verify the corresponding Rust signatures in docs/code/.

Conventions

  • Units: SI unless explicitly stated.
  • Variables: standard mathematical notation for the domain.
  • Equations are presented as reference models, not formal proofs.

Chapter 2 - Submodules and Models

1. Complex Numbers

Arithmetic and analysis on the complex plane, including quaternion extensions for 3D rotation.

Arithmetic — Full complex algebra: addition, subtraction, multiplication, division, conjugation, modulus $|z| = \sqrt{a^2+b^2}$, and argument $\arg(z) = \text{atan2}(b,a)$. Polar form interconversion: $z = r e^{i\theta}$.

Complex Functions — Complex exponential $e^z = e^a(\cos b + i\sin b)$, complex logarithm $\ln z = \ln|z| + i\arg(z)$, and complex polynomial evaluation via Horner's scheme in $\mathbb{C}$.

Fractals — Mandelbrot iteration $z_{n+1} = z_n^2 + c$ (escape-time algorithm with bailout $|z|^2 > 4$), Julia set iteration, and Newton fractal step $z \leftarrow z - f(z)/f'(z)$ for polynomial root basins.

Roots of Unity — The $n$ roots $e^{2\pi i k/n}$ for $k = 0, \ldots, n-1$, essential for FFT twiddle factors and cyclic group generators.

Complex Linear Algebra — Complex matrix multiplication and determinant (Laplace expansion), extending the linear algebra toolbox to $\mathbb{C}^{n \times n}$.

Quaternions — Hamilton's four-dimensional extension $q = w + xi + yj + zk$ with quaternion multiplication, conjugation, norm, and SLERP interpolation for smooth 3D rotations without gimbal lock.


2. FFT (Fast Fourier Transform)

Efficient frequency-domain transforms for spectral analysis, filtering, and convolution.

Radix-2 FFT — Cooley-Tukey recursive butterfly algorithm: the $N$-point DFT $X_k = \sum_{n=0}^{N-1} x_n e^{-2\pi i kn/N}$ is computed in $O(N \log N)$ by splitting into even/odd halves with twiddle factor $W_N^k = e^{-2\pi i k/N}$. Input length must be a power of two; the module pads automatically. Inverse FFT scales by $1/N$.

Bluestein (Chirp-Z) — Extends FFT to arbitrary-length sequences by rewriting the DFT as a convolution: $X_k = W_N^{k^2/2}\sum_n x_n W_N^{n^2/2}\cdot W_N^{-(k-n)^2/2}$, then applying radix-2 FFT on zero-padded sequences.

**DCT** — Discrete Cosine Transform (type-II): $X_k = \sum_{n=0}^{N-1} x_n \cos\!\left[\frac{\pi}{N}\left(n + \tfrac{1}{2}\right)k\right]$, used for signal compression (JPEG, MP3). The module also provides the inverse DCT.

Power Spectrum — $|X_k|^2$ from the FFT output gives the power spectral density. Frequency bin spacing: $\Delta f = f_s/N$ where $f_s$ is the sample rate.

FFT-Based Convolution — Circular convolution via the convolution theorem: $h = \text{IFFT}(\text{FFT}(a) \cdot \text{FFT}(b))$, and cross-correlation by conjugation: $R_{ab} = \text{IFFT}(\overline{A} \cdot B)$.


3. Graph Theory

Classical algorithms on weighted and unweighted graph structures.

Shortest Paths — Dijkstra's algorithm (non-negative weights, $O(V^2)$ without priority queue), Bellman-Ford (handles negative weights, detects negative cycles), Floyd-Warshall (all-pairs, $O(V^3)$), A* (heuristic-guided search with admissible heuristic). Path reconstruction is available for all single-source algorithms.

Network Flow — Ford-Fulkerson maximum flow via augmenting paths, and min-cut extraction from the residual graph.

Spanning Trees — Kruskal's and Prim's algorithms for minimum spanning tree (MST) on weighted graphs.

Traversal — BFS (breadth-first) and DFS (depth-first) traversal with connected component identification, topological sort, and cycle detection.


4. Integration

Numerical computation of definite integrals $\int_a^b f(x)\,dx$.

**Newton-Cotes Rules** — Trapezoidal rule $\int \approx \frac{h}{2}[f(a)+f(b)+2\sum f(x_i)]$ with error $O(h^2)$. Simpson's rule $\int \approx \frac{h}{3}[f(a)+4\sum_\text{odd}+2\sum_\text{even}+f(b)]$ with error $O(h^4)$. Simpson's 3/8 rule and Boole's rule for higher-order accuracy. Midpoint rule.

Romberg Integration — Richardson extrapolation on the trapezoidal rule to build a triangular table of superior approximations, achieving high accuracy without changing quadrature type.

Gaussian Quadrature — Exact for polynomials of degree $\le 2n-1$ using optimal node placement and weight coefficients, via Gauss-Legendre rules.

Adaptive Quadrature — Recursive interval bisection with local error estimation (adaptive Simpson), automatically concentrating effort where the integrand varies rapidly.

Multidimensional — Monte Carlo integration $\int_\Omega f \approx V \cdot \frac{1}{N}\sum f(x_i)$ and cubature methods for integrals over arbitrary domains in $\mathbb{R}^d$.


5. Interpolation

Constructing smooth approximations through known data points.

Lagrange Interpolation — Polynomial through $n$ points: $P(x) = \sum_{i=0}^{n-1} y_i \prod_{j\neq i}\frac{x-x_j}{x_i-x_j}$. Barycentric form for efficient repeated evaluation without recomputing products.

Cubic Splines — Natural cubic spline: piecewise $S_i(x) = y_i + b_i(x-x_i) + c_i(x-x_i)^2 + d_i(x-x_i)^3$ with $C^2$ continuity throughout. Coefficients determined by a tridiagonal system solved via Thomas algorithm. Integration and differentiation on the spline are also supported.

Other Methods — Linear interpolation, nearest-neighbor, and Newton's divided difference polynomial.


6. Linear Algebra

Matrix and vector computations forming the backbone of scientific computing.

Decompositions — LU decomposition (with partial pivoting for numerical stability), QR factorization (Gram-Schmidt), and Cholesky decomposition $A = LL^T$ for symmetric positive-definite matrices. Each decomposition is used to solve $Ax = b$ by back-substitution.

Eigenvalues — Power iteration for the dominant eigenvalue and eigenvector: $v^{(k+1)} = Av^{(k)}/\|Av^{(k)}\|$ with convergence rate proportional to $|\lambda_2/\lambda_1|$. Inverse iteration for eigenvalues near a shift $\sigma$. Rayleigh quotient $\rho = v^TAv/(v^Tv)$ for refined eigenvalue estimates. Gershgorin disks for bounding eigenvalue locations. Spectral radius, trace, and condition number $\kappa = |\lambda_{\max}|/|\lambda_{\min}|$.

Least Squares — Ordinary least squares $\hat{x} = (A^TA)^{-1}A^Tb$ via the normal equations or QR factorization. Weighted least squares, pseudoinverse, and SVD-based rank-deficient solutions.


7. Non-Euclidean Geometry

Curved-space geometry for general relativity, cosmology, and differential geometry.

Metric Tensors — Definition of the metric $g_{\mu\nu}$ in arbitrary coordinates (Schwarzschild, FLRW, Kerr). Line element $ds^2 = g_{\mu\nu}dx^\mu dx^\nu$, metric inverse $g^{\mu\nu}$, metric determinant, and coordinate transformations.

Christoffel Symbols — Numerical computation $\Gamma^\sigma_{\mu\nu} = \frac{1}{2}g^{\sigma\rho}(\partial_\mu g_{\nu\rho} + \partial_\nu g_{\rho\mu} - \partial_\rho g_{\mu\nu})$ via finite differences at configurable step size.

Geodesics — Integration of the geodesic equation $\frac{d^2x^\sigma}{d\tau^2} + \Gamma^\sigma_{\mu\nu}\frac{dx^\mu}{d\tau}\frac{dx^\nu}{d\tau} = 0$ using a symplectic (leapfrog) integrator. Full trajectory output for visualization of light bending, orbital precession, etc.

Curvature — Ricci scalar, Gaussian curvature of 2-surfaces, and Riemann tensor components for measuring manifold curvature.

Black Holes — Schwarzschild metric solutions: photon sphere at $r = 3M$, innermost stable circular orbit (ISCO) at $r = 6M$, and gravitational redshift $z = (1-r_s/r)^{-1/2} - 1$.


8. ODE (Ordinary Differential Equations)

Numerical solvers for initial and boundary value problems $y' = f(t, y)$.

Euler Method — First-order explicit: $y_{n+1} = y_n + h\,f(t_n, y_n)$. Simple but with $O(h)$ global error; serves as a baseline.

Runge-Kutta 4 — The classical fourth-order method: $y_{n+1} = y_n + \frac{h}{6}(k_1 + 2k_2 + 2k_3 + k_4)$ with four function evaluations per step and $O(h^4)$ global error.

Adaptive Methods — Runge-Kutta-Fehlberg (RK45) with embedded error estimation for automatic step-size control, maintaining a target local error tolerance.

Systems — All solvers accept vector-valued ODEs $\vec{y}' = \vec{f}(t,\vec{y})$ for coupled systems (e.g., Lotka-Volterra, orbital mechanics, coupled oscillators).

Boundary Value Problems — Shooting method: convert a BVP into an IVP by guessing initial conditions and iterating (bisection or Newton) until boundary conditions are satisfied.


9. Optimization

Algorithms for minimizing (or maximizing) objective functions.

Gradient Descent — $x_{k+1} = x_k - \alpha\nabla f(x_k)$ with fixed or line-search learning rate. Momentum variant $v_{k+1} = \beta v_k - \alpha\nabla f$, $x_{k+1} = x_k + v_{k+1}$ for faster convergence through ravines.

Adam Optimizer — Adaptive moment estimation: bias-corrected first ($\hat{m}$) and second ($\hat{v}$) moment estimates with update $x \leftarrow x - \alpha\hat{m}/(\sqrt{\hat{v}}+\varepsilon)$. Default $\beta_1 = 0.9$, $\beta_2 = 0.999$.

Newton's Method — Second-order: $x_{k+1} = x_k - f(x_k)/f'(x_k)$ for root-finding (1D); quadratic convergence near the root.

Constrained — Penalty methods and Lagrange multiplier approach for constrained optimization.

Evolutionary — Genetic algorithms (selection, crossover, mutation) and differential evolution for global optimization over non-smooth landscapes.

Metaheuristic — Simulated annealing (acceptance probability $e^{-\Delta E/T}$) and particle swarm optimization.


10. PDE (Partial Differential Equations)

Numerical solvers for diffusion, wave propagation, and potential problems on grids.

Heat/Diffusion Equation — $\partial T/\partial t = \alpha\nabla^2 T$ solved by three finite-difference schemes: explicit (forward-time central-space, CFL $r = \alpha\Delta t/\Delta x^2 \le 1/2$), implicit (backward Euler, unconditionally stable via Thomas tridiagonal solve), and Crank-Nicolson (second-order in time, average of explicit and implicit operators). 2D extension available.

**Wave Equation** — $\partial^2 u/\partial t^2 = c^2\nabla^2 u$ solved by central-difference leapfrog in 1D and 2D. D'Alembert analytical solution $u = \frac{1}{2}[f(x-ct)+f(x+ct)]$ for validation. Courant number $C = c\Delta t/\Delta x \le 1$ for stability. Energy density and absorbing boundary conditions.

Laplace/Poisson — $\nabla^2\phi = \rho$ solved by Jacobi and Gauss-Seidel iterative relaxation on a grid, with configurable tolerance and boundary conditions.


11. Polynomial

Polynomial algebra and numerical root-finding.

Polynomial Struct — Evaluation (Horner's method), addition, multiplication, differentiation, and integration of polynomials with real coefficients.

Root-Finding — Newton-Raphson $x_{n+1} = x_n - f(x_n)/f'(x_n)$ (quadratic convergence), bisection (robust, linear convergence), secant method (superlinear, no derivative needed), and Brent's method (combining bisection, secant, and inverse quadratic interpolation for guaranteed convergence).

Special Polynomials — Legendre $P_n(x)$, Chebyshev $T_n(x) = \cos(n\arccos x)$, Hermite $H_n(x)$, and Laguerre $L_n(x)$ — orthogonal polynomial families used in quadrature, approximation theory, and quantum mechanics.


12. Probability

Distributions, stochastic processes, and simulation.

Distributions — PDF, CDF, and quantiles for: Uniform, Normal $f(x) = \frac{1}{\sigma\sqrt{2\pi}}e^{-z^2/2}$, Exponential $f(x) = \lambda e^{-\lambda x}$, Poisson $P(k) = e^{-\lambda}\lambda^k/k!$, Binomial $\binom{n}{k}p^k(1-p)^{n-k}$, Geometric, Gamma, Beta, Cauchy, Chi-squared, Student's $t$, and $F$-distribution.

Markov Chains — Transition matrix representation, $n$-step transition $P^n$, stationary distribution $\pi P = \pi$ (eigenvector method), and absorbing chain analysis.

Monte Carlo — Random sampling, Monte Carlo integration, and variance reduction techniques (importance sampling, stratification).

Sampling — Inverse transform sampling, rejection sampling, and Box-Muller transform for normal variates.


13. Signal Processing

Time-series analysis, filtering, and spectral methods.

Filters — RC low-pass $y_n = \alpha x_n + (1-\alpha)y_{n-1}$ with $\alpha = \Delta t/(RC+\Delta t)$ and RC high-pass $y_n = \alpha(y_{n-1}+x_n-x_{n-1})$. Moving average (simple and exponential EMA). Median filter for impulse noise removal.

**Convolution** — Discrete linear convolution $(f*g)[n] = \sum_k f[k]\,g[n-k]$ both directly and via FFT for $O(N\log N)$ performance. Cross-correlation for lag detection.

Spectral Analysis — Power spectral density estimation, periodogram, Welch's method, and spectral peak detection.

Wavelets — Discrete wavelet transform (Haar, Daubechies), multiresolution analysis, and wavelet decomposition/reconstruction for time-frequency localization.


14. Sparse Matrices

Memory-efficient representation and operations for large matrices with mostly zero entries.

**CSR Format** — Compressed Sparse Row: storage via three arrays (row_ptr, col_idx, values). Construction from triplet lists $(i,j,v)$, identity matrix, random sparse generation. Element access $O(\text{nnz per row})$.

Operations — Sparse matrix-vector product $y = Ax$ in $O(\text{nnz})$, sparse-sparse addition, transposition, and Frobenius norm.

Iterative Solvers — Conjugate gradient method for symmetric positive-definite sparse systems: convergence in at most $n$ iterations for exact arithmetic, with practical convergence rate determined by the condition number. GMRES and Jacobi iteration for non-symmetric systems.


15. Statistics

Descriptive analysis, hypothesis testing, and regression.

Descriptive — Mean, median, mode, variance (sample and population), standard deviation, skewness, kurtosis, percentiles, and interquartile range.

Hypothesis Testing — One-sample and two-sample $t$-tests, paired $t$-test, chi-squared goodness-of-fit and independence tests, $p$-value computation, and confidence interval construction.

Regression — Simple linear regression $y = \beta_0 + \beta_1 x$ via $\beta_1 = \frac{n\sum xy - \sum x\sum y}{n\sum x^2 - (\sum x)^2}$. Multiple linear regression, polynomial regression, coefficient of determination $R^2 = 1 - \text{SS}_\text{res}/\text{SS}_\text{tot}$, standard error of estimate, and residual analysis.


16. Tensor

Multi-dimensional array algebra for physics and machine learning.

**Storage** — Row-major contiguous storage with shape and stride arrays. Construction from nested data, functional initialization (from_fn), zeros, ones, and random tensors. Arbitrary rank support.

Operations — Element-wise arithmetic, scalar operations, broadcasting, reshaping, slicing, and transposition via axis permutation.

Contraction — Generalized tensor contraction $C_{i\ldots k\ldots} = \sum_m A_{i\ldots m\ldots}\,B_{k\ldots m\ldots}$ along specified axes — the foundation for matrix multiplication, inner products, and Einstein summation.

Decomposition — CP (CANDECOMP/PARAFAC) and Tucker decomposition for low-rank tensor approximation.


17. Vector Calculus

Differential operators and integral calculus on vector fields in $\mathbb{R}^3$.

Vec3 Type — Three-dimensional vectors with dot product $\vec{a}\cdot\vec{b} = \sum a_ib_i$, cross product $\vec{a}\times\vec{b}$, magnitude, normalization, and scalar multiplication.

Operations — Linear interpolation (lerp), spherical linear interpolation (slerp) for smooth direction transitions, projection $\text{proj}_{\vec{b}}\vec{a} = \frac{\vec{a}\cdot\vec{b}}{\vec{b}\cdot\vec{b}}\vec{b}$, rejection, reflection $\vec{v} - 2(\vec{v}\cdot\hat{n})\hat{n}$, angle between vectors, scalar triple product $\vec{a}\cdot(\vec{b}\times\vec{c})$ (parallelepiped volume), and vector triple product.

Differential Operators — Numerical gradient $\nabla f$, divergence $\nabla\cdot\vec{F}$, curl $\nabla\times\vec{F}$, and Laplacian $\nabla^2 f$ on 3D vector fields via central differences.

Integration — Line integrals along parameterized curves, surface integrals, and flux computation $\iint \vec{F}\cdot d\vec{A}$.

Simulation — Vector field flow visualization, streamline tracing, and field evolution.


Chapter 3 - Limits, Precision, and Validation

Numerical Limits

  • f64 rounding errors can accumulate in long simulations.
  • Extreme regimes (very large or very small scales) require explicit numerical stability checks.

Recommended Verification

  • Compare against a simple analytical case when available.
  • Check the order of magnitude of results.
  • Run sensitivity analysis on dominant parameters.

Transition to Implementation

For concrete function calls, Rust signatures and module paths are documented in docs/code/.

Meteorology Module

The Meteorology module spans 8 submodules covering atmospheric science: thermodynamics and composition, radiative transfer, atmospheric dynamics, and precipitation hydrology. It provides computational tools for weather analysis, climate modeling, and hydrological engineering.


Chapter 1 - Module Scope

Scientific Purpose

This section defines the scope: which problem this module solves, which abstraction level it targets, and which outputs are expected.

Modeling Assumptions

  • The equations are numerical models, not analytical proofs.
  • Inputs must respect the documented units.
  • Validity domains (linear regime, local approximation, and so on) should be verified by the reader.

Reading Strategy

  1. Read the module structure.
  2. Identify equations and their conditions.
  3. Map these equations to Rust functions in docs/code/.

Reading Guide

Goal

This page explains the module from a scientific perspective: assumptions, models, equations, and usage limits.

How To Read This Document

  • Start with the domain section relevant to your case.
  • Identify key equations and their usage conditions.
  • Then verify the corresponding Rust signatures in docs/code/.

Conventions

  • Units: SI unless explicitly stated.
  • Variables: standard mathematical notation for the domain.
  • Equations are presented as reference models, not formal proofs.

Chapter 2 - Submodules and Models

1. Atmosphere

Vertical structure, thermodynamics, and moisture physics of the troposphere and stratosphere.

Barometric Formula — Pressure decreases exponentially with altitude: $P(h) = P_0\exp\!\left(-\frac{Mgh}{R^*T}\right)$ where $M$ is the mean molar mass of air, $g$ is gravity, and $R^* = 8.314\;\text{J mol}^{-1}\text{K}^{-1}$. The atmospheric scale height $H = R^*T/(Mg) \approx 8.5\;\text{km}$ is the e-folding length for pressure.

Lapse Rates — The dry adiabatic lapse rate $\Gamma_d = g/c_p \approx 9.8\;\text{K/km}$ applies to unsaturated air. The moist (saturated) adiabatic lapse rate is lower because latent heat release partially offsets cooling:

$$\Gamma_m = g\,\frac{1 + L_v r_s/(R_d T)}{1 + L_v^2 r_s/(c_p R_v T^2)}$$

where $L_v$ is the latent heat of vaporization, $r_s$ the saturation mixing ratio, $R_d$ and $R_v$ the gas constants for dry air and water vapor.

Potential Temperature — $\theta = T\left(\frac{P_0}{P}\right)^{R_d/c_p}$ is conserved for adiabatic displacements and serves as the natural vertical coordinate for stability analysis.

Virtual Temperature — $T_v = T(1 + 0.608\,r)$ accounts for the reduced density of moist air, where $r$ is the mixing ratio.

Moisture Variables — Mixing ratio $r = 0.622\,e/(P-e)$, saturation vapor pressure (Magnus formula) $e_s = 6.112\exp(17.67\,T_C/(T_C+243.5))$ hPa, relative humidity $\text{RH} = e/e_s \times 100\%$, and dew point from the inverse Magnus equation.

Density Altitude — Corrects pressure altitude for non-standard temperature: $h_\rho = h_P + 120(T - T_{\text{ISA}})$, critical for aviation performance.

Brunt-Väisälä Frequency — $N = \sqrt{(g/\theta)\,d\theta/dz}$ measures the static stability of the atmosphere. $N^2 > 0$ → stable (oscillatory); $N^2 < 0$ → unstable (convective).


2. Dynamics

Large-scale atmospheric motion governed by the balance between pressure gradient, Coriolis, and inertial forces.

Coriolis Parameter — $f = 2\Omega\sin\phi$ where $\Omega = 7.292 \times 10^{-5}\;\text{rad/s}$ and $\phi$ is the latitude. $f = 0$ at the equator and maximal at the poles.

Geostrophic Wind — In the free atmosphere where friction is negligible, the pressure gradient is balanced by the Coriolis force:

$$u_g = -\frac{1}{\rho f}\frac{\partial P}{\partial y}, \qquad v_g = \frac{1}{\rho f}\frac{\partial P}{\partial x}$$

The wind blows parallel to isobars with low pressure to the left (Northern Hemisphere).

Rossby Number — $Ro = U/(fL)$ compares inertial to Coriolis accelerations. $Ro \ll 1$ → quasi-geostrophic regime (synoptic scale); $Ro \sim 1$ → mesoscale (tornadoes, sea breezes).

Rossby Waves — Planetary-scale waves with phase speed $c = -\beta/k^2$ where $\beta = df/dy$ is the meridional gradient of Coriolis. These waves control teleconnection patterns and jet-stream meanders.

Thermal Wind — Vertical shear of the geostrophic wind due to horizontal temperature gradients: $\frac{\partial \vec{v}_g}{\partial \ln p} = \frac{R_d}{f}\hat{k} \times \nabla_p T$. This links upper-level jet streams to surface temperature contrasts.

Potential Vorticity — Ertel's PV $q = -g\,f\,\partial\theta/\partial p$ is conserved for adiabatic, frictionless flow — a powerful diagnostic for tropopause dynamics and stratospheric intrusions.

Ekman Layer — Friction-influenced boundary layer of depth $D_E = \pi\sqrt{2\nu/|f|}$, within which winds cross isobars toward low pressure (surface convergence in cyclones).

Richardson Number — $Ri = N^2/(du/dz)^2$ balances buoyancy suppression against shear production of turbulence. $Ri < 0.25$ → onset of Kelvin-Helmholtz instability and turbulent mixing.

Rossby Deformation Radius — $L_R = NH/|f|$ is the horizontal scale at which rotation becomes as important as buoyancy, controlling the width of fronts and the size of baroclinic eddies.

Gradient Wind — Curved-flow solution including centrifugal acceleration: $V = -\frac{fR}{2} + \sqrt{\frac{f^2R^2}{4} + \frac{R}{\rho}\frac{\partial P}{\partial r}}$, applicable to tightly curved cyclones and anticyclones.


3. Precipitation

Rainfall characterization, evapotranspiration, and surface hydrology.

Marshall-Palmer Distribution — Radar reflectivity $Z$ to rain rate $R$ conversion: $Z = 200\,R^{1.6}$ (mm⁶/m³) or equivalently $R = (Z/200)^{1/1.6}$ mm/h. An empirical relation foundational to weather radar operations.

Raindrop Terminal Velocity — $v_t = 9.65 - 10.3\,e^{-0.6D}$ m/s where $D$ is the drop diameter in mm, capturing the transition from Stokes drag (small drops) to turbulent drag (large drops).

Thornthwaite PET — Monthly potential evapotranspiration from temperature alone: $\text{PET} = 16\,(N/12)(10T/I)^a$ mm/month, where $I$ is the annual heat index and $a$ a polynomial function of $I$.

Penman Equation — Combines energy balance and aerodynamic mass transfer: $E = \frac{\Delta\,R_n + \gamma\,f(u)\,e_a}{\Delta + \gamma}$ where $\Delta$ is the slope of the saturation vapor pressure curve, $\gamma$ the psychrometric constant, $R_n$ the net radiation, and $f(u)$ a wind function.

Intensity-Duration-Frequency (IDF) — Engineering design curves: $i = \frac{a\ln T_r}{t_d + b}$ where $T_r$ is the return period (years) and $t_d$ the storm duration. Used for storm sewer, culvert, and dam design.

SCS Curve Number — USDA runoff model: $Q = (P - I_a)^2/(P - I_a + S)$ where $S = 25400/CN - 254$ mm is the potential maximum retention and $I_a = 0.2S$ is the initial abstraction. $CN$ ranges from 30 (permeable forest) to 98 (impervious surface).

Rational Method — Peak runoff $Q_p = CiA$ for small catchments ($< 80$ ha), where $C$ is the runoff coefficient, $i$ the rainfall intensity for the time of concentration, and $A$ the drainage area.

Unit Hydrograph — Peak discharge $Q_p = 2.08\,A/t_p$ (SCS triangular approximation) where $A$ is the basin area (km²) and $t_p$ the time to peak (hours).

Antecedent Precipitation Index — $\text{API}_n = k \cdot \text{API}_{n-1} + P_n$ with decay factor $k \approx 0.85$–$0.95$, tracking soil moisture from recent rainfall history.


4. Radiation

Solar and terrestrial radiation budgets governing Earth's energy balance and climate.

Stefan-Boltzmann Law — Total radiative flux from a surface: $F = \sigma T^4$ where $\sigma = 5.67 \times 10^{-8}\;\text{W m}^{-2}\text{K}^{-4}$. For a non-blackbody: $F = \varepsilon\sigma T^4$ (emissivity $0 < \varepsilon \le 1$).

Solar Constant — Total solar irradiance at the top of the atmosphere: $S_0 = 1361\;\text{W/m}^2$ (mean Earth-Sun distance).

Planetary Energy Balance — Absorbed solar radiation balances outgoing longwave: $\frac{S_0(1-\alpha)}{4} = \sigma T_e^4$, giving the effective temperature $T_e = \left(\frac{S_0(1-\alpha)}{4\sigma}\right)^{1/4} \approx 255\;\text{K}$ for Earth ($\alpha \approx 0.3$).

Greenhouse Effect — The difference $\Delta T = T_s - T_e$ between the actual surface temperature ($T_s \approx 288\;\text{K}$) and the effective radiating temperature quantifies the warming by greenhouse gases ($\Delta T \approx 33\;\text{K}$).

Beer-Lambert Atmospheric Extinction — $I = I_0\,e^{-\tau}$ where the optical depth $\tau = \kappa\,\ell$ is the product of absorption/scattering coefficient and path length. Governs visibility, solar dimming, and radiative transfer through clouds.

Planck Function — Spectral radiance of a blackbody:

$$B(\lambda, T) = \frac{C_1}{\lambda^5\left(\exp\!\left(\frac{C_2}{\lambda T}\right) - 1\right)}$$

with $C_1 = 3.742 \times 10^{-16}\;\text{W m}^2$ and $C_2 = 1.4388 \times 10^{-2}\;\text{m K}$. The peak wavelength follows Wien's law $\lambda_{\max} = 2898/T$ µm.

Solar Zenith Angle — $\cos\theta_z = \sin\phi\sin\delta + \cos\phi\cos\delta\cos h$ where $\phi$ is latitude, $\delta$ the solar declination, and $h$ the hour angle. Controls the diurnal and seasonal variation of insolation.

CO₂ Radiative Forcing — The logarithmic dependence $\Delta F = 5.35\ln(C/C_0)\;\text{W/m}^2$ gives the additional downward infrared forcing from a change in atmospheric CO₂ concentration. The climate sensitivity parameter $\lambda = \Delta T/\Delta F$ (K per W/m²) links forcing to equilibrium temperature response.


5. Clouds

Cloud microphysics, radiative properties, and precipitation initiation — the bridge between thermodynamics and rainfall.

Saturation Vapor Pressure — The Magnus formula $e_s = 611.2\exp(17.67\,T_C/(T_C + 243.5))$ Pa gives the saturation vapor pressure over a flat water surface. This is the fundamental threshold: when ambient vapor pressure exceeds $e_s$, condensation begins.

Cloud Base Altitude — The lifting condensation level $z_{\text{LCL}} = (T - T_d)/\Gamma$ where $T - T_d$ is the dew-point depression and $\Gamma$ the lapse rate. A quick estimate: cloud base rises $\sim 125\;\text{m}$ per degree of dew-point deficit.

Liquid Water Content — The adiabatic LWC increases linearly above cloud base: $\text{LWC} \approx \rho_a\,(dq_s/dT)\,\Gamma\,\Delta z / T$, where $dq_s/dT$ is the Clausius-Clapeyron slope. Typical values range from $0.1$ to $0.3\;\text{g/m}^3$ in stratocumulus.

Cloud Optical Depth and Albedo — $\tau = 3\,\text{LWP}/(2\rho_w r_e)$ where LWP is the liquid water path (g/m²) and $r_e$ the effective droplet radius. The two-stream albedo approximation: $\alpha = \tau^*/(\tau^* + 2)$ with $\tau^* = \tau(1-g)$ and asymmetry parameter $g \approx 0.85$. Doubling droplet concentration (keeping LWP constant) increases albedo — the Twomey indirect aerosol effect.

Droplet Growth — Condensation — The diffusional growth rate $dr/dt = S/(r(F_k + F_d))$ where $S$ is the supersaturation and $F_k$, $F_d$ are thermodynamic and diffusion resistance terms. Growth is fast at first but slows as $r$ increases (parabolic growth law $r \propto \sqrt{t}$).

Droplet Growth — Collision-Coalescence — Once drops exceed $\sim 20\;\mu\text{m}$, gravitational collection dominates: $dm/dt = \pi(R_1 + R_2)^2\,E\,\Delta v\,\text{LWC}/4$ where $E$ is the collection efficiency and $\Delta v$ the differential terminal velocity. This warm-rain process produces precipitation in $\sim 20$ minutes.

Autoconversion — The Kessler-type threshold: rain begins when LWC exceeds a critical value ($\sim 0.5\;\text{g/m}^3$). The rate depends on droplet concentration: fewer, larger drops convert faster (clean maritime clouds rain more efficiently than polluted continental clouds).

Ice Microphysics — Ice crystal growth rate depends on temperature-dependent habit factor (plates, dendrites, columns) and supersaturation with respect to ice. The Bergeron process exploits the difference between saturation vapor pressure over water and over ice: in mixed-phase clouds, ice crystals grow at the expense of supercooled droplets.

Radiative Properties — Cloud emissivity $\varepsilon = 1 - e^{-\tau}$ approaches unity for optically thick clouds. The Henyey-Greenstein phase function $p(\cos\theta) = (1-g^2)/(1+g^2-2g\cos\theta)^{3/2}$ describes the angular scattering pattern. Cloud radiative forcing is the net difference between shortwave cooling (albedo) and longwave warming (greenhouse).

CAPE and CIN — Convective Available Potential Energy $\text{CAPE} = \int g\,(T_p - T_e)/T_e\,dz$ measures the energy available for thunderstorm updrafts. Convective Inhibition (CIN) is the negative contribution that must be overcome for convection to initiate.


6. Ocean

Physical oceanography — wave mechanics, circulation, thermohaline dynamics, and ocean-climate coupling.

Wave Regimes — Deep-water phase speed $c = \sqrt{g\lambda/2\pi}$ (gravity waves, depth $>\lambda/2$) and shallow-water phase speed $c = \sqrt{gh}$ (tsunamis, tides). The full dispersion relation $\omega^2 = gk\tanh(kh)$ bridges both regimes.

Wave Spectra — The Phillips equilibrium spectrum $S(k) \propto k^{-4}\exp(-g^2/(k^2 U^4))$ describes the high-frequency tail of a fully developed sea. The JONSWAP spectrum adds a peak enhancement factor $\gamma \approx 3.3$ for fetch-limited growth: $S(\omega) = \alpha g^2/\omega^5 \cdot e^{-1.25(\omega_p/\omega)^4} \cdot \gamma^r$, where the peak frequency $\omega_p$ depends on wind speed and fetch.

Significant Wave Height — $H_s$ scales with wind speed and fetch: $H_s = A\,(U^2/g)\,(gF/U^2)^B$ where $A,B$ are empirical coefficients. The wave period follows a similar fetch-dependent scaling.

**Stokes Drift** — Net mass transport by surface waves: $u_S = a^2\omega k\,\cosh[2k(z+h)]/(2\sinh^2 kh)$ — a second-order effect that drives Langmuir circulation and oil-spill trajectories.

Ekman Dynamics — Ekman transport $M = \tau/(\rho f)$ is the wind-driven mass flux perpendicular to the wind direction. The Ekman spiral describes the velocity profile: flow rotates $45°$ from the wind at the surface and decays exponentially with depth over the Ekman depth $D_E = \pi\sqrt{2K_z/|f|}$. Ekman pumping/suction at the base of the Ekman layer drives large-scale upwelling and downwelling.

Thermohaline Circulation — Seawater density depends on temperature and salinity via the UNESCO/TEOS-10 polynomial equation of state: $\rho(T,S) = \rho_0 + \alpha_T(T) + \beta_S(S) + \gamma_{TS}(T,S)$. The thermal expansion coefficient $\alpha \approx 2 \times 10^{-4}\;\text{K}^{-1}$ and haline contraction coefficient $\beta \approx 7.5 \times 10^{-4}\;\text{psu}^{-1}$ control the density-driven overturning.

Mixed Layer Depth — Determined by wind stirring and buoyancy flux, the mixed layer is the well-homogenized upper ocean. Internal wave speed $c_i = \sqrt{g'h}$ (where $g'$ is the reduced gravity across the pycnocline) governs baroclinic wave propagation.

Geostrophic Currents — $v_g = -(g/f)\,d\eta/dx$ from sea surface height gradients, measurable by satellite altimetry. Upwelling velocity $w = (1/\rho f)\,\partial\tau/\partial y$ links wind patterns to nutrient supply and biological productivity.

Ocean Heat Content — $Q = \rho c_p \int_0^D \Delta T\,dz$ integrates temperature anomalies over the water column — Earth's dominant thermal reservoir absorbing $>90\%$ of anthropogenic heating.

Sea Ice and Sound — Ice growth rate from the Stefan growth law. Sound speed in seawater $c(T,S,D)$ depends on temperature, salinity, and depth via the Medwin empirical formula — critical for sonar and acoustic thermometry. Sea-level rise from thermal expansion: $\Delta h = \alpha\,\Delta T\,D$. Henry's law $K_H(T)$ governs CO₂ solubility.


7. Storms

Tropical cyclones, severe convection, and storm intensity metrics.

Potential Intensity — The theoretical maximum wind speed of a tropical cyclone: $V_{\text{max}} = \sqrt{C_k/C_d \cdot \eta \cdot \Delta k}$, where $C_k/C_d$ is the ratio of enthalpy to drag exchange coefficients, $\eta$ is the thermodynamic efficiency (Carnot engine between SST and outflow temperature), and $\Delta k$ is the air-sea enthalpy disequilibrium. This Emanuel potential intensity framework sets an upper bound on hurricane strength.

Accumulated Cyclone Energy — $\text{ACE} = \sum v_i^2 \times 10^{-4}$ where $v_i$ are 6-hourly maximum sustained winds in knots. ACE integrates intensity over a storm's lifetime and is the standard seasonal activity metric.

CAPE — Convective Available Potential Energy $\text{CAPE} = g\,(T_p - T_e)/T_e \cdot \Delta z$ for a discrete layer; summed vertically, it gives the total energy available to thunderstorm updrafts. CAPE $> 2000\;\text{J/kg}$ indicates severe weather potential.

Rossby Deformation Radius — $L_R = NH/(|f|)$ where $N$ is the Brunt-Väisälä frequency and $H$ the tropopause height. $L_R$ controls the size of mid-latitude cyclones and the width of tropical cyclone eyewalls.

Fujita Scale — Tornado intensity classification from estimated wind speed: F0 ($<33\;\text{m/s}$) to F5 ($>89\;\text{m/s}$). An empirical discrete mapping from continuous wind fields.


8. Winds

Global and mesoscale wind systems — from planetary Hadley cells to local mountain breezes.

Hadley Cell Extent — The poleward limit of the thermally driven tropical cell: $\phi_H \approx \left(\frac{5g\,\Delta T\,R}{3\Omega^2 R^2}\right)^{1/4}$, where $\Delta T$ is the equator-to-pole temperature contrast and $\Omega$ the planetary rotation rate. Fast rotation compresses the Hadley cell toward the equator.

Thermal Wind — Vertical shear of the geostrophic wind: $\partial u/\partial z = -(g/fT)\,\partial T/\partial y$. Horizontal temperature gradients drive upper-level jet streams: the subtropical jet lies above the maximum meridional temperature gradient.

Jet Stream — The estimated jet velocity $U_J \approx gH\Delta T/(fT_m L)$ scales with the scale height $H$, meridional temperature contrast $\Delta T$, and the distance $L$ over which the gradient acts.

Surface Wind — $v = \sqrt{(\partial P/\partial x)/(\rho C_D)}$ where $C_D$ is the drag coefficient. Wind stress $\tau = \rho_a C_D U^2$ drives ocean circulation via Ekman transport.

Planetary Vorticity — $f = 2\Omega\sin\phi$ and its meridional gradient $\beta = 2\Omega\cos\phi/R$ control Rossby wave propagation. The Rossby wave phase speed $c = -\beta/(k^2 + 1/L_R^2)$ is always westward relative to the mean flow.

Baroclinic Instability — The most unstable wavelength $\lambda = 2\pi\sqrt{2}\,L_R$ sets the typical size of mid-latitude weather systems ($\sim 4000\;\text{km}$).

Mesoscale Winds — Sea breeze speed $v \approx \sqrt{g\,\Delta T\,h/T_m}$ where $h$ is the boundary-layer depth. Katabatic (downslope) wind: $v \approx \sqrt{g\,\Delta T\,\sin\alpha\,L/(T_m C_D)}$ driven by radiative cooling over sloped terrain. Mountain wave vertical velocity $w = U H_m N k$ controls aviation turbulence and orographic precipitation.

Boundary Layer — The Monin-Obukhov length $L_{MO} = -u_*^3 T/(\kappa g \overline{w'\theta'})$ characterizes the stability of the surface layer ($L_{MO} > 0$: stable; $L_{MO} < 0$: unstable). The logarithmic wind profile $u(z) = (u_*/\kappa)\ln(z/z_0)$ applies in the neutral surface layer.

Curvature Corrections — Cyclostrophic wind (centrifugal balance without Coriolis, e.g., tornadoes) and gradient wind (full nonlinear balance including both Coriolis and centrifugal forces) extend the geostrophic approximation to curved flow.

Empirical Scales — Beaufort-to-m/s conversion: $v = 0.836\,B^{3/2}$ where $B$ is the Beaufort number. Wind chill temperature for human-felt cold. Föhn warming from dry adiabatic descent. Superrotation index for planetary atmosphere comparison.


Chapter 3 - Limits, Precision, and Validation

Numerical Limits

  • f64 rounding errors can accumulate in long simulations.
  • Extreme regimes (very large or very small scales) require explicit numerical stability checks.

Recommended Verification

  • Compare against a simple analytical case when available.
  • Check the order of magnitude of results.
  • Run sensitivity analysis on dominant parameters.

Transition to Implementation

For concrete function calls, Rust signatures and module paths are documented in docs/code/.

Parser Module

The parser module provides 6 complete format parsers, each built from scratch with zero dependencies. Every parser follows a consistent three-stage architecture: lexer → parser → typed value tree. This module enables SciForge to read and write structured data in all common scientific exchange formats.


Chapter 1 - Module Scope

Scientific Purpose

This section defines the scope: which problem this module solves, which abstraction level it targets, and which outputs are expected.

Modeling Assumptions

  • The equations are numerical models, not analytical proofs.
  • Inputs must respect the documented units.
  • Validity domains (linear regime, local approximation, and so on) should be verified by the reader.

Reading Strategy

  1. Read the module structure.
  2. Identify equations and their conditions.
  3. Map these equations to Rust functions in docs/code/.

Reading Guide

Goal

This page explains the module from a scientific perspective: assumptions, models, equations, and usage limits.

How To Read This Document

  • Start with the domain section relevant to your case.
  • Identify key equations and their usage conditions.
  • Then verify the corresponding Rust signatures in docs/code/.

Conventions

  • Units: SI unless explicitly stated.
  • Variables: standard mathematical notation for the domain.
  • Equations are presented as reference models, not formal proofs.

Architecture

Each format implementation follows an identical layered pattern across 4–5 source files:

LayerFileRole
Lexerlexer.rsByte-level cursor over `&[u8]` input. Advances through raw bytes, tracks position, handles whitespace skipping and token boundary detection.
Parserparser.rsRecursive-descent parser consuming tokens from the lexer to build a typed value tree.
Valuevalue.rsEnum representing parsed data nodes (strings, numbers, booleans, containers). All values borrow from the input (&'a str) — zero-copy where possible.
Errorerror.rsFormat-specific error type with byte position and error kind for precise diagnostics.

Shared design principles:

  • **Zero-allocation parsing** — values borrow slices from the input buffer via lifetime 'a. String values are &'a str referencing the original bytes, avoiding heap copies.
  • **Cursor-based lexing** — every lexer wraps a Cursor<'a> (or LineCursor<'a> for line-oriented formats) with peek(), advance(n), is_eof(), and position() methods.
  • **const fn accessors** — type-checking methods (is_object(), as_str(), as_number()) are const fn for compile-time usability.

1. CSV

Comma-separated values for tabular scientific data.

Value types:

enum CsvValue<'a> {
    Table,      // Root document node
    Record,     // One row
    Field(&'a str),  // One cell (zero-copy reference)
}

The lexer operates on raw bytes with a simple Cursor tracking position. Fields are delimited by commas; records by newlines. Quoted fields (RFC 4180) handle embedded commas, newlines, and escaped double-quotes.

Writer. The CSV writer module generates properly escaped output from structured data — quoting fields that contain delimiters, quotes, or line breaks.


2. JSON

JavaScript Object Notation — full RFC 8259 compliance.

Value types:

enum JsonValue<'a> {
    Null,
    Bool(bool),
    Number(f64),
    String(&'a str),
    Array,       // Container node
    Object,      // Container node
}

The parser handles:

  • **Number parsing** (number.rs): integers, floats, and scientific notation (1.23e-4), parsed via a dedicated module that handles all edge cases.
  • **String parsing** (string.rs): full Unicode escape sequences (\uXXXX, including surrogate pairs for supplementary plane characters), plus standard escapes (\n, \t, \\, \", etc.).
  • Nested structures: recursive descent with arbitrary nesting depth for objects and arrays.

Error reporting includes byte offset for precise Location of syntax errors.


3. YAML

YAML Ain't Markup Language — indentation-based human-readable format.

Value types:

enum YamlValue<'a> {
    Null,
    Bool(bool),
    Number(f64),
    String(&'a str),
    Sequence,    // Array/list container
    Mapping,     // Key-value container
}

The YAML lexer uses a **line-oriented cursor** (LineCursor) that tracks both byte position and indentation level. Each YamlLine carries indent, content, and offset.

**Scalar parsing** (scalar.rs): determines the type of an unquoted scalar:

  • "null", "~"Null
  • "true", "false"Bool
  • Numeric patterns → Number(f64)
  • Everything else → String

The YAML parser is used internally by the constants module to load all 118 periodic table element files at compile time.


4. HTML

HyperText Markup Language parsing for document generation and analysis.

Value types:

enum HtmlValue<'a> {
    Document,       // Root node
    Element,        // HTML tag
    Text(&'a str),  // Text content
    Comment,        // <!-- ... -->
    Doctype,        // <!DOCTYPE ...>
}

**Entity decoding** (entity.rs): handles both named entities (&amp;&, &lt;<, &gt;>, &quot;", etc.) and numeric character references (&#123;, &#x7B;).

The lexer tracks open/close tags, self-closing tags, and attributes. Used by the benchmark export module to generate self-contained HTML dashboards.


5. Markdown

Lightweight markup parsing for documentation and report generation.

Value types:

enum MdValue<'a> {
    Document,        // Root node
    Heading(u8),     // h1–h6, level stored as u8
    Paragraph,
    CodeBlock,       // Fenced (```) or indented
    ThematicBreak,   // --- or ***
    BlockQuote,      // > prefixed blocks
    List,            // Ordered or unordered
    Table,           // GFM-style tables
    Text(&'a str),   // Inline text content
}

**Inline processing** (`inline.rs`): parses bold (`**`), italic (`*`), inline code (`` ` ``), links (`text`), and other inline formatting.

The Markdown lexer uses a LineCursor similar to YAML, processing input line-by-line with indent tracking. Headings are detected by leading # characters (1–6 levels). Fenced code blocks delimit by triple backticks.

Used by the benchmark report module to generate Markdown summaries, and can parse SciForge's own documentation files for programmatic analysis.


6. TOML

**Tom's Obvious, Minimal Language** — configuration format widely used in Rust ecosystems (Cargo.toml, rustfmt.toml, etc.).

Value types:

enum TomlValue<'a> {
    String(&'a str),
    Integer(i64),
    Float(f64),
    Boolean(bool),
    DateTime(&'a str),
    Array,        // Container node
    Table,        // Container node (key-value section)
}

The TOML parser follows the same layered architecture as the other formats: lexer → parser → typed value tree, with a dedicated error module for precise diagnostics.

**Lexer** (lexer.rs): a byte-level Cursor<'a> that tokenizes into Token variants — bare keys, quoted strings (basic and literal), integers, floats, booleans, datetimes, brackets, dots, equals signs, and newlines. Handles multi-line basic strings (""") and literal strings (''').

**Parser** (`parser.rs`): recursive-descent parser that handles standard tables (`[section]`), arrays of tables (`[[array]]), dotted keys (a.b.c = val), and inline tables/arrays. Provides configurable depth and size limits via TomlLimits` to prevent denial-of-service from malicious input. Three entry points:

  • parse_toml(bytes) — full parse to TomlValue tree
  • parse_toml_with_limits(bytes, limits) — parse with custom nesting/size bounds
  • validate_toml(bytes) — syntax check without building the value tree

**Error** (error.rs): TomlError carries a TomlErrorKind enum and byte offset. The line_column() method converts byte position to human-readable (line, column) for diagnostic messages.

**Writer** (`writer.rs`): serialization helpers that emit properly quoted and escaped TOML output — `push_toml_str` for string values, `push_toml_num` for numbers, `push_toml_section` for `[table]` headers, and `push_toml_array_section` for `[[array-of-tables]]` headers.


Chapter 3 - Limits, Precision, and Validation

Numerical Limits

  • f64 rounding errors can accumulate in long simulations.
  • Extreme regimes (very large or very small scales) require explicit numerical stability checks.

Recommended Verification

  • Compare against a simple analytical case when available.
  • Check the order of magnitude of results.
  • Run sensitivity analysis on dominant parameters.

Transition to Implementation

For concrete function calls, Rust signatures and module paths are documented in docs/code/.

Physics Module

The Physics module of SciForge covers a broad spectrum of classical and modern physics, organized into 11 submodules and 45 source files. It provides computational tools for fundamental laws, field equations, wave phenomena, materials science, and quantum mechanics.


Chapter 1 - Module Scope

Scientific Purpose

This section defines the scope: which problem this module solves, which abstraction level it targets, and which outputs are expected.

Modeling Assumptions

  • The equations are numerical models, not analytical proofs.
  • Inputs must respect the documented units.
  • Validity domains (linear regime, local approximation, and so on) should be verified by the reader.

Reading Strategy

  1. Read the module structure.
  2. Identify equations and their conditions.
  3. Map these equations to Rust functions in docs/code/.

Reading Guide

Goal

This page explains the module from a scientific perspective: assumptions, models, equations, and usage limits.

How To Read This Document

  • Start with the domain section relevant to your case.
  • Identify key equations and their usage conditions.
  • Then verify the corresponding Rust signatures in docs/code/.

Conventions

  • Units: SI unless explicitly stated.
  • Variables: standard mathematical notation for the domain.
  • Equations are presented as reference models, not formal proofs.

Chapter 2 - Submodules and Models

1. Acoustics

Acoustics studies the propagation of mechanical waves through material media (gases, liquids, solids). SciForge models this domain along four axes:

Propagation — Sound waves are pressure perturbations that travel at a speed dependent on the medium: $c = \sqrt{\gamma R T / M}$ in an ideal gas, $c = \sqrt{E/\rho}$ in a solid. The module computes acoustic impedance $Z = \rho c$, transmission and reflection coefficients at interfaces (analogous to Fresnel coefficients in optics), attenuation by geometric divergence (inverse-square law for spherical waves), and sound pressure level in dB SPL.

Doppler Effect — When a source and observer are in relative motion, the perceived frequency shifts according to $f' = f_0 \frac{c + v_\text{obs}}{c + v_\text{src}}$. The module implements the classical cases (approaching/receding source), the relativistic Doppler $f' = f_0 \sqrt{(1+\beta)/(1-\beta)}$, radar Doppler (round-trip: factor of 2), and the Mach cone angle $\theta = \arcsin(c/v)$ for supersonic objects.

Absorption — Sound energy is absorbed exponentially: $I(x) = I_0 e^{-\alpha x}$. The module computes atmospheric absorption (dependent on frequency, humidity, and temperature), A-weighting (standardized psychoacoustic filter), NRC (Noise Reduction Coefficient), transmission loss (mass law), dB level addition, and room constant.

Resonance — Acoustic systems resonate at discrete frequencies. The module calculates the fundamental frequency of a vibrating string $f_1 = \frac{1}{2L}\sqrt{T/\mu}$, harmonics of open and closed pipes, the Helmholtz resonator $f = \frac{c}{2\pi}\sqrt{A/(Vl)}$, beats, quality factor, Sabine reverberation time ($T_{60} = 0.161 V/A$), room eigenmodes for a rectangular enclosure, and Schroeder frequency.


2. Electrodynamics

Classical electrodynamics, grounded in Maxwell's equations, describes the interaction between electric and magnetic fields. SciForge structures this domain across three files:

Fields — The electric field of a point charge follows Coulomb's law: $\vec{E} = \frac{kq}{r^2}\hat{r}$, with $k = 1/(4\pi\epsilon_0)$. The module computes electric potential, the magnetic field of an infinite wire (Ampère's theorem: $B = \mu_0 I / 2\pi r$), of a solenoid ($B = \mu_0 n I$), of a current loop, and the Biot-Savart field for an arbitrary segment $d\vec{B} = \frac{\mu_0 I}{4\pi} \frac{d\vec{l} \times \hat{r}}{r^2}$. The Lorentz force $\vec{F} = q(\vec{E} + \vec{v}\times\vec{B})$ unifies electric and magnetic effects. The Poynting vector $\vec{S} = \frac{1}{\mu_0}\vec{E}\times\vec{B}$ gives the electromagnetic energy flux, and the energy density combines contributions: $u = \frac{1}{2}(\epsilon_0 E^2 + B^2/\mu_0)$.

EM Waves — Wave solutions of Maxwell's equations propagate at $c = 1/\sqrt{\mu_0\epsilon_0}$. The module computes the impedance of free space $Z_0 = \sqrt{\mu_0/\epsilon_0} \approx 377\,\Omega$, wave number, wavelength, phase velocity in a medium $v = c/\sqrt{\epsilon_r\mu_r}$, group velocity in a dispersive medium, skin depth (penetration into conductors), Fresnel coefficients $r_s$ and $r_p$, Brewster's angle, critical angle for total internal reflection, Snell's law, radiation pressure (absorbed $P=I/c$ and reflected $P=2I/c$), Larmor power (radiation from an accelerated charge), radiation resistance of a dipole, and a 1D FDTD (Finite-Difference Time-Domain) solver for direct simulation of wave propagation.

Circuits — The series RLC circuit is modeled as a complete structure: resonant frequency $f_0 = 1/(2\pi\sqrt{LC})$, quality factor $Q = (1/R)\sqrt{L/C}$, complex impedance $Z(\omega) = R + j(\omega L - 1/\omega C)$, damping coefficient, bandwidth, and transient response (underdamped, overdamped, critically damped). The module also provides RC and RL time constants and AC regime analysis.


3. Electronics

Applied electronics uses the laws of physics to design practical circuits. SciForge covers four sub-areas:

Circuits — Fundamental laws: Ohm's law ($V = IR$), resistors in series/parallel, voltage and current dividers, DC power, RC and RL charge/discharge (exponentials), RLC circuit (resonance, Q factor, bandwidth), capacitive and inductive impedance, stored energy $E = \frac{1}{2}CV^2$ and $\frac{1}{2}LI^2$, Wheatstone bridge, Thévenin/Norton theorems, and maximum power transfer.

Amplifiers — Inverting amplifier gain ($-R_f/R_{in}$), non-inverting ($1 + R_f/R_{in}$), differential, summing. Op-amp integrator and differentiator. Gain-bandwidth product. Common-emitter gain, transconductance $g_m = I_C/V_T$, thermal voltage $V_T = k_B T/q \approx 26\,\text{mV}$ at 300 K. Conversion to dB (voltage and power), cascade gain, noise figure, and Friis formula for cascaded stages.

Semiconductor Devices — Shockley diode equation $I = I_s(e^{V/nV_T} - 1)$, Zener regulator, bipolar transistor ($I_C = \beta I_B$, $\alpha$ factor), MOSFET in saturation and linear regimes, body effect, solar cell (I-V model), LED (current-limiting resistor calculation), photodiode, tunnel diode, PN junction capacitance, Early effect, and DIBL (Drain-Induced Barrier Lowering).

Digital Logic — Fundamental gates (AND, OR, NOT, NAND, NOR, XOR, XNOR), half/full adder, ripple-carry adder, multiplexer, demultiplexer, decoder/encoder, SR/D/JK flip-flops, and binary↔Gray code conversion.


4. Fluid Mechanics

Fluid mechanics describes the behavior of liquids and gases in motion. SciForge organizes this domain across four files:

Flow — Reynolds number $Re = \rho v D / \mu$ (laminar/turbulent transition), Bernoulli equation $P + \frac{1}{2}\rho v^2 + \rho g h = \text{const}$, Poiseuille flow in a pipe (parabolic profile, flow rate $Q = \pi \Delta P r^4 / 8\mu L$), Mach number, drag coefficient, drag force $F_D = \frac{1}{2}\rho v^2 C_D A$, lift (coefficient $C_L$), Froude number, Weber number, mass flow rate, and terminal velocity.

Boundary Layer — Laminar boundary layer thickness on a flat plate (Blasius solution $\delta \propto \sqrt{x/Re_x}$), local and global friction coefficients, laminar-to-turbulent transition, turbulent boundary layer thickness ($\delta \propto x \cdot Re_x^{-1/5}$), displacement thickness, momentum thickness, Nusselt number ($Nu = 0.332\sqrt{Re}\cdot Pr^{1/3}$ for laminar plate), and Stanton number.

Turbulence — Turbulence modeling via Kolmogorov scales: length scale $\eta = (\nu^3/\epsilon)^{1/4}$, time scale $\tau = (\nu/\epsilon)^{1/2}$, velocity scale $v = (\nu\epsilon)^{1/4}$. Turbulent kinetic energy $k = \frac{1}{2}(u'^2 + v'^2 + w'^2)$. Taylor microscale, integral scale, friction velocity $u_\tau = \sqrt{\tau_w/\rho}$, law of the wall (viscous sublayer, buffer, logarithmic), mixing length, turbulent viscosity, turbulence intensity, and Kolmogorov energy spectrum $E(k) \propto \epsilon^{2/3} k^{-5/3}$.

Fluid Waves — Surface waves: dispersion relation $\omega^2 = gk\tanh(kh)$, phase and group velocity, significant wave height, period, power per unit wave front. Deep-water approximation ($c = \sqrt{g/k}$) and shallow-water approximation ($c = \sqrt{gh}$). Ursell number (nonlinearity), Stokes wave, and solitary wave.


5. Materials Science

This submodule deals with physical properties of condensed matter, at the intersection of physics and engineering.

Crystallography — Bragg's law $n\lambda = 2d\sin\theta$ for X-ray diffraction, interplanar spacings in cubic systems $d = a/\sqrt{h^2+k^2+l^2}$, planar density, packing fractions (BCC: $\pi\sqrt{3}/8 \approx 0.68$, FCC: $\pi\sqrt{2}/6 \approx 0.74$), structure factor (BCC/FCC extinction rules), lattice parameter from density, Debye temperature, Debye specific heat, and vacancy concentration $c_v = e^{-E_v/k_BT}$.

Diffusion — Fick's first law $J = -D \nabla c$ (steady state) and second law $\partial c/\partial t = D \nabla^2 c$ (transient, error-function solution). Arrhenius diffusion coefficient $D = D_0 e^{-Q/RT}$, diffusion length $\sqrt{2Dt}$, interdiffusion coefficient, Kirkendall effect (vacancy flux), grain-boundary diffusion, permeability, carburization depth, and mean free path.

Phases — Gibbs phase rule $F = C - P + 2$ (degrees of freedom), lever rule for phase diagrams, Clausius-Clapeyron slope $dP/dT = \Delta H / (T \Delta V)$, Gibbs free energy of mixing (regular solution), spinodal temperature, nucleation barrier $\Delta G^* = 16\pi\gamma^3/(3\Delta G_v^2)$, critical nucleus radius, nucleation rate, coarsening kinetics (LSW theory), JMAK transformation (Johnson-Mehl-Avrami-Kolmogorov $f = 1 - e^{-kt^n}$), partition coefficient, and Scheil equation for non-equilibrium solidification.

Semiconductors — Fermi energy, Fermi-Dirac distribution, intrinsic carrier concentration $n_i = \sqrt{N_c N_v} e^{-E_g/2k_BT}$, conductivity $\sigma = q(n\mu_e + p\mu_h)$, Hall coefficient, drift velocity, depletion width, built-in potential, diode current, bandgap variation with temperature (Varshni model), and dopant ionization.


6. Nucleosynthesis

Nucleosynthesis deals with the formation of atomic nuclei, primarily inside stars. This submodule is one of the richest in the Physics module.

Nuclides — Liquid-drop model (Bethe-Weizsäcker semi-empirical mass formula): $B = a_V A - a_S A^{2/3} - a_C Z(Z-1)/A^{1/3} - a_A(N-Z)^2/A \pm \delta$, with volume, surface, Coulomb, asymmetry, and pairing terms. Nuclear radius $R = r_0 A^{1/3}$, binding energy per nucleon, atomic mass, and nuclear stability.

Decay — Exponential decay law $N(t) = N_0 \cdot 2^{-t/t_{1/2}}$, decay constant $\lambda = \ln 2 / t_{1/2}$, activity in Bq and Ci, mean lifetime, decay chains (Bateman equations for radioactive series), secular and transient equilibrium, branching ratio, Geiger-Nuttall law for alpha decay, and Q-value calculation.

Nuclear Reactions — Reaction Q-value (mass balance), Coulomb barrier $E_C = 1.44 Z_1 Z_2 / (r_0(A_1^{1/3}+A_2^{1/3}))$ MeV, Gamow peak $E_0 = (E_G k_B^2 T^2/4)^{1/3}$ (most probable energy for thermonuclear reactions), Gamow window, reduced mass, astrophysical S-factor, Sommerfeld parameter, barrier penetration factor, thermonuclear rate (integrating over Maxwell-Boltzmann distribution × cross-section), estimates for pp, triple-alpha, and $^{12}$C($\alpha$,$\gamma$) rates, and reaction mean free path.

Stellar Processes — Complete classification of processes: pp chain (4 H → He, 26.7 MeV, $T > 4 \times 10^6$ K), CNO cycle (same product, catalyzed by C/N/O, $T > 15 \times 10^6$ K), triple-alpha (3 He → C, $T > 10^8$ K), carbon burning, neon burning, oxygen burning, silicon burning, and slow (s) and rapid (r) neutron-capture processes for synthesis of heavy elements beyond iron. Each process includes its threshold temperature and energy released.

**Stellar Physics** — StellarCore structure: luminosity ($L \propto M^{3.5}$), main-sequence lifetime ($\tau \propto M^{-2.5} \times 10^{10}$ years), dominant processes as a function of core temperature, temporal evolution (hydrogen consumption → helium → metals). Chandrasekhar limit (1.4 $M_\odot$), Tolman-Oppenheimer-Volkoff limit (~2.17 $M_\odot$), Eddington luminosity, maximum binding energy at the iron peak.


7. Optics

Optics describes the behavior of light, viewed as an electromagnetic wave in the visible range and beyond.

Refraction — Snell's law $n_1 \sin\theta_1 = n_2 \sin\theta_2$, critical angle $\theta_c = \arcsin(n_2/n_1)$ for total internal reflection, Brewster's angle $\theta_B = \arctan(n_2/n_1)$, Fresnel reflectance coefficients (s and p polarizations), thin-lens equation $1/f = 1/d_o + 1/d_i$, magnification, lensmaker's equation, numerical aperture, optical path length, Cauchy dispersion $n(\lambda) = A + B/\lambda^2$, and Abbe number.

Diffraction — Single-slit intensity (sinc²: $I = (\sin\beta/\beta)^2$), double-slit (interference term $\cos^2$), grating maxima ($d\sin\theta = m\lambda$), resolving power ($R = mN$), Rayleigh criterion $\theta = 1.22\lambda/D$, Airy disk radius, Fraunhofer distance, grating dispersion, Bragg condition, and first zero of a circular aperture.

Interference — Resultant intensity of two beams $I = I_1 + I_2 + 2\sqrt{I_1 I_2}\cos\delta$, thin-film phase shift, constructive condition, fringe spacing $\Delta y = \lambda L / d$, fringe visibility, coherence length and time, Fabry-Pérot transmittance (Airy function), finesse $\mathcal{F} = \pi\sqrt{R}/(1-R)$, free spectral range, Michelson path difference, and Newton's rings.

Polarization — Malus's law $I = I_0\cos^2\theta$, Stokes parameters $(S_0, S_1, S_2, S_3)$, degree of polarization, Jones matrix (rotation), quarter-wave plate, specific rotatory power, ellipticity, circular dichroism, birefringence $\Delta n = n_e - n_o$, and phase retardation $\Gamma = 2\pi\Delta n \cdot d / \lambda$.


8. Quantum Mechanics

The heart of modern physics. SciForge implements the mathematical formalisms using its own Complex type for complex arithmetic.

Wave Functions — Plane wave $\psi = e^{i(kx - \omega t)}$, Gaussian wave packet (localized superposition), normalization $\int|\psi|^2 dx = 1$, probability density, expectation values of position $\langle x \rangle$ and momentum $\langle p \rangle = -i\hbar \int \psi^* \frac{d\psi}{dx} dx$. Time evolution via the split-step (Fourier) method: alternation between real space (potential) and momentum space (kinetic energy).

**Operators** — Commutator $[A,B] = AB - BA$ and anticommutator $\{A,B\}$, expectation value $\langle A \rangle = \langle\psi|A|\psi\rangle$, variance $\sigma_A^2 = \langle A^2\rangle - \langle A\rangle^2$, uncertainty product $\sigma_A \sigma_B \geq \frac{1}{2}|\langle[A,B]\rangle|$ (Heisenberg's uncertainty principle), Hermiticity test, trace, and determinant.

Angular Momentum — Associated Legendre polynomials $P_l^m(\cos\theta)$, spherical harmonics $Y_l^m(\theta,\phi) = N_{lm} P_l^m(\cos\theta) e^{im\phi}$ (eigenfunctions of $L^2$ and $L_z$), Clebsch-Gordan coefficients (coupling of two angular momenta), and the Wigner formalism.

Spin — Pauli matrices $\sigma_x, \sigma_y, \sigma_z$ (2×2), up/down and $\pm x$, $\pm y$ spinors, Dirac gamma matrices (4×4) for relativistic theory, and the 2×2 identity.

Perturbation Theory — Stationary perturbation theory: first-order energy correction $E_n^{(1)} = \langle n|V|n\rangle$, second-order correction $E_n^{(2)} = \sum_{k\neq n} |V_{kn}|^2/(E_n-E_k)$, and first-order state correction. These corrections enable treatment of the Stark effect (electric field) and the Zeeman effect (magnetic field).

**Quantum Systems** — Hydrogen atom: energy levels $E_n = -13.6/n^2$ eV, radial functions $R_{10}$, $R_{20}$, $R_{21}$. Harmonic oscillator: $E_n = \hbar\omega(n+1/2)$, wave functions via Hermite polynomials. Infinite potential well: $E_n = n^2\pi^2\hbar^2/(2mL^2)$. Quantum tunneling $T = [1 + V_0^2\sinh^2(\kappa a)/(4E(V_0-E))]^{-1}$, Bohr radius $a_0 = \hbar^2/(me^2)$, Landau levels (magnetic field), and Zeeman effect.

Quantum Information — Von Neumann entropy $S = -\text{Tr}(\rho\ln\rho)$, purity $\text{Tr}(\rho^2)$, fidelity of pure and mixed states, concurrence of 2 qubits (entanglement measure), Bell states ($|\Phi^\pm\rangle$, $|\Psi^\pm\rangle$), and tensor product for composite systems.


9. Relativity

Einstein's special relativity transforms our understanding of space and time at velocities approaching $c$.

Lorentz Transformations — Lorentz factor $\gamma = 1/\sqrt{1-v^2/c^2}$, 4×4 boost matrix (in all three spatial directions), rapidity parameter $\phi = \text{arctanh}(v/c)$, and space-time interval invariant $s^2 = c^2\Delta t^2 - \Delta x^2 - \Delta y^2 - \Delta z^2$.

Kinematics — Time dilation $\Delta t' = \gamma \Delta t$, length contraction $L' = L/\gamma$, relativistic velocity addition $v = (v_1+v_2)/(1+v_1 v_2/c^2)$, proper time along a trajectory, and relativistic aberration $\cos\theta' = (\cos\theta - \beta)/(1-\beta\cos\theta)$.

Dynamics — Relativistic momentum $p = \gamma m v$, total energy $E = \gamma mc^2$, kinetic energy $K = (\gamma-1)mc^2$, energy-momentum relation $E^2 = (pc)^2 + (mc^2)^2$, four-momentum, invariant mass of two bodies, Mandelstam variables, Compton shift $\Delta\lambda = (h/m_e c)(1-\cos\theta)$, particle-production threshold energy, synchrotron radiation, and classical Bremsstrahlung.


10. Solid Mechanics

Solid mechanics studies the deformation and failure of materials under stress.

Elasticity — Hooke's law $\sigma = E\varepsilon$, Poisson's ratio $\nu$, shear modulus $G = E/(2(1+\nu))$, bulk modulus $K = E/(3(1-2\nu))$, first Lamé parameter, plane stress/strain, strain energy density $u = \frac{1}{2}\sigma\varepsilon$, thermal strain $\varepsilon = \alpha\Delta T$, volumetric strain, and hydrostatic stress.

Stress Analysis — 2D principal stresses (eigenvalues of the stress tensor), maximum shear stress, Mohr's circle (radius and center), stress tensor rotation, deviatoric tensor, second invariant $J_2$, beam bending $\sigma = My/I$, cantilever deflection $\delta = PL^3/3EI$, torsional shear $\tau = Tr/J$, Euler buckling $P_{cr} = \pi^2 EI/L^2$, and Hertzian contact pressure.

Plasticity — Offset yield strength, Ramberg-Osgood model (nonlinear stress-strain curve), true vs. engineering stress/strain, power-law hardening $\sigma = K\varepsilon_p^n$, Von Mises and Tresca yield criteria, isotropic hardening, Bauschinger effect, plastic work, necking criterion ($n$), and strain-rate sensitivity.

Fracture — Stress intensity factor $K_I = Y\sigma\sqrt{\pi a}$, Griffith critical stress $\sigma_c = \sqrt{2E\gamma/\pi a}$, energy release rate $G = K^2/E$, J-integral, crack-tip plastic zone (Irwin estimate), Paris law for fatigue crack growth $da/dN = C(\Delta K)^m$, fatigue life (Basquin for stress, Coffin-Manson for strain), Miner's cumulative damage rule, plane-strain fracture toughness, stress-corrosion cracking, and CTOD (Crack Tip Opening Displacement).


11. Thermodynamics

Thermodynamics studies energy transformations and the macroscopic properties of matter, complemented by statistical mechanics at the microscopic level.

Equations of State — Ideal gas law $PV = nRT$, Van der Waals $(P + a/V_m^2)(V_m - b) = RT$ (corrections for molecular interactions and volume), Redlich-Kwong, virial equation (density series), compressibility factor $Z = PV/(nRT)$. Internal energy $U = nC_vT$, enthalpy $H = nC_pT$, entropy $\Delta S = nC_v\ln(T_2/T_1) + nR\ln(V_2/V_1)$, Gibbs free energy $G = H - TS$ and Helmholtz free energy $F = U - TS$, chemical potential, Clausius-Clapeyron equation (vapor pressure), heat capacity ratio $\gamma = C_p/C_v$, speed of sound $c = \sqrt{\gamma RT/M}$, Maxwell speed distribution (three characteristic speeds: most probable, mean, and root-mean-square).

Processes — Carnot efficiency $\eta = 1 - T_c/T_h$, heating and cooling COP, isothermal/adiabatic/isobaric work, adiabatic relations ($TV^{\gamma-1} = \text{const}$, $PV^\gamma = \text{const}$), Otto efficiency, Diesel efficiency, Joule-Thomson coefficient, thermal conduction (Fourier's law $q = -kA\,dT/dx$), 1D thermal diffusion (explicit FTCS scheme), entropy of mixing, reaction free energy $\Delta G = \Delta G^0 + RT\ln Q$, equilibrium constant, and Van't Hoff equation.

Statistical Mechanics — Boltzmann distribution $P \propto e^{-E/k_BT}$, partition function $Z = \sum_i e^{-E_i/k_BT}$, harmonic oscillator partition function, canonical average energy and entropy. Quantum distributions: Fermi-Dirac $f = 1/(e^{(E-\mu)/k_BT}+1)$ (fermions) and Bose-Einstein $f = 1/(e^{(E-\mu)/k_BT}-1)$ (bosons). Blackbody radiation: Planck's law (in frequency and wavelength), Wien's displacement law $\lambda_{\max} T = 2898\,\mu\text{m·K}$, Stefan-Boltzmann law $P = \sigma A T^4$. Specific heat of solids: Debye model (numerical integration) and Einstein model. Sackur-Tetrode entropy for the ideal monoatomic gas.


Chapter 3 - Limits, Precision, and Validation

Numerical Limits

  • f64 rounding errors can accumulate in long simulations.
  • Extreme regimes (very large or very small scales) require explicit numerical stability checks.

Recommended Verification

  • Compare against a simple analytical case when available.
  • Check the order of magnitude of results.
  • Run sensitivity analysis on dominant parameters.

Transition to Implementation

For concrete function calls, Rust signatures and module paths are documented in docs/code/.

SciForge — Documentation

SciForge is a scientific computing library written in pure Rust, with no external dependencies. It covers a wide range of domains — from classical physics to molecular biology — organized into independent modules, each exposing both a domain specification and a Rust implementation.


Chapter 1 - Documentation Scope

Purpose

This page explains how the documentation is organized, what each section is meant to provide, and how to move between scientific explanations and Rust APIs.

Reading Strategy

  1. Start with the module page in docs/modules/ to understand the scientific scope and models.
  2. Continue with the matching page in docs/code/ to inspect the implementation layout and public-facing API.
  3. Use the repository structure overview at the end of this page to locate the relevant files quickly.

Reading Guide

Goal

This page acts as the entry point for the documentation set and maps each scientific area to its conceptual guide and code guide.

How To Read This Document

  • Use the module summaries below to identify the relevant scientific area.
  • Open the paired modules/ and code/ pages depending on whether you need theory or implementation details.
  • Use the repository tree at the end as a navigation shortcut.

Conventions

  • modules/ pages focus on scientific models, assumptions, and equations.
  • code/ pages focus on source layout, exported APIs, and execution flow.
  • Paths are written relative to the repository root.

Each module has two complementary pages:

  • Modules/ — describes the scientific concepts, formulas, and phenomena the module covers. Start here to understand *what* a module models.
  • Code/ — describes the Rust API: structs, functions, inputs/outputs. Go here when you want to *use* a module.

Chapter 2 - Modules at a Glance

Astronomy

Celestial mechanics, astrophysics, and cosmology (4 submodules). Covers orbital dynamics (Kepler's laws, vis-viva, Hohmann transfers, orbital perturbations), stellar physics (HR diagram, luminosity-mass-radius relations, main-sequence lifetime, stellar nucleosynthesis), cosmology (direct E(z) parameterizations, H(z) evaluation, comoving/luminosity/angular-diameter distances in LCDM/general/wCDM/CPL, dark-energy equation-of-state models, analytical LCDM shortcuts), and celestial mechanics (ecliptic/equatorial/galactic coordinate transforms, Julian date, sidereal time, nutation).

Module spec · Rust API


Benchmark

Performance measurement infrastructure for SciForge (6 submodules). Covers a 30+ field BenchmarkMetrics engine with statistical aggregation and CSV export, a compact binary encoding format (magic header, LE layout, 168+ byte records), zero-copy decoding via BenchmarkMetricsView, a simulation framework with SimState/SimConfig/StepFn traits, multi-format report generation (CSV, Markdown, HTML, JSON, YAML, TOML), and a file-based export orchestrator with periodic-table-themed CSS.

Module spec · Rust API


Biology

The largest scientific module (44 submodules, 176 source files). Covers aging (Gompertz/Weibull mortality, telomere dynamics), bioelectricity (Nernst, Goldman–Hodgkin–Katz, Hodgkin–Huxley), bioenergetics (ATP yield, Kleiber's law), biomechanics (Poiseuille flow, Hill muscle model), biophysics (Helfrich membrane, WLC, FRET), biostatistics (Kaplan–Meier, meta-analysis), ecology (Lotka–Volterra, Rosenzweig–MacArthur), enzyme kinetics (Michaelis–Menten, Hill, inhibition), evolution (molecular clock, dN/dS, coalescent), genetics (Hardy–Weinberg, $F_{ST}$), immunology (affinity maturation), neuroscience (integrate-and-fire), pharmacology (PK/PD, hepatic clearance), population dynamics (Leslie matrix, SIR/SEIR), synthetic biology (toggle switch, repressilator, FBA), virology (quasispecies, error catastrophe), and 28 more submodules.

Module spec · Rust API


Chemistry

Physical, analytical, inorganic, and computational chemistry (26 submodules). Covers acid–base equilibria (Henderson–Hasselbalch, polyprotic titrations), kinetics (Arrhenius, Eyring, Lindemann), electrochemistry (Nernst, Butler–Volmer, Tafel), thermochemistry (Hess's law, Kirchhoff), gas laws (van der Waals, virial, compressibility), quantum chemistry (Hartree–Fock, DFT concepts, Slater determinants), crystallography (Bragg's law, Miller indices, 14 Bravais lattices), molecular modeling (Lennard-Jones, Morse potential, VSEPR), colloids (DLVO theory, Stokes–Einstein), green chemistry (atom economy, E-factor), and environmental chemistry (Henry's law, BOD/COD).

Module spec · Rust API


Constants

Curated registry of physical constants, astronomical data, atomic properties, and unit conversions (5 submodules). Includes 16 CODATA fundamental constants ($c$, $G$, $h$, $\hbar$, $k_B$, $N_A$, $e$, $\varepsilon_0$, $\mu_0$, $\sigma_{SB}$, $\alpha$, Planck units), 10 astronomical constants (AU, parsec, solar/Earth parameters, Hubble constant), 13 atomic constants (particle masses, Bohr radius, Rydberg energy, magnetons), the full periodic table (118 elements loaded from YAML with OnceLock), and 12 unit conversion factors (eV↔J, cal↔J, atm↔Pa, deg↔rad, barn, ångström, fermi).

Module spec · Rust API


Geology

Earth sciences and geophysics (4 submodules). Covers radiometric dating (decay law $N(t) = N_0 e^{-\lambda t}$, half-life conversion, isochron method, $^{14}$C calibration), petrology (CIPW norm, magma viscosity, Stokes settling, crystallization sequences), seismology (P/S/surface wave propagation, Gutenberg–Richter, Omori aftershock law, magnitude scales $M_L$/$M_W$/$m_b$, focal mechanisms), and tectonics (plate velocity on a sphere, Euler poles, Byerlee's friction law, thermal subsidence).

Module spec · Rust API


Hub

Central orchestration layer (5 areas: API, Domain, Engine, Tools, Prelude — 35 source files). Provides a zero-dependency HTTP server (TcpListener-based), structured DTOs (ComputeRequest/ComputeResponse with 8 result types), domain dispatchers for all 7 scientific modules, direct astronomy-cosmology routing (E(z), H(z), and distance functions) through the Hub, an Experiment builder with 15 ParameterValue variants (Scalar through Tensor), a DynamicalSystem trait for ODE simulations (with built-in HarmonicOscillator/LotkaVolterra), priority-based task scheduling with dependency-aware topological sort, campaign batch execution, and tooling (Config, Logger, Metrics).

Module spec · Rust API


Mathematics

Numerical methods and pure mathematics (17 submodules). Covers complex arithmetic, linear algebra (Gauss elimination, LU/Cholesky decomposition, eigenvalues), calculus (symbolic differentiation, Simpson/Gauss quadrature, automatic differentiation), ODE solvers (Euler, RK4, adaptive RK45), Fourier and Laplace transforms, statistics (descriptive, distributions, hypothesis testing), probability, number theory (primes, GCD, modular arithmetic), combinatorics, set theory, graph theory (BFS, DFS, Dijkstra, Kruskal), geometry (2D/3D transforms, convex hull), trigonometry, polynomial operations, vector calculus (gradient, divergence, curl, Stokes' theorem), and special functions (Gamma, Beta, Bessel, error function).

Module spec · Rust API


Meteorology

Atmospheric science and weather physics (4 submodules). Covers atmosphere (barometric formula, ISA standard layers, pressure altitude, scale height, lapse rates), dynamics (geostrophic/gradient wind, Rossby number, vorticity, thermal wind, Ekman spiral, CAPE/CIN, Richardson number), precipitation (Clausius–Clapeyron, Köhler theory, Marshall–Palmer DSD, $Z$–$R$ relations, terminal velocity, Bergeron process), and radiation (Planck blackbody, Wien's law, Stefan–Boltzmann, solar zenith angle, Beer–Lambert atmospheric extinction, albedo, greenhouse radiative forcing $\Delta F = 5.35 \ln(C/C_0)$).

Module spec · Rust API


Parser

Multi-format data parsing library with zero dependencies (5 formats, 26 source files). Covers CSV (RFC 4180, CsvValue enum with Table/Record/Field, quoted field handling, writer), JSON (RFC 8259, JsonValue with 6 variants, number/string submodules), YAML (YamlValue with indent-based LineCursor, scalar type auto-detection for booleans/numbers/null — used by the Constants module for periodic table data), HTML (HtmlValue with Document/Element/Text/Comment, named entity decoding — used by Benchmark export), and Markdown (MdValue with 9 block-level variants, inline emphasis/links/code processing). All formats share a layered Cursor<'a> architecture with zero-copy &'a str borrowing and const fn constructors.

Module spec · Rust API


Physics

Classical and modern physics (11 submodules). Covers acoustics (wave equation, Doppler, decibel scale, resonance), electrodynamics (Maxwell's equations, Lorentz force, electromagnetic waves, Poynting vector), electronics (Ohm's law, RC/RL/RLC circuits, transistor models, op-amp configurations), fluid mechanics (Navier–Stokes, Bernoulli, Reynolds number, drag), materials science (stress–strain, Young's modulus, Hooke's law, creep), nucleosynthesis (binding energy, decay chains, cross-sections, pp-chain, CNO cycle), optics (Snell's law, thin lens, diffraction, interference, polarization), quantum mechanics (Schrödinger equation, particle-in-a-box, harmonic oscillator, hydrogen atom, tunneling), relativity (Lorentz transforms, $E = mc^2$, time dilation, gravitational redshift, Schwarzschild metric), solid mechanics (beam bending, torsion, Mohr's circle, buckling), and thermodynamics (laws of thermodynamics, Carnot cycle, entropy, heat transfer, blackbody radiation).

Module spec · Rust API


Chapter 3 - Repository Structure

docs/
├── Summary.md          # This file
├── modules/            # Scientific domain documentation (concepts & formulas)
│   ├── Astronomy.md
│   ├── Benchmark.md
│   ├── Biology.md
│   ├── Chemistry.md
│   ├── Constants.md
│   ├── Geology.md
│   ├── Hub.md
│   ├── Mathematics.md
│   ├── Meteorology.md
│   ├── Parser.md
│   └── Physics.md
└── code/               # Rust implementation documentation (API reference)
    ├── Astronomy.md
    ├── Benchmark.md
    ├── Biology.md
    ├── Chemistry.md
    ├── Constants.md
    ├── Geology.md
    ├── Hub.md
    ├── Mathematics.md
    ├── Meteorology.md
    ├── Parser.md
    └── Physics.md

SciForge — Documentation

SciForge is a scientific computing library written in pure Rust, with no external dependencies. It covers a wide range of domains — from classical physics to molecular biology — organized into independent modules, each exposing both a domain specification and a Rust implementation.


Chapter 1 - Documentation Scope

Purpose

This page explains how the documentation is organized, what each section is meant to provide, and how to move between scientific explanations and Rust APIs.

Reading Strategy

  1. Start with the module page in docs/modules/ to understand the scientific scope and models.
  2. Continue with the matching page in docs/code/ to inspect the implementation layout and public-facing API.
  3. Use the repository structure overview at the end of this page to locate the relevant files quickly.

Reading Guide

Goal

This page acts as the entry point for the documentation set and maps each scientific area to its conceptual guide and code guide.

How To Read This Document

  • Use the module summaries below to identify the relevant scientific area.
  • Open the paired modules/ and code/ pages depending on whether you need theory or implementation details.
  • Use the repository tree at the end as a navigation shortcut.

Conventions

  • modules/ pages focus on scientific models, assumptions, and equations.
  • code/ pages focus on source layout, exported APIs, and execution flow.
  • Paths are written relative to the repository root.

Each module has two complementary pages:

  • Modules/ — describes the scientific concepts, formulas, and phenomena the module covers. Start here to understand *what* a module models.
  • Code/ — describes the Rust API: structs, functions, inputs/outputs. Go here when you want to *use* a module.

Chapter 2 - Modules at a Glance

Astronomy

Celestial mechanics, astrophysics, and cosmology (4 submodules). Covers orbital dynamics (Kepler's laws, vis-viva, Hohmann transfers, orbital perturbations), stellar physics (HR diagram, luminosity-mass-radius relations, main-sequence lifetime, stellar nucleosynthesis), cosmology (direct E(z) parameterizations, H(z) evaluation, comoving/luminosity/angular-diameter distances in LCDM/general/wCDM/CPL, dark-energy equation-of-state models, analytical LCDM shortcuts), and celestial mechanics (ecliptic/equatorial/galactic coordinate transforms, Julian date, sidereal time, nutation).

Module spec · Rust API


Benchmark

Performance measurement infrastructure for SciForge (6 submodules). Covers a 30+ field BenchmarkMetrics engine with statistical aggregation and CSV export, a compact binary encoding format (magic header, LE layout, 168+ byte records), zero-copy decoding via BenchmarkMetricsView, a simulation framework with SimState/SimConfig/StepFn traits, multi-format report generation (CSV, Markdown, HTML, JSON, YAML, TOML), and a file-based export orchestrator with periodic-table-themed CSS.

Module spec · Rust API


Biology

The largest scientific module (44 submodules, 176 source files). Covers aging (Gompertz/Weibull mortality, telomere dynamics), bioelectricity (Nernst, Goldman–Hodgkin–Katz, Hodgkin–Huxley), bioenergetics (ATP yield, Kleiber's law), biomechanics (Poiseuille flow, Hill muscle model), biophysics (Helfrich membrane, WLC, FRET), biostatistics (Kaplan–Meier, meta-analysis), ecology (Lotka–Volterra, Rosenzweig–MacArthur), enzyme kinetics (Michaelis–Menten, Hill, inhibition), evolution (molecular clock, dN/dS, coalescent), genetics (Hardy–Weinberg, $F_{ST}$), immunology (affinity maturation), neuroscience (integrate-and-fire), pharmacology (PK/PD, hepatic clearance), population dynamics (Leslie matrix, SIR/SEIR), synthetic biology (toggle switch, repressilator, FBA), virology (quasispecies, error catastrophe), and 28 more submodules.

Module spec · Rust API


Chemistry

Physical, analytical, inorganic, and computational chemistry (26 submodules). Covers acid–base equilibria (Henderson–Hasselbalch, polyprotic titrations), kinetics (Arrhenius, Eyring, Lindemann), electrochemistry (Nernst, Butler–Volmer, Tafel), thermochemistry (Hess's law, Kirchhoff), gas laws (van der Waals, virial, compressibility), quantum chemistry (Hartree–Fock, DFT concepts, Slater determinants), crystallography (Bragg's law, Miller indices, 14 Bravais lattices), molecular modeling (Lennard-Jones, Morse potential, VSEPR), colloids (DLVO theory, Stokes–Einstein), green chemistry (atom economy, E-factor), and environmental chemistry (Henry's law, BOD/COD).

Module spec · Rust API


Constants

Curated registry of physical constants, astronomical data, atomic properties, and unit conversions (5 submodules). Includes 16 CODATA fundamental constants ($c$, $G$, $h$, $\hbar$, $k_B$, $N_A$, $e$, $\varepsilon_0$, $\mu_0$, $\sigma_{SB}$, $\alpha$, Planck units), 10 astronomical constants (AU, parsec, solar/Earth parameters, Hubble constant), 13 atomic constants (particle masses, Bohr radius, Rydberg energy, magnetons), the full periodic table (118 elements loaded from YAML with OnceLock), and 12 unit conversion factors (eV↔J, cal↔J, atm↔Pa, deg↔rad, barn, ångström, fermi).

Module spec · Rust API


Geology

Earth sciences and geophysics (4 submodules). Covers radiometric dating (decay law $N(t) = N_0 e^{-\lambda t}$, half-life conversion, isochron method, $^{14}$C calibration), petrology (CIPW norm, magma viscosity, Stokes settling, crystallization sequences), seismology (P/S/surface wave propagation, Gutenberg–Richter, Omori aftershock law, magnitude scales $M_L$/$M_W$/$m_b$, focal mechanisms), and tectonics (plate velocity on a sphere, Euler poles, Byerlee's friction law, thermal subsidence).

Module spec · Rust API


Hub

Central orchestration layer (5 areas: API, Domain, Engine, Tools, Prelude — 35 source files). Provides a zero-dependency HTTP server (TcpListener-based), structured DTOs (ComputeRequest/ComputeResponse with 8 result types), domain dispatchers for all 7 scientific modules, direct astronomy-cosmology routing (E(z), H(z), and distance functions) through the Hub, an Experiment builder with 15 ParameterValue variants (Scalar through Tensor), a DynamicalSystem trait for ODE simulations (with built-in HarmonicOscillator/LotkaVolterra), priority-based task scheduling with dependency-aware topological sort, campaign batch execution, and tooling (Config, Logger, Metrics).

Module spec · Rust API


Mathematics

Numerical methods and pure mathematics (17 submodules). Covers complex arithmetic, linear algebra (Gauss elimination, LU/Cholesky decomposition, eigenvalues), calculus (symbolic differentiation, Simpson/Gauss quadrature, automatic differentiation), ODE solvers (Euler, RK4, adaptive RK45), Fourier and Laplace transforms, statistics (descriptive, distributions, hypothesis testing), probability, number theory (primes, GCD, modular arithmetic), combinatorics, set theory, graph theory (BFS, DFS, Dijkstra, Kruskal), geometry (2D/3D transforms, convex hull), trigonometry, polynomial operations, vector calculus (gradient, divergence, curl, Stokes' theorem), and special functions (Gamma, Beta, Bessel, error function).

Module spec · Rust API


Meteorology

Atmospheric science and weather physics (4 submodules). Covers atmosphere (barometric formula, ISA standard layers, pressure altitude, scale height, lapse rates), dynamics (geostrophic/gradient wind, Rossby number, vorticity, thermal wind, Ekman spiral, CAPE/CIN, Richardson number), precipitation (Clausius–Clapeyron, Köhler theory, Marshall–Palmer DSD, $Z$–$R$ relations, terminal velocity, Bergeron process), and radiation (Planck blackbody, Wien's law, Stefan–Boltzmann, solar zenith angle, Beer–Lambert atmospheric extinction, albedo, greenhouse radiative forcing $\Delta F = 5.35 \ln(C/C_0)$).

Module spec · Rust API


Parser

Multi-format data parsing library with zero dependencies (5 formats, 26 source files). Covers CSV (RFC 4180, CsvValue enum with Table/Record/Field, quoted field handling, writer), JSON (RFC 8259, JsonValue with 6 variants, number/string submodules), YAML (YamlValue with indent-based LineCursor, scalar type auto-detection for booleans/numbers/null — used by the Constants module for periodic table data), HTML (HtmlValue with Document/Element/Text/Comment, named entity decoding — used by Benchmark export), and Markdown (MdValue with 9 block-level variants, inline emphasis/links/code processing). All formats share a layered Cursor<'a> architecture with zero-copy &'a str borrowing and const fn constructors.

Module spec · Rust API


Physics

Classical and modern physics (11 submodules). Covers acoustics (wave equation, Doppler, decibel scale, resonance), electrodynamics (Maxwell's equations, Lorentz force, electromagnetic waves, Poynting vector), electronics (Ohm's law, RC/RL/RLC circuits, transistor models, op-amp configurations), fluid mechanics (Navier–Stokes, Bernoulli, Reynolds number, drag), materials science (stress–strain, Young's modulus, Hooke's law, creep), nucleosynthesis (binding energy, decay chains, cross-sections, pp-chain, CNO cycle), optics (Snell's law, thin lens, diffraction, interference, polarization), quantum mechanics (Schrödinger equation, particle-in-a-box, harmonic oscillator, hydrogen atom, tunneling), relativity (Lorentz transforms, $E = mc^2$, time dilation, gravitational redshift, Schwarzschild metric), solid mechanics (beam bending, torsion, Mohr's circle, buckling), and thermodynamics (laws of thermodynamics, Carnot cycle, entropy, heat transfer, blackbody radiation).

Module spec · Rust API


Chapter 3 - Repository Structure

docs/
├── Summary.md          # This file
├── modules/            # Scientific domain documentation (concepts & formulas)
│   ├── Astronomy.md
│   ├── Benchmark.md
│   ├── Biology.md
│   ├── Chemistry.md
│   ├── Constants.md
│   ├── Geology.md
│   ├── Hub.md
│   ├── Mathematics.md
│   ├── Meteorology.md
│   ├── Parser.md
│   └── Physics.md
└── code/               # Rust implementation documentation (API reference)
    ├── Astronomy.md
    ├── Benchmark.md
    ├── Biology.md
    ├── Chemistry.md
    ├── Constants.md
    ├── Geology.md
    ├── Hub.md
    ├── Mathematics.md
    ├── Meteorology.md
    ├── Parser.md
    └── Physics.md

Astronomy Source Code Guide

This page documents the source implementation behind sciforge::astronomy, including file layout and Hub dispatch wiring.

Source Coverage

What is explained

  • File-level implementation layout in src/astronomy/.
  • Main computation groups and where they are implemented.
  • Runtime call path when astronomy functions are executed through Hub dispatch.

Visibility and external access

  • This domain module is pub(crate) in src/lib.rs and is not part of the external crate API.
  • External consumers should use the public sciforge::hub API for these computations.
  • Direct module paths shown here are for internal development and source-level understanding.

Source Code Explanation

Relevant file structure

  • Main implementation: src/astronomy/
  • Module entry point: src/astronomy/mod.rs
  • Hub routing: src/hub/engine/dispatch/astronomy.rs

Internal execution flow

  1. The module exposes subdomains through mod.rs and targeted pub use exports.
  2. Each .rs file implements a coherent block of equations and functions.
  3. The Hub invokes these functions through the domain dispatcher when execution goes through ExperimentRunner.

What to check while reading code

  • Exact signature: input/output types and argument order.
  • Unit assumptions (especially distances, velocities, and Hubble constants).
  • Domain constraints (e.g. non-negative redshift, valid density parameters).

Modules

  • celestial
  • cosmology
  • galactic
  • impacts
  • orbits
  • planetary
  • rotation
  • stellar
  • tides

Celestial API (43 functions, 1 struct)

MoonData struct

FieldType
massf64
radiusf64

Functions

FunctionSignature
gravitational_force(m1: f64, m2: f64, r: f64) -> f64
tidal_force(m: f64, r: f64, delta_r: f64) -> f64
synodic_period(p1: f64, p2: f64) -> f64
apparent_angular_size(diameter: f64, distance: f64) -> f64
parallax_distance(parallax_arcsec: f64) -> f64
barycenter(m1: f64, m2: f64, d: f64) -> f64
lagrange_l1(d: f64, m1: f64, m2: f64) -> f64
hill_sphere(a: f64, m: f64, m_star: f64, e: f64) -> f64
surface_gravity(m: f64, r: f64) -> f64
sidereal_to_solar(sidereal_period: f64, orbital_period: f64) -> f64
habitable_zone_inner(luminosity_solar: f64) -> f64
habitable_zone_outer(luminosity_solar: f64) -> f64
julian_date_to_j2000_century(jd: f64) -> f64
j2000_century_to_julian_date(t: f64) -> f64
mean_obliquity_ecliptic(t_century: f64) -> f64
nutation_longitude(omega: f64) -> f64
precession_rate_arcsec_per_year(t_century: f64) -> f64
equation_of_time(day_of_year: f64) -> f64
sidereal_year_seconds() -> f64
tropical_year_seconds() -> f64
precession_period() -> f64
day_length_seconds() -> f64
solar_day_to_sidereal_day(solar_day_s: f64, orbital_period_s: f64) -> f64
degrees_to_radians(deg: f64) -> f64
radians_to_degrees(rad: f64) -> f64
tidal_dissipation_factor() -> f64
tidal_quality_factor(specific_dissipation: f64) -> f64
tidal_heating(mass_primary: f64, radius: f64, eccentricity: f64, a: f64, n: f64) -> f64
au_to_meters(au: f64) -> f64
meters_to_au(m: f64) -> f64
light_years_to_meters(ly: f64) -> f64
meters_to_light_years(m: f64) -> f64
au_to_light_years(au: f64) -> f64
light_years_to_au(ly: f64) -> f64
earth_moon_distance() -> f64
lunar_orbital_period() -> f64
moon_data(name: &str) -> Option<MoonData>
moon_mass(name: &str) -> Option<f64>
moon_radius(name: &str) -> Option<f64>
moon_surface_gravity(name: &str) -> Option<f64>
moon_escape_velocity(name: &str) -> Option<f64>
moon_volume(name: &str) -> Option<f64>
moon_mean_density(name: &str) -> Option<f64>

Cosmology API (70 functions)

FunctionSignature
hubble_velocity(h0: f64, distance: f64) -> f64
hubble_distance(h0: f64, velocity: f64) -> f64
redshift_velocity(v: f64, c: f64) -> f64
relativistic_redshift(v: f64) -> f64
velocity_from_redshift(z: f64) -> f64
cosmological_redshift(a_emit: f64, a_obs: f64) -> f64
scale_factor(redshift: f64) -> f64
critical_density(h: f64) -> f64
critical_density_from_h0(h0: f64) -> f64
friedmann_expansion(h0: f64, omega_m: f64, omega_r: f64, omega_lambda: f64, a: f64) -> f64
lookback_time(z: f64, h0: f64) -> f64
luminosity_distance(comoving_distance: f64, z: f64) -> f64
angular_diameter_distance(comoving_distance: f64, z: f64) -> f64
cmb_temperature(t0: f64, z: f64) -> f64
age_of_universe(h0: f64) -> f64
e_z(omega_m: f64, omega_r: f64, omega_k: f64, omega_de: f64, z: f64) -> f64
e_z_lcdm(omega_m: f64, z: f64) -> f64
e_z_lcdm_rad(omega_m: f64, omega_r: f64, z: f64) -> f64
e_z_wcdm(omega_m: f64, omega_de: f64, w: f64, z: f64) -> f64
e_z_w0wa(omega_m: f64, omega_de: f64, w0: f64, wa: f64, z: f64) -> f64
hubble_at_z(h0: f64, omega_m: f64, omega_r: f64, omega_k: f64, omega_de: f64, z: f64) -> f64
hubble_at_z_lcdm(h0: f64, omega_m: f64, z: f64) -> f64
deceleration_parameter(omega_m: f64, z: f64) -> f64
deceleration_parameter_today(omega_m: f64) -> f64
hubble_distance_mpc(h0: f64) -> f64
hubble_time_gyr(h0: f64) -> f64
omega_k_from(omega_m: f64, omega_r: f64, omega_de: f64) -> f64
little_h(h0: f64) -> f64
comoving_distance_from_z(h0: f64, omega_m: f64, z: f64) -> f64
luminosity_distance_from_z(h0: f64, omega_m: f64, z: f64) -> f64
angular_diameter_distance_from_z(h0: f64, omega_m: f64, z: f64) -> f64
distance_modulus_from_z(h0: f64, omega_m: f64, z: f64) -> f64
comoving_distance_general(h0: f64, omega_m: f64, omega_r: f64, omega_k: f64, omega_de: f64, z: f64) -> f64
transverse_comoving_distance(h0: f64, omega_m: f64, omega_r: f64, omega_k: f64, omega_de: f64, z: f64) -> f64
luminosity_distance_general(h0: f64, omega_m: f64, omega_r: f64, omega_k: f64, omega_de: f64, z: f64) -> f64
angular_diameter_distance_general(h0: f64, omega_m: f64, omega_r: f64, omega_k: f64, omega_de: f64, z: f64) -> f64
distance_modulus_general(h0: f64, omega_m: f64, omega_r: f64, omega_k: f64, omega_de: f64, z: f64) -> f64
comoving_distance_wcdm(h0: f64, omega_m: f64, omega_de: f64, w: f64, z: f64) -> f64
luminosity_distance_wcdm(h0: f64, omega_m: f64, omega_de: f64, w: f64, z: f64) -> f64
comoving_distance_w0wa(h0: f64, omega_m: f64, omega_de: f64, w0: f64, wa: f64, z: f64) -> f64
luminosity_distance_w0wa(h0: f64, omega_m: f64, omega_de: f64, w0: f64, wa: f64, z: f64) -> f64
luminosity_from_angular_diameter(d_a: f64, z: f64) -> f64
angular_diameter_from_luminosity(d_l: f64, z: f64) -> f64
proper_distance(comoving_d: f64, z: f64) -> f64
lookback_time_from_z(h0: f64, omega_m: f64, z: f64) -> f64
lookback_time_general(h0: f64, omega_m: f64, omega_r: f64, omega_k: f64, omega_de: f64, z: f64) -> f64
age_at_z(h0: f64, omega_m: f64, z: f64) -> f64
age_lcdm(h0: f64, omega_m: f64) -> f64
age_general(h0: f64, omega_m: f64, omega_r: f64, omega_k: f64, omega_de: f64) -> f64
acceleration_redshift(omega_m: f64) -> f64
matter_radiation_equality_z(omega_m: f64, omega_r: f64) -> f64
particle_horizon(h0: f64, omega_m: f64) -> f64
particle_horizon_general(h0: f64, omega_m: f64, omega_r: f64, omega_k: f64, omega_de: f64) -> f64
sound_horizon_eh98(omega_m: f64, omega_b: f64, h0: f64) -> f64
event_horizon(h0: f64, omega_m: f64) -> f64
comoving_volume_element(h0: f64, omega_m: f64, z: f64) -> f64
comoving_volume_total(h0: f64, omega_m: f64, z: f64) -> f64
comoving_volume_shell(h0: f64, omega_m: f64, z1: f64, z2: f64) -> f64
matter_density_at_z(h0: f64, omega_m: f64, z: f64) -> f64
radiation_density_at_z(h0: f64, omega_r: f64, z: f64) -> f64
dark_energy_density_at_z(h0: f64, omega_de: f64, w: f64, z: f64) -> f64
omega_m_at_z(omega_m: f64, z: f64) -> f64
omega_de_at_z(omega_m: f64, z: f64) -> f64
growth_factor_approx(omega_m: f64, z: f64) -> f64
growth_rate(omega_m: f64, z: f64) -> f64
sigma8_at_z(sigma8: f64, omega_m: f64, z: f64) -> f64
cmb_temperature_at_z(z: f64) -> f64
photon_number_density(z: f64) -> f64
cmb_energy_density(z: f64) -> f64
omega_r_from_tcmb(t_cmb: f64, h0: f64) -> f64

Galactic API (21 functions)

FunctionSignature
galactic_rotation_velocity(r: f64) -> f64
sun_orbital_period() -> f64
sun_orbital_velocity() -> f64
sun_galactocentric_distance() -> f64
galactic_mass_within_radius(r: f64) -> f64
sgr_a_schwarzschild_radius() -> f64
sgr_a_sphere_of_influence() -> f64
sgr_a_distance() -> f64
m31_approach_time() -> f64
m31_reduced_mass() -> f64
hubble_recession_velocity(distance_mpc: f64) -> f64
galactic_disk_density(r: f64, z: f64) -> f64
galactic_escape_velocity(r: f64) -> f64
galactic_circular_velocity(r: f64) -> f64
galactic_dynamical_time(r: f64) -> f64
stellar_number_density(r: f64, z: f64) -> f64
oort_a_constant(r: f64, dr: f64) -> f64
oort_b_constant(r: f64, dr: f64) -> f64
epicyclic_frequency(r: f64, dr: f64) -> f64
bulge_mass_within(r: f64) -> f64
tidal_radius(m_cluster: f64, r_galactic: f64) -> f64

Impacts API (5 functions)

FunctionSignature
crater_diameter(rho_i: f64, d_p: f64, v: f64, g: f64, rho_t: f64) -> f64
fireball_radius(e_kt: f64) -> f64
ejecta_volume(d: f64, depth: f64) -> f64
impact_velocity(v_inf: f64, v_esc: f64) -> f64
ejecta_escape_fraction(v_esc: f64, v_ejecta: f64) -> f64

Orbits API (20 functions)

FunctionSignature
kepler_period(a: f64, mu: f64) -> f64
kepler_velocity(mu: f64, r: f64, a: f64) -> f64
circular_velocity(mu: f64, r: f64) -> f64
escape_velocity(mu: f64, r: f64) -> f64
vis_viva(mu: f64, r: f64, a: f64) -> f64
orbital_energy(mu: f64, a: f64) -> f64
angular_momentum(mu: f64, a: f64, e: f64) -> f64
periapsis(a: f64, e: f64) -> f64
apoapsis(a: f64, e: f64) -> f64
true_anomaly_to_radius(a: f64, e: f64, theta: f64) -> f64
hohmann_delta_v(mu: f64, r1: f64, r2: f64) -> f64
sphere_of_influence(a: f64, m_planet: f64, m_star: f64) -> f64
roche_limit(r_primary: f64, rho_primary: f64, rho_secondary: f64) -> f64
solve_kepler(m: f64, e: f64, tol: f64) -> f64
gr_perihelion_precession(mass: f64, a: f64, e: f64) -> f64
j2_value(body: &str) -> Option<f64>
j2_nodal_regression(j2: f64, r_body: f64, a: f64, e: f64, i: f64, n: f64) -> f64
j2_apsidal_precession(j2: f64, r_body: f64, a: f64, e: f64, i: f64, n: f64) -> f64
yoshida4_step`(q: &mut [f64], p: &mut [f64], dt: f64, force: &dyn Fn(&[f64]) -> Vec<f64>)`
yoshida4_weights() -> (f64, f64)

Planetary API (48 functions, 1 struct)

PlanetData struct

FieldType
massf64
radiusf64
flatteningf64
orbital_periodf64
semi_major_axisf64
eccentricityf64
inclinationf64
axial_tiltf64
sidereal_dayf64
surface_gravityf64
escape_velocityf64
mean_densityf64
bond_albedof64
orbital_velocityf64

Functions

FunctionSignature
hydrostatic_pressure(density: f64, g_surface: f64, depth: f64) -> f64
central_pressure(density: f64, g_surface: f64, radius: f64) -> f64
adiabatic_temperature_gradient(g_local: f64, specific_heat: f64) -> f64
planetary_moment_of_inertia_factor(core_density: f64, mantle_density: f64, core_radius: f64, total_radius: f64) -> f64
love_number_k2(rigidity: f64, density: f64, radius: f64) -> f64
tidal_heating(radius: f64, eccentricity: f64, mean_motion: f64, k2: f64, tidal_q: f64, perturber_mass: f64, semi_major_axis: f64) -> f64
tidal_locking_timescale(mass: f64, radius: f64, semi_major_axis: f64, perturber_mass: f64, tidal_q: f64, rigidity: f64, initial_spin: f64) -> f64
roche_limit_fluid(primary_radius: f64, primary_density: f64, secondary_density: f64) -> f64
roche_limit_rigid(primary_radius: f64, primary_density: f64, secondary_density: f64) -> f64
equilibrium_temperature(stellar_luminosity: f64, semi_major_axis: f64, albedo: f64) -> f64
greenhouse_surface_temperature(equilibrium_temp: f64, optical_depth_ir: f64) -> f64
scale_height(temperature: f64, mean_molecular_mass: f64, g_surface: f64) -> f64
atmospheric_escape_jeans(temperature: f64, molecular_mass: f64, escape_velocity: f64) -> f64
magnetopause_standoff(dipole_moment: f64, solar_wind_pressure: f64) -> f64
ring_roche_inner(planet_mass: f64, planet_radius: f64, particle_density: f64) -> f64
ring_optical_depth(surface_density: f64, particle_radius: f64, particle_density: f64) -> f64
synchronous_orbit_radius(mass: f64, rotation_period: f64) -> f64
oblateness(rotation_rate: f64, equatorial_radius: f64, mass: f64) -> f64
precession_rate(oblateness_j2: f64, planet_radius: f64, semi_major_axis: f64, mean_motion: f64) -> f64
bond_albedo_from_geometric(geometric_albedo: f64, phase_integral: f64) -> f64
thermal_inertia(thermal_conductivity: f64, density: f64, specific_heat: f64) -> f64
diurnal_skin_depth(thermal_diffusivity: f64, rotation_period: f64) -> f64
subsolar_temperature(stellar_flux: f64, albedo: f64, emissivity: f64) -> f64
nightside_temperature(thermal_inertia_val: f64, subsolar_temp: f64, rotation_period: f64) -> f64
sputtering_loss_rate(stellar_wind_flux: f64, sputtering_yield: f64, cross_section: f64) -> f64
hill_sphere_atmospheric(planet_mass: f64, stellar_mass: f64, semi_major_axis: f64) -> f64
planet_data(name: &str) -> Option<PlanetData>
planet_mass(name: &str) -> Option<f64>
planet_radius(name: &str) -> Option<f64>
planet_flattening(name: &str) -> Option<f64>
planet_orbital_period(name: &str) -> Option<f64>
planet_semi_major_axis(name: &str) -> Option<f64>
planet_eccentricity(name: &str) -> Option<f64>
planet_inclination(name: &str) -> Option<f64>
planet_axial_tilt(name: &str) -> Option<f64>
planet_sidereal_day(name: &str) -> Option<f64>
planet_surface_gravity(name: &str) -> Option<f64>
planet_escape_velocity(name: &str) -> Option<f64>
planet_mean_density(name: &str) -> Option<f64>
planet_bond_albedo(name: &str) -> Option<f64>
planet_orbital_velocity(name: &str) -> Option<f64>
planet_volume(name: &str) -> Option<f64>
planet_circumference(name: &str) -> Option<f64>
planet_surface_area(name: &str) -> Option<f64>
planet_gravitational_parameter(name: &str) -> Option<f64>
planet_hill_sphere(name: &str, stellar_mass: f64) -> Option<f64>
planet_roche_limit(name: &str, secondary_density: f64) -> Option<f64>
planet_synchronous_orbit(name: &str) -> Option<f64>

Rotation API (7 functions)

FunctionSignature
surface_velocity_at_latitude(omega: f64, r: f64, phi: f64) -> f64
centripetal_acceleration(omega: f64, r: f64, phi: f64) -> f64
coriolis_parameter(omega: f64, phi: f64) -> f64
moment_of_inertia(c_factor: f64, m: f64, r: f64) -> f64
rotational_kinetic_energy(inertia: f64, omega: f64) -> f64
nutation_obliquity_rad(omega_node: f64) -> f64
day_length_variation(doy: f64, latitude: f64, tilt: f64) -> f64

Stellar API (49 functions)

FunctionSignature
luminosity_from_radius_temp(r: f64, t: f64) -> f64
absolute_magnitude(apparent_mag: f64, distance_pc: f64) -> f64
distance_modulus(apparent_mag: f64, absolute_mag: f64) -> f64
stellar_flux(luminosity: f64, distance: f64) -> f64
wien_peak_wavelength(temperature: f64) -> f64
main_sequence_lifetime(mass_solar: f64, luminosity_solar: f64) -> f64
mass_luminosity_relation(mass_solar: f64) -> f64
schwarzschild_radius(mass: f64) -> f64
chandrasekhar_limit() -> f64
chandrasekhar_limit_kg() -> f64
is_above_chandrasekhar(mass_kg: f64) -> bool
eddington_luminosity(mass: f64) -> f64
spectral_type_temperature(spectral_index: f64) -> f64
bolometric_correction(t_eff: f64) -> f64
tov_limit() -> f64
neutron_star_surface_gravity() -> f64
neutron_star_mean_density() -> f64
neutron_star_escape_velocity() -> f64
pulsar_spindown_luminosity(period: f64, period_dot: f64) -> f64
pulsar_magnetic_field(period: f64, period_dot: f64) -> f64
pulsar_characteristic_age(period: f64, period_dot: f64) -> f64
pulsar_death_line_period(b_field: f64) -> f64
magnetar_energy_reservoir(b_field: f64) -> f64
magnetar_typical_energy() -> f64
radiation_pressure(temperature: f64) -> f64
gas_pressure(rho: f64, temperature: f64, mu: f64) -> f64
adiabatic_sound_speed(temperature: f64, mu: f64) -> f64
pp_chain_luminosity(mass_kg: f64, x_hydrogen: f64) -> f64
cno_cycle_luminosity(mass_kg: f64, x_hydrogen: f64, z_metals: f64) -> f64
kelvin_helmholtz_timescale(mass: f64, radius: f64, luminosity: f64) -> f64
nuclear_timescale(mass: f64, luminosity: f64) -> f64
white_dwarf_radius_from_mass(mass_kg: f64) -> f64
eddington_luminosity_numerical(mass_solar: f64) -> f64
helium_mass() -> f64
solar_composition() -> (f64, f64, f64)
solar_effective_temperature() -> f64
solar_absolute_magnitude() -> f64
solar_metallicity() -> f64
solar_main_sequence_lifetime() -> f64
hydrogen_burning_energy_per_kg() -> f64
eddington_ratio(luminosity: f64, mass: f64) -> f64
sun_core_temperature() -> f64
sun_surface_temperature() -> f64
sun_core_density() -> f64
sun_age() -> f64
sun_rotation_period() -> f64
solar_density() -> f64
solar_surface_gravity() -> f64
sun_luminosity_to_mass_ratio() -> f64

Tides API (6 functions)

FunctionSignature
tidal_potential(m: f64, r: f64, d: f64, k2: f64, theta: f64) -> f64
tidal_bulge_height(a_tidal: f64, r: f64, g: f64, h2: f64) -> f64
spring_tide_amplitude(h_moon: f64, h_sun: f64) -> f64
neap_tide_amplitude(h_moon: f64, h_sun: f64) -> f64
tidal_dissipation_rate(k2: f64, n: f64, m: f64, r: f64, q: f64, d: f64) -> f64
tidal_locking_timescale(omega: f64, a: f64, mu: f64, q: f64, m: f64, r: f64) -> f64

Hub dispatch mapping

All astronomy functions are wired through the astronomy dispatcher in src/hub/engine/dispatch/astronomy.rs.

use sciforge::hub::prelude::*;

let exp = Experiment::new(DomainType::Astronomy, "hubble_at_z_lcdm")
	.param("h0", ParameterValue::Scalar(67.4))
	.param("omega_m", ParameterValue::Scalar(0.315))
	.param("z", ParameterValue::Scalar(1.0));

let out = ExperimentRunner::new().run(&exp)?;

Benchmark Source Code Guide

This page documents the source implementation behind sciforge::benchmark, including benchmark engine internals, encoding/decoding, simulation flow, report generation, and exporters.

Source Coverage

What is explained

  • File-level implementation layout in src/benchmark/.
  • Main algorithms and where they are implemented.
  • Runtime call path for benchmark execution, reporting, and exports.

Visibility and external access

  • Visibility: public (pub mod benchmark; in src/lib.rs).
  • External direct path: sciforge::benchmark::*.
  • Hub integration is optional for orchestration workflows.

Source Code Explanation

Relevant file structure

  • Main implementation: src/benchmark/
  • Module entry point: src/benchmark/mod.rs
  • Hub routing (when applicable): (n/a - benchmark is direct)

Internal logic

  1. The module exposes subdomains through mod.rs and targeted pub use exports.
  2. Each .rs file implements a coherent block of equations and functions.
  3. Hub integration is optional for orchestration workflows.

What to verify in source code

  • Exact signature: input/output types and argument order.
  • Numerical preconditions: divisions, roots, logarithms, and validity ranges.
  • Implicit conventions: units, normalization, bounds, and tolerances.

Modules

  • engine — core benchmarking loop, metrics struct, constants (bench, BenchmarkMetrics, CSV_HEADER)
  • simulation — deterministic simulation runner (SimConfig, SimState, SimResult, StepFn, RenderSink)
  • encode — binary serialization of benchmark metrics
  • decode — binary deserialization of encoded benchmark data
  • report — report generation in CSV, JSON, YAML, TOML, Markdown, HTML (BenchmarkReport)
  • export — multi-format batch export to filesystem (Entry, GroupStats, ExportSummary)

Engine API (6 items)

Structs

StructFields
BenchmarkMetrics<'a>experiment_name: &'a str, precision: &'a str, elapsed_ms: u64, iterations: u64, input_samples: u64, avg_time_ns: f32, last_time_ns: f32, output_bytes: usize, total_flops: u64, step_count: u32, input_dim: u32, output_dim: u32, benchmark_flags: u64, input_bytes: u64, result_bytes: u64, min_time_ns: f32, max_time_ns: f32, time_stddev: f32, iterations_per_sec: f32, samples_per_sec: f32, eval_error: f32, eval_accuracy: f32, eval_r_squared: f32, eval_mae: f32, eval_samples: u64, eval_dataset_hash: u64, logical_cores: u32, avg_frequency_mhz: u32, max_frequency_mhz: u32, max_workers: u32, target_cpu_utilization: f32

Enums

EnumVariants
BenchmarkEncodeErrorBufferTooSmall, InvalidFormat

Constants

ConstantTypeValue
CSV_HEADER&str"experiment_name,precision,elapsed_ms,iterations,avg_time_ns,min_time_ns,max_time_ns,time_stddev,iterations_per_sec,result"
BENCHMARK_MAGIC`[u8; 4]``[b'B', b'M', b'K', 0x01]`
BENCHMARK_VERSIONu164
BENCHMARK_HEADER_SIZEusize168

Functions

FunctionSignature
benchpub fn bench<'a, T, F: Fn() -> T>(experiment_name: &'a str, precision: &'a str, iterations: u64, f: F) -> BenchmarkMetrics<'a>
BenchmarkMetrics::to_csv_rowpub fn to_csv_row(&self) -> String

Simulation API (7 items)

Structs

StructFields
SimState`positions: Vec<[f64; 3]>`, `velocities: Vec<[f64; 3]>, time: f64, step: u64`
SimConfigdt: f64, max_steps: u64, body_count: usize
SimResultfinal_state: SimState, total_steps: u64, elapsed_ms: u64, avg_step_ns: f64

Traits

TraitMethod
StepFnfn integrate(&self, state: &mut SimState, dt: f64)
RenderSinkfn frame(&mut self, state: &SimState)

Functions

FunctionSignature
SimState::newpub fn new(body_count: usize) -> Self
runpub fn run<S: StepFn, R: RenderSink>(config: &SimConfig, step_fn: &S, sink: &mut R, state: &mut SimState) -> SimResult
run_headlesspub fn run_headless<S: StepFn>(config: &SimConfig, step_fn: &S, state: &mut SimState) -> SimResult

Encode API (2 items)

FunctionSignature
encoded_sizepub fn encoded_size(metrics: &BenchmarkMetrics<'_>) -> Option<usize>
encode`pub fn encode(metrics: &BenchmarkMetrics<'_>, out: &mut [u8]) -> Result<usize, BenchmarkEncodeError>`

Decode API (1 item)

FunctionSignature
decode`pub fn decode<'a>(bytes: &'a [u8]) -> Result<BenchmarkMetrics<'a>, BenchmarkEncodeError>`

Report API (10 items)

Structs

StructFields
BenchmarkReportcsv: String, markdown: String, html: String

Functions

FunctionSignature
generatepub fn generate(metrics: &BenchmarkMetrics<'_>, result: &str) -> BenchmarkReport
generate_csvpub fn generate_csv(metrics: &BenchmarkMetrics<'_>, result: &str) -> String
generate_jsonpub fn generate_json(metrics: &BenchmarkMetrics<'_>, result: &str) -> String
generate_json_tagged`pub fn generate_json_tagged(metrics: &BenchmarkMetrics<'_>, result: &str, tags: &[(&str, &str)]) -> String`
generate_yamlpub fn generate_yaml(metrics: &BenchmarkMetrics<'_>, result: &str) -> String
generate_yaml_tagged`pub fn generate_yaml_tagged(metrics: &BenchmarkMetrics<'_>, result: &str, tags: &[(&str, &str)]) -> String`
generate_tomlpub fn generate_toml(metrics: &BenchmarkMetrics<'_>, result: &str) -> String
generate_toml_tagged`pub fn generate_toml_tagged(metrics: &BenchmarkMetrics<'_>, result: &str, tags: &[(&str, &str)]) -> String`
sanitize_filenamepub fn sanitize_filename(name: &str) -> String

Export API (7 items)

Constants

ConstantTypeValue
PTABLE_CATS`[&str; 10]``["Nonmetal", "Noble Gas", "Alkali Metal", "Alkaline Earth", "Transition Metal", "Post-Transition", "Metalloid", "Halogen", "Lanthanide", "Actinide"]`

Structs

StructFields
GroupStats<'a>groups: Vec<&'a str>, counts: BTreeMap<&'a str, usize>, sums: BTreeMap<&'a str, f32>, mins: BTreeMap<&'a str, f32>, maxs: BTreeMap<&'a str, f32>
Entry<'a>metrics: &'a BenchmarkMetrics<'a>, result: &'a str, label: &'a str, tags: Vec<(&'a str, &'a str)>, grid_row: Option<u8>, grid_col: Option<u8>
ExportSummaryfiles_written: usize, html_size: usize, md_size: usize

Functions

FunctionSignature
compute_group_stats`pub fn compute_group_stats<'a>(entries: &[Entry<'a>]) -> GroupStats<'a>`
capitalize_firstpub fn capitalize_first(s: &str) -> String
export`pub fn export(title: &str, entries: &[Entry<'_>], dir: &Path) -> std::io::Result<ExportSummary>`

Biology Source Code Guide

This page documents the source implementation behind sciforge::biology, including file layout, execution flow, and Hub dispatch integration.

Source Coverage

What is explained

  • File-level implementation layout in src/biology/.
  • Main computation groups and where they are implemented.
  • Runtime call path when biology functions are executed through Hub dispatch.

Visibility and external access

  • Visibility: internal (pub(crate) in src/lib.rs).
  • External consumers should use sciforge::hub as the public entry point.
  • Paths in this page are for source reading and internal crate development.

Source Code Explanation

Relevant file structure

  • Main implementation: src/biology/
  • Module entry point: src/biology/mod.rs
  • Hub routing (when applicable): src/hub/engine/dispatch/biology.rs

Internal logic

  1. The module exposes subdomains through mod.rs and targeted pub use exports.
  2. Each .rs file implements a coherent block of equations and functions.
  3. The Hub invokes these functions through the domain dispatcher when execution goes through ExperimentRunner.

What to verify in source code

  • Exact signature: input/output types and argument order.
  • Numerical preconditions: divisions, roots, logarithms, and validity ranges.
  • Implicit conventions: units, normalization, bounds, and tolerances.

Modules

  • aging — telomere dynamics, senescence models, Gompertz mortality, oxidative stress
  • bioelectricity — membrane potential, Hodgkin-Huxley, action potential, impedance, stimulation
  • bioenergetics — ATP yield, metabolic rate, photosynthesis, respiration, thermodynamics
  • biogeography — species-area, island biogeography, climate zones, connectivity
  • bioinformatics — sequence alignment, assembly, expression, quality
  • biomechanics — muscle force, tissue stress, locomotion, fluid mechanics
  • biophysics — membrane transport, molecular dynamics, polymers, protein folding
  • biostatistics — survival analysis, clinical trials, regression, meta-analysis
  • cancer_biology — tumor growth, microenvironment, immunology, therapy
  • cell — cell cycle, adhesion, organelles, signaling, transport
  • chronobiology — circadian rhythms, entrainment, oscillators
  • cryobiology — freezing, ice formation, preservation
  • developmental — differentiation, gene regulation, morphogens, patterns
  • ecology — Lotka-Volterra, diversity, ecosystem, food web, similarity
  • endocrinology — hormone kinetics, axes, receptors
  • enzyme — Michaelis-Menten, inhibition, regulation, mechanisms
  • epigenetics — chromatin, histones, methylation, inheritance, noncoding RNA
  • ethology — behavior, communication, foraging, learning
  • evolution — adaptation, fitness, molecular clock, neutral theory, speciation
  • genetics — drift, equilibrium, linkage, quantitative traits, selection
  • genomics — annotation, motifs, ORF, statistics, variants
  • immunology — adaptive, innate, antibodies, cytokines, dynamics
  • marine_biology — coral, fisheries, ocean, plankton
  • microbiology — biofilm, culture, growth, metabolism, quorum sensing
  • mycology — decomposition, ecology, growth, symbiosis
  • neuroscience — neural models, cognition, networks, synapses, analysis
  • nutrition — absorption, energy balance, metabolism, micronutrients
  • paleobiology — dating, diversity, extinction, morphology
  • parasitology — epidemiology, host-parasite, immunity, virulence
  • pharmacology — PK/PD, absorption, drug interactions, pharmacodynamics
  • phylogenetics — alignment, distance, molecular clock, sequence, tree
  • physiology — cardiac, hemodynamics, renal, respiratory, thermoregulation
  • plant_biology — ecology, growth, photosynthesis, transport
  • population — age structure, epidemiology, growth, predation, spatial
  • proteomics — mass spec, networks, properties, quantification
  • radiobiology — DNA damage, dose-response, fractionation, shielding
  • reproduction — embryogenesis, fertility, hormonal cycles, IVF
  • stem_cell — differentiation, dynamics, niche, reprogramming
  • structural — docking, geometry, secondary structure, superposition
  • synthetic_biology — circuits, CRISPR, metabolic engineering, stochastic
  • systems_biology — bistability, flux, networks, oscillations, sensitivity
  • tissue_engineering — bioreactor, scaffold, tissue, vascularization
  • toxicology — accumulation, dose-response, ecotoxicology, mechanisms
  • virology — dynamics, epidemiology, evolution, structure

aging API (70 functions)

FunctionSignature
telomere_shortening(initial_length: f64, loss_per_division: f64, divisions: f64) -> f64
hayflick_limit(initial_length: f64, critical_length: f64, loss_per_division: f64) -> f64
telomerase_equilibrium( shortening_rate: f64, elongation_rate: f64, initial: f64, t: f64, ) -> f64
oxidative_damage_accumulation( production_rate: f64, repair_rate: f64, t: f64, initial_damage: f64, ) -> f64
mitochondrial_damage(intact_fraction: f64, damage_rate: f64, dt: f64) -> f64
senescent_cell_fraction( division_rate: f64, senescence_prob: f64, clearance_rate: f64, t: f64, ) -> f64
caloric_restriction_lifespan( base_lifespan: f64, restriction_fraction: f64, effect_coefficient: f64, ) -> f64
reliability_theory_survival( n_elements: usize, element_failure_rate: f64, redundancy: usize, t: f64, ) -> f64
ros_steady_state(production_rate: f64, sod_activity: f64, catalase_activity: f64) -> f64
protein_aggregation( misfolded: f64, aggregation_rate: f64, chaperone_capacity: f64, dt: f64, ) -> f64
dna_repair_capacity(age: f64, base_capacity: f64, decline_rate: f64) -> f64
somatic_mutation_accumulation( mutation_rate: f64, divisions: f64, repair_efficiency: f64, ) -> f64
epigenetic_clock_horvath`(cpg_values: &[f64], coefficients: &[f64], intercept: f64) -> f64`
nad_decline(initial_nad: f64, decline_rate: f64, age: f64) -> f64
autophagy_flux( substrate: f64, autophagosome_formation: f64, lysosomal_activity: f64, age_factor: f64, ) -> f64
stem_cell_exhaustion( initial_pool: f64, division_rate: f64, senescence_prob: f64, age: f64, ) -> f64
inflammaging_cytokine(basal: f64, senescent_cells: f64, amplification: f64) -> f64
crosslink_accumulation(rate: f64, turnover: f64, t: f64) -> f64
lipofuscin_accumulation(production_rate: f64, t: f64) -> f64
immune_senescence( naive_t_cells: f64, thymic_output_rate: f64, age: f64, proliferation_capacity: f64, ) -> f64
gompertz_mortality_rate(a: f64, b: f64, age: f64) -> f64
gompertz_makeham(a: f64, b: f64, c: f64, age: f64) -> f64
weibull_mortality_hazard(lambda: f64, k: f64, age: f64) -> f64
mortality_doubling_time(b: f64) -> f64
survival_probability`(hazard_rates: &[f64], dt: f64) -> f64`
life_expectancy`(survival_curve: &[(f64, f64)]) -> f64`
deceleration_plateau(age: f64, plateau_age: f64, plateau_rate: f64, a: f64, b: f64) -> f64
frailty_deficit_index(deficits: usize, total_items: usize) -> f64
phenotypic_age_levine( albumin: f64, creatinine: f64, glucose: f64, crp: f64, lymphocyte_pct: f64, mcv: f64, rdw: f64, alp: f64, wbc: f64, chronological_age: f64, ) -> f64
horvath_clock`(cpg_betas: &[f64], coefficients: &[f64], intercept: f64) -> f64`
cr_lifespan_extension( baseline_lifespan: f64, restriction_fraction: f64, max_extension: f64, ) -> f64
reliability_theory_failure( initial_elements: usize, redundancy: usize, failure_rate: f64, t: f64, ) -> f64
ros_production_rate(metabolic_rate: f64, coupling_efficiency: f64) -> f64
antioxidant_capacity( sod: f64, catalase: f64, glutathione: f64, k_sod: f64, k_cat: f64, k_gsh: f64, ) -> f64
oxidative_damage_rate(ros_level: f64, antioxidant: f64) -> f64
lipid_peroxidation( pufa_concentration: f64, ros_level: f64, k_initiation: f64, k_propagation: f64, ) -> f64
protein_carbonylation(protein_conc: f64, ros_level: f64, rate_constant: f64) -> f64
dna_8oxog_formation(ros_level: f64, guanine_sites: f64, k_oxidation: f64) -> f64
mitochondrial_ros_vicious_cycle( damage: f64, ros_base: f64, amplification: f64, repair_rate: f64, dt: f64, ) -> f64
glutathione_ratio(gsh: f64, gssg: f64) -> f64
fenton_reaction_rate(fe2: f64, h2o2: f64, k_fenton: f64) -> f64
nrf2_response(ros_level: f64, keap1: f64, k_activation: f64) -> f64
carbonyl_stress(methylglyoxal: f64, glyoxalase: f64, km: f64) -> f64
oxidative_stress_index(total_oxidant: f64, total_antioxidant: f64) -> f64
gompertz_mortality(a: f64, b: f64, age: f64) -> f64
gompertz_survival(a: f64, b: f64, age: f64) -> f64
weibull_mortality(lambda: f64, k: f64, age: f64) -> f64
weibull_survival(lambda: f64, k: f64, age: f64) -> f64
gompertz_makeham_mortality(a: f64, b: f64, c: f64, age: f64) -> f64
mortality_rate_doubling_time(b: f64) -> f64
life_expectancy_from_survival(survival: impl Fn(f64) -> f64, max_age: f64, dt: f64) -> f64
siler_mortality(a1: f64, b1: f64, a2: f64, a3: f64, b3: f64, age: f64) -> f64
logistic_mortality_plateau(a: f64, b: f64, c: f64, age: f64) -> f64
demographic_entropy`(life_table_lx: &[f64]) -> f64`
net_reproduction_rate`(survivorship: &[f64], fecundity: &[f64]) -> f64`
generation_time`(survivorship: &[f64], fecundity: &[f64]) -> f64`
actuarial_senescence_rate( mortality_young: f64, mortality_old: f64, age_interval: f64, ) -> f64
proportional_hazards`(baseline_hazard: f64, covariates: &[f64], coefficients: &[f64]) -> f64`
biological_age_levine( chronological_age: f64, albumin: f64, creatinine: f64, glucose: f64, crp_ln: f64, lymphocyte_pct: f64, mcv: f64, rdw: f64, alkaline_phosphatase: f64, wbc: f64, ) -> f64
frailty_index(deficits_present: u32, deficits_measured: u32) -> f64
disability_free_life_expectancy`(survival: &[f64], disability_free: &[f64]) -> f64`
telomere_attrition(initial_length: f64, loss_per_division: f64, divisions: usize) -> f64
telomerase_elongation(current_length: f64, rate: f64, telomerase_activity: f64) -> f64
replicative_limit(initial_length: f64, loss_per_division: f64, critical_length: f64) -> f64
telomere_length_distribution(mean: f64, std_dev: f64, n_chromosomes: usize) -> Vec<f64>
critical_shortening_probability(mean_length: f64, std_dev: f64, critical: f64) -> f64
shelterin_protection(telomere_length: f64, shelterin_kd: f64) -> f64
end_replication_problem(lagging_strand_loss: f64, divisions: usize) -> f64
alt_pathway_elongation( recombination_rate: f64, donor_length: f64, recipient_length: f64, ) -> f64
telomere_age_regression(age: f64, birth_length: f64, annual_loss: f64) -> f64

bioelectricity API (81 functions)

FunctionSignature
action_potential_shape( t: f64, v_rest: f64, v_peak: f64, tau_rise: f64, tau_fall: f64, ) -> f64
cable_equation_steady(v0: f64, x: f64, lambda: f64) -> f64
electrotonic_length(physical_length: f64, space_constant: f64) -> f64
input_resistance_cylinder(rm: f64, ri: f64, diameter: f64) -> f64
strength_duration_weiss(rheobase: f64, chronaxie: f64, duration: f64) -> f64
strength_duration_lapicque(rheobase: f64, chronaxie: f64, duration: f64) -> f64
local_field_potential`(currents: &[f64], distances: &[f64], sigma: f64) -> f64`
extracellular_spike_amplitude(transmembrane_current: f64, distance: f64, sigma: f64) -> f64
impedance_tissue(resistance: f64, capacitance: f64, frequency: f64) -> f64
defibrillation_threshold(body_mass: f64, transthoracic_impedance: f64) -> f64
bioimpedance_body_composition( impedance: f64, height: f64, weight: f64, age: f64, sex_factor: f64, ) -> f64
coulter_counter_volume( baseline_impedance: f64, pulse_amplitude: f64, orifice_volume: f64, ) -> f64
dielectrophoresis_force(radius: f64, epsilon_m: f64, cm_factor: f64, grad_e2: f64) -> f64
clausius_mossotti(epsilon_p: f64, epsilon_m: f64) -> f64
electroporation_threshold(membrane_thickness: f64, breakdown_voltage: f64) -> f64
electroporation_pore_density(v_m: f64, v_ep: f64, n0: f64, alpha: f64) -> f64
joule_heating(current_density: f64, conductivity: f64, duration: f64) -> f64
electrode_double_layer_capacitance(epsilon: f64, debye_length: f64) -> f64
iontophoresis_flux(current: f64, z: f64, transport_number: f64) -> f64
skin_impedance_model(r_stratum: f64, c_stratum: f64, r_deep: f64, frequency: f64) -> f64
ecg_lead_vector(dipole: (f64, f64, f64), lead_direction: (f64, f64, f64)) -> f64
eeg_dipole_potential( dipole_moment: f64, cos_angle: f64, distance: f64, conductivity: f64, ) -> f64
nerve_conduction_velocity_temperature(v_ref: f64, q10: f64, t: f64, t_ref: f64) -> f64
nernst_potential( z: f64, temperature: f64, concentration_out: f64, concentration_in: f64, ) -> f64
goldman_hodgkin_katz( pk: f64, k_out: f64, k_in: f64, pna: f64, na_out: f64, na_in: f64, pcl: f64, cl_out: f64, cl_in: f64, temperature: f64, ) -> f64
cable_equation_steady_state(v0: f64, x: f64, lambda: f64) -> f64
membrane_time_constant(rm: f64, cm: f64) -> f64
length_constant(rm: f64, ri: f64) -> f64
gap_junction_conductance( n_channels: f64, single_channel_conductance: f64, open_probability: f64, ) -> f64
electrodiffusion_flux( permeability: f64, z: f64, vm: f64, c_out: f64, c_in: f64, temperature: f64, ) -> f64
hodgkin_huxley_sodium_current(g_na: f64, m: f64, h: f64, v: f64, e_na: f64) -> f64
hodgkin_huxley_potassium_current(g_k: f64, n: f64, v: f64, e_k: f64) -> f64
hodgkin_huxley_leak_current(g_l: f64, v: f64, e_l: f64) -> f64
hodgkin_huxley_dv_dt(cm: f64, i_ext: f64, i_na: f64, i_k: f64, i_l: f64) -> f64
gating_alpha_n(v: f64) -> f64
gating_beta_n(v: f64) -> f64
gating_alpha_m(v: f64) -> f64
gating_beta_m(v: f64) -> f64
gating_alpha_h(v: f64) -> f64
gating_beta_h(v: f64) -> f64
gating_steady_state(alpha: f64, beta: f64) -> f64
gating_time_constant(alpha: f64, beta: f64) -> f64
reversal_potential_two_ion(g1: f64, e1: f64, g2: f64, e2: f64) -> f64
membrane_capacitance_current(cm: f64, dv_dt: f64) -> f64
ion_channel_open_probability(v: f64, v_half: f64, slope: f64) -> f64
synaptic_conductance_alpha(g_max: f64, t: f64, tau: f64) -> f64
synaptic_current(g_syn: f64, v_post: f64, e_syn: f64) -> f64
calcium_nernst(temperature: f64, ca_out: f64, ca_in: f64) -> f64
chloride_equilibrium(temperature: f64, cl_out: f64, cl_in: f64) -> f64
resting_potential_contribution( conductance: f64, reversal: f64, total_conductance: f64, ) -> f64
space_clamp_error(distance: f64, lambda: f64) -> f64
action_potential_threshold_estimate(v_rest: f64, depolarization: f64) -> f64
conduction_velocity(diameter: f64, myelinated: bool) -> f64
saltatory_conduction_delay(internode_distance: f64, velocity: f64) -> f64
membrane_resistance_per_area(resistivity: f64, thickness: f64) -> f64
specific_membrane_capacitance(epsilon_r: f64, thickness: f64) -> f64
defibrillation_energy(capacitance: f64, voltage: f64) -> f64
electrode_impedance(resistance: f64, capacitance: f64, frequency: f64) -> f64
stimulation_strength_duration(rheobase: f64, chronaxie: f64, pulse_width: f64) -> f64
bioimpedance_cole_model( r_inf: f64, r_0: f64, tau: f64, alpha: f64, frequency: f64, ) -> (f64, f64)
transcranial_current_density(current: f64, electrode_area: f64) -> f64
neural_recruitment_curve( stimulus: f64, threshold: f64, saturation: f64, steepness: f64, ) -> f64
charge_density(charge: f64, electrode_area: f64) -> f64
cathodic_charge_balanced( anodic_amplitude: f64, anodic_duration: f64, cathodic_duration: f64, ) -> f64
pulse_train_energy( amplitude: f64, pulse_width: f64, frequency: f64, duration: f64, impedance: f64, ) -> f64
tissue_heating( current_density: f64, conductivity: f64, duration: f64, specific_heat: f64, density: f64, ) -> f64
tms_induced_efield(di_dt: f64, coil_inductance: f64, distance: f64) -> f64
dbs_volume_tissue_activated(current: f64, impedance: f64, threshold_efield: f64) -> f64
cochlear_implant_spread(current: f64, distance: f64, sigma: f64) -> f64
fes_fatigue_index(initial_force: f64, final_force: f64) -> f64
shannon_safety_limit(charge_per_phase_uc: f64, electrode_area_cm2: f64) -> f64
biphasic_pulse_charge(amplitude: f64, phase_duration: f64) -> f64
interphase_gap_effect(threshold_no_gap: f64, gap_duration: f64, time_constant: f64) -> f64
electrochemical_safety_margin(water_window: f64, electrode_potential: f64) -> f64
warburg_impedance(sigma: f64, frequency: f64) -> (f64, f64)
constant_phase_element(q: f64, alpha: f64, frequency: f64) -> (f64, f64)
chronaxie_from_strength_duration( rheobase: f64, threshold_at_pw: f64, pulse_width: f64, ) -> f64
galvanic_skin_response( baseline_conductance: f64, peak_conductance: f64, t: f64, tau_rise: f64, tau_decay: f64, ) -> f64
total_charge_delivered( amplitude: f64, pulse_width: f64, frequency: f64, duration: f64, ) -> f64
electrode_polarization_voltage(charge: f64, capacitance: f64) -> f64
anodal_break_excitation_threshold( membrane_tau: f64, pulse_duration: f64, rheobase: f64, ) -> f64

bioenergetics API (76 functions)

FunctionSignature
atp_hydrolysis_free_energy(delta_g0: f64, atp: f64, adp: f64, pi: f64, t: f64) -> f64
p_o_ratio(atp_produced: f64, oxygen_consumed: f64) -> f64
respiratory_control_index(state3_rate: f64, state4_rate: f64) -> f64
uncoupling_heat(pmf: f64, proton_leak: f64) -> f64
chemiosmotic_atp_rate(pmf: f64, atp_synthase_activity: f64, h_per_atp: f64) -> f64
shuttle_efficiency_malate_aspartate(nadh_cytoplasmic: f64, transfer_rate: f64) -> f64
shuttle_efficiency_glycerol_3p(nadh_cytoplasmic: f64, transfer_rate: f64) -> f64
metabolic_water(glucose_oxidized: f64) -> f64
adenylate_energy_charge(atp: f64, adp: f64, amp: f64) -> f64
phosphocreatine_equilibrium(creatine: f64, atp: f64, k_eq: f64) -> f64
myosin_atpase_rate(load_fraction: f64, vmax: f64) -> f64
ionic_gradient_energy(z: f64, vm: f64, c_out: f64, c_in: f64, t: f64) -> f64
glycolysis_net_atp(glucose: f64) -> f64
glycolysis_pyruvate_yield(glucose: f64) -> f64
gluconeogenesis_cost(glucose: f64) -> f64
pentose_phosphate_nadph(glucose_6p: f64) -> f64
fatty_acid_synthesis_cost(acetyl_coa_units: f64) -> f64
urea_cycle_cost(amino_acids: f64) -> f64
glycogen_storage_efficiency(glucose_units: f64) -> f64
warburg_effect(aerobic_glycolysis_rate: f64, oxidative_rate: f64) -> f64
ketogenesis_yield(acetyl_coa: f64) -> f64
amino_acid_catabolism_atp( carbon_count: usize, is_glucogenic: bool, is_ketogenic: bool, ) -> f64
cori_cycle_cost(lactate: f64) -> f64
respiratory_quotient(co2_produced: f64, o2_consumed: f64) -> f64
metabolic_flux_control_coefficient(v_enzyme: f64, v_pathway: f64, elasticity: f64) -> f64
farquhar_model( vcmax: f64, jmax: f64, ci: f64, gamma_star: f64, kc: f64, ko: f64, o: f64, rd: f64, par: f64, ) -> f64
electron_transport_rate(jmax: f64, par: f64) -> f64
light_response_curve(amax: f64, phi: f64, par: f64, rd: f64) -> f64
light_compensation_point(amax: f64, phi: f64, rd: f64) -> f64
water_use_efficiency(assimilation: f64, transpiration: f64) -> f64
rubisco_specificity(vcmax: f64, kc: f64, vomax: f64, ko: f64) -> f64
photorespiration_rate(vomax: f64, o: f64, ko: f64, ci: f64, kc: f64) -> f64
quantum_yield(assimilation_rate: f64, photon_flux: f64) -> f64
co2_compensation_point_photo( gamma_star: f64, rd: f64, vcmax: f64, kc: f64, ko: f64, o: f64, ) -> f64
stomatal_conductance_ball_berry( assimilation: f64, rh: f64, cs: f64, g0: f64, g1: f64, ) -> f64
mesophyll_conductance_photo(assimilation: f64, ci: f64, cc: f64) -> f64
triose_phosphate_utilization(tpu: f64, ci: f64, gamma_star: f64) -> f64
light_inhibition_photoinhibition(fv_fm_initial: f64, light_excess: f64, ki: f64) -> f64
canopy_photosynthesis_sun_shade(lai: f64, k_ext: f64, a_sun: f64, a_shade: f64) -> f64
carbon_concentrating_mechanism_benefit(ci_c3: f64, ci_c4: f64, vcmax: f64, kc: f64) -> f64
atp_free_energy(delta_g0: f64, atp: f64, adp: f64, pi: f64, t: f64) -> f64
atp_synthase_rate(proton_gradient: f64, n_protons: f64, delta_g_atp: f64, t: f64) -> f64
proton_motive_force(delta_psi: f64, delta_ph: f64, t: f64) -> f64
p_to_o_ratio(atp_produced: f64, oxygen_consumed: f64) -> f64
respiratory_control_ratio(state3: f64, state4: f64) -> f64
membrane_potential_nernst(z: f64, c_out: f64, c_in: f64, t: f64) -> f64
uncoupler_effect(pmf: f64, permeability: f64, concentration: f64) -> f64
citric_acid_cycle_nadh_yield(acetyl_coa_flux: f64) -> f64
citric_acid_cycle_fadh2_yield(acetyl_coa_flux: f64) -> f64
electron_transport_efficiency( n_electrons: f64, delta_e: f64, delta_g_atp: f64, n_atp: f64, ) -> f64
substrate_level_phosphorylation(n_reactions: f64, delta_g_per_reaction: f64) -> f64
anaerobic_atp_yield(glucose_flux: f64) -> f64
aerobic_atp_yield(glucose_flux: f64) -> f64
lactate_production_rate(pyruvate_flux: f64, nad_ratio: f64) -> f64
beta_oxidation_atp_yield(carbon_chain_length: f64) -> f64
creatine_phosphate_buffer(atp: f64, adp: f64, cr_p: f64, keq: f64) -> f64
gibbs_free_energy_reaction(delta_h: f64, t: f64, delta_s: f64) -> f64
gibbs_free_energy_body_temp(delta_h: f64, delta_s: f64) -> f64
equilibrium_constant_body_temp(delta_g0: f64) -> f64
redox_potential_body_temp(e0: f64, n: f64, oxidized: f64, reduced: f64) -> f64
equilibrium_constant(delta_g0: f64, t: f64) -> f64
redox_potential(e0: f64, n: f64, oxidized: f64, reduced: f64, t: f64) -> f64
energy_charge(atp: f64, adp: f64, amp: f64) -> f64
metabolic_rate_kleiber(mass: f64) -> f64
oxygen_consumption_rate(metabolic_rate: f64, oxycaloric_equivalent: f64) -> f64
coupling_efficiency(delta_g_atp: f64, delta_g_substrate: f64, n_atp: f64) -> f64
heat_dissipation(delta_g_reaction: f64, useful_work: f64) -> f64
metabolic_rate_q10(rate_ref: f64, t: f64, t_ref: f64, q10: f64) -> f64
arrhenius_metabolic(rate_ref: f64, ea: f64, t: f64, t_ref: f64) -> f64
thermogenic_cost(delta_h: f64, efficiency: f64) -> f64
proton_gradient_energy(n_protons: f64, delta_mu: f64) -> f64
nad_redox_potential(nad_ox: f64, nad_red: f64, e0: f64, t: f64) -> f64
entropy_production_rate(heat_flux: f64, temperature: f64) -> f64
exergy_content(delta_h: f64, t0: f64, delta_s: f64) -> f64
muscle_mechanical_efficiency(work_output: f64, metabolic_input: f64) -> f64
basal_metabolic_scaling(m0: f64, mass: f64, exponent: f64) -> f64

biogeography API (52 functions)

FunctionSignature
species_range_overlap(range_a: (f64, f64), range_b: (f64, f64)) -> f64
range_size_latitude(area: f64) -> f64
elevational_diversity_gradient( elevation: f64, peak_elevation: f64, max_richness: f64, ) -> f64
biome_niche_model( temperature: f64, precipitation: f64, t_opt: f64, p_opt: f64, t_width: f64, p_width: f64, ) -> f64
regional_endemism_index(endemic_species: usize, total_species: usize) -> f64
latitudinal_diversity_gradient(latitude: f64, max_richness: f64, steepness: f64) -> f64
range_shift_velocity(temp_change_rate: f64, spatial_temp_gradient: f64) -> f64
climate_envelope_suitability( temp: f64, precip: f64, temp_min: f64, temp_max: f64, precip_min: f64, precip_max: f64, ) -> f64
refugia_persistence(area: f64, min_viable_area: f64, climate_stability: f64) -> f64
wallace_line_effect(dispersal_ability: f64, barrier_width: f64) -> f64
landscape_resistance`(cost_surface: &[Vec<f64>], path: &[(usize, usize)]) -> f64`
isolation_by_distance`(genetic_dist: &[f64], geographic_dist: &[f64]) -> f64`
connectivity_index`(patch_areas: &[f64], distances: &[Vec<f64>], alpha: f64) -> Vec<f64>`
metapopulation_incidence(connectivity: f64, e: f64, colonization_coeff: f64) -> f64
habitat_fragmentation_index(total_area: f64, n_patches: usize, perimeter_sum: f64) -> f64
effective_mesh_size`(patch_areas: &[f64], total_area: f64) -> f64`
proximity_index`(focal_area: f64, neighbor_areas: &[f64], distances: &[f64]) -> f64`
corridor_effectiveness( corridor_length: f64, corridor_width: f64, matrix_resistance: f64, ) -> f64
graph_connectivity`(adjacency: &[Vec<bool>]) -> f64`
stepping_stone_migration`(populations: &[f64], migration_rate: f64) -> Vec<f64>`
least_cost_distance`( cost_surface: &[Vec<f64>], start: (usize, usize), end: (usize, usize), ) -> f64`
resistance_distance`(conductances: &[Vec<f64>], node_a: usize, node_b: usize) -> f64`
patch_cohesion`(patch_perimeters: &[f64], patch_areas: &[f64], total_cells: f64) -> f64`
circuitscape_effective_resistance`(node_conductances: &[f64]) -> f64`
dispersal_kernel_exponential(distance: f64, mean_dispersal: f64) -> f64
dispersal_kernel_2dt(distance: f64, a: f64, p: f64) -> f64
range_shift_rate(warming_rate: f64, lapse_rate: f64) -> f64
latitudinal_gradient(species_tropical: f64, species_polar: f64, lat_range: f64) -> f64
altitudinal_gradient(species_low: f64, species_high: f64, alt_range: f64) -> f64
bioclimatic_envelope( temp: f64, precip: f64, temp_min: f64, temp_max: f64, precip_min: f64, precip_max: f64, ) -> f64
species_area_relationship(c: f64, z: f64, area: f64) -> f64
endemism_index(endemic_species: usize, total_species: usize) -> f64
climate_velocity(temp_change_rate: f64, spatial_gradient: f64) -> f64
habitat_suitability_index`(variables: &[f64], optima: &[f64], tolerances: &[f64]) -> f64`
island_equilibrium_richness( immigration_max: f64, extinction_max: f64, area: f64, distance: f64, ) -> f64
nestedness_temperature`(presence_matrix: &[Vec<bool>]) -> f64`
mid_domain_effect(domain_size: f64, range_size: f64) -> f64
beta_diversity_whittaker(gamma: f64, alpha_mean: f64) -> f64
beta_diversity_sorensen(shared: f64, unique_a: f64, unique_b: f64) -> f64
rapoport_rule`(range_sizes: &[f64], latitudes: &[f64]) -> f64`
occupancy_frequency`(presences: &[bool]) -> f64`
island_species_area(c: f64, z: f64, area: f64) -> f64
island_immigration_rate(s: f64, p: f64, i_max: f64) -> f64
island_extinction_rate(s: f64, e_max: f64) -> f64
macarthur_wilson_equilibrium(i_max: f64, e_max: f64, p: f64) -> f64
macarthur_wilson_turnover(i_max: f64, e_max: f64, p: f64) -> f64
distance_decay(similarity_0: f64, decay_rate: f64, distance: f64) -> f64
rescue_effect(extinction_base: f64, immigration: f64) -> f64
target_effect(immigration_base: f64, area: f64, area_ref: f64) -> f64
species_isolation_index`(distances: &[f64]) -> f64`
area_effect_on_extinction(e_base: f64, area: f64, z: f64) -> f64
habitat_diversity(area: f64, k: f64) -> f64

bioinformatics API (51 functions)

FunctionSignature
smith_waterman_score`( seq1: &[u8], seq2: &[u8], match_score: i32, mismatch: i32, gap: i32, ) -> i32`
needleman_wunsch_score`( seq1: &[u8], seq2: &[u8], match_score: i32, mismatch: i32, gap: i32, ) -> i32`
edit_distance`(seq1: &[u8], seq2: &[u8]) -> usize`
hamming_distance`(seq1: &[u8], seq2: &[u8]) -> usize`
alignment_gc_content`(seq: &[u8]) -> f64`
sequence_identity`(seq1: &[u8], seq2: &[u8]) -> f64`
codon_frequency`(seq: &[u8]) -> Vec<(u32, usize)>`
reverse_complement`(seq: &[u8]) -> Vec<u8>`
melting_temperature_basic( a_count: usize, t_count: usize, g_count: usize, c_count: usize, ) -> f64
assembly_n50`(contig_lengths: &[usize]) -> usize`
n_metric`(contig_lengths: &[usize], fraction: f64) -> usize`
l50`(contig_lengths: &[usize]) -> usize`
genome_coverage(total_bases_sequenced: usize, genome_size: usize) -> f64
lander_waterman(coverage: f64) -> f64
expected_contigs( n_reads: usize, read_length: usize, genome_size: usize, overlap: usize, ) -> f64
assembly_completeness(aligned_bases: usize, reference_size: usize) -> f64
gc_content_reads`(reads: &[&[u8]]) -> f64`
ng50`(contig_lengths: &[usize], genome_size: usize) -> usize`
aunga`(contig_lengths: &[usize], genome_size: usize) -> f64`
misassembly_rate(misassemblies: usize, total_contigs: usize) -> f64
chimeric_contig_fraction(chimeric: usize, total: usize) -> f64
contig_size_distribution`(contig_lengths: &[usize]) -> (f64, f64, usize, usize)`
expected_gap_count(coverage: f64, genome_size: usize, read_length: usize) -> f64
principal_component_variance`(eigenvalues: &[f64], component: usize) -> f64`
manhattan_distance_features`(a: &[f64], b: &[f64]) -> f64`
euclidean_distance_features`(a: &[f64], b: &[f64]) -> f64`
pearson_correlation`(x: &[f64], y: &[f64]) -> f64`
fold_change(treatment: f64, control: f64) -> f64
log2_fold_change(treatment: f64, control: f64) -> f64
rpkm(read_count: f64, gene_length_kb: f64, total_reads_millions: f64) -> f64
tpm(read_count: f64, gene_length_kb: f64, sum_rpk: f64) -> f64
fpkm(fragment_count: f64, gene_length_kb: f64, total_fragments_millions: f64) -> f64
deseq2_size_factor`(counts: &[f64], geometric_means: &[f64]) -> f64`
benjamini_hochberg`(p_values: &mut [(usize, f64)]) -> Vec<(usize, f64)>`
volcano_significant(log2fc: f64, p_value: f64, fc_threshold: f64, p_threshold: f64) -> bool
phred_to_probability(phred: f64) -> f64
probability_to_phred(p: f64) -> f64
average_quality`(qualities: &[u8]) -> f64`
quality_filter`(qualities: &[u8], min_quality: u8, window: usize, min_fraction: f64) -> bool`
expected_errors`(qualities: &[u8]) -> f64`
trim_quality`(qualities: &[u8], min_quality: u8) -> usize`
n50`(lengths: &[usize]) -> usize`
gc_content`(sequence: &[u8]) -> f64`
adapter_match_score`(read: &[u8], adapter: &[u8]) -> usize`
complexity_dust`(sequence: &[u8], window: usize) -> f64`
kmer_frequency`(sequence: &[u8], k: usize) -> Vec<(Vec<u8>, usize)>`
shannon_entropy_sequence`(sequence: &[u8]) -> f64`
sliding_window_quality`(qualities: &[u8], window: usize) -> Vec<f64>`
per_base_quality_distribution`(quality_matrix: &[Vec<u8>]) -> Vec<(f64, f64)>`
duplication_rate(total_reads: usize, unique_reads: usize) -> f64
chimera_breakpoint_score(alignment_a: usize, alignment_b: usize, read_length: usize) -> f64

biomechanics API (67 functions)

FunctionSignature
poiseuille_flow(delta_p: f64, radius: f64, length: f64, viscosity: f64) -> f64
wall_shear_stress(flow_rate: f64, radius: f64, viscosity: f64) -> f64
reynolds_number(density: f64, velocity: f64, diameter: f64, viscosity: f64) -> f64
murrays_law_radius(parent_radius: f64, n_children: usize) -> f64
windkessel_2element( p0: f64, r: f64, c: f64, flow: impl Fn(f64) -> f64, dt: f64, steps: usize, ) -> Vec<f64>
pulse_wave_velocity( elastic_modulus: f64, wall_thickness: f64, radius: f64, density: f64, ) -> f64
casson_viscosity(tau_y: f64, eta_inf: f64, shear_rate: f64) -> f64
oxygen_dissociation_hill(po2: f64, p50: f64, n: f64) -> f64
cardiac_output(stroke_volume: f64, heart_rate: f64) -> f64
mean_arterial_pressure(systolic: f64, diastolic: f64) -> f64
total_peripheral_resistance(map: f64, cvp: f64, cardiac_output: f64) -> f64
womersley_number(radius: f64, angular_freq: f64, kinematic_viscosity: f64) -> f64
fahraeus_lindqvist(viscosity_plasma: f64, hematocrit: f64, diameter_um: f64) -> f64
compliance(delta_v: f64, delta_p: f64) -> f64
laplace_law_sphere(pressure: f64, radius: f64, wall_thickness: f64) -> f64
laplace_law_cylinder(pressure: f64, radius: f64, wall_thickness: f64) -> f64
bernoulli_velocity(delta_p: f64, density: f64) -> f64
systemic_vascular_resistance(map: f64, rap: f64, co: f64) -> f64
ejection_fraction(edv: f64, esv: f64) -> f64
gait_stride_length(velocity: f64, cadence: f64) -> f64
ground_reaction_force(mass: f64, acceleration: f64) -> f64
joint_moment(force: f64, moment_arm: f64) -> f64
joint_power(moment: f64, angular_velocity: f64) -> f64
center_of_pressure`(forces: &[(f64, f64, f64)], positions: &[(f64, f64)]) -> (f64, f64)`
inverse_dynamics_moment( i_segment: f64, alpha: f64, proximal_force: f64, proximal_arm: f64, distal_force: f64, distal_arm: f64, ) -> f64
metabolic_cost_of_transport(metabolic_rate: f64, mass: f64, velocity: f64) -> f64
froude_number(velocity: f64, leg_length: f64) -> f64
dynamic_stability_margin`(base_of_support: &[(f64, f64)], com: (f64, f64)) -> f64`
work_loop_area`(force: &[f64], length: &[f64]) -> f64`
pendulum_energy_recovery(ek_change: f64, ep_change: f64) -> f64
new(f_max: f64, l_opt: f64, v_max: f64) -> Self
force_length(&self, length: f64) -> f64
force_velocity(&self, velocity: f64) -> f64
total_force(&self, length: f64, velocity: f64) -> f64
cross_bridge_huxley(x: f64, f_rate: f64, g_rate: f64, dt: f64, n: f64) -> f64
pennation_angle_force(f_tendon: f64, angle_rad: f64) -> f64
joint_torque(force: f64, moment_arm: f64) -> f64
angular_impulse(torque: f64, dt: f64) -> f64
muscle_power(force: f64, velocity: f64) -> f64
work(force: f64, displacement: f64) -> f64
tendon_force(stiffness: f64, strain: f64) -> f64
excitation_contraction_coupling(calcium: f64, k_half: f64, n: f64) -> f64
fatigue_model(force_max: f64, time: f64, fatigue_rate: f64) -> f64
muscle_stiffness(force: f64, length: f64, l_opt: f64) -> f64
isometric_twitch(f_max: f64, t: f64, tp: f64) -> f64
tetanus_fusion(f_twitch: f64, frequency: f64, fusion_freq: f64) -> f64
muscle_metabolic_rate(force: f64, velocity: f64, activation: f64, basal: f64) -> f64
fiber_type_recruitment( excitation: f64, threshold_slow: f64, threshold_fast: f64, ) -> (f64, f64)
sarcomere_force_length(sl: f64) -> f64
linear_elastic_stress(modulus: f64, strain: f64) -> f64
kelvin_voigt(modulus: f64, viscosity: f64, strain: f64, strain_rate: f64) -> f64
maxwell_stress_relaxation(sigma0: f64, modulus: f64, viscosity: f64, t: f64) -> f64
standard_linear_solid( e1: f64, e2: f64, eta: f64, strain: f64, strain_rate: f64, stress: f64, ) -> f64
hyperelastic_neo_hookean(c1: f64, lambda: f64) -> f64
mooney_rivlin(c1: f64, c2: f64, lambda: f64) -> f64
poroelastic_consolidation( stress: f64, modulus: f64, permeability: f64, viscosity: f64, thickness: f64, t: f64, ) -> f64
strain_energy_density_linear(modulus: f64, strain: f64) -> f64
creep_power_law(a: f64, sigma: f64, n: f64, t: f64) -> f64
bone_density_wolff( rho0: f64, stimulus: f64, reference_stimulus: f64, rate: f64, dt: f64, ) -> f64
ogden_model(mu: f64, alpha: f64, lambda: f64) -> f64
fracture_toughness(force: f64, crack_length: f64, width: f64, thickness: f64) -> f64
viscoelastic_prony`(moduli: &[f64], taus: &[f64], t: f64) -> f64`
tissue_hydration_swelling(phi_0: f64, pi_ext: f64, bulk_modulus: f64) -> f64
biphasic_permeability(k0: f64, strain: f64, m: f64) -> f64
stress_fiber_remodeling(sigma_old: f64, reference: f64, rate: f64, dt: f64) -> f64
damage_accumulation(d: f64, stress: f64, threshold: f64, rate: f64, dt: f64) -> f64
elastic_modulus_density(rho: f64, c: f64, exponent: f64) -> f64

biophysics API (79 functions)

FunctionSignature
membrane_bending_energy(kappa: f64, curvature: f64, spontaneous_curvature: f64) -> f64
helfrich_energy(kappa: f64, kappa_bar: f64, c1: f64, c2: f64, c0: f64) -> f64
membrane_tension(area_strain: f64, stretch_modulus: f64) -> f64
lipid_diffusion_saffman_delbruck( viscosity_membrane: f64, viscosity_water: f64, membrane_thickness: f64, radius: f64, t: f64, ) -> f64
osmotic_lysis_threshold( internal_osmolarity: f64, membrane_tension_max: f64, radius: f64, ) -> f64
vesicle_budding_energy(kappa: f64, radius: f64) -> f64
flip_flop_rate(activation_energy: f64, t: f64) -> f64
lateral_pressure_profile( depth: f64, head_pressure: f64, tail_pressure: f64, thickness: f64, ) -> f64
line_tension_domain(length: f64, lambda: f64) -> f64
lennard_jones(r: f64, epsilon: f64, sigma: f64) -> f64
lennard_jones_force(r: f64, epsilon: f64, sigma: f64) -> f64
coulomb_interaction(q1: f64, q2: f64, r: f64, epsilon_r: f64) -> f64
debye_huckel(q: f64, r: f64, kappa: f64, epsilon_r: f64) -> f64
verlet_step`( positions: &mut [f64], velocities: &mut [f64], forces: &[f64], masses: &[f64], dt: f64, )`
kinetic_energy`(velocities: &[f64], masses: &[f64]) -> f64`
temperature_from_ke(ke: f64, n_particles: usize, n_dim: usize) -> f64
morse_potential(r: f64, d_e: f64, a: f64, r_e: f64) -> f64
harmonic_bond(r: f64, k: f64, r0: f64) -> f64
harmonic_angle(theta: f64, k: f64, theta0: f64) -> f64
dihedral_potential(phi: f64, k: f64, n: f64, delta: f64) -> f64
velocity_verlet_step`( positions: &mut [f64], velocities: &mut [f64], forces_old: &[f64], forces_new: &[f64], masses: &[f64], dt: f64, )`
berendsen_thermostat`( velocities: &mut [f64], current_temp: f64, target_temp: f64, tau: f64, dt: f64, )`
nose_hoover_friction(ke: f64, target_ke: f64, q: f64) -> f64
switching_function(r: f64, r_on: f64, r_off: f64) -> f64
pair_correlation_bin`( distances: &[f64], r_min: f64, r_max: f64, n_particles: usize, volume: f64, ) -> f64`
pressure_virial(n: usize, volume: f64, temperature: f64, virial_sum: f64) -> f64
mean_free_path(density: f64, cross_section: f64) -> f64
born_mayer_repulsion(a: f64, b: f64, r: f64) -> f64
buckingham_potential(a: f64, b: f64, c: f64, r: f64) -> f64
worm_like_chain(l: f64, lp: f64, lc: f64) -> f64
freely_jointed_chain(l: f64, n: usize, b: f64) -> f64
end_to_end_distance_rms(n: usize, b: f64) -> f64
radius_of_gyration(n: usize, b: f64) -> f64
persistence_length_from_tangent(cos_theta: f64, segment_length: f64) -> f64
kratky_porod_energy(kappa: f64, ds: f64, curvature: f64) -> f64
dna_twist_energy(c_twist: f64, delta_twist: f64, length: f64) -> f64
stokes_einstein_diffusion(t: f64, viscosity: f64, radius: f64) -> f64
mean_squared_displacement(d: f64, t: f64, n_dim: usize) -> f64
sedimentation_coefficient( mass: f64, partial_specific_vol: f64, rho_solvent: f64, friction: f64, ) -> f64
flory_radius(n: usize, b: f64, nu: f64) -> f64
kuhn_length(persistence_length: f64) -> f64
contour_length(n: usize, b: f64) -> f64
extensible_wlc(force: f64, lp: f64, lc: f64, stretch_modulus: f64, t: f64) -> f64
odijk_deflection_length(lp: f64, d: f64) -> f64
blob_size(kbt: f64, force: f64) -> f64
zimm_relaxation_time(viscosity: f64, rg: f64, kbt: f64) -> f64
rouse_relaxation_time(friction: f64, n: usize, b: f64, kbt: f64) -> f64
intrinsic_viscosity(rg: f64, mw: f64) -> f64
overlap_concentration(mw: f64, rg: f64) -> f64
debye_scattering(q: f64, rg: f64) -> f64
ramachandran_energy(phi: f64, psi: f64) -> f64
hydrophobic_free_energy(sasa_nonpolar: f64, gamma: f64) -> f64
hydrogen_bond_energy(r: f64, theta: f64, epsilon: f64, r0: f64) -> f64
electrostatic_solvation(charge: f64, radius: f64, epsilon_solvent: f64) -> f64
fold_stability(delta_h: f64, delta_s: f64, delta_cp: f64, t: f64, t_ref: f64) -> f64
fraction_folded(delta_g: f64, t: f64) -> f64
two_state_folding_rate(k0: f64, delta_g_dagger: f64, t: f64) -> f64
zimm_bragg_helix_coil(s: f64, sigma: f64, n: usize) -> f64
contact_order`(contacts: &[(usize, usize)], chain_length: usize) -> f64`
phi_value( delta_g_mut_folding: f64, delta_g_wt_folding: f64, delta_g_mut_ts: f64, delta_g_wt_ts: f64, ) -> f64
kauzmann_hydrophobic(delta_cp: f64, t: f64, t_s: f64, t_h: f64, delta_h_h: f64) -> f64
go_model_energy`( contacts: &[(usize, usize)], distances: &[f64], native_distances: &[f64], epsilon: f64, ) -> f64`
native_contact_fraction`( current_distances: &[f64], native_distances: &[f64], cutoff: f64, ) -> f64`
radius_of_gyration_3d`(coords: &[(f64, f64, f64)]) -> f64`
denaturation_midpoint(delta_h: f64, delta_s: f64) -> f64
chevron_plot_folding(k_f_water: f64, m_f: f64, denaturant: f64) -> f64
chevron_plot_unfolding(k_u_water: f64, m_u: f64, denaturant: f64) -> f64
optical_trap_force(laser_power: f64, n_medium: f64, trap_efficiency: f64) -> f64
fret_efficiency(r: f64, r0: f64) -> f64
fret_distance(efficiency: f64, r0: f64) -> f64
fluorescence_lifetime(quantum_yield: f64, radiative_rate: f64) -> f64
photobleaching_rate(intensity: f64, cross_section: f64, quantum_yield_bleach: f64) -> f64
fluorescence_recovery_half_time(beam_radius: f64, diffusion_coeff: f64) -> f64
single_molecule_diffusion_msd(d: f64, t: f64, localization_error: f64) -> f64
afm_cantilever_force(spring_constant: f64, deflection: f64) -> f64
hertz_contact_indentation( force: f64, radius: f64, youngs_modulus: f64, poisson: f64, ) -> f64
micropipette_aspiration_tension(pressure: f64, pipette_radius: f64) -> f64
youngs_modulus_from_hertz( force: f64, indentation: f64, tip_radius: f64, poisson: f64, ) -> f64
traction_force(displacement: f64, substrate_stiffness: f64) -> f64

biostatistics API (67 functions)

FunctionSignature
odds_ratio(a: usize, b: usize, c: usize, d: usize) -> f64
relative_risk(a: usize, b: usize, c: usize, d: usize) -> f64
absolute_risk_reduction(risk_control: f64, risk_treatment: f64) -> f64
number_needed_to_treat(arr: f64) -> f64
sensitivity(tp: usize, fn_count: usize) -> f64
specificity(tn: usize, fp: usize) -> f64
positive_predictive_value(tp: usize, fp: usize) -> f64
negative_predictive_value(tn: usize, fn_count: usize) -> f64
f1_score(tp: usize, fp: usize, fn_count: usize) -> f64
roc_auc`(scores: &[(f64, bool)]) -> f64`
cohens_kappa(observed_agreement: f64, expected_agreement: f64) -> f64
likelihood_ratio_positive(sensitivity: f64, specificity: f64) -> f64
likelihood_ratio_negative(sensitivity: f64, specificity: f64) -> f64
diagnostic_odds_ratio(tp: usize, fp: usize, fn_count: usize, tn: usize) -> f64
youden_index(sensitivity: f64, specificity: f64) -> f64
matthews_correlation_coefficient(tp: usize, tn: usize, fp: usize, fn_count: usize) -> f64
prevalence_adjusted_ppv(sensitivity: f64, specificity: f64, prevalence: f64) -> f64
sample_size_two_proportions(p1: f64, p2: f64, alpha_z: f64, power_z: f64) -> f64
confidence_interval_proportion(p: f64, n: usize, z: f64) -> (f64, f64)
attributable_risk(risk_exposed: f64, risk_unexposed: f64) -> f64
population_attributable_fraction( risk_exposed: f64, risk_unexposed: f64, prevalence_exposure: f64, ) -> f64
meta_analysis_fixed_effect`(effects: &[f64], variances: &[f64]) -> (f64, f64)`
cochran_q`(effects: &[f64], variances: &[f64]) -> f64`
i_squared(q: f64, k: usize) -> f64
tau_squared_dsl`(q: f64, k: usize, variances: &[f64]) -> f64`
meta_analysis_random_effects`(effects: &[f64], variances: &[f64], tau2: f64) -> (f64, f64)`
funnel_plot_asymmetry`(effects: &[f64], se: &[f64]) -> f64`
trim_and_fill`(effects: &[f64]) -> (f64, usize)`
fail_safe_n`(effects: &[f64], variances: &[f64], alpha_z: f64) -> f64`
prediction_interval(pooled: f64, tau2: f64, se_pooled: f64, k: usize) -> (f64, f64)
egger_regression`(effects: &[f64], se: &[f64]) -> (f64, f64)`
cumulative_meta_analysis`(effects: &[f64], variances: &[f64]) -> Vec<(f64, f64)>`
influence_analysis`(effects: &[f64], variances: &[f64]) -> Vec<f64>`
h_squared(q: f64, k: usize) -> f64
meta_regression_slope`(effects: &[f64], variances: &[f64], covariate: &[f64]) -> f64`
simple_linear_regression`(x: &[f64], y: &[f64]) -> (f64, f64)`
r_squared`(y: &[f64], y_pred: &[f64]) -> f64`
logistic_regression_probability`(beta: &[f64], x: &[f64]) -> f64`
aic(log_likelihood: f64, k: usize) -> f64
bic(log_likelihood: f64, k: usize, n: usize) -> f64
residual_standard_error`(residuals: &[f64], p: usize) -> f64`
chi_squared_statistic`(observed: &[f64], expected: &[f64]) -> f64`
welch_t_statistic(m1: f64, m2: f64, s1: f64, s2: f64, n1: usize, n2: usize) -> f64
mann_whitney_u`(ranks_group1: &[f64], n1: usize, n2: usize) -> f64`
bonferroni_correction(p_value: f64, n_tests: usize) -> f64
fishers_exact_test_odds(a: usize, b: usize, c: usize, d: usize) -> f64
spearman_rank_correlation`(rank_x: &[f64], rank_y: &[f64]) -> f64`
power_analysis_two_sample(effect_size: f64, alpha_z: f64, power_z: f64) -> f64
kaplan_meier`(times: &[f64], events: &[bool]) -> Vec<(f64, f64)>`
log_rank_statistic`( times1: &[f64], events1: &[bool], times2: &[f64], events2: &[bool], ) -> f64`
hazard_ratio( events_treatment: usize, time_treatment: f64, events_control: usize, time_control: f64, ) -> f64
median_survival`(curve: &[(f64, f64)]) -> f64`
nelson_aalen`(times: &[f64], events: &[bool]) -> Vec<(f64, f64)>`
exponential_survival(lambda: f64, t: f64) -> f64
weibull_survival(lambda: f64, k: f64, t: f64) -> f64
restricted_mean_survival_time`(curve: &[(f64, f64)], t_max: f64) -> f64`
greenwood_variance`(curve: &[(f64, f64)], at_risk: &[usize], events: &[usize]) -> Vec<f64>`
cumulative_incidence`(times: &[f64], events: &[bool], competing: &[bool]) -> Vec<(f64, f64)>`
life_table`( age_groups: &[(f64, f64)], deaths: &[f64], population: &[f64], ) -> Vec<(f64, f64, f64)>`
log_logistic_survival(alpha: f64, beta: f64, t: f64) -> f64
gompertz_survival(alpha: f64, beta: f64, t: f64) -> f64
cox_partial_likelihood_contribution(beta_x: f64, risk_set_sum: f64) -> f64
breslow_cumulative_hazard`(event_times: &[f64], risk_set_sums: &[f64]) -> Vec<(f64, f64)>`
survival_from_hazard(cumulative_hazard: f64) -> f64
conditional_survival(s_t: f64, s_t_plus_x: f64) -> f64
cure_fraction_model(cure_rate: f64, lambda: f64, t: f64) -> f64
aalen_johansen`(times: &[f64], events: &[u8], n_causes: usize) -> Vec<Vec<(f64, f64)>>`

cancer_biology API (65 functions)

FunctionSignature
tumor_immune_ode( tumor: f64, immune: f64, growth_rate: f64, carrying_capacity: f64, kill_rate: f64, stimulation: f64, decay_rate: f64, ) -> (f64, f64)
tumor_immune_simulate( tumor0: f64, immune0: f64, growth_rate: f64, carrying_capacity: f64, kill_rate: f64, stimulation: f64, decay_rate: f64, dt: f64, steps: usize, ) -> Vec<(f64, f64)>
immunoediting_escape( immunogenic_clones: f64, escape_mutation_rate: f64, immune_pressure: f64, ) -> f64
checkpoint_blockade_effect( baseline_kill: f64, pd1_inhibition: f64, ctla4_inhibition: f64, ) -> f64
car_t_cell_expansion( initial_cells: f64, antigen_density: f64, expansion_rate: f64, t: f64, ) -> f64
cytokine_release_syndrome( activated_cells: f64, cytokine_per_cell: f64, clearance_rate: f64, t: f64, ) -> f64
tumor_neoantigen_fitness( binding_affinity: f64, expression_level: f64, clonality: f64, ) -> f64
abscopal_effect( local_dose: f64, immune_activation: f64, distant_tumor: f64, sensitivity: f64, ) -> f64
tumor_angiogenesis_vegf(vegf: f64, endothelial_proliferation_rate: f64, kd: f64) -> f64
vessel_density( new_vessels: f64, existing_vessels: f64, regression_rate: f64, dt: f64, ) -> f64
oxygen_diffusion_krogh( p_vessel: f64, consumption_rate: f64, diffusion_coeff: f64, r: f64, r_vessel: f64, ) -> f64
hypoxia_fraction`(distances: &[f64], diffusion_limit: f64) -> f64`
microenvironment_tmb(mutations: usize, megabases_sequenced: f64) -> f64
clonal_fitness_advantage`(clone_sizes: &[f64], fitness_values: &[f64]) -> f64`
tumor_heterogeneity_shannon`(clone_fractions: &[f64]) -> f64`
metastatic_probability( invasion_rate: f64, survival_fraction: f64, colonization_rate: f64, time: f64, ) -> f64
emt_score`(epithelial_markers: &[f64], mesenchymal_markers: &[f64]) -> f64`
immune_escape_probability(mhc_expression: f64, pd_l1: f64, neoantigen_load: f64) -> f64
csc_fraction( symmetric_division_rate: f64, asymmetric_rate: f64, differentiation_rate: f64, ) -> f64
pharmacokinetic_tumor_exposure( dose: f64, bioavailability: f64, volume_distribution: f64, tumor_perfusion_fraction: f64, ) -> f64
cell_kill_log(initial: f64, surviving_fraction: f64, cycles: u32) -> f64
skipper_schabel_log_kill(n: f64, dose: f64, sensitivity: f64) -> f64
drug_resistance_goldie_coldman(n: f64, mutation_rate: f64) -> f64
combination_therapy_survival(sf_a: f64, sf_b: f64, interaction: f64) -> f64
tumor_immune_interaction( tumor: f64, immune: f64, growth_rate: f64, kill_rate: f64, stimulation: f64, decay: f64, k: f64, ) -> (f64, f64)
hallmarks_proliferation_index(mitotic_count: f64, area: f64) -> f64
cancer_stem_cell_fraction( symmetric_division_rate: f64, asymmetric_division_rate: f64, differentiation_rate: f64, ) -> f64
linear_quadratic_survival(dose: f64, alpha: f64, beta: f64) -> f64
biologically_effective_dose(dose: f64, fractions: f64, alpha_beta: f64) -> f64
equivalent_dose_2gy(dose: f64, dose_per_fraction: f64, alpha_beta: f64) -> f64
tumor_control_probability(n_cells: f64, surviving_fraction: f64) -> f64
normal_tissue_complication_probability(dose: f64, td50: f64, gamma50: f64) -> f64
therapeutic_ratio(tcp: f64, ntcp: f64) -> f64
immunotherapy_checkpoint_response( tumor: f64, t_cells: f64, activation_rate: f64, exhaustion_rate: f64, checkpoint_blockade: f64, ) -> f64
car_t_expansion( initial_cells: f64, antigen_stimulation: f64, expansion_rate: f64, t: f64, ) -> f64
antibody_drug_conjugate_kill( antibody_conc: f64, target_density: f64, internalization_rate: f64, drug_potency: f64, kd: f64, ) -> f64
metronomic_antiangiogenic_effect(dose: f64, frequency: f64, sensitivity: f64) -> f64
fractionation_schedule_bde( n_fractions: u32, dose_per_fraction: f64, alpha_beta: f64, ) -> f64
cell_cycle_specific_kill(drug_conc: f64, phase_fraction: f64, sensitivity: f64) -> f64
combination_index_chou_talalay( fa: f64, dose_a: f64, dose_b: f64, dm_a: f64, dm_b: f64, m_a: f64, m_b: f64, ) -> f64
radiation_oxygen_enhancement_ratio(dose_hypoxic: f64, dose_aerobic: f64) -> f64
hyperthermia_enhancement(dose: f64, thermal_enhancement_ratio: f64) -> f64
tumor_growth_gompertz(n: f64, n_max: f64, alpha: f64, dt: f64) -> f64
tumor_growth_logistic(n: f64, k: f64, r: f64, dt: f64) -> f64
tumor_doubling_time(growth_rate: f64) -> f64
clonal_evolution_fitness`( clone_sizes: &[f64], fitness: &[f64], mutation_rate: f64, ) -> Vec<f64>`
metastasis_probability( tumor_size: f64, shedding_rate: f64, survival_fraction: f64, colonization_rate: f64, ) -> f64
tumor_angiogenesis_rate( tumor_size: f64, vegf_production: f64, inhibitor: f64, threshold: f64, ) -> f64
norton_simon_regression(n: f64, kill_fraction: f64, gompertz_rate: f64, n_max: f64) -> f64
tumor_growth_exponential(n0: f64, rate: f64, t: f64) -> f64
tumor_growth_von_bertalanffy(n: f64, a: f64, b: f64, dt: f64) -> f64
tumor_volume_spherical(diameter: f64) -> f64
tumor_volume_ellipsoid(length: f64, width: f64, height: f64) -> f64
recist_response(baseline_diameter: f64, current_diameter: f64) -> f64
tumor_mutation_burden(somatic_mutations: f64, exome_size_mb: f64) -> f64
heterogeneity_shannon`(clone_fractions: &[f64]) -> f64`
circulating_tumor_cells(shedding: f64, tumor_size: f64, half_life: f64) -> f64
warburg_glycolysis_rate( glucose: f64, vmax: f64, km: f64, oxygen_inhibition: f64, oxygen: f64, ) -> f64
hypoxia_inducible_factor(po2: f64, km_o2: f64, max_expression: f64) -> f64
necrotic_core_radius(tumor_radius: f64, diffusion_length: f64) -> f64
viable_rim_fraction(tumor_radius: f64, necrotic_radius: f64) -> f64
ctc_cluster_survival(single_ctc_survival: f64, cluster_size: u32) -> f64
invasion_index(invaded_distance: f64, time: f64) -> f64
epithelial_mesenchymal_transition(tgf_beta: f64, threshold: f64, hill: f64) -> f64
microsatellite_instability_score(unstable_markers: u32, total_markers: u32) -> f64

cell API (78 functions)

FunctionSignature
cell_adhesion_energy(contact_area: f64, cadherin_density: f64, bond_energy: f64) -> f64
integrin_focal_adhesion_force(integrin_count: f64, force_per_integrin: f64) -> f64
adhesion_receptor_binding(ligand: f64, receptor: f64, kd: f64) -> f64
cell_cell_junction_strength( tight_junction: f64, adherens_junction: f64, desmosome: f64, ) -> f64
chemotaxis_velocity(gradient: f64, sensitivity: f64, max_speed: f64) -> f64
haptotaxis_velocity(ecm_gradient: f64, adhesion_strength: f64, drag: f64) -> f64
durotaxis_force(stiffness_gradient: f64, cell_contractility: f64) -> f64
collective_migration_speed(leader_speed: f64, follower_count: usize, coupling: f64) -> f64
wound_healing_rate(gap_width: f64, migration_speed: f64, proliferation_rate: f64) -> f64
ecm_remodeling_rate(mmp_activity: f64, timp_activity: f64, substrate: f64) -> f64
cell_spreading_area(adhesion_strength: f64, cortical_tension: f64) -> f64
catch_bond_lifetime(force: f64, k0: f64, x1: f64, x2: f64) -> f64
cell_cycle_ode( cyclin: f64, cdk: f64, apc: f64, k_syn: f64, k_deg: f64, k_act: f64, k_inact: f64, ) -> (f64, f64, f64)
cell_cycle_simulate( cyclin0: f64, cdk0: f64, apc0: f64, k_syn: f64, k_deg: f64, k_act: f64, k_inact: f64, dt: f64, steps: usize, ) -> Vec<(f64, f64, f64)>
mitotic_index(dividing_cells: usize, total_cells: usize) -> f64
cell_growth_logistic(n: f64, r: f64, k: f64, dt: f64, steps: usize) -> Vec<f64>
g1_checkpoint(dna_damage: f64, p53_threshold: f64, rb_active: f64) -> bool
g2_checkpoint(dna_damage: f64, repair_capacity: f64, cdk1_activity: f64) -> bool
spindle_assembly_checkpoint(unattached_kinetochores: usize) -> bool
apoptosis_probability(dna_damage: f64, p53: f64, bcl2: f64, bax: f64) -> f64
cell_doubling_time(growth_rate: f64) -> f64
contact_inhibition(density: f64, max_density: f64, steepness: f64) -> f64
phase_duration( total_cycle_time: f64, g1_fraction: f64, s_fraction: f64, g2_fraction: f64, ) -> (f64, f64, f64, f64)
dna_damage_accumulation( damage: f64, production_rate: f64, repair_rate: f64, dt: f64, ) -> f64
restriction_point(growth_factor: f64, threshold: f64, rb_phosphorylation: f64) -> bool
cyclin_oscillator(cyclin: f64, cdk: f64, k_syn: f64, k_deg: f64) -> f64
cell_senescence_probability( telomere_length: f64, critical_length: f64, dna_damage: f64, ) -> f64
proliferation_index(s_phase: usize, g2m_phase: usize, total: usize) -> f64
growth_fraction(proliferating: usize, total: usize) -> f64
cell_loss_factor(growth_rate: f64, doubling_time: f64) -> f64
hayflick_limit(initial_telomere: f64, loss_per_division: f64, critical: f64) -> f64
quiescence_entry( growth_factor: f64, nutrient: f64, gf_threshold: f64, nutrient_threshold: f64, ) -> bool
autophagy_flux(lc3_ii: f64, p62: f64, bafilomycin_effect: f64) -> f64
proteasome_degradation_rate(ubiquitin_tags: f64, proteasome_activity: f64, km: f64) -> f64
lysosome_ph(v_atpase_rate: f64, proton_leak: f64, buffer_capacity: f64, volume: f64) -> f64
endosome_maturation(rab5: f64, rab7: f64, conversion_rate: f64, dt: f64) -> (f64, f64)
receptor_recycling(internalized: f64, recycling_rate: f64, degradation_rate: f64) -> f64
mitochondrial_fission_rate(drp1: f64, fis1: f64, threshold: f64) -> f64
mitochondrial_fusion_rate(mfn1: f64, mfn2: f64, opa1: f64) -> f64
er_stress_upr(misfolded: f64, bip: f64, ire1_threshold: f64) -> f64
golgi_transport_rate(cargo: f64, coat_protein: f64, gtp: f64, km_coat: f64) -> f64
peroxisome_beta_oxidation(vlcfa: f64, enzyme_activity: f64, km: f64) -> f64
cytoskeleton_treadmilling(polymerization_rate: f64, depolymerization_rate: f64) -> f64
nuclear_import_rate(cargo: f64, importin: f64, ran_gtp: f64, kd: f64) -> f64
cell_volume_regulation( volume: f64, target_volume: f64, permeability: f64, osmotic_difference: f64, ) -> f64
ligand_receptor_binding(l: f64, r_total: f64, kd: f64) -> f64
hill_response(signal: f64, k: f64, n: f64) -> f64
bistable_switch(x: f64, k1: f64, k2: f64, n: f64, alpha: f64, beta: f64) -> f64
bistable_simulate( x0: f64, k1: f64, k2: f64, n: f64, alpha: f64, beta: f64, dt: f64, steps: usize, ) -> Vec<f64>
mapk_cascade`( raf: f64, mek: f64, erk: f64, signal: f64, k_activate: &[f64; 3], k_deactivate: &[f64; 3], ) -> (f64, f64, f64)`
mapk_simulate`( raf0: f64, mek0: f64, erk0: f64, signal: f64, k_activate: &[f64; 3], k_deactivate: &[f64; 3], dt: f64, steps: usize, ) -> Vec<(f64, f64, f64)>`
goldbeter_koshland(v1: f64, v2: f64, j1: f64, j2: f64) -> f64
negative_feedback(output: f64, k_prod: f64, k_deg: f64, k_inh: f64, n: f64) -> f64
positive_feedback(x: f64, basal: f64, vmax: f64, k: f64, n: f64, deg: f64) -> f64
receptor_desensitization( active: f64, ligand: f64, kd: f64, k_intern: f64, k_recycle: f64, total: f64, ) -> f64
dual_phosphorylation(x: f64, kinase: f64, phosphatase: f64, k1: f64, k2: f64) -> f64
coherent_feedforward( signal: f64, x: f64, k_sx: f64, k_xy: f64, k_sy: f64, threshold: f64, ) -> f64
incoherent_feedforward(signal: f64, x: f64, k_activation: f64, k_repression: f64) -> f64
michaelis_menten_cascade(substrate: f64, enzyme: f64, km: f64, vmax: f64) -> f64
scaffold_complex_formation(a: f64, b: f64, scaffold: f64, ka: f64, kb: f64) -> f64
crosstalk_inhibition( pathway_a: f64, pathway_b: f64, k_inh_ab: f64, k_inh_ba: f64, ) -> (f64, f64)
fick_first_law(d: f64, dc_dx: f64) -> f64
fick_second_law_1d`(conc: &mut [f64], d: f64, dx: f64, dt: f64, steps: usize)`
nernst_potential(z: f64, t: f64, c_out: f64, c_in: f64) -> f64
goldman_equation( p_na: f64, p_k: f64, p_cl: f64, na_out: f64, na_in: f64, k_out: f64, k_in: f64, cl_out: f64, cl_in: f64, t: f64, ) -> f64
osmotic_pressure(c: f64, t: f64) -> f64
donnan_ratio(z_ion: f64, z_macro: f64, c_macro: f64, c_salt: f64) -> f64
active_transport_rate(vmax: f64, substrate: f64, km: f64, atp: f64, km_atp: f64) -> f64
membrane_capacitance_current(cm: f64, dv_dt: f64) -> f64
electrochemical_gradient(z: f64, vm: f64, equilibrium_potential: f64) -> f64
vesicle_fusion_rate(calcium: f64, kd: f64, n: f64, k_max: f64) -> f64
endocytosis_rate( receptor_bound: f64, k_intern: f64, coat_protein: f64, kd_coat: f64, ) -> f64
exocytosis_rate(vesicles: f64, calcium: f64, kd: f64) -> f64
gap_junction_flux(c1: f64, c2: f64, permeability: f64) -> f64
facilitated_diffusion(c_out: f64, c_in: f64, vmax: f64, km: f64) -> f64
cotransport_rate(substrate: f64, ion: f64, vmax: f64, km_s: f64, km_i: f64) -> f64
pinocytosis_uptake(volume_rate: f64, concentration: f64) -> f64
ion_channel_conductance(g_max: f64, open_probability: f64, driving_force: f64) -> f64

chronobiology API (49 functions)

FunctionSignature
zeitgeber_strength(light_intensity: f64, threshold: f64, saturation: f64) -> f64
phase_response_curve(phase: f64, light_pulse_phase: f64, sensitivity: f64) -> f64
jet_lag_recovery(timezone_shift: f64, adaptation_rate: f64, days: f64) -> f64
shift_work_desynchrony(internal_phase: f64, external_phase: f64) -> f64
seasonal_photoperiod(day_of_year: usize, latitude: f64) -> f64
melatonin_suppression(light_intensity: f64, ic50: f64, hill_n: f64) -> f64
social_zeitgeber_strength(regularity: f64, social_contacts: f64) -> f64
food_entrainment(feeding_time: f64, clock_phase: f64, coupling: f64) -> f64
chronotype_score(midpoint_sleep: f64) -> f64
circadian_amplitude_damping(initial_amplitude: f64, damping_rate: f64, t: f64) -> f64
goodwin_oscillator( x: f64, y: f64, z: f64, k1: f64, k2: f64, k3: f64, ki: f64, n: f64, ) -> (f64, f64, f64)
van_der_pol_circadian( x: f64, y: f64, mu: f64, tau: f64, light: f64, alpha: f64, ) -> (f64, f64)
phase_response(phase: f64, light_intensity: f64, sensitivity: f64, tau: f64) -> f64
entrainment_range(coupling_strength: f64, intrinsic_period: f64) -> (f64, f64)
melatonin_profile(t: f64, onset: f64, offset: f64, amplitude: f64) -> f64
desynchrony_index(observed_period: f64, zeitgeber_period: f64) -> f64
goodwin_simulate( x0: f64, y0: f64, z0: f64, k1: f64, k2: f64, k3: f64, ki: f64, n: f64, dt: f64, steps: usize, ) -> Vec<(f64, f64, f64)>
kuramoto_order_parameter`(phases: &[f64]) -> (f64, f64)`
kuramoto_step`(phases: &mut [f64], frequencies: &[f64], coupling: f64, dt: f64)`
arnolds_tongue_boundary(coupling: f64, detuning: f64) -> bool
repressilator( a: f64, b: f64, c: f64, alpha: f64, alpha0: f64, n: f64, beta: f64, ) -> (f64, f64, f64)
amplitude_phase_from_timeseries`(values: &[f64], period: f64) -> (f64, f64)`
phase_diffusion_coefficient(phase_variance: f64, time: f64) -> f64
limit_cycle_stability(floquet_exponent: f64) -> bool
poincare_section_period`(crossing_times: &[f64]) -> f64`
detrend_moving_average`(data: &[f64], window: usize) -> Vec<f64>`
instantaneous_frequency(phase_prev: f64, phase_curr: f64, dt: f64) -> f64
mutual_information_phase`(phases1: &[f64], phases2: &[f64], n_bins: usize) -> f64`
stochastic_resonance_snr(signal_power: f64, noise_intensity: f64, threshold: f64) -> f64
jet_lag_resync_time(time_zones_crossed: f64, resync_rate: f64) -> f64
sleep_pressure(wake_duration: f64, buildup_rate: f64, max_pressure: f64) -> f64
two_process_model(sleep_pressure: f64, circadian_amplitude: f64, phase: f64) -> f64
photoperiod(latitude_rad: f64, declination_rad: f64) -> f64
ultradian_rhythm`(amplitudes: &[f64], periods: &[f64], t: f64) -> f64`
chronotype_shift(mid_sleep_free: f64, sleep_debt_correction: f64) -> f64
circadian_acrophase`(data: &[f64], period: f64) -> f64`
cosinor_amplitude`(data: &[f64], period: f64) -> f64`
social_jet_lag(weekday_midsleep: f64, weekend_midsleep: f64) -> f64
mesor`(data: &[f64]) -> f64`
sleep_debt(wake_hours: f64, optimal_sleep: f64, actual_sleep: f64) -> f64
circadian_phase_estimate(core_body_temp_min_time: f64) -> f64
light_phase_advance(lux: f64, sensitivity: f64, timing_factor: f64) -> f64
dim_light_melatonin_onset`(melatonin_levels: &[f64], threshold: f64) -> Option<usize>`
infradian_cycle(base_amplitude: f64, period_days: f64, day: f64) -> f64
temperature_compensation_q10(rate_t1: f64, rate_t2: f64, t1: f64, t2: f64) -> f64
masking_effect(endogenous: f64, exogenous_signal: f64, masking_gain: f64) -> f64
relative_amplitude(max_val: f64, min_val: f64) -> f64
interdaily_stability`(data: &[f64], period: usize) -> f64`
intradaily_variability`(data: &[f64]) -> f64`

cryobiology API (46 functions)

FunctionSignature
mazur_two_factor_model(cooling_rate: f64, optimal_rate: f64, width: f64) -> f64
ice_nucleation_rate(temperature: f64, volume: f64, j0: f64, activation_energy: f64) -> f64
critical_cooling_rate(cpa_concentration: f64, base_rate: f64, sensitivity: f64) -> f64
vitrification_probability(cooling_rate: f64, critical_rate: f64) -> f64
cpa_toxicity(concentration: f64, exposure_time: f64, k_tox: f64) -> f64
cell_volume_response(v0: f64, osmolarity_ratio: f64, vb: f64) -> f64
freeze_thaw_survival( initial_viability: f64, ice_damage: f64, osmotic_damage: f64, cpa_damage: f64, ) -> f64
intracellular_ice_formation_probability( cooling_rate: f64, critical_rate: f64, n: f64, ) -> f64
osmotic_tolerance_limit(v_min: f64, v_max: f64, initial_volume: f64) -> (f64, f64)
kedem_katchalsky_water_flux( lp: f64, area: f64, delta_pi: f64, sigma: f64, delta_p: f64, ) -> f64
kedem_katchalsky_solute_flux( ps: f64, area: f64, delta_c: f64, sigma: f64, jv: f64, c_mean: f64, ) -> f64
freezing_point_depression(concentration: f64, kf: f64, dissociation_factor: f64) -> f64
hemolysis_fraction(osmolality: f64, half_lysis_osmolality: f64, steepness: f64) -> f64
stefan_freezing_front(thermal_diffusivity: f64, t: f64, stefan_number: f64) -> f64
supercooling_degree(freezing_point: f64, nucleation_temp: f64) -> f64
ice_crystal_growth_rate( supercooling: f64, diffusivity: f64, activation_energy: f64, temperature: f64, ) -> f64
cpa_loading_protocol_step( v: f64, lp: f64, area: f64, osm_in: f64, osm_out: f64, ps: f64, c_in: f64, c_out: f64, vb: f64, dt: f64, ) -> (f64, f64)
rewarming_crystallization_risk(warming_rate: f64, critical_warming: f64) -> f64
glass_transition_temperature(cpa_fraction: f64, tg_cpa: f64, tg_water: f64) -> f64
nucleation_temperature(solution_concentration: f64, cooling_rate: f64) -> f64
ice_growth_rate(supercooling: f64, diffusion_coeff: f64, latent_heat: f64) -> f64
intracellular_ice_probability(cooling_rate: f64, critical_rate: f64) -> f64
ostwald_recrystallization_rate(temperature: f64, activation_energy: f64) -> f64
anti_freeze_protein_thermal_hysteresis(concentration: f64, k_th: f64, n: f64) -> f64
cryoprotectant_toxicity( concentration: f64, temperature: f64, exposure_time: f64, k_tox: f64, ) -> f64
dehydration_during_freezing( initial_water: f64, osmotic_coefficient: f64, ice_fraction: f64, ) -> f64
vitrification_temperature( water_fraction: f64, tg_pure_solute: f64, tg_water: f64, k_gt: f64, ) -> f64
storage_decay_arrhenius(a: f64, ea: f64, temperature_k: f64) -> f64
shelf_life(initial_viability: f64, threshold: f64, decay_rate: f64) -> f64
recrystallization_rate(temperature: f64, activation_energy: f64, pre_factor: f64) -> f64
warming_rate_survival(warming_rate: f64, optimal_warming: f64, sigma: f64) -> f64
devitrification_probability(warming_rate: f64, critical_warming_rate: f64) -> f64
cpa_permeation( permeability: f64, surface_area: f64, concentration_out: f64, concentration_in: f64, ) -> f64
two_parameter_model_volume( volume0: f64, lp: f64, surface_area: f64, osm_out: f64, osm_in: f64, dt: f64, ) -> f64
cooling_rate_survival(cooling_rate: f64, optimal: f64, sigma: f64) -> f64
ice_nucleation_probability(temperature: f64, volume: f64, j0: f64, ea: f64) -> f64
lyophilization_primary_drying_rate(heat_input: f64, sublimation_enthalpy: f64) -> f64
lyophilization_collapse_temperature(tg_prime: f64, offset: f64) -> f64
trehalose_protection(trehalose_conc: f64, k_protect: f64, max_protection: f64) -> f64
thawing_temperature_profile(t_initial: f64, t_bath: f64, k: f64, time: f64) -> f64
post_thaw_recovery_kinetics(plateau: f64, recovery_rate: f64, t: f64) -> f64
controlled_rate_freezer_program(target_rate: f64, current_temp: f64, dt: f64) -> f64
thermal_seed_temperature(sample_temp: f64, seed_offset: f64) -> f64
isochoric_preservation_pressure( temperature: f64, reference_temp: f64, bulk_modulus: f64, expansion_coeff: f64, ) -> f64
q10_temperature_coefficient(rate_t2: f64, rate_t1: f64, t2: f64, t1: f64) -> f64
wlf_viscosity_shift(c1: f64, c2: f64, temperature: f64, tg: f64) -> f64

developmental API (35 functions)

FunctionSignature
waddington_landscape(x: f64, param: f64) -> f64
differentiation_potential(x: f64, param: f64) -> f64
differentiation_simulate( x0: f64, param_start: f64, param_end: f64, noise: f64, dt: f64, steps: usize, ) -> Vec<(f64, f64)>
somitogenesis_clock(phase: f64, omega: f64, coupling: f64, neighbor_phase: f64) -> f64
somite_clock_simulate`( phases: &mut [f64], omega: f64, coupling: f64, dt: f64, steps: usize, ) -> Vec<Vec<f64>>`
lateral_inhibition_step( signal: f64, neighbor_signal: f64, delta: f64, notch: f64, k: f64, ) -> (f64, f64)
cell_fate_probability(signal: f64, threshold: f64, steepness: f64) -> f64
gene_regulatory_network_step`( expression: &mut [f64], interactions: &[Vec<f64>], basal_rates: &[f64], degradation: &[f64], dt: f64, )`
toggle_switch(a: f64, b: f64, alpha: f64, beta: f64, n: f64) -> (f64, f64)
apical_basal_polarity(par3: f64, par6: f64, atypical_pkc: f64, par1: f64) -> f64
planar_cell_polarity( frizzled: f64, vang: f64, coupling: f64, neighbor_fz: f64, neighbor_vang: f64, ) -> (f64, f64)
notch_delta_lateral_inhibition_ode( notch: f64, delta: f64, neighbor_delta: f64, beta_n: f64, beta_d: f64, k: f64, n: f64, ) -> (f64, f64)
induction_competence( signal: f64, competence_window: f64, time: f64, window_center: f64, ) -> f64
reaction_diffusion_activator_inhibitor( a: f64, h: f64, da: f64, rho_a: f64, mu_a: f64, dh: f64, rho_h: f64, mu_h: f64, laplacian_a: f64, laplacian_h: f64, ) -> (f64, f64)
hox_gene_expression`(position: f64, boundaries: &[(f64, f64)]) -> Vec<bool>`
morphogenetic_field_potential( cell_position: (f64, f64), field_center: (f64, f64), field_strength: f64, decay: f64, ) -> f64
morphogen_gradient_steady(source: f64, decay: f64, diffusion: f64, x: f64) -> f64
morphogen_diffusion_1d`( conc: &mut [f64], d: f64, decay: f64, source_idx: usize, source_rate: f64, dx: f64, dt: f64, steps: usize, )`
french_flag_model(concentration: f64, t1: f64, t2: f64) -> u8
bicoid_gradient(c0: f64, length: f64, lambda: f64, x: f64) -> f64
positional_information`(thresholds: &[f64], gradient: &[f64]) -> Vec<u8>`
morphogen_gradient_reaction`( conc: &mut [f64], production: &[f64], degradation: f64, diffusion: f64, dx: f64, dt: f64, steps: usize, )`
shh_patterning`(distance: f64, concentration: f64, thresholds: &[(f64, u8)]) -> u8`
morphogen_noise_filtering`(signal: &[f64], window: usize) -> Vec<f64>`
interpretation_delay`(concentration_history: &[f64], delay: usize) -> f64`
wnt_gradient`(source_strength: f64, decay_rate: f64, positions: &[f64]) -> Vec<f64>`
turing_reaction_diffusion`( u: &mut [f64], v: &mut [f64], du: f64, dv: f64, a: f64, b: f64, dx: f64, dt: f64, steps: usize, )`
turing_instability_condition(du: f64, dv: f64, fu: f64, gv: f64, fg_det: f64) -> bool
gierer_meinhardt`( activator: &mut [f64], inhibitor: &mut [f64], da: f64, di: f64, rho_a: f64, rho_i: f64, mu_a: f64, mu_i: f64, dx: f64, dt: f64, steps: usize, )`
french_flag_positional( position: f64, threshold_high: f64, threshold_low: f64, morphogen_source: f64, decay_length: f64, ) -> u8
lateral_inhibition`( cells: &mut [f64], notch: &mut [f64], delta: &mut [f64], beta_n: f64, beta_d: f64, k: f64, n: f64, dt: f64, steps: usize, )`
clock_and_wavefront( position: f64, wavefront_speed: f64, frequency: f64, t: f64, threshold: f64, ) -> bool
schnakenberg`( u: &mut [f64], v: &mut [f64], du: f64, dv: f64, a: f64, b: f64, gamma: f64, dx: f64, dt: f64, steps: usize, )`
voronoi_cell_sorting`( positions: &[(f64, f64)], types: &[u8], adhesion_same: f64, adhesion_diff: f64, ) -> Vec<(f64, f64)>`
wave_pinning`( u: &mut [f64], v: &mut [f64], d: f64, k_on: f64, k_off: f64, k_fb: f64, hill_n: f64, dx: f64, dt: f64, steps: usize, )`

ecology API (50 functions)

FunctionSignature
shannon_diversity`(abundances: &[f64]) -> f64`
simpson_diversity`(abundances: &[f64]) -> f64`
inverse_simpson`(abundances: &[f64]) -> f64`
species_richness`(abundances: &[f64]) -> usize`
pielou_evenness`(abundances: &[f64]) -> f64`
berger_parker`(abundances: &[f64]) -> f64`
margalef_richness(species: usize, total_individuals: f64) -> f64
chao1(observed: usize, singletons: usize, doubletons: usize) -> f64
hill_number`(abundances: &[f64], q: f64) -> f64`
trophic_cascade`( levels: &[f64], growth_rates: &[f64], carrying_capacities: &[f64], interaction_strengths: &[f64], dt: f64, steps: usize, ) -> Vec<Vec<f64>>`
reaction_diffusion_1d`( u: &mut [f64], v: &mut [f64], du: f64, dv: f64, f_coeff: f64, k: f64, dx: f64, dt: f64, steps: usize, )`
species_area(c: f64, z: f64, area: f64) -> f64
island_biogeography_equilibrium(immigration_rate: f64, extinction_rate: f64) -> f64
carrying_capacity_from_resources(resource: f64, consumption_per_capita: f64) -> f64
succession_model`( biomass: &[f64], growth_rates: &[f64], capacities: &[f64], competition: &[Vec<f64>], dt: f64, steps: usize, ) -> Vec<Vec<f64>>`
dispersal_kernel_gaussian(distance: f64, sigma: f64) -> f64
net_primary_productivity(gpp: f64, autotrophic_respiration: f64) -> f64
net_ecosystem_productivity(npp: f64, heterotrophic_respiration: f64) -> f64
carbon_use_efficiency(npp: f64, gpp: f64) -> f64
nitrogen_mineralization( organic_n: f64, microbial_activity: f64, temperature_factor: f64, ) -> f64
nutrient_use_efficiency(biomass_produced: f64, nutrient_absorbed: f64) -> f64
liebig_minimum`(nutrients: &[f64], requirements: &[f64]) -> f64`
decomposition_rate(initial_mass: f64, k: f64, t: f64) -> f64
soil_respiration(temperature: f64, moisture: f64, q10: f64, r_ref: f64) -> f64
evapotranspiration_penman_monteith( net_radiation: f64, soil_heat_flux: f64, air_temp: f64, vpd: f64, wind_speed: f64, surface_resistance: f64, ) -> f64
water_use_efficiency(carbon_assimilated: f64, water_transpired: f64) -> f64
litter_bag_decomposition(initial_mass: f64, remaining_mass: f64, time: f64) -> f64
lotka_volterra_competition( n1: f64, n2: f64, r1: f64, r2: f64, k1: f64, k2: f64, alpha12: f64, alpha21: f64, ) -> (f64, f64)
lotka_volterra_predator_prey( prey: f64, predator: f64, r: f64, a: f64, b: f64, m: f64, ) -> (f64, f64)
rosenzweig_macarthur( prey: f64, predator: f64, r: f64, k: f64, a: f64, h: f64, e: f64, m: f64, ) -> (f64, f64)
type_ii_functional_response(prey_density: f64, attack_rate: f64, handling_time: f64) -> f64
type_iii_functional_response( prey_density: f64, attack_rate: f64, handling_time: f64, exponent: f64, ) -> f64
nutrient_cycling( nutrient: f64, producers: f64, decomposers: f64, uptake_rate: f64, mortality_rate: f64, decomposition_rate: f64, ) -> (f64, f64, f64)
disturbance_regime( biomass: f64, disturbance_intensity: f64, return_interval: f64, time_since: f64, ) -> f64
intermediate_disturbance_diversity( disturbance_frequency: f64, max_diversity: f64, optimal_frequency: f64, ) -> f64
metapopulation_levins(p: f64, colonization: f64, extinction: f64) -> f64
source_sink_dynamics( source_emigration: f64, sink_mortality: f64, sink_immigration: f64, ) -> f64
food_web_connectance(links: usize, species: usize) -> f64
trophic_level`(diet_trophic_levels: &[f64], diet_fractions: &[f64]) -> f64`
lindeman_efficiency(energy_n_plus_1: f64, energy_n: f64) -> f64
bray_curtis`(a: &[f64], b: &[f64]) -> f64`
jaccard`(a: &[bool], b: &[bool]) -> f64`
sorensen`(a: &[bool], b: &[bool]) -> f64`
morisita_horn`(a: &[f64], b: &[f64]) -> f64`
euclidean_distance`(a: &[f64], b: &[f64]) -> f64`
whittaker_beta(gamma: usize, alpha_mean: f64) -> f64
horn_overlap`(a: &[f64], b: &[f64]) -> f64`
chao_jaccard(shared: usize, a_only: usize, b_only: usize, n_a: usize, n_b: usize) -> f64
manhattan_distance`(a: &[f64], b: &[f64]) -> f64`
canberra_distance`(a: &[f64], b: &[f64]) -> f64`

endocrinology API (60 functions)

FunctionSignature
hpa_axis_cortisol( crh: f64, acth_gain: f64, cortisol_gain: f64, feedback_strength: f64, cortisol_current: f64, ) -> (f64, f64)
hpg_axis_testosterone( gnrh: f64, lh_gain: f64, testosterone_gain: f64, feedback: f64, testosterone_current: f64, ) -> (f64, f64)
hpt_axis_t4( trh: f64, tsh_gain: f64, t4_gain: f64, feedback: f64, t4_current: f64, ) -> (f64, f64)
glucose_insulin_model_step( glucose: f64, insulin: f64, glucose_input: f64, dt: f64, si: f64, sg: f64, n: f64, gamma: f64, g_threshold: f64, ) -> (f64, f64)
calcium_pth_feedback(calcium: f64, setpoint: f64, pth_max: f64, steepness: f64) -> f64
raas_angiotensin(renin: f64, angiotensinogen: f64, ace_activity: f64) -> f64
aldosterone_response( angiotensin_ii: f64, potassium: f64, gain_ang: f64, gain_k: f64, ) -> f64
growth_hormone_igf1(gh: f64, liver_response: f64, feedback: f64, igf1_current: f64) -> f64
leptin_energy_feedback( fat_mass: f64, leptin_sensitivity: f64, energy_expenditure_base: f64, ) -> f64
cortisol_awakening_response( basal_cortisol: f64, car_amplitude: f64, time_after_wake_min: f64, ) -> f64
hormone_synthesis_rate(enzyme_conc: f64, substrate: f64, km: f64, vmax: f64) -> f64
hormone_half_life_clearance(concentration: f64, half_life: f64, t: f64) -> f64
pulsatile_release(amplitude: f64, frequency: f64, t: f64, basal: f64) -> f64
negative_feedback_loop(setpoint: f64, current: f64, gain: f64) -> f64
positive_feedback_loop(stimulus: f64, hormone_level: f64, gain: f64, threshold: f64) -> f64
receptor_saturation(hormone: f64, kd: f64, receptor_total: f64) -> f64
hormone_free_fraction(total: f64, binding_protein: f64, kd: f64) -> f64
circadian_hormone_profile(amplitude: f64, phase: f64, t_hours: f64, mesor: f64) -> f64
steroidogenesis_rate(cholesterol: f64, star_protein: f64, enzyme_activity: f64) -> f64
thyroid_hormone_conversion(t4: f64, deiodinase_activity: f64, km: f64) -> f64
insulin_sensitivity_index(glucose: f64, insulin: f64) -> f64
homa_ir(fasting_glucose_mmol: f64, fasting_insulin_mu_per_ml: f64) -> f64
homa_beta(fasting_insulin_mu_per_ml: f64, fasting_glucose_mmol: f64) -> f64
hormone_clearance(c0: f64, half_life: f64, t: f64) -> f64
hormone_infusion_steady_state(infusion_rate: f64, clearance_rate: f64) -> f64
hormone_infusion_transient(infusion_rate: f64, clearance_rate: f64, t: f64) -> f64
pulsatile_secretion( amplitude: f64, frequency: f64, phase: f64, baseline: f64, t: f64, ) -> f64
negative_feedback(hormone_level: f64, set_point: f64, gain: f64) -> f64
positive_feedback(hormone_level: f64, threshold: f64, gain: f64, max_rate: f64) -> f64
hpa_axis_step( crf: f64, acth: f64, cortisol: f64, k1: f64, k2: f64, k3: f64, d1: f64, d2: f64, d3: f64, neg_gain: f64, ) -> (f64, f64, f64)
thyroid_axis_tsh_t4( tsh: f64, t4: f64, trh: f64, k_stim: f64, k_inh: f64, k_prod: f64, d_tsh: f64, d_t4: f64, ) -> (f64, f64)
insulin_secretion_glucose(glucose: f64, beta_cell_mass: f64, km: f64, vmax: f64) -> f64
glucose_insulin_dynamics( glucose: f64, insulin: f64, gin: f64, si: f64, sg: f64, n: f64, ib: f64, gb: f64, ) -> (f64, f64)
hormone_binding_to_carrier(total_hormone: f64, carrier: f64, kd: f64) -> f64
free_hormone_fraction(total: f64, binding_proteins: f64, kd: f64) -> f64
cortisol_diurnal_rhythm(t_hours: f64, peak_amplitude: f64, nadir: f64) -> f64
growth_hormone_pulse`(t: f64, pulse_times: &[f64], amplitude: f64, half_life: f64) -> f64`
renin_angiotensin_aldosterone( renin: f64, angiotensinogen: f64, ace: f64, k_renin: f64, k_ace: f64, k_aldo: f64, ) -> (f64, f64, f64)
parathyroid_calcium_response( calcium: f64, set_point: f64, max_pth: f64, steepness: f64, ) -> f64
leptin_secretion(fat_mass: f64, sensitivity: f64) -> f64
ghrelin_fasting_profile( t_since_meal: f64, peak_time: f64, amplitude: f64, baseline: f64, ) -> f64
receptor_binding_fraction(ligand: f64, kd: f64) -> f64
competitive_binding(ligand: f64, competitor: f64, kd: f64, ki: f64) -> f64
receptor_up_regulation(r0: f64, stimulus: f64, k_up: f64, k_deg: f64, t: f64) -> f64
receptor_down_regulation(r0: f64, stimulus: f64, k_down: f64, k_synth: f64, t: f64) -> f64
dose_response_hill(dose: f64, ec50: f64, emax: f64, n: f64) -> f64
insulin_glucose_minimal_model( g: f64, x: f64, insulin: f64, gb: f64, p1: f64, p2: f64, p3: f64, ib: f64, ) -> (f64, f64)
receptor_internalization( surface: f64, ligand: f64, k_intern: f64, k_recycle: f64, ) -> (f64, f64)
receptor_clearance_rate(concentration: f64, half_life: f64) -> f64
feedback_loop_negative( stimulus: f64, hormone: f64, sensitivity: f64, set_point: f64, ) -> f64
receptor_pulsatile_response(amplitude: f64, frequency: f64, t: f64, baseline: f64) -> f64
allosteric_modulation(ligand: f64, modulator: f64, kd: f64, alpha: f64, beta: f64) -> f64
spare_receptor_response(ligand: f64, kd: f64, receptor_reserve: f64) -> f64
desensitization_kinetics( r0: f64, agonist: f64, k_desens: f64, k_resens: f64, t: f64, ) -> f64
second_messenger_camp(receptor_activity: f64, k_synth: f64, k_pde: f64, basal: f64) -> f64
ip3_calcium_release(ip3: f64, k_release: f64, k_serca: f64, store: f64) -> f64
receptor_dimerization(monomer: f64, kd_dimer: f64) -> f64
beta_arrestin_recruitment(agonist: f64, receptor: f64, k_arr: f64) -> f64
receptor_tyrosine_kinase_activation(ligand: f64, receptor: f64, km: f64, vmax: f64) -> f64
gpcr_g_protein_cycle( active_receptor: f64, gdp_bound: f64, k_exchange: f64, k_hydrolysis: f64, ) -> (f64, f64)

enzyme API (50 functions)

FunctionSignature
competitive_inhibition(substrate: f64, inhibitor: f64, vmax: f64, km: f64, ki: f64) -> f64
uncompetitive_inhibition( substrate: f64, inhibitor: f64, vmax: f64, km: f64, ki: f64, ) -> f64
mixed_inhibition( substrate: f64, inhibitor: f64, vmax: f64, km: f64, ki: f64, ki_prime: f64, ) -> f64
noncompetitive_inhibition( substrate: f64, inhibitor: f64, vmax: f64, km: f64, ki: f64, ) -> f64
substrate_inhibition_velocity(substrate: f64, vmax: f64, km: f64, ksi: f64) -> f64
irreversible_inhibition(active_enzyme: f64, inhibitor: f64, k_inact: f64, t: f64) -> f64
tight_binding_inhibition(enzyme_total: f64, inhibitor_total: f64, ki_app: f64) -> f64
ic50_to_ki(ic50: f64, substrate: f64, km: f64) -> f64
ki_to_ic50(ki: f64, substrate: f64, km: f64) -> f64
cheng_prusoff_uncompetitive(ic50: f64, substrate: f64, km: f64) -> f64
inhibition_constant_dixon( v_no_inhibitor: f64, v_with_inhibitor: f64, inhibitor: f64, substrate: f64, km: f64, ) -> f64
michaelis_menten(s: f64, vmax: f64, km: f64) -> f64
michaelis_menten_competitive(s: f64, vmax: f64, km: f64, inhibitor: f64, ki: f64) -> f64
michaelis_menten_uncompetitive(s: f64, vmax: f64, km: f64, inhibitor: f64, ki: f64) -> f64
michaelis_menten_noncompetitive(s: f64, vmax: f64, km: f64, inhibitor: f64, ki: f64) -> f64
hill_equation(s: f64, vmax: f64, k: f64, n: f64) -> f64
lineweaver_burk`(s: &[f64], v: &[f64]) -> (f64, f64)`
eadie_hofstee`(v: &[f64], s: &[f64]) -> (f64, f64)`
kcat(vmax: f64, e_total: f64) -> f64
catalytic_efficiency(kcat_val: f64, km: f64) -> f64
enzyme_kinetics_solve( s0: f64, e0: f64, k1: f64, k_1: f64, k2: f64, dt: f64, steps: usize, ) -> Vec<(f64, f64, f64)>
ping_pong(a: f64, b: f64, vmax: f64, ka: f64, kb: f64) -> f64
ordered_bi_bi(a: f64, b: f64, vmax: f64, ka: f64, kb: f64, kia: f64) -> f64
random_bi_bi(a: f64, b: f64, vmax: f64, ka: f64, kb: f64, kia: f64, kib: f64) -> f64
substrate_inhibition(s: f64, vmax: f64, km: f64, ki: f64) -> f64
allosteric_enzyme(s: f64, vmax: f64, k05: f64, n_hill: f64) -> f64
covalent_modification_cycle( substrate: f64, kinase_vmax: f64, kinase_km: f64, phosphatase_vmax: f64, phosphatase_km: f64, ) -> f64
enzyme_activation_energy(k_cat: f64, temperature: f64) -> f64
suicide_inhibition(e0: f64, inhibitor: f64, ki: f64, kinact: f64, t: f64) -> f64
enzyme_cooperativity`(substrate: f64, vmax: f64, s05: &[f64], weights: &[f64]) -> f64`
metabolic_network_steady_state`( stoich: &[Vec<f64>], rates: impl Fn(&[f64]) -> Vec<f64>, initial: &[f64], dt: f64, steps: usize, tolerance: f64, ) -> Vec<f64>`
arrhenius(a: f64, ea: f64, t: f64) -> f64
q10_factor(rate1: f64, rate2: f64, t1: f64, t2: f64) -> f64
metabolic_control_coefficient( flux_perturbed: f64, flux_original: f64, enzyme_perturbed: f64, enzyme_original: f64, ) -> f64
gibbs_free_energy(delta_g0: f64, t: f64, q: f64) -> f64
mass_action_ratio`( products: &[f64], reactants: &[f64], stoich_p: &[f64], stoich_r: &[f64], ) -> f64`
reaction_quotient_vs_keq(q: f64, keq: f64) -> f64
flux_control_summation`(coefficients: &[f64]) -> f64`
elasticity_coefficient( rate: f64, metabolite: f64, delta_rate: f64, delta_metabolite: f64, ) -> f64
supply_demand_modular( supply_flux: f64, demand_flux: f64, linking_metabolite: f64, elasticity_supply: f64, elasticity_demand: f64, ) -> f64
allosteric_monod_wyman_changeux(substrate: f64, n: f64, l0: f64, kr: f64, kt: f64) -> f64
hill_cooperativity(substrate: f64, k_half: f64, n: f64) -> f64
phosphorylation_switch( kinase: f64, phosphatase: f64, km_kin: f64, km_phos: f64, vmax_kin: f64, vmax_phos: f64, total_protein: f64, ) -> f64
zymogen_activation(zymogen: f64, activator: f64, k_act: f64) -> f64
product_inhibition_ordered( substrate: f64, product: f64, vmax_f: f64, km: f64, kp: f64, ) -> f64
isozyme_total_activity`(activities: &[f64], fractions: &[f64]) -> f64`
temperature_activation(rate_ref: f64, ea: f64, t: f64, t_ref: f64) -> f64
thermal_denaturation(activity: f64, k_denat: f64, t: f64) -> f64
feedback_inhibition( product: f64, ki: f64, n: f64, vmax: f64, substrate: f64, km: f64, ) -> f64
cascade_amplification`(initial_signal: f64, amplification_factors: &[f64]) -> f64`

epigenetics API (51 functions)

FunctionSignature
chromatin_accessibility( open_fraction: f64, remodeler_activity: f64, histone_density: f64, ) -> f64
nucleosome_occupancy(dna_affinity: f64, histone_conc: f64, competitor_conc: f64) -> f64
histone_mark_propagation( mark_fraction: f64, write_rate: f64, erase_rate: f64, dt: f64, ) -> f64
polycomb_silencing(pc_binding: f64, h3k27me3: f64, cooperative_factor: f64) -> f64
trithorax_activation(trx_binding: f64, h3k4me3: f64, cooperative_factor: f64) -> f64
chromatin_loop_probability(distance_bp: f64, persistence_length_bp: f64) -> f64
tad_insulation_score(contacts_within: f64, contacts_across: f64) -> f64
enhancer_promoter_contact( distance: f64, cohesin_loading: f64, ctcf_binding: f64, decay_length: f64, ) -> f64
bivalent_resolution(h3k4me3: f64, h3k27me3: f64, differentiation_signal: f64) -> (f64, f64)
heterochromatin_spread( hp1_conc: f64, h3k9me3: f64, barrier_strength: f64, distance: f64, ) -> f64
atac_seq_signal(fragment_count: f64, total_reads: f64, region_length_bp: f64) -> f64
histone_mark_occupancy(k_on: f64, k_off: f64) -> f64
histone_mark_dynamics( occupancy: f64, k_on: f64, k_off: f64, k_spread: f64, neighbor_occ: f64, ) -> f64
histone_spread_simulate`( occupancies: &mut [f64], k_on: f64, k_off: f64, k_spread: f64, dt: f64, steps: usize, ) -> Vec<Vec<f64>>`
nucleosome_positioning_energy`( dna_flexibility: &[f64], position: usize, wrap_length: usize, ) -> f64`
chromatin_compaction_ratio(extended_length: f64, compacted_length: f64) -> f64
histone_acetylation_equilibrium(hat_activity: f64, hdac_activity: f64) -> f64
bivalent_domain_resolution( h3k4me3: f64, h3k27me3: f64, signal: f64, threshold: f64, ) -> (f64, f64)
chip_seq_enrichment( ip_reads: f64, input_reads: f64, ip_total: f64, input_total: f64, ) -> f64
reader_writer_feedback( mark: f64, reader_affinity: f64, writer_rate: f64, eraser_rate: f64, ) -> f64
heterochromatin_spreading`( marks: &mut [f64], spread_rate: f64, barrier_positions: &[usize], dt: f64, )`
epigenetic_inheritance_probability(maintenance: f64, generations: usize) -> f64
transgenerational_decay(mark: f64, reset_rate: f64, generations: usize) -> Vec<f64>
epimutation_rate(changes: usize, sites: usize, generations: usize) -> f64
epiallele_frequency( fitness_epi: f64, fitness_normal: f64, freq: f64, generations: usize, ) -> Vec<f64>
chromatin_state_transition`(state: &[f64], transition_matrix: &[Vec<f64>]) -> Vec<f64>`
imprinting_expression(maternal: f64, paternal: f64, imprint_maternal: bool) -> f64
paramutation( strong_allele: f64, weak_allele: f64, conversion_rate: f64, generations: usize, ) -> Vec<(f64, f64)>
metastable_epiallele( base_expression: f64, methylation: f64, stochastic_variance: f64, ) -> f64
epigenetic_clock`(methylation_sites: &[f64], coefficients: &[f64], intercept: f64) -> f64`
environmental_epigenetic_response( stress: f64, sensitivity: f64, methylation_change_rate: f64, baseline_methylation: f64, ) -> f64
cpg_methylation_level(methylated: usize, total_cpg: usize) -> f64
methylation_decay( level: f64, dilution_rate: f64, maintenance_efficiency: f64, generations: usize, ) -> Vec<f64>
de_novo_methylation(unmethylated: f64, rate: f64, dt: f64) -> f64
bisulfite_conversion_efficiency(converted_c: usize, total_c: usize) -> f64
methylation_entropy`(profile: &[f64]) -> f64`
hydroxymethylation_rate(methylation: f64, tet_activity: f64) -> f64
tet_oxidation_cascade(mc: f64, tet: f64, dt: f64) -> (f64, f64, f64)
dnmt_processivity`( initial_methylation: &[f64], processivity: f64, direction_forward: bool, ) -> Vec<f64>`
cpg_island_density(sequence_length: usize, cpg_count: usize, expected_cpg: f64) -> f64
age_methylation_predictor`(cpg_beta_values: &[f64], weights: &[f64], offset: f64) -> f64`
mirna_target_repression( mirna_conc: f64, target_mrna: f64, kd: f64, max_repression: f64, ) -> f64
mirna_seed_match_score( seed_matches: usize, three_prime_pairing: f64, site_accessibility: f64, ) -> f64
lncrna_scaffold_activity( lncrna_conc: f64, protein_a: f64, protein_b: f64, kd_a: f64, kd_b: f64, ) -> f64
xist_silencing_spread( xist_expression: f64, distance_from_xic: f64, spread_rate: f64, ) -> f64
pirna_transposon_silencing( pirna_conc: f64, transposon_copies: f64, silencing_efficiency: f64, ) -> f64
circular_rna_mirna_sponge( circrna: f64, binding_sites: f64, mirna_total: f64, kd: f64, ) -> f64
rnai_knockdown_efficiency( sirna_conc: f64, target_mrna: f64, risc_activity: f64, kd: f64, ) -> f64
enhancer_rna_activity( erna_level: f64, enhancer_activity_base: f64, amplification: f64, ) -> f64
antisense_rna_regulation( sense_mrna: f64, antisense_rna: f64, duplex_rate: f64, degradation_rate: f64, ) -> f64
ncrna_mediated_methylation( ncrna_guide: f64, target_region_accessibility: f64, dnmt_activity: f64, ) -> f64

ethology API (60 functions)

FunctionSignature
territory_size(body_mass: f64, scaling_exponent: f64, constant: f64) -> f64
territory_defense_cost(perimeter: f64, intruder_rate: f64, cost_per_encounter: f64) -> f64
boldness_shyness_continuum(stimulus: f64, threshold: f64, steepness: f64) -> f64
dilution_effect(group_size: f64) -> f64
many_eyes_detection(individual_detection: f64, group_size: f64) -> f64
dominance_probability(rating_a: f64, rating_b: f64) -> f64
allee_effect_growth(n: f64, k: f64, r: f64, a: f64) -> f64
predator_avoidance_flight_distance(body_mass: f64, scaling: f64, risk_factor: f64) -> f64
hamilton_relatedness_benefit(relatedness: f64, benefit: f64, cost: f64) -> bool
reciprocal_altruism_threshold(benefit: f64, cost: f64, probability_future: f64) -> bool
selfish_herd_risk(distance_to_nearest: f64, predator_speed: f64) -> f64
vigilance_group_tradeoff(group_size: f64, individual_scan_rate: f64) -> f64
confusion_effect(group_size: f64, predator_success_solo: f64) -> f64
mobbing_probability(group_size: f64, predator_danger: f64, threshold: f64) -> f64
learning_curve_operant(trials: f64, asymptote: f64, rate: f64) -> f64
stimulus_generalization(distance: f64, width: f64) -> f64
ideal_despotic_distribution(rank: f64, max_rank: f64, total_resource: f64) -> f64
aggression_cost_benefit( resource_value: f64, fighting_ability: f64, injury_cost: f64, ) -> f64
migration_threshold(food_current: f64, food_destination: f64, travel_cost: f64) -> bool
information_center_benefit(colony_size: f64, discovery_prob: f64) -> f64
social_network_centrality(connections: f64, max_connections: f64) -> f64
handicap_signal_cost(quality: f64, signal_intensity: f64, cost_coeff: f64) -> f64
mate_choice_copying(intrinsic_preference: f64, social_info: f64, weight: f64) -> f64
signal_detection_d_prime(hit_rate: f64, false_alarm_rate: f64) -> f64
honest_signal_handicap(quality: f64, cost_per_signal: f64, benefit_per_signal: f64) -> f64
alarm_call_kin_selection( relatedness: f64, benefit_to_kin: f64, cost_to_caller: f64, ) -> bool
mate_choice_threshold( quality_assessed: f64, search_cost: f64, encounters: usize, threshold: f64, ) -> bool
ritualized_contest(size_a: f64, size_b: f64, motivation_a: f64, motivation_b: f64) -> f64
hawk_dove_contest(v: f64, c: f64, p_hawk: f64) -> (f64, f64)
producer_scrounger_frequency( producer_payoff: f64, scrounger_payoff: f64, p_producer: f64, selection_strength: f64, ) -> f64
territory_size_optimal(energy_gain_rate: f64, defense_cost_per_area: f64) -> f64
dominance_index(wins: f64, total_interactions: f64) -> f64
optimal_diet_value(energy_gain: f64, handling_time: f64, encounter_rate: f64) -> f64
marginal_value_theorem( travel_time: f64, gain_curve: impl Fn(f64) -> f64, max_t: f64, ) -> f64
ideal_free_distribution`(resource: &[f64], total_individuals: f64) -> Vec<f64>`
hawk_dove_payoff(v: f64, c: f64, hawk_freq: f64) -> (f64, f64)
ess_hawk_frequency(v: f64, c: f64) -> f64
tit_for_tat_payoff(r: f64, s: f64, t: f64, p: f64, opponent_cooperates: bool) -> f64
prey_choice_ranking`(prey_types: &[(f64, f64)]) -> Vec<(usize, f64)>`
risk_sensitive_foraging(mean_gain: f64, variance: f64, risk_aversion: f64) -> f64
central_place_foraging( distance: f64, load: f64, travel_cost_per_unit: f64, gain_per_load: f64, ) -> f64
producer_scrounger_game(p_freq: f64, finder_advantage: f64, group_size: f64) -> (f64, f64)
giving_up_density(metabolic_cost: f64, predation_cost: f64, missed_opportunity: f64) -> f64
patch_residence_time(gain_rate: f64, travel_time: f64, depletion_rate: f64) -> f64
functional_response_type_ii(prey_density: f64, attack_rate: f64, handling_time: f64) -> f64
functional_response_type_iii( prey_density: f64, attack_max: f64, half_sat: f64, handling_time: f64, ) -> f64
starvation_risk(reserves: f64, daily_cost: f64, variance: f64) -> f64
cache_pilferage_rate(competitors: f64, detection_prob: f64, cache_density: f64) -> f64
optimal_load_size( distance: f64, max_load: f64, loading_rate: f64, travel_speed: f64, ) -> f64
diet_breadth_threshold`(energy: &[f64], handling: &[f64], encounter: &[f64]) -> usize`
habituation(response: f64, stimulus_count: usize, decay_rate: f64) -> f64
sensitization(response: f64, noxious_stimulus: f64, gain: f64, saturation: f64) -> f64
operant_conditioning_rate(reinforcement_rate: f64, response_rate: f64, k: f64) -> f64
classical_conditioning_rescorla_wagner(v: f64, alpha: f64, beta: f64, lambda: f64) -> f64
spatial_learning_distance( trial: usize, asymptote: f64, learning_rate: f64, initial_distance: f64, ) -> f64
imprinting_critical_period(exposure_time: f64, peak_time: f64, width: f64) -> f64
social_learning_transmission(demonstrators: f64, naive: f64, transmission_rate: f64) -> f64
memory_retention_ebbinghaus(strength: f64, time: f64, stability: f64) -> f64
working_memory_capacity`(items: &[f64], capacity: usize) -> f64`
win_stay_lose_shift(previous_outcome: f64, threshold: f64) -> bool

evolution API (46 functions)

FunctionSignature
adaptation_rate( selection_coefficient: f64, mutation_rate: f64, population_size: f64, ) -> f64
fisher_geometric_adaptation`(phenotype: &[f64], optimum: &[f64]) -> f64`
adaptive_walk_progress( current_fitness: f64, max_fitness: f64, beneficial_rate: f64, step: usize, ) -> f64
beneficial_mutation_fixation_probability(s: f64, ne: f64) -> f64
phenotypic_plasticity( genotype_value: f64, environment: f64, reaction_norm_slope: f64, ) -> f64
baldwin_effect(learning_rate: f64, genetic_assimilation: f64, generations: usize) -> f64
red_queen_coevolution( host_fitness: f64, parasite_fitness: f64, host_adapt_rate: f64, parasite_adapt_rate: f64, dt: f64, ) -> (f64, f64)
environmental_gradient_selection( position: f64, optimum_slope: f64, selection_width: f64, phenotype: f64, ) -> f64
frequency_dependent_selection( frequency: f64, baseline_fitness: f64, fd_coefficient: f64, ) -> f64
adaptive_radiation_rate( niche_count: usize, occupied: usize, diversification_rate: f64, ) -> f64
fitness_landscape_nk`(genotype: &[u8], k: usize, contributions: &[Vec<f64>]) -> f64`
fitness_landscape_additive`(genotype: &[u8], effects: &[f64]) -> f64`
fisher_geometric_model(distance: f64, n_dimensions: usize) -> f64
mutation_step_probability(distance: f64, step_size: f64, n_dim: usize) -> f64
adaptive_walk(distance0: f64, step_size: f64, n_dim: usize, max_steps: usize) -> Vec<f64>
epistasis(w_ab: f64, w_a: f64, w_b: f64, w_ref: f64) -> f64
frequency_dependent_fitness(freq: f64, advantage_rare: f64) -> f64
density_dependent_fitness(population: f64, carrying_capacity: f64, r_max: f64) -> f64
wrightian_fitness`(genotype: &[bool], loci_effects: &[f64], dominance: &[f64]) -> f64`
fitness_landscape_rugged`(genotype: &[u8], peaks: &[(&[u8], f64)]) -> f64`
substitution_rate(mu: f64, ne: f64, s: f64) -> f64
dn_ds_ratio(dn: f64, ds: f64) -> f64
molecular_clock_rate(substitutions: f64, divergence_time: f64) -> f64
coalescent_time_pair(ne: f64) -> f64
expected_segregating_sites(theta: f64, n: usize) -> f64
watterson_estimator(seg_sites: usize, n: usize) -> f64
mcdonald_kreitman(dn: f64, ds: f64, pn: f64, ps: f64) -> f64
neutral_substitution_rate(mutation_rate: f64) -> f64
effective_neutral_mutations(total_mutations: usize, fraction_neutral: f64) -> f64
nearly_neutral_boundary(ne: f64) -> f64
tajima_d(pi: f64, theta_w: f64, n: usize) -> f64
watterson_theta(segregating_sites: usize, n: usize, sequence_length: usize) -> f64
nucleotide_diversity`(differences: &[f64], n_sequences: usize) -> f64`
ewens_sampling_formula(n: usize, theta: f64) -> f64
coalescent_expected_time(n: usize, ne: f64) -> f64
mcdonald_kreitman_ratio(dn: f64, ds: f64, pn: f64, ps: f64) -> f64
neutrality_index(dn: f64, ds: f64, pn: f64, ps: f64) -> f64
direction_of_selection(ni: f64) -> f64
speciation_rate_bdi(lambda: f64, mu: f64, t: f64, n0: f64) -> f64
allopatric_divergence(d0: f64, mu: f64, t: f64) -> f64
reproductive_isolation(genetic_distance: f64, k: f64, n: f64) -> f64
reinforcement_strength(sympatry: f64, hybrid_fitness: f64) -> f64
yule_process_expected_species(lambda: f64, t: f64) -> f64
birth_death_survival(lambda: f64, mu: f64, t: f64) -> f64
character_displacement(z1: f64, z2: f64, alpha: f64, sigma: f64) -> (f64, f64)
ecological_speciation_fitness( trait_val: f64, optimum1: f64, optimum2: f64, sigma: f64, ) -> (f64, f64)

genetics API (59 functions)

FunctionSignature
genetic_drift_wright_fisher( p: f64, pop_size: usize, generations: usize, seed: u64, ) -> Vec<f64>
drift_effective_population_size(n_males: f64, n_females: f64) -> f64
effective_population_size_varying`(sizes: &[f64]) -> f64`
heterozygosity_loss(ne: f64, generations: usize) -> f64
mutation_drift_equilibrium(ne: f64, mu: f64) -> f64
fixation_probability_neutral(ne: f64) -> f64
fixation_probability_selection(ne: f64, s: f64, p: f64) -> f64
fixation_time_neutral(ne: f64) -> f64
bottleneck_heterozygosity(h0: f64, n_bottleneck: f64, generations: usize) -> f64
hardy_weinberg(p: f64) -> (f64, f64, f64)
hardy_weinberg_multi`(freqs: &[f64]) -> Vec<Vec<f64>>`
chi_squared_hw`(observed: &[f64], p: f64, n_total: f64) -> f64`
inbreeding_coefficient(h_obs: f64, h_exp: f64) -> f64
wahlund_effect`(subpop_freqs: &[f64]) -> f64`
fst`(subpop_freqs: &[f64]) -> f64`
nei_genetic_distance`(pop1_freqs: &[f64], pop2_freqs: &[f64]) -> f64`
expected_heterozygosity`(allele_freqs: &[f64]) -> f64`
allele_frequency_cline(x: f64, center: f64, width: f64) -> f64
effective_population_size(n_males: f64, n_females: f64) -> f64
recombination_frequency(recombinants: f64, total_offspring: f64) -> f64
map_distance_kosambi(recombination_freq: f64) -> f64
map_distance_haldane(recombination_freq: f64) -> f64
haldane_to_recombination(map_distance: f64) -> f64
lod_score(theta: f64, recombinants: usize, non_recombinants: usize) -> f64
three_point_cross_distance`(class_counts: &[f64; 8]) -> (f64, f64, f64)`
interference(observed_double_co: f64, expected_double_co: f64) -> f64
chiasma_frequency(recombination_freq: f64) -> f64
synaptonemal_complex_length(chromosome_length_mb: f64, loop_size_kb: f64) -> f64
coalescent_expected_time(n: usize) -> f64
watterson_theta(segregating_sites: usize, n: usize) -> f64
fst_pairwise(ht: f64, hs: f64) -> f64
nucleotide_diversity`(sequences: &[&[u8]]) -> f64`
tajima_d(pi: f64, theta_w: f64, n: usize, seg_sites: usize) -> f64
nei_distance`(pop1_freqs: &[f64], pop2_freqs: &[f64]) -> f64`
molecular_heterozygosity`(freqs: &[f64]) -> f64`
broad_sense_heritability(genetic_variance: f64, phenotypic_variance: f64) -> f64
narrow_sense_heritability(additive_variance: f64, phenotypic_variance: f64) -> f64
breeder_equation(heritability: f64, selection_differential: f64) -> f64
selection_differential(mean_selected: f64, mean_population: f64) -> f64
additive_genetic_variance(allele_freq: f64, allele_effect: f64) -> f64
dominance_variance(allele_freq: f64, dominance_deviation: f64) -> f64
qtl_effect_from_means(mean_aa: f64, mean_ab: f64, mean_bb: f64) -> (f64, f64)
phenotypic_variance_components(va: f64, vd: f64, ve: f64, vi: f64) -> f64
realized_heritability(response: f64, selection_differential: f64) -> f64
mid_parent_regression( parent1: f64, parent2: f64, heritability: f64, population_mean: f64, ) -> f64
lander_botstein_lod(n: usize, r_squared: f64) -> f64
polygenic_score`(effects: &[f64], genotypes: &[f64]) -> f64`
falconer_liability_threshold(prevalence: f64) -> f64
snp_heritability( beta_squared_sum: f64, variance_explained: f64, phenotypic_variance: f64, ) -> f64
allele_frequency_selection(p: f64, w_aa: f64, w_ab: f64, w_bb: f64) -> f64
selection_iterate(p0: f64, w_aa: f64, w_ab: f64, w_bb: f64, generations: usize) -> Vec<f64>
selection_coefficient(w_mutant: f64, w_wildtype: f64) -> f64
mutation_selection_balance(mu: f64, s: f64) -> f64
mutation_selection_balance_recessive(mu: f64, s: f64) -> f64
frequency_dependent_fitness(p: f64, a: f64, b: f64) -> f64
heterozygote_advantage_equilibrium(s: f64, t: f64) -> f64
disruptive_selection( p: f64, w_aa: f64, w_ab: f64, w_bb: f64, generations: usize, ) -> Vec<f64>
truncation_selection(mean: f64, variance: f64, threshold: f64) -> f64
response_to_selection(heritability: f64, selection_differential: f64) -> f64

genomics API (46 functions)

FunctionSignature
gene_density(genes: usize, region_length_mb: f64) -> f64
cpg_enrichment(cpg_count: usize, c_count: usize, g_count: usize, length: usize) -> f64
codon_adaptation_index`(codon_weights: &[f64]) -> f64`
enc_wright`(codon_family_homozygosities: &[f64]) -> f64`
repeat_density(repeat_bases: usize, total_bases: usize) -> f64
synteny_score(conserved_blocks: usize, total_genes: usize) -> f64
n50`(contig_lengths: &mut [f64]) -> f64`
genome_completeness_busco(complete: usize, fragmented: usize, total_buscos: usize) -> f64
ka_ks_ratio( nonsynonymous_subs: f64, synonymous_subs: f64, nonsynonymous_sites: f64, synonymous_sites: f64, ) -> f64
gc_isochore(gc_content: f64) -> &'static str
pwm_score`(pwm: &[Vec<f64>], sequence: &[u8]) -> f64`
pwm_scan`(pwm: &[Vec<f64>], sequence: &[u8], threshold: f64) -> Vec<(usize, f64)>`
information_content`(pwm: &[Vec<f64>]) -> Vec<f64>`
total_information`(pwm: &[Vec<f64>]) -> f64`
consensus_sequence`(pwm: &[Vec<f64>]) -> String`
frequency_matrix`(sequences: &[&[u8]], length: usize) -> Vec<Vec<f64>>`
find_orfs(sequence: &str, min_length: usize) -> Vec<(usize, usize, String)>
codon_usage(sequence: &str) -> Vec<(String, usize)>
reading_frame_proteins(sequence: &str, frame: usize) -> Vec<String>
gc_content(sequence: &str) -> f64
gc3_content(sequence: &str) -> f64
effective_number_of_codons`(codon_counts: &[(String, usize)]) -> f64`
longest_orf_length(sequence: &str) -> usize
nucleotide_frequency`(sequence: &str) -> [f64; 4]`
translate(sequence: &str) -> String
reverse_complement(sequence: &str) -> String
kmer_count`(sequence: &[u8], k: usize) -> Vec<(Vec<u8>, usize)>`
gc_skew`(sequence: &[u8], window: usize) -> Vec<f64>`
cpg_observed_expected`(sequence: &[u8]) -> f64`
linguistic_complexity`(sequence: &[u8]) -> f64`
at_content`(sequence: &[u8]) -> f64`
dinucleotide_frequency`(sequence: &[u8]) -> Vec<(u8, u8, f64)>`
sequence_entropy`(sequence: &[u8]) -> f64`
transition_transversion`(sequence_a: &[u8], sequence_b: &[u8]) -> f64`
snp_allele_frequency(alt_count: usize, total_alleles: usize) -> f64
minor_allele_frequency(allele_freq: f64) -> f64
hardy_weinberg_expected(p: f64) -> (f64, f64, f64)
hardy_weinberg_chi_squared`(observed: &[f64; 3], expected: &[f64; 3]) -> f64`
ti_tv_ratio(transitions: usize, transversions: usize) -> f64
heterozygosity`(allele_freqs: &[f64]) -> f64`
fst_weir_cockerham(het_within: f64, het_total: f64) -> f64
linkage_disequilibrium(freq_ab: f64, freq_a: f64, freq_b: f64) -> f64
r_squared_ld(d: f64, freq_a: f64, freq_b: f64) -> f64
d_prime(d: f64, freq_a: f64, freq_b: f64) -> f64
indel_frameshift(indel_length: i64) -> bool
copy_number_variant_dosage(reads_sample: f64, reads_reference: f64, ploidy: f64) -> f64

immunology API (49 functions)

FunctionSignature
clonal_expansion(n0: f64, proliferation_rate: f64, death_rate: f64, t: f64) -> f64
clonal_selection_dynamics( naive: f64, effector: f64, memory: f64, antigen: f64, k_activation: f64, k_prolif: f64, k_death: f64, k_memory: f64, k_clear: f64, ) -> (f64, f64, f64, f64)
clonal_selection_simulate( naive0: f64, effector0: f64, memory0: f64, antigen0: f64, k_activation: f64, k_prolif: f64, k_death: f64, k_memory: f64, k_clear: f64, dt: f64, steps: usize, ) -> Vec<(f64, f64, f64, f64)>
tcell_activation_threshold(signal: f64, costimulation: f64, threshold: f64) -> bool
cytokine_hill_response(cytokine: f64, ec50: f64, n: f64) -> f64
treg_suppression(effector_rate: f64, treg: f64, k_supp: f64) -> f64
memory_recall_response( memory: f64, antigen: f64, k_recall: f64, fold_expansion: f64, ) -> f64
somatic_affinity_maturation( initial_kd: f64, rounds: usize, improvement_per_round: f64, ) -> f64
antibody_titer(dilution_factor: f64, endpoint_dilution: usize) -> f64
isotype_switch_probability( cytokine_signal: f64, switch_region_accessibility: f64, aid_activity: f64, ) -> f64
somatic_hypermutation_rate(aid_expression: f64, base_rate: f64, hotspot_factor: f64) -> f64
neutralization_potency(ic50: f64, virus_titer: f64) -> f64
opsonization_index( antibody_bound: f64, fc_receptor_density: f64, complement_coating: f64, ) -> f64
adcc_killing_rate( antibody_density: f64, nk_cell_count: f64, target_count: f64, k_sat: f64, ) -> f64
complement_cascade_c3b(c3: f64, convertase_activity: f64, factor_h_inhibition: f64) -> f64
multivalent_avidity(monovalent_kd: f64, valency: usize, cooperativity: f64) -> f64
elisa_concentration(od: f64, od_max: f64, ec50: f64, hill: f64) -> f64
b_cell_germinal_center_selection(affinity: f64, threshold: f64, t_cell_help: f64) -> bool
cytokine_production_rate(stimulus: f64, cell_count: f64, max_rate: f64, ec50: f64) -> f64
cytokine_decay(concentration: f64, half_life: f64, dt: f64) -> f64
th1_th2_balance(ifn_gamma: f64, il4: f64) -> f64
th17_regulatory_balance(il17: f64, il10: f64, tgf_beta: f64) -> f64
cytokine_storm_severity( il6: f64, tnf: f64, il1b: f64, threshold_il6: f64, threshold_tnf: f64, threshold_il1b: f64, ) -> f64
jak_stat_signaling( cytokine: f64, receptor_density: f64, jak_activity: f64, socs_inhibition: f64, ) -> f64
nfkb_activation(stimulus: f64, ikk_activity: f64, ikb_level: f64) -> f64
chemokine_gradient( source_conc: f64, distance: f64, diffusion_coeff: f64, decay_rate: f64, ) -> f64
autocrine_loop(production_rate: f64, receptor_sensitivity: f64, degradation: f64) -> f64
paracrine_signaling( source_cells: f64, target_distance: f64, diffusion: f64, production: f64, decay: f64, ) -> f64
nlrp3_inflammasome_activation( damp_signal: f64, nlrp3: f64, asc: f64, threshold: f64, ) -> f64
sir_immune( s: f64, i: f64, r: f64, immune: f64, beta: f64, gamma: f64, k_immune: f64, k_decay: f64, ) -> (f64, f64, f64, f64)
sir_immune_simulate( s0: f64, i0: f64, r0: f64, immune0: f64, beta: f64, gamma: f64, k_immune: f64, k_decay: f64, dt: f64, steps: usize, ) -> Vec<(f64, f64, f64, f64)>
vaccine_efficacy(arr_vacc: f64, arr_placebo: f64) -> f64
herd_immunity_fraction(r0: f64) -> f64
antibody_decay(ab0: f64, half_life: f64, t: f64) -> f64
booster_response(ab_pre: f64, fold_boost: f64, decay_rate: f64, t: f64) -> f64
seroconversion_probability(dose: f64, ed50: f64, n: f64) -> f64
waning_immunity(immune_fraction: f64, waning_rate: f64, t: f64) -> f64
maternal_antibody_decay(ab0: f64, half_life: f64, t_months: f64) -> f64
seir_step( s: f64, e: f64, i: f64, r: f64, beta: f64, sigma: f64, gamma: f64, dt: f64, ) -> (f64, f64, f64, f64)
antigen_antibody_binding(ab: f64, ag: f64, ka: f64) -> f64
affinity_maturation(kd_initial: f64, mutation_rate: f64, generations: usize) -> Vec<f64>
avidity(kd_monovalent: f64, n_sites: usize) -> f64
neutralization_curve(dose: f64, ic50: f64, n: f64) -> f64
complement_cascade(c0: f64, rate: f64, t: f64) -> f64
toll_like_receptor_activation(pamp: f64, receptor_density: f64, kd: f64) -> f64
phagocytosis_rate(pathogen: f64, phagocyte: f64, k_phag: f64, saturation: f64) -> f64
nk_cell_killing( target_mhc: f64, mhc_threshold: f64, activating_ligand: f64, kill_rate: f64, ) -> f64
cytokine_cascade`( initial_cytokines: &[f64], amplification: &[Vec<f64>], steps: usize, ) -> Vec<Vec<f64>>`
inflammasome_activation(damp: f64, signal2: f64, threshold: f64, nlrp3: f64) -> f64

marine_biology API (62 functions)

FunctionSignature
bleaching_thermal_threshold(sst: f64, mmm: f64) -> f64
dhw_accumulation(dhw_accumulated: f64, hotspot: f64, dt_weeks: f64) -> f64
calcification_rate( omega_aragonite: f64, temperature: f64, light: f64, max_rate: f64, ) -> f64
reef_rugosity(surface_distance: f64, linear_distance: f64) -> f64
coral_recruitment_rate( larval_supply: f64, settlement_rate: f64, post_settlement_survival: f64, available_substrate: f64, ) -> f64
symbiodinium_density( photosynthesis_rate: f64, respiration_rate: f64, expulsion_rate: f64, dt: f64, current_density: f64, ) -> f64
ocean_acidification_saturation(ca_conc: f64, co3_conc: f64, ksp: f64) -> f64
mangrove_carbon_sequestration(biomass: f64, carbon_fraction: f64, growth_rate: f64) -> f64
seagrass_light_attenuation( surface_irradiance: f64, attenuation_coeff: f64, depth: f64, ) -> f64
marine_protected_area_spillover( biomass_inside: f64, biomass_outside: f64, perimeter_area_ratio: f64, diffusion: f64, ) -> f64
trophic_transfer_efficiency(production_upper: f64, production_lower: f64) -> f64
fish_growth_von_bertalanffy(l_inf: f64, k: f64, t: f64, t0: f64) -> f64
fish_mortality_total(natural: f64, fishing: f64) -> f64
maximum_sustainable_yield(r: f64, k: f64) -> f64
stock_recruitment_beverton_holt(alpha: f64, beta: f64, spawners: f64) -> f64
stock_recruitment_ricker(alpha: f64, beta: f64, spawners: f64) -> f64
catch_per_unit_effort(catch: f64, effort: f64) -> f64
decompression_no_stop_time(depth_m: f64, surface_rate: f64) -> f64
schaefer_biomass(biomass: f64, r: f64, k: f64, catch: f64, dt: f64) -> f64
fishing_mortality_from_effort(catchability: f64, effort: f64) -> f64
yield_per_recruit(f: f64, m: f64, w_inf: f64, k: f64, t_c: f64, t_r: f64, t0: f64) -> f64
spawning_stock_biomass`(numbers: &[f64], weights: &[f64], maturity: &[f64]) -> f64`
exploitation_rate(f: f64, z: f64) -> f64
virtual_population_analysis(catch: f64, m: f64, f_rate: f64) -> f64
length_weight_relation(length: f64, a: f64, b: f64) -> f64
condition_factor_fulton(weight: f64, length: f64) -> f64
surplus_production(biomass_t: f64, biomass_t1: f64, catch: f64) -> f64
fox_model_equilibrium_yield(f: f64, msy: f64, f_msy: f64) -> f64
selectivity_logistic(length: f64, l50: f64, slope: f64) -> f64
discard_mortality(catch: f64, discard_fraction: f64, discard_survival: f64) -> f64
osmoregulation_flux( internal_osmolarity: f64, external_osmolarity: f64, permeability: f64, surface_area: f64, ) -> f64
coral_bleaching_threshold(sst: f64, mmm: f64) -> f64
degree_heating_weeks`(weekly_anomalies: &[f64]) -> f64`
ocean_acidification_ph(pco2: f64, alkalinity: f64, temperature: f64) -> f64
carbonate_saturation_state(ca_concentration: f64, co3_concentration: f64, ksp: f64) -> f64
bioluminescence_intensity(luciferin: f64, luciferase: f64, oxygen: f64, km: f64) -> f64
depth_light_attenuation(surface_irradiance: f64, attenuation_coeff: f64, depth: f64) -> f64
thermohaline_density(temperature: f64, salinity: f64) -> f64
mixed_layer_depth_temperature`( profile_temps: &[f64], profile_depths: &[f64], threshold: f64, ) -> f64`
ekman_depth(coriolis: f64, eddy_viscosity: f64) -> f64
ekman_transport(wind_stress: f64, coriolis: f64, density: f64) -> f64
sverdrup_transport(wind_stress_curl: f64, beta: f64) -> f64
primary_production_eppley(chlorophyll: f64, par: f64, temperature: f64) -> f64
new_production_f_ratio(nitrate_uptake: f64, total_uptake: f64) -> f64
nitrogen_fixation_rate(temperature: f64, iron: f64, light: f64) -> f64
oxygen_minimum_zone_depth( surface_o2: f64, respiration_rate: f64, ventilation_rate: f64, ) -> f64
seawater_sound_speed(temperature: f64, salinity: f64, depth: f64) -> f64
coral_calcification_rate(aragonite_saturation: f64, temperature: f64, light: f64) -> f64
tidal_range(lunar_amplitude: f64, solar_amplitude: f64, phase_angle: f64) -> f64
wave_energy_density(density: f64, gravity: f64, wave_height: f64) -> f64
deep_water_wave_speed(gravity: f64, wavelength: f64) -> f64
upwelling_velocity( wind_stress: f64, coriolis: f64, density: f64, coast_distance: f64, ) -> f64
phytoplankton_growth(mu_max: f64, nutrient: f64, ks: f64, light: f64, ki: f64) -> f64
bloom_critical_depth( surface_irradiance: f64, compensation_irradiance: f64, attenuation: f64, ) -> f64
sverdrup_critical_depth( avg_irradiance: f64, compensation_irradiance: f64, mixed_layer_depth: f64, attenuation: f64, ) -> f64
nutrient_phytoplankton_zooplankton_step( n: f64, p: f64, z: f64, dt: f64, mu: f64, ks: f64, grazing: f64, kp: f64, mortality_z: f64, recycling: f64, ) -> (f64, f64, f64)
chlorophyll_a_from_biomass(biomass: f64, carbon_to_chl_ratio: f64) -> f64
zooplankton_diel_migration_depth( daytime_depth: f64, nighttime_depth: f64, time_hours: f64, ) -> f64
harmful_algal_bloom_toxin( cell_density: f64, toxin_per_cell: f64, decay_rate: f64, t: f64, ) -> f64
redfield_ratio_deviation(c: f64, n: f64, p: f64) -> (f64, f64)
spring_bloom_timing(mixed_layer_depth: f64, critical_depth: f64) -> bool
export_production(primary_production: f64, f_ratio: f64) -> f64

microbiology API (44 functions)

FunctionSignature
biofilm_formation_rate( planktonic: f64, attachment_rate: f64, surface_area: f64, detachment_rate: f64, biofilm: f64, ) -> f64
biofilm_thickness(growth_rate: f64, nutrient: f64, ks: f64, detachment: f64, t: f64) -> f64
extracellular_matrix_production( cell_density: f64, signal: f64, max_rate: f64, threshold: f64, ) -> f64
biofilm_diffusion_limitation( bulk_conc: f64, thickness: f64, diffusion_biofilm: f64, consumption_rate: f64, ) -> f64
persister_fraction( antibiotic_conc: f64, mic: f64, base_fraction: f64, max_fraction: f64, ) -> f64
antibiotic_resistance_mutation_rate( population: f64, mutation_rate: f64, selective_advantage: f64, ) -> f64
minimum_inhibitory_concentration_ratio(mic_resistant: f64, mic_susceptible: f64) -> f64
horizontal_gene_transfer(donor: f64, recipient: f64, conjugation_rate: f64) -> f64
competence_transformation( dna_conc: f64, competent_cells: f64, uptake_rate: f64, integration_efficiency: f64, ) -> f64
phage_therapy_lysis( phage: f64, bacteria: f64, adsorption_rate: f64, burst_size: f64, latent_period: f64, dt: f64, ) -> (f64, f64)
chemostat_steady_state_biomass(y: f64, s_in: f64, ks: f64, mu_max: f64, d: f64) -> f64
chemostat_washout_dilution(mu_max: f64, s_in: f64, ks: f64) -> f64
minimum_inhibitory_concentration( e0: f64, emax: f64, ec50: f64, n: f64, target_kill: f64, ) -> f64
competitive_exclusion( x1: f64, x2: f64, s: f64, mu1: f64, mu2: f64, ks1: f64, ks2: f64, y1: f64, y2: f64, d: f64, s_in: f64, ) -> (f64, f64, f64)
serial_dilution( n0: f64, dilution_factor: f64, transfers: usize, growth_per_cycle: f64, ) -> Vec<f64>
biofilm_formation( planktonic: f64, attachment_rate: f64, detachment_rate: f64, biofilm: f64, carrying_capacity: f64, ) -> (f64, f64)
quorum_sensing( cell_density: f64, autoinducer_production: f64, threshold: f64, n_hill: f64, ) -> f64
colony_forming_units(od600: f64, calibration_factor: f64) -> f64
turbidostat(biomass: f64, target_od: f64, mu: f64, dt: f64) -> f64
ph_growth_response(ph: f64, ph_opt: f64, ph_min: f64, ph_max: f64) -> f64
monod_growth(mu_max: f64, s: f64, ks: f64) -> f64
monod_dynamics( x: f64, s: f64, mu_max: f64, ks: f64, y: f64, d: f64, s_in: f64, ) -> (f64, f64)
monod_simulate( x0: f64, s0: f64, mu_max: f64, ks: f64, y: f64, d: f64, s_in: f64, dt: f64, steps: usize, ) -> Vec<(f64, f64)>
bacterial_growth_phases(n0: f64, mu: f64, k: f64, lag: f64, t: f64) -> f64
generation_time_bacteria(mu: f64) -> f64
death_phase(n_peak: f64, death_rate: f64, t: f64) -> f64
diauxic_growth(s1: f64, s2: f64, mu1: f64, mu2: f64, ks1: f64, ks2: f64, ki: f64) -> f64
fermentation_yield(substrate: f64, yield_coefficient: f64) -> f64
anaerobic_atp_yield(glucose_moles: f64, pathway_efficiency: f64) -> f64
chemolithoautotrophy_energy(delta_g: f64, moles_substrate: f64, efficiency: f64) -> f64
nitrogen_fixation_cost(n2_fixed: f64, atp_per_n2: f64) -> f64
denitrification_rate( no3: f64, carbon_source: f64, max_rate: f64, ks_no3: f64, ks_c: f64, ) -> f64
sulfate_reduction_rate( sulfate: f64, electron_donor: f64, max_rate: f64, ks_so4: f64, ks_donor: f64, ) -> f64
methanogenesis_rate( co2: f64, h2: f64, max_rate: f64, ks_co2: f64, ks_h2: f64, temperature: f64, ) -> f64
anammox_rate(nh4: f64, no2: f64, max_rate: f64, ks_nh4: f64, ks_no2: f64) -> f64
iron_oxidation_rate(fe2: f64, o2: f64, ph: f64, max_rate: f64) -> f64
bioremediation_degradation( contaminant: f64, biomass: f64, max_rate: f64, ks: f64, inhibition_conc: f64, ) -> f64
quorum_sensing_ahl(n: f64, k_prod: f64, k_deg: f64, diffusion: f64) -> f64
quorum_activation(ahl: f64, threshold: f64, n: f64) -> f64
quorum_bistable( ahl0: f64, n_cells: f64, k_prod: f64, k_deg: f64, k_auto: f64, threshold: f64, hill_n: f64, dt: f64, steps: usize, ) -> Vec<f64>
biofilm_growth( b: f64, mu: f64, k_attach: f64, planktonic: f64, k_detach: f64, k_max: f64, ) -> f64
biofilm_simulate( b0: f64, planktonic0: f64, mu: f64, k_attach: f64, k_detach: f64, k_max: f64, growth_p: f64, dt: f64, steps: usize, ) -> Vec<(f64, f64)>
antibiotic_kill(n: f64, mic: f64, conc: f64, k_max: f64, hill: f64) -> f64
mutation_resistance_probability(mu: f64, n: f64) -> f64

mycology API (53 functions)

FunctionSignature
decomposition_rate(k: f64, mass: f64) -> f64
remaining_mass(initial: f64, k: f64, t: f64) -> f64
lignocellulose_decay( cellulose: f64, lignin: f64, k_cellulose: f64, k_lignin: f64, dt: f64, ) -> (f64, f64)
enzyme_mediated_decomposition(substrate: f64, enzyme: f64, vmax: f64, km: f64) -> f64
mycorrhizal_nutrient_exchange( plant_carbon: f64, fungal_phosphorus: f64, exchange_coeff: f64, ) -> (f64, f64)
saprotrophic_efficiency(carbon_assimilated: f64, carbon_consumed: f64) -> f64
humus_formation_rate( recalcitrant_fraction: f64, decomposition_rate: f64, carbon_input: f64, ) -> f64
nitrogen_mineralization( cn_ratio_substrate: f64, cn_ratio_microbe: f64, carbon_flow: f64, ) -> f64
white_rot_lignin_degradation( lignin: f64, laccase_activity: f64, peroxidase_activity: f64, km: f64, ) -> f64
brown_rot_cellulose_attack( cellulose: f64, hydroxyl_radical: f64, rate_constant: f64, ) -> f64
soft_rot_cavity_formation( cellulose: f64, moisture: f64, enzyme_activity: f64, threshold_moisture: f64, ) -> f64
mycorrhizal_carbon_cost(plant_npp: f64, allocation_fraction: f64) -> f64
ectomycorrhizal_hyphal_exploration( biomass: f64, soil_volume: f64, exploration_type_factor: f64, ) -> f64
arbuscular_mycorrhizal_phosphorus_uptake( hyphal_length: f64, soil_p: f64, uptake_rate: f64, km: f64, ) -> f64
wood_decay_mass_loss( initial_density: f64, fungal_activity: f64, moisture_factor: f64, temp_factor: f64, t: f64, ) -> f64
litter_quality_index(nitrogen_content: f64, lignin_content: f64) -> f64
carbon_use_efficiency(co2_respired: f64, carbon_assimilated: f64) -> f64
saprotrophic_decomposition( substrate_mass: f64, enzyme_activity: f64, moisture: f64, temperature: f64, optimal_temp: f64, ) -> f64
wood_decay_rate( lignin_fraction: f64, cellulose_fraction: f64, fungal_type_lignin_pref: f64, ) -> f64
fungal_succession_priority(colonization_order: usize, competitive_ability: f64) -> f64
spore_germination_rate( moisture: f64, temperature: f64, temp_min: f64, temp_max: f64, temp_opt: f64, ) -> f64
fairy_ring_expansion(ring_radius: f64, growth_rate: f64, nutrient_depletion: f64) -> f64
ergosterol_biomass_estimate(ergosterol_conc: f64, conversion_factor: f64) -> f64
fungal_carbon_mineralization(biomass: f64, cue: f64, substrate_consumed: f64) -> f64
mycelial_network_resilience(connections: usize, nodes: usize, redundancy: f64) -> f64
hyphal_growth_rate(tip_extension: f64, branching_rate: f64, tips: f64) -> f64
colony_radial_growth(r0: f64, rate: f64, t: f64) -> f64
spore_germination_probability( water_activity: f64, temperature: f64, aw_min: f64, t_min: f64, t_max: f64, ) -> f64
mycelial_network_transport( concentration_source: f64, concentration_sink: f64, conductance: f64, ) -> f64
chitin_content(dry_mass: f64, chitin_fraction: f64) -> f64
fungal_biomass_from_ergosterol(ergosterol_ug: f64, conversion_factor: f64) -> f64
substrate_colonization_speed(growth_rate: f64, nutrient_availability: f64, km: f64) -> f64
fairy_ring_radius(initial_radius: f64, expansion_rate: f64, t: f64) -> f64
spore_dispersal_distance( wind_speed: f64, release_height: f64, terminal_velocity: f64, ) -> f64
yeast_budding_rate( nutrient: f64, temperature: f64, optimal_temp: f64, temp_width: f64, ) -> f64
mycelial_biomass_logistic(biomass: f64, max_biomass: f64, mu_max: f64, dt: f64) -> f64
branching_frequency(hyphal_length: f64, branch_count: f64) -> f64
hyphal_tip_vesicle_supply( vesicle_production: f64, distance_to_tip: f64, diffusion: f64, ) -> f64
conidiation_rate(nutrient_depletion: f64, light_signal: f64, threshold: f64) -> f64
rhizomorph_transport_rate( pressure_gradient: f64, conductance: f64, cross_section: f64, ) -> f64
lichenization_benefit( algal_photosynthate: f64, fungal_protection: f64, exchange_rate: f64, ) -> f64
spore_survival_uv(initial_viability: f64, uv_dose: f64, sensitivity: f64) -> f64
monod_fungal_growth(mu_max: f64, substrate: f64, ks: f64) -> f64
biofilm_formation_rate( cell_density: f64, surface_affinity: f64, quorum_signal: f64, threshold: f64, ) -> f64
mycorrhizal_nutrient_transfer( root_surface_area: f64, hyphal_density: f64, nutrient_conc: f64, transfer_efficiency: f64, ) -> f64
mycorrhizal_carbon_allocation(carbon_to_fungus: f64, total_photosynthate: f64) -> f64
mycorrhizal_colonization( inoculum_potential: f64, root_growth_rate: f64, susceptibility: f64, time: f64, ) -> f64
common_mycorrhizal_network_transfer( donor_surplus: f64, recipient_deficit: f64, network_conductance: f64, ) -> f64
lichen_photobiont_contribution( photobiont_biomass: f64, photosynthesis_rate: f64, transfer_fraction: f64, ) -> f64
endophyte_benefit(plant_growth_base: f64, endophyte_effect: f64, stress_level: f64) -> f64
fungal_network_distance(hyphal_growth_rate: f64, branching_angle: f64, time: f64) -> f64
truffle_spore_dispersal( spore_count: f64, wind_speed: f64, animal_vectors: f64, decay_distance: f64, distance: f64, ) -> f64
mycobiome_diversity_shannon`(abundances: &[f64]) -> f64`

neuroscience API (54 functions)

FunctionSignature
firing_rate`(spikes: &[usize], dt: f64, total_steps: usize) -> f64`
interspike_intervals`(spikes: &[usize], dt: f64) -> Vec<f64>`
coefficient_of_variation`(intervals: &[f64]) -> f64`
fano_factor`(spike_counts: &[usize]) -> f64`
spike_count_correlation`(spikes_a: &[usize], spikes_b: &[usize]) -> f64`
cross_correlogram`( spikes_a: &[f64], spikes_b: &[f64], bin_width: f64, max_lag: f64, ) -> Vec<(f64, usize)>`
local_field_potential_power`(signal: &[f64], freq: f64, dt: f64) -> f64`
spike_triggered_average`(stimulus: &[f64], spike_times: &[usize], window: usize) -> Vec<f64>`
burst_detection`(isi: &[f64], threshold: f64) -> Vec<(usize, usize)>`
information_rate`(spike_counts: &[usize], stimulus_repeats: usize) -> f64`
drift_diffusion_decision( drift_rate: f64, noise: f64, threshold: f64, bias: f64, dt: f64, steps: usize, ) -> (f64, usize)
softmax_choice`(values: &[f64], temperature: f64) -> Vec<f64>`
rescorla_wagner_update(value: f64, reward: f64, alpha: f64) -> f64
td_learning_update( value_current: f64, value_next: f64, reward: f64, alpha: f64, gamma: f64, ) -> f64
reward_prediction_error(reward: f64, expected: f64) -> f64
weber_fraction(jnd: f64, stimulus_intensity: f64) -> f64
signal_to_noise_neural(signal_mean: f64, noise_std: f64) -> f64
attentional_gain(stimulus: f64, attention: f64, baseline: f64, gain: f64) -> f64
working_memory_decay( strength: f64, decay_rate: f64, interference_count: usize, dt: f64, ) -> f64
neural_efficiency(performance: f64, metabolic_cost: f64) -> f64
bayesian_integration( prior_mean: f64, prior_var: f64, likelihood_mean: f64, likelihood_var: f64, ) -> (f64, f64)
step(&mut self, i_ext: f64, dt: f64)
simulate(&mut self, i_ext: f64, dt: f64, steps: usize) -> Vec<f64>
new(a: f64, b: f64, tau: f64) -> Self
step(&mut self, i_ext: f64, dt: f64)
simulate(&mut self, i_ext: f64, dt: f64, steps: usize) -> Vec<(f64, f64)>
new(v_rest: f64, v_thresh: f64, v_reset: f64, tau: f64, r: f64) -> Self
step(&mut self, i_ext: f64, dt: f64) -> bool
simulate(&mut self, i_ext: f64, dt: f64, steps: usize) -> (Vec<f64>, Vec<usize>)
regular_spiking() -> Self
fast_spiking() -> Self
bursting() -> Self
step(&mut self, i_ext: f64, dt: f64) -> bool
simulate(&mut self, i_ext: f64, dt: f64, steps: usize) -> (Vec<f64>, Vec<usize>)
step(&mut self, i_ext: f64, dt: f64)
simulate(&mut self, i_ext: f64, dt: f64, steps: usize) -> Vec<(f64, f64)>
excitatory(weight: f64) -> Self
inhibitory(weight: f64) -> Self
step(&mut self, pre_spike: bool, dt: f64)
current(&self, v_post: f64) -> f64
stdp_update(delta_t: f64, a_plus: f64, a_minus: f64, tau_plus: f64, tau_minus: f64) -> f64
simulate_network`( n_neurons: usize, weights: &[Vec<f64>], external_current: f64, dt: f64, steps: usize, threshold: f64, reset: f64, tau: f64, resistance: f64, rest: f64, ) -> Vec<Vec<f64>>`
mean_field_rate(mu: f64, sigma: f64, threshold: f64, reset: f64, tau: f64) -> f64
ltp_magnitude( stimulus_frequency: f64, calcium_influx: f64, threshold: f64, max_potentiation: f64, ) -> f64
ltd_magnitude( calcium_level: f64, low_threshold: f64, high_threshold: f64, max_depression: f64, ) -> f64
stdp_weight_change( delta_t_ms: f64, a_plus: f64, a_minus: f64, tau_plus: f64, tau_minus: f64, ) -> f64
synaptic_vesicle_release_probability(calcium: f64, n_vesicles: usize, p_single: f64) -> f64
short_term_facilitation(baseline_p: f64, facilitation: f64, tau: f64, isi: f64) -> f64
short_term_depression(available: f64, release_p: f64, recovery_tau: f64, isi: f64) -> f64
miniature_epsp_amplitude( quantal_size: f64, n_receptors: f64, receptor_conductance: f64, ) -> f64
nmda_voltage_dependence(voltage: f64, mg_conc: f64) -> f64
dendritic_spine_volume_change( calcium: f64, actin_polymerization: f64, spine_volume: f64, max_growth: f64, ) -> f64
homeostatic_synaptic_scaling( target_rate: f64, current_rate: f64, scaling_tau: f64, dt: f64, ) -> f64
glutamate_clearance(released: f64, transporter_density: f64, vmax: f64, km: f64) -> f64

nutrition API (64 functions)

FunctionSignature
nutrient_absorption_first_order(dose: f64, ka: f64, t: f64) -> f64
gastric_emptying(volume: f64, half_life: f64, t: f64) -> f64
glycemic_index_incremental_auc`(glucose_values: &[f64], baseline: f64, dt: f64) -> f64`
protein_digestibility_corrected_amino_acid_score( limiting_aa_mg_g: f64, reference_mg_g: f64, digestibility: f64, ) -> f64
nitrogen_balance(protein_intake_g: f64, urinary_n: f64, fecal_n: f64, sweat_n: f64) -> f64
water_requirement_holliday_segar(weight_kg: f64) -> f64
iron_absorption(non_heme_mg: f64, enhancers: f64, inhibitors: f64, heme_mg: f64) -> f64
calcium_absorption_fraction(intake_mg: f64, vitamin_d_nmol: f64) -> f64
intestinal_transit_time(fiber_g: f64, fluid_ml: f64, base_time_h: f64) -> f64
oral_bioavailability( fraction_absorbed: f64, gut_wall_extraction: f64, hepatic_extraction: f64, ) -> f64
michaelis_menten_absorption(vmax: f64, concentration: f64, km: f64) -> f64
fat_soluble_vitamin_absorption(dose: f64, fat_intake_g: f64, bile_salt_conc: f64) -> f64
zinc_absorption_fraction(intake_mg: f64, phytate_mg: f64) -> f64
paracellular_absorption(permeability: f64, surface_area: f64, concentration: f64) -> f64
glucose_transporter_kinetics(glucose: f64, vmax: f64, km: f64, insulin_factor: f64) -> f64
amino_acid_absorption_rate( concentration: f64, vmax: f64, km: f64, competition_factor: f64, ) -> f64
basal_metabolic_rate_mifflin( weight_kg: f64, height_cm: f64, age: f64, is_male: bool, ) -> f64
tdee(bmr: f64, activity_factor: f64, thermic_effect: f64) -> f64
energy_balance(intake_kcal: f64, expenditure_kcal: f64) -> f64
weight_change_prediction(energy_balance_kcal_per_day: f64, days: f64) -> f64
diet_induced_thermogenesis(protein_kcal: f64, carb_kcal: f64, fat_kcal: f64) -> f64
respiratory_exchange_ratio(co2_produced: f64, o2_consumed: f64) -> f64
substrate_oxidation_from_rer(rer: f64) -> (f64, f64)
glycemic_index_load(gi: f64, carb_grams: f64) -> f64
insulin_index_response(glycemic_load: f64, protein_factor: f64, protein_grams: f64) -> f64
body_composition_bmi(weight_kg: f64, height_m: f64) -> f64
body_fat_percentage_navy(waist_cm: f64, neck_cm: f64, height_cm: f64, is_male: bool) -> f64
harris_benedict_male(weight_kg: f64, height_cm: f64, age: f64) -> f64
harris_benedict_female(weight_kg: f64, height_cm: f64, age: f64) -> f64
mifflin_st_jeor_male(weight_kg: f64, height_cm: f64, age: f64) -> f64
mifflin_st_jeor_female(weight_kg: f64, height_cm: f64, age: f64) -> f64
total_daily_energy_expenditure(bmr: f64, activity_factor: f64) -> f64
thermic_effect_of_food(caloric_intake: f64, tef_fraction: f64) -> f64
body_mass_index(weight_kg: f64, height_m: f64) -> f64
lean_body_mass_boer_male(weight_kg: f64, height_cm: f64) -> f64
lean_body_mass_boer_female(weight_kg: f64, height_cm: f64) -> f64
body_fat_percentage(total_mass: f64, lean_mass: f64) -> f64
katch_mcardle_bmr(lean_body_mass_kg: f64) -> f64
cunningham_bmr(lean_body_mass_kg: f64) -> f64
respiratory_quotient(co2_produced: f64, o2_consumed: f64) -> f64
energy_from_macros(carb_g: f64, protein_g: f64, fat_g: f64, alcohol_g: f64) -> f64
waist_to_hip_ratio(waist_cm: f64, hip_cm: f64) -> f64
body_surface_area_dubois(weight_kg: f64, height_cm: f64) -> f64
ideal_body_weight_devine_male(height_cm: f64) -> f64
ideal_body_weight_devine_female(height_cm: f64) -> f64
adjusted_body_weight(actual_kg: f64, ideal_kg: f64) -> f64
resting_metabolic_rate_owen_male(weight_kg: f64) -> f64
resting_metabolic_rate_owen_female(weight_kg: f64) -> f64
glycemic_load(glycemic_index: f64, available_carbs_g: f64) -> f64
fat_oxidation_rate(vo2: f64, vco2: f64) -> f64
carb_oxidation_rate(vco2: f64, vo2: f64) -> f64
protein_requirement_rda(weight_kg: f64) -> f64
estimated_average_requirement_calcium(age: f64) -> f64
recommended_daily_intake_scaling(body_weight_kg: f64, rdi_per_kg: f64) -> f64
vitamin_d_synthesis( uvb_intensity: f64, skin_area: f64, melanin_factor: f64, exposure_minutes: f64, ) -> f64
iron_absorption_enhancers(non_heme_iron: f64, vitamin_c_mg: f64, meat_factor: f64) -> f64
calcium_absorption(intake: f64, vitamin_d: f64, age_factor: f64) -> f64
zinc_copper_ratio(zinc_intake: f64, copper_intake: f64) -> f64
bioavailability_factor( intake: f64, absorption_fraction: f64, first_pass_extraction: f64, ) -> f64
folate_neural_tube_risk(folate_ug: f64, risk_base: f64, protective_threshold: f64) -> f64
omega3_omega6_ratio(omega3: f64, omega6: f64) -> f64
antioxidant_capacity_orac(concentration: f64, orac_per_unit: f64) -> f64
iodine_thyroid_requirement( body_weight_kg: f64, base_requirement_ug_per_kg: f64, pregnancy_factor: f64, ) -> f64
nutrient_density_score`(nutrients: &[f64], daily_values: &[f64], calories: f64) -> f64`

paleobiology API (50 functions)

FunctionSignature
radiometric_age(parent: f64, daughter: f64, decay_constant: f64) -> f64
half_life_to_decay_constant(half_life: f64) -> f64
carbon14_age(ratio_sample: f64, ratio_modern: f64) -> f64
extinction_rate(extinctions: f64, taxa_at_start: f64, interval_myr: f64) -> f64
origination_rate(originations: f64, taxa_at_end: f64, interval_myr: f64) -> f64
net_diversification_rate(origination: f64, extinction: f64) -> f64
turnover_rate(origination: f64, extinction: f64) -> f64
survivorship_cohort(initial: f64, extinction_rate: f64, t_myr: f64) -> f64
standing_diversity(origination_rate: f64, extinction_rate: f64, d0: f64, t: f64) -> f64
taxonomic_rate_sampling_corrected( observed_crossers: f64, singletons: f64, total: f64, ) -> f64
stratigraphic_completeness(gaps_duration: f64, total_duration: f64) -> f64
confidence_interval_range(known_range: f64, n_horizons: f64, confidence: f64) -> f64
logistic_diversity(d0: f64, r: f64, k: f64, t: f64) -> f64
recovery_time_after_extinction( pre_extinction: f64, post_extinction: f64, diversification_rate: f64, ) -> f64
signor_lipps_correction(observed_last: f64, sampling_prob: f64, n_taxa: f64) -> f64
potassium_argon_age(k40: f64, ar40: f64) -> f64
faith_phylogenetic_diversity`(branch_lengths: &[f64]) -> f64`
mean_pairwise_distance`(distances: &[f64], n_taxa: usize) -> f64`
net_relatedness_index(mpd_observed: f64, mpd_null_mean: f64, mpd_null_sd: f64) -> f64
nearest_taxon_index(mntd_observed: f64, mntd_null_mean: f64, mntd_null_sd: f64) -> f64
evolutionary_distinctiveness(terminal_branch_length: f64, clade_size: usize) -> f64
phylogenetic_species_variability(species_correlation_sum: f64, n_species: usize) -> f64
diversification_rate(n_extant: f64, stem_age: f64) -> f64
lineage_through_time_expected(n0: f64, birth_rate: f64, death_rate: f64, t: f64) -> f64
gamma_statistic`(branching_times: &[f64]) -> f64`
background_extinction_rate(species_lost: f64, total_species: f64, time_my: f64) -> f64
mass_extinction_magnitude(species_before: f64, species_after: f64) -> f64
recovery_time_exponential(species_lost_fraction: f64, origination_rate: f64) -> f64
kill_curve_severity( environmental_perturbation: f64, vulnerability: f64, threshold: f64, ) -> f64
selectivity_index(extinction_rate_group: f64, extinction_rate_background: f64) -> f64
origination_extinction_balance(origination_rate: f64, extinction_rate: f64) -> f64
survivorship_curve(initial_cohort: f64, extinction_rate: f64, t: f64) -> f64
lazarus_taxon_probability( true_extinction: f64, sampling_probability: f64, gap_duration: f64, ) -> f64
signor_lipps_effect(last_appearance: f64, sampling_interval: f64) -> f64
biodiversity_through_time( origination_rate: f64, extinction_rate: f64, initial_diversity: f64, t: f64, ) -> f64
waiting_time_to_extinction(population_size: f64, extinction_rate: f64) -> f64
morphological_disparity`(trait_values: &[Vec<f64>]) -> f64`
rarefied_diversity`(abundances: &[usize], sample_size: usize) -> f64`
foote_boundary_crosser_rate(n_bt: f64, n_fl: f64) -> f64
completeness_index(known_intervals: f64, total_range: f64) -> f64
lazarus_ratio(lazarus_taxa: f64, total_taxa: f64) -> f64
body_size_cope_trend`(sizes: &[f64]) -> f64`
morphospace_range`(trait_values: &[f64]) -> f64`
morphospace_volume`(ranges: &[f64]) -> f64`
pairwise_morphological_distance`(a: &[f64], b: &[f64]) -> f64`
evolutionary_rate_darwin(size_initial: f64, size_final: f64, time_myr: f64) -> f64
evolutionary_rate_haldane( size_initial: f64, size_final: f64, time_generations: f64, pooled_sd: f64, ) -> f64
taphonomic_bias(original_richness: f64, preservation_prob: f64) -> f64
ghost_lineage_duration(first_appearance: f64, inferred_origin: f64) -> f64
disparity_centroid_distance`(taxon: &[f64], centroid: &[f64]) -> f64`

parasitology API (55 functions)

FunctionSignature
parasite_r0(beta: f64, host_density: f64, recovery_rate: f64, mortality_rate: f64) -> f64
parasite_transmission_rate( contact_rate: f64, infectivity: f64, density_susceptible: f64, density_infected: f64, ) -> f64
sir_parasite_step( s: f64, i: f64, r: f64, beta: f64, gamma: f64, mu: f64, dt: f64, ) -> (f64, f64, f64)
parasite_aggregation_k(mean_burden: f64, variance_burden: f64) -> f64
parasite_negative_binomial_prevalence(mean_burden: f64, k: f64) -> f64
superinfection_rate( current_parasites: usize, max_parasites: usize, exposure_rate: f64, ) -> f64
vector_borne_r0( mosquito_density: f64, biting_rate: f64, prob_m_to_h: f64, prob_h_to_m: f64, mosquito_mortality: f64, extrinsic_incubation: f64, recovery: f64, ) -> f64
definitive_intermediate_host_cycle( cercariae_production: f64, snail_infection_rate: f64, human_exposure: f64, worm_establishment: f64, ) -> f64
host_parasite_lotka_volterra( h: f64, p: f64, r: f64, k: f64, a: f64, c: f64, d: f64, ) -> (f64, f64)
anderson_may( h: f64, p: f64, alpha: f64, beta: f64, b: f64, d_h: f64, d_p: f64, k_aggregation: f64, ) -> (f64, f64)
negative_binomial_prevalence(mean_burden: f64, k: f64) -> f64
parasite_aggregation_index(variance: f64, mean: f64) -> f64
superinfection_probability(exposure_rate: f64, current_burden: f64, max_burden: f64) -> f64
basic_reproduction_number_parasite( beta: f64, lambda: f64, h: f64, mu_p: f64, mu_h: f64, alpha: f64, ) -> f64
coevolution_red_queen( host_fitness: f64, parasite_fitness: f64, arms_race_rate: f64, ) -> (f64, f64)
nicholson_bailey(h: f64, p: f64, r: f64, a: f64) -> (f64, f64)
negative_binomial_zero_class(mean_burden: f64, k: f64) -> f64
parasite_induced_mortality(alpha: f64, burden: f64) -> f64
acquired_immunity_reduction(exposure: f64, max_immunity: f64, half_exposure: f64) -> f64
intermediate_host_prevalence(beta: f64, h2: f64, mu_l: f64, mu_h2: f64) -> f64
cercarial_force_of_infection( cercarial_density: f64, contact_rate: f64, penetration_prob: f64, ) -> f64
predator_prey_parasite_manipulation( h: f64, p: f64, prey: f64, r: f64, a: f64, manipulation_factor: f64, conversion: f64, death: f64, ) -> (f64, f64)
density_dependent_fecundity(fecundity_max: f64, burden: f64, k_dens: f64) -> f64
mate_probability_dioecious(burden: f64, k_agg: f64) -> f64
parasite_free_equilibrium(birth: f64, death: f64, carrying_capacity: f64) -> f64
antigenic_variation_escape( immune_recognition: f64, switch_rate: f64, variants: usize, ) -> f64
immune_evasion_molecular_mimicry( host_molecule_similarity: f64, immune_response_base: f64, ) -> f64
immunosuppression_by_parasite( il10_induction: f64, treg_expansion: f64, effector_response: f64, ) -> f64
encapsulation_melanization( hemocyte_density: f64, parasite_surface_area: f64, phenoloxidase: f64, ) -> f64
acquired_immunity_buildup(exposure_events: usize, max_immunity: f64, rate: f64) -> f64
maternal_antibody_decay(initial_titer: f64, half_life_weeks: f64, age_weeks: f64) -> f64
concomitant_immunity(adult_worms: f64, larval_killing_rate: f64, new_larvae: f64) -> f64
eosinophil_response(parasite_burden: f64, il5_level: f64, eosinophil_base: f64) -> f64
granuloma_formation_rate( antigen_deposition: f64, macrophage_activation: f64, fibrosis_rate: f64, ) -> f64
hygiene_hypothesis_index( parasite_exposure: f64, allergy_risk_base: f64, protection_factor: f64, ) -> f64
parasite_virulence_tradeoff(virulence: f64, beta_max: f64, v_half: f64) -> f64
optimal_virulence(beta_max: f64, v_half: f64, mortality_background: f64) -> f64
immune_evasion_probability(parasite_diversity: f64, immune_memory: f64) -> f64
worm_burden_distribution_mean(epg: f64, fecundity: f64) -> f64
force_of_infection( contact_rate: f64, environmental_contamination: f64, susceptibility: f64, ) -> f64
age_intensity_profile(age: f64, peak_age: f64, max_intensity: f64, shape: f64) -> f64
superinfection_threshold(r0_resident: f64, r0_challenger: f64) -> bool
aggregation_parameter(mean_burden: f64, variance: f64) -> f64
drug_resistance_spread( sensitive_freq: f64, resistant_fitness: f64, treatment_coverage: f64, ) -> f64
basic_reproduction_number_macroparasite( beta: f64, lambda: f64, mu_host: f64, mu_parasite: f64, alpha: f64, ) -> f64
case_fatality_rate(virulence: f64, host_resistance: f64) -> f64
parasite_clearance_rate( immune_activity: f64, drug_efficacy: f64, natural_death: f64, ) -> f64
morbidity_intensity(burden: f64, threshold: f64, severity_coeff: f64) -> f64
transmission_seasonality(baseline_beta: f64, amplitude: f64, t: f64, period: f64) -> f64
mass_drug_administration_impact(prevalence: f64, coverage: f64, efficacy: f64) -> f64
reinfection_rate( force_of_infection: f64, waning_immunity: f64, time_since_treatment: f64, ) -> f64
pathogen_shedding_rate(burden: f64, per_parasite_shed: f64, saturation: f64) -> f64
environmental_reservoir_decay(contamination: f64, decay_rate: f64, input_rate: f64) -> f64
host_specificity_index(hosts_used: f64, hosts_available: f64) -> f64
virulence_evolution_si(beta: f64, alpha: f64, gamma: f64, mu: f64) -> f64

pharmacology API (72 functions)

FunctionSignature
oral_bioavailability( fraction_absorbed: f64, gut_wall_extraction: f64, hepatic_extraction: f64, ) -> f64
intestinal_permeability_papp( amount_receiver: f64, area: f64, time: f64, donor_conc: f64, ) -> f64
dissolution_noyes_whitney( diffusion_coeff: f64, surface_area: f64, cs: f64, c: f64, thickness: f64, volume: f64, ) -> f64
biopharmaceutics_classification(solubility_high: bool, permeability_high: bool) -> u8
hepatic_clearance_well_stirred(liver_blood_flow: f64, fu: f64, cl_int: f64) -> f64
renal_drug_clearance(gfr: f64, fu: f64, secretion: f64, reabsorption_fraction: f64) -> f64
protein_binding(ka: f64, protein_conc: f64) -> f64
apparent_volume_of_distribution(dose: f64, plasma_concentration: f64) -> f64
compartment_distribution(dose: f64, kel: f64, k12: f64, k21: f64, t: f64) -> f64
p_glycoprotein_efflux(intracellular_conc: f64, pgp_activity: f64, km: f64) -> f64
drug_drug_interaction_auc_ratio(inhibitor_conc: f64, ki: f64) -> f64
cyp_induction_fold(inducer_conc: f64, ec50: f64, emax: f64) -> f64
competitive_displacement(drug_a_bound: f64, drug_b_conc: f64, kb: f64) -> f64
synergy_bliss_independence(effect_a: f64, effect_b: f64) -> f64
loewe_combination_index( dose_a: f64, dose_a_alone: f64, dose_b: f64, dose_b_alone: f64, ) -> f64
isobologram_point(dose_a: f64, ic50_a: f64, dose_b: f64, ic50_b: f64) -> f64
prodrug_activation( prodrug_conc: f64, enzyme_activity: f64, km: f64, activation_fraction: f64, ) -> f64
drug_therapeutic_index(td50: f64, ed50: f64) -> f64
loading_dose_calculation( target_concentration: f64, volume_of_distribution: f64, bioavailability: f64, ) -> f64
maintenance_dose_calculation( target_concentration: f64, clearance: f64, bioavailability: f64, dosing_interval: f64, ) -> f64
steady_state_accumulation(dose: f64, half_life: f64, dosing_interval: f64) -> f64
emax_model(e0: f64, emax: f64, c: f64, ec50: f64) -> f64
sigmoid_emax(e0: f64, emax: f64, c: f64, ec50: f64, n: f64) -> f64
log_logistic(c: f64, ec50: f64, slope: f64) -> f64
therapeutic_index(td50: f64, ed50: f64) -> f64
dose_response_hill(dose: f64, dmax: f64, ec50: f64, n: f64) -> f64
competitive_antagonism(agonist: f64, ec50: f64, antagonist: f64, kb: f64) -> f64
schild_equation(dose_ratio: f64, antagonist: f64) -> f64
receptor_occupancy(l: f64, kd: f64) -> f64
clark_equation(l: f64, kd: f64, emax: f64) -> f64
operational_model(l: f64, kd: f64, tau: f64, n: f64, emax: f64) -> f64
imax_model(i0: f64, imax: f64, c: f64, ic50: f64) -> f64
combination_index(d1: f64, dx1: f64, d2: f64, dx2: f64) -> f64
non_competitive_antagonism( agonist: f64, ec50: f64, antagonist: f64, kb: f64, emax: f64, ) -> f64
irreversible_antagonism(agonist: f64, ec50: f64, fraction_remaining: f64, emax: f64) -> f64
allosteric_modulator( agonist: f64, ec50: f64, modulator: f64, alpha: f64, beta: f64, km: f64, emax: f64, ) -> f64
patlak_plot_slope(plasma_integral: f64, plasma_conc: f64, tissue_conc: f64) -> f64
two_state_receptor(l: f64, kd_active: f64, kd_inactive: f64, l0: f64) -> f64
partial_agonist_effect(l: f64, kd: f64, intrinsic_efficacy: f64, emax: f64) -> f64
inverse_agonist_effect(e0: f64, l: f64, kd: f64, neg_efficacy: f64) -> f64
biased_agonism_ratio(e1: f64, ec50_1: f64, e2: f64, ec50_2: f64) -> f64
pk_pd_effect_compartment(ce: f64, emax: f64, ec50: f64, n: f64) -> f64
hysteresis_collapse_ke0(plasma: f64, effect_prev: f64, ke0: f64, dt: f64) -> f64
tolerance_factor(exposure_time: f64, tolerance_rate: f64) -> f64
one_compartment(dose: f64, vd: f64, ke: f64, t: f64) -> f64
one_compartment_iv_infusion(r0: f64, ke: f64, vd: f64, t: f64, t_inf: f64) -> f64
two_compartment(a: f64, alpha: f64, b: f64, beta: f64, t: f64) -> f64
oral_one_compartment(f_bio: f64, dose: f64, ka: f64, ke: f64, vd: f64, t: f64) -> f64
clearance(ke: f64, vd: f64) -> f64
half_life(ke: f64) -> f64
auc_iv_bolus(dose: f64, cl: f64) -> f64
auc_trapezoidal`(times: &[f64], concentrations: &[f64]) -> f64`
bioavailability(auc_oral: f64, dose_oral: f64, auc_iv: f64, dose_iv: f64) -> f64
volume_of_distribution(dose: f64, c0: f64) -> f64
steady_state_concentration(dose: f64, cl: f64, tau: f64, f_bio: f64) -> f64
loading_dose(css_target: f64, vd: f64, f_bio: f64) -> f64
maintenance_dose(css_target: f64, cl: f64, tau: f64, f_bio: f64) -> f64
accumulation_factor(ke: f64, tau: f64) -> f64
tmax_oral(ka: f64, ke: f64) -> f64
cmax_oral(f_bio: f64, dose: f64, ka: f64, ke: f64, vd: f64) -> f64
three_compartment(a: f64, alpha: f64, b: f64, beta: f64, c: f64, gamma: f64, t: f64) -> f64
multiple_dose_superposition( dose: f64, vd: f64, ke: f64, tau: f64, t: f64, n_doses: usize, ) -> f64
css_max(dose: f64, vd: f64, ke: f64, tau: f64) -> f64
css_min(dose: f64, vd: f64, ke: f64, tau: f64) -> f64
time_above_mic(dose: f64, vd: f64, ke: f64, mic: f64) -> f64
hepatic_extraction_ratio(cl_hepatic: f64, q_hepatic: f64) -> f64
well_stirred_model(q_h: f64, fu: f64, cl_int: f64) -> f64
renal_clearance(fraction_unbound: f64, gfr: f64) -> f64
auc_log_trapezoidal`(times: &[f64], concentrations: &[f64]) -> f64`
mean_residence_time(aumc: f64, auc: f64) -> f64
aumc_trapezoidal`(times: &[f64], concentrations: &[f64]) -> f64`
flip_flop_kinetics(ka: f64, ke: f64) -> bool

phylogenetics API (46 functions)

FunctionSignature
aa_to_index(aa: u8) -> Option<usize>
blosum62_score(a: u8, b: u8) -> i8
needleman_wunsch`(seq_a: &[u8], seq_b: &[u8], gap_penalty: i32) -> (Vec<u8>, Vec<u8>, i32)`
smith_waterman`(seq_a: &[u8], seq_b: &[u8], gap_penalty: i32) -> (Vec<u8>, Vec<u8>, i32)`
alignment_identity`(align_a: &[u8], align_b: &[u8]) -> f64`
affine_gap_needleman_wunsch`( seq_a: &[u8], seq_b: &[u8], gap_open: i32, gap_extend: i32, ) -> (Vec<u8>, Vec<u8>, i32)`
multiple_alignment_score`(alignment: &[Vec<u8>]) -> i32`
pairwise_distance`(align_a: &[u8], align_b: &[u8]) -> f64`
jukes_cantor_distance(p_distance: f64) -> f64
gap_fraction`(aligned: &[u8]) -> f64`
hamming_distance`(a: &[u8], b: &[u8]) -> usize`
p_distance`(a: &[u8], b: &[u8]) -> f64`
jukes_cantor(p: f64) -> f64
kimura_2p(transitions: f64, transversions: f64, length: f64) -> f64
count_transitions_transversions`(a: &[u8], b: &[u8]) -> (usize, usize)`
distance_matrix`(sequences: &[&[u8]]) -> Vec<Vec<f64>>`
log_det_distance`(freq_matrix: &[[f64; 4]; 4]) -> f64`
molecular_clock_rate(substitutions: f64, divergence_time: f64) -> f64
strict_clock_branch_length(rate: f64, time: f64) -> f64
relaxed_clock_lognormal(mean_rate: f64, sigma: f64, branch_deviation: f64) -> f64
divergence_time_from_distance(genetic_distance: f64, substitution_rate: f64) -> f64
jc_distance(p_diff: f64) -> f64
kimura_2p_distance(transitions: f64, transversions: f64, length: f64) -> f64
bayesian_clock_calibration( prior_age: f64, prior_sd: f64, likelihood_age: f64, likelihood_sd: f64, ) -> (f64, f64)
rate_heterogeneity_gamma(alpha: f64, n_categories: usize) -> Vec<f64>
local_clock_assignment`(branch_rates: &[f64], threshold: f64) -> Vec<usize>`
gc_content`(seq: &[u8]) -> f64`
complement(base: u8) -> u8
reverse_complement`(seq: &[u8]) -> Vec<u8>`
translate_codon`(codon: &[u8]) -> u8`
translate`(dna: &[u8]) -> Vec<u8>`
transcribe`(dna: &[u8]) -> Vec<u8>`
nucleotide_frequencies`(seq: &[u8]) -> [f64; 4]`
molecular_weight_dna`(seq: &[u8]) -> f64`
melting_temperature_basic`(seq: &[u8]) -> f64`
upgma`(dist_matrix: &[Vec<f64>]) -> Vec<(usize, usize, f64)>`
neighbor_joining`(dist_matrix: &[Vec<f64>]) -> Vec<(usize, usize, f64, f64)>`
wpgma`(dist_matrix: &[Vec<f64>]) -> Vec<(usize, usize, f64)>`
molecular_clock_test`(branch_lengths: &[f64], expected: &[f64]) -> f64`
robinson_foulds`(splits_a: &[Vec<bool>], splits_b: &[Vec<bool>]) -> usize`
sackin_index`(branch_depths: &[usize]) -> f64`
colless_index`(left_sizes: &[usize], right_sizes: &[usize]) -> f64`
branch_length_total`(branch_lengths: &[f64]) -> f64`
patristic_distance`(tree_distances: &[Vec<f64>], i: usize, j: usize) -> f64`
parsimony_score`(sequences: &[&[u8]], tree_topology: &[(usize, usize)]) -> usize`
gamma_rate_categories(alpha: f64, n_categories: usize) -> Vec<f64>

physiology API (47 functions)

FunctionSignature
frank_starling_mechanism( end_diastolic_volume: f64, contractility: f64, max_stroke_volume: f64, ) -> f64
stroke_volume_cardiac_output(heart_rate: f64, stroke_volume: f64) -> f64
ejection_fraction(stroke_volume: f64, end_diastolic_volume: f64) -> f64
map_calculation(systolic: f64, diastolic: f64) -> f64
systemic_vascular_resistance(map: f64, cvp: f64, cardiac_output: f64) -> f64
myocardial_oxygen_consumption(heart_rate: f64, systolic_bp: f64) -> f64
windkessel_pressure( cardiac_output: f64, resistance: f64, compliance: f64, t: f64, heart_rate: f64, ) -> f64
coronary_flow_reserve(hyperemic_flow: f64, resting_flow: f64) -> f64
qt_correction_bazett(qt_ms: f64, rr_ms: f64) -> f64
cardiac_work(stroke_volume_ml: f64, mean_pressure_mmhg: f64) -> f64
preload_recruitable_stroke_work(stroke_work: f64, edv: f64, v0: f64) -> f64
poiseuille_flow(radius: f64, length: f64, pressure_drop: f64, viscosity: f64) -> f64
wall_shear_stress(viscosity: f64, flow_rate: f64, radius: f64) -> f64
mean_arterial_pressure(systolic: f64, diastolic: f64) -> f64
cardiac_output(stroke_volume: f64, heart_rate: f64) -> f64
total_peripheral_resistance(map: f64, cvp: f64, cardiac_output: f64) -> f64
frank_starling(preload: f64, k: f64, max_force: f64) -> f64
pulse_wave_velocity(elasticity: f64, wall_thickness: f64, radius: f64, density: f64) -> f64
windkessel_2(flow: f64, pressure: f64, resistance: f64, compliance: f64) -> f64
glomerular_filtration_rate(kf: f64, p_gc: f64, p_bs: f64, pi_gc: f64) -> f64
creatinine_clearance(urine_cr: f64, urine_volume: f64, plasma_cr: f64) -> f64
fractional_excretion(urine_x: f64, plasma_cr: f64, plasma_x: f64, urine_cr: f64) -> f64
free_water_clearance(urine_volume: f64, urine_osm: f64, plasma_osm: f64) -> f64
tubular_reabsorption_rate(filtered_load: f64, excretion_rate: f64) -> f64
cockcroft_gault(age: f64, weight: f64, serum_cr: f64, is_female: bool) -> f64
mdrd_gfr(serum_cr: f64, age: f64, is_female: bool, is_black: bool) -> f64
tubuloglomerular_feedback( nacl_macula: f64, nacl_target: f64, sensitivity: f64, gfr_baseline: f64, ) -> f64
urine_concentration_ratio(urine_osm: f64, plasma_osm: f64) -> f64
anion_gap(sodium: f64, chloride: f64, bicarbonate: f64) -> f64
tidal_volume(respiratory_rate: f64, minute_ventilation: f64) -> f64
alveolar_ventilation(tidal_volume: f64, dead_space: f64, rate: f64) -> f64
alveolar_gas_equation(fio2: f64, p_atm: f64, p_h2o: f64, paco2: f64, rq: f64) -> f64
airway_resistance(pressure_drop: f64, flow: f64) -> f64
lung_compliance(volume_change: f64, pressure_change: f64) -> f64
oxygen_content(hb: f64, sao2: f64, pao2: f64) -> f64
oxygen_delivery(cardiac_output: f64, cao2: f64) -> f64
fick_oxygen_consumption(cardiac_output: f64, cao2: f64, cvo2: f64) -> f64
heat_balance( metabolic_rate: f64, work: f64, radiation: f64, convection: f64, evaporation: f64, ) -> f64
newton_cooling(body_temp: f64, ambient_temp: f64, h: f64, surface_area: f64) -> f64
evaporative_heat_loss(sweat_rate: f64, latent_heat: f64) -> f64
core_temperature_regulation( set_point: f64, core_temp: f64, gain_shiver: f64, gain_sweat: f64, ) -> (f64, f64)
wind_chill_index(air_temp: f64, wind_speed_kmh: f64) -> f64
heat_index(temperature_f: f64, relative_humidity: f64) -> f64
body_surface_area_dubois(weight_kg: f64, height_cm: f64) -> f64
counter_current_heat_exchange( arterial_temp: f64, venous_temp_return: f64, efficiency: f64, ) -> f64
brown_adipose_tissue_thermogenesis( bat_mass: f64, ucp1_activity: f64, substrate_availability: f64, ) -> f64
metabolic_rate_q10(rate_ref: f64, temp: f64, temp_ref: f64, q10: f64) -> f64

plant_biology API (67 functions)

FunctionSignature
competitive_exclusion_tilman(r_star_a: f64, r_star_b: f64) -> &'static str
allelopathy_effect(allelochemical_conc: f64, ic50: f64, max_inhibition: f64) -> f64
light_competition_beer_lambert(light_above: f64, lai: f64, extinction_coeff: f64) -> f64
canopy_lai(leaf_area: f64, ground_area: f64) -> f64
sla(leaf_area: f64, leaf_dry_mass: f64) -> f64
plant_defense_investment(growth_rate: f64, defense_allocation: f64) -> f64
herbivory_damage( herbivore_density: f64, feeding_rate: f64, plant_biomass: f64, defense_level: f64, ) -> f64
seed_dispersal_kernel(distance: f64, mean_dispersal: f64) -> f64
pollination_success(pollinator_visits: f64, pollen_per_visit: f64, ovule_count: f64) -> f64
nitrogen_fixation_symbiotic( nodule_mass: f64, nitrogenase_activity: f64, oxygen_limitation: f64, ) -> f64
root_growth_logistic(length: f64, max_length: f64, rate: f64, dt: f64) -> f64
auxin_gradient(source_concentration: f64, distance: f64, diffusion: f64, decay: f64) -> f64
phototropism_bending_rate(light_differential: f64, sensitivity: f64) -> f64
gravitropism_response(angle: f64, sensitivity: f64, dt: f64) -> f64
leaf_area_index(total_leaf_area: f64, ground_area: f64) -> f64
beer_lambert_canopy(light_above: f64, k: f64, lai: f64) -> f64
thermal_time(daily_mean_temp: f64, base_temp: f64) -> f64
water_potential(osmotic: f64, pressure: f64, gravitational: f64) -> f64
xylem_flow_rate(pressure_gradient: f64, conductivity: f64, cross_section: f64) -> f64
phloem_transport_munch(source_pressure: f64, sink_pressure: f64, resistance: f64) -> f64
allometric_biomass(diameter: f64, a: f64, b: f64) -> f64
specific_leaf_area(leaf_area: f64, leaf_dry_mass: f64) -> f64
relative_growth_rate(biomass_initial: f64, biomass_final: f64, time: f64) -> f64
net_assimilation_rate(biomass_change: f64, leaf_area_avg: f64, time: f64) -> f64
phytochrome_response(red: f64, far_red: f64) -> f64
vernalization_progress(temp: f64, optimal_temp: f64, range: f64, dt: f64) -> f64
photoperiod_response(day_length: f64, critical_length: f64, sensitivity: f64) -> f64
root_shoot_ratio(root_biomass: f64, shoot_biomass: f64) -> f64
canopy_gap_fraction(lai: f64, k: f64) -> f64
stem_taper(diameter_base: f64, height_fraction: f64, taper_exponent: f64) -> f64
cavitation_vulnerability(pressure: f64, p50: f64, slope: f64) -> f64
turgor_pressure(osmotic_potential: f64, water_potential: f64) -> f64
gibberellin_stem_elongation(ga_concentration: f64, max_rate: f64, km: f64) -> f64
senescence_chlorophyll_loss(chl0: f64, degradation_rate: f64, t: f64) -> f64
frost_hardiness(temp: f64, lt50: f64, slope: f64) -> f64
farquhar_c3( vcmax: f64, ci: f64, gamma_star: f64, kc: f64, ko: f64, o: f64, j: f64, rd: f64, ) -> f64
light_response_curve(phi: f64, ppfd: f64, amax: f64, theta: f64, rd: f64) -> f64
transpiration_rate(stomatal_conductance: f64, vpd: f64) -> f64
ball_berry_conductance(a_n: f64, cs: f64, rh: f64, g0: f64, g1: f64) -> f64
water_use_efficiency(a_n: f64, transpiration: f64) -> f64
penman_monteith( net_radiation: f64, soil_heat: f64, vpd: f64, ga: f64, gs: f64, delta: f64, gamma: f64, rho: f64, cp: f64, ) -> f64
rubisco_specificity(vcmax: f64, kc: f64, vomax: f64, ko: f64) -> f64
photorespiration_rate(vomax: f64, o: f64, ko: f64, ci: f64, kc: f64) -> f64
electron_transport_rate( ppfd: f64, absorptance: f64, fraction_psii: f64, phi_psii: f64, ) -> f64
stomatal_optimization(vpd: f64, ca: f64, lambda_wue: f64, g1: f64) -> f64
c4_photosynthesis( vpmax: f64, ci: f64, kp: f64, vcmax: f64, ko: f64, kc: f64, o: f64, rd: f64, ) -> f64
cam_malic_acid_storage( co2_fixed_night: f64, vacuole_capacity: f64, current_malate: f64, ) -> f64
cam_daytime_decarboxylation(malate: f64, decarboxylation_rate: f64) -> f64
chlorophyll_fluorescence_fv_fm(f0: f64, fm: f64) -> f64
non_photochemical_quenching(fm: f64, fm_prime: f64) -> f64
photochemical_quenching(fs: f64, f0_prime: f64, fm_prime: f64) -> f64
quantum_yield_psii(phi_psii: f64, ppfd: f64) -> f64
co2_compensation_point( gamma_star: f64, rd: f64, vcmax: f64, kc: f64, ko: f64, o: f64, ) -> f64
mesophyll_conductance(a_n: f64, ci: f64, cc: f64) -> f64
light_use_efficiency(gpp: f64, apar: f64) -> f64
vcmax_temperature_response(vcmax25: f64, ha: f64, temp_k: f64) -> f64
jmax_temperature_peaked(jmax25: f64, ha: f64, hd: f64, ds: f64, temp_k: f64) -> f64
xylem_flow_hagen_poiseuille( radius: f64, pressure_gradient: f64, viscosity: f64, length: f64, ) -> f64
leaf_transpiration_rate(stomatal_conductance: f64, vpd: f64) -> f64
cohesion_tension_water_potential( osmotic: f64, pressure: f64, gravity: f64, matric: f64, ) -> f64
phloem_munch_flow(turgor_source: f64, turgor_sink: f64, resistance: f64) -> f64
root_water_uptake( soil_water_potential: f64, root_water_potential: f64, root_conductance: f64, ) -> f64
xylem_cavitation_vulnerability(water_potential: f64, p50: f64, slope: f64) -> f64
stomatal_conductance_ball_berry( assimilation: f64, humidity: f64, co2_surface: f64, g0: f64, g1: f64, ) -> f64
sugar_loading_rate(sucrose_conc: f64, vmax: f64, km: f64) -> f64
root_hydraulic_conductivity( flow_rate: f64, root_surface_area: f64, pressure_difference: f64, ) -> f64
sap_flow_heat_pulse( thermal_diffusivity: f64, heat_pulse_distance: f64, time_to_max: f64, ) -> f64

population API (49 functions)

FunctionSignature
leslie_matrix_multiply`(matrix: &[Vec<f64>], population: &[f64]) -> Vec<f64>`
stable_age_distribution`(fecundities: &[f64], survivals: &[f64]) -> Vec<f64>`
cohort_generation_time`(age_fecundity: &[(f64, f64)], lambda: f64) -> f64`
reproductive_value`(lx: &[f64], mx: &[f64], lambda: f64) -> Vec<f64>`
euler_lotka_lambda`(lx: &[f64], mx: &[f64]) -> f64`
sensitivity_element(v_i: f64, w_j: f64, vw_dot: f64) -> f64
elasticity_element(sensitivity: f64, a_ij: f64, lambda: f64) -> f64
sir_model(s: f64, i: f64, r: f64, beta: f64, gamma: f64) -> (f64, f64, f64)
sir_solve( s0: f64, i0: f64, r0: f64, beta: f64, gamma: f64, dt: f64, steps: usize, ) -> Vec<(f64, f64, f64)>
seir_model( s: f64, e: f64, i: f64, r: f64, beta: f64, sigma: f64, gamma: f64, ) -> (f64, f64, f64, f64)
seir_solve( s0: f64, e0: f64, i0: f64, r0: f64, beta: f64, sigma: f64, gamma: f64, dt: f64, steps: usize, ) -> Vec<(f64, f64, f64, f64)>
sis_model(s: f64, i: f64, beta: f64, gamma: f64) -> (f64, f64)
sirs_model(s: f64, i: f64, r: f64, beta: f64, gamma: f64, xi: f64) -> (f64, f64, f64)
basic_reproduction_number(beta: f64, gamma: f64) -> f64
herd_immunity_threshold(r0: f64) -> f64
final_size_equation(r0: f64, tolerance: f64, max_iter: usize) -> f64
generation_time(incubation: f64, infectious_period: f64) -> f64
logistic_growth(n: f64, r: f64, k: f64) -> f64
logistic_solve(n0: f64, r: f64, k: f64, dt: f64, steps: usize) -> Vec<f64>
exponential_growth(n0: f64, r: f64, t: f64) -> f64
gompertz(n: f64, a: f64, b: f64, k: f64) -> f64
allee_effect(n: f64, r: f64, k: f64, a: f64) -> f64
beverton_holt(n: f64, r: f64, k: f64) -> f64
ricker(n: f64, r: f64, k: f64) -> f64
doubling_time(r: f64) -> f64
von_bertalanffy(l_inf: f64, k: f64, t: f64, t0: f64) -> f64
theta_logistic(n: f64, r: f64, k: f64, theta: f64) -> f64
moran_process_fixation(n: usize, r: f64) -> f64
lotka_volterra( prey: f64, pred: f64, alpha: f64, beta: f64, delta: f64, gamma: f64, ) -> (f64, f64)
lotka_volterra_solve( prey0: f64, pred0: f64, alpha: f64, beta: f64, delta: f64, gamma: f64, dt: f64, steps: usize, ) -> Vec<(f64, f64)>
competitive_lotka_volterra( n1: f64, n2: f64, r1: f64, r2: f64, k1: f64, k2: f64, a12: f64, a21: f64, ) -> (f64, f64)
holling_type_ii(prey: f64, attack_rate: f64, handling_time: f64) -> f64
holling_type_iii(prey: f64, attack_rate: f64, handling_time: f64) -> f64
rosenzweig_macarthur( prey: f64, pred: f64, r: f64, k: f64, a: f64, h: f64, e: f64, d: f64, ) -> (f64, f64)
beddington_deangelis(prey: f64, pred: f64, a: f64, b: f64, c: f64) -> f64
ratio_dependent(prey: f64, pred: f64, a: f64, h: f64) -> f64
intraguild_predation( prey: f64, meso: f64, top: f64, r: f64, k: f64, a_mp: f64, a_tp: f64, a_tm: f64, e_mp: f64, e_tp: f64, e_tm: f64, d_m: f64, d_t: f64, ) -> (f64, f64, f64)
apparent_competition( prey1: f64, prey2: f64, pred: f64, a1: f64, a2: f64, r1: f64, r2: f64, k1: f64, k2: f64, e: f64, d: f64, ) -> (f64, f64, f64)
diffusion_dispersal(density: f64, diffusion_coeff: f64, gradient: f64) -> f64
reaction_diffusion_fisher(n: f64, r: f64, k: f64, d: f64, laplacian: f64) -> f64
fisher_wave_speed(r: f64, d: f64) -> f64
range_expansion_rate(diffusion: f64, growth_rate: f64) -> f64
stepping_stone_migration( source_density: f64, target_density: f64, migration_rate: f64, ) -> f64
isolation_by_distance(fst: f64) -> f64
landscape_resistance(distance: f64, resistance_cost: f64) -> f64
gravity_model_migration(pop_source: f64, pop_dest: f64, distance: f64, alpha: f64) -> f64
corridor_effectiveness( width: f64, length: f64, habitat_quality: f64, species_mobility: f64, ) -> f64
allee_effect_spatial(density: f64, allee_threshold: f64, r: f64, k: f64) -> f64
kernel_based_dispersal(distance: f64, alpha: f64, shape: f64) -> f64

proteomics API (31 functions)

FunctionSignature
b_ion_masses(sequence: &str) -> Vec<f64>
y_ion_masses(sequence: &str) -> Vec<f64>
mz_ratio(mass: f64, charge: usize) -> f64
mass_from_mz(mz: f64, charge: usize) -> f64
mass_accuracy_ppm(theoretical: f64, observed: f64) -> f64
isotope_pattern_averagine(mass: f64, n_peaks: usize) -> Vec<f64>
ppi_degree`(adjacency_row: &[bool]) -> usize`
clustering_coefficient(neighbors_connected: usize, degree: usize) -> f64
betweenness_centrality_approx( shortest_paths_through: f64, total_shortest_paths: f64, ) -> f64
network_density(edges: usize, nodes: usize) -> f64
scale_free_exponent`(degree_distribution: &[f64]) -> f64`
hub_score(degree: usize, max_degree: usize) -> f64
edge_betweenness(flow_through_edge: f64, total_flow: f64) -> f64
protein_complex_stoichiometry`(abundances: &[f64]) -> Vec<f64>`
functional_enrichment_odds_ratio( hits_in_set: usize, set_size: usize, hits_total: usize, genome_size: usize, ) -> f64
guilt_by_association_score`(neighbor_annotations: &[bool]) -> f64`
peptide_molecular_weight(sequence: &str) -> f64
isoelectric_point(sequence: &str) -> f64
gravy_index(sequence: &str) -> f64
extinction_coefficient_280(n_trp: usize, n_tyr: usize, n_cystine: usize) -> f64
spectral_count_nsaf(spectral_count: f64, protein_length: f64, total_nsaf: f64) -> f64
ibaq(total_intensity: f64, num_observable_peptides: usize) -> f64
lfq_ratio(intensity_sample: f64, intensity_reference: f64) -> f64
tmt_reporter_ratio(reporter_intensity: f64, reference_channel: f64) -> f64
silac_ratio(heavy: f64, light: f64) -> f64
protein_fdr(decoy_hits: f64, target_hits: f64) -> f64
mascot_ion_score(observed: f64, expected: f64) -> f64
em_pai(observed_peptides: usize, observable_peptides: usize) -> f64
protein_coverage(identified_residues: usize, total_residues: usize) -> f64
xcorr_normalized(xcorr: f64, peptide_length: usize) -> f64
missed_cleavage_rate(missed: usize, total_peptides: usize) -> f64

radiobiology API (57 functions)

FunctionSignature
dna_strand_break_probability(dose: f64, target_size: f64, repair_efficiency: f64) -> f64
base_excision_repair_rate(damage_sites: f64, enzyme_concentration: f64, km: f64) -> f64
misrepair_probability(damage_density: f64, complexity_factor: f64) -> f64
chromosome_aberration_yield(dose: f64, alpha: f64, beta: f64) -> f64
lethal_aberration_fraction(aberrations: f64) -> f64
mutation_frequency(dose: f64, spontaneous_rate: f64, induced_rate_per_gy: f64) -> f64
double_strand_break_yield(dose: f64, let_factor: f64) -> f64
nhej_repair_kinetics( breaks: f64, fast_rate: f64, slow_rate: f64, fast_fraction: f64, t: f64, ) -> f64
homologous_recombination_probability( cell_cycle_s_g2_fraction: f64, sister_chromatid_available: bool, ) -> f64
clustered_damage_probability(dose: f64, let_val: f64, target_radius: f64) -> f64
single_strand_break_yield(dose: f64) -> f64
oxidative_base_damage_yield(dose: f64, oxygen_concentration: f64) -> f64
dna_damage_complexity_score(ssb: f64, dsb: f64, base_damage: f64) -> f64
foci_formation_kinetics(dsb: f64, recruitment_rate: f64, t: f64) -> f64
foci_resolution_kinetics(foci_max: f64, repair_rate: f64, t: f64) -> f64
micronucleus_formation(dose: f64, alpha_mn: f64, beta_mn: f64) -> f64
comet_tail_moment(tail_length: f64, tail_dna_fraction: f64) -> f64
gamma_h2ax_signal(dsb: f64, spreading_factor: f64, background: f64) -> f64
repair_pathway_choice(dsb: f64, cell_cycle_phase: f64, brca_status: f64) -> (f64, f64)
linear_quadratic_survival(dose: f64, alpha: f64, beta: f64) -> f64
biologically_effective_dose(n: f64, d: f64, alpha_beta: f64) -> f64
equivalent_dose_2gy(bed: f64, alpha_beta: f64) -> f64
tcp(n_cells: f64, survival_fraction: f64) -> f64
ntcp_lyman(dose: f64, td50: f64, m: f64) -> f64
oxygen_enhancement_ratio(dose_hypoxic: f64, dose_oxic: f64) -> f64
dna_dsb_yield(dose: f64, yield_per_gray: f64) -> f64
repair_kinetics(dsb0: f64, repair_rate: f64, t: f64) -> f64
fractionation_survival( n_fractions: usize, dose_per_fraction: f64, alpha: f64, beta: f64, repair_factor: f64, ) -> f64
relative_biological_effectiveness(dose_ref: f64, dose_test: f64) -> f64
let_to_rbe(let_val: f64, rbe_max: f64, let_half: f64) -> f64
protraction_factor(dose_rate: f64, repair_half_time: f64, total_time: f64) -> f64
bystander_effect(dose: f64, max_effect: f64, dose_half: f64) -> f64
adaptive_response( priming_dose: f64, challenge_dose: f64, alpha: f64, beta: f64, reduction_factor: f64, ) -> f64
low_dose_hypersensitivity(dose: f64, alpha_r: f64, alpha_s: f64, dc: f64, beta: f64) -> f64
tumor_growth_delay(dose: f64, alpha: f64, beta: f64, doubling_time: f64) -> f64
complication_free_cure(tcp_val: f64, ntcp_val: f64) -> f64
isoeffect_dose(n1: f64, d1: f64, alpha_beta: f64, n2: f64) -> f64
bed_biologically_effective_dose(n: f64, d: f64, alpha_beta: f64) -> f64
eqd2(n: f64, d: f64, alpha_beta: f64) -> f64
tumor_control_probability(n_clonogens: f64, surviving_fraction: f64) -> f64
normal_tissue_complication_probability(dose: f64, td50: f64, gamma50: f64) -> f64
incomplete_repair_factor(delta_t: f64, repair_half_time: f64) -> f64
repopulation_dose_equivalent( doubling_time: f64, treatment_duration: f64, alpha: f64, ) -> f64
lq_with_repopulation( alpha: f64, beta: f64, dose: f64, n_fractions: f64, treatment_days: f64, tp: f64, tk: f64, ) -> f64
therapeutic_ratio(tcp: f64, ntcp: f64) -> f64
fraction_size_optimization(alpha_beta_tumor: f64, alpha_beta_normal: f64) -> f64
hyperfractionation_advantage(d_conventional: f64, d_hyper: f64, alpha_beta: f64) -> f64
radiation_shielding_half_value(initial_intensity: f64, hvl: f64, thickness: f64) -> f64
shielding_tenth_value(initial_intensity: f64, tvl: f64, thickness: f64) -> f64
mass_attenuation(intensity: f64, mu_over_rho: f64, density: f64, thickness: f64) -> f64
buildup_factor(beam_layers: f64, mu: f64, thickness: f64) -> f64
concrete_shielding_thickness(dose_rate: f64, dose_limit: f64, hvl: f64) -> f64
lead_equivalent_thickness(mu_material: f64, mu_lead: f64, thickness_material: f64) -> f64
inverse_square_distance(dose_at_d1: f64, d1: f64, d2: f64) -> f64
occupancy_factor_dose(dose_unshielded: f64, occupancy: f64, use_factor: f64) -> f64
neutron_shielding_hydrogen(thickness_cm: f64, cross_section: f64, density_h: f64) -> f64
annual_dose_limit_check(dose_received: f64, dose_limit: f64) -> f64

reproduction API (62 functions)

FunctionSignature
cleavage_timing(stage: u32, base_interval: f64, temperature_factor: f64) -> f64
blastocyst_cell_count(initial_cells: f64, division_rate: f64, t: f64) -> f64
morphogen_gradient_embryo(source: f64, diffusion: f64, degradation: f64, x: f64) -> f64
gastrulation_cell_migration( chemotactic_sensitivity: f64, gradient: f64, random_motility: f64, ) -> f64
somitogenesis_clock(frequency: f64, wavefront_speed: f64, position: f64, t: f64) -> f64
fetal_weight_hadlock(gestational_age_weeks: f64) -> f64
placental_transfer_rate( maternal_conc: f64, fetal_conc: f64, permeability: f64, surface_area: f64, ) -> f64
crown_rump_length(gestational_age_weeks: f64) -> f64
biparietal_diameter(gestational_age_weeks: f64) -> f64
amniotic_fluid_index`(quadrants: &[f64; 4]) -> f64`
neural_tube_closure_progress(t: f64, rate: f64, max_closure: f64) -> f64
organogenesis_differentiation_rate( morphogen_conc: f64, threshold: f64, hill_coefficient: f64, ) -> f64
turing_activator_inhibitor( activator: f64, inhibitor: f64, rho_a: f64, rho_i: f64, mu_a: f64, mu_i: f64, kappa: f64, ) -> (f64, f64)
fetal_lung_maturity_ls_ratio(lecithin: f64, sphingomyelin: f64) -> f64
apgar_component( heart_rate: f64, respiration: f64, muscle_tone: f64, reflex: f64, color: f64, ) -> f64
fetal_heart_rate_baseline(gestational_age_weeks: f64) -> f64
umbilical_artery_pi(systolic: f64, diastolic: f64, mean: f64) -> f64
placental_oxygen_delivery( blood_flow: f64, hemoglobin: f64, saturation: f64, o2_binding_capacity: f64, ) -> f64
trophoblast_invasion_depth( migration_rate: f64, protease_activity: f64, resistance: f64, t: f64, ) -> f64
gestational_sac_diameter(gestational_age_days: f64) -> f64
yolk_sac_regression(initial_size: f64, regression_rate: f64, t: f64) -> f64
limb_bud_outgrowth(fgf_conc: f64, shh_conc: f64, growth_rate: f64, t: f64) -> f64
cell_fate_probability(signal_strength: f64, noise: f64, threshold: f64) -> f64
ovarian_cycle_hormone( t: f64, amplitude: f64, peak_day: f64, width: f64, baseline: f64, ) -> f64
follicle_growth(diameter: f64, fsh: f64, growth_rate: f64, max_diameter: f64) -> f64
sperm_motility_fraction(velocity: f64, threshold: f64, concentration: f64) -> f64
sperm_capacitation_rate(t: f64, half_time: f64) -> f64
fertilization_probability(sperm_count: f64, half_max: f64) -> f64
implantation_window(progesterone: f64, threshold: f64, estrogen_ratio: f64) -> bool
hcg_doubling(initial: f64, doubling_time: f64, t: f64) -> f64
lh_surge_model(t: f64, t_peak: f64, amplitude: f64, rise_rate: f64, fall_rate: f64) -> f64
estradiol_follicular(follicle_diameter: f64, num_follicles: f64, sensitivity: f64) -> f64
progesterone_luteal( t_post_ovulation: f64, peak: f64, rise_rate: f64, fall_rate: f64, ) -> f64
oocyte_quality_age( base_quality: f64, age: f64, decline_start: f64, decline_rate: f64, ) -> f64
antral_follicle_count(age: f64, initial_pool: f64, depletion_rate: f64) -> f64
anti_mullerian_hormone(follicle_count: f64, sensitivity: f64) -> f64
ivf_success_rate(age: f64, embryo_quality: f64, endometrial_thickness: f64) -> f64
menstrual_cycle_length(lh_peak_day: f64, luteal_phase_length: f64) -> f64
sperm_concentration_fertility(concentration: f64, motility: f64, morphology: f64) -> f64
cumulative_pregnancy_rate(monthly_fecundability: f64, months: u32) -> f64
zona_pellucida_binding(receptors: f64, sperm_conc: f64, kd: f64) -> f64
acrosome_reaction_rate(capacitated_fraction: f64, zona_signal: f64, k: f64) -> f64
endometrial_receptivity(p4: f64, lif: f64, integrin: f64, threshold_p4: f64) -> f64
twin_probability_dizygotic(age: f64, fsh_level: f64) -> f64
menstrual_cycle_hormone(day: f64, hormone: &str) -> f64
ovulation_probability(lh_surge: f64, follicle_maturity: f64, threshold: f64) -> f64
endometrial_thickness(day: f64, estrogen: f64) -> f64
fertility_window(cycle_day: f64, cycle_length: f64) -> f64
hcg_doubling_time(initial_hcg: f64, days: f64, doubling_time: f64) -> f64
implantation_probability( embryo_quality: f64, endometrial_receptivity: f64, age_factor: f64, ) -> f64
spermatogenesis_duration_days() -> f64
sperm_motility_score(progressive: f64, non_progressive: f64, immotile: f64) -> f64
testosterone_circadian(hour: f64, peak_level: f64, trough_level: f64) -> f64
ivf_cycle_success_rate(age: f64, embryo_quality: f64, endometrial_thickness: f64) -> f64
ovarian_reserve_amh(amh_ng_ml: f64) -> &'static str
antral_follicle_response(fsh_dose: f64, sensitivity: f64, max_follicles: f64) -> f64
ohss_risk(estradiol: f64, follicle_count: usize, bmi: f64) -> f64
embryo_grading_score(cell_count: usize, fragmentation_pct: f64, symmetry: f64) -> f64
blastocyst_expansion_rate(hours_post_fertilization: f64) -> f64
cryopreservation_survival(cooling_rate: f64, optimal_rate: f64, cpa_conc: f64) -> f64
cumulative_ivf_pregnancy_rate(cycle_rate: f64, cycles: usize) -> f64
sperm_dna_fragmentation_impact(dfi: f64, baseline_fertility: f64) -> f64

stem_cell API (50 functions)

FunctionSignature
waddington_landscape_potential( state: f64, attractor_a: f64, attractor_b: f64, barrier: f64, ) -> f64
differentiation_commitment( transcription_factor_a: f64, transcription_factor_b: f64, hill: f64, ) -> f64
lineage_progression( progenitor: f64, differentiation_rate: f64, proliferation_rate: f64, dt: f64, ) -> (f64, f64)
multipotency_index`(expressed_lineage_genes: &[f64]) -> f64`
cell_fate_probability_stochastic(tf_level: f64, noise: f64, threshold: f64) -> f64
directed_differentiation_efficiency(target_markers: f64, total_cells: f64) -> f64
transdifferentiation_barrier( epigenetic_distance: f64, reprogramming_factors: f64, efficiency_base: f64, ) -> f64
organoid_differentiation_layers(time: f64, layer_rate: f64, max_layers: f64) -> f64
terminal_differentiation_irreversibility(rb_phosphorylation: f64, cdki_level: f64) -> f64
self_renewal_probability(symmetric_rate: f64, total_division_rate: f64) -> f64
stem_cell_pool_dynamics(s: f64, r: f64, d: f64, p: f64, dt: f64) -> f64
asymmetric_division_output( stem_cells: f64, division_rate: f64, asymmetric_fraction: f64, ) -> f64
lineage_commitment(signal_strength: f64, threshold: f64, hill_n: f64) -> f64
niche_occupancy(stem_cells: f64, niche_capacity: f64) -> f64
niche_competition( resident: f64, challenger: f64, fitness_resident: f64, fitness_challenger: f64, ) -> f64
dedifferentiation_rate(injury_signal: f64, plasticity: f64, baseline: f64) -> f64
stem_cell_aging(initial_pool: f64, depletion_rate: f64, age: f64) -> f64
transit_amplifying_generations( progenitor: f64, divisions: u32, survival_per_div: f64, ) -> f64
quiescence_exit_rate(growth_factor: f64, threshold: f64, max_rate: f64) -> f64
clonal_dominance`(fitness: &[f64]) -> Vec<f64>`
neutral_drift_clone_survival(initial_clones: f64, time: f64, replacement_rate: f64) -> f64
hematopoietic_hierarchy_output( hsc: f64, mpp_rate: f64, clp_rate: f64, cmp_rate: f64, ) -> (f64, f64)
telomere_shortening_per_division( initial_length: f64, loss_per_division: f64, divisions: f64, ) -> f64
hayflick_limit_remaining( telomere_length: f64, critical_length: f64, loss_per_division: f64, ) -> f64
symmetric_commitment_probability(niche_signal: f64, k_niche: f64) -> f64
stem_cell_niche_occupancy( stem_cells: f64, niche_capacity: f64, adhesion_strength: f64, ) -> f64
niche_signal_gradient(source_strength: f64, distance: f64, decay_length: f64) -> f64
quiescence_probability(niche_signal: f64, threshold: f64) -> f64
niche_asymmetric_division(niche_polarization: f64, cell_polarity: f64) -> f64
hematopoietic_niche_osteoblast( osteoblast_count: f64, hsc_supported: f64, max_ratio: f64, ) -> f64
perivascular_niche_oxygen( distance_from_vessel: f64, vessel_po2: f64, consumption_rate: f64, diffusion: f64, ) -> f64
intestinal_crypt_dynamics( stem_cells: f64, division_rate: f64, loss_rate: f64, niche_capacity: f64, dt: f64, ) -> f64
wnt_gradient_crypt(position: f64, crypt_depth: f64, wnt_max: f64) -> f64
notch_lateral_inhibition_niche(notch_signal: f64, delta_neighbors: f64, gain: f64) -> f64
mesenchymal_niche_paracrine( mscs: f64, growth_factor_per_cell: f64, distance: f64, decay: f64, ) -> f64
reprogramming_efficiency( oct4: f64, sox2: f64, klf4: f64, myc: f64, epigenetic_barrier: f64, ) -> f64
ipsc_colony_formation( seeded_cells: f64, reprogramming_efficiency: f64, survival_fraction: f64, ) -> f64
differentiation_cascade`(progenitor: f64, rates: &[f64]) -> Vec<f64>`
waddington_potential(state: f64, landscape: impl Fn(f64) -> f64, noise: f64) -> f64
organoid_growth(cells: f64, growth_rate: f64, carrying_capacity: f64, dt: f64) -> f64
yamanaka_factor_dynamics( oct4: f64, sox2: f64, klf4: f64, myc: f64, dt: f64, degradation: f64, ) -> (f64, f64, f64, f64)
stochastic_reprogramming_events(cells: usize, probability_per_cell: f64) -> f64
partial_reprogramming_state( methylation_age: f64, cycles: usize, reset_per_cycle: f64, ) -> f64
direct_lineage_conversion`( efficiency_base: f64, tf_combination: &[f64], synergy: f64, ) -> f64`
asymmetric_division_ratio( stem_cells: f64, symmetric_prob: f64, differentiation_rate: f64, ) -> (f64, f64)
epigenetic_barrier_height( methylation_level: f64, histone_marks: f64, chromatin_accessibility: f64, ) -> f64
crispr_activation_efficiency( guide_specificity: f64, activator_strength: f64, chromatin_state: f64, ) -> f64
embryoid_body_formation( single_cells: f64, aggregation_rate: f64, min_cells_per_eb: f64, ) -> f64
directed_differentiation_yield( input_cells: f64, protocol_efficiency: f64, purity: f64, ) -> f64
maturation_index`(marker_expression: &[f64], weights: &[f64]) -> f64`

structural API (39 functions)

FunctionSignature
lennard_jones_potential(r: f64, epsilon: f64, sigma: f64) -> f64
coulomb_interaction(q1: f64, q2: f64, r: f64, dielectric: f64) -> f64
desolvation_energy(buried_area: f64, solvation_parameter: f64) -> f64
shape_complementarity(interface_area: f64, gap_volume: f64) -> f64
binding_free_energy( van_der_waals: f64, electrostatic: f64, desolvation: f64, entropy_penalty: f64, ) -> f64
kd_from_delta_g(delta_g: f64, temperature: f64) -> f64
buried_surface_area(asa_complex: f64, asa_receptor: f64, asa_ligand: f64) -> f64
hydrogen_bond_energy(distance: f64, angle_deg: f64) -> f64
clash_score`(distances: &[f64], vdw_threshold: f64) -> f64`
interface_residue_count`(distances_to_partner: &[f64], cutoff: f64) -> usize`
druggability_score(pocket_volume: f64, hydrophobicity: f64, enclosure: f64) -> f64
euclidean_distance_3d`(a: &[f64; 3], b: &[f64; 3]) -> f64`
bond_angle`(a: &[f64; 3], b: &[f64; 3], c: &[f64; 3]) -> f64`
dihedral_angle`(a: &[f64; 3], b: &[f64; 3], c: &[f64; 3], d: &[f64; 3]) -> f64`
center_of_mass`(coords: &[[f64; 3]], masses: &[f64]) -> [f64; 3]`
radius_of_gyration`(coords: &[[f64; 3]], masses: &[f64]) -> f64`
solvent_accessible_distance`(point: &[f64; 3], surface_points: &[[f64; 3]]) -> f64`
inertia_tensor`(coords: &[[f64; 3]], masses: &[f64]) -> [[f64; 3]; 3]`
planarity`(coords: &[[f64; 3]]) -> f64`
alpha_helix_propensity`(residue_propensities: &[f64]) -> f64`
beta_sheet_propensity`(residue_propensities: &[f64]) -> f64`
chou_fasman_nucleation`(propensities: &[f64], window: usize, threshold: f64) -> Vec<bool>`
gor_information_value(residue_freq_in_structure: f64, residue_freq_overall: f64) -> f64
coiled_coil_probability(heptad_score: f64, hydrophobic_moment: f64) -> f64
disorder_prediction(hydrophobicity: f64, charge: f64, complexity: f64) -> f64
solvent_accessibility(residue_asa: f64, max_asa: f64) -> f64
ramachandran_energy(phi: f64, psi: f64) -> f64
relative_contact_order`(contacts: &[(usize, usize)], chain_length: usize) -> f64`
hydrophobic_moment`(hydrophobicities: &[f64], angle_deg: f64) -> f64`
rmsd`(coords_a: &[[f64; 3]], coords_b: &[[f64; 3]]) -> f64`
gdt_ts`(coords_a: &[[f64; 3]], coords_b: &[[f64; 3]], cutoffs: &[f64]) -> f64`
tm_score`(coords_a: &[[f64; 3]], coords_b: &[[f64; 3]], l_target: usize) -> f64`
contact_map`(coords: &[[f64; 3]], cutoff: f64) -> Vec<(usize, usize)>`
rg_from_coords`(coords: &[[f64; 3]]) -> f64`
solvent_accessible_surface_approx`(radii: &[f64], probe: f64) -> f64`
lrmsd`(coords_a: &[[f64; 3]], coords_b: &[[f64; 3]], residue_indices: &[usize]) -> f64`
drmsd`(coords_a: &[[f64; 3]], coords_b: &[[f64; 3]]) -> f64`
absolute_contact_order`(contacts: &[(usize, usize)], n_residues: usize) -> f64`
b_factor_normalize`(b_factors: &[f64]) -> Vec<f64>`

Hub dispatch mapping

All biology functions are wired through:

  • src/hub/engine/dispatch/biology.rs

Chemistry Source Code Guide

This page documents the source implementation behind sciforge::chemistry, including file layout and Hub dispatch wiring.

Source Coverage

What is explained

  • File-level implementation layout in src/chemistry/.
  • Main computation groups and where they are implemented.
  • Runtime call path when chemistry functions are executed through Hub dispatch.

Visibility and external access

  • Visibility: internal (pub(crate) in src/lib.rs).
  • External consumers should use sciforge::hub as the public entry point.
  • Paths in this page are for source reading and internal crate development.

Source Code Explanation

Relevant file structure

  • Main implementation: src/chemistry/
  • Module entry point: src/chemistry/mod.rs
  • Hub routing: src/hub/engine/dispatch/chemistry.rs

Internal execution flow

  1. The module exposes subdomains through mod.rs and targeted pub use exports.
  2. Each .rs file implements a coherent block of equations and functions.
  3. The Hub invokes these functions through the domain dispatcher when execution goes through ExperimentRunner.

What to check while reading code

  • Exact signature: input/output types and argument order.
  • Numerical preconditions: divisions, roots, logarithms, and validity ranges.
  • Implicit conventions: units, normalization, bounds, and tolerances.

Modules

  • acid_base
  • analytical
  • colloids
  • computational
  • crystallography
  • electrochemistry
  • environmental
  • equilibrium
  • gas_laws
  • green_chemistry
  • inorganic
  • kinetics
  • molecular
  • nuclear
  • organic
  • photochemistry
  • polymers
  • quantum_chem
  • reaction_engineering
  • solid_state
  • solutions
  • spectroscopy
  • stoichiometry
  • surface
  • thermochemistry
  • transport

Acid-Base API (19 functions)

equilibria (11 functions)

FunctionSignature
henderson_hasselbalch(pka: f64, base: f64, acid: f64) -> f64
pka_from_ka(ka: f64) -> f64
ka_from_pka(pka: f64) -> f64
pkb_from_pka(pka: f64, pkw: f64) -> f64
ph_strong_acid(concentration: f64) -> f64
ph_strong_base(concentration: f64) -> f64
ph_weak_acid(ka: f64, c: f64) -> f64
ph_weak_base(kb: f64, c: f64) -> f64
alpha_fraction`(h: f64, ka_values: &[f64], species_index: usize) -> f64`
amphiprotic_ph(pka1: f64, pka2: f64) -> f64
ionic_product_water(t: f64) -> f64

titrations (8 functions)

FunctionSignature
strong_acid_strong_base_ph(c_acid: f64, v_acid: f64, c_base: f64, v_base: f64) -> f64
weak_acid_strong_base_ph(c_acid: f64, v_acid: f64, ka: f64, c_base: f64, v_base: f64) -> f64
equivalence_point_volume(c_analyte: f64, v_analyte: f64, c_titrant: f64) -> f64
half_equivalence_ph(pka: f64) -> f64
buffer_range(pka: f64) -> (f64, f64)
buffer_capacity_vanslyke(c_total: f64, ka: f64, h: f64) -> f64
diprotic_ph_first_equiv(pka1: f64, pka2: f64) -> f64
back_titration_moles(mol_excess_added: f64, c_back_titrant: f64, v_back_titrant: f64) -> f64

Analytical API (20 functions)

chromatography (7 functions)

FunctionSignature
retention_factor_rf(distance_solute: f64, distance_solvent: f64) -> f64
hplc_resolution(tr1: f64, tr2: f64, w1: f64, w2: f64) -> f64
theoretical_plates(tr: f64, w: f64) -> f64
height_equivalent_theoretical_plate(column_length: f64, n_plates: f64) -> f64
van_deemter(a: f64, b: f64, c: f64, u: f64) -> f64
selectivity_factor(k2: f64, k1: f64) -> f64
capacity_factor(tr: f64, t0: f64) -> f64

quantitative (8 functions)

FunctionSignature
dilution(c1: f64, v1: f64, v2: f64) -> f64
titration_equivalence_volume(c_analyte: f64, v_analyte: f64, c_titrant: f64, stoich_ratio: f64) -> f64
limit_of_detection(blank_std: f64, slope: f64) -> f64
limit_of_quantitation(blank_std: f64, slope: f64) -> f64
percent_recovery(measured: f64, expected: f64) -> f64
relative_standard_deviation(std_dev: f64, mean: f64) -> f64
gravimetric_factor(mw_analyte: f64, mw_precipitate: f64, stoich: f64) -> f64
karl_fischer_water_content(volume_reagent: f64, reagent_factor: f64, sample_mass: f64) -> f64

spectrophotometry (5 functions)

FunctionSignature
beer_lambert(epsilon: f64, path_length: f64, concentration: f64) -> f64
absorbance_to_transmittance(absorbance: f64) -> f64
transmittance_to_absorbance(transmittance: f64) -> f64
concentration_from_absorbance(absorbance: f64, epsilon: f64, path_length: f64) -> f64
signal_to_noise(signal: f64, noise: f64) -> f64

Colloids API (18 functions)

properties (10 functions)

FunctionSignature
stokes_sedimentation(r: f64, rho_p: f64, rho_f: f64, viscosity: f64) -> f64
brownian_diffusion_coefficient(t: f64, viscosity: f64, r: f64) -> f64
einstein_diffusion_displacement(d: f64, t: f64) -> f64
peclet_number_colloid(velocity: f64, r: f64, d: f64) -> f64
osmotic_pressure_colloid(n_particles: f64, volume: f64, t: f64) -> f64
sedimentation_coefficient(velocity: f64, omega: f64, r_centrifuge: f64) -> f64
tyndall_scattering_intensity(n: f64, v_particle: f64, wavelength: f64) -> f64
specific_surface_area(radius: f64, density: f64) -> f64
flocculation_rate_smoluchowski(n0: f64, k_b: f64, t: f64, viscosity: f64) -> f64
half_life_coagulation(n0: f64, k_rate: f64) -> f64

stability (8 functions)

FunctionSignature
dlvo_total_energy(van_der_waals: f64, electrostatic: f64) -> f64
hamaker_sphere_sphere(a_h: f64, r1: f64, r2: f64, d: f64) -> f64
hamaker_sphere_surface(a_h: f64, r: f64, d: f64) -> f64
debye_length(epsilon_r: f64, t: f64, ionic_strength: f64) -> f64
electrostatic_repulsion(epsilon_r: f64, r: f64, psi0: f64, kappa: f64, d: f64) -> f64
zeta_potential_smoluchowski(mobility: f64, viscosity: f64, epsilon: f64) -> f64
schulze_hardy_ccc(z: i32) -> f64
critical_coagulation_concentration(epsilon: f64, t: f64, psi0: f64, a_h: f64, z: f64) -> f64

Computational API (18 functions)

basis_sets (9 functions)

FunctionSignature
gaussian_primitive(alpha: f64, r_sq: f64) -> f64
normalization_s_orbital(alpha: f64) -> f64
normalization_p_orbital(alpha: f64) -> f64
slater_exponent(z_eff: f64, n: f64) -> f64
boys_function_zero(t: f64) -> f64
overlap_integral_1s(alpha1: f64, alpha2: f64, r_sq: f64) -> f64
kinetic_integral_1s(alpha1: f64, alpha2: f64, r_sq: f64) -> f64
sto_ng_coefficients(n: usize) -> Vec<(f64, f64)>
contracted_gaussian`(coeffs: &[(f64, f64)], r_sq: f64) -> f64`

dft (9 functions)

FunctionSignature
thomas_fermi_kinetic_energy`(density: &[f64], volume_element: f64) -> f64`
exchange_energy_lda`(density: &[f64], volume_element: f64) -> f64`
hartree_energy`(density: &[f64], potential: &[f64], volume_element: f64) -> f64`
nuclear_attraction_energy(z: f64, r: f64) -> f64
electron_nuclear_energy`(density: &[f64], distances: &[f64], z: f64, volume_element: f64) -> f64`
xc_potential_lda(density: f64) -> f64
correlation_energy_vwn(rs: f64) -> f64
wigner_seitz_radius(density: f64) -> f64
kohn_sham_total_energy(eigenvalue_sum: f64, hartree: f64, xc_energy: f64, xc_potential_integral: f64) -> f64

Crystallography API (16 functions)

diffraction (6 functions)

FunctionSignature
bragg_law(d: f64, theta: f64, n: u32) -> f64
bragg_angle(wavelength: f64, d: f64, n: u32) -> f64
interplanar_spacing_cubic(a: f64, h: i32, k: i32, l: i32) -> f64
structure_factor_bcc(h: i32, k: i32, l: i32, f_atom: f64) -> f64
structure_factor_fcc(h: i32, k: i32, l: i32, f_atom: f64) -> f64
scherrer_crystal_size(k: f64, wavelength: f64, fwhm: f64, theta: f64) -> f64

lattice (10 functions)

FunctionSignature
cubic_volume(a: f64) -> f64
tetragonal_volume(a: f64, c: f64) -> f64
orthorhombic_volume(a: f64, b: f64, c: f64) -> f64
hexagonal_volume(a: f64, c: f64) -> f64
packing_fraction_simple_cubic() -> f64
packing_fraction_bcc() -> f64
packing_fraction_fcc() -> f64
density_from_unit_cell(z: u32, molar_mass: f64, volume: f64, avogadro: f64) -> f64
miller_to_direction_cosines(h: i32, k: i32, l: i32) -> (f64, f64, f64)
reciprocal_lattice_vector(a: f64) -> f64

Electrochemistry API (20 functions)

cells (10 functions)

FunctionSignature
nernst_potential(e0: f64, n: f64, q: f64, t: f64) -> f64
cell_potential(e_cathode: f64, e_anode: f64) -> f64
gibbs_from_cell_potential(n: f64, e_cell: f64) -> f64
faraday_mass(i: f64, t: f64, m: f64, n: f64) -> f64
overpotential_tafel(a: f64, b: f64, current_density: f64) -> f64
butler_volmer(i0: f64, alpha_a: f64, alpha_c: f64, eta: f64, t: f64) -> f64
open_circuit_voltage(e_cathode: f64, e_anode: f64, n_electrons: f64, t: f64, q: f64) -> f64
faradaic_efficiency(actual_yield: f64, theoretical_yield: f64) -> f64
energy_density_battery(voltage: f64, capacity_ah: f64, mass_kg: f64) -> f64
coulombic_efficiency(discharge_capacity: f64, charge_capacity: f64) -> f64

transport (10 functions)

FunctionSignature
conductivity(resistance: f64, cell_constant: f64) -> f64
molar_conductivity(conductivity: f64, concentration: f64) -> f64
kohlrausch(lambda_inf: f64, k: f64, c: f64) -> f64
debye_huckel_activity(z: f64, ionic_strength: f64) -> f64
ionic_strength`(ions: &[(f64, f64)]) -> f64`
transference_number(lambda_ion: f64, lambda_total: f64) -> f64
debye_huckel_extended(z: f64, ionic_strength: f64, a_ion: f64) -> f64
onsager_equation(lambda_inf: f64, a: f64, b: f64, c: f64) -> f64
walden_product(viscosity: f64, molar_conductivity: f64) -> f64
mobility_from_conductivity(lambda_ion: f64, z: f64) -> f64

Environmental API (18 functions)

atmosphere (8 functions)

FunctionSignature
ozone_formation_rate(k: f64, no2: f64, hv: f64) -> f64
ozone_destruction_rate(k: f64, o3: f64, no: f64) -> f64
photochemical_smog_potential(voc: f64, nox: f64) -> f64
atmospheric_lifetime(concentration: f64, removal_rate: f64) -> f64
global_warming_potential(rf_gas: f64, lifetime_gas: f64, rf_co2: f64, lifetime_co2: f64) -> f64
henry_law_solubility(kh: f64, partial_pressure: f64) -> f64
ozone_depletion_potential(cl_atoms: f64, lifetime: f64, mw: f64) -> f64
photolysis_rate_constant(quantum_yield: f64, absorption: f64, actinic_flux: f64) -> f64

water (10 functions)

FunctionSignature
biochemical_oxygen_demand(bod_ultimate: f64, k: f64, t: f64) -> f64
chemical_oxygen_demand(sample_oxygen: f64, blank_oxygen: f64, volume: f64) -> f64
dissolved_oxygen_saturation(t: f64) -> f64
streeter_phelps(d0: f64, l0: f64, kd: f64, kr: f64, t: f64) -> f64
critical_point_time(kd: f64, kr: f64, d0: f64, l0: f64) -> f64
chlorine_decay(c0: f64, k: f64, t: f64) -> f64
ct_disinfection(c: f64, t: f64) -> f64
hardness_total(ca_mg_l: f64, mg_mg_l: f64) -> f64
langelier_saturation_index(ph: f64, ph_s: f64) -> f64
total_dissolved_solids_from_conductivity(conductivity_us: f64) -> f64

Equilibrium API (18 functions)

constants (9 functions)

FunctionSignature
equilibrium_constant_from_gibbs(delta_g: f64, t: f64) -> f64
reaction_quotient`(products: &[(f64, f64)], reactants: &[(f64, f64)]) -> f64`
le_chatelier_shift(q: f64, keq: f64) -> i32
kp_from_kc(kc: f64, t: f64, delta_n: f64) -> f64
vant_hoff(k1: f64, delta_h: f64, t1: f64, t2: f64) -> f64
degree_of_dissociation(keq: f64, c0: f64) -> f64
temperature_dependence_keq(k_ref: f64, delta_h: f64, t_ref: f64, t: f64) -> f64
gibbs_from_keq(keq: f64, t: f64) -> f64
pressure_effect_on_keq(keq: f64, delta_v: f64, p1: f64, p2: f64, t: f64) -> f64

ionic (9 functions)

FunctionSignature
common_ion_effect(ksp: f64, common_ion_conc: f64, stoich_coeff: f64) -> f64
buffer_capacity(ca: f64, cb: f64, ka: f64, h: f64) -> f64
ph_weak_acid(ka: f64, c: f64) -> f64
ph_buffer(ka: f64, acid: f64, base: f64) -> f64
solubility_product`(ion_concentrations: &[(f64, f64)]) -> f64`
distribution_coefficient(c_organic: f64, c_aqueous: f64) -> f64
solubility_from_ksp(ksp: f64, cation_stoich: f64, anion_stoich: f64) -> f64
formation_constant(product_conc: f64, metal_conc: f64, ligand_conc: f64, n: f64) -> f64
conditional_formation_constant(kf: f64, alpha_y: f64) -> f64

Gas Laws API (27 functions)

ideal (14 functions)

FunctionSignature
ideal_gas_pressure(n: f64, t: f64, v: f64) -> f64
ideal_gas_volume(n: f64, t: f64, p: f64) -> f64
ideal_gas_temperature(p: f64, v: f64, n: f64) -> f64
boyles_law(p1: f64, v1: f64, v2: f64) -> f64
charles_law(v1: f64, t1: f64, t2: f64) -> f64
gay_lussac_law(p1: f64, t1: f64, t2: f64) -> f64
combined_gas_law(p1: f64, v1: f64, t1: f64, t2: f64, p2: f64) -> f64
dalton_partial_pressure(mole_fraction: f64, total_pressure: f64) -> f64
grahams_law_effusion(m1: f64, m2: f64) -> f64
gas_density(p: f64, mw: f64, t: f64) -> f64
rms_speed(t: f64, mw: f64) -> f64
mean_speed(t: f64, mw: f64) -> f64
most_probable_speed(t: f64, mw: f64) -> f64
mean_free_path(d: f64, n_over_v: f64) -> f64

real (13 functions)

FunctionSignature
van_der_waals_pressure(n: f64, t: f64, v: f64, a: f64, b: f64) -> f64
redlich_kwong_pressure(n: f64, t: f64, v: f64, a: f64, b: f64) -> f64
compressibility_factor(p: f64, v: f64, n: f64, t: f64) -> f64
virial_equation_b(p: f64, t: f64, b: f64) -> f64
boyle_temperature(a: f64, b: f64) -> f64
critical_temperature(a: f64, b: f64) -> f64
critical_pressure(a: f64, b: f64) -> f64
critical_volume(b: f64) -> f64
reduced_temperature(t: f64, tc: f64) -> f64
reduced_pressure(p: f64, pc: f64) -> f64
peng_robinson_pressure(t: f64, vm: f64, a: f64, b: f64) -> f64
fugacity_coefficient(z: f64, b_prime: f64, p: f64) -> f64
acentric_factor(p_sat: f64, pc: f64) -> f64

Green Chemistry API (18 functions)

metrics (10 functions)

FunctionSignature
atom_economy(mw_product: f64, mw_all_products: f64) -> f64
e_factor(mass_waste: f64, mass_product: f64) -> f64
process_mass_intensity(total_mass_input: f64, mass_product: f64) -> f64
reaction_mass_efficiency(mass_product: f64, total_mass_reactants: f64) -> f64
carbon_efficiency(mass_carbon_product: f64, mass_carbon_reactants: f64) -> f64
mass_productivity(mass_product: f64, total_mass_used: f64) -> f64
solvent_intensity(mass_solvent: f64, mass_product: f64) -> f64
water_intensity(mass_water: f64, mass_product: f64) -> f64
effective_mass_yield(mass_product: f64, mass_non_benign: f64) -> f64
renewable_feedstock_index(mass_renewable: f64, total_mass: f64) -> f64

principles (8 functions)

FunctionSignature
catalyst_turnover_number(moles_product: f64, moles_catalyst: f64) -> f64
catalyst_turnover_frequency(ton: f64, time: f64) -> f64
energy_efficiency(useful_energy: f64, total_energy: f64) -> f64
selectivity(moles_desired: f64, moles_converted: f64) -> f64
yield_from_selectivity_conversion(selectivity_frac: f64, conversion_frac: f64) -> f64
stoichiometric_factor(actual_mass_reactant: f64, stoichiometric_mass: f64) -> f64
environmental_quotient(e_factor: f64, unfriendliness: f64) -> f64
mass_index(total_mass_input: f64, total_mass_output: f64) -> f64

Inorganic API (16 functions)

bonding (4 functions)

FunctionSignature
lattice_energy_born_lande(madelung: f64, z_plus: f64, z_minus: f64, r0: f64, born_exponent: f64) -> f64
lattice_energy_kapustinskii(nu: u32, z_plus: f64, z_minus: f64, r_plus: f64, r_minus: f64) -> f64
pauling_electronegativity_difference(en_a: f64, en_b: f64) -> f64
percent_ionic_character(en_diff: f64) -> f64

coordination (4 functions)

FunctionSignature
effective_atomic_number(metal_electrons: u32, ligand_electrons: u32) -> u32
chelate_effect(k_mono: f64, k_chelate: f64) -> f64
irving_williams_stability(ionization_energy: f64, ionic_radius: f64) -> f64
coordination_number_radius_ratio(r_cation: f64, r_anion: f64) -> u32

crystal_field (8 functions)

FunctionSignature
crystal_field_splitting_octahedral(dq: f64) -> f64
crystal_field_splitting_tetrahedral(dq_oct: f64) -> f64
cfse_octahedral(t2g: u32, eg: u32, dq: f64, pairing_energy: f64) -> f64
magnetic_moment_spin_only(unpaired: u32) -> f64
spectrochemical_series_dq(ligand_f: f64, metal_g: f64) -> f64
jahn_teller_distortion(eg_occupation: u32) -> bool
nephelauxetic_ratio(b_complex: f64, b_free_ion: f64) -> f64
racah_parameter_b`(transitions: &[f64], dq: f64) -> f64`

Kinetics API (23 functions)

mechanisms (11 functions)

FunctionSignature
michaelis_menten(vmax: f64, km: f64, s: f64) -> f64
lineweaver_burk_slope(km: f64, vmax: f64) -> f64
lineweaver_burk_intercept(vmax: f64) -> f64
lindemann_unimolecular(k_inf: f64, k0: f64, m: f64) -> f64
consecutive_reaction(c0: f64, k1: f64, k2: f64, t: f64) -> (f64, f64, f64)
reversible_first_order(c0: f64, kf: f64, kr: f64, t: f64) -> (f64, f64)
parallel_reactions`(c0: f64, k_values: &[f64], t: f64) -> Vec<f64>`
steady_state_intermediate(k1: f64, k_minus1: f64, k2: f64, a: f64) -> f64
pre_equilibrium_rate(k1: f64, k_minus1: f64, k2: f64, a: f64, b: f64) -> f64
competitive_inhibition(vmax: f64, km: f64, s: f64, i: f64, ki: f64) -> f64
uncompetitive_inhibition(vmax: f64, km: f64, s: f64, i: f64, ki: f64) -> f64

rates (12 functions)

FunctionSignature
rate_constant_arrhenius(a: f64, ea: f64, t: f64) -> f64
half_life_first_order(k: f64) -> f64
concentration_first_order(c0: f64, k: f64, t: f64) -> f64
concentration_second_order(c0: f64, k: f64, t: f64) -> f64
concentration_zero_order(c0: f64, k: f64, t: f64) -> f64
rate_law`(k: f64, concentrations: &[f64], orders: &[f64]) -> f64`
activation_energy_two_temps(k1: f64, k2: f64, t1: f64, t2: f64) -> f64
half_life_second_order(k: f64, c0: f64) -> f64
half_life_zero_order(k: f64, c0: f64) -> f64
integrated_rate_law_nth(c0: f64, k: f64, t: f64, n: f64) -> f64
eyring_equation(kappa: f64, kb: f64, t: f64, h: f64, delta_g_dagger: f64) -> f64
collision_frequency(na: f64, nb: f64, sigma: f64, t: f64, mu: f64) -> f64

Molecular API (20 functions)

bonding (12 functions)

FunctionSignature
bond_order(bonding_electrons: u32, antibonding_electrons: u32) -> f64
dipole_moment`(charges: &[(f64, [f64; 3])]) -> [f64; 3]`
dipole_magnitude`(mu: &[f64; 3]) -> f64`
coulomb_integral(z_eff: f64, n: f64) -> f64
slater_shielding`(electrons_below: &[u32], shielding_constants: &[f64]) -> f64`
electronegativity_mulliken(ie: f64, ea: f64) -> f64
formal_charge(valence: i32, lone_pair: i32, bonding: i32) -> i32
molar_mass`(atomic_masses: &[f64], counts: &[u32]) -> f64`
percent_composition(element_mass: f64, element_count: u32, molar_mass: f64) -> f64
electronegativity_allred_rochow(z_eff: f64, r_cov: f64) -> f64
polarizability_estimate(volume_angstrom3: f64) -> f64
bond_dissociation_energy_pauling(d_aa: f64, d_bb: f64, en_diff: f64) -> f64

geometry (8 functions)

FunctionSignature
vsepr_angle(bonding_pairs: u32, lone_pairs: u32) -> f64
hybridization_sp(bonding_regions: u32) -> &'static str
ideal_gas_moles(p: f64, v: f64, t: f64) -> f64
molecular_geometry_name(bonding_pairs: u32, lone_pairs: u32) -> &'static str
bond_length_estimate(r1: f64, r2: f64) -> f64
bond_energy_badger(r_e: f64, a: f64, b: f64) -> f64
coordination_geometry_angles(coordination: u32) -> f64
effective_nuclear_charge(z: u32, s: f64) -> f64

Nuclear API (12 functions)

decay (6 functions)

FunctionSignature
half_life_to_decay_constant(half_life: f64) -> f64
decay_constant_to_half_life(lambda: f64) -> f64
remaining_nuclei(n0: f64, lambda: f64, t: f64) -> f64
activity(lambda: f64, n: f64) -> f64
decay_chain_intermediate(n0: f64, lambda1: f64, lambda2: f64, t: f64) -> f64
specific_activity(lambda: f64, avogadro: f64, molar_mass: f64) -> f64

energy (6 functions)

FunctionSignature
mass_defect(z: u32, n: u32, atomic_mass: f64) -> f64
binding_energy(mass_defect: f64) -> f64
binding_energy_per_nucleon(binding_energy: f64, a: u32) -> f64
q_value`(reactant_masses: &[f64], product_masses: &[f64]) -> f64`
semi_empirical_mass_formula(a: u32, z: u32, av: f64, as_: f64, ac: f64, aa: f64, ap: f64) -> f64
threshold_energy(q: f64, mass_projectile: f64, mass_target: f64) -> f64

Organic API (20 functions)

descriptors (6 functions)

FunctionSignature
cahn_ingold_prelog_priority`(atomic_numbers: &[u32]) -> Vec<usize>`
topological_index_wiener`(distance_matrix: &[Vec<u32>]) -> u64`
randic_index`(adjacency: &[Vec<bool>], degrees: &[u32]) -> f64`
partition_coefficient_log_p`(fragments: &[f64]) -> f64`
topological_polar_surface_area`(contributions: &[f64]) -> f64`
rotatable_bonds(single_bonds: u32, ring_bonds: u32, terminal_bonds: u32) -> u32

reactions (7 functions)

FunctionSignature
sn1_rate(k: f64, substrate: f64) -> f64
sn2_rate(k: f64, substrate: f64, nucleophile: f64) -> f64
e1_rate(k: f64, substrate: f64) -> f64
e2_rate(k: f64, substrate: f64, base: f64) -> f64
hammett_equation(rho: f64, sigma: f64, log_k0: f64) -> f64
hammett_acidity(pka_ref: f64, rho: f64, sigma: f64) -> f64
taft_equation(rho_star: f64, sigma_star: f64, es: f64, delta: f64) -> f64

structure (7 functions)

FunctionSignature
degree_of_unsaturation(c: u32, h: u32, n: u32, halogens: u32) -> f64
molecular_formula_mass(c: u32, h: u32, o: u32, n: u32, s: u32) -> f64
alkane_boiling_point_estimate(carbon_count: u32) -> f64
huckel_energy_linear(n_atoms: usize, alpha: f64, beta: f64) -> Vec<f64>
huckel_energy_cyclic(n_atoms: usize, alpha: f64, beta: f64) -> Vec<f64>
delocalization_energy(total_pi_energy: f64, isolated_energy: f64) -> f64
resonance_stabilization(n_structures: usize) -> f64

Photochemistry API (13 functions)

kinetics (7 functions)

FunctionSignature
photolysis_rate(quantum_yield: f64, absorption_cross_section: f64, flux: f64) -> f64
stern_volmer(i0: f64, ksv: f64, quencher: f64) -> f64
stern_volmer_ratio(ksv: f64, quencher: f64) -> f64
rate_intersystem_crossing(total_rate: f64, rate_fluorescence: f64, rate_internal_conversion: f64) -> f64
phosphorescence_lifetime(rate_phosphorescence: f64, rate_non_radiative: f64) -> f64
forster_radius(quantum_yield_donor: f64, kappa_sq: f64, overlap_integral: f64, n_refraction: f64) -> f64
fret_efficiency(r: f64, r0: f64) -> f64

quantum_yield (6 functions)

FunctionSignature
quantum_yield(molecules_reacted: f64, photons_absorbed: f64) -> f64
photon_energy(wavelength_nm: f64) -> f64
photon_energy_ev(wavelength_nm: f64) -> f64
einstein_energy(wavelength_nm: f64) -> f64
fluorescence_lifetime(rate_radiative: f64, rate_non_radiative: f64) -> f64
fluorescence_quantum_yield(rate_radiative: f64, rate_non_radiative: f64) -> f64

Polymers API (14 functions)

distributions (6 functions)

FunctionSignature
number_average_molar_mass`(ni: &[f64], mi: &[f64]) -> f64`
weight_average_molar_mass`(ni: &[f64], mi: &[f64]) -> f64`
z_average_molar_mass`(ni: &[f64], mi: &[f64]) -> f64`
schulz_flory_distribution(p: f64, x: u32) -> f64
most_probable_chain_length(p: f64) -> f64
flory_huggins_free_energy(phi: f64, n1: f64, n2: f64, chi: f64, temperature: f64) -> f64

properties (8 functions)

FunctionSignature
degree_of_polymerization_number(mn: f64, m0: f64) -> f64
degree_of_polymerization_weight(mw: f64, m0: f64) -> f64
polydispersity_index(mw: f64, mn: f64) -> f64
intrinsic_viscosity_mark_houwink(k: f64, m: f64, a: f64) -> f64
end_to_end_distance_freely_jointed(n: f64, l: f64) -> f64
radius_of_gyration(end_to_end: f64) -> f64
glass_transition_fox(w1: f64, tg1: f64, w2: f64, tg2: f64) -> f64
carothers_equation(p: f64, f_avg: f64) -> f64

Quantum Chemistry API (12 functions)

huckel (6 functions)

FunctionSignature
huckel_secular_determinant(n: usize, alpha: f64, beta: f64) -> Vec<Vec<f64>>
huckel_cyclic_determinant(n: usize, alpha: f64, beta: f64) -> Vec<Vec<f64>>
huckel_charge_density`(coefficients: &[Vec<f64>], occupations: &[f64]) -> Vec<f64>`
huckel_bond_order`(coefficients: &[Vec<f64>], occupations: &[f64], atom_i: usize, atom_j: usize) -> f64`
huckel_total_pi_energy`(eigenvalues: &[f64], occupations: &[f64]) -> f64`
huckel_free_valence(bond_orders_sum: f64) -> f64

orbitals (6 functions)

FunctionSignature
lcao_bonding_energy(alpha: f64, beta: f64, overlap: f64) -> f64
lcao_antibonding_energy(alpha: f64, beta: f64, overlap: f64) -> f64
overlap_integral_1s(r: f64, zeta: f64) -> f64
hartree_energy(kinetic: f64, nuclear_attraction: f64, electron_repulsion: f64) -> f64
roothaan_total_energy`(one_electron: &[f64], fock_eigenvalues: &[f64], nuclear_repulsion: f64) -> f64`
mulliken_population`(density: &[Vec<f64>], overlap: &[Vec<f64>]) -> Vec<f64>`

Reaction Engineering API (19 functions)

design (10 functions)

FunctionSignature
damkohler_number(k: f64, tau: f64, c0: f64, order: f64) -> f64
selectivity(r_desired: f64, r_undesired: f64) -> f64
yield_reactor(moles_desired: f64, moles_reacted: f64) -> f64
overall_selectivity(moles_desired: f64, moles_all_products: f64) -> f64
thiele_modulus(r: f64, k: f64, d_eff: f64) -> f64
effectiveness_factor_sphere(phi: f64) -> f64
weisz_prater_criterion(r_obs: f64, r_particle: f64, d_eff: f64, c_s: f64) -> f64
residence_time_distribution_cstr(t: f64, tau: f64) -> f64
residence_time_distribution_pfr(t: f64, tau: f64) -> f64
recycle_ratio_effect(x_single: f64, recycle_ratio: f64) -> f64

reactors (9 functions)

FunctionSignature
cstr_volume(f_a0: f64, x: f64, r_a: f64) -> f64
pfr_conversion_first_order(k: f64, tau: f64) -> f64
cstr_conversion_first_order(k: f64, tau: f64) -> f64
batch_time_first_order(k: f64, x: f64) -> f64
batch_time_second_order(k: f64, c0: f64, x: f64) -> f64
space_time(volume: f64, volumetric_flow: f64) -> f64
space_velocity(volumetric_flow: f64, volume: f64) -> f64
levenspiel_plot_area`(fa0_over_ra: &[f64], dx: f64) -> f64`
cstr_series_conversion(k: f64, tau_each: f64, n: u32) -> f64

Solid State API (17 functions)

band_theory (9 functions)

FunctionSignature
fermi_dirac(energy: f64, fermi_level: f64, t: f64) -> f64
band_gap_from_absorption(wavelength_edge_nm: f64) -> f64
intrinsic_carrier_concentration(nc: f64, nv: f64, eg: f64, t: f64) -> f64
conductivity_semiconductor(n: f64, mu_e: f64, p: f64, mu_h: f64) -> f64
hall_coefficient(n: f64, p: f64) -> f64
doping_carrier_concentration(nd: f64, ni: f64) -> (f64, f64)
resistivity_from_conductivity(sigma: f64) -> f64
seebeck_coefficient(delta_v: f64, delta_t: f64) -> f64
ionic_conductivity_arrhenius(sigma0: f64, ea: f64, t: f64) -> f64

defects (8 functions)

FunctionSignature
schottky_defect_concentration(n_sites: f64, e_formation: f64, t: f64) -> f64
frenkel_defect_concentration(n_sites: f64, n_interstitial: f64, e_formation: f64, t: f64) -> f64
vacancy_diffusion_coefficient(d0: f64, q: f64, t: f64) -> f64
color_center_absorption(wavelength_nm: f64) -> f64
kroger_vink_equilibrium(k: f64, oxygen_pressure: f64, exponent: f64) -> f64
nonstoichiometry_delta(mass_change: f64, molar_mass_oxygen: f64, sample_mass: f64, molar_mass_sample: f64) -> f64
defect_formation_volume(lattice_param_defect: f64, lattice_param_perfect: f64) -> f64
burgers_vector_magnitude(a: f64, h: i32, k: i32, l: i32) -> f64

Solutions API (14 functions)

colligative (6 functions)

FunctionSignature
boiling_point_elevation(kb: f64, molality: f64, vant_hoff_factor: f64) -> f64
freezing_point_depression(kf: f64, molality: f64, vant_hoff_factor: f64) -> f64
osmotic_pressure(molarity: f64, temperature: f64, vant_hoff_factor: f64) -> f64
vapor_pressure_lowering(x_solvent: f64, p0_solvent: f64) -> f64
molar_mass_from_ebullioscopy(kb: f64, mass_solute: f64, mass_solvent_kg: f64, delta_t: f64) -> f64
molar_mass_from_cryoscopy(kf: f64, mass_solute: f64, mass_solvent_kg: f64, delta_t: f64) -> f64

mixtures (8 functions)

FunctionSignature
raoult_law(x_solvent: f64, p0_solvent: f64) -> f64
henrys_law(kh: f64, partial_pressure: f64) -> f64
mole_fraction(moles_component: f64, total_moles: f64) -> f64
molality(moles_solute: f64, mass_solvent_kg: f64) -> f64
molarity(moles_solute: f64, volume_liters: f64) -> f64
gibbs_duhem_check(x1: f64, d_mu1: f64, x2: f64, d_mu2: f64) -> f64
activity_from_mole_fraction(gamma: f64, x: f64) -> f64
margules_one_suffix(a: f64, x1: f64) -> f64

Spectroscopy API (20 functions)

ir (6 functions)

FunctionSignature
wavenumber_to_wavelength(wavenumber_cm: f64) -> f64
wavelength_to_wavenumber(wavelength_um: f64) -> f64
wavenumber_to_frequency(wavenumber_cm: f64) -> f64
force_constant_from_frequency(wavenumber: f64, reduced_mass_amu: f64) -> f64
reduced_mass(m1: f64, m2: f64) -> f64
ir_intensity_ratio(absorbance_sample: f64, absorbance_reference: f64) -> f64

mass_spec (6 functions)

FunctionSignature
mass_to_charge(mass: f64, charge: u32) -> f64
exact_mass_difference(theoretical: f64, experimental: f64) -> f64
nitrogen_rule(nominal_mass: u32) -> bool
rings_plus_double_bonds(c: u32, h: u32, n: u32, halogens: u32) -> f64
isotope_pattern_monoisotopic`(abundances: &[f64]) -> f64`
resolving_power(m: f64, delta_m: f64) -> f64

nmr (8 functions)

FunctionSignature
chemical_shift_ppm(frequency_sample: f64, frequency_reference: f64, spectrometer: f64) -> f64
coupling_constant_first_order(line_separation_hz: f64) -> f64
multiplicity(n_neighbors: u32) -> u32
larmor_frequency(gamma: f64, b0: f64) -> f64
t1_inversion_recovery(m0: f64, t1: f64, tau: f64) -> f64
t2_spin_echo(m0: f64, t2: f64, tau: f64) -> f64
linewidth_from_t2(t2: f64) -> f64
nuclear_overhauser_enhancement(gamma_irradiated: f64, gamma_observed: f64) -> f64

Stoichiometry API (17 functions)

balancing (7 functions)

FunctionSignature
limiting_reagent`(moles: &[f64], coefficients: &[f64]) -> usize`
theoretical_yield(moles_limiting: f64, coeff_limiting: f64, coeff_product: f64, mw_product: f64) -> f64
percent_yield(actual: f64, theoretical: f64) -> f64
excess_reagent(moles_a: f64, coeff_a: f64, moles_b: f64, coeff_b: f64) -> f64
moles_from_mass(mass: f64, molar_mass: f64) -> f64
mass_from_moles(moles: f64, molar_mass: f64) -> f64
number_of_particles(moles: f64) -> f64

calculations (10 functions)

FunctionSignature
oxidation_number_simple(charge: i32, num_atoms: u32) -> f64
equivalent_mass(molar_mass: f64, n_equivalents: f64) -> f64
normality(equivalents: f64, volume_liters: f64) -> f64
atom_economy`(mw_desired_product: f64, mw_all_products: &[f64]) -> f64`
empirical_formula_ratio`(masses: &[f64], molar_masses: &[f64]) -> Vec<f64>`
dilution_factor(v_initial: f64, v_final: f64) -> f64
stoichiometric_ratio(coeff_a: f64, coeff_b: f64) -> f64
mass_percent(mass_solute: f64, mass_solution: f64) -> f64
ppm_from_mass(mass_solute: f64, mass_solution: f64) -> f64
molarity_to_molality(molarity: f64, density: f64, molar_mass_solute: f64) -> f64

Surface API (13 functions)

adsorption (6 functions)

FunctionSignature
langmuir_isotherm(theta_max: f64, k: f64, pressure: f64) -> f64
freundlich_isotherm(kf: f64, pressure: f64, n: f64) -> f64
bet_isotherm(v_mono: f64, c: f64, p: f64, p0: f64) -> f64
temkin_isotherm(rt_over_b: f64, a: f64, pressure: f64) -> f64
langmuir_dissociative(k: f64, pressure: f64) -> f64
bet_surface_area(v_mono: f64, cross_section: f64, avogadro: f64, molar_volume: f64) -> f64

tension (7 functions)

FunctionSignature
surface_tension_young(gamma_sv: f64, gamma_sl: f64, cos_theta: f64) -> f64
contact_angle(gamma_sv: f64, gamma_sl: f64, gamma_lv: f64) -> f64
capillary_rise(gamma: f64, cos_theta: f64, rho: f64, g: f64, radius: f64) -> f64
laplace_pressure(gamma: f64, r1: f64, r2: f64) -> f64
gibbs_adsorption(d_gamma: f64, d_ln_concentration: f64, temperature: f64) -> f64
spreading_coefficient(gamma_sv: f64, gamma_lv: f64, gamma_sl: f64) -> f64
work_of_adhesion(gamma_lv: f64, cos_theta: f64) -> f64

Thermochemistry API (21 functions)

enthalpy (11 functions)

FunctionSignature
hess_law`(enthalpies: &[f64], coefficients: &[f64]) -> f64`
bond_enthalpy`(bonds_broken: &[f64], bonds_formed: &[f64]) -> f64`
born_haber_lattice_energy(sublimation: f64, ionization: f64, dissociation: f64, electron_affinity: f64, formation: f64) -> f64
calorimetry(mass: f64, specific_heat: f64, delta_t: f64) -> f64
kirchhoff(delta_h_t1: f64, delta_cp: f64, t1: f64, t2: f64) -> f64
heat_of_combustion(n_co2: f64, n_h2o: f64, hf_compound: f64) -> f64
clausius_clapeyron(p1: f64, delta_h_vap: f64, t1: f64, t2: f64) -> f64
heat_capacity_ratio(cp: f64, cv: f64) -> f64
adiabatic_flame_temperature(reactant_enthalpy: f64, product_enthalpy_base: f64, cp_products: f64, t_base: f64) -> f64
standard_enthalpy_of_reaction`(products_hf: &[f64], products_coeff: &[f64], reactants_hf: &[f64], reactants_coeff: &[f64]) -> f64`
bomb_calorimeter(delta_t: f64, c_cal: f64, mass_sample: f64) -> f64

entropy (10 functions)

FunctionSignature
entropy_change(q_rev: f64, t: f64) -> f64
gibbs_free_energy(delta_h: f64, t: f64, delta_s: f64) -> f64
spontaneity_temperature(delta_h: f64, delta_s: f64) -> f64
entropy_mixing_ideal`(mole_fractions: &[f64]) -> f64`
gibbs_helmholtz(delta_g1: f64, delta_h: f64, t1: f64, t2: f64) -> f64
trouton_rule_entropy(delta_h_vap: f64, t_boil: f64) -> f64
standard_entropy_of_reaction`(products_s: &[f64], products_coeff: &[f64], reactants_s: &[f64], reactants_coeff: &[f64]) -> f64`
entropy_phase_transition(delta_h: f64, t_transition: f64) -> f64
debye_entropy(t: f64, theta_d: f64) -> f64
helmholtz_free_energy(u: f64, t: f64, s: f64) -> f64

Transport API (17 functions)

diffusion (7 functions)

FunctionSignature
fick_first_law(d: f64, dc_dx: f64) -> f64
fick_second_law_solution(c0: f64, cs: f64, x: f64, d: f64, t: f64) -> f64
diffusion_coefficient_stokes_einstein(t: f64, viscosity: f64, r: f64) -> f64
wilke_chang(t: f64, viscosity: f64, mw_solvent: f64, phi: f64, v_solute: f64) -> f64
knudsen_diffusivity(r_pore: f64, t: f64, mw: f64) -> f64
effective_diffusivity(d_bulk: f64, porosity: f64, tortuosity: f64) -> f64
diffusion_time_estimate(length: f64, d: f64) -> f64

mass_transfer (10 functions)

FunctionSignature
mass_transfer_coefficient_film(d: f64, delta: f64) -> f64
mass_flux(k: f64, c_bulk: f64, c_surface: f64) -> f64
sherwood_number(k: f64, l: f64, d: f64) -> f64
schmidt_number(viscosity: f64, density: f64, d: f64) -> f64
penetration_theory_coefficient(d: f64, t_contact: f64) -> f64
surface_renewal_coefficient(d: f64, s: f64) -> f64
two_film_theory_overall(k_g: f64, k_l: f64, henry: f64) -> f64
mass_transfer_biot(k_ext: f64, r: f64, d_eff: f64) -> f64
overall_mass_transfer_resistance`(resistances: &[f64]) -> f64`
ntu_mass_transfer(k: f64, a: f64, flow: f64) -> f64

Hub dispatch mapping

All chemistry functions are wired through src/hub/engine/dispatch/chemistry.rs.

use sciforge::hub::prelude::*;

let exp = Experiment::new(DomainType::Chemistry, "rate_constant_arrhenius")
        .param("a", ParameterValue::Scalar(1e13))
        .param("ea", ParameterValue::Scalar(75000.0))
        .param("t", ParameterValue::Scalar(500.0));

let out = ExperimentRunner::new().run(&exp)?;

Constants Source Code Guide

This page documents the source implementation behind sciforge::constants, including constant tables and lookup helpers.

Source Coverage

What is explained

  • File-level implementation layout in src/constants/.
  • Main constant groups and lookup mechanisms.
  • Runtime usage path through Hub when constants are consumed in domain dispatch.

Visibility and external access

  • This domain module is pub(crate) in src/lib.rs and is not part of the external crate API.
  • External consumers should use the public sciforge::hub API for these computations.
  • Direct module paths shown here are for internal development and source-level understanding.

Source Code Explanation

Relevant file structure

  • Main implementation: src/constants/
  • Module entry point: src/constants/mod.rs
  • Hub routing (when applicable): (n/a - constants are direct)

Internal execution flow

  1. The module exposes subdomains through mod.rs and targeted pub use exports.
  2. Each .rs file implements a coherent constants or lookup block.
  3. Domain dispatchers and Hub prelude re-exports consume these constants internally.

What to verify in source code

  • Exact signature: input/output types and argument order.
  • Numerical preconditions: divisions, roots, logarithms, and validity ranges.
  • Implicit conventions: units, normalization, bounds, and tolerances.

Modules

  • astronomy — astronomical constants (solar/planetary masses, distances, CMB, dark matter, stellar, galactic)
  • biology — biological constants (bioenergetics, neuroscience, physiology, radiobiology)
  • geology — geological constants (impact parameters, radioactive decay, seawater composition)
  • maths — mathematical constants (approximation coefficients, ODE tables, quadrature weights)
  • meteorology — meteorological constants (atmospheric properties)
  • physics — physical constants (atomic, elements, fundamental, units)

astronomy/astrophysics (22 items)

NameTypeValue
ML_LOW_THRESHOLDf640.43
ML_LOW_COEFFf640.23
ML_LOW_EXPONENTf642.3
ML_MID_THRESHOLDf642.0
ML_MID_EXPONENTf644.0
ML_HIGH_THRESHOLDf6455.0
ML_HIGH_COEFFf641.4
ML_HIGH_EXPONENTf643.5
ML_VERY_HIGH_COEFFf6432000.0
WIEN_DISPLACEMENTf642.897_771_955e-3
MAIN_SEQUENCE_LIFETIME_SCALE_YRf641e10
CHANDRASEKHAR_LIMIT_SOLARf641.4
SPECTRAL_TEMP_SCALEf6442000.0
SPECTRAL_INDEX_OFFSETf640.92
BOLOMETRIC_CORRECTION_QUADf64-8.499
BOLOMETRIC_CORRECTION_CENTERf644.012
BOLOMETRIC_CORRECTION_OFFSETf64-0.09
HABITABLE_ZONE_INNER_FLUXf641.1
HABITABLE_ZONE_OUTER_FLUXf640.53
NUTATION_AMPLITUDE_ARCSECf649.2
VERNAL_EQUINOX_DOYf6481.0
TIDAL_DISSIPATION_COEFFf6410.5

astronomy/astro (196 items)

NameTypeValue
AUf641.495_978_707e11
PARSECf643.085_677_581e16
LIGHT_YEARf649.460_730_472_580_8e15
SOLAR_MASSf641.989_1e30
SOLAR_RADIUSf646.957e8
SOLAR_LUMINOSITYf643.828e26
EARTH_MASSf645.972_37e24
EARTH_RADIUSf646.371_0e6
HUBBLE_CONSTANTf6467.4
CMB_TEMPERATUREf642.725
SOLAR_DENSITYf64SOLAR_MASS / (4.0 / 3.0 * std::f64::consts::PI * SOLAR_RADIUS * SOLAR_RADIUS * SOLAR_RADIUS)
SOLAR_GRAVITYf64crate::constants::G * SOLAR_MASS / (SOLAR_RADIUS * SOLAR_RADIUS)
EARTH_GRAVITYf649.806_65
COSMOLOGICAL_LAMBDAf641.105_6e-52
MERCURY_MASSf643.301_1e23
MERCURY_RADIUSf642.439_7e6
MERCURY_FLATTENINGf640.000_9
MERCURY_ORBITAL_PERIODf647.600_5e6
MERCURY_SEMI_MAJOR_AXISf645.790_9e10
MERCURY_ECCENTRICITYf640.205_6
MERCURY_INCLINATIONf647.005
MERCURY_AXIAL_TILTf640.034
MERCURY_SIDEREAL_DAYf645.067_4e6
MERCURY_SURFACE_GRAVITYf643.7
MERCURY_ESCAPE_VELOCITYf644250.0
MERCURY_MEAN_DENSITYf645427.0
MERCURY_BOND_ALBEDOf640.088
VENUS_MASSf644.867_5e24
VENUS_RADIUSf646.051_8e6
VENUS_FLATTENINGf640.0
VENUS_ORBITAL_PERIODf641.941_4e7
VENUS_SEMI_MAJOR_AXISf641.082_1e11
VENUS_ECCENTRICITYf640.006_8
VENUS_INCLINATIONf643.394_6
VENUS_AXIAL_TILTf64177.36
VENUS_SIDEREAL_DAYf642.099_7e7
VENUS_SURFACE_GRAVITYf648.87
VENUS_ESCAPE_VELOCITYf6410_360.0
VENUS_MEAN_DENSITYf645243.0
VENUS_BOND_ALBEDOf640.76
MARS_MASSf646.417e23
MARS_RADIUSf643.389_5e6
MARS_FLATTENINGf640.005_89
MARS_ORBITAL_PERIODf645.935_5e7
MARS_SEMI_MAJOR_AXISf642.279_4e11
MARS_ECCENTRICITYf640.093_4
MARS_INCLINATIONf641.850
MARS_AXIAL_TILTf6425.19
MARS_SIDEREAL_DAYf6488_643.0
MARS_SURFACE_GRAVITYf643.72
MARS_ESCAPE_VELOCITYf645030.0
MARS_MEAN_DENSITYf643934.0
MARS_BOND_ALBEDOf640.250
JUPITER_MASSf641.898_2e27
JUPITER_RADIUSf646.991_1e7
JUPITER_FLATTENINGf640.064_87
JUPITER_ORBITAL_PERIODf643.743_5e8
JUPITER_SEMI_MAJOR_AXISf647.785_7e11
JUPITER_ECCENTRICITYf640.048_9
JUPITER_INCLINATIONf641.303
JUPITER_AXIAL_TILTf643.13
JUPITER_SIDEREAL_DAYf6435_730.0
JUPITER_SURFACE_GRAVITYf6424.79
JUPITER_ESCAPE_VELOCITYf6459_500.0
JUPITER_MEAN_DENSITYf641326.0
JUPITER_BOND_ALBEDOf640.343
SATURN_MASSf645.683_4e26
SATURN_RADIUSf645.823_2e7
SATURN_FLATTENINGf640.097_96
SATURN_ORBITAL_PERIODf649.295_6e8
SATURN_SEMI_MAJOR_AXISf641.433_5e12
SATURN_ECCENTRICITYf640.056_5
SATURN_INCLINATIONf642.485
SATURN_AXIAL_TILTf6426.73
SATURN_SIDEREAL_DAYf6438_520.0
SATURN_SURFACE_GRAVITYf6410.44
SATURN_ESCAPE_VELOCITYf6435_500.0
SATURN_MEAN_DENSITYf64687.0
SATURN_BOND_ALBEDOf640.342
URANUS_MASSf648.681_0e25
URANUS_RADIUSf642.536_2e7
URANUS_FLATTENINGf640.022_93
URANUS_ORBITAL_PERIODf642.651_3e9
URANUS_SEMI_MAJOR_AXISf642.872_5e12
URANUS_ECCENTRICITYf640.045_7
URANUS_INCLINATIONf640.773
URANUS_AXIAL_TILTf6497.77
URANUS_SIDEREAL_DAYf6462_064.0
URANUS_SURFACE_GRAVITYf648.69
URANUS_ESCAPE_VELOCITYf6421_300.0
URANUS_MEAN_DENSITYf641270.0
URANUS_BOND_ALBEDOf640.300
NEPTUNE_MASSf641.024_13e26
NEPTUNE_RADIUSf642.462_2e7
NEPTUNE_FLATTENINGf640.017_08
NEPTUNE_ORBITAL_PERIODf645.200_7e9
NEPTUNE_SEMI_MAJOR_AXISf644.495_1e12
NEPTUNE_ECCENTRICITYf640.011_3
NEPTUNE_INCLINATIONf641.770
NEPTUNE_AXIAL_TILTf6428.32
NEPTUNE_SIDEREAL_DAYf6457_996.0
NEPTUNE_SURFACE_GRAVITYf6411.15
NEPTUNE_ESCAPE_VELOCITYf6423_500.0
NEPTUNE_MEAN_DENSITYf641638.0
NEPTUNE_BOND_ALBEDOf640.290
LUNAR_MASSf647.342e22
LUNAR_RADIUSf641.737_4e6
EARTH_MOON_DISTANCEf643.844e8
LUNAR_ORBITAL_PERIODf642.360_6e6
IO_MASSf648.931_9e22
IO_RADIUSf641.821_6e6
EUROPA_MASSf644.799_8e22
EUROPA_RADIUSf641.560_8e6
GANYMEDE_MASSf641.481_9e23
GANYMEDE_RADIUSf642.634_1e6
CALLISTO_MASSf641.075_9e23
CALLISTO_RADIUSf642.410_3e6
TITAN_MASSf641.345_2e23
TITAN_RADIUSf642.574_7e6
ENCELADUS_MASSf641.080_2e20
ENCELADUS_RADIUSf642.521e5
TRITON_MASSf642.139_0e22
TRITON_RADIUSf641.353_4e6
PHOBOS_MASSf641.065_9e16
PHOBOS_RADIUSf641.126_7e4
DEIMOS_MASSf641.476_2e15
DEIMOS_RADIUSf646.2e3
OBERON_MASSf643.014e21
OBERON_RADIUSf647.614e5
TITANIA_MASSf643.527e21
TITANIA_RADIUSf647.889e5
TETHYS_MASSf646.174_96e20
TETHYS_RADIUSf645.311e5
DIONE_MASSf641.095_452e21
DIONE_RADIUSf645.613e5
RHEA_MASSf642.306_518e21
RHEA_RADIUSf647.638e5
IAPETUS_MASSf641.805_635e21
IAPETUS_RADIUSf647.346e5
HYPERION_MASSf645.584e18
HYPERION_RADIUSf641.35e5
MIMAS_MASSf643.749_4e19
MIMAS_RADIUSf641.982e5
PROMETHEUS_MASSf641.595e17
PROMETHEUS_RADIUSf644.31e4
PANDORA_MASSf641.371e17
PANDORA_RADIUSf644.06e4
ATLAS_MASSf646.6e15
ATLAS_RADIUSf641.53e4
PAN_MASSf644.95e15
PAN_RADIUSf641.42e4
EPIMETHEUS_MASSf645.266e17
EPIMETHEUS_RADIUSf645.83e4
JANUS_MASSf641.898e18
JANUS_RADIUSf648.95e4
AMALTHEA_MASSf642.08e18
AMALTHEA_RADIUSf648.35e4
THEBE_MASSf644.3e17
THEBE_RADIUSf644.93e4
HIMALIA_MASSf644.2e18
HIMALIA_RADIUSf648.5e4
METIS_MASSf643.6e16
METIS_RADIUSf642.15e4
ADRASTEA_MASSf642.0e15
ADRASTEA_RADIUSf648.2e3
J2_EARTHf641.082_63e-3
J2_JUPITERf641.473_6e-2
J2_SATURNf641.629_8e-2
J2_MARSf641.960_45e-3
J2_SUNf642.0e-7
MERCURY_ORBITAL_VELOCITYf6447_362.0
VENUS_ORBITAL_VELOCITYf6435_020.0
EARTH_ORBITAL_VELOCITYf6429_783.0
MARS_ORBITAL_VELOCITYf6424_007.0
JUPITER_ORBITAL_VELOCITYf6413_070.0
SATURN_ORBITAL_VELOCITYf649680.0
URANUS_ORBITAL_VELOCITYf646810.0
NEPTUNE_ORBITAL_VELOCITYf645430.0
SUN_CORE_TEMPERATUREf641.57e7
SUN_SURFACE_TEMPERATUREf645778.0
SUN_CORE_DENSITYf641.622e5
SUN_AGEf641.44e17
SUN_ROTATION_PERIODf642.164e6
YOSHIDA4_W0f64-1.702_414_383_919_315_3
YOSHIDA4_W1f641.351_207_191_959_657_8
YOSHIDA4_C1f64YOSHIDA4_W1 / 2.0
YOSHIDA4_C2f64(YOSHIDA4_W0 + YOSHIDA4_W1) / 2.0
YOSHIDA4_C3f64YOSHIDA4_C2
YOSHIDA4_C4f64YOSHIDA4_C1
YOSHIDA4_D1f64YOSHIDA4_W1
YOSHIDA4_D2f64YOSHIDA4_W0
YOSHIDA4_D3f64YOSHIDA4_W1
C_KM_Sf64crate::constants::C / 1e3
MPC_IN_Mf64PARSEC * 1e6
MPC_IN_KMf64PARSEC * 1e3
SEC_PER_GYRf64crate::constants::SECONDS_PER_DAY * crate::constants::JULIAN_CENTURY * 1e7

astronomy/darkmatter (21 items)

NameTypeValue
LOCAL_DM_DENSITYf640.3
LOCAL_DM_DENSITY_SIf645.35e-22
OMEGA_DMf640.265
OMEGA_BARYONf640.049
OMEGA_MATTERf64OMEGA_DM + OMEGA_BARYON
OMEGA_LAMBDAf641.0 - OMEGA_MATTER
THERMAL_RELIC_SIGMA_Vf643.0e-26
WIMP_MASS_MIN_GEVf6410.0
WIMP_MASS_MAX_GEVf641000.0
WIMP_SIGMA_UPPERf641.0e-46
AXION_MASS_MIN_EVf641.0e-6
AXION_MASS_MAX_EVf641.0e-3
AXION_DECAY_CONSTANTf641.0e12
NFW_RHO_S_TYPICALf644.88e6
NFW_RS_MWf6421.5
MW_VIRIAL_MASSf641.3e12
MW_VIRIAL_RADIUSf64287.0
MW_CONCENTRATIONf6413.3
Z_MATTER_RADIATION_EQf643402.0
Z_RECOMBINATIONf641089.0
AGE_UNIVERSEf644.35e17

astronomy/galactic (15 items)

NameTypeValue
MW_MASSf641.5e12
MW_DISK_RADIUSf642.63e20
MW_DISK_SCALE_HEIGHTf649.26e18
MW_BULGE_RADIUSf646.17e19
SUN_GALACTIC_DISTANCEf642.47e20
SUN_GALACTIC_VELOCITYf64220_000.0
SUN_GALACTIC_PERIODf647.25e15
MW_STELLAR_MASSf645.0e10
MW_STAR_COUNTf642.0e11
SGR_A_STAR_MASSf644.15e6
SGR_A_STAR_DISTANCEf642.47e20
M31_MASSf641.5e12
M31_DISTANCEf642.37e22
MW_M31_RADIAL_VELOCITYf64110_000.0
HUBBLE_FLOW_VELOCITY_PER_MPCf64crate::constants::HUBBLE_CONSTANT * 1e3

astronomy/stellar (22 items)

NameTypeValue
CHANDRASEKHAR_LIMITf64crate::constants::CHANDRASEKHAR_LIMIT_SOLAR * crate::constants::SOLAR_MASS
TOV_LIMITf644.58e30
EDDINGTON_PREFACTORf643.2e4
SOLAR_TEFFf64crate::constants::SUN_SURFACE_TEMPERATURE
SOLAR_ABS_MAGNITUDEf644.83
SOLAR_METALLICITYf640.013_4
PP_CHAIN_ENERGYf644.20e-12
CNO_CYCLE_ENERGYf643.98e-12
H_BURNING_EFFICIENCYf640.007
SOLAR_MS_LIFETIMEf643.15e17
WD_RADIUS_TYPICALf645.5e6
NS_RADIUS_TYPICALf641.1e4
NS_MASS_TYPICALf642.78e30
PULSAR_B_TYPICALf641.0e8
MAGNETAR_B_TYPICALf641.0e11
HYDROGEN_FRACTION_SOLARf640.734_6
HELIUM_FRACTION_SOLARf640.248_5
METAL_FRACTION_SOLARf64SOLAR_METALLICITY
HELIUM4_MASSf646.644_657_3e-27
ADIABATIC_INDEX_IDEALf645.0 / 3.0
ADIABATIC_INDEX_RADIATIONf644.0 / 3.0
OPACITY_ELECTRON_SCATTERINGf640.2

biology/bioenergetics (12 items)

NameTypeValue
KLEIBER_CONSTANTf6470.0
KLEIBER_EXPONENTf640.75
ATP_YIELD_AEROBICf6430.0
ATP_YIELD_ANAEROBICf642.0
CAC_NADH_PER_ACETYL_COAf643.0
CAC_FADH2_PER_ACETYL_COAf641.0
BETA_OX_FADH2_ATPf641.5
BETA_OX_NADH_ATPf642.5
BETA_OX_ACETYL_COA_ATPf6410.0
BETA_OX_ACTIVATION_COSTf642.0
BODY_TEMP_KELVINf64310.15
REFERENCE_TEMP_KELVINf64298.15

biology/neuroscience (62 items)

NameTypeValue
HH_RESTING_POTENTIALf64-65.0
HH_INIT_Mf640.05
HH_INIT_Hf640.6
HH_INIT_Nf640.32
HH_MEMBRANE_CAPACITANCEf641.0
HH_G_NAf64120.0
HH_G_Kf6436.0
HH_G_Lf640.3
HH_E_NAf6450.0
HH_E_Kf64-77.0
HH_E_Lf64-54.4
HH_ALPHA_M_V_SHIFTf6440.0
HH_ALPHA_M_COEFFf640.1
HH_BETA_M_MULTIPLIERf644.0
HH_BETA_M_EXP_COEFFf640.0556
HH_GATING_V_SHIFTf6465.0
HH_ALPHA_H_COEFFf640.07
HH_ALPHA_H_EXP_COEFFf640.05
HH_BETA_H_EXP_COEFFf640.1
HH_BETA_H_V_SHIFTf6435.0
HH_ALPHA_N_V_SHIFTf6455.0
HH_ALPHA_N_COEFFf640.01
HH_BETA_N_COEFFf640.125
HH_BETA_N_EXP_COEFFf640.0125
IZHI_RESTING_POTENTIALf64-65.0
IZHI_INIT_Uf64-14.0
IZHI_QUAD_COEFFf640.04
IZHI_LINEAR_COEFFf645.0
IZHI_CONSTANT_COEFFf64140.0
IZHI_SPIKE_THRESHOLDf6430.0
IZHI_RS_Af640.02
IZHI_RS_Bf640.2
IZHI_RS_Cf64-65.0
IZHI_RS_Df648.0
IZHI_FS_Af640.1
IZHI_FS_Bf640.2
IZHI_FS_Cf64-65.0
IZHI_FS_Df642.0
IZHI_BURST_Af640.02
IZHI_BURST_Bf640.2
IZHI_BURST_Cf64-50.0
IZHI_BURST_Df642.0
ML_INIT_Vf64-60.0
ML_CMf6420.0
ML_G_CAf644.4
ML_G_Kf648.0
ML_G_Lf642.0
ML_E_CAf64120.0
ML_E_Kf64-84.0
ML_E_Lf64-60.0
ML_V1f64-1.2
ML_V2f6418.0
ML_V3f642.0
ML_V4f6430.0
ML_PHIf640.04
LIF_RESTING_POTENTIALf64-65.0
LIF_THRESHOLDf64-50.0
LIF_TAUf6410.0
LIF_RESISTANCEf6410.0
NMDA_MG_KDf643.57
NMDA_VOLTAGE_COEFFf640.062
SYNAPTIC_CA_HALF_SATf640.5

biology/physiology (22 items)

NameTypeValue
WINDCHILL_CONSTANTf6413.12
WINDCHILL_TEMP_COEFFf640.6215
WINDCHILL_WIND_COEFFf6411.37
WINDCHILL_WIND_EXPf640.16
WINDCHILL_INTERACTIONf640.3965
HEAT_INDEX_CONSTANTf64-42.379
HEAT_INDEX_TEMP_COEFFf642.049_015_23
HEAT_INDEX_HUMIDITY_COEFFf6410.143_331_27
HEAT_INDEX_INTERACTIONf64-0.224_755_41
HEAT_INDEX_TEMP2f64-6.837_83e-3
HEAT_INDEX_HUMIDITY2f64-5.481_717e-2
HEAT_INDEX_T2Hf641.228_74e-3
HEAT_INDEX_TH2f648.528_2e-4
HEAT_INDEX_T2H2f64-1.99e-6
BSA_DUBOIS_COEFFf640.007_184
BSA_WEIGHT_EXPf640.425
BSA_HEIGHT_EXPf640.725
HB_O2_CAPACITYf641.34
DISSOLVED_O2_COEFFf640.003
O2_DELIVERY_SCALINGf6410.0
MMHG_TO_PAf64133.322
WINDKESSEL_SYSTOLIC_FRACTIONf640.35

biology/radiobiology (10 items)

NameTypeValue
DSB_YIELD_PER_GYf6435.0
SSB_YIELD_PER_GYf641000.0
OXIDATIVE_DAMAGE_COEFFf64200.0
OXIDATIVE_DAMAGE_O2_KMf643.0
DNA_DAMAGE_DSB_WEIGHTf6410.0
DNA_DAMAGE_BASE_WEIGHTf642.0
LN_2f64std::f64::consts::LN_2
FARQUHAR_WJ_CI_COEFFf644.0
FARQUHAR_WJ_GAMMA_COEFFf648.0
TUMOR_CARRYING_CAPACITYf641e12

geology/impact (7 items)

NameTypeValue
CRATER_SCALING_COEFFf641.161
CRATER_DENSITY_EXPONENTf641.0 / 3.0
CRATER_PROJECTILE_EXPONENTf640.78
CRATER_VELOCITY_EXPONENTf640.44
CRATER_GRAVITY_EXPONENTf64-0.22
FIREBALL_RADIUS_COEFFf6455.0
FIREBALL_ENERGY_EXPONENTf640.4

geology/radioactive (10 items)

NameTypeValue
LAMBDA_U238f641.551_25e-10
LAMBDA_U235f649.8485e-10
LAMBDA_TH232f644.947_5e-11
LAMBDA_K40_TOTALf645.543e-10
LAMBDA_K40_ARf64LAMBDA_K40_TOTAL * K40_BRANCH_RATIO_AR
K40_BRANCH_RATIO_ARf640.1048
C14_MEAN_LIFEf648_267.0
HEAT_PRODUCTION_U238f649.46e-5
HEAT_PRODUCTION_TH232f642.64e-5
HEAT_PRODUCTION_K40f642.92e-5

geology/seawater (39 items)

NameTypeValue
SEAWATER_RHO_0f64999.842_594
SEAWATER_RHO_T1f646.793_952e-2
SEAWATER_RHO_T2f64-9.095_290e-3
SEAWATER_RHO_T3f641.001_685e-4
SEAWATER_RHO_T4f64-1.120_083e-6
SEAWATER_RHO_T5f646.536_332e-9
SEAWATER_RHO_S0f648.244_93e-1
SEAWATER_RHO_S_T1f64-4.089_9e-3
SEAWATER_RHO_S_T2f647.643_8e-5
SEAWATER_RHO_S_T3f64-8.246_7e-7
SEAWATER_RHO_S_T4f645.387_5e-9
SEAWATER_RHO_B0f64-5.724_66e-3
SEAWATER_RHO_B_T1f641.022_7e-4
SEAWATER_RHO_B_T2f64-1.654_6e-6
SEAWATER_RHO_C0f644.831_4e-4
SOUND_SPEED_BASEf641448.96
SOUND_SPEED_T1f644.591
SOUND_SPEED_T2f64-5.304e-2
SOUND_SPEED_T3f642.374e-4
SOUND_SPEED_S1f641.340
SOUND_SPEED_D1f641.630e-2
SOUND_SPEED_D2f641.675e-7
SOUND_SPEED_TSf64-1.025e-2
SOUND_SPEED_TDf64-7.139e-13
PHILLIPS_ALPHAf640.0081
PHILLIPS_BETAf640.74
JONSWAP_ALPHA_COEFFf640.076
JONSWAP_ALPHA_EXPONENTf640.22
JONSWAP_FREQ_COEFFf6422.0
JONSWAP_GAMMAf643.3
JONSWAP_SIGMA_Af640.07
JONSWAP_SIGMA_Bf640.09
WAVE_HEIGHT_COEFFf640.0016
WAVE_HEIGHT_EXPONENTf640.5
WAVE_PERIOD_COEFFf640.286
HALINE_CONTRACTION_0f647.5e-4
HALINE_CONTRACTION_1f642.0e-6
THERMAL_EXPANSION_0f641.67e-4
THERMAL_EXPANSION_1f641.0e-5

maths/approximation (16 items)

NameTypeValue
ERF_A1f640.254_829_592
ERF_A2f64-0.284_496_736
ERF_A3f641.421_413_741
ERF_A4f64-1.453_152_027
ERF_A5f641.061_405_429
ERF_Pf640.327_591_1
LANCZOS_COEFFS_6`[f64``[f64`
LANCZOS_SERIES_INITf641.000_000_000_190_015
LANCZOS_SQRT_2PIf642.506_628_274_631_000_5
STIRLING_LANCZOS_Gf647.0
STIRLING_LANCZOS_COEFFS`[f64``[f64`
GOLDEN_RATIO_CONJUGATEf640.618_033_988_749_894_9
SAVITZKY_GOLAY_5_COEFFS`[f64``[f64`
SAVITZKY_GOLAY_5_NORMf6435.0
SPEED_OF_LIGHT_KM_Sf64crate::constants::C_KM_S
CMB_RECOMBINATION_REDSHIFTf64crate::constants::Z_RECOMBINATION

maths/ode (30 items)

NameTypeValue
RK45_A2f641.0 / 4.0
RK45_A3f643.0 / 8.0
RK45_A4f6412.0 / 13.0
RK45_A5f641.0
RK45_A6f640.5
RK45_B21f641.0 / 4.0
RK45_B31f643.0 / 32.0
RK45_B32f649.0 / 32.0
RK45_B41f641932.0 / 2197.0
RK45_B42f64-7200.0 / 2197.0
RK45_B43f647296.0 / 2197.0
RK45_B51f64439.0 / 216.0
RK45_B52f64-8.0
RK45_B53f643680.0 / 513.0
RK45_B54f64-845.0 / 4104.0
RK45_B61f64-8.0 / 27.0
RK45_B62f642.0
RK45_B63f64-3544.0 / 2565.0
RK45_B64f641859.0 / 4104.0
RK45_B65f64-11.0 / 40.0
RK45_C1f6416.0 / 135.0
RK45_C3f646656.0 / 12825.0
RK45_C4f6428561.0 / 56430.0
RK45_C5f64-9.0 / 50.0
RK45_C6f642.0 / 55.0
RK45_D1f6425.0 / 216.0
RK45_D3f641408.0 / 2565.0
RK45_D4f642197.0 / 4104.0
RK45_D5f64-1.0 / 5.0
ADAMS_BASHFORTH_4`[f64``[f64`

maths/quadrature (11 items)

NameTypeValue
GAUSS_LEGENDRE_5_NODES`[f64``[f64`
GAUSS_LEGENDRE_5_WEIGHTS`[f64``[f64`
GAUSS_LAGUERRE_5_NODES`[f64``[f64`
GAUSS_LAGUERRE_5_WEIGHTS`[f64``[f64`
GAUSS_HERMITE_5_NODES`[f64``[f64`
GAUSS_HERMITE_5_WEIGHTS`[f64``[f64`
LOBATTO_5_NODES`[f64``[f64`
LOBATTO_5_WEIGHTS`[f64``[f64`
GAUSS_KRONROD_15_NODES`[f64``[f64`
GAUSS_KRONROD_15_WEIGHTS`[f64``[f64`
GAUSS_7_WEIGHTS`[f64``[f64`

meteorology/atmospheric (18 items)

NameTypeValue
SPECIFIC_GAS_CONSTANT_DRY_AIRf64287.058
SPECIFIC_GAS_CONSTANT_WATER_VAPORf64461.5
SPECIFIC_HEAT_DRY_AIRf641003.5
DRY_ADIABATIC_LAPSE_RATEf64crate::constants::EARTH_GRAVITY / SPECIFIC_HEAT_DRY_AIR
VIRTUAL_TEMP_FACTORf640.608
MIXING_RATIO_FACTORf640.622
MAGNUS_Af6417.67
MAGNUS_Bf64243.5
SATURATION_VAPOR_PRESSURE_0Cf646.112
DENSITY_ALTITUDE_SCALEf64120.0
ISA_SEA_LEVEL_TEMP_Cf6415.0
ISA_LAPSE_RATE_PER_Mf640.002
VON_KARMANf640.41
STANDARD_AIR_DENSITY_SEA_LEVELf641.225
RADIATIVE_FORCING_CO2_COEFFf645.35
SOLAR_CONSTANTf641361.0
BEAUFORT_TO_MS_COEFFf640.836
BEAUFORT_TO_MS_EXPONENTf641.5

physics/atomic (18 items)

NameTypeValue
PROTON_MASS_KGf641.672_621_923_69e-27
NEUTRON_MASS_KGf641.674_927_498_04e-27
ELECTRON_MASS_KGf649.109_383_701_5e-31
PROTON_MASS_AMUf641.007_276_466_621
NEUTRON_MASS_AMUf641.008_664_915_95
ELECTRON_MASS_AMUf640.000_548_579_909_065
AMU_TO_KGf641.660_539_066_60e-27
AMU_TO_MEVf64931.494_102_42
ELECTRON_REST_MASS_MEVf64ELECTRON_MASS_KG * super::fundamental::C * super::fundamental::C / (super::units::EV_TO_JOULE * 1e6)
BOHR_RADIUSf645.291_772_109_03e-11
RYDBERG_ENERGYf6413.605_693_122_994
BOHR_MAGNETONf649.274_010_078_3e-24
NUCLEAR_MAGNETONf645.050_783_746_1e-27
COMPTON_WAVELENGTHf64super::fundamental::H / (ELECTRON_MASS_KG * super::fundamental::C)
MUON_MASSf641.883_531_627e-28
TAU_MASSf643.167_47e-27
NEUTRINO_MASS_UPPERf642.2e-36
R_INFf6410_973_731.568_16

physics/elements (4 items)

NameTypeValue
by_atomic_numberfn(z: u32) -> Option<&'static Element>
by_symbolfn(sym: &str) -> Option<&'static Element>
atomic_massfn(z: u32) -> f64
electronegativityfn(z: u32) -> Option<f64>

physics/fundamental (20 items)

NameTypeValue
Cf64299_792_458.0
Gf646.674_30e-11
Hf646.626_070_15e-34
HBARf64H / (2.0 * std::f64::consts::PI)
K_Bf641.380_649e-23
N_Af646.022_140_76e23
E_CHARGEf641.602_176_634e-19
EPSILON_0f648.854_187_812_8e-12
MU_0f641.0 / (EPSILON_0 * C * C)
K_COULOMBf641.0 / (4.0 * std::f64::consts::PI * EPSILON_0)
SIGMA_SBf645.670_374_419e-8
R_GASf64K_B * N_A
FARADAYf64N_A * E_CHARGE
ALPHA_FINEf647.297_352_569_3e-3
PLANCK_LENGTHf641.616_255e-35
PLANCK_MASSf642.176_434e-8
PLANCK_TIMEf645.391_247e-44
PLANCK_TEMPf641.416_784e32
G_Ff641.166_378_7e-5
ALPHA_Sf640.1181

physics/units (20 items)

NameTypeValue
EV_TO_JOULEf64super::fundamental::E_CHARGE
JOULE_TO_EVf641.0 / EV_TO_JOULE
HC_EV_NMf64super::fundamental::H * super::fundamental::C / EV_TO_JOULE * 1e9
KEV_TO_KELVINf641e3 / KELVIN_TO_KEV
KELVIN_TO_KEVf64super::fundamental::K_B / super::fundamental::E_CHARGE
CALORIE_TO_JOULEf644.184
ATM_TO_PASCALf64101_325.0
BAR_TO_PASCALf641.0e5
DEGREE_TO_RADf64std::f64::consts::PI / 180.0
RAD_TO_DEGREEf64180.0 / std::f64::consts::PI
BARNf641.0e-28
ANGSTROMf641.0e-10
FERMIf641.0e-15
KWH_TO_Jf643.6e6
MEV_TO_Jf64EV_TO_JOULE * 1e6
SECONDS_PER_DAYf6486_400.0
J2000_EPOCH_JDf642_451_545.0
JULIAN_CENTURYf6436_525.0
SIDEREAL_YEARf643.155_815e7
TROPICAL_YEARf643.155_693e7

Geology Source Code Guide

This page documents the source implementation behind sciforge::geology, including file layout and Hub dispatch wiring.

Source Coverage

What is explained

  • File-level implementation layout in src/geology/.
  • Main computation groups and where they are implemented.
  • Runtime call path when geology functions are executed through Hub dispatch.

Visibility and external access

  • This domain module is pub(crate) in src/lib.rs and is not part of the external crate API.
  • External consumers should use the public sciforge::hub API for these computations.
  • Direct module paths shown here are for internal development and source-level understanding.

Source Code Explanation

Relevant file structure

  • Main implementation: src/geology/
  • Module entry point: src/geology/mod.rs
  • Hub routing (when applicable): src/hub/engine/dispatch/geology.rs

Internal execution flow

  1. The module exposes subdomains through mod.rs and targeted pub use exports.
  2. Each .rs file implements a coherent block of equations and functions.
  3. The Hub invokes these functions through the domain dispatcher when execution goes through ExperimentRunner.

What to check while reading code

  • Exact signature: input/output types and argument order.
  • Numerical preconditions: divisions, roots, logarithms, and validity ranges.
  • Implicit conventions: units, normalization, bounds, and tolerances.

Modules

  • dating — geochronology and radiometric dating methods
  • erosion — fluvial, chemical, frost, and wind erosion models
  • geomorphology — landscape evolution, drainage, slope stability
  • glaciology — ice flow, glacial mass balance, isostatic rebound
  • hydrology — groundwater flow, aquifer properties, infiltration
  • mantle — mantle convection, viscosity, heat flow, plume dynamics
  • petrology — rock classification, magma composition, igneous petrology
  • seismology — seismic waves, earthquake magnitude, aftershock statistics
  • tectonics — plate tectonics, isostasy, heat flow, flexure
  • volcanism — eruption dynamics, lava flow, tephra dispersal

dating (18 functions)

FunctionSignature
radioactive_decay(n0: f64, lambda: f64, t: f64) -> f64
half_life(lambda: f64) -> f64
decay_constant(half_life: f64) -> f64
age_from_ratio(ratio_daughter_parent: f64, lambda: f64) -> f64
carbon14_age(ratio: f64) -> f64
potassium_argon_age(ar40: f64, k40: f64) -> f64
uranium_lead_age(pb206: f64, u238: f64) -> f64
isochron_age(slope: f64, lambda: f64) -> f64
fission_track_age(rho_s: f64, rho_i: f64, rho_d: f64, lambda: f64) -> f64
luminescence_dose(natural_signal: f64, dose_rate: f64) -> f64
cosmogenic_exposure_age(concentration: f64, production_rate: f64, lambda: f64) -> f64
uranium_235_lead_age(pb207: f64, u235: f64) -> f64
concordia_u238_pb206(t: f64) -> f64
concordia_u235_pb207(t: f64) -> f64
concordia_age(pb206_u238: f64, pb207_u235: f64) -> f64
thorium_232_lead_age(pb208: f64, th232: f64) -> f64
u_th_he_age(he4: f64, u238: f64, u235: f64, th232: f64) -> f64
radiogenic_heat_production(u238_ppm: f64, th232_ppm: f64, k40_ppm: f64, density: f64) -> f64

erosion (5 functions)

FunctionSignature
fluvial_erosion_rate(k: f64, p: f64, alpha: f64, vc: f64) -> f64
chemical_weathering_rate(a: f64, ea: f64, t: f64, p: f64) -> f64
frost_weathering_rate(n_ft: f64, phi: f64) -> f64
wind_erosion_threshold(rho_p: f64, rho_a: f64, g: f64, d: f64) -> f64
volcanic_explosivity_index(volume_km3: f64) -> u8

geomorphology (20 functions)

FunctionSignature
hypsometric_curve(mean_elevation: f64, std_dev: f64, fraction: f64) -> f64
continental_fraction(total_area: f64, ocean_area: f64) -> f64
ocean_basin_depth( ridge_depth: f64, plate_age_myr: f64, thermal_diffusivity: f64, ) -> f64
mid_ocean_ridge_elevation( spreading_rate_cm_yr: f64, mantle_temperature: f64, reference_temperature: f64, ) -> f64
passive_margin_subsidence( initial_elevation: f64, time_myr: f64, thermal_time_constant_myr: f64, ) -> f64
orogenic_elevation( convergence_rate: f64, erosion_rate: f64, crustal_density: f64, mantle_density: f64, time: f64, ) -> f64
erosion_rate_hack( coefficient: f64, drainage_area: f64, slope: f64, m: f64, n: f64, ) -> f64
sediment_transport_capacity( flow_velocity: f64, depth: f64, grain_size: f64, density_water: f64, density_sediment: f64, g_surface: f64, ) -> f64
crater_diameter( impactor_diameter: f64, impactor_velocity: f64, impactor_density: f64, target_density: f64, g_surface: f64, ) -> f64
crater_depth_to_diameter(simple_to_complex_transition: f64, diameter: f64) -> f64
shield_volcano_profile( base_radius: f64, max_height: f64, r: f64, ) -> f64
stratovolcano_profile( base_radius: f64, max_height: f64, r: f64, ) -> f64
caldera_profile( caldera_radius: f64, caldera_depth: f64, rim_height: f64, rim_width: f64, r: f64, ) -> f64
rift_valley_width( elastic_thickness: f64, youngs_modulus: f64, poisson: f64, mantle_density: f64, g_surface: f64, ) -> f64
tectonic_stress_field( plate_velocity: f64, viscosity: f64, thickness: f64, ) -> f64
fault_slip_rate( tectonic_stress: f64, friction_coefficient: f64, normal_stress: f64, ) -> f64
weathering_rate( rate_constant: f64, activation_energy: f64, temperature: f64, precipitation_rate: f64, ) -> f64
soil_production_rate( bare_rate: f64, soil_thickness: f64, characteristic_depth: f64, ) -> f64
landscape_diffusion( diffusivity: f64, curvature: f64, ) -> f64
flexural_wavelength( elastic_thickness: f64, youngs_modulus: f64, poisson: f64, density_contrast: f64, g_surface: f64, ) -> f64

glaciology (4 functions)

FunctionSignature
glen_strain_rate(a: f64, tau: f64, n: f64) -> f64
shallow_ice_velocity(a: f64, n: f64, rho: f64, g: f64, alpha: f64, h: f64) -> f64
ice_viscosity(a: f64, tau: f64, n: f64) -> f64
glacial_bed_erosion(kg: f64, vb: f64, l: f64) -> f64

hydrology (6 functions)

FunctionSignature
manning_velocity(n: f64, rh: f64, s: f64) -> f64
chezy_velocity(c: f64, rh: f64, s: f64) -> f64
froude_number(v: f64, g: f64, d: f64) -> f64
reynolds_number(v: f64, d: f64, nu: f64) -> f64
stream_power(rho: f64, g: f64, q: f64, s: f64) -> f64
hjulstrom_erosion_threshold(d_grain: f64) -> f64

mantle (25 functions)

FunctionSignature
rayleigh_number( alpha: f64, g_surface: f64, delta_t: f64, depth: f64, kappa: f64, nu: f64, ) -> f64
nusselt_number(rayleigh: f64, beta_exponent: f64) -> f64
convective_velocity( alpha: f64, g_surface: f64, delta_t: f64, depth: f64, kappa: f64, nu: f64, ) -> f64
core_temperature_adiabat( surface_core_temp: f64, pressure: f64, gruneisen_parameter: f64, bulk_modulus: f64, ) -> f64
inner_core_radius( total_core_radius: f64, core_mass: f64, melting_gradient: f64, adiabatic_gradient: f64, ) -> f64
core_heat_flux( thermal_conductivity: f64, delta_t: f64, core_radius: f64, ) -> f64
cmb_heat_flux( nusselt: f64, thermal_conductivity: f64, delta_t: f64, mantle_depth: f64, ) -> f64
mantle_overturn_time(mantle_depth: f64, convective_vel: f64) -> f64
viscosity_temperature( reference_viscosity: f64, activation_energy: f64, temperature: f64, reference_temperature: f64, ) -> f64
thermal_boundary_layer_thickness( mantle_depth: f64, rayleigh: f64, ) -> f64
plume_buoyancy_flux( alpha: f64, density: f64, g_surface: f64, delta_t: f64, volume_flux: f64, ) -> f64
plume_conduit_radius( buoyancy_flux: f64, kinematic_viscosity: f64, thermal_diffusivity: f64, ) -> f64
core_cooling_rate( surface_heat_flux: f64, core_radius: f64, core_density: f64, specific_heat: f64, ) -> f64
magnetic_reynolds_number( velocity: f64, length_scale: f64, magnetic_diffusivity: f64, ) -> f64
dynamo_active(magnetic_reynolds: f64) -> bool
dipole_moment( core_radius: f64, density: f64, angular_velocity: f64, conductivity: f64, convective_power: f64, ) -> f64
convective_power( cmb_flux: f64, core_radius: f64, ) -> f64
tidal_heating_rate( mass: f64, radius: f64, eccentricity: f64, orbital_freq: f64, tidal_q: f64, rigidity: f64, ) -> f64
radiogenic_heating( mass_mantle: f64, concentration_u238: f64, concentration_th232: f64, concentration_k40: f64, time_ga: f64, ) -> f64
secular_cooling_flux( core_heat_capacity: f64, core_mass: f64, cooling_rate_k_per_s: f64, core_radius: f64, ) -> f64
gravitational_differentiation_power( inner_core_growth_rate: f64, density_contrast: f64, g_cmb: f64, core_radius: f64, ) -> f64
parameterized_mantle_temperature( initial_temp: f64, radiogenic_heat: f64, surface_heat_loss: f64, mantle_heat_capacity: f64, mantle_mass: f64, dt: f64, ) -> f64
stagnant_lid_thickness( mantle_depth: f64, activation_energy: f64, delta_t: f64, interior_temp: f64, ) -> f64
planet_surface_heat_flux( interior_temp: f64, surface_temp: f64, thermal_conductivity: f64, lithosphere_thickness: f64, ) -> f64
core_liquidus(pressure_gpa: f64, fe_fraction: f64) -> f64

petrology (10 functions)

FunctionSignature
cipw_quartz_norm(sio2: f64, feldspars: f64, mafics: f64) -> f64
mg_number(mgo: f64, feo: f64) -> f64
differentiation_index(q: f64, or_val: f64, ab: f64, ne: f64) -> f64
total_alkali_silica(na2o: f64, k2o: f64) -> f64
alumina_saturation_index(al2o3: f64, cao: f64, na2o: f64, k2o: f64) -> f64
color_index`(mafic_minerals: &[f64]) -> f64`
liquidus_temperature(composition: f64, t_melt_a: f64, t_melt_b: f64) -> f64
solidus_depression(water_content: f64, base_solidus: f64, k: f64) -> f64
crystal_settling_velocity(delta_rho: f64, g: f64, r: f64, mu: f64) -> f64
viscosity_arrhenius(a: f64, ea: f64, t: f64) -> f64

seismology (12 functions)

FunctionSignature
p_wave_velocity(k: f64, g: f64, rho: f64) -> f64
s_wave_velocity(g: f64, rho: f64) -> f64
richter_magnitude(amplitude: f64, distance_km: f64) -> f64
moment_magnitude(seismic_moment: f64) -> f64
seismic_moment(mw: f64) -> f64
epicenter_distance(vp: f64, vs: f64, ts_tp: f64) -> f64
travel_time(distance: f64, velocity: f64) -> f64
snell_seismic(v1: f64, theta1: f64, v2: f64) -> f64
gutenberg_richter(a: f64, b: f64, magnitude: f64) -> f64
omori_aftershock(k: f64, c: f64, p: f64, t: f64) -> f64
seismic_energy(magnitude: f64) -> f64
peak_ground_acceleration(a: f64, b: f64, magnitude: f64, distance: f64) -> f64

tectonics (11 functions)

FunctionSignature
plate_velocity(distance: f64, time: f64) -> f64
euler_pole_velocity(omega: f64, radius: f64, colatitude: f64) -> f64
isostatic_equilibrium(rho_crust: f64, thickness: f64, rho_mantle: f64) -> f64
pratt_isostasy(rho_ref: f64, d_ref: f64, elevation: f64) -> f64
airy_root(elevation: f64, rho_crust: f64, rho_mantle: f64) -> f64
thermal_subsidence(e0: f64, t: f64, tau: f64) -> f64
mckenzie_stretching(beta: f64, rho_m: f64, rho_c: f64, alpha: f64, tl: f64, tc: f64) -> f64
heat_flow(k: f64, dt_dz: f64) -> f64
geothermal_gradient(surface_temp: f64, depth: f64, gradient: f64) -> f64
flexural_rigidity(e: f64, te: f64, nu: f64) -> f64
elastic_thickness_from_rigidity(d: f64, e: f64, nu: f64) -> f64

volcanism (18 functions)

FunctionSignature
magma_viscosity(a: f64, activation_energy: f64, temperature_k: f64) -> f64
magma_buoyancy_force( rho_magma: f64, rho_crust: f64, g_surface: f64, chamber_volume: f64, ) -> f64
overpressure_threshold( tensile_strength: f64, lithostatic_pressure: f64, ) -> f64
chamber_overpressure( bulk_modulus: f64, volume_injected: f64, chamber_volume: f64, ) -> f64
effusion_rate( overpressure: f64, conduit_radius: f64, conduit_length: f64, viscosity: f64, ) -> f64
volcanic_explosivity_index(ejecta_volume_km3: f64) -> f64
lava_flow_velocity( g_surface: f64, slope_angle: f64, thickness: f64, density: f64, viscosity: f64, ) -> f64
pyroclastic_column_height(thermal_flux: f64) -> f64
seismic_to_eruption_probability( cumulative_seismic_moment: f64, critical_moment: f64, b_value: f64, ) -> f64
tidal_triggering_stress( mass_perturber: f64, distance: f64, body_radius: f64, ) -> f64
coulomb_failure_stress( shear_stress: f64, normal_stress: f64, pore_pressure: f64, friction_coefficient: f64, cohesion: f64, ) -> f64
magma_ascent_velocity( density_contrast: f64, g_surface: f64, conduit_radius: f64, viscosity: f64, ) -> f64
volatile_exsolution_depth( saturation_pressure: f64, density: f64, g_surface: f64, ) -> f64
fragmentation_threshold( porosity: f64, vesicularity_critical: f64, ) -> bool
tephra_fallout_distance( column_height: f64, wind_speed: f64, particle_settling_velocity: f64, ) -> f64
thermal_erosion_rate( lava_temperature: f64, substrate_solidus: f64, lava_velocity: f64, thermal_diffusivity: f64, ) -> f64
degassing_rate( volatile_concentration: f64, solubility_coefficient: f64, pressure: f64, ) -> f64
eruption_energy(ejecta_mass: f64, ejecta_velocity: f64, thermal_energy: f64) -> f64

Hub dispatch mapping

All geology functions are wired through:

  • src/hub/engine/dispatch/geology.rs

Hub Source Code Guide

This page documents the source implementation behind sciforge::hub, including API layer, engine internals, dispatch routing, and tooling modules.

Source Coverage

What is explained

  • File-level implementation layout in src/hub/.
  • Main orchestration components and where they are implemented.
  • Runtime call path from API entry points to domain dispatchers.

Visibility and external access

  • hub is public from src/lib.rs (pub mod hub;).
  • External consumers should prefer sciforge::hub::prelude::* for stable entry points.
  • This is the recommended external path to reach pub(crate) science domains.

Source Code Explanation

Relevant file structure

  • Main implementation: src/hub/
  • Module entry point: src/hub/mod.rs
  • Hub routing (when applicable): src/hub/engine/dispatch/*.rs

Internal execution flow

  1. The module exposes subdomains through mod.rs and targeted pub use exports.
  2. Each .rs file implements a coherent orchestration or tooling block.
  3. The engine dispatchers route computation requests to domain implementations.

What to check while reading code

  • Exact signature: input/output types and argument order.
  • Routing logic and parameter coercion in dispatch modules.
  • Error propagation paths and domain boundary assumptions.

Modules

  • api — HTTP and CLI interfaces, DTOs, routes
  • domainDomainType enum and domain metadata
  • engine — experiment execution, pipelines, task scheduling
  • experienceExperiment / ExperimentRunner
  • pipelinePipeline / Stage composition
  • workerScheduler, TaskQueue, Executor, ExecutionContext
  • dispatch — domain-specific dispatch handlers (astronomy, biology, chemistry, geology, maths, meteorology, physics)
  • tools — numerical utilities, visualization, profiling, validation, logging
  • prelude — convenience re-exports

Prelude

use sciforge::hub::prelude::*;

Exports: Experiment, ExperimentRunner, DomainType, ParameterValue, Pipeline, Stage, Scheduler, TaskQueue, Executor.


Engine — Experiment API

Structs

StructDescription
ExperimentA named experiment with a domain, function name, and parameter map
ExperimentRunnerRuns an Experiment by dispatching to the correct domain handler

Usage

let exp = Experiment::new(DomainType::Physics, "lorentz_factor")
				.param("velocity", ParameterValue::Scalar(2.0e8));

let result = ExperimentRunner::new().run(&exp)?;

Engine — Pipeline API

Structs

StructDescription
PipelineAn ordered sequence of Stage transforms applied to a data vector
StageA single named transform step (function Vec<f64> -> Vec<f64>)

Built-in stage constructors

  • `normalize_stage()` — normalizes vector to [0, 1]
  • filter_positive_stage() — keeps only positive values
  • scale_stage(factor: f64) — multiplies each element by factor

Usage

let pipeline = Pipeline::new()
		.add(normalize_stage())
		.add(scale_stage(100.0));

let output = pipeline.run(input_data);

Engine — Worker / Scheduler API

Structs

StructDescription
SchedulerManages a queue of ScheduledTask with priority and timing
ScheduledTaskA task with an execution time and priority
TaskA named unit of work with associated TaskResult
TaskQueueFIFO/priority queue of tasks
TaskResultOutput and status of a completed task
ExecutionContextRuntime context passed to each task during execution
ExecutorDrives task execution loop, dispatching from a TaskQueue

Tools — Visualization

Generate ASCII/text-based plots for quick inspection:

  • `line_chart(data: &[f64], title: &str)` — ASCII line chart
  • `bar_chart(data: &[f64], labels: &[&str])` — ASCII bar chart
  • `scatter_plot(xs: &[f64], ys: &[f64])` — ASCII scatter plot
  • `histogram(data: &[f64], bins: usize)` — ASCII histogram
  • `heatmap(matrix: &[Vec<f64>])` — ASCII heatmap

Tools — Numerical Utilities

  • `kahan_sum(data: &[f64])` — compensated summation (Kahan)
  • `kahan_dot(a: &[f64], b: &[f64])` — compensated dot product
  • `fingerprint(data: &[f64])` — u64 hash fingerprint of a float slice
  • fingerprint_scalar(v: f64) — u64 hash of a scalar
  • linspace(start, end, n)Vec<f64> — evenly spaced points
  • logspace(start_exp, end_exp, n)Vec<f64> — logarithmically spaced points
  • `normalize(data: &[f64])` → `Vec<f64>` — rescale to [0, 1]
  • `moving_average(data: &[f64], window: usize)Vec<f64>`
  • `clamp_vec(data: &[f64], min, max)Vec<f64>`
  • `cumulative_sum(data: &[f64])Vec<f64>`
  • relative_error(computed, reference)f64
  • scalar_value(v: f64) — wraps a scalar for use with the pipeline

Tools — Formatting

  • format_scientific(v: f64, precision: usize)String — e.g. "3.14e+00"
  • format_si(v: f64, unit: &str)String — SI prefix scaling (k, M, G, …)
  • format_ns(duration_ns: u64)String — nanoseconds as human-readable duration

Tools — Profiling

  • profile_experiment(exp: &Experiment, runner: &ExperimentRunner) — time a single experiment
  • `profile_batch(exps: &[Experiment], runner: &ExperimentRunner)` — time multiple experiments
  • quick_profile<F: Fn()>(f: F)Duration — time any closure
  • run_timed<F: Fn() -> T>(f: F)(T, Duration) — run and return result + duration

Tools — Validation

  • `run_validation(data: &[f64])` — run standard suite of checks
  • `check_monotonicity(data: &[f64])` — assert data is non-decreasing
  • `check_nan_safety(data: &[f64])` — assert no NaN or Inf values
  • assert_reproducible(f: F, n: usize) — run f n times, assert identical results
  • `compare_entries(a: &[f64], b: &[f64], tol: f64)` — element-wise comparison
  • approx_equal(a: f64, b: f64, tol: f64)bool

Tools — Logging

Thread-safe, level-gated logger:

  • info(msg: &str), warn(msg: &str), error(msg: &str)
  • debug(msg: &str), trace(msg: &str)
  • log(level: LogLevel, msg: &str) — generic log call
  • set_level(level: LogLevel) — configure minimum log level
  • current_level()LogLevel
  • usage() — print module usage summary

Tools — Reporting

  • report_to_latex(metrics)String — LaTeX table from benchmark metrics
  • report_to_tsv(metrics)String — TSV table from benchmark metrics

Domain Dispatch

The DomainType enum routes function calls to the correct scientific module:

VariantDispatches to
DomainType::Astronomysrc/hub/engine/dispatch/astronomy.rs
DomainType::Biologysrc/hub/engine/dispatch/biology.rs
DomainType::Chemistrysrc/hub/engine/dispatch/chemistry.rs
DomainType::Geologysrc/hub/engine/dispatch/geology.rs
DomainType::Mathssrc/hub/engine/dispatch/maths.rs
DomainType::Meteorologysrc/hub/engine/dispatch/meteorology.rs
DomainType::Physicssrc/hub/engine/dispatch/physics.rs

Mathematics Source Code Guide

This page documents the source implementation behind sciforge::maths, including module layout and Hub dispatch wiring.

Source Coverage

What is explained

  • File-level implementation layout in src/maths/.
  • Main algorithm families and where they are implemented.
  • Runtime call path when maths functions are executed through Hub dispatch.

Visibility and external access

  • This domain module is pub(crate) in src/lib.rs and is not part of the external crate API.
  • External consumers should use the public sciforge::hub API for these computations.
  • Direct module paths shown here are for internal development and source-level understanding.

Source Code Explanation

Relevant file structure

  • Main implementation: src/maths/
  • Module entry point: src/maths/mod.rs
  • Hub routing: src/hub/engine/dispatch/maths.rs

Internal logic

  1. The module is split into algorithmic families (linalg, ode, pde, statistics, etc.).
  2. Each submodule groups related numerical methods behind public functions.
  3. Hub dispatch maps experiment function names to direct Rust calls with typed parameters.

What to verify in source code

  • Numeric preconditions (matrix shape compatibility, positive step sizes, tolerances).
  • Stability conditions (CFL-like constraints in PDE solvers, convergence criteria).
  • Complexity and allocation behavior for large inputs.

Modules

  • complex
  • fft
  • graph
  • integration
  • interpolation
  • linalg
  • non_euclidean
  • ode
  • optimization
  • pde
  • polynomial
  • probability
  • signal
  • sparse
  • statistics
  • tensor
  • vector

Complex API (26 functions)

Submodules

  • typesComplex<f64> type, constructors, polar/rectangular forms
  • ops — arithmetic, exp, log, trig, hyperbolic functions on complex numbers
  • quaternionQuaternion type, Hamilton product, rotation, normalization

Selected functions

  • Complex::new(re, im), Complex::from_polar(r, theta)
  • complex_exp(z), complex_ln(z), complex_sqrt(z)
  • complex_sin(z), complex_cos(z), complex_tan(z)
  • Quaternion::new(w, x, y, z), quaternion_rotate(q, v)

FFT API (51 functions)

Submodules

  • radix2 — Cooley-Tukey FFT/IFFT for power-of-two sizes
  • dct — Discrete Cosine Transform (types I–IV)
  • bluestein — Chirp-Z / Bluestein FFT for arbitrary sizes

Selected functions

  • fft(signal) → complex spectrum
  • ifft(spectrum) → time-domain signal
  • dct_ii(signal), dct_iii(signal), dct_iv(signal)
  • bluestein_fft(signal, n_out) — arbitrary-length DFT
  • power_spectrum(signal)

Graph API (58 functions)

Submodules

  • traversal — BFS, DFS, topological sort, connected components
  • shortest_path — Dijkstra, Bellman-Ford, Floyd-Warshall, A*
  • spanning_tree — Kruskal, Prim, minimum/maximum spanning tree
  • flow — Ford-Fulkerson, Edmonds-Karp, max-flow/min-cut

Selected functions

  • dijkstra(graph, source) → distances
  • bellman_ford(graph, source) → distances (handles negative weights)
  • floyd_warshall(graph) → all-pairs shortest paths
  • kruskal_mst(graph), prim_mst(graph, start)
  • bfs(graph, start), dfs(graph, start)
  • ford_fulkerson(graph, source, sink)

Integration API (47 functions)

Submodules

  • quadrature — trapezoidal, Simpson, Gauss-Legendre, Romberg
  • adaptive — adaptive Simpson, adaptive Gauss-Kronrod (GK15, GK21)
  • multidim — double/triple integrals, Monte Carlo integration

Selected functions

  • trapezoidal(f, a, b, n)
  • simpsons(f, a, b, n)
  • gauss_legendre(f, a, b, n_points)
  • romberg(f, a, b, max_iter, tol)
  • adaptive_simpson(f, a, b, tol)
  • monte_carlo_integral(f, domain, n_samples)
  • double_integral(f, ax, bx, ay, by, n)

Interpolation API (34 functions)

Submodules

  • lagrange — Lagrange polynomial interpolation, Neville's algorithm
  • methods — linear, bilinear, cubic, nearest-neighbor
  • spline — natural cubic spline, clamped spline, B-spline

Selected functions

  • lagrange_interpolate(xs, ys, x)
  • neville(xs, ys, x)
  • linear_interpolate(x0, y0, x1, y1, x)
  • cubic_spline(xs, ys) → spline object
  • spline_eval(spline, x)
  • bspline_basis(i, k, t, knots)

Linear Algebra API (57 functions)

Submodules

  • decomposition — LU, QR, Cholesky, SVD decompositions
  • eigenvalue — power iteration, QR algorithm, Jacobi method
  • factorization — LDL^T, Schur, polar decomposition
  • least_squares — normal equations, QR least squares, pseudoinverse

Selected functions

  • lu_decompose(matrix) → (L, U, P)
  • qr_decompose(matrix) → (Q, R)
  • cholesky(matrix) → L (lower triangular)
  • svd(matrix) → (U, Σ, V^T)
  • eigenvalues_qr(matrix, tol, max_iter)
  • solve_linear(a, b) — Ax = b via LU
  • pseudoinverse(matrix)
  • least_squares_qr(a, b)

Non-Euclidean Geometry API (56 functions)

Submodules

  • metric — metric tensors (Minkowski, Schwarzschild, Kerr, FRW)
  • geodesic — geodesic equations, numerical integration
  • curvature — Riemann tensor, Ricci scalar, Christoffel symbols
  • cosmology — scale factor, Friedmann equations
  • black_hole — Schwarzschild radius, Hawking temperature, ergosphere

Selected functions

  • schwarzschild_radius(mass)
  • hawking_temperature(mass)
  • christoffel_symbols(metric, coord)
  • riemann_tensor(metric, coord)
  • ricci_scalar(metric, coord)
  • geodesic_equation(metric, initial_pos, initial_vel, tau_span)

ODE API (35 functions)

Submodules

  • solvers — Euler, RK4, RK45, Adams-Bashforth, implicit methods
  • systems — system of ODEs interface
  • bvp — boundary value problems (shooting method, collocation)

Selected functions

  • euler(f, y0, t0, tf, dt)
  • rk4(f, y0, t0, tf, dt)
  • rk45_adaptive(f, y0, t0, tf, tol, dt_init)
  • adams_bashforth4(f, y0, t_span, dt)
  • shooting_method(f, ya, yb, t_span)
  • solve_bvp(f, bc, t_span, n_points)

Optimization API (53 functions)

Submodules

  • gradient — gradient descent, Adam, L-BFGS, conjugate gradient
  • constrained — Lagrangian, interior-point, sequential quadratic programming
  • evolutionary — genetic algorithm, differential evolution, CMA-ES
  • metaheuristic — simulated annealing, particle swarm, tabu search

Selected functions

  • gradient_descent(f, grad_f, x0, lr, max_iter)
  • adam_optimizer(f, grad_f, x0, params)
  • lbfgs(f, grad_f, x0, max_iter)
  • conjugate_gradient(a, b) — linear system solver
  • genetic_algorithm(fitness, bounds, pop_size, generations)
  • simulated_annealing(f, x0, t_init, cooling)
  • particle_swarm(f, bounds, n_particles, max_iter)

PDE API (71 functions)

Submodules

  • finite_diff — finite difference schemes (explicit, implicit, Crank-Nicolson)
  • diffusion — heat equation (1D/2D/3D), reaction-diffusion
  • wave — wave equation (1D/2D), SH waves
  • laplace — Laplace/Poisson equation, SOR, multigrid

Selected functions

  • heat_equation_1d_explicit(u0, alpha, dx, dt, steps)
  • heat_equation_2d_adi(u0, alpha, dx, dy, dt, steps)
  • crank_nicolson_diffusion(u0, alpha, dx, dt, steps)
  • wave_equation_1d(u0, v0, c, dx, dt, steps)
  • laplace_2d_sor(boundary, omega, tol)
  • poisson_2d(rhs, dx, dy, boundary)

Polynomial API (29 functions)

Submodules

  • polyPolynomial type, evaluation, arithmetic, derivative, integral
  • roots — root finding (Durand-Kerner, Jenkins-Traub, Bairstow)
  • special — Legendre, Hermite, Laguerre, Chebyshev polynomials

Selected functions

  • Polynomial::new(coeffs), poly_eval(poly, x)
  • poly_add(p, q), poly_mul(p, q), poly_div(p, q)
  • poly_derivative(poly), poly_integral(poly)
  • poly_roots(poly) → complex roots
  • legendre(n, x), hermite(n, x), chebyshev_t(n, x), laguerre(n, x)

Probability API (69 functions)

Submodules

  • distributions — PDF, CDF, quantile for Normal, Poisson, Binomial, etc.
  • sampling — Box-Muller, rejection sampling, inverse CDF
  • markov — transition matrices, stationary distribution, MCMC
  • monte_carlo — MC estimation, variance reduction, quasi-random

Selected functions

  • normal_pdf(x, mu, sigma), normal_cdf(x, mu, sigma)
  • poisson_pmf(k, lambda), binomial_pmf(k, n, p)
  • sample_normal(mu, sigma), sample_poisson(lambda)
  • metropolis_hastings(target, proposal, x0, n_samples)
  • markov_stationary(transition_matrix)

Signal Processing API (70 functions)

Submodules

  • filters — FIR/IIR filters, Butterworth, Chebyshev, window functions
  • spectral — power spectral density, spectrogram, periodogram
  • convolution — 1D/2D linear/circular convolution, cross-correlation
  • wavelets — DWT, IDWT, Daubechies, Haar wavelets

Selected functions

  • fir_filter(signal, coeffs), iir_filter(signal, b, a)
  • butterworth_lowpass(order, cutoff_freq)
  • hamming_window(n), hann_window(n), blackman_window(n)
  • psd_welch(signal, fs, nperseg)
  • convolve(signal, kernel), correlate(x, y)
  • dwt(signal, wavelet), idwt(coeffs, wavelet)

Sparse Matrix API (24 functions)

Submodules

  • csr — Compressed Sparse Row matrix storage
  • ops — sparse matrix arithmetic, transpose, norms
  • solvers — CG, GMRES, sparse LU, iterative solvers

Selected functions

  • CsrMatrix::new(rows, cols, data, indices, indptr)
  • sparse_add(a, b), sparse_mul(a, b)
  • sparse_mv(matrix, vec) — matrix-vector product
  • sparse_transpose(matrix)
  • conjugate_gradient_sparse(a, b, x0, tol)
  • gmres(a, b, x0, restart, tol)

Statistics API (71 functions)

Submodules

  • descriptive — mean, variance, skewness, kurtosis, quantiles
  • distributions — t, chi², F, KS distributions and tests
  • hypothesis — t-test, ANOVA, chi-square test, Wilcoxon
  • regression — linear, polynomial, logistic regression, R²

Selected functions

  • mean(data), variance(data), std_dev(data)
  • median(data), percentile(data, p), iqr(data)
  • skewness(data), kurtosis(data)
  • t_test_one_sample(data, mu0), t_test_two_sample(a, b)
  • chi_square_test(observed, expected)
  • linear_regression(xs, ys) → (slope, intercept, r_squared)
  • pearson_correlation(x, y), spearman_correlation(x, y)

Tensor API (27 functions)

Submodules

  • storage — N-dimensional dense tensor storage
  • ops — element-wise arithmetic, contraction, outer product
  • linalg — tensor norms, trace, symmetric/antisymmetric parts
  • decompose — Tucker decomposition, CP decomposition
  • display — pretty-print tensors

Selected functions

  • Tensor::new(shape, data), Tensor::zeros(shape), Tensor::ones(shape)
  • tensor_add(a, b), tensor_mul_scalar(t, s)
  • tensor_contract(a, b, axes) — Einstein summation
  • tensor_outer(a, b), tensor_transpose(t, perm)
  • tucker_decompose(tensor, ranks), cp_decompose(tensor, rank)

Vector Fields API (41 functions)

Submodules

  • typesVec2, Vec3, VecN with arithmetic operators
  • ops — dot product, cross product, norm, normalization
  • fields — gradient, divergence, curl, Laplacian
  • integrators — Euler, RK4 integration of vector field ODEs
  • sim — particle simulation utilities

Selected functions

  • Vec3::new(x, y, z), dot(a, b), cross(a, b), norm(v)
  • gradient(f, point, h), divergence(f, point, h)
  • curl(f, point, h), laplacian(f, point, h)
  • euler_step(field, pos, dt), rk4_step(field, pos, dt)

Hub dispatch mapping

All mathematics functions are wired through:

  • src/hub/engine/dispatch/maths.rs
use sciforge::hub::prelude::*;

let exp = Experiment::new(DomainType::Maths, "linear_regression")
        .param("xs", ParameterValue::Vector(vec![1.0, 2.0, 3.0]))
        .param("ys", ParameterValue::Vector(vec![2.1, 4.0, 5.9]));

let out = ExperimentRunner::new().run(&exp)?;

Meteorology Source Code Guide

This page documents the source implementation behind sciforge::meteorology, including file layout and Hub dispatch wiring.

Source Coverage

What is explained

  • File-level implementation layout in src/meteorology/.
  • Main computation groups and where they are implemented.
  • Runtime call path when meteorology functions are executed through Hub dispatch.

Visibility and external access

  • This domain module is pub(crate) in src/lib.rs and is not part of the external crate API.
  • External consumers should use the public sciforge::hub API for these computations.
  • Direct module paths shown here are for internal development and source-level understanding.

Source Code Explanation

Relevant file structure

  • Main implementation: src/meteorology/
  • Module entry point: src/meteorology/mod.rs
  • Hub routing (when applicable): src/hub/engine/dispatch/meteorology.rs

Internal execution flow

  1. The module exposes subdomains through mod.rs and targeted pub use exports.
  2. Each .rs file implements a coherent block of equations and functions.
  3. The Hub invokes these functions through the domain dispatcher when execution goes through ExperimentRunner.

What to check while reading code

  • Exact signature: input/output types and argument order.
  • Numerical preconditions: divisions, roots, logarithms, and validity ranges.
  • Implicit conventions: units, normalization, bounds, and tolerances.

Modules

  • atmosphere — atmospheric structure, thermodynamic properties
  • clouds — cloud classification, formation, microphysics
  • dynamics — mesoscale and synoptic dynamics, Coriolis effects
  • ocean — ocean-atmosphere coupling, SST, thermohaline circulation
  • precipitation — rainfall statistics, evapotranspiration, runoff
  • radiation — solar and terrestrial radiation, climate forcing
  • storms — cyclone intensity, storm surge, convective dynamics
  • winds — wind profiles, Beaufort scale, turbulence

atmosphere (17 functions)

FunctionSignature
barometric_formula(p0: f64, m: f64, g: f64, h: f64, t: f64) -> f64
scale_height(t: f64, m: f64, g: f64) -> f64
lapse_rate_dry() -> f64
lapse_rate_moist(t: f64, l_v: f64, r_s: f64) -> f64
potential_temperature(t: f64, p: f64, p0: f64) -> f64
virtual_temperature(t: f64, r: f64) -> f64
mixing_ratio(e: f64, p: f64) -> f64
saturation_vapor_pressure(t_celsius: f64) -> f64
relative_humidity(e: f64, es: f64) -> f64
dew_point(t: f64, rh: f64) -> f64
density_altitude(pressure_altitude: f64, temperature_c: f64) -> f64
brunt_vaisala_frequency(g: f64, theta: f64, dtheta_dz: f64) -> f64
mie_phase(cos_theta: f64, g: f64) -> f64
lifted_condensation_level(t_surface: f64, dew_point: f64) -> f64
dry_adiabatic_temperature(t_surface: f64, altitude: f64) -> f64
convective_available_potential_energy`( t_parcel: &[f64], t_env: &[f64], dz: f64, ) -> f64`
convective_inhibition`( t_parcel: &[f64], t_env: &[f64], dz: f64, ) -> f64`

clouds (21 functions)

FunctionSignature
saturation_vapor_pressure(temperature_k: f64) -> f64
cloud_base_altitude( surface_temperature: f64, dew_point: f64, lapse_rate: f64, ) -> f64
adiabatic_liquid_water_content( altitude_above_base: f64, lapse_rate: f64, temperature_at_base: f64, ) -> f64
cloud_optical_depth( liquid_water_path: f64, effective_radius: f64, ) -> f64
cloud_albedo(optical_depth: f64) -> f64
droplet_growth_condensation( supersaturation: f64, radius: f64, temperature: f64, pressure: f64, ) -> f64
droplet_growth_collision( collector_radius: f64, collected_radius: f64, liquid_water_content: f64, collection_efficiency: f64, density_water: f64, terminal_velocity_diff: f64, ) -> f64
autoconversion_rate( lwc: f64, droplet_concentration: f64, threshold_lwc: f64, ) -> f64
ice_crystal_growth_rate( temperature_k: f64, supersaturation_ice: f64, ) -> f64
bergeron_process_rate( ice_crystal_density: f64, lwc: f64, temperature_k: f64, ) -> f64
cloud_layer_temperature( base_temperature: f64, lapse_rate: f64, altitude_above_base: f64, ) -> f64
mie_size_parameter( particle_radius: f64, wavelength: f64, ) -> f64
extinction_efficiency(size_parameter: f64) -> f64
cloud_emissivity(optical_depth: f64) -> f64
convective_available_potential_energy`( parcel_temperatures: &[f64], env_temperatures: &[f64], altitudes: &[f64], g_local: f64, ) -> f64`
convective_inhibition`( parcel_temperatures: &[f64], env_temperatures: &[f64], altitudes: &[f64], g_local: f64, ) -> f64`
henyey_greenstein_phase(cos_theta: f64, asymmetry: f64) -> f64
cloud_radiative_forcing( cloud_albedo: f64, surface_albedo: f64, solar_flux: f64, cloud_fraction: f64, longwave_trapping: f64, ) -> f64
nucleation_rate_ccn( supersaturation: f64, ccn_concentration: f64, k_exponent: f64, ) -> f64
rain_evaporation_rate( rain_rate: f64, relative_humidity: f64, temperature: f64, ) -> f64
terminal_velocity_droplet(radius_m: f64) -> f64

dynamics (10 functions)

FunctionSignature
coriolis_parameter(latitude: f64, omega: f64) -> f64
geostrophic_wind(dp_dx: f64, dp_dy: f64, rho: f64, f: f64) -> (f64, f64)
rossby_number(u: f64, l: f64, f: f64) -> f64
rossby_wave_speed(beta: f64, k: f64) -> f64
thermal_wind(f: f64, delta_t: f64, delta_x: f64, t_mean: f64) -> f64
potential_vorticity(f: f64, dtheta_dp: f64) -> f64
ekman_depth(nu: f64, f: f64) -> f64
richardson_number(n2: f64, du_dz: f64) -> f64
rossby_deformation_radius(n: f64, h: f64, f: f64) -> f64
cyclone_gradient_wind(r: f64, f: f64, dp_dr: f64, rho: f64) -> f64

ocean (26 functions)

FunctionSignature
deep_water_phase_speed(g_local: f64, wavelength: f64) -> f64
shallow_water_phase_speed(g_local: f64, depth: f64) -> f64
wave_dispersion(g_local: f64, k: f64, depth: f64) -> f64
phillips_spectrum( k: f64, wind_speed: f64, g_local: f64, wind_direction_x: f64, wind_direction_y: f64, kx: f64, ky: f64, ) -> f64
jonswap_spectrum( omega: f64, wind_speed: f64, fetch: f64, g_local: f64, ) -> f64
significant_wave_height( wind_speed: f64, fetch: f64, g_local: f64, ) -> f64
wave_period( wind_speed: f64, fetch: f64, g_local: f64, ) -> f64
stokes_drift( amplitude: f64, omega: f64, k: f64, depth: f64, z: f64, ) -> f64
ekman_transport( wind_stress: f64, coriolis_parameter: f64, density: f64, ) -> f64
ekman_spiral_velocity( surface_current: f64, ekman_depth: f64, z: f64, ) -> (f64, f64)
thermohaline_density( rho_0: f64, alpha_t: f64, beta_s: f64, temperature: f64, t_ref: f64, salinity: f64, s_ref: f64, ) -> f64
overturning_stream_function( thermal_forcing: f64, salinity_forcing: f64, alpha_t: f64, beta_s: f64, kappa: f64, depth: f64, ) -> f64
mixed_layer_depth( wind_stress: f64, buoyancy_flux: f64, coriolis: f64, ) -> f64
tidal_amplitude( mass_perturber: f64, distance: f64, body_radius: f64, ocean_depth: f64, g_surface: f64, ) -> f64
geostrophic_current( g_local: f64, sea_surface_slope: f64, coriolis: f64, ) -> f64
upwelling_velocity( wind_stress_curl: f64, coriolis: f64, density: f64, ) -> f64
ocean_heat_content( density: f64, specific_heat: f64, delta_t: f64, depth: f64, area: f64, ) -> f64
sea_ice_growth_rate( thermal_conductivity_ice: f64, ice_thickness: f64, surface_temp: f64, freezing_point: f64, latent_heat: f64, ice_density: f64, ) -> f64
internal_wave_speed( g_local: f64, density_upper: f64, density_lower: f64, depth_upper: f64, depth_lower: f64, ) -> f64
langmuir_circulation_depth( wind_speed: f64, surface_current: f64, ) -> f64
seawater_density(t: f64, s: f64) -> f64
sound_speed(t: f64, s: f64, d: f64) -> f64
sea_level_rise_thermal(alpha: f64, delta_t: f64, d: f64) -> f64
henry_solubility(kh: f64, t: f64, delta_h: f64) -> f64
haline_contraction_coefficient(salinity_psu: f64) -> f64
thermal_expansion_coefficient_sw(temperature_c: f64) -> f64

precipitation (10 functions)

FunctionSignature
rain_rate_marshall_palmer(z: f64) -> f64
radar_reflectivity(rain_rate: f64) -> f64
terminal_velocity_raindrop(diameter_mm: f64) -> f64
thornthwaite_pet(t_mean: f64, heat_index: f64, day_length_hours: f64) -> f64
penman_evaporation(delta: f64, rn: f64, gamma: f64, ea: f64, u: f64) -> f64
intensity_duration_frequency(a: f64, b: f64, duration: f64, return_period: f64) -> f64
scs_curve_number_runoff(p: f64, cn: f64) -> f64
rational_method_runoff(c: f64, i: f64, a: f64) -> f64
unit_hydrograph_peak(a: f64, tp: f64) -> f64
antecedent_precipitation_index(prev_api: f64, rainfall: f64, k: f64) -> f64

radiation (12 functions)

FunctionSignature
stefan_boltzmann_flux(t: f64) -> f64
solar_constant() -> f64
albedo_reflected(solar_flux: f64, albedo: f64) -> f64
effective_temperature(solar_flux: f64, albedo: f64) -> f64
greenhouse_effect(t_surface: f64, t_effective: f64) -> f64
optical_depth(absorption_coeff: f64, path_length: f64) -> f64
beer_lambert(i0: f64, tau: f64) -> f64
planck_function(wavelength: f64, t: f64) -> f64
solar_zenith_angle(lat: f64, declination: f64, hour_angle: f64) -> f64
radiative_forcing_co2(c: f64, c0: f64) -> f64
climate_sensitivity(delta_t: f64, delta_f: f64) -> f64
outgoing_longwave_radiation(t: f64, emissivity: f64) -> f64

storms (5 functions)

FunctionSignature
potential_intensity(ck: f64, cd: f64, eta: f64, delta_k: f64) -> f64
accumulated_cyclone_energy`(v_kt_series: &[f64]) -> f64`
cape(t_parcel: f64, t_env: f64, g: f64, dz: f64) -> f64
rossby_deformation_radius(n: f64, h: f64, f: f64) -> f64
fujita_scale(v: f64) -> u8

winds (21 functions)

FunctionSignature
hadley_cell_extent(planet_radius: f64, rotation_rate: f64, delta_t: f64) -> f64
thermal_wind_shear( g_local: f64, coriolis: f64, temperature: f64, dt_dy: f64, ) -> f64
jet_stream_velocity( g_local: f64, delta_t: f64, meridional_distance: f64, coriolis: f64, scale_height: f64, ) -> f64
surface_wind_speed( pressure_gradient: f64, density: f64, drag_coefficient: f64, ) -> f64
wind_stress( air_density: f64, drag_coefficient: f64, wind_speed: f64, ) -> f64
planetary_vorticity(rotation_rate: f64, latitude: f64) -> f64
rossby_wave_phase_speed( beta: f64, zonal_wavenumber: f64, deformation_radius: f64, ) -> f64
beta_parameter(rotation_rate: f64, planet_radius: f64, latitude: f64) -> f64
baroclinic_instability_wavelength( deformation_radius: f64, ) -> f64
sea_breeze_speed( g_local: f64, delta_t: f64, boundary_layer_height: f64, mean_temperature: f64, ) -> f64
katabatic_wind_speed( g_local: f64, delta_t: f64, mean_temperature: f64, slope_angle: f64, slope_length: f64, drag_coefficient: f64, ) -> f64
mountain_wave_vertical_velocity( wind_speed: f64, mountain_height: f64, brunt_vaisala: f64, horizontal_wavelength: f64, ) -> f64
ekman_pumping_velocity( wind_stress_curl: f64, density: f64, coriolis: f64, ) -> f64
monin_obukhov_length( friction_velocity: f64, surface_temp: f64, sensible_heat_flux: f64, air_density: f64, specific_heat: f64, ) -> f64
log_wind_profile( friction_velocity: f64, z: f64, roughness_length: f64, ) -> f64
cyclostrophic_wind( pressure_gradient: f64, density: f64, radius: f64, ) -> f64
gradient_wind( coriolis: f64, pressure_gradient: f64, density: f64, radius: f64, ) -> f64
superrotation_index( zonal_wind: f64, planet_radius: f64, rotation_rate: f64, latitude: f64, ) -> f64
foehn_warming( lapse_dry: f64, lapse_moist: f64, mountain_height: f64, condensation_level: f64, ) -> f64
beaufort_to_m_s(b: f64) -> f64
wind_chill(t: f64, v: f64) -> f64

Hub dispatch mapping

All meteorology functions are wired through:

  • src/hub/engine/dispatch/meteorology.rs

Parser Source Code Guide

This page documents the source implementation behind sciforge::parser, including lexer/parser/value/error layering per format.

Source Coverage

What is explained

  • File-level implementation layout in src/parser/.
  • Main parsing algorithms and where they are implemented.
  • Runtime parse flow from byte cursor to typed value tree.

Visibility and external access

  • parser is public from src/lib.rs (pub mod parser;).
  • It can be consumed directly as sciforge::parser::{csv,json,yaml,markdown,html,toml}.
  • Limit-based parse variants are recommended for untrusted inputs.

Source Code Explanation

Relevant file structure

  • Main implementation: src/parser/
  • Module entry point: src/parser/mod.rs
  • Hub routing (when applicable): (n/a - parser is direct)

Internal execution flow

  1. The module exposes format subdomains through mod.rs and targeted pub use exports.
  2. Each format combines lexer/parser/value/error files into a coherent parsing pipeline.
  3. Callers invoke parse or validate functions directly; no Hub dispatcher is required.

What to check while reading code

  • Exact signature: input/output types and argument order.
  • Lifetime and borrowing rules for zero-copy values.
  • Depth/size limit enforcement for untrusted inputs.

Modules

  • csv — RFC-4180 CSV parser
  • json — RFC-8259 JSON parser
  • yaml — YAML 1.2 subset parser
  • markdown — CommonMark Markdown parser
  • html — HTML5-like parser
  • toml — TOML v1.0 parser

All parsers share the same design philosophy:

  • Parse from `&[u8]` bytes without copying
  • Return a Result<*Value<'_>, *Error> with lifetime tied to input
  • Provide validate_* for syntax checking without full allocation
  • Provide *_with_limits variants for resource-bounded parsing

csv API (27 items)

Structs

Struct
CsvErrorPosition
CsvError
Cursor
CsvLimits
CsvParser

Enums

Enum
CsvErrorKind
CsvValue

Functions

FunctionSignature
line_column`(&self, input: &[u8]) -> CsvErrorPosition`
peek(&self) -> Option<u8>
advance(&mut self, n: usize)
next(&mut self) -> Option<u8>
parse(mut self) -> Result<CsvValue<'a>, CsvError>
validate(mut self) -> Result<(), CsvError>
parse_csv`(bytes: &[u8]) -> Result<CsvValue<'_>, CsvError>`
parse_csv_with_limits`(bytes: &[u8], limits: CsvLimits) -> Result<CsvValue<'_>, CsvError>`
validate_csv`(bytes: &[u8]) -> Result<(), CsvError>`
write_csv`(header: &[&str], rows: &[Vec<String>]) -> String`

html API (38 items)

Structs

Struct
HtmlErrorPosition
HtmlError
Cursor
HtmlLimits
HtmlParser

Enums

Enum
HtmlErrorKind
HtmlValue

Functions

FunctionSignature
validate_entity(cursor: &mut Cursor<'_>) -> Result<(), HtmlError>
line_column`(&self, input: &[u8]) -> HtmlErrorPosition`
is_eof(&self) -> bool
peek(&self) -> Option<u8>
advance(&mut self, n: usize)
remaining`(&self) -> &'a [u8]`
starts_with`(&self, needle: &[u8]) -> bool`
skip_ws(&mut self)
read_while<F: Fn`(u8) -> bool>(&mut self, pred: F) -> &'a [u8]`
read_tag_name(&mut self) -> Result<&'a str, HtmlError>
parse(mut self) -> Result<HtmlValue<'a>, HtmlError>
validate(mut self) -> Result<(), HtmlError>
parse_html`(bytes: &[u8]) -> Result<HtmlValue<'_>, HtmlError>`
parse_html_with_max_depth`( bytes: &[u8], max_depth: usize, ) -> Result<HtmlValue<'_>, HtmlError>`
parse_html_with_limits`( bytes: &[u8], limits: HtmlLimits, ) -> Result<HtmlValue<'_>, HtmlError>`
validate_html`(bytes: &[u8]) -> Result<(), HtmlError>`
push_html_escaped(out: &mut String, text: &str)
push_html_row(out: &mut String, label: &str, value: &str)
push_js_escaped(out: &mut String, s: &str)

json API (28 items)

Structs

Struct
JsonErrorPosition
JsonError
JsonLimits
JsonParser

Enums

Enum
JsonErrorKind
DuplicateKeyPolicy
JsonValue
JsonVal

Functions

FunctionSignature
line_column`(&self, input: &[u8]) -> JsonErrorPosition`
parse(mut self) -> Result<JsonValue<'a>, JsonError>
validate(mut self) -> Result<(), JsonError>
parse_json`(bytes: &[u8]) -> Result<JsonValue<'_>, JsonError>`
parse_json_with_max_depth`( bytes: &[u8], max_depth: usize, ) -> Result<JsonValue<'_>, JsonError>`
parse_json_with_limits`( bytes: &[u8], limits: JsonLimits, ) -> Result<JsonValue<'_>, JsonError>`
validate_json`(bytes: &[u8]) -> Result<(), JsonError>`
write_json_object`(fields: &[(&str, JsonVal<'_>)]) -> String`
write_json_array`(items: &[String]) -> String`
push_json_escaped(out: &mut String, s: &str)

markdown API (39 items)

Structs

Struct
MdErrorPosition
MdError
MdLine
LineCursor
MdLimits
MdParser

Enums

Enum
MdErrorKind
MdValue

Functions

FunctionSignature
line_column`(&self, input: &[u8]) -> MdErrorPosition`
validate_inline(text: &str, base_offset: usize) -> Result<(), MdError>
peek_line(&self) -> Result<Option<MdLine<'a>>, MdError>
advance_line(&mut self)
parse(mut self) -> Result<MdValue<'a>, MdError>
validate(mut self) -> Result<(), MdError>
parse_md`(bytes: &[u8]) -> Result<MdValue<'_>, MdError>`
parse_md_with_max_depth`(bytes: &[u8], max_depth: usize) -> Result<MdValue<'_>, MdError>`
parse_md_with_limits`(bytes: &[u8], limits: MdLimits) -> Result<MdValue<'_>, MdError>`
validate_md`(bytes: &[u8]) -> Result<(), MdError>`
push_escaped(out: &mut String, text: &str)
render_inline(out: &mut String, text: &str)
render_md_html(src: &str) -> String
write_md_heading(level: u8, text: &str) -> String
write_md_table`(headers: &[&str], rows: &[Vec<String>]) -> String`
write_md_code_block(content: &str) -> String
write_md_row(out: &mut String, label: &str, value: &str)

toml API (38 items)

Structs

Struct
TomlErrorPosition
TomlError
Cursor
TomlLimits
TomlParser

Enums

Enum
TomlErrorKind
Token
TomlValue

Functions

FunctionSignature
line_column`(&self, input: &[u8]) -> TomlErrorPosition`
set_position(&mut self, pos: usize)
remaining`(&self) -> &'a [u8]`
next_token(&mut self) -> Result<Option<Token<'a>>, TomlError>
parse(mut self) -> Result<TomlValue<'a>, TomlError>
validate(mut self) -> Result<(), TomlError>
parse_toml`(bytes: &[u8]) -> Result<TomlValue<'_>, TomlError>`
parse_toml_with_max_depth`( bytes: &[u8], max_depth: usize, ) -> Result<TomlValue<'_>, TomlError>`
parse_toml_with_limits`( bytes: &[u8], limits: TomlLimits, ) -> Result<TomlValue<'_>, TomlError>`
validate_toml`(bytes: &[u8]) -> Result<(), TomlError>`
push_toml_escaped(out: &mut String, s: &str)
push_toml_str(out: &mut String, key: &str, val: &str)
push_toml_num(out: &mut String, key: &str, val: &str)
push_toml_section(out: &mut String, name: &str)
push_toml_array_section(out: &mut String, name: &str)

yaml API (33 items)

Structs

Struct
YamlErrorPosition
YamlError
YamlLine
LineCursor
YamlLimits
YamlParser

Enums

Enum
YamlErrorKind
YamlValue

Functions

FunctionSignature
line_column`(&self, input: &[u8]) -> YamlErrorPosition`
peek(&self) -> Result<Option<YamlLine<'a>>, YamlError>
next(&mut self) -> Result<Option<YamlLine<'a>>, YamlError>
parse(mut self) -> Result<YamlValue<'a>, YamlError>
validate(mut self) -> Result<(), YamlError>
parse_yaml`(bytes: &[u8]) -> Result<YamlValue<'_>, YamlError>`
parse_yaml_with_max_depth`( bytes: &[u8], max_depth: usize, ) -> Result<YamlValue<'_>, YamlError>`
parse_yaml_with_limits`( bytes: &[u8], limits: YamlLimits, ) -> Result<YamlValue<'_>, YamlError>`
validate_yaml`(bytes: &[u8]) -> Result<(), YamlError>`
parse_scalar<'a>(raw: &'a str, offset: usize) -> Result<YamlValue<'a>, YamlError>
write_yaml_map`(fields: &[(&str, &str)]) -> String`
write_yaml_document`( header: &[(&str, &str)], list_key: &str, items: &[Vec<(&str, &str)>], ) -> String`
push_yaml_value(out: &mut String, val: &str)

Physics Source Code Guide

This page documents the source implementation behind sciforge::physics, including module layout and Hub dispatch wiring.

Source Coverage

What is explained

  • File-level implementation layout in src/physics/.
  • Main computation groups and where they are implemented.
  • Runtime call path when physics functions are executed through Hub dispatch.

Visibility and external access

  • This domain module is pub(crate) in src/lib.rs and is not part of the external crate API.
  • External consumers should use the public sciforge::hub API for these computations.
  • Direct module paths shown here are for internal development and source-level understanding.

Source Code Explanation

Relevant file structure

  • Main implementation: src/physics/
  • Module entry point: src/physics/mod.rs
  • Hub routing (when applicable): src/hub/engine/dispatch/physics.rs

Internal execution flow

  1. The module exposes subdomains through mod.rs and targeted pub use exports.
  2. Each .rs file implements a coherent block of equations and functions.
  3. The Hub invokes these functions through the domain dispatcher when execution goes through ExperimentRunner.

What to check while reading code

  • Exact signature: input/output types and argument order.
  • Numerical preconditions: divisions, roots, logarithms, and validity ranges.
  • Implicit conventions: units, normalization, bounds, and tolerances.

Modules

  • acoustics
  • electrodynamics
  • electronics
  • fluid_mechanics
  • materials
  • nucleosynthesis
  • optics
  • particle
  • quantum
  • relativity
  • solid_mechanics
  • thermodynamics

Particle API (39 functions)

FunctionSignature
planck_energy() -> f64
planck_density() -> f64
planck_force() -> f64
planck_pressure() -> f64
planck_temperature() -> f64
planck_charge() -> f64
planck_impedance() -> f64
planck_angular_frequency() -> f64
schwarzschild_radius_planck() -> f64
hawking_temperature(mass: f64) -> f64
hawking_luminosity(mass: f64) -> f64
hawking_evaporation_time(mass: f64) -> f64
unruh_temperature(acceleration: f64) -> f64
fermi_coupling_constant() -> f64
weak_decay_rate(coupling: f64, mass: f64) -> f64
muon_decay_width() -> f64
fine_structure_constant() -> f64
strong_coupling_constant() -> f64
qcd_running_coupling(q2: f64) -> f64
electromagnetic_coupling_running(q2: f64) -> f64
weak_mixing_angle() -> f64
w_boson_mass_gev() -> f64
z_boson_mass_gev() -> f64
higgs_vev_gev() -> f64
compton_time(mass: f64) -> f64
gravitational_coupling() -> f64
photon_energy(frequency: f64) -> f64
photon_momentum(frequency: f64) -> f64
pair_production_threshold_energy(mass: f64) -> f64
cross_section_thomson() -> f64
neutrino_mass_upper_bound() -> f64
neutrino_de_broglie_wavelength(mass: f64, velocity: f64) -> f64
classical_electron_radius() -> f64
bohr_velocity() -> f64
schwinger_critical_field() -> f64

Acoustics API (48 functions)

Submodules

  • absorption — sound absorption coefficients, acoustic impedance
  • doppler — Doppler shift, observer/source velocity effects
  • propagation — wave propagation, attenuation, speed in media
  • resonance — standing waves, resonance frequencies, Q-factor

absorption (10 functions)

FunctionSignature
absorption_coefficient(frequency: f64, humidity: f64) -> f64
intensity_after_absorption(i0: f64, alpha: f64, distance: f64) -> f64
atmospheric_absorption(frequency: f64, temperature: f64, humidity: f64) -> f64
noise_reduction_coefficient`(alphas: &[f64]) -> f64`
sound_transmission_class`(tl_values: &[f64]) -> f64`
mass_law_transmission_loss(surface_density: f64, frequency: f64) -> f64
porous_absorber_flow_resistivity(porosity: f64, fiber_diameter: f64) -> f64
a_weighting(frequency: f64) -> f64
decibel_addition`(levels: &[f64]) -> f64`
room_constant(total_absorption: f64, surface_area: f64) -> f64

doppler (8 functions)

FunctionSignature
doppler_approaching(f0: f64, v_sound: f64, v_observer: f64, v_source: f64) -> f64
doppler_receding(f0: f64, v_sound: f64, v_observer: f64, v_source: f64) -> f64
doppler_general(f0: f64, v_sound: f64, v_observer: f64, v_source: f64) -> f64
relativistic_doppler(f0: f64, v: f64) -> f64
mach_cone_angle(v: f64, v_sound: f64) -> f64
doppler_shift_wavelength(lambda0: f64, v_source: f64, v_sound: f64) -> f64
doppler_radar_velocity(f_shift: f64, f_transmitted: f64, v_sound: f64) -> f64
sonic_boom_pressure(altitude: f64, mach: f64, aircraft_length: f64) -> f64

propagation (10 functions)

FunctionSignature
speed_of_sound_gas(gamma: f64, pressure: f64, density: f64) -> f64
speed_of_sound_solid(e: f64, density: f64) -> f64
wavelength(speed: f64, frequency: f64) -> f64
intensity(power: f64, area: f64) -> f64
intensity_level_db(intensity: f64, reference: f64) -> f64
sound_pressure_level(pressure: f64, reference: f64) -> f64
inverse_square_law(i0: f64, r0: f64, r: f64) -> f64
acoustic_impedance(density: f64, speed: f64) -> f64
transmission_coefficient(z1: f64, z2: f64) -> f64
reflection_coefficient(z1: f64, z2: f64) -> f64

resonance (11 functions)

FunctionSignature
fundamental_frequency_string(length: f64, tension: f64, linear_density: f64) -> f64
harmonic_frequency(fundamental: f64, n: u32) -> f64
resonant_frequency_pipe_open(length: f64, speed: f64, n: u32) -> f64
resonant_frequency_pipe_closed(length: f64, speed: f64, n: u32) -> f64
quality_factor(f_resonant: f64, bandwidth: f64) -> f64
helmholtz_resonator(speed: f64, neck_area: f64, neck_length: f64, volume: f64) -> f64
beat_frequency(f1: f64, f2: f64) -> f64
standing_wave_nodes(length: f64, n: u32) -> Vec<f64>
reverberation_time_sabine(volume: f64, total_absorption: f64) -> f64
room_mode_frequency(nx: u32, ny: u32, nz: u32, lx: f64, ly: f64, lz: f64, speed: f64) -> f64
schroeder_frequency(rt60: f64, volume: f64) -> f64

Electrodynamics API (36 functions + struct RlcCircuit)

Submodules

  • circuits — RC/RL/RLC, impedance, power
  • fields — electric/magnetic field computations
  • waves — electromagnetic wave properties, Poynting vector

circuits (18 functions + struct)

FunctionSignature
RlcCircuit::new(r: f64, l: f64, c: f64) -> Self
RlcCircuit::resonant_frequency(&self) -> f64
RlcCircuit::quality_factor(&self) -> f64
RlcCircuit::impedance(&self, omega: f64) -> (f64, f64)
RlcCircuit::impedance_magnitude(&self, omega: f64) -> f64
RlcCircuit::phase_angle(&self, omega: f64) -> f64
RlcCircuit::damping_ratio(&self) -> f64
RlcCircuit::bandwidth(&self) -> f64
RlcCircuit::transient_response(&self, t: f64, v0: f64) -> f64
rc_time_constant(r: f64, c: f64) -> f64
rl_time_constant(r: f64, l: f64) -> f64
rc_charging(v_source: f64, r: f64, c: f64, t: f64) -> f64
rc_discharging(v0: f64, r: f64, c: f64, t: f64) -> f64
power_dissipated(v: f64, r: f64) -> f64
parallel_resistance`(resistances: &[f64]) -> f64`
series_resistance`(resistances: &[f64]) -> f64`
parallel_capacitance`(capacitances: &[f64]) -> f64`
series_capacitance`(capacitances: &[f64]) -> f64`
voltage_divider(v_in: f64, r1: f64, r2: f64) -> f64
wheatstone_bridge_balance(r1: f64, r2: f64, r3: f64) -> f64
energy_capacitor(c: f64, v: f64) -> f64
energy_inductor(l: f64, i: f64) -> f64
mutual_inductance_coupling(k: f64, l1: f64, l2: f64) -> f64
transformer_ratio(n_primary: f64, n_secondary: f64, v_primary: f64) -> f64

fields (17 functions)

FunctionSignature
electric_field_point_charge`(q: f64, r: [f64; 3]) -> [f64; 3]`
electric_potential_point(q: f64, r: f64) -> f64
magnetic_field_wire(current: f64, r: f64) -> f64
magnetic_field_solenoid(n_per_length: f64, current: f64) -> f64
magnetic_field_loop(current: f64, radius: f64, z: f64) -> f64
biot_savart_segment`(current: f64, dl: [f64; 3], r: [f64; 3]) -> [f64; 3]`
lorentz_force`(q: f64, v: [f64; 3], e: [f64; 3], b: [f64; 3]) -> [f64; 3]`
poynting_vector`(e: [f64; 3], b: [f64; 3]) -> [f64; 3]`
energy_density_em`(e: [f64; 3], b: [f64; 3]) -> f64`
electric_dipole_field`(p: [f64; 3], r: [f64; 3]) -> [f64; 3]`
magnetic_dipole_field`(m: [f64; 3], r: [f64; 3]) -> [f64; 3]`
capacitance_parallel_plate(area: f64, distance: f64, epsilon_r: f64) -> f64
inductance_solenoid(n_turns: f64, length: f64, area: f64) -> f64
cyclotron_frequency(charge: f64, mass: f64, b: f64) -> f64
larmor_radius(mass: f64, v_perp: f64, charge: f64, b: f64) -> f64
plasma_frequency(number_density: f64, mass: f64, charge: f64) -> f64
debye_length(temperature: f64, number_density: f64, charge: f64) -> f64

waves (17 functions)

FunctionSignature
wave_impedance_free_space() -> f64
wave_number(frequency: f64) -> f64
wavelength(frequency: f64) -> f64
phase_velocity(epsilon_r: f64, mu_r: f64) -> f64
group_velocity_dispersive(v_phase: f64, omega: f64, dv_domega: f64) -> f64
skin_depth(frequency: f64, conductivity: f64, mu_r: f64) -> f64
fresnel_rs(n1: f64, n2: f64, theta_i: f64) -> f64
fresnel_rp(n1: f64, n2: f64, theta_i: f64) -> f64
brewster_angle(n1: f64, n2: f64) -> f64
critical_angle(n1: f64, n2: f64) -> Option<f64>
snell(n1: f64, theta1: f64, n2: f64) -> f64
radiation_pressure_absorbed(intensity: f64) -> f64
radiation_pressure_reflected(intensity: f64) -> f64
larmor_radiation_power(charge: f64, accel: f64) -> f64
antenna_radiation_resistance_dipole(length: f64, wavelength: f64) -> f64
fdtd_1d`(ez: &mut [f64], hy: &mut [f64], steps: usize)`
waveguide_cutoff_te(m: u32, n: u32, a: f64, b: f64) -> f64

Electronics API (42 functions)

Submodules

  • amplifiers — gain, bandwidth, noise figure
  • circuits — Kirchhoff laws, node analysis, thevenin/norton
  • digital — logic gates, binary operations
  • semiconductor_devices — diodes, transistors, MOSFET

amplifiers (15 functions)

FunctionSignature
inverting_gain(r_f: f64, r_in: f64) -> f64
non_inverting_gain(r_f: f64, r_in: f64) -> f64
differential_gain(r_f: f64, r_in: f64) -> f64
summing_amplifier`(v_inputs: &[f64], r_inputs: &[f64], r_f: f64) -> f64`
integrator_output(v_in: f64, r: f64, c: f64, t: f64) -> f64
differentiator_output(dv_dt: f64, r: f64, c: f64) -> f64
gain_bandwidth_product(gain: f64, bandwidth: f64) -> f64
common_emitter_voltage_gain(gm: f64, r_c: f64) -> f64
transconductance(i_c: f64, v_t: f64) -> f64
thermal_voltage(temperature_k: f64) -> f64
decibel_voltage(v_out: f64, v_in: f64) -> f64
decibel_power(p_out: f64, p_in: f64) -> f64
cascaded_gain`(gains_db: &[f64]) -> f64`
noise_figure(snr_in: f64, snr_out: f64) -> f64
friis_noise_factor`(factors: &[f64], gains: &[f64]) -> f64`

circuits (24 functions)

FunctionSignature
ohm_voltage(i: f64, r: f64) -> f64
ohm_current(v: f64, r: f64) -> f64
ohm_resistance(v: f64, i: f64) -> f64
series_resistance`(resistors: &[f64]) -> f64`
parallel_resistance`(resistors: &[f64]) -> f64`
voltage_divider(v_in: f64, r1: f64, r2: f64) -> f64
current_divider(i_total: f64, r_branch: f64, r_total_parallel: f64) -> f64
power_dc(v: f64, i: f64) -> f64
rc_charging(v_source: f64, t: f64, r: f64, c: f64) -> f64
rc_discharging(v0: f64, t: f64, r: f64, c: f64) -> f64
rl_current_rise(v: f64, r: f64, l: f64, t: f64) -> f64
rl_current_decay(i0: f64, r: f64, l: f64, t: f64) -> f64
rlc_resonant_frequency(l: f64, c: f64) -> f64
rlc_quality_factor(r: f64, l: f64, c: f64) -> f64
rlc_bandwidth(f0: f64, q: f64) -> f64
impedance_capacitor(c: f64, freq: f64) -> (f64, f64)
impedance_inductor(l: f64, freq: f64) -> (f64, f64)
impedance_magnitude(re: f64, im: f64) -> f64
impedance_phase(re: f64, im: f64) -> f64
capacitor_energy(c: f64, v: f64) -> f64
inductor_energy(l: f64, i: f64) -> f64
wheatstone_bridge_voltage(v_in: f64, r1: f64, r2: f64, r3: f64, r4: f64) -> f64
thevenin_voltage(v_oc: f64) -> f64
thevenin_resistance(v_oc: f64, i_sc: f64) -> f64
max_power_transfer(v_th: f64, r_th: f64) -> f64

digital (23 functions)

FunctionSignature
and_gate(a: bool, b: bool) -> bool
or_gate(a: bool, b: bool) -> bool
not_gate(a: bool) -> bool
nand_gate(a: bool, b: bool) -> bool
nor_gate(a: bool, b: bool) -> bool
xor_gate(a: bool, b: bool) -> bool
xnor_gate(a: bool, b: bool) -> bool
half_adder(a: bool, b: bool) -> (bool, bool)
full_adder(a: bool, b: bool, cin: bool) -> (bool, bool)
ripple_carry_adder`(a: &[bool], b: &[bool]) -> (Vec<bool>, bool)`
multiplexer_2to1(a: bool, b: bool, sel: bool) -> bool
demultiplexer_1to2(input: bool, sel: bool) -> (bool, bool)
decoder_2to4`(a: bool, b: bool) -> [bool; 4]`
encoder_4to2`(inputs: &[bool; 4]) -> (bool, bool)`
sr_latch(s: bool, r: bool, q_prev: bool) -> bool
d_flip_flop(d: bool, _: bool) -> bool
jk_flip_flop(j: bool, k: bool, q_prev: bool) -> bool
binary_to_gray(binary: u32) -> u32
gray_to_binary(gray: u32) -> u32
ones_complement(val: u32, bits: u32) -> u32
twos_complement(val: u32, bits: u32) -> u32

semiconductor_devices (16 functions)

FunctionSignature
diode_shockley(is: f64, v: f64, n: f64, vt: f64) -> f64
zener_voltage_regulation(v_in: f64, v_zener: f64) -> f64
bjt_ic_active(beta: f64, ib: f64) -> f64
bjt_ie(ic: f64, ib: f64) -> f64
bjt_alpha(beta: f64) -> f64
mosfet_drain_current_saturation(kn: f64, vgs: f64, vth: f64) -> f64
mosfet_drain_current_linear(kn: f64, vgs: f64, vth: f64, vds: f64) -> f64
mosfet_threshold_body_effect(vth0: f64, gamma: f64, vsb: f64, phi: f64) -> f64
solar_cell_iv(i_photo: f64, i0: f64, v: f64, n: f64, vt: f64, r_s: f64) -> f64
led_resistor(v_supply: f64, v_led: f64, i_led: f64) -> f64
photodiode_responsivity(i_photo: f64, p_optical: f64) -> f64
tunnel_diode_current(ip: f64, iv: f64, vp: f64, vv: f64, v: f64) -> f64
pn_junction_capacitance(c0: f64, v: f64, v_bi: f64, m: f64) -> f64
early_effect(ic0: f64, vce: f64, va: f64) -> f64
drain_induced_barrier_lowering(vth0: f64, sigma: f64, vds: f64) -> f64

Fluid Mechanics API (36 functions)

Submodules

  • boundary_layer — Blasius, Reynolds, displacement/momentum thickness
  • flow — continuity, Bernoulli, pipe flow, Poiseuille
  • turbulence — Reynolds stress, turbulence intensity, mixing length
  • waves — surface waves, dispersion, wave speed

boundary_layer (12 functions)

FunctionSignature
blasius_thickness(x: f64, re_x: f64) -> f64
displacement_thickness(x: f64, re_x: f64) -> f64
momentum_thickness(x: f64, re_x: f64) -> f64
shape_factor(displacement: f64, momentum: f64) -> f64
skin_friction_laminar(re_x: f64) -> f64
skin_friction_turbulent(re_x: f64) -> f64
turbulent_bl_thickness(x: f64, re_x: f64) -> f64
separation_criterion(dp_dx: f64) -> bool
falkner_skan_beta(m: f64) -> f64
thermal_bl_thickness(delta: f64, pr: f64) -> f64
nusselt_flat_plate_laminar(re: f64, pr: f64) -> f64
stanton_number(nu: f64, re: f64, pr: f64) -> f64

flow (12 functions)

FunctionSignature
reynolds_number(rho: f64, v: f64, l: f64, mu: f64) -> f64
bernoulli_pressure(rho: f64, v1: f64, p1: f64, v2: f64) -> f64
bernoulli_height(rho: f64, v1: f64, p1: f64, h1: f64, v2: f64, p2: f64, g: f64) -> f64
hagen_poiseuille(delta_p: f64, r: f64, l: f64, mu: f64) -> f64
continuity_velocity(a1: f64, v1: f64, a2: f64) -> f64
drag_force(cd: f64, rho: f64, v: f64, a: f64) -> f64
lift_force(cl: f64, rho: f64, v: f64, a: f64) -> f64
stokes_drag(mu: f64, r: f64, v: f64) -> f64
terminal_velocity_sphere(rho_p: f64, rho_f: f64, r: f64, mu: f64, g: f64) -> f64
torricelli(g: f64, h: f64) -> f64
hydraulic_diameter(area: f64, perimeter: f64) -> f64
darcy_weisbach(f: f64, l: f64, d: f64, rho: f64, v: f64) -> f64

turbulence (12 functions)

FunctionSignature
turbulent_kinetic_energy(u_prime: f64, v_prime: f64, w_prime: f64) -> f64
kolmogorov_length_scale(nu: f64, epsilon: f64) -> f64
kolmogorov_time_scale(nu: f64, epsilon: f64) -> f64
kolmogorov_velocity_scale(nu: f64, epsilon: f64) -> f64
taylor_microscale(u_rms: f64, epsilon: f64, nu: f64) -> f64
integral_length_scale(tke: f64, epsilon: f64) -> f64
friction_velocity(tau_wall: f64, rho: f64) -> f64
law_of_wall(u_tau: f64, y: f64, nu: f64) -> f64
mixing_length(kappa: f64, y: f64) -> f64
eddy_viscosity(mixing_length: f64, du_dy: f64) -> f64
turbulence_intensity(u_rms: f64, u_mean: f64) -> f64
energy_spectrum_kolmogorov(c_k: f64, epsilon: f64, k: f64) -> f64

waves (11 functions)

FunctionSignature
shallow_water_speed(g: f64, depth: f64) -> f64
deep_water_speed(g: f64, wavelength: f64) -> f64
wave_number(wavelength: f64) -> f64
wave_frequency(period: f64) -> f64
froude_number(v: f64, g: f64, depth: f64) -> f64
mach_number(v: f64, c: f64) -> f64
sound_speed_ideal_gas(gamma: f64, r: f64, t: f64, m: f64) -> f64
water_hammer_pressure(rho: f64, c: f64, delta_v: f64) -> f64
capillary_number(mu: f64, v: f64, sigma: f64) -> f64
weber_number(rho: f64, v: f64, l: f64, sigma: f64) -> f64
wave_energy_density(rho: f64, g: f64, amplitude: f64) -> f64

Materials API (45 functions)

Submodules

  • crystallography — lattice parameters, Miller indices, diffraction
  • diffusion — Fick's laws, diffusion coefficient
  • phases — phase diagrams, lever rule, Gibbs phase rule
  • semiconductors — carrier density, bandgap, doping

crystallography (11 functions)

FunctionSignature
bragg_angle(d: f64, wavelength: f64, n: i32) -> f64
d_spacing_cubic(a: f64, h: i32, k: i32, l: i32) -> f64
miller_planar_density_cubic(a: f64, atoms_per_plane: f64, h: i32, k: i32, l: i32) -> f64
packing_fraction_bcc() -> f64
packing_fraction_fcc() -> f64
lattice_parameter_from_density(m: f64, z: f64, rho: f64) -> f64
structure_factor_bcc(h: i32, k: i32, l: i32) -> f64
structure_factor_fcc(h: i32, k: i32, l: i32) -> f64
debye_temperature(theta_d: f64, t: f64) -> f64
specific_heat_debye(t: f64, theta_d: f64) -> f64
vacancy_concentration(ev: f64, t: f64) -> f64

diffusion (10 functions)

FunctionSignature
fick_first_law(d: f64, dc_dx: f64) -> f64
fick_second_law_solution(c0: f64, cs: f64, x: f64, d: f64, t: f64) -> f64
diffusion_coefficient(d0: f64, q: f64, t: f64) -> f64
diffusion_length(d: f64, t: f64) -> f64
interdiffusion_coefficient(d_a: f64, d_b: f64, x_a: f64) -> f64
kirkendall_velocity(d_a: f64, d_b: f64, dc_dx: f64, c_total: f64) -> f64
grain_boundary_diffusion(d_gb: f64, delta: f64, d_l: f64, grain_size: f64) -> f64
permeability(d: f64, s: f64) -> f64
carburization_depth(d: f64, t: f64) -> f64
mean_free_path(d: f64, n_density: f64) -> f64

phases (12 functions)

FunctionSignature
lever_rule(c0: f64, c_alpha: f64, c_beta: f64) -> (f64, f64)
gibbs_phase_rule(c: u32, p: u32) -> i32
clausius_clapeyron_slope(delta_h: f64, t: f64, delta_v: f64) -> f64
regular_solution_gibbs(xa: f64, omega: f64, t: f64) -> f64
spinodal_temperature(omega: f64) -> f64
nucleation_barrier(gamma: f64, delta_gv: f64) -> f64
critical_nucleus_radius(gamma: f64, delta_gv: f64) -> f64
nucleation_rate(n0: f64, delta_g_star: f64, t: f64) -> f64
coarsening_rate(k: f64, t: f64, t0: f64) -> f64
jmak(k: f64, t: f64, n: f64) -> f64
partition_coefficient(c_solid: f64, c_liquid: f64) -> f64
scheil_equation(c0: f64, k: f64, fs: f64) -> f64

semiconductors (11 functions)

FunctionSignature
fermi_energy(n: f64, m_eff: f64) -> f64
fermi_dirac(e: f64, ef: f64, t: f64) -> f64
intrinsic_carrier_concentration(eg: f64, t: f64, nc: f64, nv: f64) -> f64
conductivity_semiconductor(n: f64, mu_e: f64, p: f64, mu_h: f64) -> f64
hall_coefficient(n: f64, p: f64, mu_e: f64, mu_h: f64) -> f64
drift_velocity(mu: f64, e_field: f64) -> f64
depletion_width(epsilon: f64, v_bi: f64, na: f64, nd: f64) -> f64
built_in_potential(na: f64, nd: f64, ni: f64, t: f64) -> f64
diode_current(is: f64, v: f64, t: f64, n: f64) -> f64
band_gap_temperature(eg0: f64, alpha: f64, beta: f64, t: f64) -> f64
doping_ionization(nd: f64, ed: f64, t: f64) -> f64

Nucleosynthesis API (97 functions + structs Nuclide, StellarCore, enum ProcessType)

Submodules

  • decay — radioactive decay, half-life, activity
  • fusion — pp-chain, CNO cycle, plasma physics, stellar winds
  • nuclide — binding energy, nuclear radius, separation energy
  • processes — burning stages, r/s-process, nuclear statistical equilibrium
  • reactions — Q-value, cross-section, Gamow peak, reaction rates
  • stellar — Chandrasekhar limit, Eddington luminosity, compact objects

decay (18 functions)

FunctionSignature
decay_remaining(n0: f64, half_life: f64, time: f64) -> f64
bateman_chain`(n0: f64, lambdas: &[f64], time: f64) -> Vec<f64>`
specific_activity(decay_constant: f64, molar_mass: f64) -> f64
half_life_from_constant(decay_constant: f64) -> f64
mean_lifetime(half_life: f64) -> f64
decay_constant_from_half_life(half_life: f64) -> f64
activity_becquerel(n_atoms: f64, half_life: f64) -> f64
activity_curie(n_atoms: f64, half_life: f64) -> f64
secular_equilibrium_activity(parent_activity: f64) -> f64
transient_equilibrium_ratio(lambda_parent: f64, lambda_daughter: f64) -> f64
branching_ratio_effective`(partial_constants: &[f64]) -> Vec<f64>`
geiger_nuttall(z: u32, energy_mev: f64) -> f64
alpha_decay_q(parent_mass_mev: f64, daughter_mass_mev: f64, alpha_mass_mev: f64) -> f64
beta_minus_q(parent_mass_amu: f64, daughter_mass_amu: f64) -> f64
beta_plus_q(parent_mass_amu: f64, daughter_mass_amu: f64) -> f64
dose_rate_point_source(activity_bq: f64, gamma_constant: f64, distance_m: f64) -> f64
radioactive_dating_age(ratio_daughter_parent: f64, half_life: f64) -> f64
decay_chain_equilibrium_time(lambda_parent: f64, lambda_daughter: f64) -> f64

fusion (26 functions)

FunctionSignature
pp_chain_rate(temperature_k: f64, density_kg_m3: f64, hydrogen_fraction: f64) -> f64
cno_cycle_rate(temperature_k: f64, density_kg_m3: f64, hydrogen_fraction: f64, cno_fraction: f64) -> f64
triple_alpha_rate(temperature_k: f64, density_kg_m3: f64, helium_fraction: f64) -> f64
nuclear_energy_generation(temperature_k: f64, density_kg_m3: f64, hydrogen_fraction: f64, helium_fraction: f64, metal_fraction: f64) -> f64
thermal_pressure(electron_density: f64, temperature_k: f64) -> f64
magnetic_pressure(magnetic_field: f64) -> f64
plasma_beta(electron_density: f64, temperature_k: f64, magnetic_field: f64) -> f64
alfven_speed(magnetic_field: f64, density: f64) -> f64
plasma_frequency(electron_density: f64) -> f64
debye_length(electron_density: f64, temperature_k: f64) -> f64
radiative_loss_rate(electron_density: f64, temperature_k: f64) -> f64
thermal_conduction_flux(temperature_k: f64, length_scale: f64) -> f64
sound_speed_plasma(temperature_k: f64, mean_particle_mass: f64) -> f64
gyrofrequency(charge: f64, magnetic_field: f64, mass: f64) -> f64
larmor_radius(mass: f64, velocity_perp: f64, charge: f64, magnetic_field: f64) -> f64
reconnection_rate_sweet_parker(alfven_speed_val: f64, lundquist_number: f64) -> f64
lundquist_number(alfven_speed_val: f64, length_scale: f64, magnetic_diffusivity: f64) -> f64
coronal_loop_temperature(loop_length: f64, heating_rate: f64) -> f64
coronal_loop_density(heating_rate: f64, loop_length: f64, temperature_k: f64) -> f64
solar_flare_energy(magnetic_field: f64, volume: f64) -> f64
cme_kinetic_energy(mass: f64, velocity: f64) -> f64
sunspot_temperature(photosphere_temp: f64, suppression_factor: f64) -> f64
differential_rotation_rate(equatorial_rate: f64, latitude: f64, a2: f64, a4: f64) -> f64
stellar_wind_mass_loss_si(luminosity: f64, escape_velocity: f64) -> f64
convective_envelope_depth(stellar_mass_solar: f64) -> f64
mixing_length_velocity(convective_flux: f64, density: f64, temperature: f64, pressure: f64, mixing_length: f64, g_local: f64, cp: f64) -> f64
opacity_kramers(density: f64, temperature: f64, hydrogen_fraction: f64, metal_fraction: f64) -> f64
radiative_temperature_gradient(opacity: f64, luminosity: f64, mass_enclosed: f64, pressure: f64, temperature: f64) -> f64

nuclide (struct Nuclide + 20 functions)

FunctionSignature
Nuclide::n(&self) -> u32
Nuclide::atomic_mass_amu(&self) -> f64
Nuclide::binding_energy(&self) -> f64
Nuclide::is_stable(&self) -> bool
Nuclide::decay_constant(&self) -> Option<f64>
Nuclide::activity_bq(&self, num_atoms: f64) -> Option<f64>
semi_empirical_mass(z: u32, a: u32) -> f64
binding_energy_per_nucleon_semf(z: u32, a: u32) -> f64
nuclear_radius_fm(a: u32) -> f64
nuclear_density_kg_m3() -> f64
separation_energy_proton(z: u32, a: u32) -> f64
separation_energy_neutron(z: u32, a: u32) -> f64
separation_energy_alpha(z: u32, a: u32) -> f64
valley_of_stability_z(a: u32) -> f64
neutron_excess(z: u32, a: u32) -> i32
isospin_z(z: u32, a: u32) -> f64
liquid_drop_fission_parameter(z: u32, a: u32) -> f64
fission_barrier_estimate_mev(z: u32, a: u32) -> f64
nuclear_skin_thickness_fm(z: u32, a: u32) -> f64
weizsacker_mass_excess_mev(z: u32, a: u32) -> f64
proton_drip_line_a(z: u32) -> u32
neutron_drip_line_a(z: u32) -> u32
magic_number_nearest(n: u32) -> u32
is_doubly_magic(z: u32, n: u32) -> bool

processes (enum ProcessType + 14 functions)

FunctionSignature
ProcessType::threshold_temperature_k(&self) -> f64
ProcessType::energy_released_mev(&self) -> f64
ProcessType::is_active_at(&self, temperature_k: f64) -> bool
active_processes(temperature_k: f64) -> Vec<ProcessType>
dominant_process_at(temperature_k: f64) -> Option<ProcessType>
process_timescale_years(process: &ProcessType, mass_solar: f64) -> f64
process_fuel(process: &ProcessType) -> &'static str
process_product(process: &ProcessType) -> &'static str
nuclear_statistical_equilibrium_temp() -> f64
neutron_capture_rate_estimate(neutron_density_per_cm3: f64, cross_section_barn: f64, velocity_cm_s: f64) -> f64
s_process_neutron_exposure(tau: f64, sigma_times_flux: f64) -> f64
r_process_waiting_point_z(neutron_separation_energy_mev: f64, temperature_gk: f64) -> f64
pp_chain_branches(temperature_k: f64) -> (f64, f64, f64)
cno_cycle_is_dominant(temperature_k: f64, metallicity: f64) -> bool

reactions (21 functions)

FunctionSignature
q_value`(reactants: &[&Nuclide], products: &[&Nuclide]) -> f64`
coulomb_barrier(z1: u32, z2: u32, a1: u32, a2: u32) -> f64
gamow_peak(z1: u32, z2: u32, reduced_mass_amu: f64, temperature_k: f64) -> f64
gamow_window_width(z1: u32, z2: u32, reduced_mass_amu: f64, temperature_k: f64) -> f64
reduced_mass_amu(m1: f64, m2: f64) -> f64
astrophysical_s_factor(cross_section_barn: f64, energy_kev: f64, z1: u32, z2: u32, mu_amu: f64) -> f64
sommerfeld_parameter(z1: u32, z2: u32, energy_kev: f64, mu_amu: f64) -> f64
penetration_factor(z1: u32, z2: u32, energy_kev: f64, mu_amu: f64) -> f64
thermonuclear_rate(s_factor_kev_barn: f64, z1: u32, z2: u32, mu_amu: f64, temperature_k: f64) -> f64
pp_rate_estimate(temperature_k: f64, density_g_cm3: f64, x_h: f64) -> f64
triple_alpha_rate_estimate(temperature_k: f64, density_g_cm3: f64, y_he: f64) -> f64
c12_alpha_rate_estimate(temperature_k: f64) -> f64
reaction_mean_free_path(cross_section_barn: f64, number_density_per_cm3: f64) -> f64
nuclear_reaction_lifetime(cross_section_barn: f64, number_density_per_cm3: f64, velocity_cm_s: f64) -> f64
maxwell_averaged_velocity(temperature_k: f64, mu_amu: f64) -> f64
cross_section_barn_to_si(sigma_barn: f64) -> f64
nuclear_radius_fermi(a: u32) -> f64
nuclear_volume(a: u32) -> f64
q_value_to_joules(q_mev: f64) -> f64
geometric_cross_section(a1: u32, a2: u32) -> f64
geometric_cross_section_barn(a1: u32, a2: u32) -> f64

stellar (struct StellarCore + 18 functions)

FunctionSignature
StellarCore::new(mass_solar: f64, temperature_k: f64, density_kg_m3: f64) -> Self
StellarCore::luminosity_solar(&self) -> f64
StellarCore::main_sequence_lifetime_years(&self) -> f64
StellarCore::active_processes(&self) -> Vec<ProcessType>
StellarCore::dominant_process(&self) -> Option<ProcessType>
StellarCore::evolve_step(&mut self, dt_years: f64)
chandrasekhar_limit() -> f64
tolman_oppenheimer_volkoff_limit() -> f64
neutron_drip_density() -> f64
iron_peak_binding_energy() -> f64
eddington_luminosity_solar(mass_solar: f64) -> f64
kelvin_helmholtz_timescale_years(mass_solar: f64, radius_solar: f64, luminosity_solar: f64) -> f64
jeans_mass_solar(temperature_k: f64, density_kg_m3: f64) -> f64
schwarzschild_radius_km(mass_solar: f64) -> f64
nuclear_timescale_years(mass_solar: f64, luminosity_solar: f64, efficiency: f64) -> f64
core_collapse_min_mass_solar() -> f64
white_dwarf_radius_km(mass_solar: f64) -> f64
electron_degeneracy_pressure(density_kg_m3: f64) -> f64
neutron_star_radius_km(mass_solar: f64) -> f64
luminosity_radius_temperature(radius_solar: f64, temperature_k: f64) -> f64
stellar_wind_mass_loss(luminosity_solar: f64, escape_velocity_km_s: f64) -> f64

Optics API (60 functions)

Submodules

  • diffraction — single/double slit, grating equation
  • interference — thin film, Michelson, Young's experiment
  • polarization — Malus's law, Brewster angle, Stokes parameters
  • refraction — Snell's law, critical angle, refractive index dispersion
  • scattering — Rayleigh, Mie, atmospheric optics

diffraction (10 functions)

FunctionSignature
single_slit_intensity(theta: f64, a: f64, wavelength: f64) -> f64
double_slit_intensity(theta: f64, d: f64, wavelength: f64) -> f64
diffraction_grating_maxima(d: f64, wavelength: f64, order: i32) -> f64
resolving_power_grating(order: i32, n_slits: u32) -> f64
rayleigh_criterion(wavelength: f64, aperture: f64) -> f64
airy_disk_radius(wavelength: f64, f_number: f64) -> f64
fraunhofer_distance(aperture: f64, wavelength: f64) -> f64
grating_dispersion(order: i32, d: f64, theta: f64) -> f64
bragg_condition(d_spacing: f64, theta: f64, wavelength: f64) -> f64
circular_aperture_first_zero(wavelength: f64, diameter: f64) -> f64

interference (12 functions)

FunctionSignature
two_beam_intensity(i1: f64, i2: f64, delta_phase: f64) -> f64
thin_film_phase_shift(n: f64, thickness: f64, wavelength: f64, theta: f64) -> f64
constructive_condition(optical_path_diff: f64, wavelength: f64) -> bool
fringe_spacing(wavelength: f64, d: f64, l: f64) -> f64
visibility(i_max: f64, i_min: f64) -> f64
coherence_length(wavelength: f64, delta_wavelength: f64) -> f64
coherence_time(delta_nu: f64) -> f64
fabry_perot_transmittance(r: f64, delta: f64) -> f64
fabry_perot_finesse(r: f64) -> f64
free_spectral_range(d: f64, n: f64) -> f64
michelson_path_difference(mirror_displacement: f64) -> f64
newton_ring_radius(m: u32, wavelength: f64, r: f64) -> f64

polarization (11 functions)

FunctionSignature
malus_law(i0: f64, theta: f64) -> f64
brewster_reflectance(n1: f64, n2: f64) -> f64
stokes_parameters`(ex: f64, ey: f64, delta: f64) -> [f64; 4]`
degree_of_polarization`(s: &[f64; 4]) -> f64`
jones_rotation`(theta: f64) -> [[f64; 2]; 2]`
quarter_wave_plate_phase(wavelength: f64, n_fast: f64, n_slow: f64) -> f64
specific_rotation(observed: f64, l: f64, c: f64) -> f64
ellipticity(major: f64, minor: f64) -> f64
circular_dichroism(a_left: f64, a_right: f64) -> f64
birefringence(n_extraordinary: f64, n_ordinary: f64) -> f64
retardance(birefringence: f64, thickness: f64, wavelength: f64) -> f64

refraction (12 functions)

FunctionSignature
snell(n1: f64, theta1: f64, n2: f64) -> f64
critical_angle(n1: f64, n2: f64) -> f64
brewster_angle(n1: f64, n2: f64) -> f64
fresnel_reflectance_s(n1: f64, theta_i: f64, n2: f64, theta_t: f64) -> f64
fresnel_reflectance_p(n1: f64, theta_i: f64, n2: f64, theta_t: f64) -> f64
thin_lens_equation(focal: f64, object_dist: f64) -> f64
magnification(image_dist: f64, object_dist: f64) -> f64
lensmaker_equation(n: f64, r1: f64, r2: f64) -> f64
numerical_aperture(n: f64, half_angle: f64) -> f64
optical_path_length(n: f64, d: f64) -> f64
cauchy_dispersion(a: f64, b: f64, wavelength: f64) -> f64
abbe_number(nd: f64, nf: f64, nc: f64) -> f64

scattering (22 functions)

FunctionSignature
rayleigh_cross_section(wavelength: f64, refractive_index: f64, depolarization: f64) -> f64
rayleigh_scattering_coefficient(number_density: f64, wavelength: f64, refractive_index: f64, depolarization: f64) -> f64
rayleigh_phase_function(cos_theta: f64) -> f64
mie_extinction_efficiency(size_parameter: f64, refractive_index_real: f64) -> f64
mie_scattering_coefficient(number_density: f64, particle_radius: f64, wavelength: f64, refractive_index_real: f64) -> f64
henyey_greenstein(cos_theta: f64, g: f64) -> f64
optical_depth_integral(scattering_coefficient: f64, scale_height: f64, altitude_start: f64, altitude_end: f64) -> f64
transmittance(optical_depth: f64) -> f64
single_scattering_albedo(scattering_coeff: f64, absorption_coeff: f64) -> f64
atmospheric_refraction(zenith_angle: f64, pressure_pa: f64, temperature_k: f64) -> f64
color_temperature_to_rgb(temperature_k: f64) -> (f64, f64, f64)
planck_spectral_radiance(wavelength: f64, temperature: f64) -> f64
rayleigh_sky_color(wavelength_r: f64, wavelength_g: f64, wavelength_b: f64, optical_depth_zenith: f64, cos_zenith: f64) -> (f64, f64, f64)
limb_darkening(cos_angle: f64, coefficient: f64) -> f64
absorption_coefficient_gas(cross_section: f64, number_density: f64) -> f64
chapman_function(zenith_angle: f64, scale_height_ratio: f64) -> f64
glory_angle(particle_radius: f64, wavelength: f64) -> f64
rainbow_angle(refractive_index: f64) -> f64
wavelength_to_energy_ev(wavelength_nm: f64) -> f64
energy_ev_to_wavelength_nm(energy_ev: f64) -> f64
wavelength_angstrom_to_m(wavelength_angstrom: f64) -> f64
wavelength_m_to_angstrom(wavelength_m: f64) -> f64
photon_energy_joule_to_ev(energy_j: f64) -> f64
size_parameter(radius: f64, wavelength: f64) -> f64

Quantum API (struct Complex + 200+ functions)

Submodules

  • angular — angular momentum, Clebsch-Gordan, ladder operators
  • information — density matrix, entanglement entropy, fidelity, quantum gates
  • operators — expectation values, commutators, Hermitian operators
  • perturbation — first/second-order energy corrections, variational, WKB
  • spin — spin operators, Pauli matrices, Dirac gamma matrices
  • systems — harmonic oscillator, hydrogen atom, particle in a box, Landau levels
  • wavefunctions — normalization, probability density, time evolution

angular (6 functions)

FunctionSignature
associated_legendre(l: u32, m: i32, x: f64) -> f64
spherical_harmonic(l: u32, m: i32, theta: f64, phi: f64) -> Complex
clebsch_gordan(j1: f64, m1: f64, j2: f64, m2: f64, j: f64, m: f64) -> f64
wigner_3j(j1: f64, j2: f64, j3: f64, m1: f64, m2: f64, m3: f64) -> f64
spherical_harmonic_real(l: u32, m: i32, theta: f64, phi: f64) -> f64
angular_momentum_coupling(j1: f64, j2: f64) -> Vec<(f64, f64, f64)>

information (27 functions)

FunctionSignature
von_neumann_entropy`(rho: &[Vec<Complex>]) -> f64`
purity`(rho: &[Vec<Complex>]) -> f64`
fidelity_pure`(psi: &[Complex], phi: &[Complex]) -> f64`
fidelity_mixed`(rho: &[Vec<Complex>], sigma: &[Vec<Complex>]) -> f64`
concurrence_2qubit`(rho: &[Vec<Complex>]) -> f64`
bell_phi_plus() -> Vec<Complex>
bell_phi_minus() -> Vec<Complex>
bell_psi_plus() -> Vec<Complex>
bell_psi_minus() -> Vec<Complex>
hadamard_gate() -> Vec<Vec<Complex>>
phase_gate(phi: f64) -> Vec<Vec<Complex>>
t_gate() -> Vec<Vec<Complex>>
s_gate() -> Vec<Vec<Complex>>
rx_gate(theta: f64) -> Vec<Vec<Complex>>
ry_gate(theta: f64) -> Vec<Vec<Complex>>
rz_gate(theta: f64) -> Vec<Vec<Complex>>
cnot_gate() -> Vec<Vec<Complex>>
swap_gate() -> Vec<Vec<Complex>>
cz_gate() -> Vec<Vec<Complex>>
toffoli_gate() -> Vec<Vec<Complex>>
apply_gate`(gate: &[Vec<Complex>], state: &[Complex]) -> Vec<Complex>`
apply_single_qubit_gate`(gate: &[Vec<Complex>], state: &mut [Complex], target: usize, n_qubits: usize)`
measure_probabilities`(state: &[Complex]) -> Vec<f64>`
bloch_vector`(state: &[Complex; 2]) -> (f64, f64, f64)`
entanglement_entropy`(state: &[Complex], dim_a: usize) -> f64`

operators (11 functions)

FunctionSignature
commutator`(a: &[Vec<Complex>], b: &[Vec<Complex>]) -> Vec<Vec<Complex>>`
anticommutator`(a: &[Vec<Complex>], b: &[Vec<Complex>]) -> Vec<Vec<Complex>>`
expectation_value`(operator: &[Vec<Complex>], state: &[Complex]) -> Complex`
variance`(operator: &[Vec<Complex>], state: &[Complex]) -> f64`
uncertainty_product`(op_a: &[Vec<Complex>], op_b: &[Vec<Complex>], state: &[Complex]) -> f64`
is_hermitian`(m: &[Vec<Complex>]) -> bool`
is_unitary`(m: &[Vec<Complex>]) -> bool`
tensor_product`(a: &[Vec<Complex>], b: &[Vec<Complex>]) -> Vec<Vec<Complex>>`
density_matrix`(state: &[Complex]) -> Vec<Vec<Complex>>`
trace_complex`(m: &[Vec<Complex>]) -> Complex`
partial_trace_b`(rho: &[Vec<Complex>], dim_a: usize, dim_b: usize) -> Vec<Vec<Complex>>`

perturbation (9 functions)

FunctionSignature
first_order_energy`(v_matrix: &[Vec<Complex>], state: &[Complex]) -> f64`
second_order_energy`(h0_energies: &[f64], v_matrix: &[Vec<Complex>], states: &[Vec<Complex>], n_index: usize) -> f64`
first_order_state`(h0_energies: &[f64], v_matrix: &[Vec<Complex>], states: &[Vec<Complex>], n_index: usize) -> Vec<Complex>`
variational_energy`(hamiltonian: &[Vec<Complex>], trial: &[Complex]) -> f64`
variational_minimize`(hamiltonian: &[Vec<Complex>], trial_fn: impl Fn(f64) -> Vec<Complex>, param_min: f64, param_max: f64, n_points: usize) -> (f64, f64)`
wkb_phase(v: impl Fn(f64) -> f64, energy: f64, x1: f64, x2: f64, mass: f64) -> f64
wkb_transmission(v: impl Fn(f64) -> f64, energy: f64, x1: f64, x2: f64, mass: f64) -> f64
wkb_quantization(v: impl Fn(f64) -> f64, mass: f64, x_min: f64, x_max: f64, n_quantum: u32) -> f64
fermi_golden_rule`(v_matrix: &[Vec<Complex>], initial: &[Complex], finals: &[Vec<Complex>], density_of_states: f64) -> f64`

spin (19 functions)

FunctionSignature
pauli_x`() -> [[Complex; 2]; 2]`
pauli_y`() -> [[Complex; 2]; 2]`
pauli_z`() -> [[Complex; 2]; 2]`
identity_2`() -> [[Complex; 2]; 2]`
spin_up`() -> [Complex; 2]`
spin_down`() -> [Complex; 2]`
spin_plus_x`() -> [Complex; 2]`
spin_minus_x`() -> [Complex; 2]`
spin_plus_y`() -> [Complex; 2]`
spin_minus_y`() -> [Complex; 2]`
dirac_gamma0`() -> [[Complex; 4]; 4]`
dirac_gamma1`() -> [[Complex; 4]; 4]`
dirac_gamma2`() -> [[Complex; 4]; 4]`
dirac_gamma3`() -> [[Complex; 4]; 4]`
gamma5`() -> [[Complex; 4]; 4]`
rotation_operator`(angle: f64, pauli: &[[Complex; 2]; 2]) -> [[Complex; 2]; 2]`
ladder_operator_plus(j: f64) -> Vec<Vec<Complex>>
ladder_operator_minus(j: f64) -> Vec<Vec<Complex>>
jz_operator(j: f64) -> Vec<Vec<Complex>>

systems (35 functions)

FunctionSignature
hydrogen_energy(n: u32) -> f64
hydrogen_radial_r10(r: f64) -> f64
hydrogen_radial_r20(r: f64) -> f64
hydrogen_radial_r21(r: f64) -> f64
harmonic_oscillator_energy(n: u32, omega: f64) -> f64
harmonic_oscillator_wf(n: u32, x: f64, mass: f64, omega: f64) -> f64
infinite_well_energy(n: u32, length: f64, mass: f64) -> f64
infinite_well_wf(n: u32, x: f64, length: f64) -> f64
tunneling_coefficient(energy: f64, v0: f64, width: f64, mass: f64) -> f64
bohr_radius() -> f64
landau_levels(n: u32, b_field: f64, mass: f64, charge: f64) -> f64
zeeman_splitting(m_l: i32, b_field: f64) -> f64
bohr_radius_nth(n: u32, z_eff: f64) -> f64
hydrogen_energy_level(n: u32) -> f64
hydrogen_energy_level_z(n: u32, z: f64) -> f64
rydberg_wavelength(n1: u32, n2: u32) -> f64
compton_wavelength_shift(theta: f64) -> f64
cyclotron_frequency(b_field: f64) -> f64
cyclotron_frequency_particle(charge: f64, mass: f64, b_field: f64) -> f64
larmor_radius(v_perp: f64, b_field: f64) -> f64
larmor_radius_particle(mass: f64, v_perp: f64, charge: f64, b_field: f64) -> f64
nuclear_zeeman_splitting(m_i: f64, b_field: f64) -> f64
anomalous_zeeman_splitting(m_j: f64, g_j: f64, b_field: f64) -> f64
muonic_hydrogen_energy(n: u32) -> f64
muonic_bohr_radius() -> f64
tau_lepton_mass() -> f64
muon_mass_kg() -> f64
proton_gyromagnetic_ratio(b_field: f64) -> f64
neutron_mass() -> f64
proton_mass() -> f64
reduced_mass(m1: f64, m2: f64) -> f64
de_broglie_wavelength(mass: f64, velocity: f64) -> f64
magnetic_moment_orbital(m_l: i32) -> f64
fine_structure_splitting(n: u32, j: f64, z: f64) -> f64
hyperfine_splitting_hydrogen() -> f64

wavefunctions (9 functions)

FunctionSignature
plane_wave(x: f64, k: f64, omega: f64, t: f64) -> Complex
gaussian_packet(x: f64, x0: f64, sigma: f64, k0: f64) -> Complex
normalize`(psi: &mut [Complex], dx: f64)`
probability_density`(psi: &[Complex]) -> Vec<f64>`
expectation_position`(psi: &[Complex], x: &[f64], dx: f64) -> f64`
expectation_momentum`(psi: &[Complex], dx: f64) -> f64`
time_evolve_split_step`(psi: &mut [Complex], v: &[f64], dx: f64, dt: f64, mass: f64, steps: usize)`
inner_product`(psi: &[Complex], phi: &[Complex], dx: f64) -> Complex`
transition_probability`(psi_initial: &[Complex], psi_final: &[Complex], dx: f64) -> f64`

Relativity API (45 functions)

Submodules

  • accretion — black hole physics, accretion disks, jets
  • dynamics — relativistic energy, momentum, four-vectors
  • kinematics — time dilation, length contraction, velocity addition
  • lorentz — Lorentz factor, boosts, transformations

accretion (24 functions)

FunctionSignature
schwarzschild_radius(mass: f64) -> f64
kerr_event_horizon(mass: f64, spin_parameter: f64) -> f64
kerr_ergosphere(mass: f64, spin_parameter: f64, theta: f64) -> f64
isco_radius(mass: f64, spin_parameter: f64) -> f64
accretion_disk_temperature(mass: f64, accretion_rate: f64, r: f64, r_inner: f64) -> f64
accretion_disk_luminosity(mass: f64, accretion_rate: f64, r_inner: f64) -> f64
radiative_efficiency(r_isco: f64, mass: f64) -> f64
eddington_accretion_rate(mass: f64) -> f64
disk_surface_density(accretion_rate: f64, viscosity: f64, r: f64, r_inner: f64) -> f64
alpha_viscosity(alpha: f64, sound_speed: f64, scale_height: f64) -> f64
disk_scale_height(sound_speed: f64, orbital_frequency: f64) -> f64
orbital_frequency_kerr(mass: f64, r: f64, spin_parameter: f64) -> f64
gravitational_redshift(mass: f64, r: f64) -> f64
doppler_beaming_factor(velocity_los: f64, bulk_lorentz: f64) -> f64
apparent_superluminal_velocity(beta: f64, viewing_angle: f64) -> f64
blandford_znajek_power(magnetic_field: f64, event_horizon_radius: f64, spin_parameter: f64, mass: f64) -> f64
jet_lorentz_factor_from_ratio(jet_power: f64, mass_loading_rate: f64) -> f64
synchrotron_cooling_time(electron_gamma: f64, magnetic_field: f64) -> f64
photon_ring_radius(mass: f64) -> f64
shadow_angular_radius(mass: f64, distance: f64) -> f64
advection_dominated_temperature(proton_mass: f64, r: f64, mass: f64) -> f64
comptonization_parameter(electron_temperature: f64, optical_depth: f64) -> f64
bondi_accretion_rate(mass: f64, ambient_density: f64, sound_speed: f64) -> f64
tidal_disruption_radius(bh_mass: f64, star_mass: f64, star_radius: f64) -> f64

dynamics (13 functions)

FunctionSignature
relativistic_momentum(mass: f64, v: f64) -> f64
relativistic_energy(mass: f64, v: f64) -> f64
rest_energy(mass: f64) -> f64
kinetic_energy_relativistic(mass: f64, v: f64) -> f64
energy_momentum_relation(mass: f64, momentum: f64) -> f64
four_momentum`(mass: f64, v: [f64; 3]) -> [f64; 4]`
invariant_mass_two_body`(p1: [f64; 4], p2: [f64; 4]) -> f64`
mandelstam_s`(p1: [f64; 4], p2: [f64; 4]) -> f64`
compton_wavelength_shift(angle: f64) -> f64
relativistic_kinetic_energy_from_gamma(mass: f64, gamma: f64) -> f64
threshold_energy(m_target: f64, m_products_sum: f64) -> f64
synchrotron_power(charge: f64, mass: f64, gamma: f64, radius: f64) -> f64
bremsstrahlung_power_classical(charge: f64, accel: f64) -> f64

kinematics (8 functions)

FunctionSignature
velocity_addition(u: f64, v: f64) -> f64
velocity_addition_3d`(u: [f64; 3], v: f64, dir: [f64; 3]) -> [f64; 3]`
relativistic_doppler(freq: f64, v: f64, angle: f64) -> f64
transverse_doppler(freq: f64, v: f64) -> f64
aberration(theta: f64, v: f64) -> f64
headlight_effect(theta_rest: f64, v: f64) -> f64
proper_acceleration_to_coordinate(proper_accel: f64, proper_time: f64) -> (f64, f64)
twin_paradox_age(v: f64, coord_time: f64) -> f64

lorentz (10 functions)

FunctionSignature
gamma_factor(v: f64) -> f64
beta(v: f64) -> f64
time_dilation(proper_time: f64, v: f64) -> f64
length_contraction(proper_length: f64, v: f64) -> f64
lorentz_transform(t: f64, x: f64, v: f64) -> (f64, f64)
inverse_lorentz_transform(t_prime: f64, x_prime: f64, v: f64) -> (f64, f64)
lorentz_transform_4`(event: [f64; 4], v: [f64; 3]) -> [f64; 4]`
boost_matrix`(v: [f64; 3]) -> [[f64; 4]; 4]`
rapidity(v: f64) -> f64
velocity_from_rapidity(phi: f64) -> f64

Solid Mechanics API (40 functions)

Submodules

  • elasticity — Hooke's law, Young's modulus, Poisson ratio
  • fracture — stress intensity factor, fracture toughness, crack growth
  • plasticity — yield criteria, strain hardening, plastic deformation
  • stress — stress/strain tensors, principal stresses, von Mises

elasticity (12 functions)

FunctionSignature
hooke_stress(e: f64, strain: f64) -> f64
hooke_strain(stress: f64, e: f64) -> f64
poisson_lateral_strain(axial_strain: f64, nu: f64) -> f64
shear_modulus(e: f64, nu: f64) -> f64
bulk_modulus(e: f64, nu: f64) -> f64
lame_first(e: f64, nu: f64) -> f64
plane_stress_strain(stress_x: f64, stress_y: f64, e: f64, nu: f64) -> (f64, f64)
strain_energy_density(stress: f64, strain: f64) -> f64
thermal_strain(alpha: f64, delta_t: f64) -> f64
thermal_stress(e: f64, alpha: f64, delta_t: f64) -> f64
volumetric_strain(ex: f64, ey: f64, ez: f64) -> f64
hydrostatic_stress(sx: f64, sy: f64, sz: f64) -> f64

fracture (12 functions)

FunctionSignature
stress_intensity_factor(sigma: f64, a: f64, geometry_factor: f64) -> f64
griffith_critical_stress(e: f64, gamma: f64, a: f64) -> f64
energy_release_rate(k: f64, e: f64) -> f64
j_integral(energy_release: f64) -> f64
crack_tip_plastic_zone(k: f64, sigma_y: f64) -> f64
paris_law(c: f64, delta_k: f64, m: f64) -> f64
fatigue_life_basquin(sigma_f: f64, sigma_a: f64, b: f64) -> f64
fatigue_life_coffin_manson(ef: f64, ea: f64, c: f64) -> f64
miners_rule`(cycles: &[f64], max_cycles: &[f64]) -> f64`
fracture_toughness_plane_strain(kic: f64, sigma_y: f64) -> f64
stress_corrosion_threshold(k_iscc: f64, sigma: f64, a: f64) -> bool
crack_opening_displacement(k: f64, sigma_y: f64, e: f64) -> f64

plasticity (12 functions)

FunctionSignature
yield_offset_strain(total_strain: f64, offset: f64) -> f64
ramberg_osgood(stress: f64, e: f64, k: f64, n: f64) -> f64
true_stress(engineering_stress: f64, engineering_strain: f64) -> f64
true_strain(engineering_strain: f64) -> f64
hardening_power_law(k: f64, strain_plastic: f64, n: f64) -> f64
von_mises(s1: f64, s2: f64, s3: f64) -> f64
tresca(s1: f64, s2: f64, s3: f64) -> f64
isotropic_hardening(yield_0: f64, h: f64, plastic_strain: f64) -> f64
bauschinger_effect(forward_yield: f64, reverse_yield: f64) -> f64
plastic_work`(stress: &[f64], d_plastic_strain: &[f64]) -> f64`
necking_criterion(n: f64) -> f64
strain_rate_sensitivity(stress1: f64, stress2: f64, rate1: f64, rate2: f64) -> f64

stress (12 functions)

FunctionSignature
principal_stresses_2d(sx: f64, sy: f64, txy: f64) -> (f64, f64)
max_shear_stress_2d(sx: f64, sy: f64, txy: f64) -> f64
mohr_circle_radius(sx: f64, sy: f64, txy: f64) -> f64
mohr_circle_center(sx: f64, sy: f64) -> f64
stress_rotation_2d(sx: f64, sy: f64, txy: f64, theta: f64) -> (f64, f64, f64)
deviatoric_stress(sx: f64, sy: f64, sz: f64) -> (f64, f64, f64)
stress_invariant_j2(s1: f64, s2: f64, s3: f64) -> f64
beam_bending_stress(m: f64, y: f64, i: f64) -> f64
beam_deflection_cantilever(p: f64, l: f64, e: f64, i: f64) -> f64
torsion_shear_stress(t: f64, r: f64, j: f64) -> f64
column_euler_buckling(e: f64, i: f64, l: f64) -> f64
hertz_contact_pressure(force: f64, r1: f64, r2: f64, e_star: f64) -> f64

Thermodynamics API (55 functions)

Submodules

  • equations — equations of state (ideal gas, van der Waals, Redlich-Kwong)
  • processes — isothermal, adiabatic, isobaric, isochoric work/heat
  • statistical — Boltzmann factor, partition function, entropy

equations (29 functions)

FunctionSignature
ideal_gas_pressure(n_moles: f64, temperature: f64, volume: f64) -> f64
ideal_gas_volume(n_moles: f64, temperature: f64, pressure: f64) -> f64
ideal_gas_temperature(pressure: f64, volume: f64, n_moles: f64) -> f64
van_der_waals_pressure(n_moles: f64, temperature: f64, volume: f64, a: f64, b: f64) -> f64
redlich_kwong_pressure(n_moles: f64, temperature: f64, volume: f64, a: f64, b: f64) -> f64
virial_eos(pressure: f64, temperature: f64, b2: f64, b3: f64) -> f64
compressibility_factor(pressure: f64, volume: f64, n_moles: f64, temperature: f64) -> f64
internal_energy_ideal(n_moles: f64, cv: f64, temperature: f64) -> f64
enthalpy_ideal(n_moles: f64, cp: f64, temperature: f64) -> f64
entropy_ideal_gas(n_moles: f64, cv: f64, t1: f64, t2: f64, v1: f64, v2: f64) -> f64
gibbs_free_energy(enthalpy: f64, temperature: f64, entropy: f64) -> f64
helmholtz_free_energy(internal_energy: f64, temperature: f64, entropy: f64) -> f64
chemical_potential_ideal_gas(mu0: f64, temperature: f64, pressure: f64, p0: f64) -> f64
clausius_clapeyron(p1: f64, t1: f64, t2: f64, delta_h_vap: f64) -> f64
heat_capacity_ratio(cp: f64, cv: f64) -> f64
speed_of_sound_ideal(gamma: f64, temperature: f64, molar_mass: f64) -> f64
maxwell_speed_distribution(v: f64, mass: f64, temperature: f64) -> f64
most_probable_speed(mass: f64, temperature: f64) -> f64
mean_speed(mass: f64, temperature: f64) -> f64
rms_speed(mass: f64, temperature: f64) -> f64
mean_free_path(number_density: f64, cross_section: f64) -> f64
pressure_atm_to_pascal(p_atm: f64) -> f64
pressure_pascal_to_atm(p_pa: f64) -> f64
pressure_bar_to_pascal(p_bar: f64) -> f64
energy_calories_to_joules(cal: f64) -> f64
energy_joules_to_calories(j: f64) -> f64
energy_kwh_to_joules(kwh: f64) -> f64
plasma_temperature_kev_to_kelvin(t_kev: f64) -> f64
ideal_gas_pressure_atm(n_moles: f64, temperature: f64, volume_liters: f64) -> f64

processes (18 functions)

FunctionSignature
carnot_efficiency(t_hot: f64, t_cold: f64) -> f64
carnot_cop_heating(t_hot: f64, t_cold: f64) -> f64
carnot_cop_cooling(t_hot: f64, t_cold: f64) -> f64
isothermal_work(n_moles: f64, temperature: f64, v1: f64, v2: f64) -> f64
adiabatic_work(n_moles: f64, cv: f64, t1: f64, t2: f64) -> f64
isobaric_work(pressure: f64, v1: f64, v2: f64) -> f64
adiabatic_relation_tv(t1: f64, v1: f64, v2: f64, gamma: f64) -> f64
adiabatic_relation_pv(p1: f64, v1: f64, v2: f64, gamma: f64) -> f64
otto_efficiency(compression_ratio: f64, gamma: f64) -> f64
diesel_efficiency(compression_ratio: f64, cutoff_ratio: f64, gamma: f64) -> f64
joule_thomson_coefficient(cp: f64, v_molar: f64, temperature: f64, dv_dt_p: f64) -> f64
throttling_temperature_change(mu_jt: f64, dp: f64) -> f64
heat_conduction_rate(k: f64, area: f64, dt: f64, dx: f64) -> f64
thermal_diffusion_1d`(t: &mut [f64], alpha: f64, dx: f64, dt: f64, steps: usize)`
mixing_entropy`(mole_fractions: &[f64]) -> f64`
reaction_gibbs(delta_g0: f64, temperature: f64, q: f64) -> f64
equilibrium_constant(delta_g0: f64, temperature: f64) -> f64
vant_hoff(k1: f64, delta_h: f64, t1: f64, t2: f64) -> f64

statistical (15 functions)

FunctionSignature
boltzmann_distribution(energy: f64, temperature: f64) -> f64
partition_function_discrete`(energies: &[f64], temperature: f64) -> f64`
partition_function_harmonic(omega: f64, temperature: f64) -> f64
mean_energy_canonical`(energies: &[f64], temperature: f64) -> f64`
entropy_canonical`(energies: &[f64], temperature: f64) -> f64`
fermi_dirac(energy: f64, mu: f64, temperature: f64) -> f64
bose_einstein(energy: f64, mu: f64, temperature: f64) -> f64
planck_radiation(frequency: f64, temperature: f64) -> f64
planck_radiation_wavelength(wavelength: f64, temperature: f64) -> f64
wien_displacement(temperature: f64) -> f64
stefan_boltzmann_power(temperature: f64, area: f64) -> f64
debye_heat_capacity(temperature: f64, debye_temp: f64, n_atoms: f64) -> f64
einstein_heat_capacity(temperature: f64, einstein_temp: f64, n_atoms: f64) -> f64
sackur_tetrode(n_moles: f64, temperature: f64, volume: f64, mass: f64) -> f64
fermi_energy(mass: f64, number_density: f64) -> f64

Hub dispatch mapping

All physics functions are wired through:

  • src/hub/engine/dispatch/physics.rs
use sciforge::hub::prelude::*;

let exp = Experiment::new(DomainType::Physics, "lorentz_factor")
        .param("velocity", ParameterValue::Scalar(2.0e8));

let out = ExperimentRunner::new().run(&exp)?;
⚖️

MIT License

Copyright © 2026 Rayan

✅ Permission

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

📋 Condition

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

⚠ Disclaimer

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

📦 This license applies to the entire SciForge crate and all its modules.