{
 "site": "Invntr",
 "count": 105,
 "results": [
  {
   "name": "acoustics",
   "version": "0.2.0",
   "summary": "Airborne ultrasound from arrays of piston transducers (far-field piston model, checked against the Rayleigh integral) and the radiation force on small spheres (Gor'kov's potential, checked against the exact partial-wave solution for a rigid sphere and corrected by it), plus self-consistent bead-to-bead multiple acoustic scattering (exact fluid-sphere Mie monopole+dipole partial waves, checked against Silva & Bruus 2014 secondary radiation forces and exact 4M x 4M dense linear solves). levitator: two opposed flat arrays holding drops/beads (global, nearest-trap, tiled, or full-array crystal phasing with per-column height shifts); per trap the coupled equilibrium with gravity, restoring forces, lift over weight, sideways grip, stiffness, scattering shift; frames for animation and merging; sound level outside through an enclosure wall (mass law, coincidence); evaporation (d^2 law) and heating. Files: traps.csv, frames.csv, field.png, scene.glb (Python: NumPy, SciPy, matplotlib).",
   "runtime": "native",
   "timeout_s": 1800,
   "estimate_s": 10,
   "inputs": [
    {
     "name": "mode",
     "type": "string",
     "unit": null,
     "default": "levitator",
     "enum": [
      "levitator",
      "piston",
      "plane_wave",
      "exact",
      "focus",
      "enclosure",
      "evaporation",
      "scattering"
     ],
     "description": "levitator: opposed arrays holding drops/beads (the design mode). The others are the known-answer checks (see run.py)."
    },
    {
     "name": "frequency_Hz",
     "type": "number",
     "unit": "Hz",
     "default": 40000,
     "enum": null,
     "description": "Drive frequency."
    },
    {
     "name": "air_density_kg_m3",
     "type": "number",
     "unit": "kg/m^3",
     "default": 1.204,
     "enum": null,
     "description": "Density of the air."
    },
    {
     "name": "sound_speed_m_s",
     "type": "number",
     "unit": "m/s",
     "default": 343.2,
     "enum": null,
     "description": "Speed of sound in the air."
    },
    {
     "name": "array",
     "type": "object",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "levitator: two flat opposed arrays of nx x ny transducers (top faces down, bottom faces up)."
    },
    {
     "name": "phasing",
     "type": "string",
     "unit": null,
     "default": "nearest",
     "enum": [
      "global",
      "nearest",
      "tiles",
      "crystal"
     ],
     "description": "global: every transducer serves every trap; nearest: each transducer serves the trap nearest it in plan; tiles: fixed tiles of tile_n x tile_n; crystal: full-array checkerboard standing-wave crystal with optional per-column shifts (empty columns stay driven)."
    },
    {
     "name": "scattering",
     "type": "boolean",
     "unit": null,
     "default": false,
     "enum": null,
     "description": "Solve self-consistent bead-to-bead multiple acoustic scattering (monopole + dipole partial waves) and relax traps to their coupled equilibrium."
    },
    {
     "name": "scattering_model",
     "type": "string",
     "unit": null,
     "default": "mie",
     "enum": [
      "mie",
      "rayleigh"
     ],
     "description": "Partial-wave scattering coefficients: exact passive fluid-sphere Mie (mie) or small-ka Rayleigh limit (rayleigh)."
    },
    {
     "name": "column_shifts_mm",
     "type": "array",
     "unit": "mm",
     "default": null,
     "enum": null,
     "description": "crystal phasing: nx x ny array (or flat nx*ny list) of per-column vertical shifts in mm."
    },
    {
     "name": "frame_shifts_mm",
     "type": "array",
     "unit": "mm",
     "default": null,
     "enum": null,
     "description": "crystal phasing with frames: list of nx x ny column shift matrices in mm, one per frame."
    },
    {
     "name": "scattering_ka",
     "type": "number",
     "unit": "1",
     "default": 0.05,
     "enum": null,
     "description": "scattering mode: dimensionless sphere size k R."
    },
    {
     "name": "separations_lam",
     "type": "array",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "scattering mode: pair separations in wavelengths for Silva & Bruus (2014) secondary-force check."
    },
    {
     "name": "tile_n",
     "type": "integer",
     "unit": "1",
     "default": 4,
     "enum": null,
     "description": "Transducers per tile side (tiles phasing, and traps: \"plate\")."
    },
    {
     "name": "trap_phase_pattern",
     "type": "string",
     "unit": null,
     "default": "zero",
     "enum": [
      "zero",
      "checker",
      "quad"
     ],
     "description": "A phase offset per trap by its place on the tile grid (crosstalk between neighbours)."
    },
    {
     "name": "traps",
     "type": null,
     "unit": "mm",
     "default": null,
     "enum": null,
     "description": "\"plate\" (one trap over the centre of every tile, on the mid-plane), or a list of [x, y, z] in mm."
    },
    {
     "name": "frames",
     "type": "array",
     "unit": "mm",
     "default": null,
     "enum": null,
     "description": "A sequence of trap sets ([[x, y, z], ...] in mm per frame): transport and merging, analysed frame by frame."
    },
    {
     "name": "drop",
     "type": "object",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "The held object (a water drop by default)."
    },
    {
     "name": "wall",
     "type": "object",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Enclosure wall (levitator: the level outside through it; enclosure mode)."
    },
    {
     "name": "observer_m",
     "type": "number",
     "unit": "m",
     "default": 0.3,
     "enum": null,
     "description": "Distance from the device centre at which the level outside is taken."
    },
    {
     "name": "spl_limit_dB",
     "type": "number",
     "unit": "dB",
     "default": 110,
     "enum": null,
     "description": "The level allowed at the observer (set it to the rule that applies)."
    },
    {
     "name": "environment",
     "type": "object",
     "unit": null,
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "heat",
     "type": "object",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Light absorbed by the drop."
    },
    {
     "name": "air_conductivity_W_mK",
     "type": "number",
     "unit": "W/(m K)",
     "default": 0.0262,
     "enum": null,
     "description": ""
    },
    {
     "name": "piston_radius_mm",
     "type": "number",
     "unit": "mm",
     "default": 4.5,
     "enum": null,
     "description": "piston, focus modes."
    },
    {
     "name": "velocity_m_s",
     "type": "number",
     "unit": "m/s",
     "default": 1.0,
     "enum": null,
     "description": "piston mode: face velocity amplitude."
    },
    {
     "name": "rings",
     "type": "integer",
     "unit": "1",
     "default": 120,
     "enum": null,
     "description": null
    },
    {
     "name": "sectors",
     "type": "integer",
     "unit": "1",
     "default": 160,
     "enum": null,
     "description": null
    },
    {
     "name": "axis_mm",
     "type": "array",
     "unit": "mm",
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "angles_deg",
     "type": "array",
     "unit": "deg",
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "far_mm",
     "type": "number",
     "unit": "mm",
     "default": 100,
     "enum": null,
     "description": ""
    },
    {
     "name": "amplitude_Pa",
     "type": "number",
     "unit": "Pa",
     "default": 1000,
     "enum": null,
     "description": "plane_wave, exact: standing-wave amplitude."
    },
    {
     "name": "kz",
     "type": "number",
     "unit": "1",
     "default": 0.7853981633974483,
     "enum": null,
     "description": "plane_wave: k z of the sphere's centre."
    },
    {
     "name": "ka",
     "type": "array",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "n",
     "type": "integer",
     "unit": "1",
     "default": 16,
     "enum": null,
     "description": null
    },
    {
     "name": "pitch_mm",
     "type": "number",
     "unit": "mm",
     "default": 10.5,
     "enum": null,
     "description": ""
    },
    {
     "name": "p0_Pa_m",
     "type": "number",
     "unit": "Pa m",
     "default": 5,
     "enum": null,
     "description": ""
    },
    {
     "name": "separation_mm",
     "type": "number",
     "unit": "mm",
     "default": 180,
     "enum": null,
     "description": ""
    },
    {
     "name": "target_mm",
     "type": "array",
     "unit": "mm",
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "temperature_C",
     "type": "number",
     "unit": "degC",
     "default": 25,
     "enum": null,
     "description": ""
    },
    {
     "name": "humidity",
     "type": "number",
     "unit": "1",
     "default": 0.5,
     "enum": null,
     "description": ""
    },
    {
     "name": "sherwood",
     "type": "number",
     "unit": "1",
     "default": 2,
     "enum": null,
     "description": ""
    }
   ],
   "outputs": [
    {
     "name": "transducers",
     "unit": "1",
     "description": null
    },
    {
     "name": "per_array",
     "unit": "1",
     "description": null
    },
    {
     "name": "tile_n",
     "unit": "1",
     "description": null
    },
    {
     "name": "separation_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "p0_Pa_m",
     "unit": "Pa m",
     "description": null
    },
    {
     "name": "drop_radius_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "drop_mass_mg",
     "unit": "mg",
     "description": null
    },
    {
     "name": "drop_weight_uN",
     "unit": "\u00b5N",
     "description": null
    },
    {
     "name": "ka",
     "unit": "1",
     "description": null
    },
    {
     "name": "gorkov_correction",
     "unit": "1",
     "description": null
    },
    {
     "name": "f1",
     "unit": "1",
     "description": null
    },
    {
     "name": "f2",
     "unit": "1",
     "description": null
    },
    {
     "name": "traps_n",
     "unit": "1",
     "description": null
    },
    {
     "name": "min_sf_vertical",
     "unit": "1",
     "description": null
    },
    {
     "name": "min_lateral_accel_g",
     "unit": "1",
     "description": null
    },
    {
     "name": "max_aspect_ratio",
     "unit": "1",
     "description": null
    },
    {
     "name": "max_offset_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "min_separation_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "merge_separation_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "path_min_sf_vertical",
     "unit": "1",
     "description": null
    },
    {
     "name": "path_min_lateral_accel_g",
     "unit": "1",
     "description": null
    },
    {
     "name": "path_max_offset_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "scattering_iters",
     "unit": "1",
     "description": null
    },
    {
     "name": "scattering_max_shift_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "scattering_max_p_ratio",
     "unit": "1",
     "description": null
    },
    {
     "name": "scattering_max_grad_ratio",
     "unit": "1",
     "description": null
    },
    {
     "name": "scattering_residual_weight",
     "unit": "1",
     "description": null
    },
    {
     "name": "passivity_err",
     "unit": "1",
     "description": null
    },
    {
     "name": "node_worst_rel_err",
     "unit": "1",
     "description": null
    },
    {
     "name": "antinode_worst_rel_err",
     "unit": "1",
     "description": null
    },
    {
     "name": "axial_to_transverse_ratio",
     "unit": "1",
     "description": null
    },
    {
     "name": "multi_solve_rel_err",
     "unit": "1",
     "description": null
    },
    {
     "name": "multi_solve_iters",
     "unit": "1",
     "description": null
    },
    {
     "name": "frames_n",
     "unit": "1",
     "description": null
    },
    {
     "name": "merge_frame",
     "unit": "1",
     "description": null
    },
    {
     "name": "spl_open_dB",
     "unit": "dB",
     "description": null
    },
    {
     "name": "spl_enclosed_dB",
     "unit": "dB",
     "description": null
    },
    {
     "name": "safety_margin_dB",
     "unit": "dB",
     "description": null
    },
    {
     "name": "spl_inside_max_dB",
     "unit": "dB",
     "description": null
    },
    {
     "name": "traps",
     "unit": null,
     "description": null
    },
    {
     "name": "frames",
     "unit": null,
     "description": null
    },
    {
     "name": "evaporation",
     "unit": null,
     "description": null
    },
    {
     "name": "heating",
     "unit": null,
     "description": null
    },
    {
     "name": "vapour_pressure_kPa",
     "unit": "kPa",
     "description": null
    },
    {
     "name": "vapour_density_kg_m3",
     "unit": "kg/m^3",
     "description": null
    },
    {
     "name": "diffusivity_m2_s",
     "unit": "m^2/s",
     "description": null
    },
    {
     "name": "lifetime_s",
     "unit": "s",
     "description": null
    },
    {
     "name": "time_to_lose_10pct_s",
     "unit": "s",
     "description": null
    },
    {
     "name": "coincidence_Hz",
     "unit": "Hz",
     "description": null
    },
    {
     "name": "mass_law_dB",
     "unit": "dB",
     "description": null
    },
    {
     "name": "tl_dB",
     "unit": "dB",
     "description": null
    },
    {
     "name": "surface_density_kg_m2",
     "unit": "kg/m^2",
     "description": null
    },
    {
     "name": "force_N",
     "unit": "N",
     "description": null
    },
    {
     "name": "closed_form_N",
     "unit": "N",
     "description": null
    },
    {
     "name": "rel_err",
     "unit": "1",
     "description": null
    },
    {
     "name": "axis_worst_rel_err",
     "unit": "1",
     "description": null
    },
    {
     "name": "directivity_worst_rel_err",
     "unit": "1",
     "description": null
    },
    {
     "name": "single_focus_ratio",
     "unit": "1",
     "description": null
    },
    {
     "name": "twin_node_ratio",
     "unit": "1",
     "description": null
    },
    {
     "name": "focus_Pa",
     "unit": "Pa",
     "description": null
    },
    {
     "name": "ratio_small",
     "unit": "1",
     "description": null
    },
    {
     "name": "trap_kz",
     "unit": "1",
     "description": null
    },
    {
     "name": "trap_offset_from_node_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "wavelength_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "frequency_Hz",
     "unit": "Hz",
     "description": null
    },
    {
     "name": "rayleigh_distance_mm",
     "unit": "mm",
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "piston, a = 4.5 mm, 40 kHz: the Rayleigh integral (120 x 160 polar cells) on the axis against the exact closed form |p| = 2 rho c u0 |sin(k (sqrt(z^2 + a^2) - z) / 2)| at 5, 20 and 100 mm (1e-4); the far-field directivity model (A = rho c u0 k a^2 / 2) against the Rayleigh integral at 100 mm, 0-40 deg (0.5 %: the model is the far field, 100 mm is 40 Rayleigh distances)",
     "checks": [
      "axis_worst_rel_err",
      "directivity_worst_rel_err"
     ]
    },
    {
     "name": "plane standing wave p = P cos(kz), P 1000 Pa, a 0.3 mm water drop at kz = pi/4: Gor'kov's force by the instrument's finite differences against the closed form pi k R^3 P^2 (f1/3 + f2/2) sin(2kz)/(rho c^2) (Bruus, Lab Chip 12 (2012) 1014, eq. for a standing wave) to 0.2 %; the potential's minimum at the pressure node kz = pi/2 (to 0.02 mm, the scan's spacing)",
     "checks": [
      "rel_err",
      "trap_offset_from_node_mm"
     ]
    },
    {
     "name": "exact partial-wave force on a rigid sphere in a standing wave: at k a = 0.05 it tends to Gor'kov's small-particle limit (ratio 1 to 0.5 %; the first correction is of order (k a)^2)",
     "checks": [
      "ratio_small"
     ]
    },
    {
     "name": "focusing: one 16 x 16 array phased by conjugation is in phase at its focus, |P| = the sum of the transducers' amplitudes there (1e-9); opposed arrays with a pi shift give an exact node at a mid-plane target (|P| below 1e-9 of that sum), by symmetry",
     "checks": [
      "single_focus_ratio",
      "twin_node_ratio"
     ]
    },
    {
     "name": "wall: 6 mm glass (2500 kg/m^3, 70 GPa, 0.22): the coincidence frequency c^2/(2 pi) sqrt(m/D) = 1995.3 Hz (by hand; textbooks quote about 2 kHz for 6 mm glass) and the mass law at 1 kHz, 20 log10(f m) - 47 = 36.52 dB (closed form)",
     "checks": [
      "coincidence_Hz",
      "mass_law_dB"
     ]
    },
    {
     "name": "evaporation: saturation vapour pressure of water at 25 C against the CRC Handbook's table, 3.1699 kPa (0.1 %: Buck's fit); a 1 mm-radius drop at 50 % humidity, Sherwood 2: lifetime rho R^2 / (Sh D dc) = 1698.3 s (by hand from Buck and Massman's D = 2.178e-5 (T/273.15)^1.81)",
     "checks": [
      "lifetime_s",
      "vapour_pressure_kPa"
     ]
    },
    {
     "name": "levitator, one trap at the centre of opposed 4 x 4 arrays 60 mm apart: by symmetry the node is exactly at the target (offset 0, |P| = 0) and the trap holds; the Gor'kov correction equals the exact ratio at k R = 0.366 (between 1 at k R -> 0 and 0.878 at 0.5)",
     "checks": [
      "all_held",
      "first_trap.node_Pa",
      "gorkov_correction",
      "max_offset_mm"
     ]
    },
    {
     "name": "secondary acoustic radiation force (Silva & Bruus, Phys. Rev. E 90, 063007, 2014): two small spheres (ka = 0.005, R/d <= 0.016) across d = 0.05..2.0 lam match exact all-range nodal dipole-dipole and antinodal monopole-monopole closed forms to 1e-4; near-field axial/transverse dipole ratio approaches -2 (within 2% at kd = 0.0628); exact fluid-sphere Mie coefficients satisfy optical theorem Re(s_n)+|s_n|^2 = 0 to 1e-12; iterative multiple-scattering solver matches exact 32x32 dense linear solve on an 8-sphere 3D cluster to 1e-9",
     "checks": [
      "antinode_worst_rel_err",
      "axial_to_transverse_ratio",
      "multi_solve_converged",
      "multi_solve_rel_err",
      "node_worst_rel_err",
      "passivity_err"
     ]
    },
    {
     "name": "multiple scattering at finite bead size (ka = 0.549, 1.5 mm EPS bead at 40 kHz): exact passive fluid-sphere Mie coefficients satisfy Re(s_n)+|s_n|^2 = 0 to 1e-12 and iterative self-consistent multiple-scattering solver matches exact 32x32 dense linear solve on an 8-sphere 3D cluster to 1e-9",
     "checks": [
      "multi_solve_converged",
      "multi_solve_rel_err",
      "passivity_err"
     ]
    },
    {
     "name": "levitator with crystal phasing and self-consistent multiple scattering on 2 adjacent EPS beads in a 6x6 opposed array: converges, holds both beads, and records a nonzero coupled scattering shift",
     "checks": [
      "all_held",
      "min_sf_vertical",
      "scattering_converged",
      "scattering_max_shift_mm"
     ]
    }
   ],
   "title": "Acoustic levitator",
   "needs_build": true,
   "category": "Waves, optics and circuits",
   "known_answers": 28
  },
  {
   "name": "adduct_mass",
   "version": "0.1.0",
   "summary": "Converts between observed ESI precursor m/z and neutral monoisotopic mass (Da) for standard positive/negative adducts, with optional ppm mass error against a reference mass.",
   "runtime": "native",
   "timeout_s": 30,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "adduct",
     "type": "string",
     "unit": null,
     "default": "[M+H]+",
     "enum": null,
     "description": "ESI adduct ion string, e.g. [M+H]+, [M+Na]+, [M+K]+, [M+NH4]+, [M-H]-, [M+Cl]-, [M+FA-H]-, [2M+H]+, [M+2H]2+."
    },
    {
     "name": "precursor_mz",
     "type": "number",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "Observed precursor m/z (provide this OR neutral_mass)."
    },
    {
     "name": "neutral_mass",
     "type": "number",
     "unit": "Da",
     "default": null,
     "enum": null,
     "description": "Neutral monoisotopic mass in Da (provide this OR precursor_mz)."
    },
    {
     "name": "reference_mass",
     "type": "number",
     "unit": "Da",
     "default": null,
     "enum": null,
     "description": "Optional theoretical neutral mass (Da) to compute ppm error."
    }
   ],
   "outputs": [
    {
     "name": "precursor_mz",
     "unit": "1",
     "description": null
    },
    {
     "name": "neutral_mass_Da",
     "unit": "Da",
     "description": null
    },
    {
     "name": "mass_shift_Da",
     "unit": "Da",
     "description": null
    },
    {
     "name": "charge",
     "unit": "1",
     "description": null
    },
    {
     "name": "ppm_error",
     "unit": "1",
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "caffeine [M+H]+ from neutral mass 194.080376 Da -> m/z 195.087652",
     "checks": [
      "charge",
      "precursor_mz"
     ]
    },
    {
     "name": "aspirin [M-H]- from m/z 179.034982 -> neutral mass 180.042259 Da",
     "checks": [
      "charge",
      "neutral_mass_Da",
      "ppm_error"
     ]
    },
    {
     "name": "caffeine [M+Na]+ -> m/z 217.069597",
     "checks": [
      "precursor_mz"
     ]
    }
   ],
   "title": "ESI adduct mass conversion",
   "needs_build": true,
   "category": "Mass spectrometry",
   "known_answers": 6
  },
  {
   "name": "allan_deviation",
   "version": "0.1.0",
   "summary": "Overlapping Allan deviation of a rate (frequency) or phase time series at logarithmically spaced averaging times: white-noise, bias-instability, random-walk and drift regions from a non-negative power-law fit, the random-walk coefficient, the minimum and its averaging time, the log-log slope; curve as csv. Takes measured samples or synthesises a seeded series.",
   "runtime": "native",
   "timeout_s": 60,
   "estimate_s": 0.2,
   "inputs": [
    {
     "name": "kind",
     "type": "string",
     "unit": null,
     "default": "frequency",
     "enum": [
      "frequency",
      "phase"
     ],
     "description": "frequency: the samples are a rate (gyro deg/s, fractional frequency, sensor reading); phase: the samples are its time integral (time error, angle), in unit times seconds."
    },
    {
     "name": "values",
     "type": "array",
     "unit": null,
     "default": [],
     "enum": null,
     "description": "Equally spaced samples, oldest first. Leave empty and set synth_n to synthesise a series instead."
    },
    {
     "name": "sample_interval_s",
     "type": "number",
     "unit": "s",
     "default": 1.0,
     "enum": null,
     "description": "Time between samples (tau0)."
    },
    {
     "name": "unit",
     "type": "string",
     "unit": null,
     "default": "1",
     "enum": null,
     "description": "Unit of the rate samples (deg/s, Hz, 1 for fractional frequency). Every deviation is reported in it."
    },
    {
     "name": "points_per_decade",
     "type": "integer",
     "unit": "1",
     "default": 10,
     "enum": null,
     "description": "Averaging times per decade (logarithmic spacing, whole multiples of tau0)."
    },
    {
     "name": "max_tau_fraction",
     "type": "number",
     "unit": "1",
     "default": 0.2,
     "enum": null,
     "description": "Longest averaging time as a share of the record (0.5 is the estimator's limit; past 0.2 the points are very uncertain)."
    },
    {
     "name": "tau_query_s",
     "type": "number",
     "unit": "s",
     "default": null,
     "enum": null,
     "description": "Optional: one averaging time to read the deviation at (snapped to a whole number of samples)."
    },
    {
     "name": "synth_n",
     "type": "integer",
     "unit": "1",
     "default": 0,
     "enum": null,
     "description": "Number of synthetic rate samples (0: use values)."
    },
    {
     "name": "synth_white_sd",
     "type": "number",
     "unit": null,
     "default": 1.0,
     "enum": null,
     "description": "Synthetic: standard deviation of the white noise per sample."
    },
    {
     "name": "synth_walk_step_sd",
     "type": "number",
     "unit": null,
     "default": 0.0,
     "enum": null,
     "description": "Synthetic: standard deviation of each random-walk step (one step per sample)."
    },
    {
     "name": "synth_drift_per_sample",
     "type": "number",
     "unit": null,
     "default": 0.0,
     "enum": null,
     "description": "Synthetic: linear drift of the rate, per sample."
    },
    {
     "name": "synth_offset",
     "type": "number",
     "unit": null,
     "default": 0.0,
     "enum": null,
     "description": "Synthetic: constant offset (does not change the deviation)."
    },
    {
     "name": "seed",
     "type": "integer",
     "unit": "1",
     "default": 1,
     "enum": null,
     "description": "Synthetic: generator seed (xoshiro256**); the same seed gives the same series."
    }
   ],
   "outputs": [
    {
     "name": "source",
     "unit": null,
     "description": "values or synthetic"
    },
    {
     "name": "kind",
     "unit": null,
     "description": null
    },
    {
     "name": "unit",
     "unit": null,
     "description": "the unit every deviation is in"
    },
    {
     "name": "sample_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "record_length_s",
     "unit": "s",
     "description": null
    },
    {
     "name": "tau_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "tau_min_s",
     "unit": "s",
     "description": null
    },
    {
     "name": "tau_max_s",
     "unit": "s",
     "description": null
    },
    {
     "name": "adev_tau0",
     "unit": null,
     "description": "Allan deviation at one sample interval"
    },
    {
     "name": "adev_min",
     "unit": null,
     "description": "smallest Allan deviation on the curve"
    },
    {
     "name": "tau_at_min_s",
     "unit": "s",
     "description": null
    },
    {
     "name": "adev_min_rel_error",
     "unit": "1",
     "description": "1-sigma relative sampling error of adev_min"
    },
    {
     "name": "adev_max",
     "unit": null,
     "description": null
    },
    {
     "name": "adev_at_query",
     "unit": null,
     "description": null
    },
    {
     "name": "query_tau_s",
     "unit": "s",
     "description": null
    },
    {
     "name": "minimum_location",
     "unit": null,
     "description": "interior, shortest_tau, longest_tau, single_tau or flat_zero"
    },
    {
     "name": "minimum_resolved",
     "unit": null,
     "description": "an interior minimum with a fall before and a rise after it beyond 2 sigma"
    },
    {
     "name": "loglog_slope",
     "unit": "1",
     "description": "weighted slope of log ADEV against log tau over the whole curve"
    },
    {
     "name": "white_noise_coefficient",
     "unit": null,
     "description": "No unit the kernel can check (unit s^0.5 is not a whole power). N (angle/velocity random walk), unit s^0.5; reported as the white term's ADEV at tau = 1 s"
    },
    {
     "name": "bias_instability",
     "unit": null,
     "description": "B, the flicker floor is 0.664 B"
    },
    {
     "name": "random_walk_coefficient",
     "unit": null,
     "description": "No unit the kernel can check (unit s^-0.5 is not a whole power). K (rate random walk), unit s^-0.5; reported as its number in the unit of the samples"
    },
    {
     "name": "drift_rate",
     "unit": null,
     "description": "No unit declared (unit/s cannot be formed from a free-text unit). R (rate ramp), unit/s; reported as its number in the unit of the samples"
    },
    {
     "name": "regions",
     "unit": null,
     "description": "per noise term: slope, whether it dominates anywhere, coefficient (true dimension in coefficient_unit), the averaging times where it dominates"
    },
    {
     "name": "curve",
     "unit": null,
     "description": null
    },
    {
     "name": "warnings",
     "unit": null,
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "linear rate drift y = a t (a = 0.004 /s, tau0 = 0.5 s): ADEV = a tau / sqrt 2 exactly (IEEE Std 952 ramp term), R = a, slope +1; closed form, rel 1e-9",
     "checks": [
      "adev_at_query",
      "adev_tau0",
      "drift_rate",
      "loglog_slope"
     ]
    },
    {
     "name": "constant signal 3.25: every Allan deviation is 0 by definition (differences of equal averages); exact",
     "checks": [
      "adev_max",
      "adev_tau0",
      "minimum_location"
     ]
    },
    {
     "name": "alternating +1,-1 (20 samples, tau0 = 1 s), by hand from the definition: m-averages are +-1/m (odd m) or 0 (even m), so ADEV(m tau0) = sqrt2/m for odd m, 0 for even m; ADEV(1 s) = sqrt 2, ADEV(3 s) = sqrt2/3, ADEV(2 s) = 0; exact, rel 1e-9",
     "checks": [
      "adev_at_query",
      "adev_min",
      "adev_tau0",
      "tau_at_min_s"
     ]
    },
    {
     "name": "phase input x = t^2/2 (rate y = t, a = 1 /s), 11 samples: second difference of x is a tau^2, so ADEV = tau / sqrt 2 exactly; ADEV(1 s) = 0.7071068, ADEV(4 s) = 2.8284271, R = 1; closed form, rel 1e-9",
     "checks": [
      "adev_at_query",
      "adev_tau0",
      "drift_rate"
     ]
    },
    {
     "name": "white rate noise s = 2, 1e5 samples, seed 7: AVAR = s^2 tau0/tau, so ADEV(tau0) = s = 2, slope -1/2, N = s sqrt(tau0) = 2; statistical: rel 1.5 % on ADEV(tau0) is ~5 sigma of its 0.32 % sampling error, slope +-0.03 and N 2 % cover the fit's pooled sampling error",
     "checks": [
      "adev_tau0",
      "loglog_slope",
      "white_noise_coefficient"
     ]
    },
    {
     "name": "rate random walk, step sd q = 0.01 per sample, 1e5 samples, seed 11: exact discrete AVAR = q^2 (2m^2+1)/(6m) (worked from the definition), so ADEV(1 s) = q/sqrt2 = 0.00707107, ADEV(10 s) = q sqrt(201/60) = 0.0183030, K = q/sqrt(tau0) = 0.01; statistical: 1.5 % / 3 % are ~5 sigma of the 0.22 % / 0.7 % sampling errors, K 5 % because the fit pools long-tau points with errors of several %",
     "checks": [
      "adev_at_query",
      "adev_tau0",
      "random_walk_coefficient"
     ]
    }
   ],
   "title": "Allan deviation",
   "needs_build": true,
   "category": "Measurement and data",
   "known_answers": 20
  },
  {
   "name": "antenna_array",
   "version": "0.1.0",
   "summary": "Linear antenna array of equally spaced isotropic elements: the array factor against angle from the array axis for N elements, spacing in wavelengths and a progressive phase step (or a steering angle), with uniform, binomial, Dolph-Chebyshev or custom symmetric amplitude taper. Gives beam direction, half-power and first-null beamwidths, every null, first and highest sidelobe, directivity (exact sum), and a grating-lobe check. Array factor only: element pattern, mutual coupling and losses are not modelled.",
   "runtime": "native",
   "timeout_s": 60,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "n_elements",
     "type": "integer",
     "unit": "1",
     "default": 8,
     "enum": null,
     "description": "Number of elements N. With taper = custom the number of weights is used instead."
    },
    {
     "name": "spacing_wavelengths",
     "type": "number",
     "unit": "1",
     "default": 0.5,
     "enum": null,
     "description": "Element spacing divided by the wavelength, d / lambda."
    },
    {
     "name": "phase_deg",
     "type": "number",
     "unit": "deg",
     "default": 0,
     "enum": null,
     "description": "Progressive phase beta from one element to the next. 0 is broadside; -360 d / lambda is endfire toward 0 deg. Ignored when steer_angle_deg is given."
    },
    {
     "name": "steer_angle_deg",
     "type": [
      "number",
      "null"
     ],
     "unit": "deg",
     "default": null,
     "enum": null,
     "description": "Optional: point the beam at this angle from the array axis (90 = broadside); sets beta = -360 (d / lambda) cos(angle) deg."
    },
    {
     "name": "taper",
     "type": "string",
     "unit": null,
     "default": "uniform",
     "enum": [
      "uniform",
      "binomial",
      "chebyshev",
      "custom"
     ],
     "description": "Amplitude taper. binomial: C(N-1, n), no sidelobes at half-wave spacing. chebyshev: Dolph-Chebyshev, all sidelobes at sidelobe_db. custom: the weights input."
    },
    {
     "name": "sidelobe_db",
     "type": "number",
     "unit": null,
     "default": 26,
     "enum": null,
     "description": "Chebyshev taper only: sidelobe level below the main beam, a positive number of dB."
    },
    {
     "name": "weights",
     "type": [
      "array",
      "null"
     ],
     "unit": null,
     "default": null,
     "enum": null,
     "description": "taper = custom only: one real amplitude per element, zero or positive, symmetric about the centre, 2 to 500 values."
    }
   ],
   "outputs": [
    {
     "name": "n_elements",
     "unit": "1",
     "description": null
    },
    {
     "name": "taper",
     "unit": "1",
     "description": null
    },
    {
     "name": "spacing_wavelengths",
     "unit": "1",
     "description": null
    },
    {
     "name": "array_length_wavelengths",
     "unit": "1",
     "description": "(N - 1) d / lambda"
    },
    {
     "name": "phase_deg",
     "unit": "deg",
     "description": "the progressive phase used"
    },
    {
     "name": "main_beam_visible",
     "unit": "1",
     "description": "false when |beta| > k d: no full-strength peak in visible space"
    },
    {
     "name": "beam_angle_deg",
     "unit": "deg",
     "description": "main-beam direction from the array axis: cos(theta) = -beta / (k d)"
    },
    {
     "name": "beam_from_broadside_deg",
     "unit": "deg",
     "description": "90 - beam_angle_deg"
    },
    {
     "name": "hpbw_deg",
     "unit": "deg",
     "description": "half-power beamwidth; for a beam on the axis, twice the angle from the axis to the half-power point; null when the pattern never drops 3 dB"
    },
    {
     "name": "half_power_low_deg",
     "unit": "deg",
     "description": null
    },
    {
     "name": "half_power_high_deg",
     "unit": "deg",
     "description": null
    },
    {
     "name": "fnbw_deg",
     "unit": "deg",
     "description": "width between the first nulls either side of the main beam"
    },
    {
     "name": "first_null_low_deg",
     "unit": "deg",
     "description": null
    },
    {
     "name": "first_null_high_deg",
     "unit": "deg",
     "description": null
    },
    {
     "name": "null_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "nulls_deg",
     "unit": "deg",
     "description": "every null in 0 to 180 deg, ascending (first 200; out/nulls.csv holds all)"
    },
    {
     "name": "sidelobe_count",
     "unit": "1",
     "description": "lobe peaks in 0 to 180 deg other than the main beam and grating lobes"
    },
    {
     "name": "first_sidelobe_db",
     "unit": null,
     "description": "dB relative to the main beam: the higher of the two lobes next to the main beam; null when there is none"
    },
    {
     "name": "first_sidelobe_angle_deg",
     "unit": "deg",
     "description": null
    },
    {
     "name": "max_sidelobe_db",
     "unit": null,
     "description": "dB relative to the main beam: the highest sidelobe (grating lobes are counted separately)"
    },
    {
     "name": "max_sidelobe_angle_deg",
     "unit": "deg",
     "description": null
    },
    {
     "name": "directivity",
     "unit": "1",
     "description": "peak power over the average over the sphere, isotropic elements"
    },
    {
     "name": "directivity_db",
     "unit": null,
     "description": "10 log10(directivity), dBi"
    },
    {
     "name": "directivity_check_rel_diff",
     "unit": "1",
     "description": "relative gap between the exact sum and Simpson's rule for the sphere average"
    },
    {
     "name": "taper_efficiency",
     "unit": "1",
     "description": "(sum a)^2 / (N sum a^2)"
    },
    {
     "name": "centre_over_edge",
     "unit": "1",
     "description": "largest weight over the end element's weight"
    },
    {
     "name": "weights",
     "unit": "1",
     "description": "element amplitudes, largest = 1 (first 200; out/weights.csv holds all)"
    },
    {
     "name": "grating_lobe_free",
     "unit": "1",
     "description": "true when no second full-strength peak (psi = 360 m deg) is in visible space"
    },
    {
     "name": "single_main_beam",
     "unit": null,
     "description": "true when the main beam is in visible space and no grating lobe is: the verdict"
    },
    {
     "name": "grating_lobe_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "grating_lobe_angles_deg",
     "unit": "deg",
     "description": null
    },
    {
     "name": "max_spacing_no_grating_wavelengths",
     "unit": "1",
     "description": "1 / (1 + |cos(beam angle)|): below this spacing no grating-lobe peak enters visible space; files: out/pattern.csv, out/lobes.csv, out/nulls.csv, out/weights.csv"
    },
    {
     "name": "warnings",
     "unit": "1",
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "uniform broadside N = 4, d = lambda/2 (Balanis, Antenna Theory, sec. 6.3): nulls at cos(theta) = m lambda/(N d) = 0, +-1/2, +-1 -> 0, 60, 120, 180 deg; AF = cos(psi/2) cos(psi), so the sidelobe is 2/(3 sqrt 6) = -11.3033 dB and the half-power point solves cos(psi/2) cos(psi) = 1/sqrt 2; half-wave spacing gives D = N = 4; closed forms, 1e-6",
     "checks": [
      "beam_angle_deg",
      "directivity",
      "first_sidelobe_db",
      "fnbw_deg",
      "grating_lobe_free",
      "hpbw_deg",
      "null_count",
      "nulls_deg.0",
      "nulls_deg.1",
      "nulls_deg.2",
      "nulls_deg.3"
     ]
    },
    {
     "name": "uniform broadside N = 3, d = lambda/2: AF = (1 + 2 cos psi)/3, nulls at cos(theta) = +-2/3, one sidelobe each side at endfire of level 1/3 = -9.5424 dB, D = N = 3; closed forms, 1e-6",
     "checks": [
      "directivity",
      "first_null_high_deg",
      "first_null_low_deg",
      "first_sidelobe_db",
      "null_count",
      "sidelobe_count"
     ]
    },
    {
     "name": "two elements in phase, d = lambda/2: AF = cos((pi/2) cos theta), no sidelobe, nulls on the axis (0 and 180 deg), half power at cos(theta) = +-1/2 so HPBW = 60 deg, D = 2; closed forms, 1e-6",
     "checks": [
      "directivity",
      "first_null_high_deg",
      "first_null_low_deg",
      "first_sidelobe_db",
      "hpbw_deg",
      "sidelobe_count"
     ]
    },
    {
     "name": "two elements in phase, d = lambda/4: D = 2/(1 + sin(k d)/(k d)) = 2/(1 + 2/pi) = 1.2220309 (Kraus, Antennas, two isotropic sources); no null and no sidelobe (the pattern is exactly at half power on the axis, cos^2(pi/4) = 1/2, so the beamwidth is not graded); closed form, 1e-9",
     "checks": [
      "directivity",
      "null_count",
      "sidelobe_count"
     ]
    },
    {
     "name": "steering, N = 8, d = lambda/2, beta = -90 deg: peak where k d cos(theta) + beta = 0 -> cos(theta) = 1/2, 60 deg; first nulls at psi = +-2 pi/N -> cos(theta) = 3/4 and 1/4; half-power point solves sin(4 psi)/(8 sin(psi/2)) = 1/sqrt 2; half-wave spacing gives D = N = 8 at any scan; closed forms, 1e-6",
     "checks": [
      "beam_angle_deg",
      "directivity",
      "first_null_high_deg",
      "first_null_low_deg",
      "fnbw_deg",
      "hpbw_deg",
      "max_spacing_no_grating_wavelengths"
     ]
    },
    {
     "name": "ordinary endfire, N = 10, d = lambda/4, beta = -k d = -90 deg (Balanis sec. 6.3.3): beam on the axis, first null at cos(theta) = 1 - lambda/(N d) = 0.6 -> 53.1301 deg, FNBW twice that; HPBW = 2 acos(1 - psi_h/(k d)) with sin(5 psi_h)/(10 sin(psi_h/2)) = 1/sqrt 2; every lag term sin(2 l k d) vanishes so D = N = 10; closed forms, 1e-6",
     "checks": [
      "beam_angle_deg",
      "directivity",
      "first_null_high_deg",
      "fnbw_deg",
      "hpbw_deg"
     ]
    },
    {
     "name": "large-N asymptotes at N = 200, d = lambda/2: first sidelobe tends to the sinc value -13.2615 dB (tan x = x at x = 4.4934; the N = 200 value differs by x^2/(6 N^2) = 0.0007 dB, so abs_tol 0.002 dB) and HPBW tends to 0.8859 lambda/(N d) rad = 0.50758 deg (terms of order 1/N^2 dropped, so rel_tol 1e-4); D = N = 200 exactly",
     "checks": [
      "directivity",
      "first_sidelobe_db",
      "hpbw_deg",
      "null_count"
     ]
    },
    {
     "name": "Dolph-Chebyshev N = 10, 26 dB, d = lambda/2 (Dolph 1946): AF = T9(x0 cos(psi/2)), T9(x0) = R: every sidelobe at -26 dB, first nulls where x0 cos(psi/2) = cos(pi/18), half power where T9 = R/sqrt 2 -> cosh(acosh(R/sqrt 2)/9)/x0; closed forms, 1e-6",
     "checks": [
      "first_null_high_deg",
      "first_null_low_deg",
      "first_sidelobe_db",
      "hpbw_deg",
      "max_sidelobe_db",
      "null_count"
     ]
    },
    {
     "name": "Dolph-Chebyshev N = 3, 20 dB (R = 10): T2(x0 cos(psi/2)) = (x0^2 - 1) + x0^2 cos(psi) with x0^2 = (R + 1)/2, so centre/edge = 2 (R - 1)/(R + 1) = 18/11 and the sidelobe is -20 dB; closed forms, 1e-9 and 1e-6 dB",
     "checks": [
      "centre_over_edge",
      "max_sidelobe_db"
     ]
    },
    {
     "name": "Dolph-Chebyshev weights N = 8, 30 dB, d = lambda/2: T7(x0 z), z = cos(psi/2), x0 = cosh(acosh(10^1.5)/7), expanded as a polynomial in z and turned into harmonics with cos^p = 2^-p sum C(p, j) cos((p - 2j) psi/2) (algebra, not the program's Fourier sum): weights 0.26221649, 0.51874705, 0.81196007, 1 (largest = 1); half-wave broadside so D = (sum a)^2/sum a^2 = 6.7328972; first null where x0 z = cos(pi/14); half power where T7 = R/sqrt 2; closed forms, 1e-9 relative and 1e-6 deg or dB",
     "checks": [
      "directivity",
      "first_null_low_deg",
      "hpbw_deg",
      "max_sidelobe_db",
      "null_count",
      "weights.0",
      "weights.1",
      "weights.2",
      "weights.3",
      "weights.7"
     ]
    },
    {
     "name": "binomial N = 5, d = lambda/2 (Stone's array): AF = cos^4(psi/2), no sidelobe, nulls only on the axis, HPBW = 2 asin((2/pi) acos(2^(-1/8))) = 30.2826 deg, D = (sum a)^2/sum a^2 = 256/70; closed forms, 1e-6",
     "checks": [
      "centre_over_edge",
      "directivity",
      "hpbw_deg",
      "null_count",
      "sidelobe_count"
     ]
    },
    {
     "name": "grating lobe: N = 8, d = 0.7 lambda steered to 60 deg: beta = -360 (0.7)(0.5) = -126 deg; d exceeds 1/(1 + |cos 60|) = 2/3 lambda, so psi = -360 deg is visible at cos(theta) = 1/2 - 1/0.7 -> 158.2132 deg; closed forms, 1e-6",
     "checks": [
      "beam_angle_deg",
      "grating_lobe_angles_deg.0",
      "grating_lobe_count",
      "grating_lobe_free",
      "max_spacing_no_grating_wavelengths",
      "phase_deg"
     ]
    },
    {
     "name": "custom weights [1, 3, 3, 1], d = lambda/2: AF = cos^3(psi/2) (the N = 4 binomial array given by hand): nulls only on the axis, no sidelobe, D = (sum a)^2/sum a^2 = 64/20 = 3.2, HPBW =2 asin((2/pi) acos(2^(-1/6))) = 34.9334 deg; closed forms, 1e-6",
     "checks": [
      "directivity",
      "hpbw_deg",
      "n_elements",
      "null_count",
      "sidelobe_count"
     ]
    },
    {
     "name": "main beam outside visible space: 4 elements at a quarter wavelength with a 180 deg phase step; |beta| = 180 deg exceeds k d = 90 deg, so there is no full-strength peak and the verdict must fail (closed form: visible only when |beta| <= 360 deg * d/lambda)",
     "checks": [
      "main_beam_visible",
      "single_main_beam"
     ]
    }
   ],
   "title": "Linear antenna array",
   "needs_build": true,
   "category": "Waves, optics and circuits",
   "known_answers": 78
  },
  {
   "name": "arm",
   "version": "0.1.0",
   "summary": "A serial robot arm on a weighted base (yaw, pitch joints, roll wrist, gripper), sized by statics and rigid-body dynamics. Per joint: the torque needed in the worst pose (arm straight out, level, payload at the fingertips, plus inertia at the given angular acceleration) against what its drive gives (motor x usable fraction x ratio x efficiency, capped at the gearbox rating), and the margin. Per tube link: weight, cantilever sag, root stress. Whole arm: reach, mass, tip sag, tip-over margin, joint speeds, fingertip of the shown pose. Motor, gearbox and material figures are inputs (assumptions until replaced by datasheets). Files: parts.csv, joints.csv, shoulder_torque.csv, scene.glb (the arm in its pose, metres, one mesh per part, metal finishes).",
   "runtime": "native",
   "timeout_s": 120,
   "estimate_s": 2,
   "inputs": [
    {
     "name": "payload_kg",
     "type": "number",
     "unit": "kg",
     "default": 1.5,
     "enum": null,
     "description": "Held at the fingertips."
    },
    {
     "name": "accel_deg_s2",
     "type": "number",
     "unit": "deg/s^2",
     "default": 90,
     "enum": null,
     "description": "Peak angular acceleration of every joint, for the inertia torque."
    },
    {
     "name": "required_margin",
     "type": "number",
     "unit": "1",
     "default": 2.0,
     "enum": null,
     "description": "Torque and stress margin a joint or link must reach."
    },
    {
     "name": "pose_deg",
     "type": "array",
     "unit": "deg",
     "default": [
      -35,
      55,
      -80,
      -40,
      0
     ],
     "enum": null,
     "description": "Shown pose: yaw, then each pitch joint (relative, degrees from level for the first), then roll."
    },
    {
     "name": "payload_offset_m",
     "type": "number",
     "unit": "m",
     "default": 0.02,
     "enum": null,
     "description": "How far the payload's centre sits off the roll axis."
    },
    {
     "name": "payload_size_m",
     "type": "number",
     "unit": "m",
     "default": 0.06,
     "enum": null,
     "description": "Edge of the payload cube shown in the gripper."
    },
    {
     "name": "base",
     "type": "object",
     "unit": null,
     "default": {
      "height_m": 0.3,
      "radius_m": 0.22,
      "mass_kg": 30
     },
     "enum": null,
     "description": "height_m (shoulder axis height), radius_m, mass_kg."
    },
    {
     "name": "links",
     "type": "array",
     "unit": null,
     "default": [
      {
       "name": "upper arm",
       "length_m": 0.6,
       "od_m": 0.08,
       "wall_m": 0.004
      },
      {
       "name": "forearm",
       "length_m": 0.5,
       "od_m": 0.06,
       "wall_m": 0.003
      },
      {
       "name": "wrist",
       "length_m": 0.1,
       "od_m": 0.05,
       "wall_m": 0.003
      }
     ],
     "enum": null,
     "description": "Tubes from the shoulder out: name, length_m, od_m, wall_m (or mass_kg)."
    },
    {
     "name": "tool",
     "type": "object",
     "unit": null,
     "default": {
      "name": "two-finger gripper",
      "length_m": 0.16,
      "mass_kg": 0.65,
      "stroke_m": 0.08,
      "grip_force_N": 60,
      "radius_m": 0.04
     },
     "enum": null,
     "description": "Gripper: name, length_m, mass_kg, stroke_m, grip_force_N, radius_m."
    },
    {
     "name": "material",
     "type": "object",
     "unit": null,
     "default": {
      "name": "aluminium 6061-T6",
      "E_Pa": 68900000000.0,
      "density_kg_m3": 2700,
      "yield_Pa": 276000000.0
     },
     "enum": null,
     "description": "Tube material: name, E_Pa, density_kg_m3, yield_Pa."
    },
    {
     "name": "joints",
     "type": "array",
     "unit": null,
     "default": [
      {
       "key": "J1_base_yaw",
       "name": "J1 base yaw",
       "axis": "yaw",
       "motor": {
        "kind": "NEMA 23 stepper",
        "torque_Nm": 1.9,
        "usable_fraction": 0.6,
        "speed_rpm": 600,
        "mass_kg": 1.0,
        "frame_m": 0.057,
        "body_length_m": 0.076
       },
       "gearbox": {
        "kind": "planetary",
        "ratio": 20,
        "efficiency": 0.85,
        "rated_output_Nm": 40,
        "mass_kg": 0.9,
        "length_m": 0.06
       }
      },
      {
       "key": "J2_shoulder",
       "name": "J2 shoulder",
       "axis": "pitch",
       "motor": {
        "kind": "NEMA 34 stepper",
        "torque_Nm": 8.5,
        "usable_fraction": 0.6,
        "speed_rpm": 400,
        "mass_kg": 3.8,
        "frame_m": 0.086,
        "body_length_m": 0.118
       },
       "gearbox": {
        "kind": "cycloidal",
        "ratio": 50,
        "efficiency": 0.8,
        "rated_output_Nm": 200,
        "mass_kg": 3.2,
        "length_m": 0.075
       }
      },
      {
       "key": "J3_elbow",
       "name": "J3 elbow",
       "axis": "pitch",
       "motor": {
        "kind": "NEMA 23 stepper",
        "torque_Nm": 2.4,
        "usable_fraction": 0.6,
        "speed_rpm": 500,
        "mass_kg": 1.15,
        "frame_m": 0.057,
        "body_length_m": 0.1
       },
       "gearbox": {
        "kind": "planetary",
        "ratio": 30,
        "efficiency": 0.85,
        "rated_output_Nm": 60,
        "mass_kg": 1.0,
        "length_m": 0.06
       }
      },
      {
       "key": "J4_wrist_pitch",
       "name": "J4 wrist pitch",
       "axis": "pitch",
       "motor": {
        "kind": "NEMA 17 stepper",
        "torque_Nm": 0.59,
        "usable_fraction": 0.6,
        "speed_rpm": 500,
        "mass_kg": 0.5,
        "frame_m": 0.042,
        "body_length_m": 0.06
       },
       "gearbox": {
        "kind": "planetary",
        "ratio": 27,
        "efficiency": 0.85,
        "rated_output_Nm": 18,
        "mass_kg": 0.45,
        "length_m": 0.045
       }
      },
      {
       "key": "J5_wrist_roll",
       "name": "J5 wrist roll",
       "axis": "roll",
       "motor": {
        "kind": "NEMA 17 stepper",
        "torque_Nm": 0.45,
        "usable_fraction": 0.6,
        "speed_rpm": 600,
        "mass_kg": 0.35,
        "frame_m": 0.042,
        "body_length_m": 0.04
       },
       "gearbox": {
        "kind": "planetary",
        "ratio": 10,
        "efficiency": 0.9,
        "rated_output_Nm": 8,
        "mass_kg": 0.25,
        "length_m": 0.035
       }
      }
     ],
     "enum": null,
     "description": "key, name, axis (yaw | pitch | roll; one pitch joint per link, in order), motor {kind, torque_Nm, usable_fraction, speed_rpm, mass_kg, frame_m, body_length_m}, gearbox {kind, ratio, efficiency, rated_output_Nm, mass_kg, length_m}. Assumed figures."
    },
    {
     "name": "g",
     "type": "number",
     "unit": "m/s^2",
     "default": 9.80665,
     "enum": null,
     "description": null
    }
   ],
   "outputs": [
    {
     "name": "reach_m",
     "unit": "m",
     "description": null
    },
    {
     "name": "max_height_m",
     "unit": "m",
     "description": null
    },
    {
     "name": "total_mass_kg",
     "unit": "kg",
     "description": null
    },
    {
     "name": "moving_mass_kg",
     "unit": "kg",
     "description": null
    },
    {
     "name": "tip_sag_m",
     "unit": "m",
     "description": null
    },
    {
     "name": "tipover_margin",
     "unit": "1",
     "description": null
    },
    {
     "name": "min_torque_margin",
     "unit": "1",
     "description": null
    },
    {
     "name": "all_ok",
     "unit": null,
     "description": null
    },
    {
     "name": "joints",
     "unit": null,
     "description": "per joint: required_Nm, static_Nm, dynamic_Nm, available_Nm, margin, speed_deg_s, limited_by, ok"
    },
    {
     "name": "links",
     "unit": null,
     "description": "per link: tip_deflection_m, end_slope_rad, root_moment_Nm, root_stress_MPa, stress_margin, end_force_N, I_m4"
    },
    {
     "name": "parts",
     "unit": null,
     "description": null
    },
    {
     "name": "upper_arm_I_m4",
     "unit": "m^4",
     "description": null
    },
    {
     "name": "upper_arm_end_force_N",
     "unit": "N",
     "description": null
    },
    {
     "name": "upper_arm_length_m",
     "unit": "m",
     "description": null
    },
    {
     "name": "upper_arm_point_deflection_m",
     "unit": "m",
     "description": null
    },
    {
     "name": "E_Pa",
     "unit": "Pa",
     "description": null
    },
    {
     "name": "parts.csv",
     "unit": null,
     "description": null
    },
    {
     "name": "joints.csv",
     "unit": null,
     "description": null
    },
    {
     "name": "shoulder_torque.csv",
     "unit": null,
     "description": null
    },
    {
     "name": "scene.glb",
     "unit": null,
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "one level link of 2 kg, 1 m, 1 kg at its end: shoulder torque g(mL/2 + PL) = 19.6133 N m, reach 1 m",
     "checks": [
      "joints.J2.required_Nm",
      "reach_m"
     ]
    },
    {
     "name": "two 1 m links, shoulder up 90, elbow -90: fingertip at x = 1, y = 0.5 + 1; shoulder torque level g(1x0.5 + 1x1.5) = 19.6133 N m",
     "checks": [
      "fingertip_m.0",
      "fingertip_m.1",
      "fingertip_m.2",
      "joints.J2.required_Nm",
      "joints.J3.required_Nm"
     ]
    },
    {
     "name": "a 50 x 5 mm aluminium tube, 1 m, under its own weight: sag wL^4/8EI",
     "checks": [
      "links.tube.tip_deflection_m",
      "tip_sag_m"
     ]
    },
    {
     "name": "the default arm builds: at least 15 parts in the scene, reach 1.36 m",
     "checks": [
      "reach_m",
      "scene.meshes"
     ]
    }
   ],
   "title": "Robot arm",
   "needs_build": true,
   "category": "Dynamics and control",
   "known_answers": 11
  },
  {
   "name": "arrhenius_fit",
   "version": "0.1.0",
   "summary": "Arrhenius and Eyring analysis of rate constants measured at several temperatures: activation energy and pre-exponential factor, activation enthalpy, entropy and free energy, each with its least-squares standard error; the rate, half-life and shelf life predicted at another temperature for a reaction of order 0, 1 or 2; Q10. Unweighted straight lines of ln k and ln(k/T) against 1/T.",
   "runtime": "native",
   "timeout_s": 30,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "temperatures_K",
     "type": "array",
     "unit": "K",
     "default": null,
     "enum": null,
     "description": "Absolute temperatures of the measurements, kelvin (add 273.15 to degrees Celsius). At least two different ones; three or more for standard errors."
    },
    {
     "name": "rate_constants",
     "type": "array",
     "unit": "1/s",
     "default": null,
     "enum": null,
     "description": "One rate constant per temperature, above zero. First order: 1/s. Zero order: mol/(L s); second order: L/(mol s) (pass those with 'unchecked' when chaining)."
    },
    {
     "name": "predict_temperature_K",
     "type": "number",
     "unit": "K",
     "default": 298.15,
     "enum": null,
     "description": "Temperature at which the rate, the shelf life, Q10 (to this temperature plus 10 K) and the free energy of activation are reported."
    },
    {
     "name": "shelf_fraction_remaining",
     "type": "number",
     "unit": "1",
     "default": 0.9,
     "enum": null,
     "description": "Shelf life is the time until this fraction of the starting amount remains (0.9 is t90)."
    },
    {
     "name": "reaction_order",
     "type": "integer",
     "unit": "1",
     "default": 1,
     "enum": [
      0,
      1,
      2
     ],
     "description": "Order of the rate law used for half-life and shelf life: 0, 1 or 2 (one reactant)."
    },
    {
     "name": "initial_conc_mol_per_L",
     "type": "number",
     "unit": "mol/L",
     "default": 1.0,
     "enum": null,
     "description": "Starting concentration; it sets the times for orders 0 and 2 and does not matter for order 1."
    },
    {
     "name": "transmission_coefficient",
     "type": "number",
     "unit": "1",
     "default": 1.0,
     "enum": null,
     "description": "Kappa in the Eyring equation k = kappa (kB T/h) exp(-dG/RT)."
    },
    {
     "name": "r2_min",
     "type": "number",
     "unit": "1",
     "default": 0.98,
     "enum": null,
     "description": "The Arrhenius line is said to hold when R2 of ln k against 1/T is at least this."
    }
   ],
   "outputs": [
    {
     "name": "point_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "degrees_of_freedom",
     "unit": "1",
     "description": "points minus 2; standard errors are null when it is 0"
    },
    {
     "name": "lowest_temperature_K",
     "unit": "K",
     "description": null
    },
    {
     "name": "highest_temperature_K",
     "unit": "K",
     "description": null
    },
    {
     "name": "ea_kJ_per_mol",
     "unit": "kJ/mol",
     "description": "Arrhenius activation energy, -R times the slope of ln k against 1/T"
    },
    {
     "name": "ea_se_kJ_per_mol",
     "unit": "kJ/mol",
     "description": "its standard error"
    },
    {
     "name": "ln_a",
     "unit": "1",
     "description": "natural logarithm of the pre-exponential factor (in the unit of the rate constants)"
    },
    {
     "name": "ln_a_se",
     "unit": "1",
     "description": null
    },
    {
     "name": "log10_a",
     "unit": "1",
     "description": null
    },
    {
     "name": "prefactor_per_s",
     "unit": "1/s",
     "description": "pre-exponential factor A, in the unit of the rate constants (1/s for first order); null if it overflows"
    },
    {
     "name": "r2",
     "unit": "1",
     "description": "R2 of ln k against 1/T"
    },
    {
     "name": "residual_sd_ln_k",
     "unit": "1",
     "description": "standard deviation of the residuals in ln k; about the relative scatter of k"
    },
    {
     "name": "max_abs_residual_ln_k",
     "unit": "1",
     "description": null
    },
    {
     "name": "dh_kJ_per_mol",
     "unit": "kJ/mol",
     "description": "Eyring enthalpy of activation"
    },
    {
     "name": "dh_se_kJ_per_mol",
     "unit": "kJ/mol",
     "description": null
    },
    {
     "name": "ds_J_per_molK",
     "unit": "J/(mol K)",
     "description": "Eyring entropy of activation (rate constants in 1/s; standard state 1 mol/L for second order)"
    },
    {
     "name": "ds_se_J_per_molK",
     "unit": "J/(mol K)",
     "description": null
    },
    {
     "name": "dg_kJ_per_mol",
     "unit": "kJ/mol",
     "description": "Eyring free energy of activation at predict_temperature_K, dH - T dS"
    },
    {
     "name": "dg_se_kJ_per_mol",
     "unit": "kJ/mol",
     "description": "its standard error, from the Eyring line at that temperature (dH and dS are strongly correlated, so it is far smaller than their errors combined)"
    },
    {
     "name": "eyring_r2",
     "unit": "1",
     "description": "R2 of ln(k/T) against 1/T"
    },
    {
     "name": "predict_temperature_K",
     "unit": "K",
     "description": null
    },
    {
     "name": "k_pred_per_s",
     "unit": "1/s",
     "description": "rate constant on the Arrhenius line at predict_temperature_K, in the unit of the rate constants"
    },
    {
     "name": "k_pred_rel_se",
     "unit": "1",
     "description": "standard error of ln k there: the relative error of k, and of the half-life and shelf life"
    },
    {
     "name": "half_life_s",
     "unit": "s",
     "description": null
    },
    {
     "name": "shelf_life_s",
     "unit": "s",
     "description": "time until shelf_fraction_remaining is left, at predict_temperature_K"
    },
    {
     "name": "q10",
     "unit": "1",
     "description": "k(T + 10 K)/k(T) at T = predict_temperature_K, on the Arrhenius line"
    },
    {
     "name": "extrapolation_K",
     "unit": "K",
     "description": "how far predict_temperature_K lies outside the measured range (0 inside it)"
    },
    {
     "name": "fit_ok",
     "unit": null,
     "description": "true when R2 is at least r2_min"
    },
    {
     "name": "warnings",
     "unit": null,
     "description": "what to know before trusting the numbers"
    },
    {
     "name": "points",
     "unit": null,
     "description": "the first 200 points against the line"
    },
    {
     "name": "files",
     "unit": null,
     "description": "out/arrhenius_plot.csv (both linear plots, every point), out/prediction_curve.csv (rate, half-life and shelf life over temperature)"
    }
   ],
   "selftests": [
    {
     "name": "closed form: exact k = A exp(-Ea/RT) with Ea = 50 kJ/mol, A = 1e10 /s at 280-360 K gives both back, and k, t90 = ln(10/9)/k, t1/2 = ln2/k, Q10 = exp(Ea/R * 10/(T(T+10))) at 298.15 K (1e-9: round-off only)",
     "checks": [
      "ea_kJ_per_mol",
      "extrapolation_K",
      "fit_ok",
      "half_life_s",
      "k_pred_per_s",
      "ln_a",
      "prefactor_per_s",
      "q10",
      "r2",
      "shelf_life_s"
     ]
    },
    {
     "name": "closed form, two points: Ea = R ln(k2/k1)/(1/T1 - 1/T2) for k doubling from 298 K to 308 K; Q10 at 298 K is exactly 2; no standard error with two points (1e-9: round-off only)",
     "checks": [
      "degrees_of_freedom",
      "ea_kJ_per_mol",
      "ea_se_kJ_per_mol",
      "k_pred_per_s",
      "q10"
     ]
    },
    {
     "name": "textbook value: a rate that doubles from 298 K to 308 K has Ea = 52.89 kJ/mol (quoted to 4 figures with R = 8.314; 0.01 kJ/mol covers that rounding)",
     "checks": [
      "ea_kJ_per_mol"
     ]
    },
    {
     "name": "closed form: exact Eyring data k = (kB T/h) exp(dS/R) exp(-dH/RT) with dH = 80 kJ/mol, dS = -40 J/(mol K) gives both back, and dG(298.15 K) = dH - T dS = 91.926 kJ/mol (1e-9: round-off only)",
     "checks": [
      "dg_kJ_per_mol",
      "dh_kJ_per_mol",
      "ds_J_per_molK",
      "eyring_r2"
     ]
    },
    {
     "name": "closed form: Eyring k = (kB T/h) exp(-dG/RT), so k = 1 /s at 298.15 K means dG = R T ln(kB T/h) = 73.02 kJ/mol (1e-9: round-off only)",
     "checks": [
      "dg_kJ_per_mol",
      "k_pred_per_s"
     ]
    },
    {
     "name": "closed form: the same with a transmission coefficient of 0.5: dG = R T ln(kappa kB T/h) (1e-9: round-off only)",
     "checks": [
      "dg_kJ_per_mol"
     ]
    },
    {
     "name": "closed form for least-squares errors: three points equally spaced in 1/T with residuals (+e, -2e, +e) orthogonal to the line: se(Ea) = R sqrt(3) e/d, se(ln A) = sqrt(6) e sqrt(1/3 + xm^2/(2 d^2)), sd = sqrt(6) e, se(ln k) at the mean = sqrt(2) e (1e-7: the residuals are 1e-2 on logarithms of order 1, so round-off is magnified)",
     "checks": [
      "ea_kJ_per_mol",
      "ea_se_kJ_per_mol",
      "k_pred_rel_se",
      "ln_a",
      "ln_a_se",
      "max_abs_residual_ln_k",
      "r2",
      "residual_sd_ln_k"
     ]
    },
    {
     "name": "closed form for the Eyring errors: the same construction on ln(k/T): se(dH) = R sqrt(3) e/d, se(dS) = R sqrt(6) e sqrt(1/3 + xm^2/(2 d^2)), se(dG) at the mean = R T sqrt(2) e (1e-7, as above)",
     "checks": [
      "dg_kJ_per_mol",
      "dg_se_kJ_per_mol",
      "dh_kJ_per_mol",
      "dh_se_kJ_per_mol",
      "ds_J_per_molK",
      "ds_se_J_per_molK"
     ]
    },
    {
     "name": "closed form, zero order: t90 = 0.1 C0/k = 250000 s and t1/2 = C0/(2k) = 1.25e6 s for k = 2e-7 mol/(L s), C0 = 0.5 mol/L (1e-9)",
     "checks": [
      "half_life_s",
      "shelf_life_s"
     ]
    },
    {
     "name": "closed form, second order: t90 = (1/0.9 - 1)/(k C0) and t1/2 = 1/(k C0) = 1e7 s for k = 2e-7 L/(mol s), C0 = 0.5 mol/L (1e-9)",
     "checks": [
      "half_life_s",
      "shelf_life_s"
     ]
    },
    {
     "name": "closed form, first order with 80 % remaining: t80 = ln(1/0.8)/k and t1/2 = ln 2/k for k = 2e-7 /s, independent of C0 (1e-9)",
     "checks": [
      "half_life_s",
      "shelf_life_s"
     ]
    }
   ],
   "title": "Arrhenius and Eyring fit",
   "needs_build": true,
   "category": "Chemistry",
   "known_answers": 43
  },
  {
   "name": "backbone_build",
   "version": "0.1.0",
   "summary": "Builds a protein backbone (N, CA, C, O) from a sequence and phi, psi, omega with ideal bond lengths and angles (internal coordinates, NeRF placement). Writes a PDB, measures every bond, angle and dihedral back from the atoms, and reports end-to-end distance, radius of gyration and, for a regular chain, the exact helix screw: rise, residues per turn, handedness. Presets: alpha helix, 3-10 helix, beta strand, polyproline II, extended.",
   "runtime": "native",
   "timeout_s": 30,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "sequence",
     "type": "string",
     "unit": null,
     "default": "AEAAAKEAAAKEAAAKA",
     "enum": null,
     "description": "One-letter amino acid codes, 2 to 500 residues. Only the backbone is built; the letters name the residues in the PDB."
    },
    {
     "name": "preset",
     "type": "string",
     "unit": null,
     "default": "alpha_helix",
     "enum": [
      "alpha_helix",
      "helix_3_10",
      "beta_strand",
      "beta_parallel",
      "polyproline_ii",
      "extended",
      "custom"
     ],
     "description": "Textbook (phi, psi): alpha_helix (-57, -47), helix_3_10 (-49, -26), beta_strand antiparallel (-139, 135), beta_parallel (-119, 113), polyproline_ii (-75, 145), extended (180, 180). custom takes phi_deg and psi_deg."
    },
    {
     "name": "phi_deg",
     "type": "number",
     "unit": "deg",
     "default": null,
     "enum": null,
     "description": "phi = C(i-1)-N-CA-C, IUPAC sign; only with preset custom."
    },
    {
     "name": "psi_deg",
     "type": "number",
     "unit": "deg",
     "default": null,
     "enum": null,
     "description": "psi = N-CA-C-N(i+1); only with preset custom."
    },
    {
     "name": "omega_deg",
     "type": "number",
     "unit": "deg",
     "default": 180,
     "enum": null,
     "description": "omega = CA-C-N(i+1)-CA(i+1): 180 trans, 0 cis."
    },
    {
     "name": "phi_list_deg",
     "type": "array",
     "unit": "deg",
     "default": null,
     "enum": null,
     "description": "One phi per residue (the first is unused); overrides the preset."
    },
    {
     "name": "psi_list_deg",
     "type": "array",
     "unit": "deg",
     "default": null,
     "enum": null,
     "description": "One psi per residue (sets O of the last residue too); overrides the preset."
    },
    {
     "name": "omega_list_deg",
     "type": "array",
     "unit": "deg",
     "default": null,
     "enum": null,
     "description": "One omega per residue (the last is unused); overrides omega_deg."
    },
    {
     "name": "bond_n_ca_A",
     "type": "number",
     "unit": "\u00c5",
     "default": 1.458,
     "enum": null,
     "description": "Ideal N-CA bond length (Engh and Huber 1991)."
    },
    {
     "name": "bond_ca_c_A",
     "type": "number",
     "unit": "\u00c5",
     "default": 1.525,
     "enum": null,
     "description": "Ideal CA-C bond length."
    },
    {
     "name": "bond_c_n_A",
     "type": "number",
     "unit": "\u00c5",
     "default": 1.329,
     "enum": null,
     "description": "Ideal peptide C-N bond length."
    },
    {
     "name": "bond_c_o_A",
     "type": "number",
     "unit": "\u00c5",
     "default": 1.231,
     "enum": null,
     "description": "Ideal carbonyl C=O bond length."
    },
    {
     "name": "angle_n_ca_c_deg",
     "type": "number",
     "unit": "deg",
     "default": 111.0,
     "enum": null,
     "description": "Ideal N-CA-C angle (tau)."
    },
    {
     "name": "angle_ca_c_n_deg",
     "type": "number",
     "unit": "deg",
     "default": 116.2,
     "enum": null,
     "description": "Ideal CA-C-N angle."
    },
    {
     "name": "angle_c_n_ca_deg",
     "type": "number",
     "unit": "deg",
     "default": 121.7,
     "enum": null,
     "description": "Ideal C-N-CA angle."
    },
    {
     "name": "angle_ca_c_o_deg",
     "type": "number",
     "unit": "deg",
     "default": 120.8,
     "enum": null,
     "description": "Ideal CA-C=O angle; O lies in the peptide plane, so O-C-N = 360 - CA-C-N - CA-C-O."
    }
   ],
   "outputs": [
    {
     "name": "ok",
     "unit": null,
     "description": "geometry_ok and clash_free."
    },
    {
     "name": "geometry_ok",
     "unit": null,
     "description": "Every bond, angle and dihedral measured back from the atoms is within 1e-6 of the request."
    },
    {
     "name": "clash_free",
     "unit": null,
     "description": "No two atoms of residues two or more apart closer than 2.2 \u00c5 (a gross steric clash)."
    },
    {
     "name": "n_residues",
     "unit": "1",
     "description": null
    },
    {
     "name": "n_atoms",
     "unit": "1",
     "description": null
    },
    {
     "name": "rise_A",
     "unit": "\u00c5",
     "description": "Shift along the helix axis per residue (exact screw of one residue onto the next); null when phi, psi, omega vary."
    },
    {
     "name": "residues_per_turn",
     "unit": "1",
     "description": null
    },
    {
     "name": "rotation_per_residue_deg",
     "unit": "deg",
     "description": "Signed: positive right-handed."
    },
    {
     "name": "pitch_A",
     "unit": "\u00c5",
     "description": null
    },
    {
     "name": "radius_ca_A",
     "unit": "\u00c5",
     "description": "Distance of CA from the helix axis."
    },
    {
     "name": "end_to_end_A",
     "unit": "\u00c5",
     "description": "CA(1) to CA(n)."
    },
    {
     "name": "end_to_end_n_c_A",
     "unit": "\u00c5",
     "description": "N(1) to C(n)."
    },
    {
     "name": "contour_ca_A",
     "unit": "\u00c5",
     "description": "Sum of consecutive CA-CA distances."
    },
    {
     "name": "rg_ca_A",
     "unit": "\u00c5",
     "description": null
    },
    {
     "name": "rg_backbone_A",
     "unit": "\u00c5",
     "description": "Radius of gyration of N, CA, C, O, unweighted."
    },
    {
     "name": "o_n_i3_A",
     "unit": "\u00c5",
     "description": "Mean O(i) to N(i+3): 3-10 helix hydrogen-bond distance."
    },
    {
     "name": "o_n_i4_A",
     "unit": "\u00c5",
     "description": "Mean O(i) to N(i+4): alpha helix hydrogen-bond distance."
    },
    {
     "name": "min_nonbonded_A",
     "unit": "\u00c5",
     "description": "Closest atoms of residues two or more apart."
    },
    {
     "name": "max_dihedral_error_deg",
     "unit": "deg",
     "description": null
    },
    {
     "name": "max_bond_error_A",
     "unit": "\u00c5",
     "description": null
    },
    {
     "name": "max_angle_error_deg",
     "unit": "deg",
     "description": null
    },
    {
     "name": "ca_ca_A",
     "unit": null,
     "description": "Shortest and longest consecutive CA-CA distance."
    },
    {
     "name": "bond_lengths_A",
     "unit": null,
     "description": "min and max of each bond measured from the atoms: n_ca, ca_c, c_n, c_o."
    },
    {
     "name": "bond_angles_deg",
     "unit": null,
     "description": "min and max of each bond angle measured from the atoms: n_ca_c, ca_c_n, c_n_ca, ca_c_o, o_c_n."
    },
    {
     "name": "built",
     "unit": null,
     "description": "phi_deg, psi_deg, omega_deg per residue, measured from the atoms (null where undefined)."
    },
    {
     "name": "handedness",
     "unit": null,
     "description": "right, left or none (a 2-fold screw or a straight chain); null when the chain is not regular."
    },
    {
     "name": "regular",
     "unit": null,
     "description": "phi, psi and omega are the same along the chain."
    },
    {
     "name": "warnings",
     "unit": null,
     "description": null
    },
    {
     "name": "files",
     "unit": null,
     "description": "out/backbone.pdb (centred), out/residues.csv, out/atoms.csv, out/scene.glb"
    }
   ],
   "selftests": [
    {
     "name": "CA-CA = 3.803955 A for trans omega whatever phi and psi: 1-4 distance law d^2 = l1^2+l2^2+l3^2-2l1l2cos(a1)-2l2l3cos(a2)+2l1l3(cos(a1)cos(a2)-sin(a1)sin(a2)cos(omega)), omega=180 (rel 1e-9, double precision); O-C-N = 360-116.2-120.8 = 123 deg (planar sp2 carbon)",
     "checks": [
      "bond_angles_deg.o_c_n.max",
      "bond_angles_deg.o_c_n.min",
      "ca_ca_A.max",
      "ca_ca_A.min"
     ]
    },
    {
     "name": "dihedrals measured back from the atoms equal the inputs, bond lengths and angles equal the ideal values (exact: error 0, bound 1e-9 for rounding over 12 residues), with a cis omega in the chain",
     "checks": [
      "built.omega_deg.3",
      "built.phi_deg.4",
      "max_angle_error_deg",
      "max_bond_error_A",
      "max_dihedral_error_deg"
     ]
    },
    {
     "name": "alpha helix (-57, -47): textbook (Pauling; Branden & Tooze) 3.6 residues per turn, 1.5 A rise, right-handed. Tolerance 0.05 / 0.06: the textbook figures are two-figure roundings for slightly different bond geometry; the exact screw for this geometry is the next case",
     "checks": [
      "handedness",
      "residues_per_turn",
      "rise_A"
     ]
    },
    {
     "name": "alpha helix (-57, -47) exact screw: Denavit-Hartenberg product of the residue's three bond transforms, Chasles axis (cos theta = (tr R - 1)/2, rise = axis . translation), computed apart from the instrument: 99.472976 deg, 3.619073 residues per turn, 1.551353 A (rel 1e-9)",
     "checks": [
      "pitch_A",
      "residues_per_turn",
      "rise_A",
      "rotation_per_residue_deg"
     ]
    },
    {
     "name": "polyproline II (-75, 145) exact screw (Denavit-Hartenberg product, as above): left-handed, -120.305257 deg, 2.992388 residues per turn, 3.078790 A rise (rel 1e-9); textbook PPII is left-handed, 3.0 residues per turn, 3.1 A",
     "checks": [
      "handedness",
      "residues_per_turn",
      "rise_A",
      "rotation_per_residue_deg"
     ]
    },
    {
     "name": "fully extended (180, 180, 180): planar zigzag by 2D turtle geometry, a 2-fold screw: rise = CA(i)-CA(i+2)/2 = 3.642566 A, 2 residues per turn, CA1-CA10 = 32.801422 A, Rg(CA) = 10.476824 A (rel 1e-9)",
     "checks": [
      "end_to_end_A",
      "residues_per_turn",
      "rg_ca_A",
      "rise_A"
     ]
    },
    {
     "name": "cis peptide (omega = 0): CA-CA = 2.771384 A by the 1-4 distance law with omega = 0 (rel 1e-9); two residues: Rg(CA) = CA-CA / 2",
     "checks": [
      "ca_ca_A.min",
      "end_to_end_A",
      "rg_ca_A"
     ]
    }
   ],
   "title": "Protein backbone build",
   "needs_build": true,
   "category": "Structural biology",
   "known_answers": 27
  },
  {
   "name": "battery_ecm",
   "version": "0.1.0",
   "summary": "Battery cell equivalent-circuit (Thevenin) model: open-circuit voltage against state of charge given as points, series resistance R0 and up to two RC pairs, capacity. Over a constant, pulse, csv or discharge-charge round-trip current profile it gives terminal voltage, state of charge, heat and energy, time to a voltage cut-off and round-trip efficiency, for one cell or an n_series x n_parallel pack. Solved exactly piecewise (no numerical integration); trace in out/trace.csv.",
   "runtime": "native",
   "timeout_s": 30,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "ocv_soc",
     "type": "array",
     "unit": "1",
     "default": [
      0,
      1
     ],
     "enum": null,
     "description": "State-of-charge points of the open-circuit-voltage curve, rising strictly from 0 to 1. The curve is straight between points."
    },
    {
     "name": "ocv_V",
     "type": "array",
     "unit": "V",
     "default": [
      3.0,
      4.2
     ],
     "enum": null,
     "description": "Open-circuit voltage of one cell at each ocv_soc point (taken from the cell's own measured curve)."
    },
    {
     "name": "capacity_Ah",
     "type": "number",
     "unit": "A h",
     "default": 3.0,
     "enum": null,
     "description": "Capacity of one cell."
    },
    {
     "name": "r0_ohm",
     "type": "number",
     "unit": "ohm",
     "default": 0.0,
     "enum": null,
     "description": "Series (instant) resistance of one cell."
    },
    {
     "name": "r1_ohm",
     "type": "number",
     "unit": "ohm",
     "default": 0.0,
     "enum": null,
     "description": "First RC pair resistance; 0 leaves the pair out."
    },
    {
     "name": "c1_F",
     "type": "number",
     "unit": "F",
     "default": 0.0,
     "enum": null,
     "description": "First RC pair capacitance; 0 leaves the pair out."
    },
    {
     "name": "r2_ohm",
     "type": "number",
     "unit": "ohm",
     "default": 0.0,
     "enum": null,
     "description": "Second RC pair resistance; 0 leaves the pair out."
    },
    {
     "name": "c2_F",
     "type": "number",
     "unit": "F",
     "default": 0.0,
     "enum": null,
     "description": "Second RC pair capacitance; 0 leaves the pair out."
    },
    {
     "name": "soc0",
     "type": "number",
     "unit": "1",
     "default": 1.0,
     "enum": null,
     "description": "Starting state of charge (fraction). RC voltages start at 0 (cell at rest)."
    },
    {
     "name": "profile",
     "type": "string",
     "unit": null,
     "default": "constant",
     "enum": [
      "constant",
      "pulse",
      "csv",
      "round_trip"
     ],
     "description": "constant: current_A for duration_s (or until empty / cut-off). pulse: pulse_count pulses of current_A for pulse_on_s, each followed by rest_s at zero current. csv: rows time_s,current_A, each held until the next row. round_trip: discharge at current_A to empty or v_min_V (or for duration_s), rest_s, charge at charge_current_A back to soc0, rest_s."
    },
    {
     "name": "current_A",
     "type": "number",
     "unit": "A",
     "default": 1.0,
     "enum": null,
     "description": "Pack current, positive on discharge; each cell carries current_A / n_parallel."
    },
    {
     "name": "duration_s",
     "type": "number",
     "unit": "s",
     "default": null,
     "enum": null,
     "description": "Length of a constant profile, or of the discharge of a round trip. Left out: until the cell is empty, full or at a cut-off."
    },
    {
     "name": "pulse_on_s",
     "type": "number",
     "unit": "s",
     "default": 10.0,
     "enum": null,
     "description": "Length of each pulse (profile pulse)."
    },
    {
     "name": "pulse_count",
     "type": "integer",
     "unit": "1",
     "default": 1,
     "enum": null,
     "description": "Number of pulses (profile pulse)."
    },
    {
     "name": "rest_s",
     "type": "number",
     "unit": "s",
     "default": 0.0,
     "enum": null,
     "description": "Rest at zero current after each pulse, or after each half of a round trip."
    },
    {
     "name": "charge_current_A",
     "type": "number",
     "unit": "A",
     "default": null,
     "enum": null,
     "description": "Pack charge current of a round trip (magnitude). Left out: the same as current_A."
    },
    {
     "name": "profile_csv",
     "type": "string",
     "unit": null,
     "default": "",
     "enum": null,
     "description": "Current profile for profile csv: lines time_s,current_A (pack current, positive on discharge); a header line is allowed; the last row marks the end."
    },
    {
     "name": "profile_file",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "The same profile as a csv file (time_s,current_A)."
    },
    {
     "name": "v_min_V",
     "type": "number",
     "unit": "V",
     "default": null,
     "enum": null,
     "description": "Discharge cut-off, per cell. The run stops (a round trip turns to charge) where the terminal voltage first reaches it."
    },
    {
     "name": "v_max_V",
     "type": "number",
     "unit": "V",
     "default": null,
     "enum": null,
     "description": "Charge cut-off, per cell."
    },
    {
     "name": "n_series",
     "type": "integer",
     "unit": "1",
     "default": 1,
     "enum": null,
     "description": "Cells in series (identical cells, no balancing, no wiring resistance)."
    },
    {
     "name": "n_parallel",
     "type": "integer",
     "unit": "1",
     "default": 1,
     "enum": null,
     "description": "Cells in parallel."
    },
    {
     "name": "dt_s",
     "type": "number",
     "unit": "s",
     "default": null,
     "enum": null,
     "description": "Spacing of the trace in out/trace.csv. Left out: about 2000 rows. The model is exact at any spacing."
    }
   ],
   "outputs": [
    {
     "name": "profile",
     "unit": null,
     "description": null
    },
    {
     "name": "completed",
     "unit": null,
     "description": "true when the profile ran to its end (or an open-ended constant run reached its natural end)."
    },
    {
     "name": "stop_reason",
     "unit": null,
     "description": "profile_end, empty, full, cutoff_low, cutoff_high."
    },
    {
     "name": "runtime_s",
     "unit": "s",
     "description": null
    },
    {
     "name": "runtime_h",
     "unit": "h",
     "description": null
    },
    {
     "name": "time_to_cutoff_s",
     "unit": "s",
     "description": "First time the terminal voltage reached v_min_V (discharge) or v_max_V (charge); null if never."
    },
    {
     "name": "soc_start",
     "unit": "1",
     "description": null
    },
    {
     "name": "soc_end",
     "unit": "1",
     "description": null
    },
    {
     "name": "soc_min",
     "unit": "1",
     "description": null
    },
    {
     "name": "ocv_start_V",
     "unit": "V",
     "description": null
    },
    {
     "name": "ocv_end_V",
     "unit": "V",
     "description": null
    },
    {
     "name": "instant_drop_V",
     "unit": "V",
     "description": "Cell voltage step when the first current is applied from rest: I R0."
    },
    {
     "name": "cell_voltage_end_V",
     "unit": "V",
     "description": "Cell terminal voltage at the end, under the last current applied."
    },
    {
     "name": "cell_voltage_min_V",
     "unit": "V",
     "description": null
    },
    {
     "name": "cell_voltage_max_V",
     "unit": "V",
     "description": null
    },
    {
     "name": "pack_voltage_start_V",
     "unit": "V",
     "description": "Open-circuit pack voltage at the start."
    },
    {
     "name": "pack_voltage_end_V",
     "unit": "V",
     "description": null
    },
    {
     "name": "pack_voltage_min_V",
     "unit": "V",
     "description": null
    },
    {
     "name": "pack_voltage_max_V",
     "unit": "V",
     "description": null
    },
    {
     "name": "cell_current_peak_A",
     "unit": "A",
     "description": null
    },
    {
     "name": "tau1_s",
     "unit": "s",
     "description": null
    },
    {
     "name": "tau2_s",
     "unit": "s",
     "description": null
    },
    {
     "name": "rc1_voltage_end_V",
     "unit": "V",
     "description": null
    },
    {
     "name": "rc2_voltage_end_V",
     "unit": "V",
     "description": null
    },
    {
     "name": "final_rest_s",
     "unit": "s",
     "description": null
    },
    {
     "name": "rc1_voltage_rest_start_V",
     "unit": "V",
     "description": "First RC voltage when the final rest began."
    },
    {
     "name": "rc1_rest_fraction",
     "unit": "1",
     "description": "First RC voltage at the end over its value at the start of the final rest: exp(-rest/tau1)."
    },
    {
     "name": "rc2_rest_fraction",
     "unit": "1",
     "description": null
    },
    {
     "name": "charge_out_Ah",
     "unit": "A h",
     "description": null
    },
    {
     "name": "charge_in_Ah",
     "unit": "A h",
     "description": null
    },
    {
     "name": "energy_discharged_Wh",
     "unit": "W h",
     "description": null
    },
    {
     "name": "energy_charged_Wh",
     "unit": "W h",
     "description": null
    },
    {
     "name": "energy_delivered_Wh",
     "unit": "W h",
     "description": "Net energy out of the pack terminals (discharged minus charged)."
    },
    {
     "name": "energy_chemical_Wh",
     "unit": "W h",
     "description": "Net energy drawn from the open-circuit source: delivered + heat + energy still stored in the RC capacitors."
    },
    {
     "name": "heat_Wh",
     "unit": "W h",
     "description": null
    },
    {
     "name": "heat_J",
     "unit": "J",
     "description": null
    },
    {
     "name": "heat_r0_J",
     "unit": "J",
     "description": null
    },
    {
     "name": "heat_rc_J",
     "unit": "J",
     "description": null
    },
    {
     "name": "rc_stored_J",
     "unit": "J",
     "description": null
    },
    {
     "name": "energy_balance_residual_J",
     "unit": "J",
     "description": "chemical - delivered - heat - stored: zero up to rounding."
    },
    {
     "name": "heat_mean_W",
     "unit": "W",
     "description": null
    },
    {
     "name": "heat_peak_W",
     "unit": "W",
     "description": null
    },
    {
     "name": "round_trip_efficiency",
     "unit": "1",
     "description": "Energy discharged over energy charged, when the round trip returned to its starting state of charge."
    },
    {
     "name": "n_cells",
     "unit": "1",
     "description": null
    },
    {
     "name": "pack_capacity_Ah",
     "unit": "A h",
     "description": null
    },
    {
     "name": "pack_energy_full_Wh",
     "unit": "W h",
     "description": "Open-circuit energy from full to empty: capacity times the integral of OCV over state of charge."
    },
    {
     "name": "pack_r0_ohm",
     "unit": "ohm",
     "description": null
    },
    {
     "name": "pack_dc_resistance_ohm",
     "unit": "ohm",
     "description": "(R0 + R1 + R2) n_series / n_parallel."
    },
    {
     "name": "trace_rows",
     "unit": "1",
     "description": null
    },
    {
     "name": "steps",
     "unit": "1",
     "description": null
    },
    {
     "name": "warnings",
     "unit": null,
     "description": null
    },
    {
     "name": "files",
     "unit": null,
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "constant current from full, no cut-off (Coulomb counting closed form): runtime = Q/I = 3 Ah / 1.5 A = 7200 s; instant drop I R0 = 0.075 V; linear OCV 3.0-4.2 V gives chemical energy Q x mean OCV = 10.8 Wh, heat I^2 R0 t = 810 J, delivered 10.575 Wh (rel 1e-9, exact piecewise solution)",
     "checks": [
      "cell_voltage_end_V",
      "energy_chemical_Wh",
      "energy_delivered_Wh",
      "heat_J",
      "instant_drop_V",
      "runtime_s",
      "stop_reason"
     ]
    },
    {
     "name": "time to cut-off, closed form for linear OCV and R0 only: 4.2 - 1.2 I t/Q - I R0 = 3.3 V gives t = 0.825 x 10800 / 1.8 = 4950 s, soc_end = 0.3125 (rel 1e-9; cut-off found by bisection to machine precision)",
     "checks": [
      "cell_voltage_end_V",
      "soc_end",
      "stop_reason",
      "time_to_cutoff_s"
     ]
    },
    {
     "name": "RC relaxation after a pulse (first-order RC closed form): 2 A for 400 s into R1 = 0.02 ohm, C1 = 1000 F (tau 20 s) charges v1 to I R1 (1 - e^-20) = 0.0399999999175 V; after one time constant of rest v1/v1(0) = e^-1 = 0.367879 (36.79 %), terminal = 3.7 - v1 e^-1 = 3.6852848224 V (rel 1e-9)",
     "checks": [
      "cell_voltage_end_V",
      "instant_drop_V",
      "rc1_rest_fraction",
      "rc1_voltage_rest_start_V",
      "runtime_s",
      "tau1_s"
     ]
    },
    {
     "name": "energy balance with an RC pair (closed-form integrals): flat OCV 3.7 V, 2 A for 100 s, R0 0.05, R1 0.02, C1 1000 F: heat = I^2 R0 T + I^2 R1 [T - 2 tau (1-e^-5) + tau/2 (1-e^-10)] = 25.6215251 J, stored C v^2/2 = 0.7892556 J, delivered = 740 J - heat - stored = 713.5892193 J = 0.1982192276 Wh, min voltage 3.7 - 0.1 - 0.04 (1-e^-5) (rel 1e-9)",
     "checks": [
      "cell_voltage_min_V",
      "energy_balance_residual_J",
      "energy_chemical_Wh",
      "energy_delivered_Wh",
      "heat_J",
      "rc_stored_J"
     ]
    },
    {
     "name": "zero current (definition of open-circuit voltage): terminal voltage = OCV at soc0 = 0.37 on the line 3.0 + 1.2 soc through three points = 3.444 V, no heat, soc unchanged (rel 1e-12)",
     "checks": [
      "cell_voltage_end_V",
      "heat_J",
      "ocv_end_V",
      "soc_end"
     ]
    },
    {
     "name": "round-trip efficiency, closed form for flat OCV and R0 only: (U - I R0)/(U + I R0) = 3.625/3.775 = 0.96026490066; discharged Q(U - I R0) = 10.875 Wh, charged Q(U + I R0) = 11.325 Wh (rel 1e-9)",
     "checks": [
      "energy_charged_Wh",
      "energy_discharged_Wh",
      "round_trip_efficiency",
      "soc_end"
     ]
    },
    {
     "name": "pack scaling (Kirchhoff): 3 series x 2 parallel at 3 A pack current = 1.5 A per cell: runtime Q/I = 7200 s, start voltage 3 x 4.2 = 12.6 V, end voltage 3 x 2.925 = 8.775 V, delivered 6 x 10.575 = 63.45 Wh, pack R0 = 0.05 x 3/2 = 0.075 ohm (rel 1e-9)",
     "checks": [
      "energy_delivered_Wh",
      "pack_capacity_Ah",
      "pack_r0_ohm",
      "pack_voltage_end_V",
      "pack_voltage_start_V",
      "runtime_s"
     ]
    }
   ],
   "title": "Battery equivalent-circuit run",
   "needs_build": true,
   "category": "Electrochemistry and batteries",
   "known_answers": 37
  },
  {
   "name": "beam",
   "version": "0.1.0",
   "summary": "Euler-Bernoulli beam, finite elements with cubic Hermite shape functions. Cantilever or simply supported, under a point load or a uniform load. Readings: maximum deflection and maximum bending moment; file deflection.csv (x, deflection).",
   "runtime": "native",
   "timeout_s": 60,
   "estimate_s": 1,
   "inputs": [
    {
     "name": "support",
     "type": "string",
     "unit": null,
     "default": "cantilever",
     "enum": [
      "cantilever",
      "simply_supported"
     ],
     "description": "cantilever: fixed at x=0. simply_supported: pinned at both ends."
    },
    {
     "name": "load",
     "type": "string",
     "unit": null,
     "default": "point_end",
     "enum": [
      "point_end",
      "point_mid",
      "udl"
     ],
     "description": "point_end: P at the free end (cantilever only). point_mid: P at mid-span. udl: w along the whole beam."
    },
    {
     "name": "length",
     "type": "number",
     "unit": "m",
     "default": 2.0,
     "enum": null,
     "description": null
    },
    {
     "name": "E",
     "type": "number",
     "unit": "Pa",
     "default": 200000000000.0,
     "enum": null,
     "description": "Young's modulus."
    },
    {
     "name": "I",
     "type": "number",
     "unit": "m^4",
     "default": 8e-06,
     "enum": null,
     "description": "Second moment of area."
    },
    {
     "name": "P",
     "type": "number",
     "unit": "N",
     "default": 1000.0,
     "enum": null,
     "description": "Point load."
    },
    {
     "name": "w",
     "type": "number",
     "unit": "N/m",
     "default": 500.0,
     "enum": null,
     "description": "Uniform load."
    },
    {
     "name": "elements",
     "type": "integer",
     "unit": null,
     "default": 40,
     "enum": null,
     "description": null
    }
   ],
   "outputs": [
    {
     "name": "max_deflection",
     "unit": "m",
     "description": null
    },
    {
     "name": "max_moment",
     "unit": "N m",
     "description": null
    },
    {
     "name": "deflection.csv",
     "unit": null,
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "cantilever, end load: PL^3/3EI and PL",
     "checks": [
      "max_deflection",
      "max_moment"
     ]
    },
    {
     "name": "cantilever, uniform load: wL^4/8EI and wL^2/2",
     "checks": [
      "max_deflection",
      "max_moment"
     ]
    },
    {
     "name": "simply supported, mid load: PL^3/48EI and PL/4",
     "checks": [
      "max_deflection",
      "max_moment"
     ]
    },
    {
     "name": "simply supported, uniform load: 5wL^4/384EI and wL^2/8",
     "checks": [
      "max_deflection",
      "max_moment"
     ]
    }
   ],
   "title": "Beam",
   "needs_build": true,
   "category": "Mechanics, CAD and finite elements",
   "known_answers": 8
  },
  {
   "name": "bode_margins",
   "version": "0.1.0",
   "summary": "Frequency response of an open loop L(s) = gain * num(s)/den(s) * exp(-s T) on a log sweep: gain and phase margins with their crossover frequencies, delay margin, -3 dB bandwidth and resonant peak of L, unity-feedback closed-loop and sensitivity peaks, closed-loop stability by Routh (and delay margin when T > 0); bode.csv and crossovers.csv.",
   "runtime": "native",
   "timeout_s": 30,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "num",
     "type": "array",
     "unit": null,
     "default": [
      1
     ],
     "enum": null,
     "description": "Numerator coefficients, highest power of s first: [1, 2] is s + 2. Up to degree 30."
    },
    {
     "name": "den",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Denominator coefficients, highest power of s first: [1, 3, 2, 0] is s^3 + 3 s^2 + 2 s. Up to degree 30."
    },
    {
     "name": "gain",
     "type": "number",
     "unit": "1",
     "default": 1.0,
     "enum": null,
     "description": "Loop gain K multiplying num/den; any finite non-zero number (negative flips the sign)."
    },
    {
     "name": "dead_time_s",
     "type": "number",
     "unit": "s",
     "default": 0.0,
     "enum": null,
     "description": "Pure dead time T: the loop is multiplied by exp(-s T)."
    },
    {
     "name": "w_min_rad_s",
     "type": "number",
     "unit": "rad/s",
     "default": 0.001,
     "enum": null,
     "description": "Lowest sweep frequency."
    },
    {
     "name": "w_max_rad_s",
     "type": "number",
     "unit": "rad/s",
     "default": 1000.0,
     "enum": null,
     "description": "Highest sweep frequency (above w_min_rad_s)."
    },
    {
     "name": "points_per_decade",
     "type": "number",
     "unit": "1",
     "default": 100,
     "enum": null,
     "description": "Base sweep density; the sweep is refined further wherever the phase turns fast."
    },
    {
     "name": "eval_w_rad_s",
     "type": "number",
     "unit": "rad/s",
     "default": null,
     "enum": null,
     "description": "Optional: one frequency (inside the sweep) at which to report gain and phase of L."
    }
   ],
   "outputs": [
    {
     "name": "gain_margin",
     "unit": "1",
     "description": null
    },
    {
     "name": "gain_margin_dB",
     "unit": null,
     "description": "Decibels (20 log10 of the ratio); dB is not in the kernel's unit table, so no unit is declared."
    },
    {
     "name": "phase_crossover_rad_s",
     "unit": "rad/s",
     "description": null
    },
    {
     "name": "phase_margin_deg",
     "unit": "deg",
     "description": null
    },
    {
     "name": "gain_crossover_rad_s",
     "unit": "rad/s",
     "description": null
    },
    {
     "name": "delay_margin_s",
     "unit": "s",
     "description": null
    },
    {
     "name": "closed_loop_stable",
     "unit": null,
     "description": "true/false, or null when not decided (see stability_basis)."
    },
    {
     "name": "stability_basis",
     "unit": null,
     "description": "How closed_loop_stable was decided."
    },
    {
     "name": "closed_loop_rhp_poles_no_dead_time",
     "unit": "1",
     "description": null
    },
    {
     "name": "open_loop_rhp_poles",
     "unit": "1",
     "description": null
    },
    {
     "name": "dc_gain",
     "unit": "1",
     "description": null
    },
    {
     "name": "dc_gain_dB",
     "unit": null,
     "description": "Decibels (20 log10 of the ratio); dB is not in the kernel's unit table, so no unit is declared."
    },
    {
     "name": "bandwidth_rad_s",
     "unit": "rad/s",
     "description": "First frequency where |L| falls 3.0103 dB below its DC gain."
    },
    {
     "name": "peak_gain",
     "unit": "1",
     "description": null
    },
    {
     "name": "peak_gain_dB",
     "unit": null,
     "description": "Decibels (20 log10 of the ratio); dB is not in the kernel's unit table, so no unit is declared."
    },
    {
     "name": "resonant_peak",
     "unit": "1",
     "description": "Largest |L| inside the sweep divided by |L(0)|, when above 1."
    },
    {
     "name": "resonant_peak_dB",
     "unit": null,
     "description": "Decibels (20 log10 of the ratio); dB is not in the kernel's unit table, so no unit is declared."
    },
    {
     "name": "resonant_rad_s",
     "unit": "rad/s",
     "description": null
    },
    {
     "name": "closed_loop_peak",
     "unit": "1",
     "description": "Largest |L/(1+L)| in the sweep."
    },
    {
     "name": "closed_loop_peak_rad_s",
     "unit": "rad/s",
     "description": null
    },
    {
     "name": "closed_loop_bandwidth_rad_s",
     "unit": "rad/s",
     "description": null
    },
    {
     "name": "sensitivity_peak",
     "unit": "1",
     "description": "Largest |1/(1+L)| in the sweep (Ms)."
    },
    {
     "name": "sensitivity_peak_rad_s",
     "unit": "rad/s",
     "description": null
    },
    {
     "name": "gain_at_w",
     "unit": "1",
     "description": null
    },
    {
     "name": "gain_at_w_dB",
     "unit": null,
     "description": "Decibels (20 log10 of the ratio); dB is not in the kernel's unit table, so no unit is declared."
    },
    {
     "name": "phase_at_w_deg",
     "unit": "deg",
     "description": null
    },
    {
     "name": "gain_crossover_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "phase_crossover_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "sweep_points",
     "unit": "1",
     "description": null
    },
    {
     "name": "warnings",
     "unit": null,
     "description": "Caveats in words: crossovers outside the sweep, open-loop right-half-plane poles, undecided stability."
    },
    {
     "name": "crossovers",
     "unit": null,
     "description": null
    },
    {
     "name": "bode.csv",
     "unit": null,
     "description": null
    },
    {
     "name": "crossovers.csv",
     "unit": null,
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "textbook K/(s(s+1)(s+2)), K=1: phase crossover at sqrt(2) rad/s, gain margin 6/K = 6 = 20 log10 6 = 15.563025 dB (closed form, rel 1e-6)",
     "checks": [
      "closed_loop_stable",
      "gain_margin",
      "gain_margin_dB",
      "phase_crossover_rad_s"
     ]
    },
    {
     "name": "Routh limit of K/(s(s+1)(s+2)) is K = 6: at K=10 the closed loop is unstable and the gain margin is 6/K = 0.6 (closed form, rel 1e-6)",
     "checks": [
      "closed_loop_stable",
      "gain_margin",
      "phase_crossover_rad_s"
     ]
    },
    {
     "name": "first-order lag 1/(s+1) at its corner w = 1: -10 log10 2 = -3.0103 dB and -45 deg; -3 dB bandwidth = 1 rad/s (closed form, rel 1e-6)",
     "checks": [
      "bandwidth_rad_s",
      "gain_at_w_dB",
      "phase_at_w_deg"
     ]
    },
    {
     "name": "integrator 1/s: |L| = 1 at w = 1 rad/s, phase margin 90 deg, delay margin pi/2 s, no phase crossover (closed form, rel 1e-6)",
     "checks": [
      "delay_margin_s",
      "gain_crossover_rad_s",
      "phase_crossover_count",
      "phase_margin_deg"
     ]
    },
    {
     "name": "integrator with dead time T = 0.5 s: phase margin 90 deg - T rad = 61.352110 deg at w = 1; phase crossover at pi/(2T) = pi rad/s with gain margin pi/(2T) = pi; delay margin pi/2 - T (closed form, rel 1e-6)",
     "checks": [
      "closed_loop_stable",
      "delay_margin_s",
      "gain_crossover_rad_s",
      "gain_margin",
      "phase_crossover_rad_s",
      "phase_margin_deg"
     ]
    },
    {
     "name": "second order wn^2/(s^2 + 2 z wn s + wn^2), wn = 2, z = 0.3: resonant peak 1/(2 z sqrt(1-z^2)) = 1.7471414 at wn sqrt(1-2z^2) = 1.8110770 rad/s; bandwidth wn sqrt(1-2z^2+sqrt(4z^4-4z^2+2)) = 2.9073789 rad/s (closed forms, rel 1e-6; the peak frequency is found by golden section, good to ~1e-8 relative)",
     "checks": [
      "bandwidth_rad_s",
      "resonant_peak",
      "resonant_peak_dB",
      "resonant_rad_s"
     ]
    }
   ],
   "title": "Bode margins",
   "needs_build": true,
   "category": "Dynamics and control",
   "known_answers": 24
  },
  {
   "name": "bolt_joint",
   "version": "0.1.0",
   "summary": "Preloaded bolted joint in tension: bolt stiffness (shank and thread in series), member stiffness by the pressure-cone (frustum) method over a stack of plates, joint constant C = kb/(kb + km), preload from tightening torque (T = K F d), bolt and clamp loads Fi + C P and Fi - (1 - C) P, separation load Fi/(1 - C), and safety factors against proof (yield), separation and fatigue (Goodman).",
   "runtime": "native",
   "timeout_s": 30,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "d_mm",
     "type": "number",
     "unit": "mm",
     "default": 12,
     "enum": null,
     "description": "Nominal bolt diameter (shank)."
    },
    {
     "name": "pitch_mm",
     "type": "number",
     "unit": "mm",
     "default": 1.75,
     "enum": null,
     "description": "Thread pitch; gives the ISO tensile stress area pi/4 (d - 0.9382 p)^2 unless tensile_area_mm2 is given."
    },
    {
     "name": "tensile_area_mm2",
     "type": "number",
     "unit": "mm^2",
     "default": null,
     "enum": null,
     "description": "Tensile stress area of the thread; leave out to compute it from pitch_mm."
    },
    {
     "name": "bolt_modulus_GPa",
     "type": "number",
     "unit": "GPa",
     "default": 207,
     "enum": null,
     "description": "Young's modulus of the bolt."
    },
    {
     "name": "shank_length_mm",
     "type": "number",
     "unit": "mm",
     "default": 15,
     "enum": null,
     "description": "Unthreaded shank length inside the grip; the rest of the grip is threaded."
    },
    {
     "name": "member_thickness_mm",
     "type": "array",
     "unit": "mm",
     "default": [
      15,
      15
     ],
     "enum": null,
     "description": "Thickness of each clamped plate, head side first (1 to 50 plates). Their sum is the grip."
    },
    {
     "name": "member_modulus_GPa",
     "type": "array",
     "unit": "GPa",
     "default": [
      207,
      207
     ],
     "enum": null,
     "description": "Young's modulus of each clamped plate, same order as member_thickness_mm."
    },
    {
     "name": "hole_diameter_mm",
     "type": "number",
     "unit": "mm",
     "default": null,
     "enum": null,
     "description": "Clearance hole diameter; defaults to d_mm."
    },
    {
     "name": "bearing_diameter_mm",
     "type": "number",
     "unit": "mm",
     "default": null,
     "enum": null,
     "description": "Outer diameter of the bearing face under head and nut (washer face); defaults to 1.5 d_mm."
    },
    {
     "name": "cone_half_angle_deg",
     "type": "number",
     "unit": "deg",
     "default": 30,
     "enum": null,
     "description": "Half-angle of the pressure cone; 30 is the usual value, 0 a straight sleeve."
    },
    {
     "name": "bolt_stiffness_kN_per_mm",
     "type": "number",
     "unit": "kN/mm",
     "default": null,
     "enum": null,
     "description": "Bolt stiffness given directly (replaces the computed one)."
    },
    {
     "name": "member_stiffness_kN_per_mm",
     "type": "number",
     "unit": "kN/mm",
     "default": null,
     "enum": null,
     "description": "Member stiffness given directly (replaces the frustum result)."
    },
    {
     "name": "proof_strength_MPa",
     "type": "number",
     "unit": "MPa",
     "default": 580,
     "enum": null,
     "description": "Proof strength of the bolt material (580 MPa: ISO 898-1 class 8.8, d up to 16 mm)."
    },
    {
     "name": "ultimate_MPa",
     "type": "number",
     "unit": "MPa",
     "default": 800,
     "enum": null,
     "description": "Tensile strength of the bolt material (800 MPa: ISO 898-1 class 8.8, d up to 16 mm)."
    },
    {
     "name": "endurance_MPa",
     "type": "number",
     "unit": "MPa",
     "default": null,
     "enum": null,
     "description": "Fully corrected endurance strength of the threaded bolt (alternating amplitude). Leave out to skip the fatigue check."
    },
    {
     "name": "nut_factor",
     "type": "number",
     "unit": "1",
     "default": 0.2,
     "enum": null,
     "description": "Torque coefficient K in T = K F d (about 0.2 for plain steel, dry)."
    },
    {
     "name": "preload_kN",
     "type": "number",
     "unit": "kN",
     "default": null,
     "enum": null,
     "description": "Preload given directly. Give at most one of preload_kN and torque_Nm."
    },
    {
     "name": "torque_Nm",
     "type": "number",
     "unit": "N m",
     "default": null,
     "enum": null,
     "description": "Tightening torque; the preload follows from T = K F d."
    },
    {
     "name": "preload_fraction_of_proof",
     "type": "number",
     "unit": "1",
     "default": 0.75,
     "enum": null,
     "description": "Preload as a fraction of the proof load, used when neither preload_kN nor torque_Nm is given."
    },
    {
     "name": "external_load_kN",
     "type": "number",
     "unit": "kN",
     "default": 10,
     "enum": null,
     "description": "Largest external tension per bolt."
    },
    {
     "name": "external_load_min_kN",
     "type": "number",
     "unit": "kN",
     "default": 0,
     "enum": null,
     "description": "Smallest external tension per bolt over the load cycle (fatigue)."
    },
    {
     "name": "required_factor",
     "type": "number",
     "unit": "1",
     "default": 1.0,
     "enum": null,
     "description": "Each safety factor must reach this value for the joint to pass."
    }
   ],
   "outputs": [
    {
     "name": "tensile_area_mm2",
     "unit": "mm^2",
     "description": null
    },
    {
     "name": "shank_area_mm2",
     "unit": "mm^2",
     "description": null
    },
    {
     "name": "grip_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "threaded_length_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "cone_max_diameter_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "bolt_stiffness_kN_per_mm",
     "unit": "kN/mm",
     "description": null
    },
    {
     "name": "member_stiffness_kN_per_mm",
     "unit": "kN/mm",
     "description": null
    },
    {
     "name": "joint_constant",
     "unit": "1",
     "description": "C = kb/(kb + km)"
    },
    {
     "name": "proof_load_kN",
     "unit": "kN",
     "description": null
    },
    {
     "name": "preload_kN",
     "unit": "kN",
     "description": null
    },
    {
     "name": "preload_of_proof",
     "unit": "1",
     "description": null
    },
    {
     "name": "torque_Nm",
     "unit": "N m",
     "description": null
    },
    {
     "name": "external_load_kN",
     "unit": "kN",
     "description": null
    },
    {
     "name": "bolt_load_kN",
     "unit": "kN",
     "description": null
    },
    {
     "name": "clamp_load_kN",
     "unit": "kN",
     "description": null
    },
    {
     "name": "separation_load_kN",
     "unit": "kN",
     "description": null
    },
    {
     "name": "separated",
     "unit": "1",
     "description": null
    },
    {
     "name": "preload_stress_MPa",
     "unit": "MPa",
     "description": null
    },
    {
     "name": "bolt_stress_MPa",
     "unit": "MPa",
     "description": null
    },
    {
     "name": "alternating_stress_MPa",
     "unit": "MPa",
     "description": null
    },
    {
     "name": "mean_stress_MPa",
     "unit": "MPa",
     "description": null
    },
    {
     "name": "yield_factor",
     "unit": "1",
     "description": "Sp At / (Fi + C P)"
    },
    {
     "name": "load_factor",
     "unit": "1",
     "description": "Multiple of P that brings the bolt to its proof load"
    },
    {
     "name": "load_factor_rule",
     "unit": "1",
     "description": null
    },
    {
     "name": "separation_factor",
     "unit": "1",
     "description": "Fi / ((1 - C) P)"
    },
    {
     "name": "fatigue_factor",
     "unit": "1",
     "description": "Goodman, preload held: Se (Sut - sig_i) / (Sut sig_a + Se (sig_m - sig_i))"
    },
    {
     "name": "goodman_factor_proportional",
     "unit": "1",
     "description": "Goodman, mean and alternating scaled together"
    },
    {
     "name": "governing_factor",
     "unit": "1",
     "description": null
    },
    {
     "name": "governing",
     "unit": "1",
     "description": null
    },
    {
     "name": "required_factor",
     "unit": "1",
     "description": null
    },
    {
     "name": "all_ok",
     "unit": "1",
     "description": null
    },
    {
     "name": "warnings",
     "unit": "1",
     "description": null
    },
    {
     "name": "notes",
     "unit": "1",
     "description": null
    },
    {
     "name": "frusta",
     "unit": "1",
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "Rod k = A E/L (full shank) and straight sleeves k = E pi (D^2 - dh^2)/(4 t) at cone angle 0, three pieces of two moduli in series: C = 5/17 exactly; bolt Fi + C P, clamp Fi - (1 - C) P, separation Fi/(1 - C), T = K F d, proof load reached after opening at Sp At / P (closed forms, rel 1e-9)",
     "checks": [
      "bolt_load_kN",
      "bolt_stiffness_kN_per_mm",
      "clamp_load_kN",
      "joint_constant",
      "load_factor",
      "member_stiffness_kN_per_mm",
      "separation_load_kN",
      "torque_Nm",
      "yield_factor"
     ]
    },
    {
     "name": "Frustum, two equal steel plates, D = 1.5 d, 30 deg: Shigley eq. 8-22 km = pi E d tan a / (2 ln(5 (l tan a + 0.5 d)/(l tan a + 2.5 d))); bolt shank and thread in series 1/kb = ld/(Ad E) + lt/(At E); ISO stress area pi/4 (d - 13 sqrt3/24 p)^2 (84.3 mm2 in ISO 898-1 for M12); Fi = T/(K d) (closed forms, rel 1e-9)",
     "checks": [
      "bolt_stiffness_kN_per_mm",
      "joint_constant",
      "member_stiffness_kN_per_mm",
      "preload_kN",
      "tensile_area_mm2"
     ]
    },
    {
     "name": "Uneven stack [10, 12, 8] mm of one steel at 30 deg is one continuous cone: km equals Shigley eq. 8-22 for l = 30 mm (compliances along one cone add; closed form, rel 1e-9)",
     "checks": [
      "bolt_stiffness_kN_per_mm",
      "joint_constant",
      "member_stiffness_kN_per_mm"
     ]
    },
    {
     "name": "Joint opened: kb = 1, km = 3 kN/mm (C = 0.25), Fi = 24 kN, P = 50 kN > Fi/(1 - C) = 32 kN: bolt carries all of P, clamp 0, separation factor 0.64; proof reached while closed at (Sp At - Fi)/(C P) = 0.48 (closed forms, rel 1e-9)",
     "checks": [
      "bolt_load_kN",
      "clamp_load_kN",
      "joint_constant",
      "load_factor",
      "separated",
      "separation_factor",
      "separation_load_kN"
     ]
    },
    {
     "name": "Goodman fatigue, Shigley eq. 8-38 n_f = Se (Sut - sig_i)/(Sut sig_a + Se (sig_m - sig_i)) = 16/9, proportional 1/(sig_a/Se + sig_m/Sut) = 40/33, yield Sp At/(Fi + C P) = 15/13, load factor (Sp At - Fi)/(C P) = 3: C = 0.25, At = 50 mm2, Fi = 24 kN, P 0..8 kN, Se 100, Sut 800 MPa (closed forms, rel 1e-9)",
     "checks": [
      "alternating_stress_MPa",
      "fatigue_factor",
      "goodman_factor_proportional",
      "load_factor",
      "mean_stress_MPa",
      "separation_factor",
      "yield_factor"
     ]
    }
   ],
   "title": "Preloaded bolted joint",
   "needs_build": true,
   "category": "Mechanics, CAD and finite elements",
   "known_answers": 31
  },
  {
   "name": "buckled_beam",
   "version": "0.1.0",
   "summary": "A precompressed (buckled) beam turned at its right end: pinned-pinned (output: the left pivot's angle) or fixed-pinned (output: the clamp's reaction moment). Closed-form small-deflection model of Tissot-Daguette et al., Mech. Mach. Theory 174 (2022) 104874 (CC BY 4.0), Section 3. Per precompression: the stable state, the moment limit, the angle limit (snap), the output's extreme, the energy to switch; normalised coefficients; optional gripper stroke and grip force. Files: curves.csv, scene.glb (beam shapes at the critical states, mm).",
   "runtime": "native",
   "timeout_s": 120,
   "estimate_s": 3,
   "inputs": [
    {
     "name": "ends",
     "type": "string",
     "unit": null,
     "default": "pinned_pinned",
     "enum": [
      "pinned_pinned",
      "fixed_pinned"
     ],
     "description": null
    },
    {
     "name": "length_m",
     "type": "number",
     "unit": "m",
     "default": 0.2,
     "enum": null,
     "description": null
    },
    {
     "name": "width_m",
     "type": "number",
     "unit": "m",
     "default": 0.025,
     "enum": null,
     "description": null
    },
    {
     "name": "thickness_m",
     "type": "number",
     "unit": "m",
     "default": 0.00025,
     "enum": null,
     "description": null
    },
    {
     "name": "E_Pa",
     "type": "number",
     "unit": "Pa",
     "default": 210000000000.0,
     "enum": null,
     "description": null
    },
    {
     "name": "precompressions_m",
     "type": "array",
     "unit": "m",
     "default": [
      0.003,
      0.005,
      0.0075
     ],
     "enum": null,
     "description": "End shortenings \u0394l, one result each."
    },
    {
     "name": "jaw_radius_m",
     "type": "number",
     "unit": "m",
     "default": null,
     "enum": null,
     "description": "Gripper jaw radius at the output pivot: gives the jaw stroke (pinned-pinned) or the grip force (fixed-pinned)."
    },
    {
     "name": "points",
     "type": "integer",
     "unit": null,
     "default": 20000,
     "enum": null,
     "description": null
    }
   ],
   "outputs": [
    {
     "name": "critical",
     "unit": null,
     "description": "per precompression: theta_stable_deg, M_in_lim_Nmm, theta_in_lim_deg, theta_out_max_deg or M_stable_Nmm and M_out_max_Nmm, energy_to_switch_mJ, energy_stable_mJ, kL at each limit"
    },
    {
     "name": "coefficients",
     "unit": null,
     "description": null
    },
    {
     "name": "gripper",
     "unit": null,
     "description": null
    },
    {
     "name": "curves.csv",
     "unit": null,
     "description": null
    },
    {
     "name": "scene.glb",
     "unit": null,
     "description": null
    },
    {
     "name": "EI_Nm2",
     "unit": "N m^2",
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "pinned-pinned, first mode: the end slope of a buckled sine, 2 sqrt(dl/L) (Euler: y = a sin(pi x/L), dl = pi^2 a^2/4L)",
     "checks": [
      "coefficients.theta_stable"
     ]
    },
    {
     "name": "pinned-pinned at rest stores P_cr dl, P_cr = pi^2 EI/L^2 (Euler)",
     "checks": [
      "critical.dl_5mm.energy_stable_mJ"
     ]
    },
    {
     "name": "fixed-pinned at rest stores P_cr dl, P_cr = 20.1907 EI/L^2 (Euler, effective length 0.699 L)",
     "checks": [
      "critical.dl_5mm.energy_stable_mJ"
     ]
    }
   ],
   "title": "Buckled beam (analytical)",
   "needs_build": true,
   "category": "Mechanics, CAD and finite elements",
   "known_answers": 3
  },
  {
   "name": "calibration_curve",
   "version": "0.1.0",
   "summary": "Instrument calibration: unweighted or weighted least-squares straight line (or quadratic) of response against standard concentration, with residuals, R\u00b2, standard errors, detection and quantitation limits (k s / slope), inverse prediction of an unknown with its confidence interval, and a lack-of-fit F test from replicate standards. Student's t and Fisher's F are computed from the incomplete beta function; no table is stored.",
   "runtime": "native",
   "timeout_s": 30,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "x",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Concentrations of the standards, one per reading; replicate readings repeat the concentration."
    },
    {
     "name": "y",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Instrument response of each standard, paired with x."
    },
    {
     "name": "x_unit",
     "type": "string",
     "unit": null,
     "default": "1",
     "enum": null,
     "description": "Unit of concentration (e.g. \"mg/L\"); the concentration readings carry it. \"1\" for arbitrary units."
    },
    {
     "name": "y_unit",
     "type": "string",
     "unit": null,
     "default": "1",
     "enum": null,
     "description": "Unit of the response; the response readings carry it. \"1\" for arbitrary units (absorbance, counts, peak area)."
    },
    {
     "name": "model",
     "type": "string",
     "unit": null,
     "default": "linear",
     "enum": [
      "linear",
      "quadratic"
     ],
     "description": "y = a + b x, or y = a + b x + c x^2."
    },
    {
     "name": "weighting",
     "type": "string",
     "unit": null,
     "default": "none",
     "enum": [
      "none",
      "1/x",
      "1/x^2",
      "1/y",
      "1/y^2",
      "custom"
     ],
     "description": "Weights of the standards; they are rescaled so they sum to n (textbook convention)."
    },
    {
     "name": "weights",
     "type": "array",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "With weighting=\"custom\": one weight per reading, e.g. 1/s_i^2."
    },
    {
     "name": "weight_unknown",
     "type": "number",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "With weighting=\"custom\": the weight of one reading of the unknown, on the scale of weights. Default: the mean weight."
    },
    {
     "name": "y_unknown",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Replicate responses of the unknown sample (m of them); its concentration is read from the curve."
    },
    {
     "name": "confidence",
     "type": "number",
     "unit": "1",
     "default": 0.95,
     "enum": null,
     "description": "Two-sided confidence level for t intervals and the lack-of-fit test (alpha = 1 - confidence)."
    },
    {
     "name": "lod_basis",
     "type": "string",
     "unit": null,
     "default": "residual",
     "enum": [
      "residual",
      "intercept",
      "blank"
     ],
     "description": "Sigma in LOD = k_lod sigma / b: the residual standard deviation s_y/x, the standard error of the intercept, or blank_sd."
    },
    {
     "name": "blank_sd",
     "type": "number",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Standard deviation of replicate blank readings, with lod_basis=\"blank\"."
    },
    {
     "name": "k_lod",
     "type": "number",
     "unit": "1",
     "default": 3.3,
     "enum": null,
     "description": "Detection-limit factor (ICH Q2: 3.3)."
    },
    {
     "name": "k_loq",
     "type": "number",
     "unit": "1",
     "default": 10,
     "enum": null,
     "description": "Quantitation-limit factor (ICH Q2: 10)."
    }
   ],
   "outputs": [
    {
     "name": "model",
     "unit": null,
     "description": "linear or quadratic"
    },
    {
     "name": "equation",
     "unit": null,
     "description": "the fitted curve as text"
    },
    {
     "name": "intercept",
     "unit": null,
     "description": "a"
    },
    {
     "name": "slope",
     "unit": null,
     "description": "b, in the unit of y per unit of x (sensitivity)"
    },
    {
     "name": "quadratic",
     "unit": null,
     "description": "c, in the unit of y per unit of x squared; null for a line"
    },
    {
     "name": "se_intercept",
     "unit": null,
     "description": null
    },
    {
     "name": "se_slope",
     "unit": null,
     "description": "in the unit of y per unit of x"
    },
    {
     "name": "se_quadratic",
     "unit": null,
     "description": "in the unit of y per unit of x squared"
    },
    {
     "name": "slope_ci_low",
     "unit": null,
     "description": "in the unit of y per unit of x"
    },
    {
     "name": "slope_ci_high",
     "unit": null,
     "description": "in the unit of y per unit of x"
    },
    {
     "name": "intercept_ci_low",
     "unit": null,
     "description": null
    },
    {
     "name": "intercept_ci_high",
     "unit": null,
     "description": null
    },
    {
     "name": "x_min",
     "unit": null,
     "description": null
    },
    {
     "name": "x_max",
     "unit": null,
     "description": null
    },
    {
     "name": "x_mean",
     "unit": null,
     "description": "weighted mean concentration"
    },
    {
     "name": "y_mean",
     "unit": null,
     "description": "weighted mean response"
    },
    {
     "name": "sxx",
     "unit": null,
     "description": "weighted sum of squared deviations of x, unit of x squared"
    },
    {
     "name": "ss_residual",
     "unit": null,
     "description": "weighted residual sum of squares, unit of y squared"
    },
    {
     "name": "residual_sd",
     "unit": null,
     "description": "s_y/x = sqrt(SS_res / (n - p))"
    },
    {
     "name": "max_abs_residual",
     "unit": null,
     "description": null
    },
    {
     "name": "residuals",
     "unit": null,
     "description": null
    },
    {
     "name": "r2",
     "unit": "1",
     "description": null
    },
    {
     "name": "adjusted_r2",
     "unit": "1",
     "description": null
    },
    {
     "name": "t_critical",
     "unit": "1",
     "description": "two-sided Student t at the confidence level, n - p degrees of freedom"
    },
    {
     "name": "lod_sigma",
     "unit": null,
     "description": null
    },
    {
     "name": "lod",
     "unit": null,
     "description": "detection limit k_lod sigma / |b|"
    },
    {
     "name": "loq",
     "unit": null,
     "description": "quantitation limit k_loq sigma / |b|"
    },
    {
     "name": "y_unknown_mean",
     "unit": null,
     "description": null
    },
    {
     "name": "x_unknown",
     "unit": null,
     "description": "x0 = (y0 - a) / b"
    },
    {
     "name": "s_x_unknown",
     "unit": null,
     "description": "(s/b) sqrt(1/(m w0) + 1/n + (y0 - ybar)^2 / (b^2 Sxx))"
    },
    {
     "name": "x_unknown_ci_low",
     "unit": null,
     "description": null
    },
    {
     "name": "x_unknown_ci_high",
     "unit": null,
     "description": null
    },
    {
     "name": "x_unknown_ci_half_width",
     "unit": null,
     "description": null
    },
    {
     "name": "x_unknown_rel_sd_pct",
     "unit": "%",
     "description": null
    },
    {
     "name": "weight_unknown_scaled",
     "unit": "1",
     "description": null
    },
    {
     "name": "g_factor",
     "unit": "1",
     "description": "(t s_b / b)^2; above 0.05 the symmetric interval is approximate"
    },
    {
     "name": "ss_pure_error",
     "unit": null,
     "description": "unit of y squared"
    },
    {
     "name": "ss_lack_of_fit",
     "unit": null,
     "description": "unit of y squared"
    },
    {
     "name": "lack_of_fit_f",
     "unit": "1",
     "description": null
    },
    {
     "name": "lack_of_fit_p",
     "unit": "1",
     "description": null
    },
    {
     "name": "lack_of_fit_significant",
     "unit": null,
     "description": "true when p < 1 - confidence; null when it cannot be tested"
    },
    {
     "name": "point_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "level_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "degrees_of_freedom",
     "unit": "1",
     "description": null
    },
    {
     "name": "df_pure_error",
     "unit": "1",
     "description": null
    },
    {
     "name": "df_lack_of_fit",
     "unit": "1",
     "description": null
    },
    {
     "name": "unknown_replicates",
     "unit": "1",
     "description": null
    },
    {
     "name": "points",
     "unit": null,
     "description": null
    },
    {
     "name": "all_ok",
     "unit": null,
     "description": "no warnings"
    },
    {
     "name": "warnings",
     "unit": null,
     "description": null
    },
    {
     "name": "notes",
     "unit": null,
     "description": null
    },
    {
     "name": "files",
     "unit": null,
     "description": "out/points.csv (x, y, weight, fitted, residual, standardised residual) and out/curve.csv (fit with confidence band of the mean and prediction band of a single reading)"
    }
   ],
   "selftests": [
    {
     "name": "exact line y = 2x + 1 (closed form): slope 2, intercept 1, residuals 0, R2 1; inverse of y0 = 8 is x0 = 3.5 exactly (rounding tolerance only)",
     "checks": [
      "intercept",
      "lod",
      "max_abs_residual",
      "r2",
      "residual_sd",
      "slope",
      "x_unknown"
     ]
    },
    {
     "name": "five-point set worked by hand with exact fractions (Sxx=10, Sxy=98/5): b=49/25, a=11/50, SSres=11/250, s=sqrt(11/750); LOD=3.3s/b, LOQ=10s/b; t(0.975,3) from the closed-form nu=3 t cdf; x0=(7-a)/b with the textbook s_x0 (rel 1e-9: exact arithmetic; t from a root solve, rel 1e-9)",
     "checks": [
      "intercept",
      "lod",
      "loq",
      "r2",
      "residual_sd",
      "s_x_unknown",
      "se_intercept",
      "se_slope",
      "slope",
      "ss_residual",
      "t_critical",
      "x_unknown",
      "x_unknown_ci_half_width"
     ]
    },
    {
     "name": "four standards, dof 2, unknown read twice (m=2): b=24/25, a=3/50, SSres=4/125; t(0.975,2)=0.95/sqrt(2*0.975*0.025) in closed form; x0=2.125 and s_x0 with 1/m (rel 1e-9)",
     "checks": [
      "intercept",
      "residual_sd",
      "s_x_unknown",
      "slope",
      "t_critical",
      "x_unknown",
      "x_unknown_ci_high",
      "x_unknown_ci_low"
     ]
    },
    {
     "name": "weighted line, weights 4:3:2:1 rescaled to sum n (exact fractions): xbar_w=2, b=47/50, a=1/5, SSres_w=9/125, s_b=s/2, s_a=s sqrt(1/4+1); unknown y0=3 with weight 3 -> x0=(3-a)/b and weighted s_x0 (rel 1e-9)",
     "checks": [
      "intercept",
      "residual_sd",
      "s_x_unknown",
      "se_intercept",
      "se_slope",
      "slope",
      "x_unknown"
     ]
    },
    {
     "name": "lack of fit, duplicates at 3 levels: SSpe=6/100, SSlof=1/3, F(1,3)=50/3; p from F(1,3)=t(3)^2 and the closed-form nu=3 t cdf (rel 1e-9)",
     "checks": [
      "intercept",
      "lack_of_fit_f",
      "lack_of_fit_p",
      "lack_of_fit_significant",
      "slope",
      "ss_lack_of_fit",
      "ss_pure_error"
     ]
    },
    {
     "name": "exact quadratic y = 1 + 2x + 0.5x^2 (closed form): coefficients recovered, y0 = 11.5 inverts to the root x0 = 3; t(0.975, nu=1) = tan(0.475 pi) = 12.7062... (Cauchy, closed form)",
     "checks": [
      "intercept",
      "quadratic",
      "slope",
      "t_critical",
      "x_unknown"
     ]
    },
    {
     "name": "blank-based limits on the five-point set: LOD = 3.3 x 0.05 / 1.96, LOQ = 10 x 0.05 / 1.96 (closed form, rel 1e-9)",
     "checks": [
      "lod",
      "loq"
     ]
    }
   ],
   "title": "Calibration curve",
   "needs_build": true,
   "category": "Measurement and data",
   "known_answers": 49
  },
  {
   "name": "channel2d",
   "version": "0.1.0",
   "summary": "2D incompressible flow by the lattice Boltzmann method (D2Q9, BGK). mode=cylinder: flow past a cylinder, vortex street, Strouhal number, vorticity.png, probe.csv and scene.glb (the vorticity as a 3D surface). mode=poiseuille: channel flow checked against the exact parabola, profile.csv. All lengths in lattice cells, velocities in lattice units.",
   "runtime": "native",
   "timeout_s": 900,
   "estimate_s": 60,
   "inputs": [
    {
     "name": "mode",
     "type": "string",
     "unit": null,
     "default": "cylinder",
     "enum": [
      "cylinder",
      "poiseuille"
     ],
     "description": null
    },
    {
     "name": "Re",
     "type": "number",
     "unit": "1",
     "default": 100,
     "enum": null,
     "description": "Reynolds number U D / nu (cylinder mode)."
    },
    {
     "name": "nx",
     "type": "integer",
     "unit": "1",
     "default": 400,
     "enum": null,
     "description": null
    },
    {
     "name": "ny",
     "type": "integer",
     "unit": "1",
     "default": 100,
     "enum": null,
     "description": null
    },
    {
     "name": "diameter_cells",
     "type": "integer",
     "unit": "1",
     "default": 20,
     "enum": null,
     "description": null
    },
    {
     "name": "u_lattice",
     "type": "number",
     "unit": "1",
     "default": 0.08,
     "enum": null,
     "description": "Inflow speed (cylinder) or target peak speed (poiseuille), lattice units. Keep it under 0.1 so the flow stays nearly incompressible."
    },
    {
     "name": "tau",
     "type": "number",
     "unit": "1",
     "default": 0.8,
     "enum": null,
     "description": "Relaxation time (poiseuille mode; cylinder mode derives it from Re)."
    },
    {
     "name": "steps",
     "type": "integer",
     "unit": null,
     "default": 20000,
     "enum": null,
     "description": null
    }
   ],
   "outputs": [
    {
     "name": "strouhal",
     "unit": "1",
     "description": null
    },
    {
     "name": "u_max, u_max_exact, rel_error",
     "unit": null,
     "description": null
    },
    {
     "name": "vorticity.png",
     "unit": null,
     "description": null
    },
    {
     "name": "probe.csv",
     "unit": null,
     "description": null
    },
    {
     "name": "profile.csv",
     "unit": null,
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "Poiseuille channel: peak speed within 1% of g H^2 / 8 nu",
     "checks": [
      "profile_rms_error",
      "rel_error"
     ]
    },
    {
     "name": "Cylinder at Re 100, periodic sides, 20% blockage: a vortex street with St in 0.16-0.22 (unbounded 0.164; blockage raises it)",
     "checks": [
      "probe_amplitude_over_U",
      "shedding_periods",
      "strouhal"
     ]
    }
   ],
   "title": "Flow past a cylinder (2D)",
   "needs_build": true,
   "category": "Mechanics, CAD and finite elements",
   "known_answers": 5
  },
  {
   "name": "charge_deconvolution",
   "version": "0.1.0",
   "summary": "Electrospray charge-state deconvolution: from the m/z peaks of one envelope (and optional intensities) find each peak's charge, the neutral mass with its spread, and the peaks that fit no charge; or predict the envelope m/z = (M +/- z m_c)/z for a mass. Adjacent-peak rule z1 = (m2 - m_c)/(m1 - m2) (Mann, Meng and Fenn 1989).",
   "runtime": "native",
   "timeout_s": 30,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "mode",
     "type": "string",
     "unit": null,
     "default": "deconvolute",
     "enum": [
      "deconvolute",
      "predict"
     ],
     "description": "deconvolute: peaks to mass. predict: mass to peaks."
    },
    {
     "name": "polarity",
     "type": "string",
     "unit": null,
     "default": "positive",
     "enum": [
      "positive",
      "negative"
     ],
     "description": "positive: [M + z m_c]^z+. negative: [M - z m_c]^z-."
    },
    {
     "name": "carrier_mass_Da",
     "type": "number",
     "unit": "Da",
     "default": 1.007276466621,
     "enum": null,
     "description": "Mass of one charge carrier. Default: the proton, CODATA 2018 (1.007276466621 u). Na+ is 22.989218."
    },
    {
     "name": "mz",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "deconvolute: centroid m/z of the peaks of one envelope (m/z is dimensionless, Th)."
    },
    {
     "name": "intensity",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "deconvolute, optional: one height or area per peak, same order as mz; weights the mass. Leave out for equal weights."
    },
    {
     "name": "tol_ppm",
     "type": "number",
     "unit": null,
     "default": 200,
     "enum": null,
     "description": "deconvolute: largest relative m/z error, in ppm (parts per million), for a peak to take a charge. 200 for unit resolution, 20 for high resolution."
    },
    {
     "name": "z_min",
     "type": "integer",
     "unit": "1",
     "default": 1,
     "enum": null,
     "description": "deconvolute: lowest charge allowed."
    },
    {
     "name": "z_max",
     "type": "integer",
     "unit": "1",
     "default": 100,
     "enum": null,
     "description": "deconvolute: highest charge allowed."
    },
    {
     "name": "mass_Da",
     "type": "number",
     "unit": "Da",
     "default": null,
     "enum": null,
     "description": "predict: the neutral mass M."
    },
    {
     "name": "z_from",
     "type": "integer",
     "unit": "1",
     "default": 1,
     "enum": null,
     "description": "predict: lowest charge of the envelope."
    },
    {
     "name": "z_to",
     "type": "integer",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "predict: highest charge of the envelope (default z_from)."
    }
   ],
   "outputs": [
    {
     "name": "mode",
     "unit": "1",
     "description": null
    },
    {
     "name": "polarity",
     "unit": "1",
     "description": null
    },
    {
     "name": "carrier_mass_Da",
     "unit": "Da",
     "description": null
    },
    {
     "name": "mass_Da",
     "unit": "Da",
     "description": "deconvolute: weighted mean of z (m/z -/+ m_c) over the assigned peaks. predict: the mass given."
    },
    {
     "name": "mass_sd_Da",
     "unit": "Da",
     "description": "Spread (unbiased weighted standard deviation) of the per-peak masses; null when it cannot be formed."
    },
    {
     "name": "mass_sem_Da",
     "unit": "Da",
     "description": "Standard error of the mean mass."
    },
    {
     "name": "mass_sd_ppm",
     "unit": null,
     "description": "mass_sd_Da / mass_Da in ppm. No unit the kernel can check (ppm is not in its table)."
    },
    {
     "name": "z_lowest",
     "unit": "1",
     "description": null
    },
    {
     "name": "z_highest",
     "unit": "1",
     "description": null
    },
    {
     "name": "n_peaks",
     "unit": "1",
     "description": null
    },
    {
     "name": "n_assigned",
     "unit": "1",
     "description": null
    },
    {
     "name": "n_unassigned",
     "unit": "1",
     "description": null
    },
    {
     "name": "n_charges",
     "unit": "1",
     "description": null
    },
    {
     "name": "all_assigned",
     "unit": "1",
     "description": "true when every peak took a charge."
    },
    {
     "name": "charges_consecutive",
     "unit": "1",
     "description": null
    },
    {
     "name": "pair_z",
     "unit": "1",
     "description": "Charge of the highest-m/z peak of the first adjacent pair (z, z+1)."
    },
    {
     "name": "pair_z_raw",
     "unit": "1",
     "description": "Adjacent-peak rule before rounding: (m2 - m_c)/(m1 - m2)."
    },
    {
     "name": "max_error_ppm",
     "unit": null,
     "description": "Largest |m/z error| of an assigned peak, ppm. No unit the kernel can check (ppm is not in its table)."
    },
    {
     "name": "rms_error_ppm",
     "unit": null,
     "description": "RMS m/z error of the assigned peaks, ppm. No unit the kernel can check (ppm is not in its table)."
    },
    {
     "name": "mz_highest",
     "unit": "1",
     "description": null
    },
    {
     "name": "mz_lowest",
     "unit": "1",
     "description": null
    },
    {
     "name": "mz_spacing_min",
     "unit": "1",
     "description": "predict: m/z gap between the two most highly charged peaks."
    },
    {
     "name": "charges",
     "unit": "1",
     "description": "Charge of each input peak in order; null for a peak that fits none."
    },
    {
     "name": "unassigned_mz",
     "unit": "1",
     "description": null
    },
    {
     "name": "peaks",
     "unit": null,
     "description": null
    },
    {
     "name": "envelope",
     "unit": null,
     "description": null
    },
    {
     "name": "weighted_by_intensity",
     "unit": "1",
     "description": null
    },
    {
     "name": "warnings",
     "unit": "1",
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "Mann-Meng-Fenn adjacent-peak closed form: noise-free pair of M = 16951.5 Da at z = 10, 11 (m/z = M/z + m_p, CODATA proton) gives z1 = (m2 - m_p)/(m1 - m2) = 10 and M exactly (rel 1e-9, float rounding only)",
     "checks": [
      "mass_Da",
      "n_assigned",
      "pair_z",
      "pair_z_raw",
      "z_highest",
      "z_lowest"
     ]
    },
    {
     "name": "Envelope of M = 16951.5 Da at z = 10..20 (m/z = M/z + m_p, written to 4 decimals: rounding <= 5e-5 m/z x z <= 1e-3 Da per peak) recovers M within 0.01 Da and every charge",
     "checks": [
      "all_assigned",
      "charges_consecutive",
      "mass_Da",
      "n_assigned",
      "z_highest",
      "z_lowest"
     ]
    },
    {
     "name": "Stray peak m/z 1600.0 inside the M = 16951.5 Da envelope (z = 10..20, 4 decimals) fits no charge (nearest z = 11 is 3.8 % off, far past 200 ppm): flagged, mass still within 0.01 Da",
     "checks": [
      "all_assigned",
      "mass_Da",
      "n_assigned",
      "n_unassigned"
     ]
    },
    {
     "name": "Predict closed form m/z = M/z + m_p (CODATA 2018 proton 1.007276466621 Da), M = 16951.5 Da, z = 10..20: m/z(10) = 1696.1572764666, m/z(20) = 848.5822764666, gap M/19 - M/20 = 44.609210526 (rel 1e-9)",
     "checks": [
      "mz_highest",
      "mz_lowest",
      "mz_spacing_min",
      "n_charges"
     ]
    },
    {
     "name": "Negative mode [M - zH]z-: noise-free M = 10000 Da at z = 4, 5, 6 (m/z = M/z - m_p) recovers M exactly (rel 1e-9) and the charges",
     "checks": [
      "mass_Da",
      "pair_z",
      "z_highest",
      "z_lowest"
     ]
    },
    {
     "name": "Intensity-weighted mean, closed form: z = 10, 11, 12 of M = 16951.5 Da with the z = 12 peak moved +0.1 m/z (z x = M + 1.2 Da, 71 ppm), weights 1, 1, 2: M = M + 2(1.2)/4 = 16952.1 Da, unbiased weighted SD sqrt(0.36/0.625) = 0.758946638 Da (rel 1e-6)",
     "checks": [
      "mass_Da",
      "mass_sd_Da",
      "n_assigned"
     ]
    }
   ],
   "title": "Charge-state deconvolution",
   "needs_build": true,
   "category": "Mass spectrometry",
   "known_answers": 27
  },
  {
   "name": "circuit",
   "version": "0.1.0",
   "summary": "An electrical circuit simulated by ngspice 47 (the open-source SPICE; built from its pinned source tarball by install.sh): what reaches a load over time. The circuit is a small JSON netlist (named nodes; resistors, capacitors, inductors, diodes from a small library or with stated model parameters, timed switches, voltage and current sources as DC, sine, pulse, piecewise-linear or a sampled waveform from a CSV file of an earlier run; raw SPICE lines as an escape). Analyses: operating point, transient (duration and step), AC sweep. Measures, named by the caller (measures.<name>): a node's voltage, a part's current or power (every part is sensed by a 0 V source in series), as mean, RMS, peak, min, max, final, value at a time, time to reach a level, integral (energy); AC: peak, peak frequency, -3 dB bandwidth, Q. A criterion on one measure gives the verdict. Transients carry an energy balance (net source energy against dissipated plus stored). Files: waveforms.csv (every node voltage and part current; envelope-decimated when long), plot.png, deck.cir (the SPICE deck as run).",
   "runtime": "native",
   "timeout_s": 3600,
   "estimate_s": 5,
   "inputs": [
    {
     "name": "circuit",
     "type": "object",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "The netlist: {ground?: \"0\", parts: [...]}. Nodes are named (letters, digits, _; \"0\" or \"gnd\" is ground; SPICE ignores case). Parts, each with a unique name: {type: resistor|capacitor|inductor, between: [n1, n2], value (ohm, F, H), ic? (V or A, starting value)}; {type: diode, anode, cathode, part: ideal|BAS70 or model: {IS, N, RS, CJO, VJ, M, BV, IBV, TT, EG, XTI, ISR, NR...} with source: where the figures come from, leak_ohm?: a resistor across it}; {type: switch, between, closed: [[t_on, t_off], ...] or wave (closed while > 0.5), r_on? 1e-3, r_off? 1e12}; {type: voltage_source, plus, minus, wave, ac?}; {type: current_source, from, to, wave, ac?} (pushes current into node 'to'); {type: spice, lines: [raw SPICE]} (escape hatch: parts and models only). Waves: {dc: x}, {sine: {amplitude, frequency_Hz, offset?, phase_deg?, delay_s?}}, {pulse: {low, high, width_s, period_s?, delay_s?, rise_s?, fall_s?}}, {pwl: [[t, x], ...], repeat?}, {csv: {time: column, value: column, scale?, time_from_zero?, repeat?}} (file: wave_file). Every number may be a string naming a params entry or an expression over them. Plain numbers only: 1e-6, never 1u (SPICE suffixes are not read; M would be milli)."
    },
    {
     "name": "circuit_file",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "The netlist as a JSON file instead of circuit."
    },
    {
     "name": "wave_file",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "A CSV file for a source with wave {csv: {time, value}} (e.g. an earlier run's history.csv)."
    },
    {
     "name": "params",
     "type": "object",
     "unit": null,
     "default": {},
     "enum": null,
     "description": "Named numbers (or expressions over earlier ones) that the netlist, the analysis and the criterion may use: {\"Vs\": 3.0, \"Ip\": \"2 * Vs / 1e6\"}. Sweep them with bench sweep --grid=params.Vs=..."
    },
    {
     "name": "analysis",
     "type": "object",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Default {type: op}. {type: op} | {type: tran, duration_s, step_s (print step and default largest step), max_step_s?, start?: auto|op|zero (zero: everything starts empty unless it has ic; auto: zero when any part has ic, else from the operating point), save_from_s?} | {type: ac, from_Hz, to_Hz, points_per_decade? 100}"
    },
    {
     "name": "measures",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Default none (an operating point still lists every node voltage and part current in op). [{name, of: v(node) | v(a,b) | i(part) | p(part), stat, ...}]. Transient stats: mean, rms, max, min, peak (largest |x|), peak_to_peak, final, initial, change (end of the window minus its start), at (time_s), time_to (level, direction rise|fall|either, after_s), integral (J for p()); window from_s/to_s or last_s. AC (magnitude): peak, peak_frequency, bandwidth, q, at (frequency_Hz), phase_at. Op: value. i(part) is the current into the part's first terminal (between[0], anode, plus, from); p(part) the power it absorbs (sources delivering: negative)."
    },
    {
     "name": "criterion",
     "type": "object",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "A test on one measure for the verdict: {measure, at_least? | at_most? | within?: [lo, hi], text?: \"reaches 1.8 V within 60 s\"}. A level never reached (null) fails."
    },
    {
     "name": "options",
     "type": "object",
     "unit": null,
     "default": {},
     "enum": null,
     "description": "Simulator options: reltol (1e-3), abstol (1e-12 A), vntol (1e-6 V), gmin (1e-12 S: lower it, e.g. 1e-15, when pA leakage matters), chgtol, itl4, method (trap|gear)."
    },
    {
     "name": "temperature_C",
     "type": "number",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Circuit temperature (SPICE temp; models are given at 27 degC). Diode leakage grows fast with it."
    },
    {
     "name": "energy_balance",
     "type": "boolean",
     "unit": null,
     "default": true,
     "enum": null,
     "description": "Transient energy balance (needs every vector saved: off when keep is measured)."
    },
    {
     "name": "keep",
     "type": "string",
     "unit": null,
     "default": "all",
     "enum": [
      "all",
      "measured"
     ],
     "description": "Which vectors the simulator saves: all, or only what measures and plot need (long runs)."
    },
    {
     "name": "plot",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Quantities to plot (default: those the measures use), e.g. [\"v(out)\", \"i(RL)\"]."
    },
    {
     "name": "title",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "The plot's title."
    },
    {
     "name": "csv_max_rows",
     "type": "integer",
     "unit": null,
     "default": 20000,
     "enum": null,
     "description": "Rows of waveforms.csv before it is envelope-decimated."
    },
    {
     "name": "timeout_s",
     "type": "number",
     "unit": "s",
     "default": 3000,
     "enum": null,
     "description": "Wall time allowed to ngspice."
    }
   ],
   "outputs": [
    {
     "name": "measures",
     "unit": null,
     "description": null
    },
    {
     "name": "measure_units",
     "unit": null,
     "description": null
    },
    {
     "name": "figures",
     "unit": null,
     "description": null
    },
    {
     "name": "ok",
     "unit": null,
     "description": null
    },
    {
     "name": "criterion",
     "unit": null,
     "description": null
    },
    {
     "name": "criterion_value",
     "unit": null,
     "description": null
    },
    {
     "name": "energy_balance",
     "unit": null,
     "description": null
    },
    {
     "name": "energy_balance_error",
     "unit": null,
     "description": null
    },
    {
     "name": "op",
     "unit": null,
     "description": null
    },
    {
     "name": "points",
     "unit": null,
     "description": null
    },
    {
     "name": "duration_s",
     "unit": "s",
     "description": null
    },
    {
     "name": "parts",
     "unit": null,
     "description": null
    },
    {
     "name": "warnings",
     "unit": null,
     "description": null
    },
    {
     "name": "waveforms.csv",
     "unit": null,
     "description": null
    },
    {
     "name": "plot.png",
     "unit": null,
     "description": null
    },
    {
     "name": "deck.cir",
     "unit": null,
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "divider operating point: 10 V over 1 kohm + 3 kohm gives 7.5 V, 2.5 mA, 18.75 mW in the 3 kohm, -25 mW in the source (Ohm's law; to 1e-9)",
     "checks": [
      "measures.i_r1",
      "measures.p_r2",
      "measures.p_v1",
      "measures.v_mid"
     ]
    },
    {
     "name": "RC step, 1 kohm, 1 uF, 1 V from empty: v(tau) = 1 - 1/e, time to 0.9 V = tau ln 10, source energy C V^2 (1 - e^-5) over 5 tau (closed forms; 1e-5, 1e-5, 1e-4), energy balance to 1e-5, criterion met",
     "checks": [
      "energy_balance_error",
      "measures.e_source",
      "measures.t_90",
      "measures.v_tau",
      "ok"
     ]
    },
    {
     "name": "series RLC, 10 ohm, 10 mH, 1 uF, AC sweep of the current: resonance 1/(2 pi sqrt(LC)) = 1591.549 Hz (1e-5), peak 1/R (1e-5), Q = sqrt(L/C)/R = 10 and -3 dB bandwidth R/(2 pi L) (5e-4: the -3 dB points are interpolated between sweep points 0.23 % apart)",
     "checks": [
      "measures.bw",
      "measures.f0",
      "measures.ipk",
      "measures.q"
     ]
    },
    {
     "name": "half-wave rectifier, 1000 V peak, ideal diode, 10 kohm: mean output Vp/pi (closed form; 5e-4: the ideal-enough diode drops about 0.03 V at 0.1 A)",
     "checks": [
      "energy_balance_error",
      "measures.vmean"
     ]
    },
    {
     "name": "full-wave bridge, 1000 V peak, four ideal diodes, 10 kohm: mean output 2 Vp/pi (closed form; 5e-4, two diode drops)",
     "checks": [
      "measures.vmean"
     ]
    },
    {
     "name": "half-wave rectifier with a smoothing capacitor, 100 V peak at 50 Hz, 100 uF, 10 kohm: ripple against the standard approximation Vp/(f R C) = 2.0 V (6 %: the approximation lets the capacitor discharge for a whole period at constant current; it recharges for about 3 % of it and decays exponentially, so it runs about 4 % high), energy balance to 1e-4",
     "checks": [
      "energy_balance_error",
      "measures.ripple"
     ]
    },
    {
     "name": "piezoelectric source into a full-bridge rectifier at half its open-circuit voltage: 0.1 mA sine at 100 Hz beside 1 nF, ideal diodes, into a 79.6 V store: power f Ip^2/(w^2 Cp) = 2.533 mW (Shu and Lien 2006, Smart Mater. Struct. 15 1499, eq. for the standard interface; 2e-3: two diode drops against 80 V)",
     "checks": [
      "energy_balance_error",
      "measures.p_store"
     ]
    },
    {
     "name": "PWL ramp 0 to 1 V in 1 ms across 1 uF draws C dV/dt = 1 mA (1e-6); a 1 uF capacitor charged to 1 V (ic) switched at 1 ms onto 1 kohm is at 1/e at 2 ms (1e-5); energy balance 1e-5",
     "checks": [
      "energy_balance_error",
      "measures.i_ramp",
      "measures.v_b_2ms"
     ]
    }
   ],
   "title": "Circuit",
   "needs_build": true,
   "category": "Waves, optics and circuits",
   "known_answers": 23
  },
  {
   "name": "compare",
   "version": "0.1.0",
   "summary": "Compare two tables of numbers cell by cell: relative error (measured - reference)/|reference|, the worst cell, whether all are within a tolerance. Tables are objects of rows, usually other runs' readings (\"@r0012:critical\"). Only rows and numeric columns present in both are compared.",
   "runtime": "native",
   "timeout_s": 60,
   "estimate_s": 1,
   "inputs": [
    {
     "name": "reference",
     "type": "object",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "The table to check against."
    },
    {
     "name": "measured",
     "type": "object",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "The table being checked."
    },
    {
     "name": "columns",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Compare only these columns (default: every numeric column in both)."
    },
    {
     "name": "tolerance_rel",
     "type": "number",
     "unit": "1",
     "default": 0.025,
     "enum": null,
     "description": null
    }
   ],
   "outputs": [
    {
     "name": "cells",
     "unit": null,
     "description": null
    },
    {
     "name": "compared",
     "unit": "1",
     "description": null
    },
    {
     "name": "max_abs_error_pct",
     "unit": "%",
     "description": null
    },
    {
     "name": "worst",
     "unit": null,
     "description": null
    },
    {
     "name": "all_within",
     "unit": null,
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "102 against 100 is +2 %, within 2.5 %",
     "checks": [
      "all_within",
      "compared",
      "max_abs_error_pct"
     ]
    },
    {
     "name": "97 against 100 is -3 %, outside 2.5 %; rows or columns in one table only are skipped",
     "checks": [
      "all_within",
      "compared",
      "max_abs_error_pct"
     ]
    }
   ],
   "title": "Comparison",
   "needs_build": true,
   "category": "Measurement and data",
   "known_answers": 6
  },
  {
   "name": "contact_map",
   "version": "0.1.0",
   "summary": "Analyzes 3D protein-protein or protein-ligand contacts from PDB/mmCIF: heavy-atom contacts within cutoff, interface residue counts, H-bond candidates, salt bridges, steric clashes, and an interface scene.glb.",
   "runtime": "native",
   "timeout_s": 60,
   "estimate_s": 0.1,
   "inputs": [
    {
     "name": "structure_text",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "structure_file",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "chain_a",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "chain_b",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "cutoff_A",
     "type": "number",
     "unit": "\u00c5",
     "default": 4.5,
     "enum": null,
     "description": null
    }
   ],
   "outputs": [
    {
     "name": "contact_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "interface_residues_a",
     "unit": "1",
     "description": null
    },
    {
     "name": "interface_residues_b",
     "unit": "1",
     "description": null
    },
    {
     "name": "hbond_candidates",
     "unit": "1",
     "description": null
    },
    {
     "name": "salt_bridges",
     "unit": "1",
     "description": null
    },
    {
     "name": "clash_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "min_distance_A",
     "unit": "\u00c5",
     "description": null
    },
    {
     "name": "scene.glb",
     "unit": null,
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "ASP OD1 (chain A) and LYS NZ (chain B) at 3.2 \u00c5 -> 1 salt bridge, 1 H-bond candidate",
     "checks": [
      "contact_count",
      "hbond_candidates",
      "min_distance_A",
      "salt_bridges"
     ]
    }
   ],
   "title": "3D molecular interface contacts",
   "needs_build": true,
   "category": "Structural biology",
   "known_answers": 4
  },
  {
   "name": "control_chart",
   "version": "0.1.0",
   "summary": "Statistical process control: X-bar and R, X-bar and S, and individuals / moving-range charts from subgrouped data, with d2, d3 and c4 computed by integration over the normal distribution (no copied table), Western Electric or Nelson run rules, capability Cp, Cpk, Pp, Ppk and the expected parts per million outside the specification.",
   "runtime": "native",
   "timeout_s": 60,
   "estimate_s": 0.1,
   "inputs": [
    {
     "name": "data",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "The measurements: a list of subgroups (each an inner list of equal length), or a flat list cut into subgroups of subgroup_size. Leave out to get the constants (and, with process_mean and process_sigma, the capability of a described process)."
    },
    {
     "name": "data_unit",
     "type": "string",
     "unit": null,
     "default": "1",
     "enum": null,
     "description": "Unit of the measurements, the specification limits and the process mean and sigma (mm, um, g, ...). Only recorded and passed on to the readings."
    },
    {
     "name": "subgroup_size",
     "type": "integer",
     "unit": "1",
     "default": 1,
     "enum": null,
     "description": "Parts measured together, used to cut a flat data list; 1 charts individuals. Without data: the n of the constants."
    },
    {
     "name": "chart",
     "type": "string",
     "unit": null,
     "default": "auto",
     "enum": [
      "auto",
      "xbar_r",
      "xbar_s",
      "i_mr"
     ],
     "description": "auto: i_mr for single values, xbar_r for subgroups up to 10, xbar_s above."
    },
    {
     "name": "rules",
     "type": "string",
     "unit": null,
     "default": "western_electric",
     "enum": [
      "western_electric",
      "nelson",
      "limits_only"
     ],
     "description": "western_electric: beyond limits, 2 of 3 beyond 2 sigma, 4 of 5 beyond 1 sigma, 8 in a row on one side. nelson adds trend of 6, 14 alternating, 15 within 1 sigma, 8 beyond 1 sigma on both sides, and takes 9 in a row. Every set also flags the dispersion chart beyond its limits."
    },
    {
     "name": "limit_sigmas",
     "type": "number",
     "unit": "1",
     "default": 3,
     "enum": null,
     "description": "Control limits at this many standard deviations of the plotted statistic."
    },
    {
     "name": "lsl",
     "type": "number",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Lower specification limit (optional)."
    },
    {
     "name": "usl",
     "type": "number",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Upper specification limit (optional)."
    },
    {
     "name": "process_mean",
     "type": "number",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Known (standard) process mean: centres the chart. Without data, the mean of the described process."
    },
    {
     "name": "process_sigma",
     "type": "number",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Known (standard) process standard deviation, greater than 0: sets the limits. Without data, the sigma of the described process."
    },
    {
     "name": "constants_table_max_n",
     "type": "integer",
     "unit": "1",
     "default": 0,
     "enum": null,
     "description": "If 2 or more, also tabulate d2, d3, c4, A2, A3, B3-B6, D1-D4, E2 for n = 2 up to this, at limit_sigmas (out/constants.csv)."
    }
   ],
   "outputs": [
    {
     "name": "data_unit",
     "unit": "1",
     "description": "The unit the location readings are in."
    },
    {
     "name": "mode",
     "unit": "1",
     "description": "\"data\" (charted measurements) or \"model\" (constants and a described process)."
    },
    {
     "name": "chart",
     "unit": "1",
     "description": null
    },
    {
     "name": "subgroup_size",
     "unit": "1",
     "description": null
    },
    {
     "name": "subgroups_n",
     "unit": "1",
     "description": null
    },
    {
     "name": "observations_n",
     "unit": "1",
     "description": null
    },
    {
     "name": "limit_sigmas",
     "unit": "1",
     "description": null
    },
    {
     "name": "false_alarm_rate",
     "unit": "1",
     "description": "Probability that one in-control point falls beyond the limits, 2 (1 - Phi(L))."
    },
    {
     "name": "arl_in_control",
     "unit": "1",
     "description": "Average run length between false alarms, in points."
    },
    {
     "name": "mean",
     "unit": null,
     "description": "Grand mean of the data (or the described process mean)."
    },
    {
     "name": "sigma_within",
     "unit": null,
     "description": "Mean range / d2, mean s / c4, or mean moving range / d2(2)."
    },
    {
     "name": "sigma_overall",
     "unit": null,
     "description": "Sample standard deviation of every observation (n - 1)."
    },
    {
     "name": "dispersion_mean",
     "unit": null,
     "description": null
    },
    {
     "name": "location_cl",
     "unit": null,
     "description": null
    },
    {
     "name": "location_lcl",
     "unit": null,
     "description": null
    },
    {
     "name": "location_ucl",
     "unit": null,
     "description": null
    },
    {
     "name": "dispersion_cl",
     "unit": null,
     "description": null
    },
    {
     "name": "dispersion_lcl",
     "unit": null,
     "description": null
    },
    {
     "name": "dispersion_ucl",
     "unit": null,
     "description": null
    },
    {
     "name": "in_control",
     "unit": "1",
     "description": "true when no rule fired; null without data."
    },
    {
     "name": "signals_n",
     "unit": "1",
     "description": null
    },
    {
     "name": "signal_points_n",
     "unit": "1",
     "description": null
    },
    {
     "name": "signals",
     "unit": "1",
     "description": null
    },
    {
     "name": "signals_detail",
     "unit": "1",
     "description": null
    },
    {
     "name": "rule_counts",
     "unit": "1",
     "description": null
    },
    {
     "name": "cp",
     "unit": "1",
     "description": "(USL - LSL) / 6 sigma_within."
    },
    {
     "name": "cpk",
     "unit": "1",
     "description": "min(USL - mean, mean - LSL) / 3 sigma_within."
    },
    {
     "name": "cpu",
     "unit": "1",
     "description": null
    },
    {
     "name": "cpl",
     "unit": "1",
     "description": null
    },
    {
     "name": "pp",
     "unit": "1",
     "description": "(USL - LSL) / 6 sigma_overall."
    },
    {
     "name": "ppk",
     "unit": "1",
     "description": "As Cpk with sigma_overall."
    },
    {
     "name": "sigma_level",
     "unit": "1",
     "description": "3 Cpk: the distance from the mean to the nearer specification limit in sigma_within."
    },
    {
     "name": "fraction_outside_expected",
     "unit": "1",
     "description": "ppm_expected / 1e6: the fraction of parts expected outside the specification, the number to chain into other runs."
    },
    {
     "name": "ppm_expected",
     "unit": null,
     "description": "No unit the kernel can check (ppm is not in its table): read it as a count per million. Parts per million expected outside the specification, normal with the mean and sigma_within (a count per million parts, not a fraction)."
    },
    {
     "name": "ppm_below_lsl",
     "unit": null,
     "description": "No unit the kernel can check (ppm is not in its table): read it as a count per million. Parts per million expected below LSL."
    },
    {
     "name": "ppm_above_usl",
     "unit": null,
     "description": "No unit the kernel can check (ppm is not in its table): read it as a count per million. Parts per million expected above USL."
    },
    {
     "name": "ppm_expected_overall",
     "unit": null,
     "description": "No unit the kernel can check (ppm is not in its table): read it as a count per million. Parts per million expected outside, with sigma_overall."
    },
    {
     "name": "ppm_observed",
     "unit": null,
     "description": "No unit the kernel can check (ppm is not in its table): read it as a count per million. Parts per million of the measurements that fall outside the specification."
    },
    {
     "name": "constants",
     "unit": "1",
     "description": "d2, d3, c4 (by integration), c4_gamma (Gamma-function check), and A2, A3, B3-B6, D1-D4, E2 at limit_sigmas for the subgroup size."
    },
    {
     "name": "constants_table",
     "unit": "1",
     "description": null
    },
    {
     "name": "points",
     "unit": "1",
     "description": null
    },
    {
     "name": "points_truncated",
     "unit": "1",
     "description": null
    },
    {
     "name": "notes",
     "unit": "1",
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "n = 2 closed forms: d2 = 2/sqrt(pi), d3 = sqrt(2 - 4/pi), c4 = sqrt(2/pi), D4 = 1 + 3 sqrt(pi/2 - 1) (textbook 3.267); d2, d3 by 12-point Gauss-Legendre quadrature, rel 1e-8",
     "checks": [
      "constants.D4",
      "constants.c4",
      "constants.c4_gamma",
      "constants.d2",
      "constants.d3"
     ]
    },
    {
     "name": "n = 3 closed forms: d2 = 3/sqrt(pi), c4 = Gamma(3/2) = sqrt(pi)/2, rel 1e-8 (quadrature)",
     "checks": [
      "constants.c4",
      "constants.d2"
     ]
    },
    {
     "name": "n = 5: c4 = sqrt(2/4) Gamma(5/2)/Gamma(2) = 3 sqrt(pi)/(4 sqrt 2), A3 = 3/(c4 sqrt 5) (closed forms, rel 1e-9); d2(5) = 2.32593 and A2(5) = 0.577 (Tippett 1925 / ASTM STP 15D textbook table, abs to its last digit)",
     "checks": [
      "constants.A2",
      "constants.A3",
      "constants.c4",
      "constants.d2"
     ]
    },
    {
     "name": "centred process, sigma = (USL - LSL)/6: Cp = Cpk = 1, ppm = 1e6 erfc(3/sqrt 2) = 2699.796 (textbook 2700), ARL = 1/erfc(3/sqrt 2) = 370.4; closed forms, rel 1e-6",
     "checks": [
      "arl_in_control",
      "cp",
      "cpk",
      "false_alarm_rate",
      "ppm_expected"
     ]
    },
    {
     "name": "six sigma with a 1.5 sigma shift (Motorola): Cp = 2, Cpk = 1.5, ppm = 1e6 (Q(4.5) + Q(7.5)) = 3.3977 (textbook 3.4); closed forms, rel 1e-6",
     "checks": [
      "cp",
      "cpk",
      "fraction_outside_expected",
      "ppm_expected"
     ]
    },
    {
     "name": "I-MR by hand on 1,3,2,4,3: mean 2.6, mean MR 1.5, sigma = 1.5 sqrt(pi)/2, UCL = 2.6 + 3 sigma, MR UCL = 1.5 (1 + 3 sqrt(pi/2 - 1)), s = sqrt(1.3); exact arithmetic, rel 1e-8 (d2, d3 by quadrature)",
     "checks": [
      "chart",
      "dispersion_mean",
      "dispersion_ucl",
      "in_control",
      "location_lcl",
      "location_ucl",
      "mean",
      "sigma_overall",
      "sigma_within"
     ]
    },
    {
     "name": "X-bar R by hand on four subgroups (-1, 1), specs -6..6: sigma_within = R/d2 = sqrt(pi), Cp = Cpk = 2/sqrt(pi), s = sqrt(8/7), Pp = 2 sqrt(7/8), UCL = 3 sqrt(pi/2), R UCL = 2 (1 + 3 sqrt(pi/2 - 1)); exact arithmetic, rel 1e-8",
     "checks": [
      "chart",
      "cp",
      "cpk",
      "dispersion_ucl",
      "location_ucl",
      "pp",
      "ppk",
      "ppm_observed",
      "sigma_within"
     ]
    },
    {
     "name": "rules by construction, standards mean 0 sigma 1: a 4 sigma spike gives 1 point beyond 3 sigma and 2 moving ranges of 4 above (d2 + 3 d3) = 3.686; then 8 points at +0.5 sigma give one run of 8 (Western Electric)",
     "checks": [
      "dispersion_ucl",
      "in_control",
      "rule_counts.beyond_limits",
      "rule_counts.dispersion_beyond_limits",
      "rule_counts.four_of_five_beyond_1_sigma",
      "rule_counts.run_same_side",
      "rule_counts.two_of_three_beyond_2_sigma"
     ]
    }
   ],
   "title": "Control chart and process capability",
   "needs_build": true,
   "category": "Measurement and data",
   "known_answers": 45
  },
  {
   "name": "crystal_lattice",
   "version": "0.1.0",
   "summary": "Crystallography of one unit cell, any of the seven crystal systems: cell volume and reciprocal cell, the spacing d of any plane (hkl), its Bragg angle at a wavelength, which reflections the centring (P, I, F, A, B, C, R) or the diamond and hcp structures extinguish, the theoretical density from the atoms in the cell, and for sc, bcc, fcc, hcp and diamond the nearest-neighbour distance, coordination number and hard-sphere packing fraction found from the atom positions. Writes the powder line positions and multiplicities as a csv. No intensities: no structure factors or scattering factors.",
   "runtime": "native",
   "timeout_s": 30,
   "estimate_s": 0.1,
   "inputs": [
    {
     "name": "structure",
     "type": "string",
     "unit": null,
     "default": "custom",
     "enum": [
      "custom",
      "sc",
      "bcc",
      "fcc",
      "hcp",
      "diamond"
     ],
     "description": "A one-element structure fixes system, centring and atom positions; custom takes them from system and centring."
    },
    {
     "name": "system",
     "type": "string",
     "unit": null,
     "default": "cubic",
     "enum": [
      "cubic",
      "tetragonal",
      "orthorhombic",
      "hexagonal",
      "trigonal",
      "monoclinic",
      "triclinic"
     ],
     "description": "Crystal system. trigonal means rhombohedral axes (a, alpha); monoclinic has unique axis b."
    },
    {
     "name": "centring",
     "type": "string",
     "unit": null,
     "default": "P",
     "enum": [
      "P",
      "I",
      "F",
      "A",
      "B",
      "C",
      "R"
     ],
     "description": "Lattice centring; R is a rhombohedral lattice on hexagonal axes, obverse setting."
    },
    {
     "name": "a_A",
     "type": "number",
     "unit": "\u00c5",
     "default": null,
     "enum": null,
     "description": "Cell edge a."
    },
    {
     "name": "b_A",
     "type": "number",
     "unit": "\u00c5",
     "default": null,
     "enum": null,
     "description": "Cell edge b; leave out where the system fixes it."
    },
    {
     "name": "c_A",
     "type": "number",
     "unit": "\u00c5",
     "default": null,
     "enum": null,
     "description": "Cell edge c; leave out where the system fixes it. For hcp, left out means the ideal sqrt(8/3) a."
    },
    {
     "name": "alpha_deg",
     "type": "number",
     "unit": "deg",
     "default": null,
     "enum": null,
     "description": "Cell angle alpha; leave out where the system fixes it."
    },
    {
     "name": "beta_deg",
     "type": "number",
     "unit": "deg",
     "default": null,
     "enum": null,
     "description": "Cell angle beta; leave out where the system fixes it."
    },
    {
     "name": "gamma_deg",
     "type": "number",
     "unit": "deg",
     "default": null,
     "enum": null,
     "description": "Cell angle gamma; leave out where the system fixes it."
    },
    {
     "name": "hkl",
     "type": "array",
     "unit": null,
     "default": [
      [
       1,
       1,
       1
      ]
     ],
     "enum": null,
     "description": "Planes to report, as [h, k, l] triples. The first one feeds d_A and two_theta_deg."
    },
    {
     "name": "wavelength_A",
     "type": "number",
     "unit": "\u00c5",
     "default": 1.5406,
     "enum": null,
     "description": "Radiation wavelength; the default is Cu K-alpha1."
    },
    {
     "name": "two_theta_max_deg",
     "type": "number",
     "unit": "deg",
     "default": 120,
     "enum": null,
     "description": "Upper end of the powder pattern."
    },
    {
     "name": "molar_mass_g_per_mol",
     "type": "number",
     "unit": "g/mol",
     "default": null,
     "enum": null,
     "description": "Molar mass of one formula unit (one atom for the named structures); gives the density."
    },
    {
     "name": "formula_units",
     "type": "number",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "Formula units per cell (Z), for a custom cell with molar_mass_g_per_mol."
    },
    {
     "name": "atoms",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "The cell contents instead of molar_mass_g_per_mol: atoms per cell of each kind with their molar masses."
    }
   ],
   "outputs": [
    {
     "name": "a_A",
     "unit": "\u00c5",
     "description": null
    },
    {
     "name": "b_A",
     "unit": "\u00c5",
     "description": null
    },
    {
     "name": "c_A",
     "unit": "\u00c5",
     "description": null
    },
    {
     "name": "alpha_deg",
     "unit": "deg",
     "description": null
    },
    {
     "name": "beta_deg",
     "unit": "deg",
     "description": null
    },
    {
     "name": "gamma_deg",
     "unit": "deg",
     "description": null
    },
    {
     "name": "c_over_a",
     "unit": "1",
     "description": null
    },
    {
     "name": "volume_A3",
     "unit": "\u00c5^3",
     "description": null
    },
    {
     "name": "reciprocal",
     "unit": null,
     "description": "Reciprocal cell (crystallographers' convention, no 2 pi)."
    },
    {
     "name": "atoms_per_cell",
     "unit": "1",
     "description": null
    },
    {
     "name": "formula_units",
     "unit": "1",
     "description": null
    },
    {
     "name": "mass_per_cell_g_per_mol",
     "unit": "g/mol",
     "description": "Mass of one mole of cells."
    },
    {
     "name": "density_g_per_cm3",
     "unit": "g/cm^3",
     "description": "Theoretical (X-ray) density; null without masses."
    },
    {
     "name": "nearest_neighbour_A",
     "unit": "\u00c5",
     "description": "Named structures only."
    },
    {
     "name": "atomic_radius_A",
     "unit": "\u00c5",
     "description": "Half the nearest-neighbour distance."
    },
    {
     "name": "coordination_number",
     "unit": "1",
     "description": "Atoms at exactly the nearest-neighbour distance. A real hcp metal (c/a not sqrt(8/3)) gives 6, not the 12 of the ideal cell."
    },
    {
     "name": "packing_fraction",
     "unit": "1",
     "description": "Equal hard spheres touching at the nearest-neighbour distance."
    },
    {
     "name": "wavelength_A",
     "unit": "\u00c5",
     "description": null
    },
    {
     "name": "d_min_A",
     "unit": "\u00c5",
     "description": "Smallest spacing reachable below two_theta_max_deg."
    },
    {
     "name": "d_A",
     "unit": "\u00c5",
     "description": "Spacing of the first plane in hkl."
    },
    {
     "name": "two_theta_deg",
     "unit": "deg",
     "description": "Bragg 2 theta of the first plane in hkl; null when lambda > 2d."
    },
    {
     "name": "allowed",
     "unit": null,
     "description": "Whether the first plane in hkl survives the reflection rule."
    },
    {
     "name": "reflections",
     "unit": null,
     "description": "One row per plane in hkl; also out/reflections.csv."
    },
    {
     "name": "n_lines",
     "unit": "1",
     "description": "Powder lines below two_theta_max_deg."
    },
    {
     "name": "first_line_two_theta_deg",
     "unit": "deg",
     "description": null
    },
    {
     "name": "lines",
     "unit": null,
     "description": "First 40 powder lines; all of them in out/powder_pattern.csv. Planes sharing one d (333 and 511) are one line, named after one of them, multiplicities added."
    },
    {
     "name": "pattern_complete",
     "unit": null,
     "description": "False when the index limit of 40 cut the pattern short, or it has no line."
    }
   ],
   "selftests": [
    {
     "name": "silicon, diamond cubic a = 5.4310 A at Cu K-alpha1 1.5406 A: closed forms d = a/sqrt(h^2+k^2+l^2) (d111 = 3.1356 A), Bragg 2theta = 2 asin(lambda/2d) (28.44 deg), packing pi sqrt(3)/16 = 0.34009, neighbour a sqrt(3)/4; diamond rule: 200 and 222 absent, so the lines run 111 (x8), 220 (x12), 311 (x24) (rel 1e-9)",
     "checks": [
      "atoms_per_cell",
      "coordination_number",
      "d_A",
      "lines.0.multiplicity",
      "lines.0.name",
      "lines.1.multiplicity",
      "lines.1.name",
      "lines.1.two_theta_deg",
      "lines.2.multiplicity",
      "lines.2.name",
      "lines.2.two_theta_deg",
      "n_lines",
      "nearest_neighbour_A",
      "packing_fraction",
      "reflections.0.allowed",
      "reflections.1.allowed",
      "reflections.2.allowed",
      "reflections.3.allowed",
      "reflections.3.d_A",
      "two_theta_deg",
      "volume_A3"
     ]
    },
    {
     "name": "copper, fcc a = 3.6149 A, M = 63.546 g/mol: density 4M/(N_A a^3) = 8.935 g/cm^3, packing pi/(3 sqrt 2) = 0.74048, neighbour a/sqrt(2), 12 neighbours; F rule (all odd or all even): 100 and 110 absent, 111 and 200 present (rel 1e-9)",
     "checks": [
      "atoms_per_cell",
      "coordination_number",
      "d_A",
      "density_g_per_cm3",
      "lines.0.multiplicity",
      "lines.0.name",
      "lines.1.multiplicity",
      "lines.1.name",
      "nearest_neighbour_A",
      "packing_fraction",
      "reflections.0.allowed",
      "reflections.1.allowed",
      "reflections.2.allowed",
      "reflections.3.allowed",
      "reflections.3.two_theta_deg"
     ]
    },
    {
     "name": "alpha iron, bcc a = 2.8665 A, M = 55.845 g/mol: density 2M/(N_A a^3) = 7.874 g/cm^3, packing pi sqrt(3)/8 = 0.68017, neighbour a sqrt(3)/2, 8 neighbours; I rule (h+k+l even): 100 and 111 absent, 110 and 200 present (rel 1e-9)",
     "checks": [
      "coordination_number",
      "d_A",
      "density_g_per_cm3",
      "lines.0.multiplicity",
      "lines.0.name",
      "nearest_neighbour_A",
      "packing_fraction",
      "reflections.0.allowed",
      "reflections.1.allowed",
      "reflections.2.allowed",
      "reflections.3.allowed",
      "two_theta_deg"
     ]
    },
    {
     "name": "simple cubic a = 3 A: packing pi/6 = 0.52360, neighbour a, 6 neighbours, one atom per cell, every reflection present, first line 100 (x6) at 2 asin(lambda/2a) (rel 1e-9)",
     "checks": [
      "allowed",
      "atoms_per_cell",
      "coordination_number",
      "lines.0.multiplicity",
      "lines.0.name",
      "nearest_neighbour_A",
      "packing_fraction",
      "two_theta_deg",
      "volume_A3"
     ]
    },
    {
     "name": "ideal hcp a = 3.2094 A, c left out: c/a = sqrt(8/3), packing pi/(3 sqrt 2) = 0.74048 (same as fcc), 12 neighbours at a, volume (sqrt 3/2) a^2 c; 001 absent (l odd, h+2k = 3n), 002 at c/2, 100 at a sqrt(3)/2, 101 present from 1/d^2 = 4(h^2+hk+k^2)/(3a^2) + l^2/c^2 (rel 1e-9)",
     "checks": [
      "c_over_a",
      "coordination_number",
      "d_A",
      "nearest_neighbour_A",
      "packing_fraction",
      "reflections.0.allowed",
      "reflections.1.allowed",
      "reflections.2.d_A",
      "reflections.3.allowed",
      "reflections.3.d_A",
      "volume_A3"
     ]
    },
    {
     "name": "triclinic 4 x 5 x 6 A with all angles 90 deg: the triclinic volume formula reduces to abc = 120 A^3 and d123 to 1/sqrt(1/a^2 + 4/b^2 + 9/c^2) (rel 1e-9)",
     "checks": [
      "d_A",
      "reciprocal.a_star_per_A",
      "reciprocal.gamma_star_deg",
      "volume_A3"
     ]
    },
    {
     "name": "rhombohedral cell a = 2.5 A, alpha = 60 deg (the primitive cell of fcc with cube edge a sqrt 2): volume a^3/sqrt(2), a quarter of the cube; its 111 and 100 planes are both cube {111} planes, d = a sqrt(2/3) (rel 1e-9)",
     "checks": [
      "d_A",
      "reflections.1.d_A",
      "volume_A3"
     ]
    },
    {
     "name": "monoclinic 5 x 6 x 7 A, beta = 110 deg: volume abc sin(beta), d100 = a sin(beta), d010 = b, d001 = c sin(beta), beta* = 180 - beta (rel 1e-9)",
     "checks": [
      "d_A",
      "reciprocal.a_star_per_A",
      "reciprocal.beta_star_deg",
      "reflections.1.d_A",
      "reflections.2.d_A",
      "volume_A3"
     ]
    },
    {
     "name": "hexagonal a = 3 A, c = 5 A: volume (sqrt 3/2) a^2 c, d110 = a/2, d112 from 1/d^2 = 4(h^2+hk+k^2)/(3a^2) + l^2/c^2, a* = 2/(a sqrt 3), gamma* = 60 deg (rel 1e-9)",
     "checks": [
      "d_A",
      "reciprocal.a_star_per_A",
      "reciprocal.gamma_star_deg",
      "reflections.1.d_A",
      "volume_A3"
     ]
    },
    {
     "name": "copper as an R lattice on hexagonal axes (a = a_c/sqrt 2, c = a_c sqrt 3, Z = 3, a_c = 3.6149 A): the same crystal as the fcc case, so density 4M/(N_A a_c^3) = 8.935 g/cm^3, volume 3 a_c^3/4, lines a_c/sqrt 3 (x8) then a_c/2 (x6); R rule -h+k+l = 3n: 001, 002, 100 absent, 003 and 101 present (rel 1e-9)",
     "checks": [
      "d_A",
      "density_g_per_cm3",
      "lines.0.d_A",
      "lines.0.multiplicity",
      "lines.1.d_A",
      "lines.1.multiplicity",
      "reflections.0.allowed",
      "reflections.1.allowed",
      "reflections.2.allowed",
      "reflections.3.allowed",
      "reflections.4.allowed",
      "reflections.4.d_A",
      "volume_A3"
     ]
    },
    {
     "name": "A-centred orthorhombic 4 x 5 x 6 A: the extra lattice point at (0, 1/2, 1/2) gives the structure factor 1 + exp(i pi (k+l)), zero when k+l is odd, so 010, 001, 110, 101, 1 -2 3 are absent; the lines run 100 (x2, d = 4 A), 011 (x4, d from 1/d^2 = h^2/a^2 + k^2/b^2 + l^2/c^2), 002 (x2, d = 3 A) (rel 1e-9)",
     "checks": [
      "allowed",
      "d_A",
      "lines.0.d_A",
      "lines.0.multiplicity",
      "lines.0.name",
      "lines.0.two_theta_deg",
      "lines.1.d_A",
      "lines.1.multiplicity",
      "lines.1.name",
      "lines.2.d_A",
      "lines.2.multiplicity",
      "lines.2.name",
      "reflections.0.allowed",
      "reflections.1.allowed",
      "reflections.2.allowed",
      "reflections.3.allowed",
      "reflections.4.allowed",
      "reflections.5.allowed",
      "reflections.6.allowed",
      "reflections.7.allowed"
     ]
    },
    {
     "name": "B-centred orthorhombic 4 x 5 x 6 A: the extra lattice point at (1/2, 0, 1/2) gives the structure factor 1 + exp(i pi (h+l)), zero when h+l is odd, so 100, 001, 110, 011 are absent; the lines run 010 (x2, d = 5 A), 101 (x4, d from 1/d^2 = h^2/a^2 + k^2/b^2 + l^2/c^2), 002 (x2, d = 3 A) (rel 1e-9)",
     "checks": [
      "allowed",
      "d_A",
      "lines.0.d_A",
      "lines.0.multiplicity",
      "lines.0.name",
      "lines.0.two_theta_deg",
      "lines.1.d_A",
      "lines.1.multiplicity",
      "lines.1.name",
      "lines.2.d_A",
      "lines.2.multiplicity",
      "lines.2.name",
      "reflections.0.allowed",
      "reflections.1.allowed",
      "reflections.2.allowed",
      "reflections.3.allowed",
      "reflections.4.allowed",
      "reflections.5.allowed",
      "reflections.6.allowed",
      "reflections.7.allowed"
     ]
    },
    {
     "name": "C-centred orthorhombic 4 x 5 x 6 A: the extra lattice point at (1/2, 1/2, 0) gives the structure factor 1 + exp(i pi (h+k)), zero when h+k is odd, so 100, 010, 101, 011, 1 -2 3 are absent; the lines run 001 (x2, d = 6 A), 110 (x4, d from 1/d^2 = h^2/a^2 + k^2/b^2 + l^2/c^2), 002 (x2, d = 3 A) (rel 1e-9)",
     "checks": [
      "allowed",
      "d_A",
      "lines.0.d_A",
      "lines.0.multiplicity",
      "lines.0.name",
      "lines.0.two_theta_deg",
      "lines.1.d_A",
      "lines.1.multiplicity",
      "lines.1.name",
      "lines.2.d_A",
      "lines.2.multiplicity",
      "lines.2.name",
      "reflections.0.allowed",
      "reflections.1.allowed",
      "reflections.2.allowed",
      "reflections.3.allowed",
      "reflections.4.allowed",
      "reflections.5.allowed",
      "reflections.6.allowed",
      "reflections.7.allowed"
     ]
    }
   ],
   "title": "Crystal lattice",
   "needs_build": true,
   "category": "Materials and crystals",
   "known_answers": 159
  },
  {
   "name": "diffraction",
   "version": "0.1.0",
   "summary": "Fraunhofer (far-field) diffraction at normal incidence by a single slit, a double slit, an N-slit grating and a circular aperture: intensity against angle, dark fringes and maxima, missing orders, resolving power mN and the Rayleigh limit, with the pattern as csv. Scalar theory; Bessel functions and every root computed, nothing tabled.",
   "runtime": "native",
   "timeout_s": 60,
   "estimate_s": 0.1,
   "inputs": [
    {
     "name": "aperture",
     "type": "string",
     "unit": null,
     "default": "single_slit",
     "enum": [
      "single_slit",
      "double_slit",
      "grating",
      "circular"
     ],
     "description": "single_slit (uses slit_width_um), double_slit and grating (slit_width_um, slit_spacing_um, slits, order), circular (diameter_mm)."
    },
    {
     "name": "wavelength_nm",
     "type": "number",
     "unit": "nm",
     "default": 632.8,
     "enum": null,
     "description": "Wavelength in the medium around the aperture."
    },
    {
     "name": "slit_width_um",
     "type": "number",
     "unit": "\u00b5m",
     "default": 50,
     "enum": null,
     "description": "Width a of each slit."
    },
    {
     "name": "slit_spacing_um",
     "type": "number",
     "unit": "\u00b5m",
     "default": 250,
     "enum": null,
     "description": "Centre-to-centre spacing d of the slits (grating period); at least slit_width_um."
    },
    {
     "name": "slits",
     "type": "integer",
     "unit": "1",
     "default": 2,
     "enum": null,
     "description": "Number of slits N lit by the beam (2 for double_slit)."
    },
    {
     "name": "order",
     "type": "integer",
     "unit": "1",
     "default": 1,
     "enum": null,
     "description": "Diffraction order m to report (angle, peak height, resolving power mN, dispersion)."
    },
    {
     "name": "diameter_mm",
     "type": "number",
     "unit": "mm",
     "default": 1,
     "enum": null,
     "description": "Diameter D of the circular aperture (lens, mirror, pinhole)."
    },
    {
     "name": "screen_distance_m",
     "type": "number",
     "unit": "m",
     "default": 1,
     "enum": null,
     "description": "Distance L to the screen, or the focal length of the lens that focuses the pattern (then set focused = true)."
    },
    {
     "name": "focused",
     "type": "boolean",
     "unit": null,
     "default": false,
     "enum": null,
     "description": "true: the pattern is formed in the focal plane of a lens of focal length screen_distance_m, so no far-field warning."
    },
    {
     "name": "points",
     "type": "integer",
     "unit": "1",
     "default": 2001,
     "enum": null,
     "description": "Evenly spaced angles in pattern.csv (narrow grating orders get extra samples)."
    },
    {
     "name": "angle_max_deg",
     "type": "number",
     "unit": "deg",
     "default": null,
     "enum": null,
     "description": "Largest angle from the axis in pattern.csv (optional; by default about three side lobes, or past the order asked for)."
    },
    {
     "name": "query_angle_deg",
     "type": "number",
     "unit": "deg",
     "default": null,
     "enum": null,
     "description": "Optional: an angle at which to report the relative intensity."
    },
    {
     "name": "separation_urad",
     "type": "number",
     "unit": "\u00b5rad",
     "default": null,
     "enum": null,
     "description": "Optional, single_slit or circular: angular separation of two point sources, judged against the Rayleigh limit."
    },
    {
     "name": "delta_wavelength_nm",
     "type": "number",
     "unit": "nm",
     "default": null,
     "enum": null,
     "description": "Optional, double_slit or grating: wavelength gap of two lines, judged against the resolving power mN."
    }
   ],
   "outputs": [
    {
     "name": "aperture",
     "unit": null,
     "description": "single_slit, double_slit, grating or circular"
    },
    {
     "name": "first_zero_deg",
     "unit": "deg",
     "description": "First dark fringe (slit, N slits) or dark ring (circle) from the axis."
    },
    {
     "name": "first_zero_mm",
     "unit": "mm",
     "description": "Its distance from the axis on the screen, L tan t."
    },
    {
     "name": "central_peak_width_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "zeros_deg",
     "unit": "deg",
     "description": null
    },
    {
     "name": "first_side_max_beta_over_pi",
     "unit": "1",
     "description": "Single slit: root of tan b = b over pi."
    },
    {
     "name": "first_side_max_rel",
     "unit": "1",
     "description": "Single slit: first side maximum over the central peak, 1/(1 + b^2)."
    },
    {
     "name": "first_side_max_deg",
     "unit": "deg",
     "description": null
    },
    {
     "name": "central_fwhm_lambda_over_width",
     "unit": "1",
     "description": "Full width at half maximum of the central peak in lambda/a (slit) or lambda/D (circle)."
    },
    {
     "name": "central_fwhm_deg",
     "unit": "deg",
     "description": null
    },
    {
     "name": "rayleigh_limit_deg",
     "unit": "deg",
     "description": null
    },
    {
     "name": "rayleigh_limit_urad",
     "unit": "\u00b5rad",
     "description": "Angle of the first zero: sin t = lambda/a (slit), 1.21967 lambda/D (circle)."
    },
    {
     "name": "first_zero_lambda_over_D",
     "unit": "1",
     "description": "Circle: j_{1,1}/pi."
    },
    {
     "name": "first_ring_lambda_over_D",
     "unit": "1",
     "description": "Circle: first bright ring at j_{2,1}/pi."
    },
    {
     "name": "first_ring_peak_rel",
     "unit": "1",
     "description": "Circle: first bright ring over the central peak."
    },
    {
     "name": "airy_disc_energy_fraction",
     "unit": "1",
     "description": "Circle: share of the light inside the first dark ring, 1 - J0^2 - J1^2 (Rayleigh)."
    },
    {
     "name": "dark_rings",
     "unit": null,
     "description": null
    },
    {
     "name": "slits",
     "unit": "1",
     "description": null
    },
    {
     "name": "order",
     "unit": "1",
     "description": null
    },
    {
     "name": "max_order",
     "unit": "1",
     "description": "Highest order that exists, floor(d/lambda)."
    },
    {
     "name": "peak_gain_over_single_slit",
     "unit": "1",
     "description": "N^2."
    },
    {
     "name": "secondary_maxima_between_orders",
     "unit": "1",
     "description": "N - 2."
    },
    {
     "name": "fringe_spacing_mm",
     "unit": "mm",
     "description": "Paraxial spacing of the principal maxima on the screen, lambda L / d."
    },
    {
     "name": "missing_orders",
     "unit": "1",
     "description": "Orders that fall on a zero of the slit envelope (m a / d whole)."
    },
    {
     "name": "fringes_in_central_peak",
     "unit": "1",
     "description": null
    },
    {
     "name": "envelope_first_zero_deg",
     "unit": "deg",
     "description": null
    },
    {
     "name": "order_angle_deg",
     "unit": "deg",
     "description": "d sin t = m lambda."
    },
    {
     "name": "order_position_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "order_missing",
     "unit": null,
     "description": "true when order m falls on a zero of the slit envelope"
    },
    {
     "name": "order_peak_rel",
     "unit": "1",
     "description": "Height of order m over the central peak, (sin b / b)^2 at b = pi a m / d."
    },
    {
     "name": "order_halfwidth_deg",
     "unit": "deg",
     "description": "From order m to the dark fringe beside it."
    },
    {
     "name": "resolving_power",
     "unit": "1",
     "description": "m N."
    },
    {
     "name": "min_resolvable_nm",
     "unit": "nm",
     "description": "lambda / (m N)."
    },
    {
     "name": "free_spectral_range_nm",
     "unit": "nm",
     "description": "lambda / m."
    },
    {
     "name": "dispersion_deg_per_nm",
     "unit": "deg/nm",
     "description": "m / (d cos t)."
    },
    {
     "name": "required_resolving_power",
     "unit": "1",
     "description": "lambda / delta_lambda."
    },
    {
     "name": "min_slits_to_resolve",
     "unit": "1",
     "description": null
    },
    {
     "name": "resolved",
     "unit": null,
     "description": "Rayleigh criterion met (set when separation_urad or delta_wavelength_nm is given)."
    },
    {
     "name": "resolution_margin",
     "unit": "1",
     "description": "Separation over the Rayleigh limit, or mN over lambda/delta_lambda."
    },
    {
     "name": "fresnel_number",
     "unit": "1",
     "description": "(W/2)^2 / (lambda L) for the whole aperture; Fraunhofer needs it well below 1."
    },
    {
     "name": "far_field_distance_m",
     "unit": "m",
     "description": "2 W^2 / lambda."
    },
    {
     "name": "intensity_at_query_rel",
     "unit": "1",
     "description": null
    },
    {
     "name": "maxima",
     "unit": null,
     "description": null
    },
    {
     "name": "angle_max_deg",
     "unit": "deg",
     "description": null
    },
    {
     "name": "pattern_points",
     "unit": "1",
     "description": null
    },
    {
     "name": "warnings",
     "unit": null,
     "description": "list of plain-language warnings"
    }
   ],
   "selftests": [
    {
     "name": "single slit, closed form (Hecht 10.2.1): zeros at sin t = m lambda/a (500 nm, 10 um: asin 0.05, asin 0.1); first side maximum at tan b = b, b = 4.4934094579 = 1.4302966531 pi (A&S Table 4.19), height 1/(1+b^2) = 4.719 %; FWHM 2(1.3915573783)/pi = 0.8858929 lambda/a (root of sin x/x = 1/sqrt 2); 1e-9 rel on the asin values, 1e-8 on the tabled roots",
     "checks": [
      "central_fwhm_lambda_over_width",
      "first_side_max_beta_over_pi",
      "first_side_max_rel",
      "first_zero_deg",
      "first_zero_mm",
      "zeros_deg.1"
     ]
    },
    {
     "name": "circular aperture, Airy pattern (Born & Wolf 8.5.2): first dark ring at j11/pi = 3.8317059702/pi = 1.2196698913 lambda/D, first bright ring at j21/pi = 5.1356223018/pi = 1.6347193504 lambda/D (A&S Table 9.5), its height (2 J1(x)/x)^2 with J1(j21) = J2'(j21) = -0.3396687428 (A&S Table 9.5) = 1.7498 % (1e-8), light inside the first dark ring 1 - J0(j11)^2 = 83.78 % (Rayleigh, J0(j11) = -0.4027593957); 100 mm telescope at 550 nm: Rayleigh limit asin(1.2196698913 x 5.5e-6) = 6.7081844 urad, so 7 urad is resolved",
     "checks": [
      "airy_disc_energy_fraction",
      "first_ring_lambda_over_D",
      "first_ring_peak_rel",
      "first_zero_lambda_over_D",
      "rayleigh_limit_urad",
      "resolved"
     ]
    },
    {
     "name": "grating equation d sin t = m lambda (Hecht 10.2.8): 600 nm, d = 2 um, order 2: sin t = 0.6, t = 36.869897646 deg; resolving power mN = 2 x 1000 = 2000; order height (sin b/b)^2 at b = pi a m/d = pi/2 (a = 0.5 um) = 4/pi^2 = 0.405284735; dispersion m/(d cos t) = 1.25e-3 rad/nm = 0.0716197244 deg/nm; highest order floor(d/lambda) = 3; all 1e-9 rel",
     "checks": [
      "dispersion_deg_per_nm",
      "max_order",
      "min_resolvable_nm",
      "order_angle_deg",
      "order_peak_rel",
      "resolving_power"
     ]
    },
    {
     "name": "Young double slit (Hecht 9.3): He-Ne 632.8 nm, d = 100 um, a = 20 um, L = 2 m: fringe spacing lambda L/d = 12.656 mm; d/a = 5 so order 5 is missing and 2(5)-1 = 9 fringes sit in the central envelope; order 1 height (sin(pi/5)/(pi/5))^2 = 0.8751402001; peak gain N^2 = 4; 1e-9 rel",
     "checks": [
      "fringe_spacing_mm",
      "fringes_in_central_peak",
      "missing_orders.0",
      "order_peak_rel",
      "peak_gain_over_single_slit"
     ]
    },
    {
     "name": "grating resolves the sodium D doublet (Hecht 10.2.8): lambda/delta_lambda = 589.0/0.6 = 981.667 needed; 1000 lines in first order give mN = 1000, so resolved, and the fewest lines that do it is ceil(981.667) = 982; exact arithmetic, 1e-9 rel",
     "checks": [
      "min_slits_to_resolve",
      "required_resolving_power",
      "resolved",
      "resolving_power"
     ]
    }
   ],
   "title": "Fraunhofer diffraction",
   "needs_build": true,
   "category": "Waves, optics and circuits",
   "known_answers": 27
  },
  {
   "name": "diffusion_solid",
   "version": "0.1.0",
   "summary": "Diffusion in solids (Fick's second law, constant D): Arrhenius diffusivity from D0 and Q (or from D at two temperatures), constant-surface (erfc) and thin-film (Gaussian) profiles in a half-space, finite slab by Fourier series, depth for a target concentration, equivalent time at another temperature, homogenisation time; profile csv. erf/erfc computed in-house (series + continued fraction).",
   "runtime": "native",
   "timeout_s": 30,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "source",
     "type": "string",
     "unit": null,
     "default": "constant_surface",
     "enum": [
      "constant_surface",
      "thin_film",
      "slab"
     ],
     "description": "constant_surface: half-space, surface held at c_surface (erfc). thin_film: a dose film_dose on (or buried in) the surface (Gaussian). slab: thickness slab_thickness_m, both faces held at c_surface (Fourier series)."
    },
    {
     "name": "temperature_K",
     "type": "number",
     "unit": "K",
     "default": 1200,
     "enum": null,
     "description": "Temperature of the treatment."
    },
    {
     "name": "time_s",
     "type": "number",
     "unit": "s",
     "default": 3600,
     "enum": null,
     "description": "Time at temperature_K."
    },
    {
     "name": "d0_m2_s",
     "type": "number",
     "unit": "m^2/s",
     "default": 2.3e-05,
     "enum": null,
     "description": "Arrhenius pre-factor D0 (from your own data source). Ignored when d_at_t1_m2_s and d_at_t2_m2_s are given."
    },
    {
     "name": "q_kJ_per_mol",
     "type": "number",
     "unit": "kJ/mol",
     "default": 148,
     "enum": null,
     "description": "Activation energy Q (from your own data source). 0 makes D = D0 at every temperature."
    },
    {
     "name": "temperature2_K",
     "type": [
      "number",
      "null"
     ],
     "unit": "K",
     "default": null,
     "enum": null,
     "description": "Second temperature: gives D there and the time with the same D t (equivalent time); with d_at_t2_m2_s, the temperature of that measurement."
    },
    {
     "name": "d_at_t1_m2_s",
     "type": [
      "number",
      "null"
     ],
     "unit": "m^2/s",
     "default": null,
     "enum": null,
     "description": "Measured D at temperature_K. With d_at_t2_m2_s, D0 and Q are derived from the two points."
    },
    {
     "name": "d_at_t2_m2_s",
     "type": [
      "number",
      "null"
     ],
     "unit": "m^2/s",
     "default": null,
     "enum": null,
     "description": "Measured D at temperature2_K."
    },
    {
     "name": "c_surface",
     "type": "number",
     "unit": "1",
     "default": 1.0,
     "enum": null,
     "description": "Surface concentration Cs (any unit; every concentration in the same unit)."
    },
    {
     "name": "c_initial",
     "type": "number",
     "unit": "1",
     "default": 0.0,
     "enum": null,
     "description": "Initial uniform concentration C0."
    },
    {
     "name": "c_target",
     "type": [
      "number",
      "null"
     ],
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "Concentration whose depth is wanted."
    },
    {
     "name": "probe_depth_m",
     "type": "number",
     "unit": "m",
     "default": 0,
     "enum": null,
     "description": "Depth at which the concentration is read; with c_target (constant_surface), the time for c_target to reach this depth."
    },
    {
     "name": "film_dose",
     "type": "number",
     "unit": "m",
     "default": 1e-06,
     "enum": null,
     "description": "thin_film: amount per area, concentration unit times metre."
    },
    {
     "name": "film_buried",
     "type": "boolean",
     "unit": null,
     "default": false,
     "enum": null,
     "description": "thin_film: true for a film inside the body (spreads both ways, half the dose on each side)."
    },
    {
     "name": "slab_thickness_m",
     "type": "number",
     "unit": "m",
     "default": 0.01,
     "enum": null,
     "description": "slab: thickness L."
    },
    {
     "name": "slab_target_fraction",
     "type": "number",
     "unit": "1",
     "default": 0.99,
     "enum": null,
     "description": "slab: fraction of the way from C0 to Cs the mean must reach (homogenisation of the slab)."
    },
    {
     "name": "segregation_wavelength_m",
     "type": [
      "number",
      "null"
     ],
     "unit": "m",
     "default": null,
     "enum": null,
     "description": "Wavelength of a sinusoidal segregation (dendrite arm spacing): gives its relaxation and homogenisation times."
    },
    {
     "name": "residual_fraction",
     "type": "number",
     "unit": "1",
     "default": 0.01,
     "enum": null,
     "description": "Segregation amplitude left at the homogenisation time, as a fraction of the start."
    },
    {
     "name": "depth_max_m",
     "type": [
      "number",
      "null"
     ],
     "unit": "m",
     "default": null,
     "enum": null,
     "description": "Depth of the profile csv (default 4 x 2 sqrt(D t); slab: the thickness)."
    },
    {
     "name": "points",
     "type": "integer",
     "unit": "1",
     "default": 201,
     "enum": null,
     "description": "Points in the profile csv."
    }
   ],
   "outputs": [
    {
     "name": "source",
     "unit": null,
     "description": "which source was solved"
    },
    {
     "name": "arrhenius_from",
     "unit": null,
     "description": "inputs or two_points"
    },
    {
     "name": "gas_constant_J_per_mol_K",
     "unit": "J/(mol K)",
     "description": null
    },
    {
     "name": "d0_m2_s",
     "unit": "m^2/s",
     "description": null
    },
    {
     "name": "q_kJ_per_mol",
     "unit": "kJ/mol",
     "description": null
    },
    {
     "name": "diffusivity_m2_s",
     "unit": "m^2/s",
     "description": null
    },
    {
     "name": "diffusion_length_m",
     "unit": "m",
     "description": "sqrt(D t)"
    },
    {
     "name": "characteristic_depth_m",
     "unit": "m",
     "description": "2 sqrt(D t)"
    },
    {
     "name": "z_probe",
     "unit": "1",
     "description": "probe_depth_m / (2 sqrt(D t))"
    },
    {
     "name": "erf_z_probe",
     "unit": "1",
     "description": null
    },
    {
     "name": "erfc_z_probe",
     "unit": "1",
     "description": null
    },
    {
     "name": "c_at_probe",
     "unit": "1",
     "description": null
    },
    {
     "name": "depth_for_target_m",
     "unit": "m",
     "description": null
    },
    {
     "name": "z_for_target",
     "unit": "1",
     "description": null
    },
    {
     "name": "time_for_target_at_probe_s",
     "unit": "s",
     "description": null
    },
    {
     "name": "diffusivity2_m2_s",
     "unit": "m^2/s",
     "description": null
    },
    {
     "name": "time_equivalent_s",
     "unit": "s",
     "description": "time at temperature2_K with the same D t"
    },
    {
     "name": "segregation_relaxation_time_s",
     "unit": "s",
     "description": "lambda^2 / (4 pi^2 D)"
    },
    {
     "name": "segregation_remaining_fraction",
     "unit": "1",
     "description": null
    },
    {
     "name": "homogenisation_time_s",
     "unit": "s",
     "description": null
    },
    {
     "name": "uptake_per_area",
     "unit": "m",
     "description": "constant_surface: 2 (Cs - C0) sqrt(D t / pi), concentration unit times metre"
    },
    {
     "name": "surface_flux",
     "unit": "m/s",
     "description": "constant_surface: (Cs - C0) sqrt(D / (pi t)), concentration unit times m/s"
    },
    {
     "name": "film_peak_c",
     "unit": "1",
     "description": null
    },
    {
     "name": "film_mass_fraction_in_profile",
     "unit": "1",
     "description": null
    },
    {
     "name": "slab_fourier_number",
     "unit": "1",
     "description": null
    },
    {
     "name": "slab_method",
     "unit": null,
     "description": "fourier_series or image_sum"
    },
    {
     "name": "slab_terms",
     "unit": "1",
     "description": null
    },
    {
     "name": "slab_centre_c",
     "unit": "1",
     "description": null
    },
    {
     "name": "slab_mean_c",
     "unit": "1",
     "description": null
    },
    {
     "name": "slab_centre_fraction",
     "unit": "1",
     "description": null
    },
    {
     "name": "slab_mean_fraction",
     "unit": "1",
     "description": null
    },
    {
     "name": "slab_fourier_number_to_fraction",
     "unit": "1",
     "description": null
    },
    {
     "name": "slab_time_to_fraction_s",
     "unit": "s",
     "description": null
    },
    {
     "name": "profile_depth_max_m",
     "unit": "m",
     "description": null
    },
    {
     "name": "profile_points",
     "unit": "1",
     "description": null
    },
    {
     "name": "all_ok",
     "unit": null,
     "description": "true when there are no warnings"
    },
    {
     "name": "warnings",
     "unit": null,
     "description": "list of warnings"
    }
   ],
   "selftests": [
    {
     "name": "erfc profile at z = 0.5: erf(0.5) = 0.5204998778 (Abramowitz & Stegun Table 7.1), C = Cs - (Cs - C0) erf(z); halfway depth z = erfinv(0.5) = 0.4769362762; closed form, rel 1e-9",
     "checks": [
      "c_at_probe",
      "characteristic_depth_m",
      "depth_for_target_m",
      "erf_z_probe",
      "z_for_target"
     ]
    },
    {
     "name": "erfc profile at z = 1: erf(1) = 0.8427007929, erfc(1) = 0.1572992071 (Abramowitz & Stegun Table 7.1); closed form, rel 1e-9",
     "checks": [
      "c_at_probe",
      "erf_z_probe",
      "erfc_z_probe"
     ]
    },
    {
     "name": "depth grows as sqrt(t): halfway depth at t is 0.4769363 x 2 sqrt(Dt), so twice that depth is reached at exactly 4 t = 40000 s; closed form, rel 1e-9 (probe given to 15 digits)",
     "checks": [
      "time_for_target_at_probe_s"
     ]
    },
    {
     "name": "Arrhenius from two points: D = 1e-14 at 1000 K and 1e-12 at 1250 K give Q = R ln(100) / (1/1000 - 1/1250) = 191.4475768 kJ/mol and D0 = 1e-14 x 100^5 = 1e-4 m^2/s; equivalent time at 1250 K = t / 100; R = k_B N_A (CODATA exact); closed form, rel 1e-9",
     "checks": [
      "d0_m2_s",
      "diffusivity2_m2_s",
      "diffusivity_m2_s",
      "gas_constant_J_per_mol_K",
      "q_kJ_per_mol",
      "time_equivalent_s"
     ]
    },
    {
     "name": "Arrhenius forward: D0 = 1e-4 m^2/s, Q = 191.4475768 kJ/mol at 1000 K gives D = 1e-14 m^2/s (inverse of the two-point case); closed form, rel 1e-9",
     "checks": [
      "diffusion_length_m",
      "diffusivity_m2_s"
     ]
    },
    {
     "name": "thin film (Crank eq. 3.4, surface film): peak M / sqrt(pi D t) = 2e-3 / sqrt(pi); C = peak/e at depth 2 sqrt(Dt) = 1 mm; mass conserved (integral = 1, Simpson to z = 7, rel 1e-9); sinusoidal segregation tau = lambda^2 / (4 pi^2 D), homogenisation to 1 % = tau ln 100; closed form, rel 1e-9",
     "checks": [
      "depth_for_target_m",
      "film_mass_fraction_in_profile",
      "film_peak_c",
      "homogenisation_time_s",
      "segregation_relaxation_time_s"
     ]
    },
    {
     "name": "slab Fourier series (Crank eq. 4.17) at Fo = 1e-4 matches the half-space at early times: C(z = 1) = erfc(1) = 0.1572992071, mean uptake = 4 sqrt(Fo / pi) = 0.0225675833; 99 % of the mean at Fo = ln(800 / pi^2) / pi^2 = 0.4453220 (first term; the next is below 1e-16); image terms below erfc(49), rel 1e-8",
     "checks": [
      "c_at_probe",
      "slab_fourier_number",
      "slab_fourier_number_to_fraction",
      "slab_mean_fraction",
      "slab_method",
      "slab_time_to_fraction_s"
     ]
    }
   ],
   "title": "Diffusion in solids",
   "needs_build": true,
   "category": "Materials and crystals",
   "known_answers": 28
  },
  {
   "name": "draft",
   "version": "0.1.0",
   "summary": "The drafting engine (from DraftCore, with ForgeCraft's and MasonCraft's commands): 2D drawings, dimensions, tables, blocks, DXF/DWG/PDF/SVG/PNG; FEA studies on a drawn profile (fea.*), STEP views (cad.view); site layouts, placement, rules checks, material flow and space programmes (site.*, place.*, rules.*, flow.*, program.*). args are the drafting tool's arguments: [\"commands\"] lists all 516 commands; [\"run\", \"--metric\", \"--cmd\", \"<id> {json}\", ..., \"--save\", \"out/a.dxf\"] runs them. Read staged files from inputs/, write under out/.",
   "runtime": "native",
   "timeout_s": 600,
   "estimate_s": 1,
   "inputs": [
    {
     "name": "args",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "The drafting tool's arguments: info <file> | convert <in> <out> | run [files] [--metric] [--cmd \"<id> {json}\"]... [--script \"...\"] [--save out/x.dxf] [--export out/x.png] | commands [--filter]"
    },
    {
     "name": "files",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Files to stage under inputs/, e.g. [\"@r0003/site.dxf\"]."
    }
   ],
   "outputs": [
    {
     "name": "exit",
     "unit": null,
     "description": null
    },
    {
     "name": "lines",
     "unit": null,
     "description": null
    },
    {
     "name": "stdout.txt",
     "unit": null,
     "description": null
    },
    {
     "name": "out/*",
     "unit": null,
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "a 3 x 4 closed polyline has area 12 and perimeter 14",
     "checks": [
      "lines.1.area",
      "lines.1.perimeter"
     ]
    },
    {
     "name": "fea.*: a 100 x 10 plate pulled with 1 MPa: peak von Mises 1 MPa (sigma = F / A), mesh converged; end displacement sigma L / E = 5e-4 mm",
     "checks": [
      "lines.4.convergence.points.0.status",
      "lines.4.maxDisplacement",
      "lines.4.maxVonMises"
     ]
    },
    {
     "name": "site.*: a 200 x 100 m plot has an area of 20000 m2",
     "checks": [
      "lines.1.area"
     ]
    },
    {
     "name": "site.scene: one 10 x 20 x 5 m building is a solid 10 wide, 5 tall, 20 deep",
     "checks": [
      "lines.2.bounds_max.0",
      "lines.2.bounds_max.1",
      "lines.2.bounds_min.1",
      "lines.2.bounds_min.2",
      "lines.2.items"
     ]
    }
   ],
   "title": "Drawing",
   "needs_build": true,
   "category": "Mechanics, CAD and finite elements",
   "known_answers": 11
  },
  {
   "name": "drawing",
   "version": "0.1.0",
   "summary": "A dimensioned workshop drawing made from a `solid` model: per part, projected views (front, top, right side, isometric, and an auxiliary view along any slanted hole axis; third angle; hidden edges dashed) and, for an assembly, front and top views with balloons and a parts list (item, part, material, quantity, mass each and total). Every dimension's end points come from the model's exact B-rep facts (bounding box for overall sizes; a cylindrical face's axis and radius for hole diameters and centre positions; a slanted planar face's normal and edges for an angle), never typed. The Bench's drafting engine (draft, bench-draft-cli) draws and measures the dimensions (DIMLFAC = 1 / scale, so the text reads true size) and writes DXF, PDF and PNG on A4 or A3 at the largest ISO 5455 scale that fits. Each printed value is read back from the DXF the engine wrote and returned beside the model's value. Title block: part, material, mass from the model, scale, units, projection, the solid run it was made from (checked against the journal), date. Input: `drawing_file` (\"@<solid run>/drawing.json\", made with drawing_data: true) and `source_run`, or a `model` script (the solid instrument's own code then runs inside this run).",
   "runtime": "native",
   "timeout_s": 900,
   "estimate_s": 8,
   "inputs": [
    {
     "name": "drawing_file",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "drawing.json from a solid run made with drawing_data: true, e.g. \"@r0019/drawing.json\"."
    },
    {
     "name": "source_run",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "The solid run drawing_file came from (\"r0019\"): printed in the title block; checked against the lab's journal (same instrument, same file hash) and refused if it does not match."
    },
    {
     "name": "model",
     "type": "object",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Instead of drawing_file: a solid model script (see the solid instrument); solid's code runs inside this run with drawing_data on. The title block then says so (no source run)."
    },
    {
     "name": "parameters",
     "type": "object",
     "unit": null,
     "default": {},
     "enum": null,
     "description": "With model: overrides of the model's parameters by name."
    },
    {
     "name": "sheets",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Which sheets, in order: [{\"part\": name, \"scale\"?: \"5:1\"}, {\"assembly\": true}]. Default: every part, then the assembly (when it has more than one instance)."
    },
    {
     "name": "paper",
     "type": "string",
     "unit": null,
     "default": "auto",
     "enum": [
      "auto",
      "A4",
      "A3"
     ],
     "description": "auto: A4 when it takes the same scale as A3, else A3 (landscape)."
    },
    {
     "name": "scale",
     "type": "string",
     "unit": null,
     "default": "auto",
     "enum": null,
     "description": "\"auto\" (the largest ISO 5455 scale that fits: 50:1 ... 1:200) or a scale such as \"2:1\" for every sheet."
    },
    {
     "name": "date",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Date for the title block. Default: the date of the source run (so a replay draws the same sheet)."
    },
    {
     "name": "show_parameters",
     "type": "array",
     "unit": null,
     "default": [],
     "enum": null,
     "description": "Parameter names whose values the title block prints (e.g. [\"strip_L\"])."
    }
   ],
   "outputs": [
    {
     "name": "dims",
     "unit": null,
     "description": "dims.<sheet>.<view>.<what>: each printed dimension's value (mm or degrees), as the engine measured it x DIMLFAC. <what>: size_x|size_y|size_z, hole_d.<i>, hole_x.<i> (centre from the left edge), hole_y.<i>/hole_z.<i> (from the bottom edge), radius.<i>, angle.<i>"
    },
    {
     "name": "drawn",
     "unit": null,
     "description": "drawn.<sheet>.<view>.<what>: the length on paper (mm; angles in degrees) the engine measured"
    },
    {
     "name": "dimensions",
     "unit": null,
     "description": "every dimension, keyed \"<sheet> <view> <what>\": sheet, view, kind, what it stands for, model value (from the B-rep), drawn_mm (on paper), printed, text, error, anchor_offset_mm (its end points' distance from the drawn geometry, model mm)"
    },
    {
     "name": "max_dim_error",
     "unit": null,
     "description": "largest |printed - model| / model over all dimensions"
    },
    {
     "name": "anchor_offset_max_mm",
     "unit": "mm",
     "description": "largest distance of a dimension end point from the drawn geometry (curved edges are drawn as chords within 0.001 mm)"
    },
    {
     "name": "scale_check_max_rel",
     "unit": null,
     "description": "largest |drawn / printed - scale| / scale over the linear dimensions"
    },
    {
     "name": "sheets",
     "unit": null,
     "description": "per sheet: paper, scale, scale_factor, dimlfac, views drawn and skipped, mass_g, the pdf, png and dxf, the scales tried"
    },
    {
     "name": "views",
     "unit": null,
     "description": "views.<sheet>.<view>.{n_visible, n_hidden}: edges in each projection, as solid counted them"
    },
    {
     "name": "NN_<sheet>.pdf",
     "unit": null,
     "description": null
    },
    {
     "name": "NN_<sheet>.dxf",
     "unit": null,
     "description": null
    },
    {
     "name": "NN_<sheet>.png",
     "unit": null,
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "a box 40 x 20 x 10 with one 6 mm hole at (10, 10), forced to 2:1 on A4: every printed dimension equals the script's parameter (L, W, T, D, X, Y); drawn lengths are twice the model's (the scale arithmetic: printed = drawn x DIMLFAC = drawn / 2); end points lie on the drawn lines",
     "checks": [
      "anchor_offset_max_mm",
      "dims.plate.front.size_x",
      "dims.plate.front.size_z",
      "dims.plate.right.size_y",
      "dims.plate.right.size_z",
      "dims.plate.top.hole_d.0",
      "dims.plate.top.hole_x.0",
      "dims.plate.top.hole_y.0",
      "dims.plate.top.size_x",
      "dims.plate.top.size_y",
      "drawn.plate.top.hole_d.0",
      "drawn.plate.top.size_x",
      "max_dim_error",
      "n_sheets",
      "scale_check_max_rel",
      "sheets.plate.dimlfac",
      "sheets.plate.mass_g",
      "sheets.plate.paper",
      "sheets.plate.scale_factor"
     ]
    },
    {
     "name": "the same box with X = 12, Y = 7, D = 5 (parameters changed): the drawing follows, every dimension equals the new parameter",
     "checks": [
      "dims.plate.top.hole_d.0",
      "dims.plate.top.hole_x.0",
      "dims.plate.top.hole_y.0",
      "max_dim_error",
      "sheets.plate.mass_g"
     ]
    },
    {
     "name": "a wedge, profile (0,0) (40,0) (40,10) (0,30) extruded 8: its slanted face at atan(20/40) = 26.565051177 deg to the top view's horizontal; an L profile (legs 5 wide, 30 x 20): edge counts top 6, front 4 + 1 hidden, side 5; overall sizes",
     "checks": [
      "anchor_offset_max_mm",
      "dims.ell.top.size_x",
      "dims.ell.top.size_y",
      "dims.wedge.front.size_z",
      "dims.wedge.top.angle.0",
      "dims.wedge.top.size_x",
      "dims.wedge.top.size_y",
      "max_dim_error",
      "n_sheets",
      "views.ell.front.n_hidden",
      "views.ell.front.n_visible",
      "views.ell.right.n_visible",
      "views.ell.top.n_visible",
      "views.wedge.top.n_visible"
     ]
    },
    {
     "name": "a block 400 x 200 x 100, scale chosen: 1:1 cannot fit A3 (front 400 + side 200 > 392 mm of frame), 1:2 does (200 + 100 + dimension room); A4 would need 1:5, so A3 at 1:2; printed sizes 400, 200, 100 from drawn 200, 100, 50",
     "checks": [
      "dims.block.front.size_x",
      "dims.block.front.size_z",
      "dims.block.top.size_y",
      "drawn.block.front.size_x",
      "scale_check_max_rel",
      "sheets.block.paper",
      "sheets.block.scale_factor"
     ]
    }
   ],
   "title": "Drawing from the solid model",
   "needs_build": true,
   "category": "Mechanics, CAD and finite elements",
   "known_answers": 45
  },
  {
   "name": "dynamics",
   "version": "0.1.0",
   "summary": "One mass on any spring, shaken at its base, followed over time (SciPy solve_ivp, DOP853, events at every contact and snap). Spring: a stiffness (with a cubic term), or a force-deflection curve from a CSV file (a strip run's curves.csv, with scales) or inline points, extended beyond the data by a stated rule. Mechanical damping, an ideal transducer, a piezoelectric patch on a resistive load (the lumped pair: force factor, clamped capacitance, load), end stops (push-only spring-dashpot set from a restitution). Base motion: a sine (RMS acceleration or velocity), a stepped frequency sweep up and down, a stepped amplitude sweep, a half-sine shock, or a free release. Readings: steady swing (max, min, RMS), snaps between wells, peak force on each stop, harvested power, power against load and the best load, the small-signal (linear) answer beside the real one, energy balance error. Files: history.csv, sweep.csv or load.csv, spring.csv (the spring used, data or extension), plot.png.",
   "runtime": "native",
   "timeout_s": 3600,
   "estimate_s": 20,
   "inputs": [
    {
     "name": "mass_kg",
     "type": "number",
     "unit": "kg",
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "stiffness_N_per_m",
     "type": "number",
     "unit": "N/m",
     "default": null,
     "enum": null,
     "description": "A linear spring (or with cubic_N_per_m3 a Duffing spring, F = k x + k3 x^3)."
    },
    {
     "name": "cubic_N_per_m3",
     "type": "number",
     "unit": "N/m^3",
     "default": 0,
     "enum": null,
     "description": null
    },
    {
     "name": "curve",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "A CSV force-deflection curve, e.g. @rNNNN/curves.csv from strip."
    },
    {
     "name": "curve_points",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Inline [deflection_m, force_N] pairs, used when curve is not given."
    },
    {
     "name": "curve_x",
     "type": "string",
     "unit": null,
     "default": "d_over_L",
     "enum": null,
     "description": "The curve file's deflection column."
    },
    {
     "name": "curve_force",
     "type": "string",
     "unit": null,
     "default": "force",
     "enum": null,
     "description": "The curve file's force column."
    },
    {
     "name": "curve_filter",
     "type": "object",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Keep only rows with these column values, e.g. {\"precompression_pct\": 1}."
    },
    {
     "name": "x_scale_m",
     "type": "number",
     "unit": "m",
     "default": 1,
     "enum": null,
     "description": "Multiplies the curve's deflections to metres."
    },
    {
     "name": "force_scale_N",
     "type": "number",
     "unit": "N",
     "default": 1,
     "enum": null,
     "description": "Multiplies the curve's forces to newtons."
    },
    {
     "name": "curve_EI_Nm2",
     "type": "number",
     "unit": "N m^2",
     "default": null,
     "enum": null,
     "description": "With curve_length_m: a dimensionless strip curve (d/L, F L^2/EI): x scale L, force scale EI/L^2."
    },
    {
     "name": "curve_length_m",
     "type": "number",
     "unit": "m",
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "force_sign",
     "type": "string",
     "unit": null,
     "default": "push",
     "enum": [
      "push",
      "restoring"
     ],
     "description": "push: the force needed to hold the mass at that deflection (strip's convention); restoring: the spring's force on the mass."
    },
    {
     "name": "extend",
     "type": "string",
     "unit": null,
     "default": "quadratic",
     "enum": [
      "quadratic",
      "linear"
     ],
     "description": "Beyond the data: the end value and slope plus a curvature fitted to the last extend_fit_span of the data, or the end tangent."
    },
    {
     "name": "extend_fit_span",
     "type": "number",
     "unit": null,
     "default": 0.1,
     "enum": null,
     "description": "Fraction of the data's range used to fit the extension's curvature."
    },
    {
     "name": "rest_state",
     "type": null,
     "unit": null,
     "default": "lower",
     "enum": null,
     "description": "Which stable resting point the mass starts in and deflections are measured from: lower, upper or an index."
    },
    {
     "name": "rest_near_m",
     "type": "number",
     "unit": "m",
     "default": null,
     "enum": null,
     "description": "Or: the stable resting point nearest this curve deflection."
    },
    {
     "name": "tune_to_Hz",
     "type": "number",
     "unit": "Hz",
     "default": null,
     "enum": null,
     "description": "Scale the curve's force so the small-signal frequency at rest is this (a stand-in for a trim screw)."
    },
    {
     "name": "extra_stiffness_N_per_m",
     "type": "number",
     "unit": "N/m",
     "default": 0,
     "enum": null,
     "description": "A linear stiffness added about the rest point (e.g. a piezo patch's own stiffness)."
    },
    {
     "name": "gravity_mps2",
     "type": "number",
     "unit": "m/s^2",
     "default": 0,
     "enum": null,
     "description": "Gravity along the direction of motion."
    },
    {
     "name": "zeta_mech",
     "type": "number",
     "unit": "1",
     "default": 0,
     "enum": null,
     "description": "Mechanical damping ratio, of the small-signal frequency at rest."
    },
    {
     "name": "damping_Ns_per_m",
     "type": "number",
     "unit": "N s/m",
     "default": null,
     "enum": null,
     "description": "Or the damping coefficient."
    },
    {
     "name": "zeta_elec",
     "type": null,
     "unit": "1",
     "default": 0,
     "enum": null,
     "description": "An ideal (viscous) transducer's damping ratio, or \"matched\" (= zeta_mech, the most an ideal one takes). Its power is power_ideal_uW."
    },
    {
     "name": "theta_N_per_V",
     "type": "number",
     "unit": "N/V",
     "default": null,
     "enum": null,
     "description": "Piezo force factor (lumped): force per volt, also charge per metre."
    },
    {
     "name": "coupling_k2",
     "type": "number",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "Or the system coupling theta^2/(K C_p), K the short-circuit stiffness at rest."
    },
    {
     "name": "capacitance_F",
     "type": "number",
     "unit": "F",
     "default": null,
     "enum": null,
     "description": "Piezo clamped capacitance."
    },
    {
     "name": "load_ohm",
     "type": null,
     "unit": "ohm",
     "default": "best",
     "enum": null,
     "description": "The resistive load, or \"best\" (sine only: a load scan and a search for the most power)."
    },
    {
     "name": "load_points",
     "type": "integer",
     "unit": null,
     "default": 13,
     "enum": null,
     "description": "Loads in the scan (log-spaced over 1/(w C_p) x 10^+-1.5)."
    },
    {
     "name": "stop_lower_m",
     "type": "number",
     "unit": "m",
     "default": null,
     "enum": null,
     "description": "A stop below rest (negative)."
    },
    {
     "name": "stop_upper_m",
     "type": "number",
     "unit": "m",
     "default": null,
     "enum": null,
     "description": "A stop above rest (positive)."
    },
    {
     "name": "stop_stiffness_N_per_m",
     "type": "number",
     "unit": "N/m",
     "default": 20000,
     "enum": null,
     "description": "Contact stiffness of each stop."
    },
    {
     "name": "stop_restitution",
     "type": "number",
     "unit": "1",
     "default": 0.5,
     "enum": null,
     "description": "Coefficient of restitution of an isolated impact on a stop."
    },
    {
     "name": "excitation",
     "type": "string",
     "unit": null,
     "default": "sine",
     "enum": [
      "sine",
      "sweep",
      "amplitude_sweep",
      "shock",
      "free"
     ],
     "description": null
    },
    {
     "name": "frequency_Hz",
     "type": "number",
     "unit": "Hz",
     "default": null,
     "enum": null,
     "description": "Drive frequency (default: the small-signal natural frequency)."
    },
    {
     "name": "accel_rms_mps2",
     "type": "number",
     "unit": "m/s^2",
     "default": null,
     "enum": null,
     "description": "RMS base acceleration."
    },
    {
     "name": "velocity_rms_mmps",
     "type": "number",
     "unit": "mm/s",
     "default": null,
     "enum": null,
     "description": "Or RMS base velocity (held across a sweep)."
    },
    {
     "name": "f_start_Hz",
     "type": "number",
     "unit": "Hz",
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "f_stop_Hz",
     "type": "number",
     "unit": "Hz",
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "sweep_steps",
     "type": "integer",
     "unit": null,
     "default": 41,
     "enum": null,
     "description": null
    },
    {
     "name": "sweep_direction",
     "type": "string",
     "unit": null,
     "default": "both",
     "enum": [
      "up",
      "down",
      "both"
     ],
     "description": "Each step starts from the state the last one left (jumps and coexisting branches show)."
    },
    {
     "name": "levels_velocity_rms_mmps",
     "type": "array",
     "unit": "mm/s",
     "default": null,
     "enum": null,
     "description": "amplitude_sweep: RMS velocities in order, at frequency_Hz."
    },
    {
     "name": "levels_accel_rms_mps2",
     "type": "array",
     "unit": "m/s^2",
     "default": null,
     "enum": null,
     "description": "Or RMS accelerations."
    },
    {
     "name": "shock_peak_mps2",
     "type": "number",
     "unit": "m/s^2",
     "default": null,
     "enum": null,
     "description": "Half-sine shock: peak base acceleration (signed)."
    },
    {
     "name": "shock_duration_s",
     "type": "number",
     "unit": "s",
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "u0_m",
     "type": "number",
     "unit": "m",
     "default": 0,
     "enum": null,
     "description": "free: starting deflection from rest."
    },
    {
     "name": "v0_mps",
     "type": "number",
     "unit": "m/s",
     "default": 0,
     "enum": null,
     "description": "free: starting velocity."
    },
    {
     "name": "record_s",
     "type": "number",
     "unit": "s",
     "default": 1,
     "enum": null,
     "description": "free and shock: how long to follow."
    },
    {
     "name": "start",
     "type": "string",
     "unit": null,
     "default": "rest",
     "enum": [
      "rest",
      "linear"
     ],
     "description": "Start at rest, or in the small-signal steady state."
    },
    {
     "name": "rtol",
     "type": "number",
     "unit": null,
     "default": 1e-09,
     "enum": null,
     "description": "Integrator relative tolerance (absolute: rtol x each state's scale)."
    },
    {
     "name": "method",
     "type": "string",
     "unit": null,
     "default": "DOP853",
     "enum": [
      "DOP853",
      "RK45",
      "Radau",
      "LSODA"
     ],
     "description": null
    },
    {
     "name": "settle_tol",
     "type": "number",
     "unit": null,
     "default": 1e-07,
     "enum": null,
     "description": "Steady when amplitude and power change less than this between 10-cycle blocks."
    },
    {
     "name": "max_settle_cycles",
     "type": "integer",
     "unit": null,
     "default": 3000,
     "enum": null,
     "description": null
    },
    {
     "name": "measure_cycles",
     "type": "integer",
     "unit": null,
     "default": 50,
     "enum": null,
     "description": null
    }
   ],
   "outputs": [
    {
     "name": "swing_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "swing_max_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "swing_min_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "swing_rms_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "power_uW",
     "unit": "\u00b5W",
     "description": null
    },
    {
     "name": "power_load_uW",
     "unit": "\u00b5W",
     "description": null
    },
    {
     "name": "power_ideal_uW",
     "unit": "\u00b5W",
     "description": null
    },
    {
     "name": "best_load_ohm",
     "unit": "ohm",
     "description": null
    },
    {
     "name": "best_power_uW",
     "unit": "\u00b5W",
     "description": null
    },
    {
     "name": "load_table",
     "unit": null,
     "description": null
    },
    {
     "name": "coupling_k2",
     "unit": "1",
     "description": null
    },
    {
     "name": "snaps",
     "unit": null,
     "description": null
    },
    {
     "name": "stays_in_well",
     "unit": null,
     "description": null
    },
    {
     "name": "final_well",
     "unit": null,
     "description": null
    },
    {
     "name": "stops",
     "unit": null,
     "description": null
    },
    {
     "name": "linear_estimate",
     "unit": null,
     "description": null
    },
    {
     "name": "energy_balance_error",
     "unit": "1",
     "description": null
    },
    {
     "name": "time_outside_data_fraction",
     "unit": "1",
     "description": null
    },
    {
     "name": "max_outside_data_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "sweep",
     "unit": null,
     "description": null
    },
    {
     "name": "snap_level",
     "unit": null,
     "description": null
    },
    {
     "name": "log_decrement",
     "unit": null,
     "description": null
    },
    {
     "name": "integrator",
     "unit": null,
     "description": null
    },
    {
     "name": "history.csv",
     "unit": null,
     "description": null
    },
    {
     "name": "sweep.csv",
     "unit": null,
     "description": null
    },
    {
     "name": "load.csv",
     "unit": null,
     "description": null
    },
    {
     "name": "spring.csv",
     "unit": null,
     "description": null
    },
    {
     "name": "plot.png",
     "unit": null,
     "description": null
    },
    {
     "name": "power_vs_linear",
     "unit": "1",
     "description": null
    },
    {
     "name": "swing_vs_linear",
     "unit": "1",
     "description": null
    },
    {
     "name": "zeta_mech",
     "unit": "1",
     "description": null
    },
    {
     "name": "zeta_elec",
     "unit": "1",
     "description": null
    },
    {
     "name": "capacitance_F",
     "unit": "F",
     "description": null
    },
    {
     "name": "theta_N_per_V",
     "unit": "N/V",
     "description": null
    },
    {
     "name": "voltage_rms_V",
     "unit": "V",
     "description": null
    },
    {
     "name": "voltage_peak_V",
     "unit": "V",
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "linear resonator from rest, 0.9 f_n, zeta 0.05: steady amplitude m A/|k - m w^2 + i c w| and phase lag atan2(c w, k - m w^2) (closed form; to 1e-6 and 1e-4 deg)",
     "checks": [
      "fundamental_mm",
      "phase_lag_deg",
      "settled",
      "swing_mm"
     ]
    },
    {
     "name": "free decay, zeta 0.02: logarithmic decrement 2 pi zeta / sqrt(1 - zeta^2) and damped frequency f_n sqrt(1 - zeta^2) (to 1e-6)",
     "checks": [
      "damped_frequency_Hz",
      "log_decrement"
     ]
    },
    {
     "name": "undamped double well, curve points only between the two wells (x^3 - x spring): energy conserved to 1e-8 while half the time is spent on the extension",
     "checks": [
      "energy_balance_error",
      "snaps",
      "time_outside_data_fraction"
     ]
    },
    {
     "name": "undamped double well U = k1(x^4/(4 x0^2) - x^2/2): kicked at 0.98 sqrt(2 dU/m) stays in its well",
     "checks": [
      "energy_balance_error",
      "snaps",
      "stays_in_well"
     ]
    },
    {
     "name": "the same well kicked at 1.02 sqrt(2 dU/m) snaps across",
     "checks": [
      "snaps",
      "stays_in_well"
     ]
    },
    {
     "name": "isolated impact on a stop (K 1e4 N/m, e 0.5, 0.1 m/s): rebound ratio, contact time and peak force of the push-only spring-dashpot (closed form, to 1e-6 / 1e-6 / 1e-5)",
     "checks": [
      "stops.upper.contact_time_s",
      "stops.upper.impacts",
      "stops.upper.peak_force_N",
      "stops.upper.restitution_measured"
     ]
    },
    {
     "name": "half-sine shock (10 m/s^2, 2 ms) on an undamped linear spring at 25 Hz: residual swing = |(u, u'/w) at the pulse's end| from the exact forced solution (to 1e-6)",
     "checks": [
      "swing_max_mm",
      "swing_min_mm"
     ]
    },
    {
     "name": "ideal matched transducer at resonance: P = m A^2 / (16 zeta w_n) (Williams and Yates 1996; as resonator)",
     "checks": [
      "power_uW"
     ]
    },
    {
     "name": "linear piezoelectric harvester at resonance, load 1/(w C_p): power |V|^2/(2R) from the frequency response of the lumped pair (to 1e-5)",
     "checks": [
      "power_load_uW"
     ]
    },
    {
     "name": "linear piezoelectric harvester, best load found by the time-domain search: R_opt^2 = (a^2+b^2)/((b w C_p)^2 + (a w C_p + w theta^2)^2) from dP/dR = 0, and its power (to 1e-3, 1e-5)",
     "checks": [
      "best_load_ohm",
      "best_power_uW"
     ]
    }
   ],
   "title": "Shaken mass",
   "needs_build": true,
   "category": "Dynamics and control",
   "known_answers": 24
  },
  {
   "name": "elastic_network",
   "version": "0.1.0",
   "summary": "Gaussian (GNM) and anisotropic (ANM) elastic network models on C-alpha atoms from PDB or mmCIF text or a file: slowest modes, predicted mean-square fluctuations and B-factors, correlation with the file's B-factors and the spring constant that matches them, hinge residues of the slowest GNM mode, mode collectivity.",
   "runtime": "native",
   "timeout_s": 120,
   "estimate_s": 0.5,
   "inputs": [
    {
     "name": "structure_text",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "PDB (fixed-column ATOM/HETATM) or mmCIF text. Only the first model is read; only CA atoms of amino acids are used."
    },
    {
     "name": "structure_file",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "A PDB or mmCIF file instead of structure_text."
    },
    {
     "name": "chain",
     "type": "string",
     "unit": null,
     "default": "",
     "enum": null,
     "description": "One chain ID to keep; empty keeps every chain."
    },
    {
     "name": "model",
     "type": "string",
     "unit": null,
     "default": "both",
     "enum": [
      "both",
      "gnm",
      "anm"
     ],
     "description": null
    },
    {
     "name": "gnm_cutoff_A",
     "type": "number",
     "unit": "\u00c5",
     "default": 7.0,
     "enum": null,
     "description": "GNM contact cutoff between CA atoms (7 to 7.3 \u00c5 is usual)."
    },
    {
     "name": "anm_cutoff_A",
     "type": "number",
     "unit": "\u00c5",
     "default": 15.0,
     "enum": null,
     "description": "ANM spring cutoff between CA atoms (13 to 15 \u00c5 is usual)."
    },
    {
     "name": "gamma_N_per_m",
     "type": "number",
     "unit": "N/m",
     "default": 1.0,
     "enum": null,
     "description": "Spring constant gamma (1 kcal/(mol \u00c5^2) = 0.6948 N/m)."
    },
    {
     "name": "temperature_K",
     "type": "number",
     "unit": "K",
     "default": 300.0,
     "enum": null,
     "description": null
    },
    {
     "name": "n_modes",
     "type": "integer",
     "unit": "1",
     "default": 10,
     "enum": null,
     "description": "How many slowest nonzero modes to report."
    }
   ],
   "outputs": [
    {
     "name": "model",
     "unit": "1",
     "description": null
    },
    {
     "name": "residue_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "file_bfactor_mean_A2",
     "unit": "\u00c5^2",
     "description": null
    },
    {
     "name": "gnm_contact_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "gnm_zero_modes",
     "unit": "1",
     "description": null
    },
    {
     "name": "gnm_slow_eigenvalues",
     "unit": "1",
     "description": "Kirchhoff eigenvalues, in units of gamma (dimensionless)."
    },
    {
     "name": "gnm_lambda_max",
     "unit": "1",
     "description": null
    },
    {
     "name": "gnm_eigenvalue_sum",
     "unit": "1",
     "description": null
    },
    {
     "name": "gnm_trace",
     "unit": "1",
     "description": null
    },
    {
     "name": "gnm_inverse_trace",
     "unit": "1",
     "description": null
    },
    {
     "name": "gnm_slow_collectivity",
     "unit": "1",
     "description": null
    },
    {
     "name": "gnm_mode1_collectivity",
     "unit": "1",
     "description": null
    },
    {
     "name": "gnm_fastest_mode_collectivity",
     "unit": "1",
     "description": null
    },
    {
     "name": "gnm_slow_variance_fraction",
     "unit": "1",
     "description": null
    },
    {
     "name": "gnm_hinge_indices",
     "unit": "1",
     "description": null
    },
    {
     "name": "gnm_hinge_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "gnm_msf_A2",
     "unit": "\u00c5^2",
     "description": null
    },
    {
     "name": "gnm_bfactors_A2",
     "unit": "\u00c5^2",
     "description": null
    },
    {
     "name": "gnm_bfactor_mean_A2",
     "unit": "\u00c5^2",
     "description": null
    },
    {
     "name": "gnm_bfactor_correlation",
     "unit": "1",
     "description": null
    },
    {
     "name": "gnm_gamma_fit_N_per_m",
     "unit": "N/m",
     "description": null
    },
    {
     "name": "anm_spring_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "anm_zero_modes",
     "unit": "1",
     "description": null
    },
    {
     "name": "anm_slow_eigenvalues_N_per_m",
     "unit": "N/m",
     "description": null
    },
    {
     "name": "anm_lambda_max_N_per_m",
     "unit": "N/m",
     "description": null
    },
    {
     "name": "anm_eigenvalue_sum_N_per_m",
     "unit": "N/m",
     "description": null
    },
    {
     "name": "anm_trace_N_per_m",
     "unit": "N/m",
     "description": null
    },
    {
     "name": "anm_slow_collectivity",
     "unit": "1",
     "description": null
    },
    {
     "name": "anm_mode1_collectivity",
     "unit": "1",
     "description": null
    },
    {
     "name": "anm_fastest_mode_collectivity",
     "unit": "1",
     "description": null
    },
    {
     "name": "anm_slow_variance_fraction",
     "unit": "1",
     "description": null
    },
    {
     "name": "anm_msf_A2",
     "unit": "\u00c5^2",
     "description": null
    },
    {
     "name": "anm_bfactors_A2",
     "unit": "\u00c5^2",
     "description": null
    },
    {
     "name": "anm_bfactor_mean_A2",
     "unit": "\u00c5^2",
     "description": null
    },
    {
     "name": "anm_bfactor_correlation",
     "unit": "1",
     "description": null
    },
    {
     "name": "anm_gamma_fit_N_per_m",
     "unit": "N/m",
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "GNM straight chain N=10, nearest-neighbour contacts only: Kirchhoff = path-graph Laplacian, eigenvalues 2-2cos(k pi/N), one zero mode, trace 2(N-1)=18, sum of 1/lambda (N^2-1)/6=16.5, [K+]_ii = (1/N) sum_j |i-j| - (N^3-N)/(6N^2) (effective resistance, Klein-Randic 1993) so <dR_1^2> = 3kT/gamma*2.85 and <dR_5^2> = 3kT/gamma*0.85; mode 1 = cos((i-1/2)pi/N) flips sign between residues 5 and 6 (hinge); file B set to [K+]_ii gives r = 1 and fitted gamma = 8 pi^2 kB T / A^2; ANM of a collinear chain: x block = the same Laplacian, y and z blocks empty: 2N+1 = 21 zero modes. rel 1e-9 (exact arithmetic up to rounding)",
     "checks": [
      "anm_lambda_max_N_per_m",
      "anm_slow_eigenvalues_N_per_m.0",
      "anm_zero_modes",
      "gnm_bfactor_correlation",
      "gnm_contact_count",
      "gnm_eigenvalue_sum",
      "gnm_gamma_fit_N_per_m",
      "gnm_hinge_indices",
      "gnm_inverse_trace",
      "gnm_lambda_max",
      "gnm_msf_A2.0",
      "gnm_msf_A2.4",
      "gnm_slow_eigenvalues.0",
      "gnm_slow_eigenvalues.1",
      "gnm_slow_eigenvalues.4",
      "gnm_trace",
      "gnm_zero_modes"
     ]
    },
    {
     "name": "two nodes, one spring (gamma = 0.5 N/m, 300 K): GNM eigenvalues 0 and 2, [K+]_ii = 1/4 so <dR^2> = 3kT/(4 gamma) and B = 2 pi^2 kT/gamma; ANM: five zero modes and one nonzero mode of value 2 gamma = 1 N/m, <dR^2> = kT/(4 gamma); a mode that moves both nodes equally has collectivity 1 (Bruschweiler 1995). rel 1e-9",
     "checks": [
      "anm_eigenvalue_sum_N_per_m",
      "anm_mode1_collectivity",
      "anm_msf_A2.1",
      "anm_slow_eigenvalues_N_per_m.0",
      "anm_spring_count",
      "anm_zero_modes",
      "gnm_bfactors_A2.1",
      "gnm_mode1_collectivity",
      "gnm_msf_A2.0",
      "gnm_slow_eigenvalues.0",
      "gnm_zero_modes"
     ]
    },
    {
     "name": "regular tetrahedron, all six edges springs (gamma = 1 N/m): ANM nonzero eigenvalues are those of R R^T = 2I + (1/2) A(octahedron), octahedron spectrum {4, 0x3, -2x2}, so gamma x {1, 1, 2, 2, 2, 4} and exactly six zero modes; trace = 2 gamma x 6 springs = 12 N/m; GNM of K4: eigenvalues 0, 4, 4, 4. abs 1e-9",
     "checks": [
      "anm_eigenvalue_sum_N_per_m",
      "anm_rigid",
      "anm_slow_eigenvalues_N_per_m.0",
      "anm_slow_eigenvalues_N_per_m.1",
      "anm_slow_eigenvalues_N_per_m.2",
      "anm_slow_eigenvalues_N_per_m.4",
      "anm_slow_eigenvalues_N_per_m.5",
      "anm_trace_N_per_m",
      "anm_zero_modes",
      "gnm_lambda_max",
      "gnm_slow_eigenvalues.0",
      "gnm_zero_modes"
     ]
    },
    {
     "name": "irregular non-collinear six-node cluster, every pair a spring (gamma = 0.7 N/m): ANM has exactly six zero modes (rigid body) and its eigenvalues sum to the trace 2 gamma x 15 springs = 21 N/m; GNM of K6: eigenvalues 0 and 6 (x5), sum of 1/lambda = 5/6, [K+]_ii = (N-1)/N^2 = 5/36 so <dR^2> = 3kT/gamma x 5/36. rel 1e-9",
     "checks": [
      "anm_eigenvalue_sum_N_per_m",
      "anm_rigid",
      "anm_spring_count",
      "anm_trace_N_per_m",
      "anm_zero_modes",
      "gnm_contact_count",
      "gnm_inverse_trace",
      "gnm_lambda_max",
      "gnm_msf_A2.2",
      "gnm_slow_eigenvalues.0"
     ]
    }
   ],
   "title": "Elastic network model (GNM / ANM)",
   "needs_build": true,
   "category": "Structural biology",
   "known_answers": 50
  },
  {
   "name": "elastica",
   "version": "0.1.0",
   "summary": "The planar elastica, exact (no small-angle approximation): an inextensible straight beam, ends l = L - dl apart, right end pinned and turned (angle control), left end pinned or clamped. Finite differences in the beam angle, Newton with a sparse Jacobian, pseudo-arclength continuation from the stable state through the moment limit to the fold where the beam snaps. Per precompression: stable angle, moment limit, angle limit, the output's extreme, energies, axial force at rest (named as buckled_beam names them). Files: curves.csv, scene.glb (the exact shapes at the critical states, mm).",
   "runtime": "native",
   "timeout_s": 600,
   "estimate_s": 5,
   "inputs": [
    {
     "name": "ends",
     "type": "string",
     "unit": null,
     "default": "pinned_pinned",
     "enum": [
      "pinned_pinned",
      "fixed_pinned"
     ],
     "description": null
    },
    {
     "name": "length_m",
     "type": "number",
     "unit": "m",
     "default": 0.2,
     "enum": null,
     "description": null
    },
    {
     "name": "width_m",
     "type": "number",
     "unit": "m",
     "default": 0.025,
     "enum": null,
     "description": null
    },
    {
     "name": "thickness_m",
     "type": "number",
     "unit": "m",
     "default": 0.00025,
     "enum": null,
     "description": null
    },
    {
     "name": "E_Pa",
     "type": "number",
     "unit": "Pa",
     "default": 210000000000.0,
     "enum": null,
     "description": null
    },
    {
     "name": "precompressions_m",
     "type": "array",
     "unit": "m",
     "default": [
      0.003,
      0.005,
      0.0075
     ],
     "enum": null,
     "description": null
    },
    {
     "name": "nodes",
     "type": "integer",
     "unit": null,
     "default": 800,
     "enum": null,
     "description": "Grid nodes along the beam (error falls as 1/nodes^2)."
    }
   ],
   "outputs": [
    {
     "name": "critical",
     "unit": null,
     "description": null
    },
    {
     "name": "curves.csv",
     "unit": null,
     "description": null
    },
    {
     "name": "scene.glb",
     "unit": null,
     "description": null
    },
    {
     "name": "EI_Nm2",
     "unit": "N m^2",
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "pinned-pinned Euler elastica, end slope 30 deg (exact, elliptic integrals): dl/L = 2 - 2E(k)/K(k), PL^2/EI = (2K(k))^2, k = sin(slope/2)",
     "checks": [
      "critical.dl_13p5136mm.p_stable",
      "critical.dl_13p5136mm.theta_stable_deg"
     ]
    },
    {
     "name": "pinned-pinned Euler elastica, end slope 60 deg (exact, elliptic integrals): dl/L = 2 - 2E(k)/K(k), PL^2/EI = (2K(k))^2, k = sin(slope/2)",
     "checks": [
      "critical.dl_51p7961mm.p_stable",
      "critical.dl_51p7961mm.theta_stable_deg"
     ]
    },
    {
     "name": "fixed-pinned, nearly straight: the axial force at rest is the Euler load 20.1907 EI/L^2 (tan kL = kL)",
     "checks": [
      "critical.dl_0p01mm.p_stable"
     ]
    }
   ],
   "title": "Elastica (exact large deflection)",
   "needs_build": true,
   "category": "Mechanics, CAD and finite elements",
   "known_answers": 5
  },
  {
   "name": "fatigue",
   "version": "0.1.0",
   "summary": "Infinite-life fatigue check under a mean plus an alternating stress: Goodman, Soderberg and Gerber safety factors, and the first-cycle yield factor; pass when the governing rule (Goodman by default) and yield both meet the required factor. The endurance limit is the part's, as made (surface, size, reliability factors applied by the user).",
   "runtime": "native",
   "timeout_s": 30,
   "estimate_s": 1,
   "inputs": [
    {
     "name": "mean_MPa",
     "type": "number",
     "unit": "MPa",
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "alternating_MPa",
     "type": "number",
     "unit": "MPa",
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "ultimate_MPa",
     "type": "number",
     "unit": "MPa",
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "yield_MPa",
     "type": "number",
     "unit": "MPa",
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "endurance_MPa",
     "type": "number",
     "unit": "MPa",
     "default": null,
     "enum": null,
     "description": "Endurance limit of the part as made."
    },
    {
     "name": "required_factor",
     "type": "number",
     "unit": "1",
     "default": 1.5,
     "enum": null,
     "description": null
    },
    {
     "name": "rule",
     "type": "string",
     "unit": null,
     "default": "goodman",
     "enum": [
      "goodman",
      "soderberg",
      "gerber"
     ],
     "description": null
    },
    {
     "name": "alternating_per_mm_MPa",
     "type": "number",
     "unit": "MPa/mm",
     "default": null,
     "enum": null,
     "description": "With swing_mm, instead of alternating_MPa: the stress per mm of motion (e.g. from the strip instrument)."
    },
    {
     "name": "swing_mm",
     "type": "number",
     "unit": "mm",
     "default": null,
     "enum": null,
     "description": "Amplitude of the motion (e.g. from the resonator instrument)."
    }
   ],
   "outputs": [
    {
     "name": "goodman_factor",
     "unit": "1",
     "description": null
    },
    {
     "name": "soderberg_factor",
     "unit": "1",
     "description": null
    },
    {
     "name": "gerber_factor",
     "unit": "1",
     "description": null
    },
    {
     "name": "yield_factor",
     "unit": "1",
     "description": null
    },
    {
     "name": "infinite_life",
     "unit": null,
     "description": null
    },
    {
     "name": "governing_factor",
     "unit": "1",
     "description": null
    },
    {
     "name": "required_factor",
     "unit": "1",
     "description": null
    },
    {
     "name": "alternating_MPa",
     "unit": "MPa",
     "description": null
    },
    {
     "name": "mean_MPa",
     "unit": "MPa",
     "description": null
    },
    {
     "name": "peak_stress_MPa",
     "unit": "MPa",
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "pure alternating stress: every rule gives S_e / s_a",
     "checks": [
      "gerber_factor",
      "goodman_factor",
      "soderberg_factor"
     ]
    },
    {
     "name": "Goodman, Soderberg, Gerber by hand: s_m 300, s_a 100, S_u 1000, S_e 400, S_y 800",
     "checks": [
      "gerber_factor",
      "goodman_factor",
      "soderberg_factor",
      "yield_factor"
     ]
    },
    {
     "name": "alternating from stress per mm x swing: 200 MPa/mm x 0.5 mm = 100 MPa, so Goodman as by hand",
     "checks": [
      "alternating_MPa",
      "goodman_factor"
     ]
    }
   ],
   "title": "Fatigue check",
   "needs_build": true,
   "category": "Mechanics, CAD and finite elements",
   "known_answers": 9
  },
  {
   "name": "fea2d",
   "version": "0.2.0",
   "summary": "2D finite elements (quadratic triangles) from ForgeCraft: plane stress, plane strain or axisymmetric; linear, or elastic-plastic with stages and contact when the study has \"nonlinear\". Units are whatever the study uses consistently (mm, N, MPa). Readings: solver summary (peak von Mises, displacement, reactions, equilibrium error) and fields at probe points. File nodes.csv. Curves: a run of loop points that lie on one circle (a fillet, a hole drawn as facets) is meshed as the true arc with curved elements, re-drawn at the element size, so the answer does not depend on how finely it was drawn (summary.arcs lists them; study.curves = \"asDrawn\" turns this off). Linear studies run the mesh convergence check by default: summary.convergence says whether the governing peak converged, is singular, is not converged, or is limited by the drawing (it sits on a faceted curve that is not a circle, so a finer drawing could move it); summary.peaks gives each peak's finest value and status.",
   "runtime": "native",
   "timeout_s": 600,
   "estimate_s": 2,
   "inputs": [
    {
     "name": "study",
     "type": "object",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "ForgeCraft study JSON: {name, loops: [[[x,y],...]], analysis: planeStress|planeStrain|axisymmetric, thickness, material: {name, e, nu, yieldStrength?}, meshSize?, supports: [{at, x, y}], loads: [{kind: pressure|traction|force|..., at, ...}], nonlinear?}. Selectors: {kind: segment, a, b} | {kind: window, min, max} | {kind: circle, center, radius}. curves?: \"arcs\" (default: runs of points on one circle are meshed as the true circle) | \"asDrawn\" (straight facets as given)."
    },
    {
     "name": "probes",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Points [x, y]; each returns the nearest node's displacement and stress."
    },
    {
     "name": "convergence",
     "type": "boolean",
     "unit": null,
     "default": true,
     "enum": null,
     "description": "Run the mesh convergence check (re-solves refined around each peak; linear studies)."
    }
   ],
   "outputs": [
    {
     "name": "summary",
     "unit": null,
     "description": null
    },
    {
     "name": "probes",
     "unit": null,
     "description": null
    },
    {
     "name": "nodes.csv",
     "unit": null,
     "description": null
    },
    {
     "name": "scene.glb",
     "unit": null,
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "Lame thick cylinder, ri 50, ro 100, p 10 (axisymmetric): hoop stress 16.667 / 9.259 / 6.667 at r = 50 / 75 / 100, within 2%",
     "checks": [
      "probes.0.stress.3",
      "probes.1.stress.3",
      "probes.2.stress.3",
      "scene.bounds_max.0",
      "scene.bounds_max.1",
      "scene.legend_max_is_reported_peak",
      "summary.residual"
     ]
    },
    {
     "name": "Kirsch: quarter plate with a hole in tension, peak stress 2.9-3.25 x far field",
     "checks": [
      "probes.0.stress.0"
     ]
    },
    {
     "name": "Heywood: plate with a hole d/W = 0.1 in tension (quarter, 300 long), the hole drawn as 6 straight facets per quarter: taken as the true circle; peak 3.032 x the gross stress (Heywood 1952, Kt_net = 2 + (1 - d/W)^3, gross = Kt_net / (1 - d/W); Howland 1930 gives the same within 1%) within 1.5%, converged",
     "checks": [
      "summary.arcs.0.points",
      "summary.arcs.0.radius",
      "summary.convergence.status",
      "summary.peaks.overall.value"
     ]
    },
    {
     "name": "Heywood again, the same hole drawn with 90 facets per quarter: the same true circle, the same 3.032 within 1.5%, converged (the answer does not depend on the drawing)",
     "checks": [
      "summary.arcs.0.points",
      "summary.convergence.status",
      "summary.peaks.overall.value"
     ]
    },
    {
     "name": "Lame ring in plane stress, ri 50, ro 100, p 10, both circles drawn as 6 facets per quarter: von Mises at the bore sqrt(16.667^2 + 16.667*10 + 10^2) = 23.333 within 0.5%, hoop 16.667 at the bore and 6.667 outside within 1%, converged",
     "checks": [
      "probes.0.stress.0",
      "probes.1.stress.0",
      "summary.arcs.1.radius",
      "summary.convergence.status",
      "summary.peaks.overall.value"
     ]
    },
    {
     "name": "Inglis 1913: an elliptic hole (semi-axes 10 across the load, 5 along it) in a wide plate, Kt = 1 + 2a/b = 5, drawn as 45 facets per quarter: an ellipse is not a circle, so it stays faceted, and the check says the peak is limited by the drawing; its value within 5% of 5",
     "checks": [
      "summary.convergence.status",
      "summary.peaks.overall.value"
     ]
    },
    {
     "name": "The Heywood hole drawn as 6 facets with curves: asDrawn: meshed as its facets, the peak is limited by the drawing, never converged",
     "checks": [
      "summary.convergence.status",
      "summary.peaks.overall.status"
     ]
    }
   ],
   "title": "Stress analysis (2D)",
   "needs_build": true,
   "category": "Mechanics, CAD and finite elements",
   "known_answers": 24
  },
  {
   "name": "fea3d",
   "version": "0.1.0",
   "summary": "3D linear elastic stress and deflection of a solid part, on proven open-source code: gmsh 4.14 (OpenCASCADE) builds or reads the part and meshes it with quadratic curved tetrahedra; scikit-fem 11 assembles linear elasticity; SciPy (direct) or PyAMG (smoothed aggregation + CG) solves it. Part: box, cylinder, tube (optionally a sector), a 2D outline with holes and corner fillets extruded through a thickness, or a STEP file (mm). Supports and loads act on CAD faces picked by plane, box or hole; loads are pressure, total force, traction, or a pin bearing on a hole (cosine pressure, as fea2d). Readings: peak von Mises and where, the peak away from supports, the governing peak after the mesh convergence check (fea2d's rules: h/2 and h/4 balls of refinement, converged under 2 %, singular when it keeps growing), safety factor on yield, largest displacement, applied load against the sum of reactions, mesh size and quality, probes at exact points. Files: scene.glb (the part coloured by von Mises, with a legend), results.csv (the readings), nodes.csv (every node: position, displacement, stress), part.step (the part as built). Units: whatever the inputs use consistently (mm, N, MPa).",
   "runtime": "native",
   "timeout_s": 1800,
   "estimate_s": 30,
   "inputs": [
    {
     "name": "name",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "A name for the part (the scene's title)."
    },
    {
     "name": "part",
     "type": "object",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "The solid. {kind: box, size: [lx, ly, lz], origin?} | {kind: cylinder, radius, length, axis?: x|y|z|[ax,ay,az], base?: [x,y,z], angle_deg?: 360} | {kind: tube, inner_radius, outer_radius, length, axis?, base?, angle_deg?} (angle_deg < 360 gives a sector, e.g. a quarter model) | {kind: extrude, outline: [[x, y], ...], holes?: [{center: [x, y], radius}], fillets?: [{at: [x, y] (an outline corner), radius}], thickness, z0? (default -thickness/2: mid-plane at z = 0)} | {kind: step} with the step input, or {kind: step, sample: <file in the instrument's samples/>}."
    },
    {
     "name": "step",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "A STEP file (.step/.stp) of one solid, in millimetres, for part {kind: step}."
    },
    {
     "name": "material",
     "type": "object",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "{E, nu, yield?} in the model's units (mm, N, MPa: steel E 210000, nu 0.3). With yield, the safety factor is yield / the governing peak."
    },
    {
     "name": "mesh_size",
     "type": "number",
     "unit": "model length",
     "default": null,
     "enum": null,
     "description": "Largest element edge. About a third of the thinnest wall is a start; curved faces are graded finer (curve_elements)."
    },
    {
     "name": "supports",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "[{at: selector, fix?: [\"x\", \"y\", \"z\"] (default all: held), label?}]. A symmetry plane is a support fixing the direction normal to it; a plane held only along its normal counts as one (symmetry: true/false overrides) and is not a 'support' for the peak away from supports, since a frictionless roller makes no singularity. Selectors pick faces of the part (every point of a face must satisfy it): {\"plane\": \"x\", \"at\": 0} the face(s) at x = 0; {\"box\": {\"min\": [x, y, z], \"max\": [x, y, z]}} faces inside a box; {\"hole\": {\"center\": [x, y, z], \"axis\": \"z\", \"radius\": r}} a hole's (or a cylinder's) wall. Optional \"tol\" widens the match."
    },
    {
     "name": "loads",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "[{kind: pressure, at, p} (p > 0 pushes into the part) | {kind: force, at, force: [Fx, Fy, Fz]} (total, spread evenly over the faces' area) | {kind: traction, at, t: [tx, ty, tz]} (force per area) | {kind: bearing, at: {hole: ...}, force: [Fx, Fy, Fz]} (a pin pushing on a hole: pressure ~ cos on the half facing the load, scaled to the total), label?}. Selectors pick faces of the part (every point of a face must satisfy it): {\"plane\": \"x\", \"at\": 0} the face(s) at x = 0; {\"box\": {\"min\": [x, y, z], \"max\": [x, y, z]}} faces inside a box; {\"hole\": {\"center\": [x, y, z], \"axis\": \"z\", \"radius\": r}} a hole's (or a cylinder's) wall. Optional \"tol\" widens the match."
    },
    {
     "name": "probes",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Points [x, y, z]; each returns the displacement, stress [sxx, syy, szz, syz, sxz, sxy] and von Mises there (interpolated in the element holding it)."
    },
    {
     "name": "convergence",
     "type": "boolean",
     "unit": null,
     "default": true,
     "enum": null,
     "description": "Run the mesh convergence check (re-solves the part with finer balls of elements around each peak)."
    },
    {
     "name": "solver",
     "type": "string",
     "unit": null,
     "default": "auto",
     "enum": null,
     "description": "auto (SciPy direct up to 60 000 free dofs, PyAMG smoothed aggregation + CG beyond), direct, or amg."
    },
    {
     "name": "curve_elements",
     "type": "number",
     "unit": null,
     "default": 24,
     "enum": null,
     "description": "Elements around a full circle on curved faces (gmsh Mesh.MeshSizeFromCurvature)."
    },
    {
     "name": "stress_unit",
     "type": "string",
     "unit": null,
     "default": "MPa",
     "enum": null,
     "description": "The stress unit the inputs imply, for the legend."
    }
   ],
   "outputs": [
    {
     "name": "summary",
     "unit": null,
     "description": "peak_away_finest, peak_away_status, safety_factor_away (the peak away from supports on the finest mesh of the check, its status, yield over it), peak_von_mises(_at), peak_von_mises_free(_at) (away from supports: farther than 1.5 mesh_size from every held node), governing_peak (the value the part is judged by, on the finest mesh of the check), governing, safety_factor, max_displacement(_at, _vector), applied and reactions [x, y, z], equilibrium_error |applied + reactions| / |applied|, residual, solver, elements, nodes, dofs, quality_min/mean (gmsh minSICN: 1 regular, 0 flat), bbox_min/max"
    },
    {
     "name": "convergence",
     "unit": null,
     "description": "status converged | notConverged | singular | notChecked, reason, points [{label, at, sizes, values, change, ratio, slope, extrapolated, status}], governing (index into points)"
    },
    {
     "name": "warnings",
     "unit": null,
     "description": null
    },
    {
     "name": "probes",
     "unit": null,
     "description": null
    },
    {
     "name": "selections",
     "unit": null,
     "description": "each support and load: faces picked and their area"
    },
    {
     "name": "scene.glb",
     "unit": null,
     "description": null
    },
    {
     "name": "results.csv",
     "unit": null,
     "description": null
    },
    {
     "name": "nodes.csv",
     "unit": null,
     "description": null
    },
    {
     "name": "part.step",
     "unit": null,
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "Cantilever 200 x 10 x 10 mm, E 200 GPa, nu 0.3, 100 N at the free end, wall face clamped: tip deflection PL^3/3EI + PL/(kGA) = 1.6031 mm (Timoshenko, k = 5/6) within 1%; bending stress M c / I = 6P(L - x)/(b h^2) = 108 MPa at x = 20 and 60 MPa at x = 100 on the top face within 1%; the clamped edge's peak is singular (a rigid wall with nu > 0) and the part is judged by the peak away from it",
     "checks": [
      "convergence.points.0.status",
      "convergence.status",
      "probes.0.displacement.2",
      "probes.1.stress.0",
      "probes.2.stress.0",
      "scene.bounds_max.0",
      "scene.legend_max_is_reported_peak",
      "summary.applied.2",
      "summary.equilibrium_error",
      "summary.residual"
     ]
    },
    {
     "name": "Axial bar 100 x 10 x 10 mm on three symmetry planes, 1000 N on the end face: stress F/A = 10 MPa everywhere, extension FL/EA = 0.005 mm, lateral strain -nu F/(EA) (uy = -7.5e-5 mm at y = 5); exact for any mesh, within 1e-6",
     "checks": [
      "convergence.status",
      "probes.0.displacement.0",
      "probes.0.displacement.1",
      "probes.1.stress.0",
      "summary.max_displacement",
      "summary.peak_von_mises"
     ]
    },
    {
     "name": "Lame thick cylinder, ri 50, ro 100, open ends, p 10 inside (quarter model on symmetry planes): hoop stress 16.667 at the bore and 6.667 outside, bore radial displacement 0.0049167 mm, peak von Mises 23.333 at the bore, all within 1%; the peak converges. Solved with the AMG-CG branch (solver amg) that large parts use",
     "checks": [
      "convergence.status",
      "probes.0.displacement.0",
      "probes.0.stress.1",
      "probes.1.stress.1",
      "probes.2.stress.1",
      "scene.bounds_max.0",
      "scene.legend_max_is_reported_peak",
      "summary.applied.0",
      "summary.peak_von_mises"
     ]
    },
    {
     "name": "Solid cylinder r 10, 100 long on z, base clamped, traction 10 MPa along z on the far end picked by a box: the load is t pi r^2 = 3141.59 N within 0.1% (the curved face's area), the stress at mid-length is t = 10 MPa within 1% (St Venant: 2.5 diameters from the clamp)",
     "checks": [
      "probes.0.stress.2",
      "probes.1.stress.2",
      "selections.1.area",
      "summary.applied.2"
     ]
    },
    {
     "name": "Pin-loaded lug: plate 60 x 20 x 5 mm held at x = 0, a pin pulls its hole (r 4 at x = 45) with 1000 N (cosine bearing pressure): the assembled load is 1000 N, the reactions balance it, and the shank carries F/A = 10 MPa at x = 20 within 2% (St Venant: 16 mm from the hole, 20 from the wall)",
     "checks": [
      "probes.0.stress.0",
      "summary.applied.0",
      "summary.bbox_max.2",
      "summary.reactions.0"
     ]
    },
    {
     "name": "The cantilever read from a STEP file (samples/bar_200x10x10_mm.step, written by OpenCASCADE): the part is 200 mm long (units read as mm) and its tip deflection is 1.6031 mm within 1%",
     "checks": [
      "probes.0.displacement.2",
      "summary.bbox_max.0",
      "summary.bbox_max.2"
     ]
    }
   ],
   "title": "Stress analysis (3D)",
   "needs_build": true,
   "category": "Mechanics, CAD and finite elements",
   "known_answers": 36
  },
  {
   "name": "fiber_modes",
   "version": "0.1.0",
   "summary": "Step-index optical fibre (weakly guiding LP modes) and symmetric slab waveguide: numerical aperture, V number, single-mode cutoff wavelength, every guided mode with its cutoff and effective index from the exact characteristic equation (Bessel J and K computed, no tables), LP01 mode-field diameter by Marcuse's fit; slab TE and TM modes.",
   "runtime": "native",
   "timeout_s": 60,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "geometry",
     "type": "string",
     "unit": null,
     "default": "fiber",
     "enum": [
      "fiber",
      "slab"
     ],
     "description": "fiber: step-index circular core of radius core_radius_um; slab: symmetric planar core of full thickness slab_thickness_um."
    },
    {
     "name": "n_core",
     "type": "number",
     "unit": "1",
     "default": 1.4492,
     "enum": null,
     "description": "Core refractive index at the wavelength."
    },
    {
     "name": "n_clad",
     "type": "number",
     "unit": "1",
     "default": 1.444,
     "enum": null,
     "description": "Cladding refractive index at the wavelength (must be below n_core)."
    },
    {
     "name": "wavelength_nm",
     "type": "number",
     "unit": "nm",
     "default": 1550,
     "enum": null,
     "description": "Vacuum wavelength."
    },
    {
     "name": "core_radius_um",
     "type": "number",
     "unit": "um",
     "default": 4.1,
     "enum": null,
     "description": "Fibre core radius a (half the core diameter). Used when geometry = fiber."
    },
    {
     "name": "slab_thickness_um",
     "type": "number",
     "unit": "um",
     "default": 1.0,
     "enum": null,
     "description": "Full core thickness d of the slab. Used when geometry = slab; V = (pi d / lambda) NA."
    }
   ],
   "outputs": [
    {
     "name": "geometry",
     "unit": null,
     "description": "fiber or slab"
    },
    {
     "name": "numerical_aperture",
     "unit": "1",
     "description": "sqrt(n_core^2 - n_clad^2)"
    },
    {
     "name": "acceptance_half_angle_deg",
     "unit": "deg",
     "description": "asin(NA), launch from air"
    },
    {
     "name": "index_contrast_percent",
     "unit": "%",
     "description": "Delta = (n1^2 - n2^2) / (2 n1^2)"
    },
    {
     "name": "v_number",
     "unit": "1",
     "description": "fibre: 2 pi a NA / lambda; slab: pi d NA / lambda"
    },
    {
     "name": "single_mode",
     "unit": null,
     "description": "fibre: V < j01 = 2.405; slab: V <= pi/2 (one TE and one TM mode)"
    },
    {
     "name": "lp11_cutoff_V",
     "unit": "1",
     "description": "first zero of J0, computed"
    },
    {
     "name": "cutoff_wavelength_nm",
     "unit": "nm",
     "description": "longest wavelength at which the second mode is guided"
    },
    {
     "name": "lp_mode_count",
     "unit": "1",
     "description": "guided LP modes (null above V = 150)"
    },
    {
     "name": "mode_count",
     "unit": "1",
     "description": "fibre: guided modes counting polarisations and orientations; slab: TE plus TM"
    },
    {
     "name": "mode_count_estimate",
     "unit": "1",
     "description": "V^2/2, the large-V estimate"
    },
    {
     "name": "u_lp01",
     "unit": "1",
     "description": null
    },
    {
     "name": "w_lp01",
     "unit": "1",
     "description": null
    },
    {
     "name": "b_lp01",
     "unit": "1",
     "description": "normalised propagation constant (n_eff^2 - n2^2) / (n1^2 - n2^2)"
    },
    {
     "name": "neff_lp01",
     "unit": "1",
     "description": null
    },
    {
     "name": "beta_lp01_per_um",
     "unit": "1/um",
     "description": null
    },
    {
     "name": "core_power_fraction_lp01",
     "unit": "1",
     "description": null
    },
    {
     "name": "b_lp11",
     "unit": "1",
     "description": null
    },
    {
     "name": "neff_lp11",
     "unit": "1",
     "description": null
    },
    {
     "name": "mode_field_diameter_um",
     "unit": "um",
     "description": "LP01, Marcuse fit, given for 0.8 <= V <= 2.5 only"
    },
    {
     "name": "mfd_over_core_diameter",
     "unit": "1",
     "description": null
    },
    {
     "name": "te_mode_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "tm_mode_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "b_te0",
     "unit": "1",
     "description": null
    },
    {
     "name": "neff_te0",
     "unit": "1",
     "description": null
    },
    {
     "name": "beta_te0_per_um",
     "unit": "1/um",
     "description": null
    },
    {
     "name": "b_tm0",
     "unit": "1",
     "description": null
    },
    {
     "name": "neff_tm0",
     "unit": "1",
     "description": null
    },
    {
     "name": "modes",
     "unit": null,
     "description": "the first 12 guided modes, highest n_eff first; out/modes.csv holds all"
    },
    {
     "name": "convention",
     "unit": null,
     "description": "the V and mode-count conventions used, in words"
    },
    {
     "name": "warnings",
     "unit": null,
     "description": "list of plain-language warnings"
    },
    {
     "name": "modes_listed",
     "unit": "1",
     "description": "rows of the modes table kept in the readings. Files: out/modes.csv (every guided mode), out/dispersion.csv (fundamental mode against wavelength, 0.5 to 2 times the input), out/field_lp01.csv (fibre: LP01 radial field and the Marcuse Gaussian)"
    }
   ],
   "selftests": [
    {
     "name": "fibre closed forms: NA = sqrt(1.45^2 - 1.44^2) = 0.17, V = 2 pi a NA / lambda, LP11 cutoff at j01 = 2.404825557695773 (Abramowitz & Stegun Table 9.5), cutoff wavelength 2 pi a NA / j01; rel 1e-9 (bisection to machine precision)",
     "checks": [
      "acceptance_half_angle_deg",
      "cutoff_wavelength_nm",
      "lp11_cutoff_V",
      "lp_mode_count",
      "mode_count",
      "numerical_aperture",
      "single_mode",
      "v_number"
     ]
    },
    {
     "name": "Marcuse (1977) mode-field fit w0/a = 0.65 + 1.619 V^-1.5 + 2.879 V^-6 at V = 2.06737, a = 3 um: MFD = 7.389163480 um, rel 1e-9 (closed form); LP01 n_eff lies between n2 = 1.44 and n1 = 1.45",
     "checks": [
      "b_lp01",
      "mode_field_diameter_um",
      "neff_lp01"
     ]
    },
    {
     "name": "LP mode count from Bessel zeros (Abramowitz & Stegun Table 9.5): V = 5.130, just below j21 = 5.135622, guides LP01 LP11 LP21 LP02 = 4 LP modes, 12 with polarisations; LP21 and LP02 cut off at j11 = 3.831705970207512, rel 1e-9",
     "checks": [
      "lp_mode_count",
      "mode_count",
      "modes.LP02.cutoff_V",
      "modes.LP21.cutoff_V",
      "single_mode"
     ]
    },
    {
     "name": "LP31 appears above j21 = 5.135622301840683 (Abramowitz & Stegun Table 9.5): V = 5.140 guides 5 LP modes, 16 with polarisations; LP31 cutoff rel 1e-9",
     "checks": [
      "lp_mode_count",
      "mode_count",
      "modes.LP31.cutoff_V"
     ]
    },
    {
     "name": "LP01 b at V = 2 against the Rudolph-Neumann approximation b = (1.1428 - 0.996/V)^2 = 0.415767 (Jeunhomme, Single-Mode Fiber Optics; accurate to 0.2 % for 1.5 < V < 2.5, so rel_tol 2e-3: the reference, not the solver, is approximate)",
     "checks": [
      "b_lp01",
      "v_number"
     ]
    },
    {
     "name": "symmetric slab TE0 exact: V = pi d NA / lambda = 2 pi/3 solves tan u = w/u at u = pi/3, w = sqrt(3) pi/3, so b = 3/4 and n_eff = sqrt(1.44 + 0.75 * 0.81); TE count ceil(V/(pi/2)) = 2; single-mode cutoff lambda = 2 d NA = 1200 nm; rel 1e-9",
     "checks": [
      "b_te0",
      "cutoff_wavelength_nm",
      "mode_count",
      "neff_te0",
      "single_mode",
      "te_mode_count",
      "v_number"
     ]
    },
    {
     "name": "symmetric slab TM0 exact: tan u = rho w/u with rho = (n1/n2)^2 = 1.5625 has root u = pi/4, w = u/rho at V = (pi/4) sqrt(1 + 1/rho^2), so b = 1/(1 + rho^2) = 0.2905788876; one TE and one TM mode (V = 0.9325 < pi/2); rel 1e-9",
     "checks": [
      "b_tm0",
      "single_mode",
      "te_mode_count",
      "v_number"
     ]
    }
   ],
   "title": "Fibre and slab waveguide modes",
   "needs_build": true,
   "category": "Waves, optics and circuits",
   "known_answers": 32
  },
  {
   "name": "filter_design",
   "version": "0.1.0",
   "summary": "Passive LC ladder filter synthesis: Butterworth or Chebyshev, low-pass, high-pass or band-pass of order n for a cutoff and impedance. Prototype g values from the closed forms, inductors and capacitors, load resistance, attenuation at a stop frequency and the order a stop requirement needs. The response is computed from the finished ladder as a circuit (ABCD chain between the terminations) and compared with the closed form; response and element csv.",
   "runtime": "native",
   "timeout_s": 30,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "family",
     "type": "string",
     "unit": null,
     "default": "butterworth",
     "enum": [
      "butterworth",
      "chebyshev"
     ],
     "description": "Butterworth (maximally flat, cutoff at -3.01 dB) or Chebyshev (equal ripple, cutoff at the ripple edge)."
    },
    {
     "name": "response",
     "type": "string",
     "unit": null,
     "default": "lowpass",
     "enum": [
      "lowpass",
      "highpass",
      "bandpass"
     ],
     "description": null
    },
    {
     "name": "order",
     "type": "integer",
     "unit": "1",
     "default": 3,
     "enum": null,
     "description": "Number of reactive elements (low/high-pass) or resonators (band-pass)."
    },
    {
     "name": "cutoff_Hz",
     "type": "number",
     "unit": "Hz",
     "default": 1000000.0,
     "enum": null,
     "description": "Passband edge of a low-pass or high-pass. Not used for a band-pass."
    },
    {
     "name": "band_low_Hz",
     "type": "number",
     "unit": "Hz",
     "default": null,
     "enum": null,
     "description": "Band-pass: lower passband edge (with band_high_Hz)."
    },
    {
     "name": "band_high_Hz",
     "type": "number",
     "unit": "Hz",
     "default": null,
     "enum": null,
     "description": "Band-pass: upper passband edge (with band_low_Hz)."
    },
    {
     "name": "center_Hz",
     "type": "number",
     "unit": "Hz",
     "default": null,
     "enum": null,
     "description": "Band-pass, instead of the two edges: centre frequency, the geometric mean of the edges (with bandwidth_Hz)."
    },
    {
     "name": "bandwidth_Hz",
     "type": "number",
     "unit": "Hz",
     "default": null,
     "enum": null,
     "description": "Band-pass, with center_Hz: upper edge minus lower edge."
    },
    {
     "name": "impedance_ohm",
     "type": "number",
     "unit": "ohm",
     "default": 50.0,
     "enum": null,
     "description": "Source resistance. The load is the same except for an even-order Chebyshev (see load_ohm)."
    },
    {
     "name": "ripple_dB",
     "type": "number",
     "unit": null,
     "default": 0.5,
     "enum": null,
     "description": "Chebyshev passband ripple. Ignored for Butterworth."
    },
    {
     "name": "first_element",
     "type": "string",
     "unit": null,
     "default": "shunt",
     "enum": [
      "shunt",
      "series"
     ],
     "description": "shunt: pi ladder (low-pass starts with a capacitor to ground). series: T ladder (low-pass starts with an inductor)."
    },
    {
     "name": "stop_Hz",
     "type": "number",
     "unit": "Hz",
     "default": null,
     "enum": null,
     "description": "Optional: a frequency to read the attenuation at."
    },
    {
     "name": "stop_attenuation_min_dB",
     "type": "number",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Optional, with stop_Hz: the attenuation wanted there. Gives meets_stop and order_needed."
    },
    {
     "name": "points",
     "type": "integer",
     "unit": "1",
     "default": 201,
     "enum": null,
     "description": "Rows of response.csv, log spaced."
    },
    {
     "name": "sweep_min_Hz",
     "type": "number",
     "unit": "Hz",
     "default": null,
     "enum": null,
     "description": "Optional: start of the response sweep (default a decade below the cutoff)."
    },
    {
     "name": "sweep_max_Hz",
     "type": "number",
     "unit": "Hz",
     "default": null,
     "enum": null,
     "description": "Optional: end of the response sweep (default a decade above the cutoff)."
    }
   ],
   "outputs": [
    {
     "name": "order",
     "unit": "1",
     "description": null
    },
    {
     "name": "g",
     "unit": "1",
     "description": "Prototype values g_1..g_n (1 ohm, 1 rad/s)."
    },
    {
     "name": "g_load",
     "unit": "1",
     "description": "g_(n+1): 1, or coth^2(beta/4) for an even-order Chebyshev."
    },
    {
     "name": "ripple_dB",
     "unit": null,
     "description": null
    },
    {
     "name": "source_ohm",
     "unit": "ohm",
     "description": null
    },
    {
     "name": "load_ohm",
     "unit": "ohm",
     "description": null
    },
    {
     "name": "elements",
     "unit": null,
     "description": "The ladder, source side first: name, branch (series or shunt), type, g, L_H, C_F, resonance_Hz, value as text."
    },
    {
     "name": "cutoff_Hz",
     "unit": "Hz",
     "description": null
    },
    {
     "name": "band_low_Hz",
     "unit": "Hz",
     "description": null
    },
    {
     "name": "band_high_Hz",
     "unit": "Hz",
     "description": null
    },
    {
     "name": "center_Hz",
     "unit": "Hz",
     "description": null
    },
    {
     "name": "fractional_bandwidth",
     "unit": "1",
     "description": null
    },
    {
     "name": "edge_attenuation_dB",
     "unit": null,
     "description": "Attenuation of the ladder as built at the cutoff (band-pass: at the upper edge)."
    },
    {
     "name": "edge_low_attenuation_dB",
     "unit": null,
     "description": "Band-pass: the same at the lower edge."
    },
    {
     "name": "half_power_low_Hz",
     "unit": "Hz",
     "description": null
    },
    {
     "name": "half_power_high_Hz",
     "unit": "Hz",
     "description": null
    },
    {
     "name": "passband_return_loss_min_dB",
     "unit": null,
     "description": "Chebyshev: worst passband return loss, -10 log10(1 - 10^(-ripple/10))."
    },
    {
     "name": "stop_Hz",
     "unit": "Hz",
     "description": null
    },
    {
     "name": "stop_normalised",
     "unit": "1",
     "description": "The low-pass prototype frequency stop_Hz maps to."
    },
    {
     "name": "stop_attenuation_dB",
     "unit": null,
     "description": "Attenuation of the ladder as built at stop_Hz (circuit analysis)."
    },
    {
     "name": "stop_attenuation_formula_dB",
     "unit": null,
     "description": "The closed form at stop_Hz: 10 log10(1 + w^2n), or 10 log10(1 + eps^2 Tn(w)^2)."
    },
    {
     "name": "stop_attenuation_min_dB",
     "unit": null,
     "description": null
    },
    {
     "name": "meets_stop",
     "unit": null,
     "description": "true when the attenuation at stop_Hz reaches stop_attenuation_min_dB."
    },
    {
     "name": "order_needed",
     "unit": "1",
     "description": "Smallest order whose closed-form attenuation at stop_Hz reaches the requirement."
    },
    {
     "name": "synthesis_error_dB",
     "unit": null,
     "description": "Largest gap between the ladder's response and the closed form over the sweep and the band edges."
    },
    {
     "name": "points_compared",
     "unit": "1",
     "description": null
    },
    {
     "name": "sweep_min_Hz",
     "unit": "Hz",
     "description": null
    },
    {
     "name": "sweep_max_Hz",
     "unit": "Hz",
     "description": null
    },
    {
     "name": "all_ok",
     "unit": null,
     "description": "true when the ladder reproduces the closed form within 1e-6 dB and any stop requirement is met."
    },
    {
     "name": "warnings",
     "unit": null,
     "description": null
    },
    {
     "name": "notes",
     "unit": null,
     "description": null
    },
    {
     "name": "files",
     "unit": null,
     "description": "out/response.csv (f_Hz, attenuation_dB, formula_dB, return_loss_dB, phase_deg), out/elements.csv"
    }
   ],
   "selftests": [
    {
     "name": "Butterworth n=3 low-pass, 1 MHz, 50 ohm: g = 2 sin((2k-1) pi/(2n)) = 1, 2, 1; C = g/(2 pi fc R), L = g R/(2 pi fc); 10 log10(2) = 3.0103 dB at cutoff read off the ladder (closed forms, 1e-9)",
     "checks": [
      "edge_attenuation_dB",
      "elements.0.C_F",
      "elements.1.L_H",
      "elements.2.C_F",
      "g.0",
      "g.1",
      "g.2",
      "half_power_high_Hz",
      "load_ohm"
     ]
    },
    {
     "name": "Butterworth n=5: g = 0.618034, 1.618034, 2, 1.618034, 0.618034 (golden ratio, (sqrt5 -+ 1)/2); ladder at 2 fc gives 10 log10(1 + 2^10) = 30.107239 dB (closed forms, 1e-9)",
     "checks": [
      "edge_attenuation_dB",
      "g.0",
      "g.1",
      "g.2",
      "g.3",
      "g.4",
      "stop_attenuation_dB"
     ]
    },
    {
     "name": "Pozar, Microwave Engineering, maximally flat low-pass example: 2 GHz, 50 ohm, at least 15 dB at 3 GHz -> N = 5, C1 = 0.984 pF, L2 = 6.438 nH, C3 = 3.183 pF (tolerance: half the last printed digit); 10 log10(1 + 1.5^10) = 17.6838 dB",
     "checks": [
      "elements.0.C_F",
      "elements.1.L_H",
      "elements.2.C_F",
      "elements.3.L_H",
      "elements.4.C_F",
      "meets_stop",
      "order_needed",
      "stop_attenuation_dB"
     ]
    },
    {
     "name": "Butterworth n=3 high-pass T, 1 kHz, 50 ohm: C = 1/(g R 2 pi fc), L = R/(g 2 pi fc); ladder at fc/2 gives 10 log10(1 + 2^6) = 18.129134 dB; 3.0103 dB at cutoff (closed forms, 1e-9)",
     "checks": [
      "edge_attenuation_dB",
      "elements.0.C_F",
      "elements.1.L_H",
      "elements.2.C_F",
      "stop_attenuation_dB"
     ]
    },
    {
     "name": "Chebyshev 0.5 dB n=3: g = 1.5963, 1.0967, 1.5963 (Matthaei-Young-Jones table 4.05-2, also Pozar table 8.4; 4 printed decimals, tolerance 6e-5); ladder ripple at the passband edge = 0.5 dB; at 2 fc 10 log10(1 + eps^2 T3(2)^2), T3(2) = 26 -> 19.216057 dB; half-power at fc cosh(acosh(1/eps)/3)",
     "checks": [
      "edge_attenuation_dB",
      "g.0",
      "g.1",
      "g.2",
      "g_load",
      "half_power_high_Hz",
      "passband_return_loss_min_dB",
      "stop_attenuation_dB"
     ]
    },
    {
     "name": "Chebyshev n=1: g1 = 2 eps = 2 sqrt(10^(0.5/10) - 1) = 0.698623 exactly (closed form, 1e-9); ripple 0.5 dB at the edge",
     "checks": [
      "edge_attenuation_dB",
      "g.0"
     ]
    },
    {
     "name": "Chebyshev 0.5 dB n=2 (even order, unequal terminations): g = 1.4029, 0.7071, load 1.9841 (Matthaei-Young-Jones table 4.05-2 / Pozar table 8.4, 4 decimals); ladder ripple 0.5 dB at the edge; at 3 fc 10 log10(1 + eps^2 T2(3)^2), T2(3) = 17 -> 15.594677 dB",
     "checks": [
      "edge_attenuation_dB",
      "g.0",
      "g.1",
      "g_load",
      "stop_attenuation_dB"
     ]
    },
    {
     "name": "Pozar, Microwave Engineering, band-pass example: 0.5 dB equal ripple, N = 3, 1 GHz centre, 10 % bandwidth, 50 ohm -> L1 = 127.0 nH, C1 = 0.199 pF, L2 = 0.726 nH, C2 = 34.91 pF (tolerance: half the last printed digit); ladder ripple 0.5 dB at both band edges; every resonator at 1 GHz",
     "checks": [
      "edge_attenuation_dB",
      "edge_low_attenuation_dB",
      "elements.0.C_F",
      "elements.0.L_H",
      "elements.0.resonance_Hz",
      "elements.1.C_F",
      "elements.1.L_H",
      "elements.1.resonance_Hz",
      "elements.2.L_H",
      "fractional_bandwidth"
     ]
    },
    {
     "name": "Butterworth n=3 band-pass 9-11 MHz, 50 ohm: shunt C1 = g/(2 pi bw R), series L2 = g R/(2 pi bw), each resonant at sqrt(f1 f2); 3.0103 dB at both edges; at 12 MHz w = (f^2 - f1 f2)/(f bw) = 1.875 -> 10 log10(1 + 1.875^6) = 16.478892 dB (closed forms; 1e-8 because L - 1/C nearly cancel in band)",
     "checks": [
      "center_Hz",
      "edge_attenuation_dB",
      "edge_low_attenuation_dB",
      "elements.0.C_F",
      "elements.0.L_H",
      "elements.1.C_F",
      "elements.1.L_H",
      "stop_attenuation_dB",
      "stop_normalised"
     ]
    }
   ],
   "title": "LC ladder filter",
   "needs_build": true,
   "category": "Waves, optics and circuits",
   "known_answers": 63
  },
  {
   "name": "fingerprint_sim",
   "version": "0.1.0",
   "summary": "Computes circular Morgan-like topological fingerprints from SMILES, pairwise Tanimoto and Dice similarity matrices, SALI scores, and activity-cliff detection.",
   "runtime": "native",
   "timeout_s": 30,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "molecules",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Array of {name, smiles, activity?} objects."
    },
    {
     "name": "radius",
     "type": "integer",
     "unit": null,
     "default": 2,
     "enum": null,
     "description": null
    },
    {
     "name": "n_bits",
     "type": "integer",
     "unit": null,
     "default": 1024,
     "enum": null,
     "description": null
    },
    {
     "name": "cliff_sim_threshold",
     "type": "number",
     "unit": "1",
     "default": 0.5,
     "enum": null,
     "description": null
    },
    {
     "name": "cliff_delta_threshold",
     "type": "number",
     "unit": "1",
     "default": 1.0,
     "enum": null,
     "description": null
    }
   ],
   "outputs": [
    {
     "name": "molecule_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "pair_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "mean_tanimoto",
     "unit": "1",
     "description": null
    },
    {
     "name": "max_tanimoto",
     "unit": "1",
     "description": null
    },
    {
     "name": "min_tanimoto",
     "unit": "1",
     "description": null
    },
    {
     "name": "activity_cliff_count",
     "unit": "1",
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "identical molecules give Tanimoto 1.0; high-similarity potency jump flags 1 activity cliff",
     "checks": [
      "activity_cliff_count",
      "max_tanimoto"
     ]
    }
   ],
   "title": "Fingerprint similarity & activity cliffs",
   "needs_build": true,
   "category": "Chemistry",
   "known_answers": 2
  },
  {
   "name": "fit",
   "version": "0.2.0",
   "summary": "Nonlinear least-squares fit of a model to measured data (Levenberg-Marquardt and trust-region, SciPy, exact complex-step derivatives, tolerances at machine precision): parameters, standard errors from s^2 (J^T J)^-1, residual sum of squares, residual standard deviation, predictions at given x. Files: fit.csv (x, y, fitted, residual), fit.png (data, curve, residuals). `converged` is true only when the solution passes its checks (stop reason, gradient, conditioning, finite errors); otherwise `warnings` says why.",
   "runtime": "native",
   "timeout_s": 300,
   "estimate_s": 2,
   "inputs": [
    {
     "name": "csv",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Data with a header row."
    },
    {
     "name": "data",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Inline CSV text, used when csv is not given."
    },
    {
     "name": "x",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Predictor column. Default: the first column."
    },
    {
     "name": "y",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Response column. Default: the second column."
    },
    {
     "name": "model",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Expression in x and the parameters, e.g. \"b1*(1-exp(-b2*x))\". ^ is a power. Functions: exp, log, log10, sqrt, sin, cos, tan, tanh, arctan, abs, pi, e."
    },
    {
     "name": "params",
     "type": "object",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Parameter names and starting values, e.g. {\"b1\": 1, \"b2\": 1}."
    },
    {
     "name": "method",
     "type": "string",
     "unit": null,
     "default": "auto",
     "enum": [
      "auto",
      "lm",
      "trf",
      "dogbox"
     ],
     "description": "auto: Levenberg-Marquardt and trust-region, keep the better trustworthy fit. lm, trf, dogbox: one method."
    },
    {
     "name": "max_evaluations",
     "type": "integer",
     "unit": null,
     "default": 20000,
     "enum": null,
     "description": null
    },
    {
     "name": "predict",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "x values at which to report the fitted model."
    },
    {
     "name": "title",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": null
    }
   ],
   "outputs": [
    {
     "name": "params",
     "unit": null,
     "description": null
    },
    {
     "name": "std_errors",
     "unit": null,
     "description": null
    },
    {
     "name": "rss",
     "unit": null,
     "description": null
    },
    {
     "name": "residual_sd",
     "unit": null,
     "description": null
    },
    {
     "name": "dof",
     "unit": null,
     "description": null
    },
    {
     "name": "converged",
     "unit": null,
     "description": null
    },
    {
     "name": "predictions",
     "unit": null,
     "description": null
    },
    {
     "name": "fit.csv",
     "unit": null,
     "description": null
    },
    {
     "name": "fit.png",
     "unit": null,
     "description": null
    },
    {
     "name": "warnings",
     "unit": null,
     "description": null
    },
    {
     "name": "condition",
     "unit": null,
     "description": null
    },
    {
     "name": "method",
     "unit": null,
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "exact data y = 3 exp(-0.5 x) + 1 from a poor start: parameters recovered to 1e-9, RSS 0",
     "checks": [
      "params.a",
      "params.c",
      "params.k",
      "rss"
     ]
    },
    {
     "name": "straight line against the ordinary-least-squares formulas: slope 1.99 (SE 0.0597216), intercept 0.05 (SE 0.198074), RSS 0.107, prediction 11.99 at x = 6",
     "checks": [
      "params.b0",
      "params.b1",
      "predictions.6",
      "rss",
      "std_errors.b0",
      "std_errors.b1"
     ]
    },
    {
     "name": "a saturated start is caught: a exp(-k x) from k = 60 with lm alone must not be reported converged",
     "checks": [
      "converged"
     ]
    }
   ],
   "title": "Curve fit",
   "needs_build": true,
   "category": "Measurement and data",
   "known_answers": 11
  },
  {
   "name": "formula_from_mass",
   "version": "0.1.0",
   "summary": "Candidate elemental formulas (C, H, N, O, S, P, F, Cl, Br, I within limits) for a measured monoisotopic neutral mass, or an m/z with its adduct ([M+H]+, [M-H]-, [M+Na]+, [M+2H]2+, [2M+H]+ ...), within a ppm tolerance. Exhaustive search inside the element limits; ring-and-double-bond equivalents RDBE = C - (H+X)/2 + (N+P)/2 + 1, the nitrogen rule and H/C limits as filters; ranked by absolute ppm error. Monoisotopic masses are the single IUPAC/AME values of bench_science::iupac, the electron mass CODATA.",
   "runtime": "native",
   "timeout_s": 60,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "neutral_mass",
     "type": "number",
     "unit": "Da",
     "default": null,
     "enum": null,
     "description": "Measured monoisotopic mass of the neutral molecule. Give this or mz, not both."
    },
    {
     "name": "mz",
     "type": "number",
     "unit": "Da",
     "default": null,
     "enum": null,
     "description": "Measured m/z of the ion (Da per elementary charge, i.e. thomson). Give this or neutral_mass, not both."
    },
    {
     "name": "adduct",
     "type": "string",
     "unit": null,
     "default": "[M+H]+",
     "enum": null,
     "description": "Ion form when mz is given: [M+H]+, [M-H]-, [M+Na]+, [M+K]+, [M+NH4]+, [M+2H]2+, [2M+H]+, [M+FA-H]-, [M-H2O+H]+, [M]+ ... m/z = (n M + atoms added - atoms lost - z m_e) / |z|."
    },
    {
     "name": "tolerance_ppm",
     "type": "number",
     "unit": null,
     "default": 5,
     "enum": null,
     "description": "Half-width of the window, parts per million of the theoretical value on the measured scale."
    },
    {
     "name": "c_max",
     "type": "integer",
     "unit": "1",
     "default": 100,
     "enum": null,
     "description": null
    },
    {
     "name": "h_max",
     "type": "integer",
     "unit": "1",
     "default": 200,
     "enum": null,
     "description": null
    },
    {
     "name": "n_max",
     "type": "integer",
     "unit": "1",
     "default": 10,
     "enum": null,
     "description": null
    },
    {
     "name": "o_max",
     "type": "integer",
     "unit": "1",
     "default": 20,
     "enum": null,
     "description": null
    },
    {
     "name": "s_max",
     "type": "integer",
     "unit": "1",
     "default": 4,
     "enum": null,
     "description": null
    },
    {
     "name": "p_max",
     "type": "integer",
     "unit": "1",
     "default": 3,
     "enum": null,
     "description": null
    },
    {
     "name": "f_max",
     "type": "integer",
     "unit": "1",
     "default": 0,
     "enum": null,
     "description": null
    },
    {
     "name": "cl_max",
     "type": "integer",
     "unit": "1",
     "default": 0,
     "enum": null,
     "description": null
    },
    {
     "name": "br_max",
     "type": "integer",
     "unit": "1",
     "default": 0,
     "enum": null,
     "description": null
    },
    {
     "name": "i_max",
     "type": "integer",
     "unit": "1",
     "default": 0,
     "enum": null,
     "description": null
    },
    {
     "name": "min_atoms",
     "type": "object",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Lower limits per element, e.g. {\"Cl\": 1} when the isotope pattern shows chlorine."
    },
    {
     "name": "rdbe_min",
     "type": "number",
     "unit": "1",
     "default": 0,
     "enum": null,
     "description": null
    },
    {
     "name": "rdbe_max",
     "type": "number",
     "unit": "1",
     "default": 40,
     "enum": null,
     "description": null
    },
    {
     "name": "h_per_c_min",
     "type": "number",
     "unit": "1",
     "default": 0.2,
     "enum": null,
     "description": null
    },
    {
     "name": "h_per_c_max",
     "type": "number",
     "unit": "1",
     "default": 3.1,
     "enum": null,
     "description": null
    },
    {
     "name": "nitrogen_rule",
     "type": "boolean",
     "unit": null,
     "default": true,
     "enum": null,
     "description": "Keep only closed-shell neutral formulas: nominal mass and N count both even or both odd (same as a whole-number RDBE for these ten elements)."
    },
    {
     "name": "target_formula",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Optional expected formula (e.g. C6H12O6): its mass, error, RDBE and why it is or is not listed."
    },
    {
     "name": "max_candidates",
     "type": "integer",
     "unit": "1",
     "default": 25,
     "enum": null,
     "description": "Rows in the candidates reading; out/candidates.csv holds them all."
    }
   ],
   "outputs": [
    {
     "name": "measured",
     "unit": "Da",
     "description": "The measured value: neutral mass, or m/z in Da per charge."
    },
    {
     "name": "neutral_mass_Da",
     "unit": "Da",
     "description": null
    },
    {
     "name": "tolerance_ppm",
     "unit": null,
     "description": "parts per million (no kernel unit for ppm, left undeclared)"
    },
    {
     "name": "window_mDa",
     "unit": "mDa",
     "description": "Half-width of the neutral-mass window."
    },
    {
     "name": "in_window_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "candidate_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "listed_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "unique",
     "unit": null,
     "description": "true when exactly one formula passes"
    },
    {
     "name": "best_formula",
     "unit": null,
     "description": "Hill formula of the lowest-|error| candidate"
    },
    {
     "name": "best_mass_Da",
     "unit": "Da",
     "description": null
    },
    {
     "name": "best_mz",
     "unit": "Da",
     "description": null
    },
    {
     "name": "best_error_ppm",
     "unit": null,
     "description": "(measured - theoretical)/theoretical x 1e6, parts per million"
    },
    {
     "name": "best_error_mDa",
     "unit": "mDa",
     "description": null
    },
    {
     "name": "best_rdbe",
     "unit": "1",
     "description": null
    },
    {
     "name": "best_h_per_c",
     "unit": "1",
     "description": null
    },
    {
     "name": "best_nominal_mass",
     "unit": "Da",
     "description": null
    },
    {
     "name": "second_error_ppm",
     "unit": null,
     "description": "parts per million"
    },
    {
     "name": "candidates",
     "unit": null,
     "description": "Best first: formula, mass_Da, mz, error_ppm, error_mDa, rdbe, h_per_c, nominal_mass, nitrogen_rule_ok, atoms"
    },
    {
     "name": "target",
     "unit": null,
     "description": "The expected formula, if named"
    },
    {
     "name": "rejected",
     "unit": null,
     "description": "Formulas inside the window rejected by each rule (one formula may fail several)"
    },
    {
     "name": "warnings",
     "unit": null,
     "description": null
    },
    {
     "name": "search_nodes",
     "unit": "1",
     "description": "Loop steps taken; out/candidates.csv holds every candidate, best first, with its atom counts."
    }
   ],
   "selftests": [
    {
     "name": "Glucose C6H12O6 at 180.06339 Da, 5 ppm (spec): listed; mass = 72 + 12 x 1.00782503223 + 6 x 15.99491461957 = 180.06338810418 Da (IUPAC monoisotopic sum, rel 1e-12); RDBE = 6 - 12/2 + 1 = 1; error = (180.06339 - 180.06338810418)/180.06338810418 x 1e6 = 0.0105286256 ppm (exact decimal arithmetic, abs 1e-6 ppm)",
     "checks": [
      "best_formula",
      "target.error_ppm",
      "target.listed",
      "target.mass_Da",
      "target.rdbe"
     ]
    },
    {
     "name": "Caffeine [M+H]+ at m/z 195.08765, 5 ppm (spec): best C8H10N4O2; m/z = 194.08037557916 + 1.00782503223 - 0.000548579909 (CODATA m_e) = 195.087652031481 (rel 1e-12); RDBE = 8 - 10/2 + 4/2 + 1 = 6; error -0.0104131706 ppm (exact decimal, abs 1e-6 ppm)",
     "checks": [
      "best_error_ppm",
      "best_formula",
      "best_mz",
      "best_rdbe"
     ]
    },
    {
     "name": "Benzene C6H6 at 78.04695 Da, 5 ppm (spec): the only formula; RDBE = 6 - 6/2 + 1 = 4 (three C=C + one ring); mass 78.04695019338 Da (IUPAC sum, rel 1e-12)",
     "checks": [
      "best_formula",
      "best_mass_Da",
      "best_rdbe",
      "unique"
     ]
    },
    {
     "name": "Tight tolerance 0.1 ppm at 180.06339 Da returns one formula, C6H12O6 (spec; the 5 ppm runner-up C7H16OS2 sits 4.8 ppm away, checked by an independent brute-force enumeration)",
     "checks": [
      "best_formula",
      "candidate_count",
      "unique"
     ]
    },
    {
     "name": "Halogen RDBE: chlorobenzene C6H5Cl at 112.00798 Da, cl_max 2: RDBE = 6 - (5+1)/2 + 1 = 4; mass 72 + 5 x 1.00782503223 + 34.968852682 = 112.00797784315 Da (IUPAC sum, rel 1e-12)",
     "checks": [
      "best_formula",
      "target.listed",
      "target.mass_Da",
      "target.rdbe"
     ]
    },
    {
     "name": "Nitrogen rule: radical C5H6N (nominal 80, one N, RDBE 5 - 6/2 + 1/2 + 1 = 3.5) at 80.05002 Da is in the 5 ppm window but rejected",
     "checks": [
      "target.listed",
      "target.nitrogen_rule_ok",
      "target.nominal_mass",
      "target.rdbe"
     ]
    },
    {
     "name": "Negative mode: glucose [M-H]- at m/z 179.0561, 3 ppm: m/z = 180.06338810418 - 1.00782503223 + 0.000548579909 = 179.056111651859 (rel 1e-12; electron added, not removed)",
     "checks": [
      "best_formula",
      "best_mz",
      "charge"
     ]
    }
   ],
   "title": "Formula from accurate mass",
   "needs_build": true,
   "category": "Mass spectrometry",
   "known_answers": 27
  },
  {
   "name": "gas_eos",
   "version": "0.1.0",
   "summary": "Real-gas equations of state (ideal, van der Waals, Redlich-Kwong, Peng-Robinson) from the critical temperature, critical pressure and acentric factor given as inputs: compressibility Z, liquid and vapour molar volumes, fugacity coefficient, second virial coefficient, saturation pressure by equal fugacity, the isotherm and the vapour-pressure curve as csv.",
   "runtime": "native",
   "timeout_s": 30,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "eos",
     "type": "string",
     "unit": "1",
     "default": "peng_robinson",
     "enum": [
      "ideal",
      "van_der_waals",
      "redlich_kwong",
      "peng_robinson"
     ],
     "description": "Equation of state."
    },
    {
     "name": "T_K",
     "type": "number",
     "unit": "K",
     "default": 300.0,
     "enum": null,
     "description": "Temperature."
    },
    {
     "name": "P_Pa",
     "type": "number",
     "unit": "Pa",
     "default": 101325.0,
     "enum": null,
     "description": "Absolute pressure."
    },
    {
     "name": "Tc_K",
     "type": "number",
     "unit": "K",
     "default": null,
     "enum": null,
     "description": "Critical temperature of the substance (needed for every eos but ideal)."
    },
    {
     "name": "Pc_Pa",
     "type": "number",
     "unit": "Pa",
     "default": null,
     "enum": null,
     "description": "Critical pressure of the substance (needed for every eos but ideal)."
    },
    {
     "name": "omega",
     "type": "number",
     "unit": "1",
     "default": 0.0,
     "enum": null,
     "description": "Acentric factor (Peng-Robinson only)."
    },
    {
     "name": "kappa",
     "type": "number",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "Peng-Robinson alpha slope; replaces the 1976 correlation 0.37464 + 1.54226 omega - 0.26992 omega^2 when given."
    },
    {
     "name": "isotherm_points",
     "type": "integer",
     "unit": "1",
     "default": 200,
     "enum": null,
     "description": "Rows in out/isotherm.csv."
    }
   ],
   "outputs": [
    {
     "name": "eos",
     "unit": "1",
     "description": null
    },
    {
     "name": "R_J_per_mol_K",
     "unit": "J/(mol K)",
     "description": null
    },
    {
     "name": "T_K",
     "unit": "K",
     "description": null
    },
    {
     "name": "P_Pa",
     "unit": "Pa",
     "description": null
    },
    {
     "name": "reduced_temperature",
     "unit": "1",
     "description": null
    },
    {
     "name": "reduced_pressure",
     "unit": "1",
     "description": null
    },
    {
     "name": "omega_a",
     "unit": "1",
     "description": null
    },
    {
     "name": "omega_b",
     "unit": "1",
     "description": null
    },
    {
     "name": "alpha",
     "unit": "1",
     "description": null
    },
    {
     "name": "kappa",
     "unit": "1",
     "description": null
    },
    {
     "name": "a_Pa_m6_per_mol2",
     "unit": "Pa m^6/mol^2",
     "description": null
    },
    {
     "name": "b_m3_per_mol",
     "unit": "m^3/mol",
     "description": null
    },
    {
     "name": "A",
     "unit": "1",
     "description": null
    },
    {
     "name": "B",
     "unit": "1",
     "description": null
    },
    {
     "name": "Z",
     "unit": "1",
     "description": null
    },
    {
     "name": "phase",
     "unit": "1",
     "description": null
    },
    {
     "name": "real_root_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "Z_liquid",
     "unit": "1",
     "description": null
    },
    {
     "name": "Z_vapor",
     "unit": "1",
     "description": null
    },
    {
     "name": "molar_volume_m3_per_mol",
     "unit": "m^3/mol",
     "description": null
    },
    {
     "name": "molar_volume_L_per_mol",
     "unit": "L/mol",
     "description": null
    },
    {
     "name": "density_mol_per_m3",
     "unit": "mol/m^3",
     "description": null
    },
    {
     "name": "V_liquid_L_per_mol",
     "unit": "L/mol",
     "description": null
    },
    {
     "name": "V_vapor_L_per_mol",
     "unit": "L/mol",
     "description": null
    },
    {
     "name": "ln_fugacity_coefficient",
     "unit": "1",
     "description": null
    },
    {
     "name": "fugacity_coefficient",
     "unit": "1",
     "description": null
    },
    {
     "name": "fugacity_Pa",
     "unit": "Pa",
     "description": null
    },
    {
     "name": "fugacity_coefficient_liquid",
     "unit": "1",
     "description": null
    },
    {
     "name": "fugacity_coefficient_vapor",
     "unit": "1",
     "description": null
    },
    {
     "name": "cubic_residual",
     "unit": "1",
     "description": null
    },
    {
     "name": "triple_root_spread",
     "unit": "1",
     "description": null
    },
    {
     "name": "second_virial_m3_per_mol",
     "unit": "m^3/mol",
     "description": null
    },
    {
     "name": "second_virial_from_Z_m3_per_mol",
     "unit": "m^3/mol",
     "description": null
    },
    {
     "name": "Zc",
     "unit": "1",
     "description": null
    },
    {
     "name": "Vc_L_per_mol",
     "unit": "L/mol",
     "description": null
    },
    {
     "name": "critical_pressure_ratio",
     "unit": "1",
     "description": null
    },
    {
     "name": "critical_dP_dV_reduced",
     "unit": "1",
     "description": null
    },
    {
     "name": "critical_d2P_dV2_reduced",
     "unit": "1",
     "description": null
    },
    {
     "name": "saturation_pressure_Pa",
     "unit": "Pa",
     "description": null
    },
    {
     "name": "saturation_Z_liquid",
     "unit": "1",
     "description": null
    },
    {
     "name": "saturation_Z_vapor",
     "unit": "1",
     "description": null
    },
    {
     "name": "saturation_V_liquid_L_per_mol",
     "unit": "L/mol",
     "description": null
    },
    {
     "name": "saturation_V_vapor_L_per_mol",
     "unit": "L/mol",
     "description": null
    },
    {
     "name": "saturation_fugacity_coefficient",
     "unit": "1",
     "description": null
    },
    {
     "name": "saturation_ln_phi_gap",
     "unit": "1",
     "description": null
    },
    {
     "name": "spinodal_min_Pa",
     "unit": "Pa",
     "description": null
    },
    {
     "name": "spinodal_max_Pa",
     "unit": "Pa",
     "description": null
    },
    {
     "name": "pressure_over_saturation",
     "unit": "1",
     "description": null
    },
    {
     "name": "isotherm_csv",
     "unit": "1",
     "description": "out/isotherm.csv: V_L_per_mol, P_Pa, Z, P_ideal_Pa, P_coexistence_Pa (Maxwell line inside the two-phase dome)."
    },
    {
     "name": "isotherm_points",
     "unit": "1",
     "description": null
    },
    {
     "name": "saturation_curve_csv",
     "unit": "1",
     "description": "out/saturation_curve.csv: T_K, T_over_Tc, P_sat_Pa, V_liquid_L_per_mol, V_vapor_L_per_mol from 0.45 Tc to 0.995 Tc."
    },
    {
     "name": "saturation_curve_points",
     "unit": "1",
     "description": null
    },
    {
     "name": "all_ok",
     "unit": "1",
     "description": null
    },
    {
     "name": "warnings",
     "unit": "1",
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "ideal gas molar volume R T / P at 273.15 K and 101325 Pa = 22.41396954 L/mol (CODATA 2018, R exact from k_B N_A); closed form, rel 1e-9",
     "checks": [
      "Z",
      "molar_volume_L_per_mol"
     ]
    },
    {
     "name": "van der Waals critical point (Tc 400 K, Pc 4 MPa): Zc = 3/8 exactly, Omega_a = 27/64, Omega_b = 1/8, dP/dV = d2P/dV2 = 0 at (Tc, Vc); Z of the triple root to abs 1e-4 because a triple root carries the cube root of rounding (~5e-6)",
     "checks": [
      "Z",
      "Zc",
      "critical_d2P_dV2_reduced",
      "critical_dP_dV_reduced",
      "critical_pressure_ratio",
      "omega_a",
      "omega_b",
      "triple_root_spread"
     ]
    },
    {
     "name": "Redlich-Kwong critical point: Zc = 1/3 exactly, Omega_b = (2^(1/3)-1)/3 = 0.08664035, Omega_a = 1/(9(2^(1/3)-1)) = 0.42748023 (Redlich & Kwong 1949 closed forms, rel 1e-6); triple root Z abs 1e-4 (cube-root conditioning)",
     "checks": [
      "Z",
      "Zc",
      "critical_d2P_dV2_reduced",
      "critical_dP_dV_reduced",
      "omega_a",
      "omega_b",
      "triple_root_spread"
     ]
    },
    {
     "name": "Peng-Robinson critical point (Peng & Robinson 1976 textbook values Zc 0.3074, Omega_a 0.45724, Omega_b 0.07780, abs tol half the last printed digit); dP/dV = d2P/dV2 = 0; triple root Z abs 1e-4 (cube-root conditioning)",
     "checks": [
      "Z",
      "Zc",
      "alpha",
      "critical_d2P_dV2_reduced",
      "critical_dP_dV_reduced",
      "omega_a",
      "omega_b",
      "triple_root_spread"
     ]
    },
    {
     "name": "van der Waals second virial B2 = b - a/(R T) = -(19/64) R Tc/Pc = -2.46835609e-4 m3/mol at T = Tc = 400 K, Pc = 4 MPa (closed form); Z at 1 Pa tends to 1 + B2 P/(R T) = 1 - 7.421875e-8 (abs 1e-12, the next virial term is ~1e-14); B2 from the solved Z at low pressure rel 1e-6 (finite-pressure slope)",
     "checks": [
      "Z",
      "second_virial_from_Z_m3_per_mol",
      "second_virial_m3_per_mol"
     ]
    },
    {
     "name": "van der Waals saturation by equal fugacity against Lekner's exact parametric coexistence (Am. J. Phys. 50, 161, 1982) at y = 1: T = 0.900880331 Tc, P = 0.649705129 Pc, V_L = 0.604476735 Vc, V_V = 2.336827136 Vc (Tc 400 K, Pc 4 MPa); closed form, rel 1e-7",
     "checks": [
      "saturation_V_liquid_L_per_mol",
      "saturation_V_vapor_L_per_mol",
      "saturation_ln_phi_gap",
      "saturation_pressure_Pa"
     ]
    }
   ],
   "title": "Real-gas equation of state",
   "needs_build": true,
   "category": "Chemistry",
   "known_answers": 32
  },
  {
   "name": "gear_train",
   "version": "0.1.0",
   "summary": "Generic ISO/AGMA involute spur gear pair designer: pitch/tip/root diameters, center distance, gear ratio, transverse contact ratio, undercut check, tangential/radial forces, Lewis tooth bending stress, Hertzian contact stress, exact 2D involute tooth profiles (gear_profiles.json for solid), and a 3D meshed scene.glb.",
   "runtime": "native",
   "timeout_s": 30,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "module_mm",
     "type": "number",
     "unit": "mm",
     "default": 2.0,
     "enum": null,
     "description": null
    },
    {
     "name": "z1",
     "type": "integer",
     "unit": null,
     "default": 20,
     "enum": null,
     "description": null
    },
    {
     "name": "z2",
     "type": "integer",
     "unit": null,
     "default": 40,
     "enum": null,
     "description": null
    },
    {
     "name": "pressure_angle_deg",
     "type": "number",
     "unit": "deg",
     "default": 20.0,
     "enum": null,
     "description": null
    },
    {
     "name": "face_width_mm",
     "type": "number",
     "unit": "mm",
     "default": 10.0,
     "enum": null,
     "description": null
    },
    {
     "name": "input_torque_Nm",
     "type": "number",
     "unit": "N m",
     "default": 1.0,
     "enum": null,
     "description": null
    },
    {
     "name": "E_MPa",
     "type": "number",
     "unit": "MPa",
     "default": 200000.0,
     "enum": null,
     "description": null
    },
    {
     "name": "nu",
     "type": "number",
     "unit": "1",
     "default": 0.3,
     "enum": null,
     "description": null
    }
   ],
   "outputs": [
    {
     "name": "gear_ratio",
     "unit": "1",
     "description": null
    },
    {
     "name": "pitch_d1_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "pitch_d2_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "center_distance_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "contact_ratio",
     "unit": "1",
     "description": null
    },
    {
     "name": "tangential_force_N",
     "unit": "N",
     "description": null
    },
    {
     "name": "radial_force_N",
     "unit": "N",
     "description": null
    },
    {
     "name": "output_torque_Nm",
     "unit": "N m",
     "description": null
    },
    {
     "name": "lewis_bending_pinion_MPa",
     "unit": "MPa",
     "description": null
    },
    {
     "name": "hertz_contact_MPa",
     "unit": "MPa",
     "description": null
    },
    {
     "name": "gear_profiles.json",
     "unit": null,
     "description": null
    },
    {
     "name": "scene.glb",
     "unit": null,
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "standard 20-deg pair m=2, z1=20, z2=40: center distance 60 mm, ratio 2.0, contact ratio 1.635186, no undercut",
     "checks": [
      "center_distance_mm",
      "contact_ratio",
      "gear_ratio",
      "tangential_force_N",
      "undercut_warning"
     ]
    },
    {
     "name": "10-tooth pinion at 20 deg triggers undercut warning",
     "checks": [
      "center_distance_mm",
      "undercut_warning"
     ]
    }
   ],
   "title": "Involute gear pair",
   "needs_build": true,
   "category": "Mechanics, CAD and finite elements",
   "known_answers": 7
  },
  {
   "name": "hardy_weinberg",
   "version": "0.1.0",
   "summary": "Hardy-Weinberg analysis of genotype counts at one autosomal locus with two or more alleles: allele frequencies with standard errors, expected counts, Pearson chi-square, the Levene-Haldane exact test (full enumeration, or seeded Monte Carlo when too large), observed and expected heterozygosity and the inbreeding coefficient F. Also: allele and carrier frequency from the incidence of a recessive condition (with optional Wright's F), and the chi-square upper tail.",
   "runtime": "native",
   "timeout_s": 60,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "mode",
     "type": "string",
     "unit": null,
     "default": "genotypes",
     "enum": [
      "genotypes",
      "carrier",
      "chi_square_p"
     ],
     "description": "genotypes: test counts for Hardy-Weinberg proportions; carrier: allele and carrier frequency from the incidence of a recessive condition; chi_square_p: upper tail of the chi-square distribution."
    },
    {
     "name": "counts",
     "type": "array",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "Genotype counts in the order A1A1, A1A2, A2A2, A1A3, A2A3, A3A3, ...: k(k+1)/2 numbers for k alleles (2 to 12). Two alleles: [AA, AB, BB]. Give this or 'genotypes'."
    },
    {
     "name": "genotypes",
     "type": "object",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Genotype counts by name, e.g. {\"M/M\": 298, \"M/N\": 489, \"N/N\": 213}. Give this or 'counts'."
    },
    {
     "name": "alleles",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Allele names (optional): fixes their order and lets absent alleles be listed."
    },
    {
     "name": "alpha",
     "type": "number",
     "unit": "1",
     "default": 0.05,
     "enum": null,
     "description": "Significance level for the verdict."
    },
    {
     "name": "exact_method",
     "type": "string",
     "unit": null,
     "default": "auto",
     "enum": [
      "auto",
      "enumerate",
      "monte_carlo",
      "none"
     ],
     "description": "auto: enumerate every table if it fits the budget, else Monte Carlo; none: chi-square only."
    },
    {
     "name": "mc_draws",
     "type": "integer",
     "unit": "1",
     "default": 20000,
     "enum": null,
     "description": "Random matings of the allele pool for the Monte Carlo exact test."
    },
    {
     "name": "seed",
     "type": "integer",
     "unit": "1",
     "default": 1,
     "enum": null,
     "description": null
    },
    {
     "name": "incidence",
     "type": "number",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "carrier mode: fraction of people affected by the recessive condition (1 in 2500 is 0.0004)."
    },
    {
     "name": "incidence_one_in",
     "type": "number",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "carrier mode: the same as 1 / incidence, e.g. 2500."
    },
    {
     "name": "inbreeding_F",
     "type": "number",
     "unit": "1",
     "default": 0,
     "enum": null,
     "description": "carrier mode: Wright's inbreeding coefficient of the population (0 random mating, 1/16 first-cousin children)."
    },
    {
     "name": "chi_square",
     "type": "number",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "chi_square_p mode: the statistic."
    },
    {
     "name": "df",
     "type": "integer",
     "unit": "1",
     "default": 1,
     "enum": null,
     "description": "chi_square_p mode: degrees of freedom."
    }
   ],
   "outputs": [
    {
     "name": "mode",
     "unit": null,
     "description": "genotypes, carrier or chi_square_p"
    },
    {
     "name": "n_individuals",
     "unit": "1",
     "description": null
    },
    {
     "name": "n_alleles",
     "unit": "1",
     "description": null
    },
    {
     "name": "allele_freq",
     "unit": null,
     "description": null
    },
    {
     "name": "p",
     "unit": "1",
     "description": "Frequency of the first allele (two alleles only)."
    },
    {
     "name": "q",
     "unit": "1",
     "description": "Frequency of the second allele (two alleles), or of the recessive allele (carrier mode)."
    },
    {
     "name": "chi_square",
     "unit": "1",
     "description": null
    },
    {
     "name": "df",
     "unit": "1",
     "description": null
    },
    {
     "name": "chi_square_p",
     "unit": "1",
     "description": null
    },
    {
     "name": "exact_p",
     "unit": "1",
     "description": "Levene-Haldane exact test: sum of the probabilities of every genotype table no more probable than the observed one."
    },
    {
     "name": "exact_p_het_deficit",
     "unit": "1",
     "description": null
    },
    {
     "name": "exact_p_het_excess",
     "unit": "1",
     "description": null
    },
    {
     "name": "exact_p_se",
     "unit": "1",
     "description": null
    },
    {
     "name": "exact_tables",
     "unit": "1",
     "description": null
    },
    {
     "name": "exact_prob_sum",
     "unit": "1",
     "description": null
    },
    {
     "name": "exact_mean_het_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "observed_het",
     "unit": "1",
     "description": null
    },
    {
     "name": "expected_het",
     "unit": "1",
     "description": null
    },
    {
     "name": "expected_het_unbiased",
     "unit": "1",
     "description": null
    },
    {
     "name": "inbreeding_F",
     "unit": "1",
     "description": "1 - H_obs / H_exp (genotypes mode); the input F (carrier mode)."
    },
    {
     "name": "min_expected_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "hwe_p",
     "unit": "1",
     "description": "The p-value the verdict uses: exact when available, else chi-square."
    },
    {
     "name": "hwe_ok",
     "unit": null,
     "description": "true when hwe_p is at or above alpha (genotypes mode)"
    },
    {
     "name": "genotype_table",
     "unit": null,
     "description": null
    },
    {
     "name": "allele_table",
     "unit": null,
     "description": null
    },
    {
     "name": "incidence",
     "unit": "1",
     "description": null
    },
    {
     "name": "carrier_frequency",
     "unit": "1",
     "description": "2pq(1-F): heterozygote carriers in the whole population."
    },
    {
     "name": "carriers_one_in",
     "unit": "1",
     "description": null
    },
    {
     "name": "carrier_frequency_among_unaffected",
     "unit": "1",
     "description": null
    },
    {
     "name": "carriers_per_affected",
     "unit": "1",
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "MN blood group textbook counts 298/489/213: p = 1085/2000 = 0.5425 exactly, expected M/N = 2Npq = 496.3875, chi-square = N F^2 = 0.221490 (textbook 0.222), df 1 (closed form, rel 1e-9)",
     "checks": [
      "chi_square",
      "df",
      "genotype_table.M/N.expected",
      "inbreeding_F",
      "p",
      "q"
     ]
    },
    {
     "name": "counts exactly p^2 : 2pq : q^2 (36/48/16, p = 0.6): chi-square 0, F 0, chi-square p 1 (exact identity, abs 1e-12)",
     "checks": [
      "chi_square",
      "chi_square_p",
      "hwe_ok",
      "inbreeding_F",
      "p"
     ]
    },
    {
     "name": "only heterozygotes 0/4/0: F = -1, chi-square = N F^2 = 4, its p = erfc(sqrt 2) = 0.0455003, Levene-Haldane exact p = (3 + 8)/35 and excess p = 8/35 by hand enumeration of 3 tables (rel 1e-9)",
     "checks": [
      "chi_square",
      "chi_square_p",
      "exact_p",
      "exact_p_het_excess",
      "exact_tables",
      "inbreeding_F"
     ]
    },
    {
     "name": "three alleles in exact proportions (p = .5/.3/.2, N = 100: 25/30/9/20/12/4): chi-square 0, F 0, df 3, p1 = 0.5 (exact identity)",
     "checks": [
      "allele_freq.A1",
      "allele_freq.A3",
      "chi_square",
      "df",
      "inbreeding_F"
     ]
    },
    {
     "name": "three alleles, N = 2 (A1/A2 + A3/A3): chi-square 4 and exact p = 1/3 by hand (two possible tables, probabilities 1/3 and 2/3), df 3 (rel 1e-9)",
     "checks": [
      "chi_square",
      "df",
      "exact_p",
      "exact_tables"
     ]
    },
    {
     "name": "recessive incidence 1/2500: q = sqrt(0.0004) = 0.02, carriers 2pq = 0.0392 (textbook), 1 in 25.51 (closed form, rel 1e-12)",
     "checks": [
      "carrier_frequency",
      "carriers_one_in",
      "q"
     ]
    },
    {
     "name": "first-cousin F = 1/16, incidence (1-F)q^2 + Fq = 13/8000 built from q = 0.02: q recovered = 0.02, carriers 2pq(1-F) = 0.03675 (closed form, rel 1e-12)",
     "checks": [
      "carrier_frequency",
      "q"
     ]
    },
    {
     "name": "chi-square 1 df at its 0.95 quantile 3.841458820694124: p = erfc(sqrt(x/2)) = 0.05 (closed form, rel 1e-9)",
     "checks": [
      "chi_square_p"
     ]
    },
    {
     "name": "chi-square 2 df at 5.991464547107979: p = exp(-x/2) = 0.05 (closed form, rel 1e-9)",
     "checks": [
      "chi_square_p"
     ]
    },
    {
     "name": "chi-square 4 df at 10: p = exp(-5)(1 + 5) = 0.0404277 (closed form, rel 1e-9)",
     "checks": [
      "chi_square_p"
     ]
    }
   ],
   "title": "Hardy-Weinberg equilibrium",
   "needs_build": true,
   "category": "Genomics",
   "known_answers": 34
  },
  {
   "name": "hbond_find",
   "version": "0.1.0",
   "summary": "Hydrogen bonds and salt bridges in a protein from PDB/mmCIF by geometry: donor-acceptor distance and D-H...A angle, backbone amide H placed on the C(i-1)-N-CA bisector, counts by type (bb-bb, sc-bb, bb-sc, sc-sc), backbone i->i+4 helix pairs, Asp/Glu-Lys/Arg salt bridges.",
   "runtime": "native",
   "timeout_s": 60,
   "estimate_s": 0.1,
   "inputs": [
    {
     "name": "structure_text",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "PDB (ATOM records) or mmCIF text. HETATM, water and ligands are not read."
    },
    {
     "name": "structure_file",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "A PDB or mmCIF file, used when structure_text is empty."
    },
    {
     "name": "chain",
     "type": "string",
     "unit": null,
     "default": "",
     "enum": null,
     "description": "Only this chain; empty reads every chain."
    },
    {
     "name": "dist_max_A",
     "type": "number",
     "unit": "\u00c5",
     "default": 3.5,
     "enum": null,
     "description": "Largest donor-acceptor distance for an H-bond."
    },
    {
     "name": "angle_min_deg",
     "type": "number",
     "unit": "deg",
     "default": 120.0,
     "enum": null,
     "description": "Smallest D-H...A angle, applied where the donor's H is known (backbone N)."
    },
    {
     "name": "salt_bridge_max_A",
     "type": "number",
     "unit": "\u00c5",
     "default": 4.0,
     "enum": null,
     "description": "Largest carboxylate O to Lys/Arg N distance for a salt bridge."
    },
    {
     "name": "nh_bond_A",
     "type": "number",
     "unit": "\u00c5",
     "default": 1.01,
     "enum": null,
     "description": "N-H length of a placed amide hydrogen."
    },
    {
     "name": "peptide_bond_max_A",
     "type": "number",
     "unit": "\u00c5",
     "default": 2.0,
     "enum": null,
     "description": "C(i-1)-N(i) distance above which the chain is taken as broken (no H placed)."
    },
    {
     "name": "include_his_salt_bridges",
     "type": "boolean",
     "unit": null,
     "default": false,
     "enum": null,
     "description": "Count His ND1/NE2 as a base for salt bridges."
    }
   ],
   "outputs": [
    {
     "name": "atoms_read",
     "unit": "1",
     "description": null
    },
    {
     "name": "residues",
     "unit": "1",
     "description": null
    },
    {
     "name": "chains",
     "unit": "1",
     "description": null
    },
    {
     "name": "donors",
     "unit": "1",
     "description": null
    },
    {
     "name": "acceptors",
     "unit": "1",
     "description": null
    },
    {
     "name": "amide_h_placed",
     "unit": "1",
     "description": null
    },
    {
     "name": "amide_h_from_file",
     "unit": "1",
     "description": null
    },
    {
     "name": "placed_h_bond_max_dev_A",
     "unit": "\u00c5",
     "description": null
    },
    {
     "name": "placed_h_out_of_plane_max_A",
     "unit": "\u00c5",
     "description": null
    },
    {
     "name": "hbond_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "hbond_bb_bb",
     "unit": "1",
     "description": "backbone N-H to backbone O"
    },
    {
     "name": "hbond_sc_bb",
     "unit": "1",
     "description": "side-chain donor to backbone O"
    },
    {
     "name": "hbond_bb_sc",
     "unit": "1",
     "description": "backbone N-H to side-chain acceptor"
    },
    {
     "name": "hbond_sc_sc",
     "unit": "1",
     "description": null
    },
    {
     "name": "hbond_distance_only",
     "unit": "1",
     "description": "bonds from side-chain donors, judged on distance alone; a give-or-take pair (OH...OH, OH...His N) is counted once"
    },
    {
     "name": "helix_i4_count",
     "unit": "1",
     "description": "backbone O(i) to N-H(i+4), same chain"
    },
    {
     "name": "turn_i3_count",
     "unit": "1",
     "description": "backbone O(i) to N-H(i+3), same chain"
    },
    {
     "name": "salt_bridge_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "mean_distance_DA_A",
     "unit": "\u00c5",
     "description": null
    },
    {
     "name": "mean_angle_DHA_deg",
     "unit": "deg",
     "description": null
    },
    {
     "name": "shortest_distance_DA_A",
     "unit": "\u00c5",
     "description": null
    },
    {
     "name": "warnings",
     "unit": null,
     "description": null
    },
    {
     "name": "hbonds",
     "unit": null,
     "description": null
    },
    {
     "name": "i4_pairs",
     "unit": null,
     "description": null
    },
    {
     "name": "salt_bridges",
     "unit": null,
     "description": null
    },
    {
     "name": "placed_h",
     "unit": null,
     "description": null
    },
    {
     "name": "hbonds.csv",
     "unit": null,
     "description": null
    },
    {
     "name": "salt_bridges.csv",
     "unit": null,
     "description": null
    },
    {
     "name": "amide_h.csv",
     "unit": null,
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "N-H...O at D-A 3.49 A, just inside 3.5 A, angle 180 (exact construction): 1 bb-bb bond, H...A = 3.49 - 1.01 = 2.48 A; placed H = (-1.01, 0, 0) on the C(i-1)-N-CA bisector, in plane, C-N-H = 180 - atan(15/8) deg (closed form)",
     "checks": [
      "amide_h_placed",
      "hbond_bb_bb",
      "hbond_count",
      "hbonds.0.angle_DHA_deg",
      "hbonds.0.distance_DA_A",
      "hbonds.0.distance_HA_A",
      "placed_h.0.angle_CA_N_H_deg",
      "placed_h.0.angle_C_N_H_deg",
      "placed_h.0.n_h_A",
      "placed_h.0.out_of_plane_A",
      "placed_h.0.x_A",
      "placed_h.0.y_A",
      "placed_h.0.z_A"
     ]
    },
    {
     "name": "same donor, O at D-A 3.51 A, just outside 3.5 A (exact construction): no H-bond",
     "checks": [
      "amide_h_placed",
      "hbond_count"
     ]
    },
    {
     "name": "angle cutoff 120 deg: O at D-H...A = acos(-0.6) = 126.87 deg is kept, O at acos(-5/13) = 112.62 deg is dropped (Pythagorean constructions, exact); H...A = 2.0 A, D-A = sqrt(2.21^2 + 1.6^2)",
     "checks": [
      "hbond_count",
      "hbonds.0.acceptor",
      "hbonds.0.angle_DHA_deg",
      "hbonds.0.distance_DA_A",
      "hbonds.0.distance_HA_A"
     ]
    },
    {
     "name": "angle cutoff raised to 127 deg: the acos(-0.6) = 126.87 deg bond is now just outside, none kept",
     "checks": [
      "hbond_count"
     ]
    },
    {
     "name": "salt bridge: Asp OD1 to Lys NZ at 3.0 A found, to Arg NE at 5.0 A not (cutoff 4.0 A, exact construction); the Lys NZ...OD1 pair is also 1 sc-sc H-bond on distance alone",
     "checks": [
      "hbond_count",
      "hbond_distance_only",
      "hbond_sc_sc",
      "salt_bridge_count",
      "salt_bridges.0.base",
      "salt_bridges.0.distance_A"
     ]
    },
    {
     "name": "hand-built set, counts known by construction: 1 bb-bb (O1 to NH5, an i->i+4 pair), 1 sc-bb (Ser OG 2.8 A), 1 bb-sc (NH61 to Asp OD1 3.0 A), 1 sc-sc (Lys-Glu 3.0 A, also the one salt bridge); Pro N (no amide H) and Thr OG1 at 3.8 A give none",
     "checks": [
      "amide_h_placed",
      "hbond_bb_bb",
      "hbond_bb_sc",
      "hbond_count",
      "hbond_distance_only",
      "hbond_sc_bb",
      "hbond_sc_sc",
      "helix_i4_count",
      "i4_pairs.0.acceptor_O",
      "i4_pairs.0.donor_NH",
      "salt_bridge_count"
     ]
    },
    {
     "name": "counted once by construction: two Ser OG 2.8 A apart can each give or take, with no hydrogens that is 1 sc-sc bond (not 2); a Tyr OH 2.7 A from a His NE2 likewise 1; total 2, both on distance alone",
     "checks": [
      "hbond_count",
      "hbond_distance_only",
      "hbond_sc_sc",
      "hbonds.0.distance_DA_A",
      "hbonds.1.distance_DA_A",
      "salt_bridge_count"
     ]
    }
   ],
   "title": "Hydrogen bonds and salt bridges",
   "needs_build": true,
   "category": "Structural biology",
   "known_answers": 44
  },
  {
   "name": "hertz_contact",
   "version": "0.1.0",
   "summary": "Hertz contact of two elastic bodies (sphere on flat, sphere on sphere or in a cup, cylinder on flat, parallel cylinders): contact radius or half-width, peak and mean pressure, approach and stiffness, the stresses down the load axis with the largest shear and von Mises stress and their depths, and an optional first-yield check per body. Closed forms of Hertz (1882) as given by K. L. Johnson, Contact Mechanics (1985), chapters 3 and 4.",
   "runtime": "native",
   "timeout_s": 30,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "geometry",
     "type": "string",
     "unit": null,
     "default": "sphere_on_flat",
     "enum": [
      "sphere_on_flat",
      "sphere_on_sphere",
      "cylinder_on_flat",
      "parallel_cylinders"
     ],
     "description": "Point contact (sphere_*) or line contact (cylinder_on_flat, parallel_cylinders with parallel axes)."
    },
    {
     "name": "force_N",
     "type": "number",
     "unit": "N",
     "default": 100.0,
     "enum": null,
     "description": "Normal load pressing the bodies together (for a line contact, the load over the whole length)."
    },
    {
     "name": "radius1_mm",
     "type": "number",
     "unit": "mm",
     "default": 10.0,
     "enum": null,
     "description": "Radius of body 1, the convex ball or roller."
    },
    {
     "name": "radius2_mm",
     "type": "number",
     "unit": "mm",
     "default": 10.0,
     "enum": null,
     "description": "Radius of body 2 (sphere_on_sphere, parallel_cylinders only); negative for a cup or groove, which must be wider than body 1."
    },
    {
     "name": "length_mm",
     "type": "number",
     "unit": "mm",
     "default": 10.0,
     "enum": null,
     "description": "Length of the line of contact (line contact only)."
    },
    {
     "name": "modulus1_GPa",
     "type": "number",
     "unit": "GPa",
     "default": 210.0,
     "enum": null,
     "description": "Young's modulus of body 1."
    },
    {
     "name": "modulus2_GPa",
     "type": "number",
     "unit": "GPa",
     "default": 210.0,
     "enum": null,
     "description": "Young's modulus of body 2 (the flat, for *_on_flat)."
    },
    {
     "name": "poisson1",
     "type": "number",
     "unit": "1",
     "default": 0.3,
     "enum": null,
     "description": null
    },
    {
     "name": "poisson2",
     "type": "number",
     "unit": "1",
     "default": 0.3,
     "enum": null,
     "description": null
    },
    {
     "name": "yield1_MPa",
     "type": "number",
     "unit": "MPa",
     "default": 0.0,
     "enum": null,
     "description": "Yield strength of body 1 for the first-yield check; 0 skips it."
    },
    {
     "name": "yield2_MPa",
     "type": "number",
     "unit": "MPa",
     "default": 0.0,
     "enum": null,
     "description": "Yield strength of body 2 for the first-yield check; 0 skips it."
    },
    {
     "name": "probe_depth_mm",
     "type": "number",
     "unit": "mm",
     "default": 0.0,
     "enum": null,
     "description": "Depth below the surface, on the load axis, where the stresses are also reported."
    },
    {
     "name": "small_contact_limit",
     "type": "number",
     "unit": "1",
     "default": 0.1,
     "enum": null,
     "description": "Largest contact size over the smallest radius accepted before warning that Hertz's half-space assumption is strained."
    }
   ],
   "outputs": [
    {
     "name": "geometry",
     "unit": null,
     "description": "Text: the geometry solved."
    },
    {
     "name": "contact_type",
     "unit": null,
     "description": "Text: point (circle) or line (strip)."
    },
    {
     "name": "effective_modulus_GPa",
     "unit": "GPa",
     "description": "E*: 1/E* = (1-nu1^2)/E1 + (1-nu2^2)/E2."
    },
    {
     "name": "effective_radius_mm",
     "unit": "mm",
     "description": "R: 1/R = 1/R1 + 1/R2."
    },
    {
     "name": "contact_radius_mm",
     "unit": "mm",
     "description": "a, point contact only."
    },
    {
     "name": "contact_half_width_mm",
     "unit": "mm",
     "description": "b, line contact only."
    },
    {
     "name": "contact_size_mm",
     "unit": "mm",
     "description": "a or b."
    },
    {
     "name": "contact_area_mm2",
     "unit": "mm^2",
     "description": null
    },
    {
     "name": "peak_pressure_MPa",
     "unit": "MPa",
     "description": null
    },
    {
     "name": "mean_pressure_MPa",
     "unit": "MPa",
     "description": null
    },
    {
     "name": "approach_mm",
     "unit": "mm",
     "description": "Approach of distant points, a^2/R; null for a line contact, where it depends on the bulk shape."
    },
    {
     "name": "stiffness_N_per_mm",
     "unit": "N/mm",
     "description": "Contact stiffness dF/d(approach) = 2 E* a; null for a line contact."
    },
    {
     "name": "max_shear_MPa",
     "unit": "MPa",
     "description": "Largest shear (Tresca) on the load axis, worse of the two bodies."
    },
    {
     "name": "max_shear_depth_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "max_shear_over_p0",
     "unit": "1",
     "description": null
    },
    {
     "name": "max_shear_depth_ratio",
     "unit": "1",
     "description": "Depth over a or b."
    },
    {
     "name": "max_shear_body",
     "unit": null,
     "description": "Text: body_1 or body_2."
    },
    {
     "name": "max_von_mises_MPa",
     "unit": "MPa",
     "description": null
    },
    {
     "name": "max_von_mises_depth_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "max_von_mises_over_p0",
     "unit": "1",
     "description": null
    },
    {
     "name": "max_von_mises_body",
     "unit": null,
     "description": "Text: body_1 or body_2."
    },
    {
     "name": "edge_tension_MPa",
     "unit": "MPa",
     "description": "Radial tension at the edge of the contact circle, (1-2 nu) p0 / 3; null for a line contact."
    },
    {
     "name": "probe_depth_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "probe_depth_ratio",
     "unit": "1",
     "description": null
    },
    {
     "name": "probe_axial_stress_MPa",
     "unit": "MPa",
     "description": null
    },
    {
     "name": "size_ratio",
     "unit": "1",
     "description": null
    },
    {
     "name": "small_contact_ok",
     "unit": null,
     "description": "true when size_ratio is at or below small_contact_limit."
    },
    {
     "name": "yield_check",
     "unit": null,
     "description": "Text: elastic, yields, or not checked (no yield strength given)."
    },
    {
     "name": "min_yield_margin",
     "unit": "1",
     "description": null
    },
    {
     "name": "yield_load_N",
     "unit": "N",
     "description": "Load at which the first body starts to yield below the surface (von Mises)."
    },
    {
     "name": "bodies",
     "unit": null,
     "description": null
    },
    {
     "name": "all_ok",
     "unit": null,
     "description": "true when there is no warning: the contact is small, and no body with a yield strength given yields."
    },
    {
     "name": "warnings",
     "unit": null,
     "description": "One line per body that yields, and one if the contact is not small."
    },
    {
     "name": "notes",
     "unit": null,
     "description": "Assumptions of the run, in words."
    }
   ],
   "selftests": [
    {
     "name": "Hertz sphere on flat, steel on steel, 100 N on R 10 mm: closed forms a = (3FR/4E*)^(1/3), p0 = 3F/(2 pi a^2), pm = F/(pi a^2), approach a^2/R, stiffness 2E*a, centre surface stress -(1+2nu)p0/2, edge tension (1-2nu)p0/3 (Johnson 1985 eqs 3.44-3.45, 4.22-4.23); rel 1e-6",
     "checks": [
      "approach_mm",
      "bodies.body_1.probe_lateral_stress_MPa",
      "contact_radius_mm",
      "edge_tension_MPa",
      "effective_modulus_GPa",
      "mean_pressure_MPa",
      "peak_pressure_MPa",
      "stiffness_N_per_mm"
     ]
    },
    {
     "name": "Hertz parallel cylinders R 10 and 20 mm, steel on aluminium (70 GPa, nu 0.33), 1000 N over 10 mm: closed forms R = R1R2/(R1+R2), b = sqrt(4FR/(pi L E*)), p0 = 2F/(pi b L), pm = F/(2bL), centre surface stress -p0 (Johnson 1985 eqs 4.43-4.45); rel 1e-6",
     "checks": [
      "bodies.body_1.probe_lateral_stress_MPa",
      "contact_half_width_mm",
      "effective_modulus_GPa",
      "effective_radius_mm",
      "mean_pressure_MPa",
      "peak_pressure_MPa"
     ]
    },
    {
     "name": "Line contact largest shear, exact: d/dz of z(1 - z/sqrt(1+z^2)) = 0 gives z^4 + z^2 = 1, so depth = phi^(-1/2) b = 0.786151378 b and shear = phi^(-5/2) p0 = 0.300283106 p0 (Johnson 1985 eq 4.47 with plane strain, nu 0.3); rel 1e-6",
     "checks": [
      "approach_mm",
      "max_shear_depth_ratio",
      "max_shear_over_p0"
     ]
    },
    {
     "name": "Sphere on sphere, two 12.7 mm balls, 500 N: R = R1/2 and the point closed forms (Johnson 1985 eqs 4.22-4.23); largest shear 0.31 p0 at 0.48 a for nu 0.3 (Johnson 1985 sec 3.4, quoted to 2 digits so abs 0.005)",
     "checks": [
      "approach_mm",
      "contact_radius_mm",
      "effective_radius_mm",
      "max_shear_depth_ratio",
      "max_shear_over_p0",
      "peak_pressure_MPa"
     ]
    },
    {
     "name": "First yield of a roller, steel on steel, 1000 N over 10 mm, nu 0.3: p0 = 606.037 MPa (closed form, eq 4.45) and von Mises yield starts at p0 = 1.79 Y (Johnson 1985 sec 6.2, quoted to 3 digits: abs 0.005, so margins rel 0.3 % and yield load, which goes as margin^2, rel 0.6 %). Body 1 Y 400 MPa: margin 1.18, elastic; body 2 Y 300 MPa: margin 0.886, yields at F (1.79 Y/p0)^2 = 785.1 N",
     "checks": [
      "all_ok",
      "bodies.body_1.yield_check",
      "bodies.body_1.yield_margin",
      "bodies.body_1.yield_onset_p0_over_yield",
      "bodies.body_2.yield_check",
      "bodies.body_2.yield_margin",
      "peak_pressure_MPa",
      "yield_check",
      "yield_load_N"
     ]
    }
   ],
   "title": "Hertz contact",
   "needs_build": true,
   "category": "Mechanics, CAD and finite elements",
   "known_answers": 32
  },
  {
   "name": "huckel_mo",
   "version": "0.1.0",
   "summary": "Hueckel molecular-orbital theory for a conjugated pi system given as atoms and bonds (heteroatom h and k optional): orbital energies alpha + x beta, coefficients, pi-electron energy, delocalisation energy against a localised structure, HOMO-LUMO gap, pi charges, bond orders and free valences. Optional beta in eV turns the gap into eV and a wavelength.",
   "runtime": "native",
   "timeout_s": 30,
   "estimate_s": 0.02,
   "inputs": [
    {
     "name": "atoms",
     "type": null,
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "The pi centres: a count of carbons (6), or a list where each item is a label (\"C\") or {\"label\": \"N\", \"h\": 0.5, \"electrons\": 1}. h sets the Coulomb integral alpha_X = alpha + h beta (carbon 0); electrons is what the atom gives to the pi system (0, 1 or 2). 1 to 80 centres."
    },
    {
     "name": "bonds",
     "type": "array",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "Bonds as [i, j] with atoms numbered from 1, or [i, j, k] where beta_ij = k beta (carbon-carbon 1). Each bond once."
    },
    {
     "name": "charge",
     "type": "integer",
     "unit": "1",
     "default": 0,
     "enum": null,
     "description": "Net charge of the pi system in elementary charges: 1 for a cation (one electron fewer), -1 for an anion."
    },
    {
     "name": "double_bonds",
     "type": "array",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "Optional: the double bonds of the localised reference structure, as [[1,2],[3,4]]. Left out, a maximum matching of the bonds between one-electron atoms is used."
    },
    {
     "name": "beta_eV",
     "type": "number",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Optional: the resonance integral beta in eV (negative, typically -2.4 to -3 for C-C). Gives the gap in eV and its wavelength. Left out, everything stays in units of beta."
    }
   ],
   "outputs": [
    {
     "name": "atoms",
     "unit": "1",
     "description": null
    },
    {
     "name": "bonds",
     "unit": "1",
     "description": null
    },
    {
     "name": "pi_electrons",
     "unit": "1",
     "description": null
    },
    {
     "name": "orbital_x",
     "unit": "1",
     "description": "orbital energies E = alpha + x beta, most bonding first (beta < 0, so larger x is lower in energy)"
    },
    {
     "name": "occupancy",
     "unit": "1",
     "description": null
    },
    {
     "name": "pi_energy_alpha",
     "unit": "1",
     "description": "the alpha part of the pi energy: the number of pi electrons"
    },
    {
     "name": "pi_energy_beta",
     "unit": "1",
     "description": "the beta part of the pi energy, in units of beta"
    },
    {
     "name": "reference_energy_beta",
     "unit": "1",
     "description": null
    },
    {
     "name": "delocalisation_energy_beta",
     "unit": "1",
     "description": "pi energy minus the localised reference, in units of beta (positive is stabilising)"
    },
    {
     "name": "delocalisation_energy_per_electron_beta",
     "unit": "1",
     "description": null
    },
    {
     "name": "homo_x",
     "unit": "1",
     "description": null
    },
    {
     "name": "lumo_x",
     "unit": "1",
     "description": null
    },
    {
     "name": "homo_lumo_gap_beta",
     "unit": "1",
     "description": "x_HOMO - x_LUMO, in units of |beta|; 0 for an open shell (the SOMO is both)"
    },
    {
     "name": "unpaired_electrons",
     "unit": "1",
     "description": null
    },
    {
     "name": "densities",
     "unit": "1",
     "description": null
    },
    {
     "name": "charges",
     "unit": "1",
     "description": "pi charge per atom in elementary charges: electrons given minus pi density"
    },
    {
     "name": "largest_charge",
     "unit": "1",
     "description": null
    },
    {
     "name": "bond_orders",
     "unit": "1",
     "description": "Coulson pi bond orders, in the order of the bond list"
    },
    {
     "name": "max_bond_order",
     "unit": "1",
     "description": null
    },
    {
     "name": "min_bond_order",
     "unit": "1",
     "description": null
    },
    {
     "name": "free_valences",
     "unit": "1",
     "description": null
    },
    {
     "name": "fragments",
     "unit": "1",
     "description": null
    },
    {
     "name": "beta_eV",
     "unit": null,
     "description": "the resonance integral as given, in eV (eV is not in the kernel unit table, so no unit is declared)"
    },
    {
     "name": "delocalisation_energy_eV",
     "unit": null,
     "description": "delocalisation energy in eV (stabilisation, positive) (eV is not in the kernel unit table, so no unit is declared)"
    },
    {
     "name": "pi_energy_beta_part_eV",
     "unit": null,
     "description": "the beta part of the pi energy in eV (eV is not in the kernel unit table, so no unit is declared)"
    },
    {
     "name": "homo_lumo_gap_eV",
     "unit": null,
     "description": "HOMO-LUMO gap in eV (eV is not in the kernel unit table, so no unit is declared)"
    },
    {
     "name": "gap_wavelength_nm",
     "unit": "nm",
     "description": "h c / (gap in eV), from the exact SI values of h, c and e"
    },
    {
     "name": "orbitals",
     "unit": null,
     "description": null
    },
    {
     "name": "atom_table",
     "unit": null,
     "description": null
    },
    {
     "name": "bond_table",
     "unit": null,
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "ethylene: exact 2x2 roots x = +-1, E = 2 alpha + 2 beta, bond order 1, gap 2|beta|; with beta = -2.7 eV the gap wavelength is hc/(5.4 eV) = 229.600367 nm from exact SI h, c, e (closed form, rel 1e-6)",
     "checks": [
      "bond_orders.0",
      "delocalisation_energy_beta",
      "gap_wavelength_nm",
      "homo_lumo_gap_beta",
      "orbital_x.0",
      "orbital_x.1",
      "pi_energy_beta"
     ]
    },
    {
     "name": "butadiene (Coulson, linear chain x = 2cos(k pi/5)): x = +-1.618034, +-0.618034; E = 4 alpha + 2 sqrt5 beta = 4.472136; delocalisation 2 sqrt5 - 4; bond orders 2/sqrt5 and 1/sqrt5; gap sqrt5 - 1 (closed form, rel 1e-6)",
     "checks": [
      "bond_orders.0",
      "bond_orders.1",
      "delocalisation_energy_beta",
      "homo_lumo_gap_beta",
      "orbital_x.0",
      "orbital_x.1",
      "orbital_x.2",
      "orbital_x.3",
      "pi_energy_beta"
     ]
    },
    {
     "name": "benzene (ring x = 2cos(2 pi k/6)): x = 2, 1, 1, -1, -1, -2; E = 6 alpha + 8 beta; delocalisation 2 beta; every bond order 2/3; no pi charge (closed form, rel 1e-6)",
     "checks": [
      "bond_orders.0",
      "bond_orders.2",
      "bond_orders.5",
      "closed_shell",
      "delocalisation_energy_beta",
      "homo_lumo_gap_beta",
      "largest_charge",
      "orbital_x.0",
      "orbital_x.1",
      "orbital_x.2",
      "orbital_x.3",
      "orbital_x.5",
      "pi_energy_beta"
     ]
    },
    {
     "name": "allyl radical (chain x = 2cos(k pi/4)): x = sqrt2, 0, -sqrt2; E = 3 alpha + 2 sqrt2 beta; delocalisation 2 sqrt2 - 2; one unpaired electron; no pi charge (Coulson-Rushbrooke, alternant) (closed form, rel 1e-6)",
     "checks": [
      "bond_orders.0",
      "delocalisation_energy_beta",
      "largest_charge",
      "orbital_x.0",
      "orbital_x.1",
      "orbital_x.2",
      "pi_energy_beta",
      "unpaired_electrons"
     ]
    },
    {
     "name": "allyl cation (charge +1): two electrons in the sqrt2 orbital (1/2, 1/sqrt2, 1/2) give +1/2 on each end, 0 in the middle, bond order 1/sqrt2, gap sqrt2 (closed form, rel 1e-6)",
     "checks": [
      "bond_orders.0",
      "charges.0",
      "charges.1",
      "charges.2",
      "closed_shell",
      "homo_lumo_gap_beta"
     ]
    },
    {
     "name": "cyclobutadiene (ring x = 2cos(2 pi k/4)): x = 2, 0, 0, -2, a degenerate non-bonding pair holding two electrons (two unpaired, Hund), E = 4 alpha + 4 beta, delocalisation 0, every bond order 1/2 (closed form, rel 1e-6)",
     "checks": [
      "bond_orders.0",
      "bond_orders.1",
      "degenerate_frontier",
      "delocalisation_energy_beta",
      "orbital_x.0",
      "orbital_x.1",
      "orbital_x.2",
      "orbital_x.3",
      "pi_energy_beta",
      "unpaired_electrons"
     ]
    },
    {
     "name": "two-centre C=X heteroatom bond, h = 1, k = 1 (secular equation x^2 - x - 1 = 0): x = (1 +- sqrt5)/2; pi charge -1/sqrt5 on X and +1/sqrt5 on C; bond order 2/sqrt5; delocalisation 0 against its own double bond (closed form, rel 1e-6)",
     "checks": [
      "bond_orders.0",
      "charges.0",
      "charges.1",
      "delocalisation_energy_beta",
      "orbital_x.0",
      "orbital_x.1"
     ]
    }
   ],
   "title": "Hueckel pi orbitals",
   "needs_build": true,
   "category": "Chemistry",
   "known_answers": 59
  },
  {
   "name": "hypothesis_test",
   "version": "0.1.0",
   "summary": "Classical tests on small data sets: one-sample, paired and two-sample t (Student and Welch), one-way ANOVA, chi-square goodness of fit and independence, or a plain p-value from a t, z, chi-square or F statistic. Gives the statistic, degrees of freedom, exact p-value (own incomplete beta and gamma functions), critical value, effect size and confidence interval.",
   "runtime": "native",
   "timeout_s": 30,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "test",
     "type": "string",
     "unit": null,
     "default": "welch_t",
     "enum": [
      "one_sample_t",
      "paired_t",
      "two_sample_t",
      "welch_t",
      "anova",
      "chi2_gof",
      "chi2_independence",
      "p_value"
     ],
     "description": "Which test to run."
    },
    {
     "name": "x",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "First sample (t tests). Any one unit; the estimate and interval come back in it."
    },
    {
     "name": "y",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Second sample (paired, two-sample and Welch t), same unit as x."
    },
    {
     "name": "mu0",
     "type": "number",
     "unit": null,
     "default": 0.0,
     "enum": null,
     "description": "Null value of the mean (one-sample) or of the mean difference (paired, two-sample), in the unit of x."
    },
    {
     "name": "groups",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "ANOVA: one list of values per group."
    },
    {
     "name": "observed",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Goodness of fit: observed counts per category."
    },
    {
     "name": "expected",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Goodness of fit: expected counts or proportions per category (rescaled to the observed total). Left out: equal shares."
    },
    {
     "name": "ddof",
     "type": "number",
     "unit": "1",
     "default": 0,
     "enum": null,
     "description": "Goodness of fit: parameters estimated from the data, taken off the degrees of freedom."
    },
    {
     "name": "table",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Independence: contingency table of counts, rows by columns."
    },
    {
     "name": "yates",
     "type": "boolean",
     "unit": null,
     "default": false,
     "enum": null,
     "description": "Independence: Yates' continuity correction (2 x 2 tables only)."
    },
    {
     "name": "statistic",
     "type": "number",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "p_value: the statistic to convert."
    },
    {
     "name": "distribution",
     "type": "string",
     "unit": null,
     "default": "t",
     "enum": [
      "t",
      "z",
      "chi2",
      "F"
     ],
     "description": "p_value: the null distribution."
    },
    {
     "name": "df",
     "type": "number",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "p_value: degrees of freedom (numerator for F). At most 1e6: above that the p-value loses digits and the run is refused."
    },
    {
     "name": "df2",
     "type": "number",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "p_value: denominator degrees of freedom for F. At most 1e6: above that the p-value loses digits and the run is refused."
    },
    {
     "name": "alternative",
     "type": "string",
     "unit": null,
     "default": "two_sided",
     "enum": [
      "two_sided",
      "less",
      "greater"
     ],
     "description": "Alternative hypothesis for t and z. Chi-square and F are always upper-tailed."
    },
    {
     "name": "alpha",
     "type": "number",
     "unit": "1",
     "default": 0.05,
     "enum": null,
     "description": "Significance level."
    },
    {
     "name": "confidence",
     "type": "number",
     "unit": "1",
     "default": 0.95,
     "enum": null,
     "description": "Confidence level of the intervals."
    }
   ],
   "outputs": [
    {
     "name": "statistic",
     "unit": "1",
     "description": null
    },
    {
     "name": "df",
     "unit": "1",
     "description": null
    },
    {
     "name": "df2",
     "unit": "1",
     "description": null
    },
    {
     "name": "p_value",
     "unit": "1",
     "description": null
    },
    {
     "name": "p_two_sided",
     "unit": "1",
     "description": null
    },
    {
     "name": "p_upper",
     "unit": "1",
     "description": null
    },
    {
     "name": "p_lower",
     "unit": "1",
     "description": null
    },
    {
     "name": "critical_value",
     "unit": "1",
     "description": null
    },
    {
     "name": "alpha",
     "unit": "1",
     "description": null
    },
    {
     "name": "confidence",
     "unit": "1",
     "description": null
    },
    {
     "name": "cohen_d",
     "unit": "1",
     "description": null
    },
    {
     "name": "hedges_g",
     "unit": "1",
     "description": null
    },
    {
     "name": "eta_squared",
     "unit": "1",
     "description": null
    },
    {
     "name": "omega_squared",
     "unit": "1",
     "description": null
    },
    {
     "name": "cohens_w",
     "unit": "1",
     "description": null
    },
    {
     "name": "cramers_v",
     "unit": "1",
     "description": null
    },
    {
     "name": "phi",
     "unit": "1",
     "description": null
    },
    {
     "name": "effect_size",
     "unit": "1",
     "description": null
    },
    {
     "name": "n_total",
     "unit": "1",
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "Cauchy closed form: t with 1 df, two-sided p(t = 1) = 1 - (2/pi) atan(1) = 0.5, tails 1/4 and 3/4",
     "checks": [
      "p_lower",
      "p_upper",
      "p_value"
     ]
    },
    {
     "name": "Cauchy closed form: t with 1 df, upper tail of t = sqrt(3) is 1/2 - atan(sqrt 3)/pi = 1/6",
     "checks": [
      "p_value"
     ]
    },
    {
     "name": "t with 2 df closed form p = 1 - t/sqrt(t^2+2): p(4.302652729749464) = 0.05, and the 5 % critical value is sqrt(2*0.9025/0.0975) (textbook 4.3027)",
     "checks": [
      "critical_value",
      "p_value"
     ]
    },
    {
     "name": "chi-square with 2 df closed form p = exp(-x/2): p(-2 ln 0.05 = 5.9915) = 0.05, critical value 5.991464547107982",
     "checks": [
      "critical_value",
      "p_value"
     ]
    },
    {
     "name": "chi-square with 2 df closed form p = exp(-x/2) deep in the tail: p(40) = exp(-20)",
     "checks": [
      "p_value"
     ]
    },
    {
     "name": "F(1, 2) = t(2)^2: F = 18.51282051282051 (= 4.3027^2) gives p = 0.05 and is its own 5 % critical value",
     "checks": [
      "critical_value",
      "p_value"
     ]
    },
    {
     "name": "normal: two-sided p(z = 1.96) = erfc(1.96/sqrt 2) = 0.04999579029644086; 5 % critical value is the textbook 1.959963984540054",
     "checks": [
      "critical_value",
      "p_value"
     ]
    },
    {
     "name": "large df limit: t with 1e6 df, p(1.96) tends to the normal 0.0499958; tolerance 1e-6 absolute because the t-to-normal gap is of order 1/df (about 3e-7 here)",
     "checks": [
      "p_value"
     ]
    },
    {
     "name": "Student pooled t by hand, [1,2,3] vs [4,5,6]: t = -3/sqrt(2/3), df 4, p from the 4-df closed form 1 - x(1 + (1-x^2)/2) with x = t/sqrt(t^2+4), d = -3, Hedges g = -3 sqrt(2/pi)",
     "checks": [
      "cohen_d",
      "df",
      "estimate",
      "hedges_g",
      "p_value",
      "pooled_sd",
      "reject_null",
      "statistic"
     ]
    },
    {
     "name": "identical group means: Welch t on [1,2,3] vs [3,2,1] gives t = 0, p = 1, df 4 (equal variances and sizes)",
     "checks": [
      "df",
      "p_value",
      "reject_null",
      "statistic"
     ]
    },
    {
     "name": "one-sample t by hand, [5,7,9] against mu0 = 5: t = sqrt 3, df 2, p = 1 - sqrt(3/5), 95 % interval 7 +- 4.3027*2/sqrt 3, d = 1",
     "checks": [
      "ci_high",
      "ci_low",
      "cohen_d",
      "df",
      "p_value",
      "se",
      "statistic"
     ]
    },
    {
     "name": "Welch t by hand, [0,2] vs [3,5]: t = -3/sqrt 2, Welch-Satterthwaite df = 2, p = 1 - |t|/sqrt(t^2+2)",
     "checks": [
      "df",
      "p_value",
      "statistic"
     ]
    },
    {
     "name": "Welch-Satterthwaite by hand, [1,2,3,4,5] vs [2,4,6]: t = -1/sqrt(11/6), df = 484/137",
     "checks": [
      "df",
      "se",
      "statistic"
     ]
    },
    {
     "name": "paired t by hand, [10,12,14] vs [5,5,5]: differences 5,7,9, t = 7 sqrt(3)/2, df 2, p = 1 - t/sqrt(t^2+2)",
     "checks": [
      "df",
      "estimate",
      "p_value",
      "statistic"
     ]
    },
    {
     "name": "one-way ANOVA of two groups equals t^2: [[1,2,3],[4,5,6]] gives F = 13.5 on (1, 4) df, the same p as the pooled t (0.0213116...), eta squared = 13.5/17.5",
     "checks": [
      "df",
      "df2",
      "eta_squared",
      "p_value",
      "ss_between",
      "ss_within",
      "statistic"
     ]
    },
    {
     "name": "goodness of fit by hand, [30,10,20] against equal shares: chi2 = 10, df 2, p = exp(-5), Cohen w = sqrt(1/6)",
     "checks": [
      "cohens_w",
      "df",
      "p_value",
      "statistic"
     ]
    },
    {
     "name": "independence by hand, [[20,10,30],[10,20,30]]: chi2 = 20/3, df 2, p = exp(-10/3), Cramer V = sqrt(1/18)",
     "checks": [
      "cramers_v",
      "df",
      "p_value",
      "statistic"
     ]
    },
    {
     "name": "2 x 2 with Yates by hand, [[10,20],[20,10]]: chi2 = 4*(4.5^2)/15 = 5.4, df 1, p = erfc(sqrt 2.7)",
     "checks": [
      "df",
      "p_value",
      "phi",
      "statistic"
     ]
    },
    {
     "name": "chi-square with 4 df closed form p = exp(-x/2)(1 + x/2): p(6) = 4 exp(-3)",
     "checks": [
      "p_value"
     ]
    },
    {
     "name": "F(2, 4) closed form p = (1 + f/2)^-2: p(3) = 0.16, 5 % critical value 2(sqrt 20 - 1)",
     "checks": [
      "critical_value",
      "p_value"
     ]
    },
    {
     "name": "Cauchy closed form, one-sided critical values past the median: t with 1 df, alternative greater, alpha = 0.75 has critical value tan(pi(1/2 - 3/4)) = -1; p(t = 1) = 1/4",
     "checks": [
      "critical_value",
      "p_value",
      "reject_null"
     ]
    },
    {
     "name": "Cauchy closed form: t with 1 df, alternative less, alpha = 0.75 has critical value +1; p(t = 1) = 3/4",
     "checks": [
      "critical_value",
      "p_value"
     ]
    },
    {
     "name": "non-integer df, F(2, n) closed form p = (1 + 2f/n)^(-n/2) for any n: F(2, 484/137) at f = 1.7",
     "checks": [
      "p_value"
     ]
    },
    {
     "name": "non-integer df, F(m, 2) closed form p = 1 - (m f/(2 + m f))^(m/2) for any m: F(2.7, 2) at f = 3.3",
     "checks": [
      "p_value"
     ]
    },
    {
     "name": "three-group ANOVA by hand, [[1,2,3],[2,3,4],[5,6,7]]: SSB = 26, SSW = 6, F = 13 on (2, 6) df, p = (1 + 2*13/6)^-3 = 27/4096 exactly",
     "checks": [
      "df",
      "df2",
      "eta_squared",
      "p_value",
      "ss_between",
      "ss_within",
      "statistic"
     ]
    },
    {
     "name": "Welch p at non-integer df 484/137, [1,2,3,4,5] vs [2,4,6]: NOT a closed form; p = 0.50621417165285 from Simpson integration of the t density (python math, 200000 panels, two routes agreeing to 1.4e-14), independent of this program",
     "checks": [
      "p_value"
     ]
    }
   ],
   "title": "Hypothesis test",
   "needs_build": true,
   "category": "Measurement and data",
   "known_answers": 80
  },
  {
   "name": "isotope_pattern",
   "version": "0.1.0",
   "summary": "Computes exact monoisotopic mass, average mass, RDBE, nitrogen rule, and theoretical isotopic envelope (M, M+1, M+2...) from a molecular formula, or enumerates CHNO candidate formulas for a target exact mass.",
   "runtime": "native",
   "timeout_s": 30,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "formula",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Molecular formula, e.g. C9H8O4 or C6H5Cl."
    },
    {
     "name": "target_mass",
     "type": "number",
     "unit": "Da",
     "default": null,
     "enum": null,
     "description": "Optional neutral monoisotopic mass to enumerate CHNO formulas."
    },
    {
     "name": "tol_ppm",
     "type": "number",
     "unit": "1",
     "default": 10.0,
     "enum": null,
     "description": null
    },
    {
     "name": "max_isotopes",
     "type": "integer",
     "unit": null,
     "default": 5,
     "enum": null,
     "description": null
    }
   ],
   "outputs": [
    {
     "name": "exact_mass_Da",
     "unit": "Da",
     "description": null
    },
    {
     "name": "avg_mass_Da",
     "unit": "Da",
     "description": null
    },
    {
     "name": "rdbe",
     "unit": "1",
     "description": null
    },
    {
     "name": "m0_rel_pct",
     "unit": "%",
     "description": null
    },
    {
     "name": "m1_rel_pct",
     "unit": "%",
     "description": null
    },
    {
     "name": "m2_rel_pct",
     "unit": "%",
     "description": null
    },
    {
     "name": "isotopes",
     "unit": null,
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "aspirin C9H8O4: 180.042259 Da, RDBE 6, M+1 ~9.88%",
     "checks": [
      "exact_mass_Da",
      "m1_rel_pct",
      "rdbe"
     ]
    },
    {
     "name": "chlorobenzene C6H5Cl: 37Cl M+2 peak ~32.2%",
     "checks": [
      "exact_mass_Da",
      "m2_rel_pct"
     ]
    }
   ],
   "title": "Isotope pattern & formula analysis",
   "needs_build": true,
   "category": "Mass spectrometry",
   "known_answers": 5
  },
  {
   "name": "kabsch_align",
   "version": "0.1.0",
   "summary": "Exact Horn quaternion Kabsch 3D superposition of two protein structures (CA atoms): RMSD (\u00c5), TM-score, GDT-TS, rotation matrix, translation vector, and superposed 3D scene.glb.",
   "runtime": "native",
   "timeout_s": 60,
   "estimate_s": 0.1,
   "inputs": [
    {
     "name": "mobile_text",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "mobile_file",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "reference_text",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "reference_file",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "chain",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": null
    }
   ],
   "outputs": [
    {
     "name": "aligned_residues",
     "unit": "1",
     "description": null
    },
    {
     "name": "rmsd_A",
     "unit": "\u00c5",
     "description": null
    },
    {
     "name": "tm_score",
     "unit": "1",
     "description": null
    },
    {
     "name": "gdt_ts",
     "unit": "1",
     "description": null
    },
    {
     "name": "max_deviation_A",
     "unit": "\u00c5",
     "description": null
    },
    {
     "name": "scene.glb",
     "unit": null,
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "rigid 90-deg rotation + translation recovers RMSD = 0.0 \u00c5 and TM-score = 1.0",
     "checks": [
      "gdt_ts",
      "rmsd_A",
      "tm_score"
     ]
    }
   ],
   "title": "Kabsch 3D structural alignment",
   "needs_build": true,
   "category": "Structural biology",
   "known_answers": 3
  },
  {
   "name": "kalman_filter",
   "version": "0.1.0",
   "summary": "Linear Kalman filter for a small state-space model x[k] = F x[k-1] + w (cov Q), z[k] = H x[k] + v (cov R): filtered states and covariance (Joseph form), innovation statistics with the NIS chi-square consistency band, log-likelihood, the steady-state gain and covariance (Riccati recursion to its fixed point), and the RMS error against a truth track when given. Measurements inline (z) or from a csv; a null step is predicted, not updated. States carry the model's own units (declared 1).",
   "runtime": "native",
   "timeout_s": 60,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "F",
     "type": "array",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "State transition matrix, n x n (1 to 12 states), as a list of rows, e.g. [[1, 1], [0, 1]] for constant velocity with a step of 1. Model units."
    },
    {
     "name": "H",
     "type": "array",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "Measurement matrix, m x n (1 to 12 measurements), e.g. [[1, 0]] to measure position only."
    },
    {
     "name": "Q",
     "type": "array",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "Process noise covariance, n x n, symmetric, variances >= 0. Left out: zero (a deterministic state)."
    },
    {
     "name": "R",
     "type": "array",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "Measurement noise covariance, m x m, symmetric; positive variances keep the gain defined."
    },
    {
     "name": "P0",
     "type": "array",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "Prior covariance of x0, n x n. Left out: a diffuse prior, diffuse_variance on every state."
    },
    {
     "name": "x0",
     "type": "array",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "Prior state, n numbers. Left out: zeros (harmless with the diffuse prior)."
    },
    {
     "name": "z",
     "type": "array",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "Measurements, one entry per step: a list of m numbers (a bare number when m = 1), or null for a step without a measurement. Leave out z and csv to get the steady state only."
    },
    {
     "name": "csv",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Measurements from a csv with a header row instead of z: columns z (m = 1) or z1..zm, optional truth columns x1_true..xn_true. Empty cell = no measurement."
    },
    {
     "name": "z_columns",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "csv column names holding the m measurements, in the order of the rows of H."
    },
    {
     "name": "truth_columns",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "csv column names holding the true states, in state order (\"\" for a state without truth)."
    },
    {
     "name": "truth",
     "type": "array",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "True states inline, one list of n numbers per step (null where unknown); gives the RMS error of the estimates."
    },
    {
     "name": "diffuse_variance",
     "type": "number",
     "unit": "1",
     "default": 1000000000.0,
     "enum": null,
     "description": "Prior variance on every state when P0 is left out; far above anything the states can take."
    },
    {
     "name": "predict_first",
     "type": "boolean",
     "unit": null,
     "default": true,
     "enum": null,
     "description": "true: x0, P0 are at step 0 and the first measurement is at step 1 (predict, then update); false: x0, P0 are at the first measurement."
    },
    {
     "name": "confidence",
     "type": "number",
     "unit": "1",
     "default": 0.95,
     "enum": null,
     "description": "Two-sided probability of the NIS chi-square consistency band."
    }
   ],
   "outputs": [
    {
     "name": "n_states",
     "unit": "1",
     "description": null
    },
    {
     "name": "n_measurements",
     "unit": "1",
     "description": null
    },
    {
     "name": "n_steps",
     "unit": "1",
     "description": null
    },
    {
     "name": "n_updates",
     "unit": "1",
     "description": null
    },
    {
     "name": "prior",
     "unit": null,
     "description": "\"given\" or \"diffuse\""
    },
    {
     "name": "x_final",
     "unit": "1",
     "description": "Filtered state after the last step (model units)."
    },
    {
     "name": "P_final",
     "unit": "1",
     "description": "Its covariance."
    },
    {
     "name": "sigma_final",
     "unit": "1",
     "description": "Square roots of the diagonal of P_final."
    },
    {
     "name": "gain_final",
     "unit": "1",
     "description": "Kalman gain of the last update, n x m."
    },
    {
     "name": "innovation_mean",
     "unit": "1",
     "description": null
    },
    {
     "name": "innovation_rms",
     "unit": "1",
     "description": null
    },
    {
     "name": "innovation_lag1_autocorrelation",
     "unit": "1",
     "description": "Near 0 for a well-tuned filter (white innovations)."
    },
    {
     "name": "nis_mean",
     "unit": "1",
     "description": "Mean normalised innovation squared v' S^-1 v; expected value m."
    },
    {
     "name": "nis_expected",
     "unit": "1",
     "description": null
    },
    {
     "name": "nis_band_lo",
     "unit": "1",
     "description": "Lower edge of the chi-square band for the mean NIS (dof = updates x m), divided by the number of updates."
    },
    {
     "name": "nis_band_hi",
     "unit": "1",
     "description": null
    },
    {
     "name": "consistent",
     "unit": null,
     "description": "true when the mean NIS lies inside its band."
    },
    {
     "name": "log_likelihood",
     "unit": "1",
     "description": "Gaussian log-likelihood of the innovations (nats)."
    },
    {
     "name": "steady_converged",
     "unit": null,
     "description": "Whether the Riccati recursion reached a fixed point (relative change <= 1e-13)."
    },
    {
     "name": "steady_iterations",
     "unit": "1",
     "description": null
    },
    {
     "name": "steady_gain",
     "unit": "1",
     "description": "Steady-state Kalman gain, n x m."
    },
    {
     "name": "steady_prior_cov",
     "unit": "1",
     "description": "Steady-state predicted covariance (Riccati fixed point)."
    },
    {
     "name": "steady_post_cov",
     "unit": "1",
     "description": "Steady-state updated covariance."
    },
    {
     "name": "steady_post_sigma",
     "unit": "1",
     "description": null
    },
    {
     "name": "rms_error",
     "unit": "1",
     "description": "RMS of estimate - truth per state, over the steps with truth."
    },
    {
     "name": "rms_measurement_error",
     "unit": "1",
     "description": "RMS of z - H truth per measurement (the raw sensor error), for comparison."
    },
    {
     "name": "states",
     "unit": null,
     "description": null
    },
    {
     "name": "warnings",
     "unit": null,
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "scalar random walk q=1, r=2: steady prior P = (q + sqrt(q^2 + 4qr))/2 = 2, gain P/(P+r) = 0.5, posterior P r/(P+r) = 1 (closed-form Riccati fixed point, rel 1e-6)",
     "checks": [
      "steady_converged",
      "steady_gain.0.0",
      "steady_post_cov.0.0",
      "steady_prior_cov.0.0"
     ]
    },
    {
     "name": "scalar random walk q=r=1: steady prior P = (1 + sqrt 5)/2 = golden ratio 1.6180339887, gain = 1/phi = 0.6180339887 (closed-form Riccati fixed point, rel 1e-6)",
     "checks": [
      "steady_gain.0.0",
      "steady_prior_cov.0.0"
     ]
    },
    {
     "name": "constant state, q=0, diffuse prior, r=4, z=[1,2,3,4,10]: estimate = running mean 4, P_n = r/n = 0.8; truth 4 gives RMS of running means (-3,-2.5,-2,-1.5,0) = sqrt(4.3) (exact; rel 1e-6 covers the 1e9 prior's ~1e-9 bias)",
     "checks": [
      "P_final.0.0",
      "rms_error.0",
      "steady_converged",
      "x_final.0"
     ]
    },
    {
     "name": "noise-free constant-velocity target z = 3 + 2k (k=1..10), F=[[1,1],[0,1]], q=0, r=1, diffuse prior: velocity 2 and position 23 exactly; covariance = least-squares line fit: var v = r/Sxx = 1/82.5, var x10 = r(1/N + (N-tbar)^2/Sxx) = 0.345454, cov = 4.5/82.5 (exact; rel 1e-6)",
     "checks": [
      "P_final.0.0",
      "P_final.0.1",
      "P_final.1.1",
      "x_final.0",
      "x_final.1"
     ]
    },
    {
     "name": "alpha-beta steady state (Kalata 1984; Bar-Shalom, Li, Kirubarajan 2001, sec. 6.5): white-acceleration CV model, T=1, tracking index lambda = sigma_a T^2/sigma_z = 1 -> alpha = 0.75, beta = 0.5, gain [alpha, beta/T], prior var x = alpha r/(1-alpha) = 3 (closed form; rel 1e-6)",
     "checks": [
      "steady_converged",
      "steady_gain.0.0",
      "steady_gain.1.0",
      "steady_prior_cov.0.0"
     ]
    },
    {
     "name": "two hand-worked scalar steps (F=H=Q=R=P0=1, x0=0, z=[3,6]): S=3, v=3, NIS 3; S=8/3, v=4, NIS 6 -> x=4.5, P=5/8, mean NIS 4.5, log-lik -(2 ln 2pi + ln 3 + ln 8/3 + 9)/2; 2-dof chi-square band from the closed form F^-1(p) = -2 ln(1-p): [-ln 0.975, -ln 0.025] (exact; rel 1e-6)",
     "checks": [
      "P_final.0.0",
      "consistent",
      "innovation_mean.0",
      "log_likelihood",
      "nis_band_hi",
      "nis_band_lo",
      "nis_mean",
      "x_final.0"
     ]
    }
   ],
   "title": "Kalman filter",
   "needs_build": true,
   "category": "Dynamics and control",
   "known_answers": 27
  },
  {
   "name": "kendrick_defect",
   "version": "0.1.0",
   "summary": "Kendrick mass analysis of a peak list: rescales masses so a chosen repeat unit (CH2, C2H4O, CF2, any formula or mass) weighs a whole number, gives each peak its Kendrick mass and mass defect, groups peaks into homologous series, and reports series length, gaps, repeat counts, end-group residual and Mn/Mw.",
   "runtime": "native",
   "timeout_s": 30,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "masses",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Peak masses in Da: neutral monoisotopic masses, or m/z of singly charged ions. At most 20000 peaks, each above zero and at most 1e7 Da."
    },
    {
     "name": "formulas",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Molecular formulas (C10H22, C12H26O7); their monoisotopic masses are built from element masses and added to the peak list after 'masses'."
    },
    {
     "name": "intensities",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "One intensity per peak (masses first, then formulas), zero or above. Needed only for Mn, Mw and dispersity."
    },
    {
     "name": "repeat_unit",
     "type": "string",
     "unit": null,
     "default": "CH2",
     "enum": null,
     "description": "Formula of the repeat unit: CH2, C2H4O, C3H6O, CF2, C2H6OSi..."
    },
    {
     "name": "repeat_mass_Da",
     "type": "number",
     "unit": "Da",
     "default": null,
     "enum": null,
     "description": "Exact mass of the repeat unit; replaces repeat_unit when given."
    },
    {
     "name": "divisor",
     "type": "integer",
     "unit": "1",
     "default": 1,
     "enum": null,
     "description": "Fractional base unit X: scale = round(R/X)/(R/X). 1 is the classical Kendrick scale."
    },
    {
     "name": "convention",
     "type": "string",
     "unit": null,
     "default": "nominal_minus_kendrick",
     "enum": [
      "nominal_minus_kendrick",
      "kendrick_minus_nominal"
     ],
     "description": "Sign of the mass defect. Nominal Kendrick mass is the Kendrick mass rounded to the nearest whole number."
    },
    {
     "name": "tolerance_mDa",
     "type": "number",
     "unit": "mDa",
     "default": 2.0,
     "enum": null,
     "description": "Two peaks join one series when their Kendrick remainders are this close (single linkage). Use the mass accuracy of the spectrum."
    },
    {
     "name": "min_series_length",
     "type": "integer",
     "unit": "1",
     "default": 3,
     "enum": null,
     "description": "Fewest members (distinct repeat counts) that make a series."
    },
    {
     "name": "end_group",
     "type": "string",
     "unit": null,
     "default": "",
     "enum": null,
     "description": "Formula of both end groups together (H2O for HO-PEG-H, H2 for alkanes). When given, absolute repeat counts are reported."
    },
    {
     "name": "adduct_mass_Da",
     "type": "number",
     "unit": "Da",
     "default": 0.0,
     "enum": null,
     "description": "Mass the ion carries beyond the neutral molecule: 0 for neutral masses, 22.98922 for [M+Na]+, 1.00728 for [M+H]+."
    }
   ],
   "outputs": [
    {
     "name": "repeat_exact_mass_Da",
     "unit": "Da",
     "description": null
    },
    {
     "name": "repeat_nominal_mass",
     "unit": "1",
     "description": null
    },
    {
     "name": "repeat_kendrick_mass",
     "unit": "1",
     "description": null
    },
    {
     "name": "divisor",
     "unit": "1",
     "description": null
    },
    {
     "name": "scale_factor",
     "unit": "1",
     "description": null
    },
    {
     "name": "tolerance_mDa",
     "unit": "mDa",
     "description": null
    },
    {
     "name": "end_group_mass_Da",
     "unit": "Da",
     "description": null
    },
    {
     "name": "peak_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "series_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "assigned_peak_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "unassigned_peak_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "longest_series_length",
     "unit": "1",
     "description": null
    },
    {
     "name": "min_kmd_separation",
     "unit": "1",
     "description": "Smallest difference in mass defect between two series (Kendrick mass units)."
    },
    {
     "name": "kmd_min",
     "unit": "1",
     "description": null
    },
    {
     "name": "kmd_max",
     "unit": "1",
     "description": null
    },
    {
     "name": "top_series_kmd",
     "unit": "1",
     "description": null
    },
    {
     "name": "top_series_residual_mass_Da",
     "unit": "Da",
     "description": "What is left of the longest series' lightest member after the adduct and whole repeat units are taken out: the end groups, up to whole repeat units."
    },
    {
     "name": "top_series_repeat_count_min",
     "unit": "1",
     "description": null
    },
    {
     "name": "top_series_repeat_count_max",
     "unit": "1",
     "description": null
    },
    {
     "name": "top_series_mn_Da",
     "unit": "Da",
     "description": null
    },
    {
     "name": "top_series_mw_Da",
     "unit": "Da",
     "description": null
    },
    {
     "name": "top_series_dispersity",
     "unit": "1",
     "description": null
    },
    {
     "name": "peaks_listed",
     "unit": "1",
     "description": null
    },
    {
     "name": "series",
     "unit": null,
     "description": "One row per series, longest first."
    },
    {
     "name": "peaks",
     "unit": null,
     "description": "The first 500 peaks; out/peaks.csv holds all."
    }
   ],
   "selftests": [
    {
     "name": "Kendrick 1963 scale: CH2 factor = 14/(12 + 2*1.00782503223) = 0.99888338647; olefins CnH2n land on whole Kendrick masses, defect 0 (closed form, 1e-9)",
     "checks": [
      "peaks.0.kendrick_mass",
      "peaks.3.kendrick_mass",
      "repeat_exact_mass_Da",
      "repeat_kendrick_mass",
      "scale_factor",
      "series.0.kmd",
      "series.0.nominal_class",
      "series_count"
     ]
    },
    {
     "name": "alkanes CnH(2n+2), n = 1..20, from element masses: one series, defect = 2 - 14*m(H2)/m(CH2) = -0.013399362 for every member (closed form; spread below 1e-9, well inside the 1e-6 asked)",
     "checks": [
      "kmd_max",
      "kmd_min",
      "longest_series_length",
      "series.0.kmd",
      "series.0.kmd_spread",
      "series.0.missing",
      "series.0.nominal_class",
      "series_count",
      "top_series_repeat_count_max",
      "top_series_repeat_count_min",
      "top_series_residual_mass_Da",
      "unassigned_peak_count"
     ]
    },
    {
     "name": "PEG HO-(C2H4O)n-H, n = 5..12, unit C2H4O = 44.02621475 Da: oligomers line up on one defect 18 - 44*m(H2O)/m(C2H4O) = +0.000159436; end group H2O gives n = 5..12; equal intensities give Mn = 8.5*m(C2H4O) + m(H2O), Mw = sum m^2 / sum m (closed forms, 1e-9)",
     "checks": [
      "longest_series_length",
      "repeat_exact_mass_Da",
      "scale_factor",
      "series.0.kmd",
      "series.0.kmd_spread",
      "series.0.nominal_class",
      "series_count",
      "top_series_dispersity",
      "top_series_mn_Da",
      "top_series_mw_Da",
      "top_series_repeat_count_max",
      "top_series_repeat_count_min",
      "top_series_residual_mass_Da"
     ]
    },
    {
     "name": "two series on the same nominal masses 128..198 are separated: alkanes C9..C14 (defect -0.013399362) and alkylnaphthalenes C10H8..C15H18 (defect +0.080396174), 93.796 mDa apart = 7*(14*m(H2)/m(CH2) - 2) (closed form, 1e-9)",
     "checks": [
      "min_kmd_separation",
      "peaks.0.series",
      "peaks.1.series",
      "series.0.kmd",
      "series.0.length",
      "series.0.nominal_class",
      "series.1.kmd",
      "series.1.length",
      "series.1.nominal_class",
      "series_count",
      "unassigned_peak_count"
     ]
    },
    {
     "name": "wrong repeat unit, known negative: the PEG oligomers on the CH2 scale step 43.977 Kendrick units, so the remainder mod 14 moves 1.977 per member and no series forms (closed form: 44.02621475*14/14.01565006 = 43.97705)",
     "checks": [
      "has_series",
      "peaks.0.kendrick_mass",
      "series_count",
      "unassigned_peak_count"
     ]
    },
    {
     "name": "fractional base unit (Fouquet and Sato 2017), C2H4O with divisor 3: factor = 15/(44.02621475/3) = 1.022118305, the repeat unit weighs 45; flipped sign convention gives defect = frac part of 45*m(H2O)/m(C2H4O) = +0.408928 (closed form, 1e-9)",
     "checks": [
      "repeat_kendrick_mass",
      "scale_factor",
      "series.0.kmd",
      "series.0.kmd_spread",
      "series_count"
     ]
    },
    {
     "name": "series on the rounding edge: masses built as (140.0005, 153.9995, 168.0004, 181.9996)/scale differ by whole CH2 within 1 mDa; they must stay one series of 4 with spread exactly 1.0 mDa and mean defect 0 (by construction; 1e-9)",
     "checks": [
      "longest_series_length",
      "series.0.kmd",
      "series.0.kmd_spread",
      "series.0.span",
      "series_count"
     ]
    }
   ],
   "title": "Kendrick mass defect analysis",
   "needs_build": true,
   "category": "Mass spectrometry",
   "known_answers": 58
  },
  {
   "name": "kinetics_fit",
   "version": "0.1.0",
   "summary": "Nonlinear Levenberg-Marquardt solver for enzyme kinetics (Michaelis-Menten Vmax, Km) and 4PL Hill dose-response curves (IC50/EC50, Hill slope), with Cheng-Prusoff Ki conversion.",
   "runtime": "native",
   "timeout_s": 30,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "model",
     "type": "string",
     "unit": null,
     "default": "michaelis_menten",
     "enum": [
      "michaelis_menten",
      "hill_ic50"
     ],
     "description": null
    },
    {
     "name": "x",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Substrate or inhibitor concentrations."
    },
    {
     "name": "y",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Observed velocities or responses."
    },
    {
     "name": "substrate_conc",
     "type": "number",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "km_substrate",
     "type": "number",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": null
    }
   ],
   "outputs": [
    {
     "name": "vmax",
     "unit": "1",
     "description": null
    },
    {
     "name": "km",
     "unit": "1",
     "description": null
    },
    {
     "name": "ic50",
     "unit": "1",
     "description": null
    },
    {
     "name": "hill_slope",
     "unit": "1",
     "description": null
    },
    {
     "name": "ki",
     "unit": "1",
     "description": null
    },
    {
     "name": "r2",
     "unit": "1",
     "description": null
    },
    {
     "name": "rmse",
     "unit": "1",
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "exact Michaelis-Menten (Vmax=100, Km=5) recovers both parameters with R2 = 1.0",
     "checks": [
      "km",
      "r2",
      "vmax"
     ]
    },
    {
     "name": "4PL Hill IC50=10, Hill=1 + Cheng-Prusoff ([S]=Km=10) -> Ki=5.0",
     "checks": [
      "hill_slope",
      "ic50",
      "ki"
     ]
    }
   ],
   "title": "Enzyme kinetics & IC50 curve fit",
   "needs_build": true,
   "category": "Chemistry",
   "known_answers": 6
  },
  {
   "name": "kmer_spectrum",
   "version": "0.1.0",
   "summary": "k-mer counting on DNA reads or one sequence (canonical or not, linear or circular): spectrum histogram, distinct and unique k-mers, Shannon entropy, linguistic complexity, genome-size estimate from the spectrum peak, most over-represented k-mers against a base-composition model. Reads from a list, FASTA/FASTQ text, a staged file, or a seeded shotgun simulator.",
   "runtime": "native",
   "timeout_s": 120,
   "estimate_s": 1.0,
   "inputs": [
    {
     "name": "k",
     "type": "integer",
     "unit": "1",
     "default": 21,
     "enum": null,
     "description": "Word length in bases (packed two bits per base, so at most 31). 21 is usual for read sets."
    },
    {
     "name": "canonical",
     "type": "boolean",
     "unit": null,
     "default": true,
     "enum": null,
     "description": "Count a k-mer and its reverse complement as one (reads from both strands)."
    },
    {
     "name": "circular",
     "type": "boolean",
     "unit": null,
     "default": false,
     "enum": null,
     "description": "Read every sequence as a circle: L windows instead of L - k + 1 (plasmids, de Bruijn sequences)."
    },
    {
     "name": "sequences",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Reads or sequences as strings of A, C, G, T (U read as T; N and IUPAC codes break the k-mers that span them)."
    },
    {
     "name": "sequence_text",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "FASTA ('>' headers), FASTQ (four lines per read) or one read per line."
    },
    {
     "name": "sequence_file",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Staged FASTA, FASTQ or one-read-per-line file, e.g. \"@r0003/reads.fa\"."
    },
    {
     "name": "top_n",
     "type": "integer",
     "unit": "1",
     "default": 10,
     "enum": null,
     "description": "How many of the most frequent k-mers to list."
    },
    {
     "name": "min_multiplicity",
     "type": "integer",
     "unit": "1",
     "default": 0,
     "enum": null,
     "description": "k-mers seen fewer times are treated as sequencing errors; 0 finds the error valley of the spectrum."
    },
    {
     "name": "sim_genome_bp",
     "type": "integer",
     "unit": "1",
     "default": 0,
     "enum": null,
     "description": "Length in base pairs of a simulated random circular genome; 0 turns the simulator off. Use it instead of giving sequences."
    },
    {
     "name": "sim_read_bp",
     "type": "integer",
     "unit": "1",
     "default": 150,
     "enum": null,
     "description": "Simulated read length in base pairs."
    },
    {
     "name": "sim_coverage",
     "type": "number",
     "unit": "1",
     "default": 30.0,
     "enum": null,
     "description": "Read bases over genome bases."
    },
    {
     "name": "sim_error_rate",
     "type": "number",
     "unit": "1",
     "default": 0.0,
     "enum": null,
     "description": "Chance that a simulated base is read wrong (uniform substitution)."
    },
    {
     "name": "sim_seed",
     "type": "integer",
     "unit": "1",
     "default": 1,
     "enum": null,
     "description": "Seed of the SplitMix64 draws: the same seed gives the same reads."
    },
    {
     "name": "sim_both_strands",
     "type": "boolean",
     "unit": null,
     "default": true,
     "enum": null,
     "description": "Half the simulated reads come from the reverse strand."
    }
   ],
   "outputs": [
    {
     "name": "k",
     "unit": "1",
     "description": null
    },
    {
     "name": "sequences",
     "unit": "1",
     "description": null
    },
    {
     "name": "total_bases",
     "unit": "1",
     "description": "bases read (base pairs)"
    },
    {
     "name": "gc_fraction",
     "unit": "1",
     "description": null
    },
    {
     "name": "windows",
     "unit": "1",
     "description": "sum over sequences of L - k + 1 (L when circular)"
    },
    {
     "name": "total_kmers",
     "unit": "1",
     "description": "windows counted (those with no ambiguous base)"
    },
    {
     "name": "skipped_kmers",
     "unit": "1",
     "description": null
    },
    {
     "name": "short_sequences",
     "unit": "1",
     "description": null
    },
    {
     "name": "possible_kmers",
     "unit": "1",
     "description": "4^k, or the canonical count (4^k + 4^(k/2))/2 for even k and 4^k/2 for odd k"
    },
    {
     "name": "distinct_kmers",
     "unit": "1",
     "description": null
    },
    {
     "name": "unique_kmers",
     "unit": "1",
     "description": "k-mers seen exactly once"
    },
    {
     "name": "unique_fraction",
     "unit": "1",
     "description": null
    },
    {
     "name": "max_multiplicity",
     "unit": "1",
     "description": null
    },
    {
     "name": "mean_multiplicity",
     "unit": "1",
     "description": null
    },
    {
     "name": "entropy_bits",
     "unit": "1",
     "description": "Shannon entropy of the k-mer distribution, bits"
    },
    {
     "name": "entropy_relative",
     "unit": "1",
     "description": "entropy over log2(min(possible, total))"
    },
    {
     "name": "vocabulary_usage",
     "unit": "1",
     "description": "distinct over min(possible, total) at word length k"
    },
    {
     "name": "linguistic_complexity",
     "unit": "1",
     "description": "Trifonov: sum of distinct words over sum of min(possible, windows), word lengths 1..k"
    },
    {
     "name": "error_cutoff_multiplicity",
     "unit": "1",
     "description": null
    },
    {
     "name": "error_kmers",
     "unit": "1",
     "description": null
    },
    {
     "name": "distinct_solid_kmers",
     "unit": "1",
     "description": null
    },
    {
     "name": "solid_kmer_occurrences",
     "unit": "1",
     "description": null
    },
    {
     "name": "peak_multiplicity",
     "unit": "1",
     "description": "k-mer depth at the spectrum peak"
    },
    {
     "name": "peak_distinct_kmers",
     "unit": "1",
     "description": null
    },
    {
     "name": "coverage_peak_found",
     "unit": null,
     "description": "true when the spectrum (above the error cutoff) peaks at multiplicity 2 or more"
    },
    {
     "name": "genome_size_estimate_bp",
     "unit": "1",
     "description": "solid k-mer occurrences over peak multiplicity, base pairs"
    },
    {
     "name": "top_kmers",
     "unit": null,
     "description": null
    },
    {
     "name": "spectrum",
     "unit": null,
     "description": null
    },
    {
     "name": "simulation",
     "unit": null,
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "homopolymer A x 50, k = 5 (closed form): one distinct k-mer counted L - k + 1 = 46 times, entropy 0, linguistic complexity 5/161 (Trifonov, sum of min(4^w, L - w + 1) over w = 1..5 is 161)",
     "checks": [
      "distinct_kmers",
      "entropy_bits",
      "linguistic_complexity",
      "max_multiplicity",
      "total_kmers",
      "unique_kmers"
     ]
    },
    {
     "name": "de Bruijn B(4,3) read cyclically, k = 3 (de Bruijn 1946): every one of 4^3 = 64 k-mers exactly once, entropy 2k = 6 bits, linguistic complexity 1",
     "checks": [
      "distinct_kmers",
      "entropy_bits",
      "entropy_relative",
      "linguistic_complexity",
      "max_multiplicity",
      "total_kmers",
      "unique_kmers"
     ]
    },
    {
     "name": "total k-mers = sum (L_i - k + 1) (counting identity): lengths 10, 25, 7, 3 at k = 4 give 7 + 22 + 4 + 0 = 33, one sequence shorter than k",
     "checks": [
      "short_sequences",
      "total_bases",
      "total_kmers",
      "windows"
     ]
    },
    {
     "name": "canonical merge (Watson-Crick pairing): AAACG and its reverse complement CGTTT are one canonical 5-mer seen twice; 4^5/2 = 512 canonical 5-mers possible",
     "checks": [
      "distinct_kmers",
      "entropy_bits",
      "max_multiplicity",
      "possible_kmers",
      "total_kmers"
     ]
    },
    {
     "name": "same pair not canonical: AAACG and CGTTT stay two k-mers, entropy log2 2 = 1 bit, 4^5 = 1024 possible",
     "checks": [
      "distinct_kmers",
      "entropy_bits",
      "possible_kmers",
      "unique_kmers"
     ]
    },
    {
     "name": "even-k palindrome ACGT is its own reverse complement: one canonical 4-mer; (4^4 + 4^2)/2 = 136 canonical 4-mers possible (palindrome count 4^(k/2))",
     "checks": [
      "distinct_kmers",
      "possible_kmers",
      "total_kmers"
     ]
    },
    {
     "name": "genome size from the spectrum peak (exact construction): circular B(4,3) genome G = 64 bp read 3 times plus one circular error read ACGTA whose five 5-mers are absent from the genome; k = 5 gives peak 3, error k-mers 5, G = 192/3 = 64",
     "checks": [
      "coverage_peak_found",
      "distinct_kmers",
      "error_kmers",
      "genome_size_estimate_bp",
      "peak_multiplicity",
      "solid_kmer_occurrences",
      "total_kmers",
      "unique_kmers"
     ]
    }
   ],
   "title": "k-mer spectrum",
   "needs_build": true,
   "category": "Genomics",
   "known_answers": 37
  },
  {
   "name": "ld_stats",
   "version": "0.1.0",
   "summary": "Linkage disequilibrium between two biallelic loci (A/a, B/b) from phased haplotype counts, or from unphased 3x3 genotype counts by EM gene counting: haplotype frequencies, D, Lewontin's D', r, r^2, chi-square (1 df) with its tail probability, and the decay D_t = D_0 (1 - c)^t of D, D' and r^2 under random mating with recombination fraction c.",
   "runtime": "native",
   "timeout_s": 30,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "n_AB",
     "type": "number",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "Phased data: chromosomes carrying haplotype AB. Give all four haplotype counts, or genotype_counts instead."
    },
    {
     "name": "n_Ab",
     "type": "number",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "Phased data: chromosomes carrying haplotype Ab."
    },
    {
     "name": "n_aB",
     "type": "number",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "Phased data: chromosomes carrying haplotype aB."
    },
    {
     "name": "n_ab",
     "type": "number",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "Phased data: chromosomes carrying haplotype ab."
    },
    {
     "name": "genotype_counts",
     "type": "array",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "Unphased data: 3x3 counts of individuals, rows AA, Aa, aa and columns BB, Bb, bb. Haplotype frequencies are the maximum-likelihood ones under random union of gametes (EM over the phase of the double heterozygotes Aa Bb)."
    },
    {
     "name": "recomb_rate",
     "type": "number",
     "unit": "1",
     "default": 0.01,
     "enum": null,
     "description": "Recombination fraction c between the loci, per generation (0.5 = unlinked; about 0.01 per cM for short distances)."
    },
    {
     "name": "generations",
     "type": "integer",
     "unit": "1",
     "default": 100,
     "enum": null,
     "description": "Generations of random mating for the decay of D (whole number)."
    },
    {
     "name": "r2_threshold",
     "type": "number",
     "unit": "1",
     "default": 0.2,
     "enum": null,
     "description": "r^2 level for 'generations to decay to threshold'."
    },
    {
     "name": "alpha",
     "type": "number",
     "unit": "1",
     "default": 0.05,
     "enum": null,
     "description": "Significance level for the chi-square test of D = 0."
    },
    {
     "name": "em_tol",
     "type": "number",
     "unit": "1",
     "default": 1e-13,
     "enum": null,
     "description": "EM stops when a step changes the haplotype frequencies by less than this."
    },
    {
     "name": "em_max_iter",
     "type": "integer",
     "unit": "1",
     "default": 100000,
     "enum": null,
     "description": "EM iteration cap per start."
    }
   ],
   "outputs": [
    {
     "name": "mode",
     "unit": null,
     "description": "haplotypes (counts given) or genotypes_em (estimated from genotype counts)"
    },
    {
     "name": "n_haplotypes",
     "unit": "1",
     "description": "number of chromosomes (2 x individuals in genotype mode)"
    },
    {
     "name": "count_AB",
     "unit": "1",
     "description": null
    },
    {
     "name": "count_Ab",
     "unit": "1",
     "description": null
    },
    {
     "name": "count_aB",
     "unit": "1",
     "description": null
    },
    {
     "name": "count_ab",
     "unit": "1",
     "description": null
    },
    {
     "name": "p_AB",
     "unit": "1",
     "description": null
    },
    {
     "name": "p_Ab",
     "unit": "1",
     "description": null
    },
    {
     "name": "p_aB",
     "unit": "1",
     "description": null
    },
    {
     "name": "p_ab",
     "unit": "1",
     "description": null
    },
    {
     "name": "p_A",
     "unit": "1",
     "description": null
    },
    {
     "name": "p_B",
     "unit": "1",
     "description": null
    },
    {
     "name": "D",
     "unit": "1",
     "description": "p_AB p_ab - p_Ab p_aB = p_AB - p_A p_B"
    },
    {
     "name": "D_max",
     "unit": "1",
     "description": null
    },
    {
     "name": "D_prime",
     "unit": "1",
     "description": "Lewontin's D / D_max, signed; null when a locus is monomorphic"
    },
    {
     "name": "D_prime_abs",
     "unit": "1",
     "description": null
    },
    {
     "name": "r",
     "unit": "1",
     "description": null
    },
    {
     "name": "r2",
     "unit": "1",
     "description": "D^2 / (p_A q_A p_B q_B)"
    },
    {
     "name": "chi_square",
     "unit": "1",
     "description": "n r^2, one degree of freedom"
    },
    {
     "name": "p_value",
     "unit": "1",
     "description": "erfc(sqrt(chi_square / 2))"
    },
    {
     "name": "alpha",
     "unit": "1",
     "description": null
    },
    {
     "name": "ld_significant",
     "unit": null,
     "description": "p_value < alpha"
    },
    {
     "name": "min_expected_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "recomb_rate",
     "unit": "1",
     "description": null
    },
    {
     "name": "generations",
     "unit": "1",
     "description": null
    },
    {
     "name": "decay_factor",
     "unit": "1",
     "description": "(1 - c)^t"
    },
    {
     "name": "D_after",
     "unit": "1",
     "description": null
    },
    {
     "name": "D_prime_after",
     "unit": "1",
     "description": null
    },
    {
     "name": "r2_after",
     "unit": "1",
     "description": null
    },
    {
     "name": "half_life_generations",
     "unit": "1",
     "description": "generations for D to halve: ln 2 / -ln(1 - c)"
    },
    {
     "name": "r2_threshold",
     "unit": "1",
     "description": null
    },
    {
     "name": "generations_to_r2_threshold",
     "unit": "1",
     "description": "generations until r^2 falls to r2_threshold (fractional)"
    },
    {
     "name": "haplotypes",
     "unit": null,
     "description": null
    },
    {
     "name": "decay_table",
     "unit": null,
     "description": null
    },
    {
     "name": "n_individuals",
     "unit": "1",
     "description": null
    },
    {
     "name": "n_double_het",
     "unit": "1",
     "description": null
    },
    {
     "name": "double_het_cis_fraction",
     "unit": "1",
     "description": null
    },
    {
     "name": "em_iterations",
     "unit": "1",
     "description": null
    },
    {
     "name": "em_converged",
     "unit": null,
     "description": "EM met em_tol"
    },
    {
     "name": "em_optima",
     "unit": "1",
     "description": null
    },
    {
     "name": "log_likelihood",
     "unit": "1",
     "description": null
    },
    {
     "name": "warnings",
     "unit": null,
     "description": "list of text"
    }
   ],
   "selftests": [
    {
     "name": "closed form, independence: counts equal n pA pB (pA=0.6, pB=0.3, n=1000) give D = 0, D' = 0, r^2 = 0, chi-square = 0, p = 1 (exact up to rounding, abs 1e-12)",
     "checks": [
      "D",
      "D_prime",
      "chi_square",
      "p_A",
      "p_B",
      "p_value",
      "r2"
     ]
    },
    {
     "name": "closed form, complete LD: only AB (40) and ab (60) give D' = 1, r^2 = 1, D = pAB - pA pB = 0.4 - 0.16 = 0.24, chi-square = n r^2 = 100 (rel 1e-9)",
     "checks": [
      "D",
      "D_prime",
      "chi_square",
      "r",
      "r2"
     ]
    },
    {
     "name": "closed form (30,20,10,40): D = 0.3 - 0.5*0.4 = 0.1, D' = 0.1/min(0.3,0.2) = 0.5, r^2 = 0.01/0.06 = 1/6, chi-square = 100/6, decay c=0.1 t=10: D_t = 0.1*0.9^10, half-life ln2/-ln0.9 = 6.5788134790 (rel 1e-9)",
     "checks": [
      "D",
      "D_after",
      "D_prime",
      "D_prime_after",
      "chi_square",
      "generations_to_r2_threshold",
      "half_life_generations",
      "r2",
      "r2_after"
     ]
    },
    {
     "name": "textbook chi-square(1) 95% point 3.841458820694 gives p = 0.05: counts 0.3n,0.2n,0.1n,0.4n with n = 6 x 3.841458820694 so chi2 = n/6 (rel 1e-6, erfc series)",
     "checks": [
      "chi_square",
      "p_value"
     ]
    },
    {
     "name": "exact gene counting, EM on phase-unambiguous genotypes (no Aa Bb): returns the true haplotype counts AB 28, Ab 12, aB 7, ab 23 of 70 chromosomes, D = (28*23 - 12*7)/70^2 = 560/4900 (rel 1e-12)",
     "checks": [
      "D",
      "count_AB",
      "count_Ab",
      "count_aB",
      "count_ab",
      "n_haplotypes"
     ]
    },
    {
     "name": "MLE at exact expectation: HWE genotype counts from haplotypes (0.4,0.1,0.1,0.4), N=10000, are a fixed point of EM, so EM returns them: D = 0.15, D' = 0.6, r^2 = 0.36, cis fraction 0.16/0.17 (rel 1e-8, EM tolerance 1e-13)",
     "checks": [
      "D",
      "D_prime",
      "double_het_cis_fraction",
      "em_converged",
      "p_AB",
      "p_Ab",
      "r2"
     ]
    }
   ],
   "title": "Linkage disequilibrium",
   "needs_build": true,
   "category": "Genomics",
   "known_answers": 36
  },
  {
   "name": "lddt_score",
   "version": "0.1.0",
   "summary": "lDDT (local distance difference test, Mariani et al. 2013) of a model against a reference structure, per residue and overall, without superposition: the fraction of reference atom pairs of different residues within 15 \u00c5 whose distance the model keeps within 0.5, 1, 2 and 4 \u00c5, averaged over the four thresholds. CA atoms or all heavy atoms; PDB or mmCIF text or files, or bare coordinate lists. Atoms are matched by chain, residue number, insertion code and atom name (no sequence alignment, no swap of equivalent side-chain atoms, no stereochemistry check); a reference atom the model lacks loses all its pairs.",
   "runtime": "native",
   "timeout_s": 120,
   "estimate_s": 0.1,
   "inputs": [
    {
     "name": "reference_text",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "The reference structure as PDB or mmCIF text (coordinates in \u00c5)."
    },
    {
     "name": "reference_file",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "The reference structure as a PDB or mmCIF file of the lab."
    },
    {
     "name": "model_text",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "The model as PDB or mmCIF text, numbered like the reference."
    },
    {
     "name": "model_file",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "The model as a PDB or mmCIF file of the lab."
    },
    {
     "name": "reference_xyz",
     "type": "array",
     "unit": "\u00c5",
     "default": null,
     "enum": null,
     "description": "Instead of structures: one [x, y, z] per residue of the reference."
    },
    {
     "name": "model_xyz",
     "type": "array",
     "unit": "\u00c5",
     "default": null,
     "enum": null,
     "description": "One [x, y, z] per residue of the model, in the same order; null where the model has no residue."
    },
    {
     "name": "atoms",
     "type": "string",
     "unit": null,
     "default": "ca",
     "enum": [
      "ca",
      "all"
     ],
     "description": "ca: one CA per residue. all: every heavy atom (hydrogens are left out)."
    },
    {
     "name": "chain",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Score this chain of the reference only (and of the model, unless model_chain is set)."
    },
    {
     "name": "model_chain",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "The model's chain letter when it differs from the reference's."
    },
    {
     "name": "include_hetatm",
     "type": "boolean",
     "unit": null,
     "default": false,
     "enum": null,
     "description": "Also score HETATM residues (modified residues, ligands; never water)."
    },
    {
     "name": "inclusion_radius_A",
     "type": "number",
     "unit": "\u00c5",
     "default": 15.0,
     "enum": null,
     "description": "Reference pairs closer than this are scored (strictly less). lDDT is defined with 15."
    },
    {
     "name": "thresholds_A",
     "type": "array",
     "unit": "\u00c5",
     "default": [
      0.5,
      1.0,
      2.0,
      4.0
     ],
     "enum": null,
     "description": "A pair is preserved at a threshold when its distance changes by strictly less. lDDT is defined with 0.5, 1, 2, 4."
    }
   ],
   "outputs": [
    {
     "name": "lddt",
     "unit": "1",
     "description": "Global lDDT, 0 to 1: preserved pairs over all pairs, averaged over the thresholds."
    },
    {
     "name": "mean_residue_lddt",
     "unit": "1",
     "description": "Mean of the per-residue scores (not the same number as lddt)."
    },
    {
     "name": "min_residue_lddt",
     "unit": "1",
     "description": null
    },
    {
     "name": "min_residue",
     "unit": null,
     "description": "The residue with the lowest score."
    },
    {
     "name": "pairs_total",
     "unit": "1",
     "description": "Reference atom pairs of different residues inside the radius."
    },
    {
     "name": "preserved_pairs",
     "unit": "1",
     "description": "Preserved pairs, one count per threshold."
    },
    {
     "name": "preserved_fraction",
     "unit": "1",
     "description": "Preserved fraction, one per threshold."
    },
    {
     "name": "thresholds_A",
     "unit": "\u00c5",
     "description": null
    },
    {
     "name": "threshold_table",
     "unit": null,
     "description": null
    },
    {
     "name": "inclusion_radius_A",
     "unit": "\u00c5",
     "description": null
    },
    {
     "name": "reference_residues",
     "unit": "1",
     "description": null
    },
    {
     "name": "residues_scored",
     "unit": "1",
     "description": null
    },
    {
     "name": "residues_missing_in_model",
     "unit": "1",
     "description": null
    },
    {
     "name": "reference_atoms",
     "unit": "1",
     "description": null
    },
    {
     "name": "atoms_missing_in_model",
     "unit": "1",
     "description": null
    },
    {
     "name": "model_atoms_not_in_reference",
     "unit": "1",
     "description": null
    },
    {
     "name": "residue_name_mismatches",
     "unit": "1",
     "description": null
    },
    {
     "name": "residue_names",
     "unit": null,
     "description": null
    },
    {
     "name": "residue_lddt",
     "unit": "1",
     "description": "Per residue, in reference order; null for a residue with no pair inside the radius."
    },
    {
     "name": "residue_pairs",
     "unit": "1",
     "description": null
    },
    {
     "name": "lowest_residues",
     "unit": null,
     "description": null
    },
    {
     "name": "residues",
     "unit": null,
     "description": null
    },
    {
     "name": "complete",
     "unit": null,
     "description": "true when the model has every scored reference atom."
    },
    {
     "name": "warnings",
     "unit": null,
     "description": null
    },
    {
     "name": "residue_lddt.csv",
     "unit": null,
     "description": "One row per reference residue: atoms, pairs, lDDT and the preserved fraction per threshold."
    },
    {
     "name": "thresholds.csv",
     "unit": null,
     "description": "Preserved pairs and fraction per threshold."
    }
   ],
   "selftests": [
    {
     "name": "identical structures (6 CA of an ideal helix): lDDT = 1 by definition, C(6,2) = 15 pairs (Mariani 2013); abs 1e-9, a ratio of counts",
     "checks": [
      "lddt",
      "min_residue_lddt",
      "pairs_total",
      "preserved_fraction.0"
     ]
    },
    {
     "name": "rigid copy, all heavy atoms (3 residues x N,CA,C,O; 90 deg turn about z + shift): distances are invariant, lDDT = 1; pairs = C(12,2) - 3*C(4,2) = 48; abs 1e-9",
     "checks": [
      "lddt",
      "mean_residue_lddt",
      "pairs_total",
      "preserved_fraction.0"
     ]
    },
    {
     "name": "one residue moved 100 A (5 CA on a line, 3.8 A apart; the 15.2 A end pair is outside 15 A so 9 pairs; residue 3 owns 4): lDDT = 5/9, per residue 2/3, 3/4, 0, 3/4, 2/3 (counted by hand); abs 1e-9",
     "checks": [
      "lddt",
      "min_residue",
      "pairs_total",
      "residue_lddt.0",
      "residue_lddt.1",
      "residue_lddt.2",
      "residue_lddt.3",
      "residue_lddt.4"
     ]
    },
    {
     "name": "every distance off by 0.75 A (regular tetrahedron, edge e against e + 0.75): fails 0.5 A, passes 1, 2, 4 A, lDDT = 3/4 exactly; abs 1e-9",
     "checks": [
      "lddt",
      "pairs_total",
      "preserved_fraction.0",
      "preserved_fraction.1",
      "preserved_fraction.2",
      "preserved_fraction.3",
      "residue_lddt.3"
     ]
    },
    {
     "name": "model lacks residue 3 of the 5-residue line: its 4 of 9 pairs stay in the count and are lost, lDDT = 5/9 (counted by hand); abs 1e-9",
     "checks": [
      "complete",
      "lddt",
      "pairs_total",
      "residue_lddt.2",
      "residue_lddt.4",
      "residues_missing_in_model"
     ]
    },
    {
     "name": "all atoms, pairs inside a residue excluded (2 residues x 2 atoms on a line: 4 pairs, not 6); one atom 3 A out breaks its 2 pairs at 0.5, 1, 2 A only: (2+2+2+4)/16 = 0.625 (counted by hand); abs 1e-9",
     "checks": [
      "lddt",
      "pairs_total",
      "preserved_fraction.0",
      "preserved_fraction.3",
      "residue_lddt.0"
     ]
    },
    {
     "name": "the same two residues, CA only: one pair, 5 A against 8 A, kept at 4 A only: lDDT = 1/4; abs 1e-9",
     "checks": [
      "lddt",
      "pairs_total"
     ]
    },
    {
     "name": "inclusion radius 4 A on the 5-residue line keeps only the 4 neighbour pairs (3.8 A); end residue moved 100 A loses 1: lDDT = 3/4, residue 4 = 1/2, residue 5 = 0 (counted by hand); abs 1e-9",
     "checks": [
      "lddt",
      "pairs_total",
      "residue_lddt.0",
      "residue_lddt.3",
      "residue_lddt.4"
     ]
    }
   ],
   "title": "lDDT: model against reference",
   "needs_build": true,
   "category": "Structural biology",
   "known_answers": 41
  },
  {
   "name": "life",
   "version": "0.1.0",
   "summary": "LifeCraft's sequence engine (molecular biology): GenBank, FASTA and other sequence files, restriction enzymes and digests, cloning (restriction, Gibson, Golden Gate), primers (Tm, checks, design, mutagenesis), translation, Sanger verification. Runs a batch of engine commands; commands=\"<filter>\" lists them with their parameters. Read files from inputs/ (staged file inputs); save outputs under out/.",
   "runtime": "native",
   "timeout_s": 300,
   "estimate_s": 1,
   "inputs": [
    {
     "name": "steps",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Commands in order: [{\"id\": \"file.open\", \"params\": {\"path\": \"inputs/backbone.fasta\"}}, ...]. Results come back in order; the batch stops at the first error."
    },
    {
     "name": "files",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Files to stage under inputs/, as references like \"@r0003/backbone.fasta\" (bench_import brings outside files in)."
    },
    {
     "name": "commands",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "List the engine's commands whose id contains this text (\"\" for all) instead of running steps."
    }
   ],
   "outputs": [
    {
     "name": "completed",
     "unit": null,
     "description": null
    },
    {
     "name": "results",
     "unit": null,
     "description": null
    },
    {
     "name": "batch.json",
     "unit": null,
     "description": null
    },
    {
     "name": "out/*",
     "unit": null,
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "EcoRI sites in a 21-mer: sites at 4 and 13, cut after base 4 (G^AATTC)",
     "checks": [
      "completed",
      "results.2.0.cut_after_base",
      "results.2.0.site_start",
      "results.2.1.site_start"
     ]
    },
    {
     "name": "primer Tm against Biopython 1.88 Tm_NN: 55.04 C (the engine reports one decimal)",
     "checks": [
      "results.0.tm"
     ]
    }
   ],
   "title": "Biology batch",
   "needs_build": true,
   "category": "Structural biology",
   "known_answers": 5
  },
  {
   "name": "lqr",
   "version": "0.1.0",
   "summary": "Continuous-time linear-quadratic regulator for a small state-space plant x' = Ax + Bu (up to 8 states, tested to 6): stabilising Riccati solution P (Hamiltonian matrix sign + Newton-Kleinman), gain K = R^-1 B'P, closed-loop poles with damping, Riccati residual, and the response to an initial state with an exact cost balance (cost paid + x_end'P x_end = x0'P x0). Writes out/response.csv, out/poles.csv, out/gain.csv.",
   "runtime": "native",
   "timeout_s": 30,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "A",
     "type": "array",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "State matrix, n x n rows (n <= 8). Entries in the plant's own state units per second; time is in seconds."
    },
    {
     "name": "B",
     "type": "array",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "Input matrix, n rows by m columns; a flat list of n numbers for a single input."
    },
    {
     "name": "Q",
     "type": "array",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "State weight, symmetric positive semi-definite n x n, or a list of n diagonal weights. Left out: identity."
    },
    {
     "name": "R",
     "type": "array",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "Input weight, symmetric positive definite m x m, or a list of m diagonal weights. Left out: identity."
    },
    {
     "name": "rho",
     "type": "number",
     "unit": "1",
     "default": 1.0,
     "enum": null,
     "description": "Multiplies R (effort price); raise it for gentler control."
    },
    {
     "name": "x0",
     "type": "array",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "Initial state for the response, one number per state. Left out: [1, 0, ..., 0]."
    },
    {
     "name": "t_end_s",
     "type": "number",
     "unit": "s",
     "default": 0.0,
     "enum": null,
     "description": "Response length; 0 means eight time constants of the slowest closed-loop pole."
    },
    {
     "name": "n_steps",
     "type": "integer",
     "unit": "1",
     "default": 400,
     "enum": null,
     "description": "Samples in the response (exact transition matrix, so steps only set the resolution)."
    }
   ],
   "outputs": [
    {
     "name": "n_states",
     "unit": "1",
     "description": null
    },
    {
     "name": "n_inputs",
     "unit": "1",
     "description": null
    },
    {
     "name": "K",
     "unit": "1",
     "description": "Gain, m rows by n columns, u = -K x (units: input per state)."
    },
    {
     "name": "P",
     "unit": "1",
     "description": "Stabilising solution of A'P + PA - PBR^-1B'P + Q = 0 (units of cost per state squared)."
    },
    {
     "name": "poles",
     "unit": null,
     "description": "Closed-loop poles, slowest first."
    },
    {
     "name": "open_loop_poles",
     "unit": null,
     "description": "Eigenvalues of A, slowest first."
    },
    {
     "name": "open_loop_stable",
     "unit": "1",
     "description": null
    },
    {
     "name": "open_loop_max_real_per_s",
     "unit": "1/s",
     "description": null
    },
    {
     "name": "max_pole_real_per_s",
     "unit": "1/s",
     "description": null
    },
    {
     "name": "min_damping_ratio",
     "unit": "1",
     "description": null
    },
    {
     "name": "fastest_pole_rad_per_s",
     "unit": "rad/s",
     "description": null
    },
    {
     "name": "slowest_time_constant_s",
     "unit": "s",
     "description": null
    },
    {
     "name": "settling_time_s",
     "unit": "s",
     "description": "Four slowest time constants (2 % band)."
    },
    {
     "name": "riccati_residual_rel",
     "unit": "1",
     "description": "|A'P + PA - PGP + Q| over the size of its terms (Frobenius)."
    },
    {
     "name": "kleinman_steps",
     "unit": "1",
     "description": null
    },
    {
     "name": "P_min_eig",
     "unit": "1",
     "description": null
    },
    {
     "name": "pole_error_rel",
     "unit": "1",
     "description": "First-order pole error estimate from an independent complex determinant, relative to |Acl|."
    },
    {
     "name": "controllability_rank",
     "unit": "1",
     "description": null
    },
    {
     "name": "controllable",
     "unit": "1",
     "description": null
    },
    {
     "name": "cost_J",
     "unit": "1",
     "description": "Optimal cost from x0: x0'P x0."
    },
    {
     "name": "cost_paid",
     "unit": "1",
     "description": "Cost accumulated over the response (Van Loan Gramian, independent of P)."
    },
    {
     "name": "cost_left",
     "unit": "1",
     "description": "x_end'P x_end."
    },
    {
     "name": "cost_balance_rel",
     "unit": "1",
     "description": "|cost_J - cost_paid - cost_left| / cost_J."
    },
    {
     "name": "peak_control_abs",
     "unit": "1",
     "description": null
    },
    {
     "name": "peak_control_max",
     "unit": "1",
     "description": null
    },
    {
     "name": "x_end",
     "unit": "1",
     "description": null
    },
    {
     "name": "t_end_s",
     "unit": "s",
     "description": null
    },
    {
     "name": "dt_s",
     "unit": "s",
     "description": null
    },
    {
     "name": "n_steps",
     "unit": "1",
     "description": null
    },
    {
     "name": "rho",
     "unit": "1",
     "description": null
    },
    {
     "name": "stable",
     "unit": "1",
     "description": null
    },
    {
     "name": "design_ok",
     "unit": "1",
     "description": null
    },
    {
     "name": "warnings",
     "unit": "1",
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "double integrator Q=I R=1, closed form K=[1, sqrt3], P=[[sqrt3,1],[1,sqrt3]], poles -sqrt3/2 +- j/2 (wn 1, zeta sqrt3/2); rel 1e-9: solver converges to round-off",
     "checks": [
      "K.0.0",
      "K.0.1",
      "P.0.0",
      "P.0.1",
      "P.1.1",
      "cost_J",
      "cost_balance_rel",
      "design_ok",
      "fastest_pole_rad_per_s",
      "max_pole_real_per_s",
      "min_damping_ratio",
      "riccati_residual_rel",
      "stable"
     ]
    },
    {
     "name": "scalar unstable plant a=2 b=3 q=4 r=5, closed form P = r(a+sqrt(a^2+b^2 q/r))/b^2 = 2.97036, K = bP/r, pole -sqrt(a^2+b^2 q/r) = -sqrt(11.2); rel 1e-9",
     "checks": [
      "K.0.0",
      "P.0.0",
      "max_pole_real_per_s",
      "open_loop_max_real_per_s",
      "open_loop_stable",
      "riccati_residual_rel",
      "stable"
     ]
    },
    {
     "name": "undamped oscillator w0=2 (A=[[0,1],[-4,0]]), Q=diag(9,1), R=1, hand-solved ARE: p12 = -w0^2+sqrt(w0^4+q1) = 1, p22 = sqrt(q2+2 p12) = sqrt3, p11 = p22 (w0^2+p12) = 5 sqrt3, wn = sqrt5, zeta = sqrt(3/20); rel 1e-9",
     "checks": [
      "K.0.0",
      "K.0.1",
      "P.0.0",
      "P.0.1",
      "P.1.1",
      "design_ok",
      "fastest_pole_rad_per_s",
      "max_pole_real_per_s",
      "min_damping_ratio",
      "riccati_residual_rel"
     ]
    },
    {
     "name": "two decoupled scalar plants, two inputs, R=diag(1,0.5) times rho=2: scalar closed forms P11 = 2(1+sqrt1.5), P22 = sqrt7-2, off-diagonals 0 (abs 1e-12), poles -sqrt1.5 and -sqrt7; rel 1e-9",
     "checks": [
      "K.0.0",
      "K.0.1",
      "K.1.1",
      "P.0.0",
      "P.0.1",
      "P.1.1",
      "fastest_pole_rad_per_s",
      "max_pole_real_per_s",
      "n_inputs",
      "riccati_residual_rel"
     ]
    },
    {
     "name": "4-state coupled plant = Hadamard rotation H(DI + oscillator)H of the two closed forms above: P' = H P H gives P11 = 2sqrt3+1, P22 = 2sqrt3-1, P13 = -sqrt3; poles invariant (-sqrt3/2, zeta sqrt(3/20), wn sqrt5); x0 = H e1 so cost x0'Px0 = sqrt3; rel 1e-9",
     "checks": [
      "P.0.0",
      "P.0.2",
      "P.1.1",
      "controllability_rank",
      "cost_J",
      "cost_balance_rel",
      "design_ok",
      "fastest_pole_rad_per_s",
      "max_pole_real_per_s",
      "min_damping_ratio",
      "riccati_residual_rel"
     ]
    }
   ],
   "title": "Linear-quadratic regulator",
   "needs_build": true,
   "category": "Dynamics and control",
   "known_answers": 51
  },
  {
   "name": "material",
   "version": "0.1.0",
   "summary": "A material's properties with the source of every value, and a design endurance limit derived as a run. action=library: a built-in material from open sources only (MIL-HDBK-5J, NASA TN D-2899), values as printed with document, table and page, converted exactly to SI. action=record: a property set from outside the library with its source (URL or document, where, date read, trust), validated and journalled, so a design cites the run instead of a typed number. action=endurance: the endurance limit of the part as made from a test value: Goodman mean-stress conversion, life change (Basquin slope, flat, or a stated factor), surface, size, loading, temperature, other and reliability factors (normal distribution), each with its formula or source. Readings feed other instruments: @run:E_Pa (strip), @run:arm_material (arm), @run:ultimate_MPa, @run:yield_MPa, @run:design.endurance_MPa (fatigue).",
   "runtime": "native",
   "timeout_s": 30,
   "estimate_s": 1,
   "inputs": [
    {
     "name": "action",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": [
      "library",
      "list",
      "record",
      "endurance"
     ],
     "description": "library (default when material is given), list, record, endurance."
    },
    {
     "name": "material",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "library: the material id (action list shows them), e.g. aisi301-full-hard, 6061-T6-drawn-tube."
    },
    {
     "name": "basis",
     "type": "string",
     "unit": null,
     "default": "A",
     "enum": null,
     "description": "library: design basis wanted (A, B; S-basis or typical tables give what they print)."
    },
    {
     "name": "direction",
     "type": "string",
     "unit": null,
     "default": "L",
     "enum": null,
     "description": "library: grain direction wanted (L, LT)."
    },
    {
     "name": "fatigue_cycles",
     "type": "number",
     "unit": "1",
     "default": 10000000,
     "enum": null,
     "description": "library: life at which to read an S-N law."
    },
    {
     "name": "stress_ratio",
     "type": "number",
     "unit": "1",
     "default": -1,
     "enum": null,
     "description": "library: stress ratio R at which to read an S-N law."
    },
    {
     "name": "name",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "record: the material's name."
    },
    {
     "name": "condition",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "record: temper or condition."
    },
    {
     "name": "properties",
     "type": "object",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "record: {property: {value, unit as printed, where?, basis?, direction?}}; properties ultimate, yield, E, Ec, G, poisson, density, elongation."
    },
    {
     "name": "fatigue",
     "type": "object",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "record: a fatigue test value: {amplitude: {value, unit}, mean?: {value, unit}, cycles, survival (0.5 = median), loading: bending|axial|torsion, where?, conditions?}."
    },
    {
     "name": "source",
     "type": "object",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "record: {url or document, where, date_read YYYY-MM-DD, trust: high|medium|low, note}."
    },
    {
     "name": "test",
     "type": "object",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "endurance: the test value: a record's fatigue_test (\"@run:fatigue_test\") or {amplitude, mean?, cycles, survival, loading, source, trust?} in stress_unit."
    },
    {
     "name": "estimate_from_ultimate",
     "type": "boolean",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "endurance, steels: S'e = 0.5 S_ut (S_ut up to 1400 MPa) in place of a test value."
    },
    {
     "name": "ultimate",
     "type": "number",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "endurance: the part's tensile strength, in stress_unit (for a test with a mean stress, a machined surface, or the estimate)."
    },
    {
     "name": "stress_unit",
     "type": "string",
     "unit": null,
     "default": "MPa",
     "enum": [
      "MPa",
      "ksi"
     ],
     "description": null
    },
    {
     "name": "life_cycles",
     "type": "number",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "endurance: the part's life; default the test's."
    },
    {
     "name": "life",
     "type": "object",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "endurance, when the life differs from the test's: {method: basquin, k, source} | {method: flat, source} | {method: factor, value, source}; assumption: true marks an unsourced step."
    },
    {
     "name": "reliability",
     "type": "number",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "endurance: survival probability wanted (0.99); default the test's."
    },
    {
     "name": "cov",
     "type": "number",
     "unit": "1",
     "default": 0.08,
     "enum": null,
     "description": "endurance: coefficient of variation of the endurance strength."
    },
    {
     "name": "surface",
     "type": null,
     "unit": null,
     "default": null,
     "enum": null,
     "description": "endurance: as_tested | {method: machined} | {method: factor, value, source}."
    },
    {
     "name": "size",
     "type": null,
     "unit": null,
     "default": null,
     "enum": null,
     "description": "endurance: as_tested | {method: round_rotating, d_mm or d_in} | {method: factor, value, source}."
    },
    {
     "name": "loading",
     "type": null,
     "unit": null,
     "default": null,
     "enum": null,
     "description": "endurance: as_tested | {method: factor, value, source}."
    },
    {
     "name": "temperature",
     "type": null,
     "unit": null,
     "default": null,
     "enum": null,
     "description": "endurance: as_tested | {method: factor, value, source}."
    },
    {
     "name": "other",
     "type": null,
     "unit": null,
     "default": null,
     "enum": null,
     "description": "endurance: as_tested | {method: factor, value, source}."
    }
   ],
   "outputs": [
    {
     "name": "E_Pa",
     "unit": "Pa",
     "description": null
    },
    {
     "name": "E_GPa",
     "unit": "GPa",
     "description": null
    },
    {
     "name": "density_kg_m3",
     "unit": "kg/m^3",
     "description": null
    },
    {
     "name": "poisson",
     "unit": "1",
     "description": null
    },
    {
     "name": "yield_MPa",
     "unit": "MPa",
     "description": null
    },
    {
     "name": "ultimate_MPa",
     "unit": "MPa",
     "description": null
    },
    {
     "name": "arm_material",
     "unit": null,
     "description": "the arm instrument's material object"
    },
    {
     "name": "values",
     "unit": null,
     "description": "each property: value (SI), printed value and unit, basis, direction, source, where"
    },
    {
     "name": "fatigue_test",
     "unit": null,
     "description": "record: the test value, for action endurance"
    },
    {
     "name": "design",
     "unit": null,
     "description": "endurance: endurance_MPa, endurance_Pa, life_cycles, reliability, total_factor"
    },
    {
     "name": "factors",
     "unit": null,
     "description": "endurance: each factor with its formula and source"
    },
    {
     "name": "G_Pa",
     "unit": "Pa",
     "description": null
    },
    {
     "name": "G_GPa",
     "unit": "GPa",
     "description": null
    },
    {
     "name": "Ec_Pa",
     "unit": "Pa",
     "description": null
    },
    {
     "name": "Ec_GPa",
     "unit": "GPa",
     "description": null
    },
    {
     "name": "ultimate_Pa",
     "unit": "Pa",
     "description": null
    },
    {
     "name": "yield_Pa",
     "unit": "Pa",
     "description": null
    },
    {
     "name": "elongation_pct",
     "unit": "%",
     "description": null
    },
    {
     "name": "fatigue",
     "unit": null,
     "description": null
    },
    {
     "name": "k_e",
     "unit": "1",
     "description": null
    },
    {
     "name": "k_life",
     "unit": "1",
     "description": null
    },
    {
     "name": "k_loading",
     "unit": "1",
     "description": null
    },
    {
     "name": "k_mean_stress",
     "unit": "1",
     "description": null
    },
    {
     "name": "k_other",
     "unit": "1",
     "description": null
    },
    {
     "name": "k_reliability",
     "unit": "1",
     "description": null
    },
    {
     "name": "k_size",
     "unit": "1",
     "description": null
    },
    {
     "name": "k_surface",
     "unit": "1",
     "description": null
    },
    {
     "name": "k_temperature",
     "unit": "1",
     "description": null
    },
    {
     "name": "z_R",
     "unit": "1",
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "library read-back: AISI 301 full hard, A basis, L: MIL-HDBK-5J Table 2.7.1.0(b) p. 2-223 prints Ftu 174 ksi, E 26.0e3 ksi, mu 0.27, w 0.286 lb/in3; exact conversion",
     "checks": [
      "E_GPa",
      "density_kg_m3",
      "poisson",
      "source.statement",
      "ultimate_MPa",
      "values.E.where",
      "values.ultimate.printed",
      "values.ultimate.printed_unit"
     ]
    },
    {
     "name": "library read-back: 6061-T6 drawn tube, MIL-HDBK-5J Table 3.6.2.0(c1) p. 3-267: Fty 35 ksi (S basis), E 9.9e3 ksi, w 0.098 lb/in3, as the arm's material object",
     "checks": [
      "arm_material.E_Pa",
      "arm_material.density_kg_m3",
      "arm_material.yield_Pa",
      "values.yield.basis",
      "values.yield.where"
     ]
    },
    {
     "name": "library read-back: Ti-6Al-4V annealed sheet and 7075-T6 sheet, MIL-HDBK-5J Tables 5.4.1.0(b) p. 5-53 (E 16.0e3 ksi, Fty A L 126 ksi) and 3.7.6.0(b1) p. 3-371",
     "checks": [
      "E_GPa",
      "density_kg_m3",
      "values.E.where",
      "yield_MPa"
     ]
    },
    {
     "name": "library read-back: 7075-T6 sheet 0.040-0.125 in, B basis, LT: Ftu 80 ksi, Fty 71 ksi (MIL-HDBK-5J Table 3.7.6.0(b1), p. 3-371)",
     "checks": [
      "ultimate_MPa",
      "values.yield.printed",
      "yield_MPa"
     ]
    },
    {
     "name": "6061-T6 S-N law of MIL-HDBK-5J Fig. 3.6.2.2.8 (p. 3-289): log N = 20.68 - 9.84 log Seq, Seq = Smax (1-R)^0.63; at 1e7 cycles, R = -1: Sa = 10^(13.68/9.84)/2^0.63 ksi",
     "checks": [
      "fatigue.amplitude_MPa",
      "fatigue.basquin_k"
     ]
    },
    {
     "name": "NASA TN D-2899 Table IV(d) transcribed: 35 unnotched AISI 301 points, 5 run-outs, every printed MN/m2 within 1.1 of ksi x 6.894757",
     "checks": [
      "fatigue.count",
      "fatigue.rows_consistent",
      "fatigue.runouts",
      "ultimate_MPa"
     ]
    },
    {
     "name": "exact unit conversions on a record (synthetic values): 100 ksi = 689.4757293168361 MPa, 10 Msi = 68.94757293168361 GPa, 0.1 lb/in3 = 2767.9904710203125 kg/m3 (lbf, in, lb exact); low trust flagged",
     "checks": [
      "E_GPa",
      "density_kg_m3",
      "low_trust",
      "ok",
      "ultimate_MPa"
     ]
    },
    {
     "name": "reliability factor from the normal distribution: z at 99 % = 2.326 (standard normal tables, NIST/SEMATECH e-Handbook 1.3.6.7.1); k_e = 1 - 0.08 z = 0.814 (Shigley 8th ed. Table 6-6, printed in Example 7-1)",
     "checks": [
      "design.endurance_MPa",
      "k_reliability",
      "z_R"
     ]
    },
    {
     "name": "reliability 99.9 %: z = 3.090 (standard normal tables, NIST/SEMATECH e-Handbook 1.3.6.7.1)",
     "checks": [
      "z_R"
     ]
    },
    {
     "name": "published worked example: Budynas and Nisbett, Shigley's Mechanical Engineering Design, 8th ed., Example 7-1 (pp. 358-359): S_ut 105 kpsi machined 1.100 in shaft, 99 %: k_a 0.787, k_b 0.870, k_e 0.814, Se 29.3 kpsi. The book multiplies the factors already rounded to 3 digits (0.787 x 0.870 x 0.814 x 52.5 = 29.26); unrounded the chain gives 29.25, so Se is held to the book's rounding: 3 factors at +-0.0005 (+-0.06 kpsi) plus the final digit (+-0.05)",
     "checks": [
      "design.endurance",
      "k_reliability",
      "k_size",
      "k_surface"
     ]
    },
    {
     "name": "Goodman mean-stress conversion and Basquin life change, closed form: 100 MPa at mean 250, S_ut 1000 -> 133.33 fully reversed; 1e6 -> 1e8 cycles with k = 10: x 100^-0.1",
     "checks": [
      "design.endurance_MPa",
      "k_life",
      "k_mean_stress"
     ]
    },
    {
     "name": "assumed factors are flagged: a size factor given as an assumption puts a warning on the run (ok false), value as given",
     "checks": [
      "design.endurance_MPa",
      "k_size",
      "ok"
     ]
    },
    {
     "name": "SI forms of the surface and size factors agree with the kpsi/inch forms: 710 MPa machined k_a = 4.51 x 710^-0.265 = 0.792, 32 mm rotating k_b = (32/7.62)^-0.107 = 0.858 (Shigley 8th ed. solutions manual, Problem 7-7, quoted in a search result; not read on a page)",
     "checks": [
      "k_size",
      "k_surface"
     ]
    }
   ],
   "title": "Material",
   "needs_build": true,
   "category": "Mechanics, CAD and finite elements",
   "known_answers": 47
  },
  {
   "name": "measure",
   "version": "0.1.0",
   "summary": "A measured time series (base and response accelerations, e.g. a shaker test) turned into quantities a model can be compared with. random: H1 transmissibility with coherence (Welch, Hann), the relative-motion FRF R = (T - 1)/(-w^2) in mm per m/s^2, its peak, the half-power damping and a single-mode fit of the complex R (f_n, zeta, gain), and the relative displacement in time (RMS, peak, share of time beyond a gap). sweep: the frequency measured from the base signal itself (analytic phase), split up and down at its turning point, in bins a lock-in on the base's phase gives the base, tip and relative fundamentals; the relative displacement amplitude against frequency, each direction's peak and jumps. stepped: levels found from the base's RMS, transients dropped, per level the base RMS and the relative displacement amplitude. Files: frf.csv, sweep.csv or steps.csv, plot.png (Python: NumPy, SciPy, matplotlib).",
   "runtime": "native",
   "timeout_s": 900,
   "estimate_s": 10,
   "inputs": [
    {
     "name": "kind",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": [
      "random",
      "sweep",
      "stepped"
     ],
     "description": "random: broadband (H1 and coherence); sweep: a slow sine sweep up and down; stepped: a fixed sine at increasing levels."
    },
    {
     "name": "data",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "A CSV time series, e.g. @rNNNN/01_random.csv from bench import: a time column and two accelerations."
    },
    {
     "name": "synthetic",
     "type": "object",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Instead of data, a test signal generated here with a known answer: {signal: random|chirp|envelope|steps, f_n_Hz, zeta, gain, ...} (see run.py)."
    },
    {
     "name": "time_column",
     "type": "string",
     "unit": null,
     "default": "time_s",
     "enum": null,
     "description": null
    },
    {
     "name": "base_column",
     "type": "string",
     "unit": null,
     "default": "acc_base_ms2",
     "enum": null,
     "description": "The base acceleration, m/s^2."
    },
    {
     "name": "response_column",
     "type": "string",
     "unit": null,
     "default": "acc_tip_ms2",
     "enum": null,
     "description": "The response (absolute) acceleration, m/s^2."
    },
    {
     "name": "nperseg",
     "type": "integer",
     "unit": null,
     "default": 32768,
     "enum": null,
     "description": "random: samples per Welch segment. The Hann main lobe (1.5/T) must be well under the resonance's half-power bandwidth or the peak is smoothed and the damping read high."
    },
    {
     "name": "overlap",
     "type": "number",
     "unit": "1",
     "default": 0.75,
     "enum": null,
     "description": null
    },
    {
     "name": "f_lo_Hz",
     "type": "number",
     "unit": "Hz",
     "default": 2,
     "enum": null,
     "description": "random: the band written to frf.csv."
    },
    {
     "name": "f_hi_Hz",
     "type": "number",
     "unit": "Hz",
     "default": 40,
     "enum": null,
     "description": null
    },
    {
     "name": "peak_search_Hz",
     "type": "array",
     "unit": "Hz",
     "default": null,
     "enum": null,
     "description": "random: [low, high] where the peak is looked for (default the written band)."
    },
    {
     "name": "fit_halfwidth_Hz",
     "type": "number",
     "unit": "Hz",
     "default": null,
     "enum": null,
     "description": "random: the single-mode fit uses the peak +- this (default 4 half-power bandwidths, at least 8 bins)."
    },
    {
     "name": "highpass_Hz",
     "type": "number",
     "unit": "Hz",
     "default": 3,
     "enum": null,
     "description": "random: the relative acceleration is integrated twice above this frequency."
    },
    {
     "name": "gap_check_mm",
     "type": "number",
     "unit": "mm",
     "default": 0.5,
     "enum": null,
     "description": "random: the share of time the relative displacement spends beyond this is reported."
    },
    {
     "name": "bandpass_Hz",
     "type": "array",
     "unit": "Hz",
     "default": [
      3,
      40
     ],
     "enum": null,
     "description": "sweep, stepped: the band the base is filtered to before its phase is taken."
    },
    {
     "name": "freq_window_s",
     "type": "number",
     "unit": "s",
     "default": 1.0,
     "enum": null,
     "description": "sweep, stepped: the instantaneous frequency is the slope of a least-squares line through the phase over this window."
    },
    {
     "name": "edge_s",
     "type": "number",
     "unit": "s",
     "default": 2.0,
     "enum": null,
     "description": "sweep: dropped at each end of the record (filter and phase edge effects)."
    },
    {
     "name": "bin_Hz",
     "type": "number",
     "unit": "Hz",
     "default": 0.05,
     "enum": null,
     "description": "sweep: the width of each frequency bin."
    },
    {
     "name": "jump_ratio",
     "type": "number",
     "unit": "1",
     "default": 1.25,
     "enum": null,
     "description": "sweep: adjacent bins whose relative displacement differs by more than this factor are a jump."
    },
    {
     "name": "label_range_Hz",
     "type": "array",
     "unit": "Hz",
     "default": null,
     "enum": null,
     "description": "sweep: the range a label claims; a warning says when the measured frequency disagrees."
    },
    {
     "name": "probe_Hz",
     "type": "array",
     "unit": "Hz",
     "default": null,
     "enum": null,
     "description": "sweep: frequencies whose bins are reported as readings (probe.up_10p5 ...)."
    },
    {
     "name": "window_s",
     "type": "number",
     "unit": "s",
     "default": 0.5,
     "enum": null,
     "description": "stepped: the base's RMS is taken in windows of this length."
    },
    {
     "name": "level_change",
     "type": "number",
     "unit": "1",
     "default": 0.1,
     "enum": null,
     "description": "stepped: a change of the base's log RMS by more than this, confirmed by the next window, starts a new level."
    },
    {
     "name": "min_level_s",
     "type": "number",
     "unit": "s",
     "default": 3,
     "enum": null,
     "description": null
    },
    {
     "name": "settle_fraction",
     "type": "number",
     "unit": "1",
     "default": 0.4,
     "enum": null,
     "description": "stepped: the first part of each level dropped as transient."
    }
   ],
   "outputs": [
    {
     "name": "kind",
     "unit": null,
     "description": null
    },
    {
     "name": "samples",
     "unit": "1",
     "description": null
    },
    {
     "name": "sample_rate_Hz",
     "unit": "Hz",
     "description": null
    },
    {
     "name": "duration_s",
     "unit": "s",
     "description": null
    },
    {
     "name": "base_rms_mps2",
     "unit": "m/s^2",
     "description": null
    },
    {
     "name": "response_rms_mps2",
     "unit": "m/s^2",
     "description": null
    },
    {
     "name": "nperseg",
     "unit": "1",
     "description": null
    },
    {
     "name": "overlap",
     "unit": "1",
     "description": null
    },
    {
     "name": "averages",
     "unit": "1",
     "description": null
    },
    {
     "name": "resolution_Hz",
     "unit": "Hz",
     "description": null
    },
    {
     "name": "peak_frequency_Hz",
     "unit": "Hz",
     "description": null
    },
    {
     "name": "peak_rel_mm_per_mps2",
     "unit": "mm/(m/s^2)",
     "description": null
    },
    {
     "name": "peak_transmissibility",
     "unit": "1",
     "description": null
    },
    {
     "name": "coherence_at_peak",
     "unit": "1",
     "description": null
    },
    {
     "name": "coherence_min_in_fit_band",
     "unit": "1",
     "description": null
    },
    {
     "name": "half_power_zeta",
     "unit": "1",
     "description": null
    },
    {
     "name": "half_power_Hz",
     "unit": "Hz",
     "description": null
    },
    {
     "name": "fit",
     "unit": null,
     "description": null
    },
    {
     "name": "window_bandwidth_ratio",
     "unit": "1",
     "description": null
    },
    {
     "name": "rel_disp_rms_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "rel_disp_peak_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "gap_check_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "time_beyond_gap_fraction",
     "unit": "1",
     "description": null
    },
    {
     "name": "truth_peak_Hz",
     "unit": "Hz",
     "description": null
    },
    {
     "name": "order",
     "unit": null,
     "description": null
    },
    {
     "name": "turnaround_s",
     "unit": "s",
     "description": null
    },
    {
     "name": "f_min_Hz",
     "unit": "Hz",
     "description": null
    },
    {
     "name": "f_max_Hz",
     "unit": "Hz",
     "description": null
    },
    {
     "name": "sweep_rate_Hz_per_min",
     "unit": "Hz/min",
     "description": null
    },
    {
     "name": "up",
     "unit": null,
     "description": null
    },
    {
     "name": "down",
     "unit": null,
     "description": null
    },
    {
     "name": "jump_up_Hz",
     "unit": "Hz",
     "description": null
    },
    {
     "name": "jump_down_Hz",
     "unit": "Hz",
     "description": null
    },
    {
     "name": "peak_mean_Hz",
     "unit": "Hz",
     "description": null
    },
    {
     "name": "bins",
     "unit": "1",
     "description": null
    },
    {
     "name": "bin_Hz",
     "unit": "Hz",
     "description": null
    },
    {
     "name": "probe",
     "unit": null,
     "description": null
    },
    {
     "name": "frequency_Hz",
     "unit": "Hz",
     "description": null
    },
    {
     "name": "levels",
     "unit": "1",
     "description": null
    },
    {
     "name": "max_rel_disp_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "steps",
     "unit": null,
     "description": null
    },
    {
     "name": "synthetic",
     "unit": null,
     "description": null
    },
    {
     "name": "warnings",
     "unit": null,
     "description": null
    },
    {
     "name": "ok",
     "unit": null,
     "description": null
    },
    {
     "name": "frf.csv",
     "unit": null,
     "description": null
    },
    {
     "name": "sweep.csv",
     "unit": null,
     "description": null
    },
    {
     "name": "steps.csv",
     "unit": null,
     "description": null
    },
    {
     "name": "plot.png",
     "unit": null,
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "random, a linear oscillator f_n 13.3 Hz, zeta 0.014, gain 0.93 (exact lsim response to band-limited noise, 100 s at 1024 Hz), 32 s Hann segments: the single-mode fit gives f_n to 1e-3, zeta to 3 % (the Hann main lobe, 0.047 Hz, smooths a 0.37 Hz-wide peak: about +1 % bias, 0.3 % scatter over seeds), gain to 1 %; the peak of |R| is at f_n sqrt(1 - 2 zeta^2) = 13.2974 Hz to 0.01 Hz (a third of a bin), the half-power damping to 5 %",
     "checks": [
      "base_rms_mps2",
      "coherence_at_peak",
      "fit.f_n_Hz",
      "fit.gain",
      "fit.zeta",
      "half_power_zeta",
      "peak_frequency_Hz"
     ]
    },
    {
     "name": "random, f_n 18 Hz, zeta 0.03, gain 1.2, with sensor noise 0.2 m/s^2 RMS on the response: fit f_n to 1e-3, zeta to 3 %, gain to 1 %; half-power damping to 5 %",
     "checks": [
      "fit.f_n_Hz",
      "fit.gain",
      "fit.zeta",
      "half_power_zeta"
     ]
    },
    {
     "name": "chirp 10 -> 16 -> 10 Hz at 1.17 Hz/min, 0.17 m/s^2 amplitude, on the same oscillator (exact lsim response): the frequency measured from the base turns at 16 Hz (to 0.01 Hz) and sweeps at 1.17 Hz/min (to 0.2 %); the base RMS is 0.17/sqrt(2) (to 1e-3); at 10.475 Hz, away from resonance, the relative displacement is the steady-state |R| A = 0.059525 mm (to 0.3 %); the mean of the up and down peaks is at 13.2974 Hz (to 0.02 Hz) and the peaks are the steady-state 0.80864 mm to 2 % (a finite sweep rate lowers and shifts them: about 1 % here); no jump",
     "checks": [
      "base_rms_mps2",
      "down.peak_mm",
      "f_max_Hz",
      "jump_down_Hz",
      "jump_up_Hz",
      "peak_mean_Hz",
      "probe.up_10p5.rel_disp_amp_mm",
      "sweep_rate_Hz_per_min",
      "up.peak_mm"
     ]
    },
    {
     "name": "a prescribed envelope with jumps (relative displacement 1.0 mm below 14.2 Hz on the way up, 0.3 mm above; on the way down 0.3 mm above 13.6 Hz, 1.0 mm below): the jumps located to one bin (0.05 Hz), the amplitudes either side to 1e-3",
     "checks": [
      "down.jump_from_mm",
      "down.jump_to_mm",
      "jump_down_Hz",
      "jump_up_Hz",
      "up.jump_to_mm",
      "up.peak_mm"
     ]
    },
    {
     "name": "stepped sine at 13 Hz, four levels of 10 s (0.05, 0.1, 0.2, 0.4 m/s^2 RMS, 0.2 s ramps) on the same oscillator (exact lsim response, transients included): four levels found, the frequency to 0.002 Hz, level 3's base RMS to 1e-3 and its relative displacement the steady-state |R(13 Hz)| A = 0.71979 mm to 0.5 % (the transient left after dropping 40 % of the level decays to under 1 %)",
     "checks": [
      "frequency_Hz",
      "levels",
      "steps.l03.base_accel_rms_mps2",
      "steps.l03.rel_disp_amp_mm"
     ]
    }
   ],
   "title": "Measured response",
   "needs_build": true,
   "category": "Measurement and data",
   "known_answers": 30
  },
  {
   "name": "modal_chain",
   "version": "0.1.0",
   "summary": "Undamped modes of a spring-mass chain with n degrees of freedom (fixed-fixed, fixed-free or free-free; uniform or per-element masses and stiffnesses): natural frequencies, mode shapes, participation factors and effective modal masses for base excitation. One-sided Jacobi SVD of K^1/2-weighted incidence matrix; every result checked against K and M.",
   "runtime": "native",
   "timeout_s": 30,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "boundary",
     "type": "string",
     "unit": "1",
     "default": "fixed_free",
     "enum": [
      "fixed_fixed",
      "fixed_free",
      "free_free"
     ],
     "description": "Ends of the chain. fixed_fixed: wall-m1 ... mn-wall (n+1 springs); fixed_free: wall-m1 ... m(n-1)-mn (n springs); free_free: m1-m2 ... m(n-1)-mn (n-1 springs). Base excitation moves every wall together."
    },
    {
     "name": "n",
     "type": "integer",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "Number of masses. Leave out when masses_kg or stiffnesses_N_per_m is given (the list sets it); 3 when nothing sets it."
    },
    {
     "name": "mass_kg",
     "type": "number",
     "unit": "kg",
     "default": 1.0,
     "enum": null,
     "description": "Every mass, for a uniform chain (ignored when masses_kg is given)."
    },
    {
     "name": "stiffness_N_per_m",
     "type": "number",
     "unit": "N/m",
     "default": 1000.0,
     "enum": null,
     "description": "Every spring, for a uniform chain (ignored when stiffnesses_N_per_m is given)."
    },
    {
     "name": "masses_kg",
     "type": "array",
     "unit": "kg",
     "default": [],
     "enum": null,
     "description": "Per-element masses from the left end; empty means uniform mass_kg."
    },
    {
     "name": "stiffnesses_N_per_m",
     "type": "array",
     "unit": "N/m",
     "default": [],
     "enum": null,
     "description": "Per-element springs from the left end, walls included (see boundary); empty means uniform stiffness_N_per_m."
    },
    {
     "name": "modes_listed",
     "type": "integer",
     "unit": "1",
     "default": 10,
     "enum": null,
     "description": "How many modes go in the 'modes' table and 'mode_shapes' (all modes are always in out/modes.csv and out/mode_shapes.csv)."
    }
   ],
   "outputs": [
    {
     "name": "boundary",
     "unit": "1",
     "description": null
    },
    {
     "name": "n_dof",
     "unit": "1",
     "description": null
    },
    {
     "name": "n_springs",
     "unit": "1",
     "description": null
    },
    {
     "name": "total_mass_kg",
     "unit": "kg",
     "description": null
    },
    {
     "name": "omega_rad_per_s",
     "unit": "rad/s",
     "description": "Natural circular frequencies, lowest first."
    },
    {
     "name": "frequency_Hz",
     "unit": "Hz",
     "description": null
    },
    {
     "name": "period_s",
     "unit": "s",
     "description": "null for a rigid-body mode."
    },
    {
     "name": "fundamental_omega_rad_per_s",
     "unit": "rad/s",
     "description": "Lowest non-zero mode."
    },
    {
     "name": "fundamental_frequency_Hz",
     "unit": "Hz",
     "description": null
    },
    {
     "name": "fundamental_period_s",
     "unit": "s",
     "description": null
    },
    {
     "name": "fundamental_mass_fraction",
     "unit": "1",
     "description": null
    },
    {
     "name": "highest_frequency_Hz",
     "unit": "Hz",
     "description": null
    },
    {
     "name": "rigid_body_modes",
     "unit": "1",
     "description": null
    },
    {
     "name": "effective_mass_kg",
     "unit": "kg",
     "description": "(phi^T M 1)^2 / (phi^T M phi), influence vector all ones."
    },
    {
     "name": "effective_mass_fraction",
     "unit": "1",
     "description": null
    },
    {
     "name": "cumulative_mass_fraction",
     "unit": "1",
     "description": null
    },
    {
     "name": "effective_mass_sum_kg",
     "unit": "kg",
     "description": null
    },
    {
     "name": "participation_factor",
     "unit": "1",
     "description": "phi^T M 1 / phi^T M phi with the shape scaled to largest component 1."
    },
    {
     "name": "modes_for_90_pct_mass",
     "unit": "1",
     "description": null
    },
    {
     "name": "rms_omega_rad_per_s",
     "unit": "rad/s",
     "description": null
    },
    {
     "name": "geometric_mean_omega_rad_per_s",
     "unit": "rad/s",
     "description": null
    },
    {
     "name": "mode_shapes",
     "unit": "1",
     "description": "Per listed mode, the displacement of each mass, largest component 1."
    },
    {
     "name": "sign_changes",
     "unit": "1",
     "description": null
    },
    {
     "name": "oscillation_ok",
     "unit": "1",
     "description": null
    },
    {
     "name": "max_residual",
     "unit": "1",
     "description": null
    },
    {
     "name": "orthogonality_error",
     "unit": "1",
     "description": null
    },
    {
     "name": "trace_error",
     "unit": "1",
     "description": null
    },
    {
     "name": "mass_sum_error",
     "unit": "1",
     "description": null
    },
    {
     "name": "jacobi_sweeps",
     "unit": "1",
     "description": null
    },
    {
     "name": "checks_ok",
     "unit": "1",
     "description": null
    },
    {
     "name": "warnings",
     "unit": "1",
     "description": null
    },
    {
     "name": "modes",
     "unit": "1",
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "uniform fixed-fixed n=5, k=1000 N/m, m=1 kg: w_j = 2 sqrt(k/m) sin(j pi/(2(n+1))) (closed form); shape sin(i j pi/(n+1)) gives m_eff,1 = 2m cot^2(pi/12)/(n+1), m_eff,2 = 0 by symmetry; rel 1e-9",
     "checks": [
      "checks_ok",
      "effective_mass_kg.0",
      "effective_mass_kg.1",
      "effective_mass_sum_kg",
      "omega_rad_per_s.0",
      "omega_rad_per_s.4",
      "rigid_body_modes"
     ]
    },
    {
     "name": "uniform fixed-fixed n=50, k=1000 N/m, m=1 kg: lowest and highest of w_j = 2 sqrt(k/m) sin(j pi/(2(n+1))) (closed form; rel 1e-8 for 50x50 rounding)",
     "checks": [
      "checks_ok",
      "effective_mass_sum_kg",
      "omega_rad_per_s.0",
      "omega_rad_per_s.49"
     ]
    },
    {
     "name": "uniform fixed-free n=4, k=400 N/m, m=2 kg: w_j = 2 sqrt(k/m) sin((2j-1) pi/(2(2n+1))) (closed form, w_2 = sqrt(200) exactly); shape sin(i pi/(2n+1)) gives m_eff,1 = 7.1474305506 kg; rel 1e-9",
     "checks": [
      "effective_mass_kg.0",
      "effective_mass_sum_kg",
      "omega_rad_per_s.0",
      "omega_rad_per_s.1",
      "omega_rad_per_s.2",
      "omega_rad_per_s.3"
     ]
    },
    {
     "name": "two equal masses fixed-free (m=2 kg, k=800 N/m): w^2 = (3 -+ sqrt 5)/2 k/m (closed form); shape (1, golden ratio) gives m_eff = m(1 +- 2/sqrt 5); rel 1e-9",
     "checks": [
      "effective_mass_kg.0",
      "effective_mass_kg.1",
      "mode_shapes.0.0",
      "mode_shapes.0.1",
      "omega_rad_per_s.0",
      "omega_rad_per_s.1"
     ]
    },
    {
     "name": "per-element fixed-free, m=[2,1] kg, k=[300 (wall), 100] N/m: m1 m2 w^4 - (m1 k2 + m2(k1+k2)) w^2 + k1 k2 = 0 gives w^2 = 150 -+ sqrt 7500 (exact quadratic); rel 1e-9",
     "checks": [
      "effective_mass_sum_kg",
      "omega_rad_per_s.0",
      "omega_rad_per_s.1"
     ]
    },
    {
     "name": "free-free m=[1,3] kg, k=300 N/m: one zero mode carrying the total mass, w = sqrt(k(1/m1+1/m2)) = 20 rad/s (exact); zero mode abs 1e-9 rad/s",
     "checks": [
      "effective_mass_kg.0",
      "effective_mass_kg.1",
      "omega_rad_per_s.0",
      "omega_rad_per_s.1",
      "rigid_body_modes"
     ]
    },
    {
     "name": "uniform free-free n=6, k=250 N/m, m=0.5 kg: w_j = 2 sqrt(k/m) sin(j pi/(2n)), j=0..n-1 (closed form); one zero mode; rel 1e-9",
     "checks": [
      "effective_mass_kg.0",
      "effective_mass_sum_kg",
      "omega_rad_per_s.0",
      "omega_rad_per_s.1",
      "omega_rad_per_s.5",
      "rigid_body_modes"
     ]
    }
   ],
   "title": "Spring-mass chain modes",
   "needs_build": true,
   "category": "Dynamics and control",
   "known_answers": 37
  },
  {
   "name": "molecule",
   "version": "0.1.0",
   "summary": "Molecules from SMILES, one per line with an optional name after a space: molecular formula, average mass (g/mol), monoisotopic mass (Da), Crippen logP, TPSA, Lipinski counts. Files: molecules.csv, library.sdf (2D coordinates). Chemistry core from PotionCraft.",
   "runtime": "native",
   "timeout_s": 60,
   "estimate_s": 0.1,
   "inputs": [
    {
     "name": "smiles",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "SMILES, one per line; an optional name follows after whitespace. Lines starting with # are skipped."
    }
   ],
   "outputs": [
    {
     "name": "count",
     "unit": null,
     "description": null
    },
    {
     "name": "formula",
     "unit": null,
     "description": null
    },
    {
     "name": "mw",
     "unit": "g/mol",
     "description": null
    },
    {
     "name": "exact_mass",
     "unit": "Da",
     "description": null
    },
    {
     "name": "molecules",
     "unit": null,
     "description": null
    },
    {
     "name": "molecules.csv",
     "unit": null,
     "description": null
    },
    {
     "name": "library.sdf",
     "unit": null,
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "aspirin: C9H8O4, 180.159 g/mol, 180.042259 Da",
     "checks": [
      "exact_mass",
      "formula",
      "mw"
     ]
    },
    {
     "name": "caffeine: C8H10N4O2, 194.19 g/mol, 194.080376 Da",
     "checks": [
      "exact_mass",
      "formula",
      "mw"
     ]
    }
   ],
   "title": "Molecules",
   "needs_build": true,
   "category": "Chemistry",
   "known_answers": 6
  },
  {
   "name": "molecule3d",
   "version": "0.1.0",
   "summary": "Molecules in 3D from SMILES (one per line, optional name after a space): an RDKit ETKDG conformer minimised with MMFF94 (UFF when MMFF lacks parameters), seeded so replays agree. Readings: energy (kcal/mol), atom counts, heavy-atom bond lengths, ring planarity. Files: scene.glb (ball and stick, angstroms), molecules3d.sdf (3D coordinates).",
   "runtime": "native",
   "timeout_s": 300,
   "estimate_s": 3,
   "inputs": [
    {
     "name": "smiles",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "SMILES, one per line; an optional name follows after a space."
    },
    {
     "name": "forcefield",
     "type": "string",
     "unit": null,
     "default": "mmff",
     "enum": [
      "mmff",
      "uff"
     ],
     "description": null
    },
    {
     "name": "seed",
     "type": "integer",
     "unit": null,
     "default": 42,
     "enum": null,
     "description": null
    },
    {
     "name": "max_iterations",
     "type": "integer",
     "unit": null,
     "default": 2000,
     "enum": null,
     "description": null
    }
   ],
   "outputs": [
    {
     "name": "energy_kcal_mol",
     "unit": "kcal/mol",
     "description": null
    },
    {
     "name": "heavy_bond_mean",
     "unit": "\u00c5",
     "description": null
    },
    {
     "name": "planarity_rms",
     "unit": "\u00c5",
     "description": null
    },
    {
     "name": "scene.glb",
     "unit": null,
     "description": null
    },
    {
     "name": "molecules3d.sdf",
     "unit": null,
     "description": null
    },
    {
     "name": "heavy_bond_min",
     "unit": "\u00c5",
     "description": null
    },
    {
     "name": "heavy_bond_max",
     "unit": "\u00c5",
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "ethane: the C-C bond is a single bond, 1.50-1.55 \u00c5 after MMFF94; 8 atoms with hydrogens",
     "checks": [
      "atoms",
      "heavy_bond_min"
     ]
    },
    {
     "name": "benzene: a flat ring (heavy atoms within 0.01 \u00c5 of one plane), C-C 1.38-1.41 \u00c5",
     "checks": [
      "heavy_bond_max",
      "heavy_bond_min",
      "planarity_rms"
     ]
    }
   ],
   "title": "Molecules in 3D",
   "needs_build": true,
   "category": "Chemistry",
   "known_answers": 5
  },
  {
   "name": "motif_scan",
   "version": "0.1.0",
   "summary": "Scans DNA/RNA sequences against a Position Frequency Matrix (PFM / JASPAR format) converted to a log-odds PWM: information content (bits), forward & reverse-complement binding site hits, and relative scores.",
   "runtime": "native",
   "timeout_s": 30,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "sequence",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "pfm",
     "type": "object",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Object with A, C, G, T arrays of equal length."
    },
    {
     "name": "pseudocount",
     "type": "number",
     "unit": "1",
     "default": 0.5,
     "enum": null,
     "description": null
    },
    {
     "name": "min_rel_score",
     "type": "number",
     "unit": "1",
     "default": 0.8,
     "enum": null,
     "description": null
    },
    {
     "name": "scan_both_strands",
     "type": "boolean",
     "unit": null,
     "default": true,
     "enum": null,
     "description": null
    }
   ],
   "outputs": [
    {
     "name": "motif_width",
     "unit": "1",
     "description": null
    },
    {
     "name": "information_content_bits",
     "unit": "1",
     "description": null
    },
    {
     "name": "hit_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "top_rel_score",
     "unit": "1",
     "description": null
    },
    {
     "name": "top_position",
     "unit": "1",
     "description": null
    },
    {
     "name": "hits",
     "unit": null,
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "exact TATA-box TATAAA at position 6 gives 1 hit with rel_score = 1.0",
     "checks": [
      "hit_count",
      "information_content_bits",
      "top_position",
      "top_rel_score"
     ]
    }
   ],
   "title": "TFBS motif PWM scan",
   "needs_build": true,
   "category": "Genomics",
   "known_answers": 4
  },
  {
   "name": "nernst_cell",
   "version": "0.1.0",
   "summary": "Electrochemical cell thermodynamics: two half-reactions (standard reduction potentials as inputs), electrons, activities, pH and temperature give the standard and actual cell voltage (Nernst), free energy and equilibrium constant; a temperature coefficient gives entropy, enthalpy and thermoneutral voltage; Faraday's law gives charge, mass and specific capacity for electrolysis.",
   "runtime": "native",
   "timeout_s": 30,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "e_cathode_V",
     "type": "number",
     "unit": "V",
     "default": 0.34,
     "enum": null,
     "description": "Standard REDUCTION potential of the half-reaction that is reduced (cathode), against the standard hydrogen electrode, at reference_temperature_C. Default: Cu2+/Cu."
    },
    {
     "name": "e_anode_V",
     "type": "number",
     "unit": "V",
     "default": -0.76,
     "enum": null,
     "description": "Standard REDUCTION potential of the half-reaction that is oxidised (anode), same reference. Default: Zn2+/Zn. The cell is E0 = e_cathode_V - e_anode_V; for a concentration cell give both the same value."
    },
    {
     "name": "n_electrons",
     "type": "number",
     "unit": "1",
     "default": 2,
     "enum": null,
     "description": "Electrons transferred in the balanced cell reaction as written."
    },
    {
     "name": "temperature_C",
     "type": "number",
     "unit": null,
     "default": 25,
     "enum": null,
     "description": "Cell temperature, degrees Celsius."
    },
    {
     "name": "reference_temperature_C",
     "type": "number",
     "unit": null,
     "default": 25,
     "enum": null,
     "description": "Temperature the standard potentials are tabulated at, degrees Celsius."
    },
    {
     "name": "e_temp_coeff_mV_per_K",
     "type": "number",
     "unit": "mV/K",
     "default": null,
     "enum": null,
     "description": "Optional temperature coefficient dE0/dT of the cell. When given, E0 is moved linearly from the reference temperature and dS0 = n F dE0/dT, dH0 and the thermoneutral voltage are reported. Left out: E0 is used as given and those readings are null."
    },
    {
     "name": "reaction_quotient",
     "type": "number",
     "unit": "1",
     "default": 1,
     "enum": null,
     "description": "Reaction quotient Q (products over reactants) of the cell reaction, greater than 0. Multiplied with the activity lists and the pH term when those are given too."
    },
    {
     "name": "product_activities",
     "type": "array",
     "unit": null,
     "default": [],
     "enum": null,
     "description": "Activities of the products of the cell reaction (each > 0; pure solids and liquids are 1 and may be left out)."
    },
    {
     "name": "product_powers",
     "type": "array",
     "unit": null,
     "default": [],
     "enum": null,
     "description": "Stoichiometric power of each product activity; empty means 1 for each."
    },
    {
     "name": "reactant_activities",
     "type": "array",
     "unit": null,
     "default": [],
     "enum": null,
     "description": "Activities of the reactants of the cell reaction (each > 0)."
    },
    {
     "name": "reactant_powers",
     "type": "array",
     "unit": null,
     "default": [],
     "enum": null,
     "description": "Stoichiometric power of each reactant activity; empty means 1 for each."
    },
    {
     "name": "protons",
     "type": "number",
     "unit": "1",
     "default": 0,
     "enum": null,
     "description": "Number of H+ on the reactant side of the cell reaction as written (negative when H+ is a product). With ph it adds protons * pH to log10 Q; do not also list H+ among the activities."
    },
    {
     "name": "ph",
     "type": "number",
     "unit": "1",
     "default": 0,
     "enum": null,
     "description": "pH of the solution the protons come from (0 is the standard state)."
    },
    {
     "name": "current_A",
     "type": "number",
     "unit": "A",
     "default": 1,
     "enum": null,
     "description": "Electrolysis or discharge current (magnitude)."
    },
    {
     "name": "time_s",
     "type": "number",
     "unit": "s",
     "default": 3600,
     "enum": null,
     "description": "Duration the current flows."
    },
    {
     "name": "molar_mass_g_per_mol",
     "type": "number",
     "unit": "g/mol",
     "default": 63.546,
     "enum": null,
     "description": "Molar mass of the deposited, dissolved or evolved product. Default: copper."
    },
    {
     "name": "electrons_per_product",
     "type": "number",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "Electrons per formula unit of that product (z in Faraday's law). Left out: n_electrons."
    },
    {
     "name": "current_efficiency",
     "type": "number",
     "unit": "1",
     "default": 1,
     "enum": null,
     "description": "Fraction of the charge that makes the product."
    }
   ],
   "outputs": [
    {
     "name": "e_standard_V",
     "unit": "V",
     "description": "Standard cell voltage at the cell temperature: e_cathode_V - e_anode_V, moved by the temperature coefficient when given."
    },
    {
     "name": "e_cell_V",
     "unit": "V",
     "description": "Cell voltage E = E0 - (R T / n F) ln Q."
    },
    {
     "name": "e_formal_at_ph_V",
     "unit": "V",
     "description": "Cell voltage at the given pH with every other activity at 1."
    },
    {
     "name": "nernst_slope_mV",
     "unit": "mV",
     "description": "R T ln10 / F: volts per decade of Q for one electron."
    },
    {
     "name": "nernst_slope_per_n_mV",
     "unit": "mV",
     "description": "R T ln10 / (n F)."
    },
    {
     "name": "thermal_voltage_mV",
     "unit": "mV",
     "description": "R T / F."
    },
    {
     "name": "ph_slope_mV_per_pH",
     "unit": "mV",
     "description": "Change of the cell voltage per pH unit: -(protons / n) R T ln10 / F."
    },
    {
     "name": "log10_q",
     "unit": "1",
     "description": null
    },
    {
     "name": "reaction_quotient",
     "unit": "1",
     "description": "Q; null when outside what a double holds (read log10_q)."
    },
    {
     "name": "dg_standard_kJ_per_mol",
     "unit": "kJ/mol",
     "description": "-n F E0."
    },
    {
     "name": "dg_kJ_per_mol",
     "unit": "kJ/mol",
     "description": "-n F E."
    },
    {
     "name": "log10_k",
     "unit": "1",
     "description": "n F E0 / (R T ln10)."
    },
    {
     "name": "ln_k",
     "unit": "1",
     "description": null
    },
    {
     "name": "equilibrium_constant",
     "unit": "1",
     "description": "K; null when outside what a double holds (read log10_k)."
    },
    {
     "name": "spontaneous",
     "unit": null,
     "description": "true when E > 0: the reaction runs as written (galvanic)."
    },
    {
     "name": "direction",
     "unit": null,
     "description": "forward, reverse or equilibrium."
    },
    {
     "name": "ds_standard_J_per_mol_K",
     "unit": "J/(mol K)",
     "description": "n F dE0/dT; null without a temperature coefficient."
    },
    {
     "name": "dh_standard_kJ_per_mol",
     "unit": "kJ/mol",
     "description": "dG0 + T dS0; null without a temperature coefficient."
    },
    {
     "name": "thermoneutral_voltage_V",
     "unit": "V",
     "description": "-dH0 / (n F); null without a temperature coefficient."
    },
    {
     "name": "thermodynamic_efficiency",
     "unit": "1",
     "description": "dG0 / dH0; null without a temperature coefficient."
    },
    {
     "name": "temperature_K",
     "unit": "K",
     "description": null
    },
    {
     "name": "faraday_C_per_mol",
     "unit": "C/mol",
     "description": "e N_A from the exact SI values."
    },
    {
     "name": "gas_constant_J_per_mol_K",
     "unit": "J/(mol K)",
     "description": "k N_A from the exact SI values."
    },
    {
     "name": "charge_C",
     "unit": "C",
     "description": null
    },
    {
     "name": "charge_Ah",
     "unit": "A h",
     "description": null
    },
    {
     "name": "electrons_mol",
     "unit": "mol",
     "description": null
    },
    {
     "name": "product_mol",
     "unit": "mol",
     "description": null
    },
    {
     "name": "mass_g",
     "unit": "g",
     "description": "I t M eta / (z F)."
    },
    {
     "name": "specific_capacity_mAh_per_g",
     "unit": "mA h/g",
     "description": "z F / (3.6 M): theoretical capacity of the product."
    },
    {
     "name": "reversible_energy_Wh",
     "unit": "W h",
     "description": "|E| times the charge passed: the least electrical work to drive, or the most to draw."
    },
    {
     "name": "specific_energy_Wh_per_kg",
     "unit": "W h/kg",
     "description": "|E| times the specific capacity, per kg of product."
    },
    {
     "name": "warnings",
     "unit": null,
     "description": "Things the reader should know about how the inputs were read."
    }
   ],
   "selftests": [
    {
     "name": "Daniell cell, spec known answer: Cu2+/Cu +0.34 V, Zn2+/Zn -0.76 V, n=2, 25 C -> E0 = 1.10 V, dG0 = -nFE0 = -212.27 kJ/mol, log10 K = nFE0/(RT ln10) = 37.19 (closed forms with exact SI e, k, N_A; rel 1e-9)",
     "checks": [
      "dg_standard_kJ_per_mol",
      "e_cell_V",
      "e_standard_V",
      "ln_k",
      "log10_k",
      "spontaneous"
     ]
    },
    {
     "name": "Nernst slope, spec known answer: R T ln10 / F = 59.159 mV and R T / F = 25.693 mV at 298.15 K; F = e N_A = 96485.33212 C/mol, R = k N_A = 8.314462618 J/mol/K (CODATA exact; rel 1e-9)",
     "checks": [
      "faraday_C_per_mol",
      "gas_constant_J_per_mol_K",
      "nernst_slope_mV",
      "temperature_K",
      "thermal_voltage_mV"
     ]
    },
    {
     "name": "Concentration cell, spec known answer: same half-cell both sides, activities 1.0 (cathode) and 0.1 (anode), n=1, 25 C -> E0 = 0, E = (RT ln10/F) log10(10) = 59.16 mV (closed form; rel 1e-9)",
     "checks": [
      "e_cell_V",
      "e_standard_V",
      "log10_q",
      "spontaneous"
     ]
    },
    {
     "name": "Hydrogen electrode against SHE, spec known answer: 2H+ + 2e- -> H2 moves -59.16 mV per pH unit; at pH 7 E = -7 RT ln10/F = -0.4141 V (closed form; rel 1e-9)",
     "checks": [
      "e_cell_V",
      "e_formal_at_ph_V",
      "log10_q",
      "ph_slope_mV_per_pH",
      "spontaneous"
     ]
    },
    {
     "name": "Faraday's law, spec known answer: 1 A for 1 h, M = 63.546 g/mol, z = 2 -> m = I t M/(z F) = 1.1855 g, 3600 C = 1 Ah, 0.037311 mol of electrons (closed form; rel 1e-9)",
     "checks": [
      "charge_Ah",
      "charge_C",
      "electrons_mol",
      "mass_g",
      "product_mol"
     ]
    },
    {
     "name": "Daniell cell off standard, textbook exercise: a(Cu2+) = 0.01, a(Zn2+) = 1, n=2, 25 C -> Q = 100, E = 1.10 - (0.059159/2) * 2 = 1.0408 V, dG = -nFE = -200.85 kJ/mol (closed form; rel 1e-9)",
     "checks": [
      "dg_kJ_per_mol",
      "e_cell_V",
      "log10_q"
     ]
    },
    {
     "name": "Oxygen electrode at pH 7, textbook value E0' = +0.815 V: O2 + 4H+ + 4e- -> 2H2O, E0 = 1.229 V, protons = 4, n = 4 -> 1.229 - 7 * 0.059159 = 0.81488 V, slope -59.16 mV/pH (closed form; rel 1e-9)",
     "checks": [
      "e_cell_V",
      "ph_slope_mV_per_pH"
     ]
    },
    {
     "name": "Hydrogen-oxygen cell against thermochemical tables (CODATA key values for liquid water: dfG0 = -237.13, dfH0 = -285.83 kJ/mol, dS0 = -163.3 J/mol/K; thermoneutral 1.481 V, ideal efficiency 0.83). Tolerance 0.1 % because the inputs E0 = 1.229 V and dE0/dT = -0.846 mV/K are rounded to 4 and 3 digits",
     "checks": [
      "dg_standard_kJ_per_mol",
      "dh_standard_kJ_per_mol",
      "ds_standard_J_per_mol_K",
      "thermodynamic_efficiency",
      "thermoneutral_voltage_V"
     ]
    },
    {
     "name": "Temperature: at 80 C the slope is R T ln10/F = 70.0725 mV (T = 353.15 K) and E0 moves linearly, 1.229 - 0.000846 * 55 = 1.18247 V; dS0 = n F dE0/dT = -163.2532 J/mol/K (closed forms; rel 1e-9)",
     "checks": [
      "dh_standard_kJ_per_mol",
      "ds_standard_J_per_mol_K",
      "e_standard_V",
      "nernst_slope_mV"
     ]
    },
    {
     "name": "Specific capacity of lithium metal, textbook value 3860 mAh/g: z F/(3.6 M) with M = 6.94 g/mol (IUPAC abridged), z = 1 -> 3861.88 mAh/g (closed form; rel 1e-9)",
     "checks": [
      "specific_capacity_mAh_per_g"
     ]
    }
   ],
   "title": "Electrochemical cell: Nernst voltage and Faraday's law",
   "needs_build": true,
   "category": "Electrochemistry and batteries",
   "known_answers": 40
  },
  {
   "name": "neutral_loss",
   "version": "0.1.0",
   "summary": "Screens a singly-charged MS2 spectrum for curated literature neutral losses (H2O, CO, CO2, NH3, ketene, sulfate, phosphate, hexose, glucuronide, etc.) within a Da tolerance.",
   "runtime": "native",
   "timeout_s": 30,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "precursor_mz",
     "type": "number",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "peaks",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Fragment peaks as [[mz, intensity], ...]."
    },
    {
     "name": "tol_da",
     "type": "number",
     "unit": "Da",
     "default": 0.01,
     "enum": null,
     "description": null
    }
   ],
   "outputs": [
    {
     "name": "match_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "top_loss_formula",
     "unit": null,
     "description": null
    },
    {
     "name": "matches",
     "unit": null,
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "aspirin [M-H]- 179.0350 -> fragment 137.0244 identifies ketene (C2H2O) loss",
     "checks": [
      "match_count",
      "top_loss_formula"
     ]
    }
   ],
   "title": "MS2 neutral loss lookup",
   "needs_build": true,
   "category": "Mass spectrometry",
   "known_answers": 2
  },
  {
   "name": "optics",
   "version": "0.1.0",
   "summary": "Light on small spheres in a box: narrow Gaussian beams from projectors outside light chosen spheres among many (a volumetric display of held beads). Per beam, the exact fraction on the target through the spheres in front (offset-disc Gaussian, noncentral chi-square), the spill onto spheres behind (crosstalk) and the beam that ends on a board or leaves through a tinted wall (eye safety, peak mW). Brightness of each sphere toward each eye (Lambertian sphere mixed with isotropic scattering, phase angle per source), covering by spheres in front (angular disc overlap) and by opaque boards, room light through tinted walls with front-surface reflection and ports, heat (conduction to still air) and light force against the sphere's grip. Pictures from chosen eyes at true angular size. Files: spheres.csv, eyes.csv, view_<eye>.png, scene.glb (Python: NumPy, SciPy, matplotlib).",
   "runtime": "native",
   "timeout_s": 1800,
   "estimate_s": 10,
   "inputs": [
    {
     "name": "mode",
     "type": "string",
     "unit": null,
     "default": "display",
     "enum": [
      "display",
      "beam",
      "sphere",
      "poisson",
      "walls",
      "pair"
     ],
     "description": "display: the design mode. The others are known-answer checks (see run.py)."
    },
    {
     "name": "sites",
     "type": "array",
     "unit": "mm",
     "default": null,
     "enum": null,
     "description": "Sphere centres [[x, y, z], ...] in mm (or give sites_file)."
    },
    {
     "name": "sites_file",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "A CSV with x_mm, y_mm, z_mm columns, e.g. a levitator run's traps.csv: \"@r2126/traps.csv\". Row order = site index."
    },
    {
     "name": "sphere",
     "type": "object",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "radius_mm (0.5), albedo (0.95), isotropic_fraction (0: Lambertian sphere; 1: isotropic scatterer), absorbed_fraction (0.05), density_kg_m3 (25), grip_g (the weakest sideways grip, in g, for the light-force ratio)."
    },
    {
     "name": "beam",
     "type": "object",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "waist_mm (1/e^2 radius at the spheres, 0.4), pointing_error_mm (aim miss, worst case, 0), reach_min (a projector serves a sphere only if at least this fraction of its beam lands on it, 0.5), per_sphere (up to this many projectors per lit sphere, 3), exit_limit_mW (optional: also refuse a projector whose escaping beam would exceed this)."
    },
    {
     "name": "box",
     "type": "object",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "board_z_mm (boards at +-), board_hx_mm, board_hy_mm (half sizes), wall_x_mm, wall_y_mm (walls at +-), wall_transmittance (luminous, one pass), wall_index (1.49 acrylic), port_fraction (clear area of the walls), board_reflectance."
    },
    {
     "name": "room",
     "type": "object",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "illuminance_lx (300; lux, not in the kernel's unit table), reflectance (0.5) of the room's surfaces."
    },
    {
     "name": "projectors",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "[{name, position_mm: [x, y, z] outside the walls, power_mW (optical, 20), efficacy_lm_W (luminous efficacy of its light, 250), scan: vector (one beam steered from sphere to sphere) | raster (a frame), dwell_efficiency (vector, 0.8), frame_area_mm2 (raster)}]"
    },
    {
     "name": "lit",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Indices of the lit sites (the image)."
    },
    {
     "name": "colors",
     "type": "object",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "For pictures: {\"<site>\": [r, g, b] 0-1, \"default\": [...]}"
    },
    {
     "name": "eyes",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "[{name, group, position_mm: [x, y, z]}]: where people look from."
    },
    {
     "name": "render_eyes",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Names of the eyes to draw a picture from."
    },
    {
     "name": "seen_min",
     "type": "number",
     "unit": "1",
     "default": 0.5,
     "enum": null,
     "description": "A lit sphere counts as seen if at least this fraction of it is uncovered..."
    },
    {
     "name": "phase_min",
     "type": "number",
     "unit": "1",
     "default": 0.25,
     "enum": null,
     "description": "...and it is at least this fraction as bright toward the eye as head-on."
    },
    {
     "name": "fov_deg",
     "type": "number",
     "unit": "deg",
     "default": 34,
     "enum": null,
     "description": null
    },
    {
     "name": "air_conductivity_W_mK",
     "type": "number",
     "unit": "W/(m K)",
     "default": 0.0262,
     "enum": null,
     "description": null
    },
    {
     "name": "nusselt",
     "type": "number",
     "unit": "1",
     "default": 2.0,
     "enum": null,
     "description": null
    },
    {
     "name": "seed",
     "type": "number",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "mfp_mm",
     "type": "number",
     "unit": "mm",
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "lines",
     "type": "number",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": null
    }
   ],
   "outputs": [
    {
     "name": "reach_fraction",
     "unit": "1",
     "description": "Fraction of all sites (all loaded) that some projector reaches with at least reach_min of its beam (and under exit_limit_mW if set)."
    },
    {
     "name": "reach_fraction_any_exit",
     "unit": "1",
     "description": null
    },
    {
     "name": "two_projector_fraction",
     "unit": "1",
     "description": "Fraction of sites reached that way by at least two projectors."
    },
    {
     "name": "lit_n",
     "unit": "1",
     "description": null
    },
    {
     "name": "unreached_lit_n",
     "unit": "1",
     "description": null
    },
    {
     "name": "crosstalk_ratio",
     "unit": "1",
     "description": "Brightest unlit sphere (head-on, from beam spill and light scattered by lit spheres) over the median lit sphere."
    },
    {
     "name": "max_exit_mW_peak",
     "unit": "mW",
     "description": "Strongest beam leaving the box through a wall while lighting this image (peak power, after the wall)."
    },
    {
     "name": "max_dT_K",
     "unit": "K",
     "description": null
    },
    {
     "name": "light_force_over_grip",
     "unit": "1",
     "description": null
    },
    {
     "name": "max_sphere_power_mW",
     "unit": "mW",
     "description": null
    },
    {
     "name": "worst_seen_fraction",
     "unit": "1",
     "description": "Over all eyes: the smallest fraction of lit spheres seen (uncovered and bright enough toward the eye)."
    },
    {
     "name": "worst_contrast",
     "unit": "1",
     "description": "Over all eyes: median seen lit sphere over the brightest background (luminance ratio)."
    },
    {
     "name": "median_lit_luminance_headon",
     "unit": null,
     "description": "cd/m^2 (not in the kernel's unit table)."
    },
    {
     "name": "fresnel_R",
     "unit": "1",
     "description": null
    },
    {
     "name": "ghost_ratio",
     "unit": "1",
     "description": null
    },
    {
     "name": "groups",
     "unit": null,
     "description": "Per eye group: worst_seen_fraction, worst_contrast and which eyes."
    },
    {
     "name": "eyes",
     "unit": null,
     "description": "Per eye: seen_fraction, uncovered_fraction, phase_ok_fraction, hidden_by_board, hidden_by_spheres, median_lit_seen (cd/m^2), contrast."
    },
    {
     "name": "projectors",
     "unit": null,
     "description": "Per projector: spheres served, power, mean power on a sphere, strongest escaping beam, reach fraction."
    },
    {
     "name": "room",
     "unit": null,
     "description": "Luminances (cd/m^2) of the background parts: unlit sphere, room through the box, board, wall reflection; inside illuminance (lx)."
    },
    {
     "name": "files",
     "unit": null,
     "description": "out/spheres.csv (per site), out/eyes.csv, out/view_<eye>.png, out/scene.glb"
    }
   ],
   "selftests": [
    {
     "name": "Gaussian beam on a disc: on the axis the fraction is 1 - exp(-2 R^2/w^2) (closed form) for R/w = 0.5, 1, 2 (1e-9); off the axis (d/w = 0.35, 0.7, 1.4, R = w) the noncentral chi-square form against direct polar quadrature of the Gaussian over the disc, 4000 x 8000 cells (1e-6)",
     "checks": [
      "axis_worst_rel_err",
      "far_fraction",
      "offaxis_worst_rel_err"
     ]
    },
    {
     "name": "Lambertian sphere (Russell 1916): intensity toward phase angles 0, 45, 90, 135, 180 deg from a 600 x 1200 facet integration of a sphere lit from one side, against I(alpha) = 2 rho Phi (sin alpha + (pi - alpha) cos alpha)/(3 pi^2) (1e-4 of the head-on value); the phase function, Lambertian, isotropic and a 50/50 mix, integrates over the sphere to the scattered flux (1e-6)",
     "checks": [
      "flux_isotropic",
      "flux_lambert",
      "flux_mix",
      "intensity_worst_err_rel_headon"
     ]
    },
    {
     "name": "Beer-Lambert for a Poisson field of spheres: 4000 random lines one mean free path long through spheres (R = 0.5 mm) at random, density 1/(pi R^2 mfp): the fraction that touches none is exp(-1) = 0.3679 (abs 0.03, four binomial standard deviations); the thin-beam limit of the beam model is 1 through a sphere and 0 beside it",
     "checks": [
      "clear_fraction",
      "thin_beam_off_sphere",
      "thin_beam_on_sphere"
     ]
    },
    {
     "name": "Closed forms: normal-incidence reflectance of acrylic (n = 1.49), ((n-1)/(n+1))^2 = 0.0387252; an unlit white sphere (rho 0.9) behind walls of T = 0.3 in 300 lx: rho E T^2/pi = 7.73493 (by hand); a 1 mm sphere in still air (Nu = 2) absorbing 1 mW warms P/(4 pi k R) = 6.07462 K (k = 0.0262 W/m K); two unit discs 1 apart overlap 2 pi/3 - sqrt(3)/2 = 1.2283697",
     "checks": [
      "fresnel_R_acrylic",
      "heat_rise_K",
      "lens_equal",
      "unlit_luminance"
     ]
    },
    {
     "name": "Two spheres on a beam's axis (R = 0.5 mm, w = 0.4 mm, aim 0.2 mm off), the far one lit, through the whole display path: its reach is (1 - (1 - exp(-2R^2/w^2))) x the offset-disc fraction = 0.0386270 and the beam leaving the far wall carries P (1 - f0)(1 - f_d) T = 0.0159299 mW of 10 mW (by hand); an eye from the side sees it, an eye on the axis behind the projector does not (the near sphere covers it)",
     "checks": [
      "exit_far_mW",
      "reach_far",
      "seen_behind",
      "seen_side"
     ]
    }
   ],
   "title": "Spheres lit in a box",
   "needs_build": true,
   "category": "Waves, optics and circuits",
   "known_answers": 18
  },
  {
   "name": "orbit_kepler",
   "version": "0.1.0",
   "summary": "Two-body (Kepler) orbits about any central body given by its GM (Earth by default): state vector to classical elements and back, period, specific energy and angular momentum, speeds at periapsis and apoapsis (vis-viva), escape and circular speed, hyperbolic excess speed and turn angle, and propagation in time by Kepler's equation (ellipse, hyperbola; Barker's equation on a parabola). Writes the orbit track as out/orbit.csv. Units: km, s, deg.",
   "runtime": "native",
   "timeout_s": 20,
   "estimate_s": 0.02,
   "inputs": [
    {
     "name": "gm_km3_s2",
     "type": "number",
     "unit": "km^3/s^2",
     "default": 398600.4418,
     "enum": null,
     "description": "Gravitational parameter GM of the central body. Default: the Earth (WGS 84 / EGM96 value 398600.4418)."
    },
    {
     "name": "body_radius_km",
     "type": "number",
     "unit": "km",
     "default": 6378.137,
     "enum": null,
     "description": "Radius of the central body; altitudes are measured above it. Default: the Earth's equatorial radius (WGS 84). 0 measures from the centre."
    },
    {
     "name": "r_km",
     "type": "array",
     "unit": "km",
     "default": null,
     "enum": null,
     "description": "State mode: position [x, y, z] in an inertial frame centred on the body. Give with v_km_s and no elements."
    },
    {
     "name": "v_km_s",
     "type": "array",
     "unit": "km/s",
     "default": null,
     "enum": null,
     "description": "State mode: velocity [vx, vy, vz]. Give with r_km."
    },
    {
     "name": "a_km",
     "type": "number",
     "unit": "km",
     "default": null,
     "enum": null,
     "description": "Elements mode, size: semi-major axis (positive on an ellipse, negative on a hyperbola). Give exactly one of a_km, period_s, h_km2_s, periapsis_altitude_km."
    },
    {
     "name": "period_s",
     "type": "number",
     "unit": "s",
     "default": null,
     "enum": null,
     "description": "Elements mode, size: orbital period (closed orbits only)."
    },
    {
     "name": "h_km2_s",
     "type": "number",
     "unit": "km^2/s",
     "default": null,
     "enum": null,
     "description": "Elements mode, size: specific angular momentum."
    },
    {
     "name": "periapsis_altitude_km",
     "type": "number",
     "unit": "km",
     "default": null,
     "enum": null,
     "description": "Elements mode, size: periapsis altitude above body_radius_km; with apoapsis_altitude_km (then leave e out) or with e."
    },
    {
     "name": "apoapsis_altitude_km",
     "type": "number",
     "unit": "km",
     "default": null,
     "enum": null,
     "description": "Elements mode: apoapsis altitude; needs periapsis_altitude_km."
    },
    {
     "name": "e",
     "type": "number",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "Eccentricity: 0 circle, below 1 ellipse, 1 parabola, above 1 hyperbola. 0 when left out."
    },
    {
     "name": "i_deg",
     "type": "number",
     "unit": "deg",
     "default": null,
     "enum": null,
     "description": "Inclination. 0 when left out."
    },
    {
     "name": "raan_deg",
     "type": "number",
     "unit": "deg",
     "default": null,
     "enum": null,
     "description": "Right ascension of the ascending node. 0 when left out."
    },
    {
     "name": "argp_deg",
     "type": "number",
     "unit": "deg",
     "default": null,
     "enum": null,
     "description": "Argument of periapsis. 0 when left out."
    },
    {
     "name": "true_anomaly_deg",
     "type": "number",
     "unit": "deg",
     "default": null,
     "enum": null,
     "description": "True anomaly at the epoch. 0 (periapsis) when left out."
    },
    {
     "name": "dt_s",
     "type": "number",
     "unit": "s",
     "default": 0,
     "enum": null,
     "description": "Propagate this long from the epoch by Kepler's equation (negative goes back)."
    },
    {
     "name": "propagate_periods",
     "type": "number",
     "unit": "1",
     "default": 0,
     "enum": null,
     "description": "Also propagate this many orbital periods (closed orbits only); added to dt_s."
    },
    {
     "name": "samples",
     "type": "integer",
     "unit": "1",
     "default": 361,
     "enum": null,
     "description": "Rows in out/orbit.csv: one period evenly in time (closed orbit), or a sweep of true anomaly about periapsis (open orbit)."
    }
   ],
   "outputs": [
    {
     "name": "mode",
     "unit": "1",
     "description": "\"state\" or \"elements\": which inputs defined the orbit"
    },
    {
     "name": "orbit_type",
     "unit": "1",
     "description": "circular, elliptic, parabolic or hyperbolic"
    },
    {
     "name": "gm_km3_s2",
     "unit": "km^3/s^2",
     "description": null
    },
    {
     "name": "body_radius_km",
     "unit": "km",
     "description": null
    },
    {
     "name": "a_km",
     "unit": "km",
     "description": "semi-major axis; null on a parabola"
    },
    {
     "name": "p_km",
     "unit": "km",
     "description": "semi-latus rectum h^2/GM"
    },
    {
     "name": "e",
     "unit": "1",
     "description": null
    },
    {
     "name": "i_deg",
     "unit": "deg",
     "description": null
    },
    {
     "name": "raan_deg",
     "unit": "deg",
     "description": null
    },
    {
     "name": "argp_deg",
     "unit": "deg",
     "description": null
    },
    {
     "name": "true_anomaly_deg",
     "unit": "deg",
     "description": null
    },
    {
     "name": "mean_anomaly_deg",
     "unit": "deg",
     "description": "null on a parabola"
    },
    {
     "name": "time_since_periapsis_s",
     "unit": "s",
     "description": null
    },
    {
     "name": "period_s",
     "unit": "s",
     "description": "null on an open orbit"
    },
    {
     "name": "mean_motion_rad_s",
     "unit": "rad/s",
     "description": null
    },
    {
     "name": "specific_energy_km2_s2",
     "unit": "km^2/s^2",
     "description": null
    },
    {
     "name": "h_km2_s",
     "unit": "km^2/s",
     "description": null
    },
    {
     "name": "periapsis_radius_km",
     "unit": "km",
     "description": null
    },
    {
     "name": "apoapsis_radius_km",
     "unit": "km",
     "description": null
    },
    {
     "name": "periapsis_altitude_km",
     "unit": "km",
     "description": null
    },
    {
     "name": "apoapsis_altitude_km",
     "unit": "km",
     "description": null
    },
    {
     "name": "v_periapsis_km_s",
     "unit": "km/s",
     "description": null
    },
    {
     "name": "v_apoapsis_km_s",
     "unit": "km/s",
     "description": null
    },
    {
     "name": "v_infinity_km_s",
     "unit": "km/s",
     "description": "hyperbolic excess speed; null unless hyperbolic"
    },
    {
     "name": "turn_angle_deg",
     "unit": "deg",
     "description": "hyperbolic turn angle 2 asin(1/e); null unless hyperbolic"
    },
    {
     "name": "r_km",
     "unit": "km",
     "description": null
    },
    {
     "name": "v_km_s",
     "unit": "km/s",
     "description": null
    },
    {
     "name": "r_mag_km",
     "unit": "km",
     "description": null
    },
    {
     "name": "v_mag_km_s",
     "unit": "km/s",
     "description": null
    },
    {
     "name": "altitude_km",
     "unit": "km",
     "description": null
    },
    {
     "name": "v_circular_km_s",
     "unit": "km/s",
     "description": null
    },
    {
     "name": "v_escape_km_s",
     "unit": "km/s",
     "description": null
    },
    {
     "name": "dt_s",
     "unit": "s",
     "description": null
    },
    {
     "name": "r_end_km",
     "unit": "km",
     "description": null
    },
    {
     "name": "v_end_km_s",
     "unit": "km/s",
     "description": null
    },
    {
     "name": "r_end_mag_km",
     "unit": "km",
     "description": null
    },
    {
     "name": "v_end_mag_km_s",
     "unit": "km/s",
     "description": null
    },
    {
     "name": "altitude_end_km",
     "unit": "km",
     "description": null
    },
    {
     "name": "true_anomaly_end_deg",
     "unit": "deg",
     "description": null
    },
    {
     "name": "mean_anomaly_end_deg",
     "unit": "deg",
     "description": null
    },
    {
     "name": "position_change_km",
     "unit": "km",
     "description": null
    },
    {
     "name": "velocity_change_km_s",
     "unit": "km/s",
     "description": null
    },
    {
     "name": "energy_rel_change",
     "unit": "1",
     "description": null
    },
    {
     "name": "h_rel_change",
     "unit": "1",
     "description": null
    },
    {
     "name": "roundtrip_rel_error",
     "unit": "1",
     "description": "state -> elements -> state, relative"
    },
    {
     "name": "kepler_iterations",
     "unit": "1",
     "description": null
    },
    {
     "name": "clears_body",
     "unit": "1",
     "description": null
    },
    {
     "name": "warnings",
     "unit": "1",
     "description": null
    },
    {
     "name": "conventions",
     "unit": "1",
     "description": null
    },
    {
     "name": "orbit_csv_rows",
     "unit": "1",
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "circular orbit 400 km above R=6378.137 km, GM=398600.4418: closed forms v=sqrt(GM/r)=7.66856 km/s, T=2pi sqrt(r^3/GM), v_esc=sqrt(2) v, energy=-GM/2r, h=sqrt(GM r) (rel 1e-9)",
     "checks": [
      "h_km2_s",
      "period_s",
      "r_mag_km",
      "specific_energy_km2_s2",
      "v_circular_km_s",
      "v_escape_km_s",
      "v_mag_km_s"
     ]
    },
    {
     "name": "sidereal-day period 86164.09 s, e=0: Kepler's third law a=(GM T^2/4pi^2)^(1/3)=42164.17 km (geostationary radius), v=sqrt(GM/a) (rel 1e-9)",
     "checks": [
      "a_km",
      "r_mag_km",
      "v_mag_km_s"
     ]
    },
    {
     "name": "frame conventions by inspection: r=[0,7000,0], v=[0,0,7] (below circular, so apoapsis) gives i=90, raan=90, argp=180, nu=180, e=1-R v^2/GM, a=R/(1+e); round trip state->elements->state exact (closed form, rel 1e-9)",
     "checks": [
      "a_km",
      "apoapsis_radius_km",
      "argp_deg",
      "e",
      "i_deg",
      "periapsis_radius_km",
      "raan_deg",
      "roundtrip_rel_error",
      "true_anomaly_deg"
     ]
    },
    {
     "name": "Kepler's equation, ellipse a=10000 km e=0.5 from periapsis, dt=(pi/2-e) sqrt(a^3/GM)=1696.0474 s: exact solution E=90 deg, so r=a and nu=acos(-e)=120 deg (rel 1e-9)",
     "checks": [
      "energy_rel_change",
      "h_rel_change",
      "mean_anomaly_end_deg",
      "r_end_mag_km",
      "true_anomaly_end_deg"
     ]
    },
    {
     "name": "Barker's equation, parabola e=1 periapsis 500 km: from periapsis dt=(2/3) sqrt(p^3/GM) (p=2 r_p) reaches nu=90 deg at r=p; v_p=sqrt(2GM/r_p) escape speed (closed form, rel 1e-9)",
     "checks": [
      "orbit_type",
      "r_end_mag_km",
      "specific_energy_km2_s2",
      "true_anomaly_end_deg",
      "v_periapsis_km_s"
     ]
    },
    {
     "name": "hyperbolic Kepler equation, e=2 periapsis 500 km: turn angle 2 asin(1/e)=60 deg, v_inf=sqrt(GM(e-1)/r_p); from periapsis dt=(2 sqrt3 - ln(2+sqrt3))/n reaches H=ln(2+sqrt3), nu=90 deg, r=p=3 r_p (exact solution, rel 1e-9)",
     "checks": [
      "a_km",
      "r_end_mag_km",
      "true_anomaly_end_deg",
      "turn_angle_deg",
      "v_infinity_km_s"
     ]
    },
    {
     "name": "Curtis, Orbital Mechanics for Engineering Students, Example 4.3: r=[-6045,-3490,2500] km, v=[-3.457,6.618,2.533] km/s gives h=58310, i=153.2, raan=255.3, e=0.1712, argp=20.07, nu=28.45, a=8788 (textbook prints 4 figures: tolerance half the last digit); one period of propagation returns the start (exact, 1e-9 relative)",
     "checks": [
      "a_km",
      "argp_deg",
      "e",
      "energy_rel_change",
      "h_km2_s",
      "h_rel_change",
      "i_deg",
      "position_change_km",
      "raan_deg",
      "true_anomaly_deg",
      "velocity_change_km_s"
     ]
    }
   ],
   "title": "Two-body orbit (Kepler)",
   "needs_build": true,
   "category": "Space and orbits",
   "known_answers": 45
  },
  {
   "name": "orbit_transfer",
   "version": "0.1.0",
   "summary": "Impulsive orbital manoeuvres around one body (two-body, coplanar and coaxial orbits): Hohmann and bi-elliptic transfers between circular or elliptic orbits, plane change (pure, separate, or combined with the highest burn), phasing in a circular orbit; delta-v per burn from vis-viva, coast time, propellant by the rocket equation.",
   "runtime": "native",
   "timeout_s": 30,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "manoeuvre",
     "type": "string",
     "unit": null,
     "default": "hohmann",
     "enum": [
      "hohmann",
      "bielliptic",
      "plane_change",
      "phasing"
     ],
     "description": "hohmann: two tangential burns, orbit 1 to orbit 2; bielliptic: three burns through intermediate_km; plane_change: one burn at apoapsis of orbit 1; phasing: catch a target phase_angle_deg ahead in circular orbit 1."
    },
    {
     "name": "mu_m3_s2",
     "type": "number",
     "unit": "m^3/s^2",
     "default": 398600441800000.0,
     "enum": null,
     "description": "Gravitational parameter GM of the central body. Default: Earth (IERS 2010 / WGS 84 value)."
    },
    {
     "name": "body_radius_km",
     "type": "number",
     "unit": "km",
     "default": 6378.137,
     "enum": null,
     "description": "Radius of the central body: altitudes are measured above it, and orbits that dip below it are flagged. Default: Earth's equatorial radius (WGS 84). 0 switches the surface check off."
    },
    {
     "name": "given",
     "type": "string",
     "unit": null,
     "default": "altitude",
     "enum": [
      "altitude",
      "radius"
     ],
     "description": "Whether the *_km orbit inputs are altitudes above body_radius_km or radii from the centre."
    },
    {
     "name": "orbit1_peri_km",
     "type": "number",
     "unit": "km",
     "default": 300,
     "enum": null,
     "description": "Periapsis of the starting orbit (altitude or radius, see given)."
    },
    {
     "name": "orbit1_apo_km",
     "type": "number",
     "unit": "km",
     "default": null,
     "enum": null,
     "description": "Apoapsis of the starting orbit; leave out for a circular orbit."
    },
    {
     "name": "orbit2_peri_km",
     "type": "number",
     "unit": "km",
     "default": 35786,
     "enum": null,
     "description": "Periapsis of the target orbit. Default: geostationary altitude."
    },
    {
     "name": "orbit2_apo_km",
     "type": "number",
     "unit": "km",
     "default": null,
     "enum": null,
     "description": "Apoapsis of the target orbit; leave out for a circular orbit."
    },
    {
     "name": "intermediate_km",
     "type": "number",
     "unit": "km",
     "default": null,
     "enum": null,
     "description": "Far turning point of a bi-elliptic transfer, beyond both orbits. Given with hohmann, the bi-elliptic transfer is only compared."
    },
    {
     "name": "depart_at",
     "type": "string",
     "unit": null,
     "default": "auto",
     "enum": [
      "auto",
      "periapsis",
      "apoapsis"
     ],
     "description": "Where on orbit 1 the transfer starts (apse lines aligned). auto takes the cheaper."
    },
    {
     "name": "plane_change_deg",
     "type": "number",
     "unit": "deg",
     "default": 0,
     "enum": null,
     "description": "Angle between the planes of orbit 1 and orbit 2."
    },
    {
     "name": "plane_change_at",
     "type": "string",
     "unit": null,
     "default": "combined",
     "enum": [
      "combined",
      "separate"
     ],
     "description": "combined: with the burn at the largest radius; separate: a burn of its own at apoapsis of the slower orbit."
    },
    {
     "name": "phase_angle_deg",
     "type": "number",
     "unit": "deg",
     "default": 0,
     "enum": null,
     "description": "phasing: how far the target is ahead (positive) or behind (negative) along circular orbit 1."
    },
    {
     "name": "phasing_revs",
     "type": "integer",
     "unit": "1",
     "default": 1,
     "enum": null,
     "description": "phasing: whole revolutions spent in the phasing orbit."
    },
    {
     "name": "isp_s",
     "type": "number",
     "unit": "s",
     "default": 320,
     "enum": null,
     "description": "Specific impulse of the engine (exhaust speed = isp_s * g0, g0 = 9.80665 m/s^2 exact)."
    },
    {
     "name": "initial_mass_kg",
     "type": "number",
     "unit": "kg",
     "default": 1000,
     "enum": null,
     "description": "Spacecraft mass before the first burn."
    }
   ],
   "outputs": [
    {
     "name": "manoeuvre",
     "unit": null,
     "description": null
    },
    {
     "name": "feasible",
     "unit": null,
     "description": "true when no orbit or phasing orbit dips below body_radius_km"
    },
    {
     "name": "warnings",
     "unit": null,
     "description": null
    },
    {
     "name": "notes",
     "unit": null,
     "description": null
    },
    {
     "name": "dv_total_m_s",
     "unit": "m/s",
     "description": null
    },
    {
     "name": "dv_total_km_s",
     "unit": "km/s",
     "description": null
    },
    {
     "name": "dv1_m_s",
     "unit": "m/s",
     "description": "first in-plane burn (a pure plane-change burn is not counted here)"
    },
    {
     "name": "dv2_m_s",
     "unit": "m/s",
     "description": "second in-plane burn; with a combined plane change this is the combined burn"
    },
    {
     "name": "dv3_m_s",
     "unit": "m/s",
     "description": "third in-plane burn (bi-elliptic), else null"
    },
    {
     "name": "dv_plane_m_s",
     "unit": "m/s",
     "description": "the burn that carries the plane change: the pure turn, or the whole combined burn"
    },
    {
     "name": "burn_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "transfer_time_s",
     "unit": "s",
     "description": null
    },
    {
     "name": "transfer_time_h",
     "unit": "h",
     "description": null
    },
    {
     "name": "depart_at",
     "unit": null,
     "description": null
    },
    {
     "name": "propellant_kg",
     "unit": "kg",
     "description": null
    },
    {
     "name": "final_mass_kg",
     "unit": "kg",
     "description": null
    },
    {
     "name": "mass_ratio",
     "unit": "1",
     "description": null
    },
    {
     "name": "exhaust_speed_m_s",
     "unit": "m/s",
     "description": null
    },
    {
     "name": "radius_ratio",
     "unit": "1",
     "description": "larger over smaller semi-major axis of orbit 1 and the final orbit"
    },
    {
     "name": "speed_initial_m_s",
     "unit": "m/s",
     "description": null
    },
    {
     "name": "period_initial_h",
     "unit": "h",
     "description": null
    },
    {
     "name": "period_final_h",
     "unit": "h",
     "description": null
    },
    {
     "name": "ratio_bielliptic_never_below",
     "unit": "1",
     "description": "circular-to-circular radius ratio below which no bi-elliptic transfer beats Hohmann (bi-parabolic limit)"
    },
    {
     "name": "ratio_bielliptic_always_above",
     "unit": "1",
     "description": "radius ratio above which every bi-elliptic transfer beats Hohmann"
    },
    {
     "name": "transfer_sma_km",
     "unit": "km",
     "description": null
    },
    {
     "name": "transfer_eccentricity",
     "unit": "1",
     "description": null
    },
    {
     "name": "hohmann_dv_m_s",
     "unit": "m/s",
     "description": "coplanar Hohmann total (no plane change), for comparison"
    },
    {
     "name": "bielliptic_dv_m_s",
     "unit": "m/s",
     "description": "coplanar bi-elliptic total through intermediate_km (no plane change), for comparison"
    },
    {
     "name": "bielliptic_saving_m_s",
     "unit": "m/s",
     "description": null
    },
    {
     "name": "bielliptic_cheaper",
     "unit": null,
     "description": null
    },
    {
     "name": "biparabolic_dv_m_s",
     "unit": "m/s",
     "description": "out to infinity and back: the limit of the bi-elliptic transfer"
    },
    {
     "name": "phasing_other_apsis_km",
     "unit": "km",
     "description": "radius of the phasing orbit's far apsis"
    },
    {
     "name": "phasing_period_s",
     "unit": "s",
     "description": null
    },
    {
     "name": "burns",
     "unit": null,
     "description": "per burn: radius_km, speed_before_m_s, speed_after_m_s, turn_deg, dv_m_s, propellant_kg, mass_after_kg"
    },
    {
     "name": "burns.csv",
     "unit": null,
     "description": null
    },
    {
     "name": "trajectory.csv",
     "unit": null,
     "description": null
    },
    {
     "name": "bielliptic_sweep.csv",
     "unit": null,
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "Hohmann 300 km to geostationary, vis-viva closed form dv1 = sqrt(GM/r1)(sqrt(2 r2/(r1+r2)) - 1), dv2 = sqrt(GM/r2)(1 - sqrt(2 r1/(r1+r2))), t = pi sqrt(a^3/GM) (textbook: about 3.89 km/s); rel 1e-6",
     "checks": [
      "dv1_m_s",
      "dv2_m_s",
      "dv_total_m_s",
      "transfer_sma_km",
      "transfer_time_h"
     ]
    },
    {
     "name": "Tsiolkovsky rocket equation on the same Hohmann: m1 = m0 exp(-dv/(Isp g0)), Isp 300 s, m0 1000 kg, g0 = 9.80665 exact; rel 1e-6",
     "checks": [
      "exhaust_speed_m_s",
      "final_mass_kg",
      "propellant_kg"
     ]
    },
    {
     "name": "Pure plane change 28.5 deg in 300 km circular orbit, closed form dv = 2 v sin(di/2), v = sqrt(GM/r); rel 1e-6",
     "checks": [
      "dv_plane_m_s",
      "dv_total_m_s"
     ]
    },
    {
     "name": "Hohmann 300 km to GEO with 28.5 deg plane change combined at apoapsis, law of cosines dv = sqrt(va^2 + vc^2 - 2 va vc cos di); rel 1e-6",
     "checks": [
      "dv1_m_s",
      "dv_plane_m_s",
      "dv_total_m_s"
     ]
    },
    {
     "name": "Hohmann 300 km to GEO then separate 28.5 deg plane change in GEO, closed form dv1 + dv2 + 2 v_GEO sin(di/2); rel 1e-6",
     "checks": [
      "dv_total_m_s"
     ]
    },
    {
     "name": "Bi-elliptic r 7000 -> 105000 km via 210000 km (ratio 15), vis-viva closed form per burn and two half-ellipse times; Hohmann closed form for comparison; rel 1e-6",
     "checks": [
      "bielliptic_cheaper",
      "dv1_m_s",
      "dv2_m_s",
      "dv3_m_s",
      "dv_total_m_s",
      "hohmann_dv_m_s",
      "transfer_time_h"
     ]
    },
    {
     "name": "Bi-elliptic thresholds (Hoelker and Silber 1961; Vallado): 11.938765 = root of x^3 - (7+4 sqrt2) x^2 + (3+4 sqrt2) x - 1, rel 1e-6; 15.58172 textbook, rel 1e-6 (program uses a one-sided difference of 1e-6 in r)",
     "checks": [
      "ratio_bielliptic_always_above",
      "ratio_bielliptic_never_below"
     ]
    },
    {
     "name": "Phasing in GEO, target 30 deg ahead, 1 rev: period T(1 - 30/360), a = r (11/12)^(2/3), dv = 2 |v_p - v_c| by vis-viva; rel 1e-6",
     "checks": [
      "dv_total_m_s",
      "feasible",
      "phasing_other_apsis_km",
      "transfer_time_h"
     ]
    },
    {
     "name": "Same orbit to same orbit: dv 0 and time 0 exactly (abs 1e-9)",
     "checks": [
      "dv_total_m_s",
      "propellant_kg",
      "transfer_time_s"
     ]
    }
   ],
   "title": "Orbit transfer",
   "needs_build": true,
   "category": "Space and orbits",
   "known_answers": 30
  },
  {
   "name": "orf_codon",
   "version": "0.1.0",
   "summary": "Finds Open Reading Frames (ORFs) across all 6 reading frames, translates the longest ORF, and computes sequence GC%, longest-ORF GC3%, and codon usage counts.",
   "runtime": "native",
   "timeout_s": 30,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "sequence",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "min_aa_len",
     "type": "integer",
     "unit": null,
     "default": 10,
     "enum": null,
     "description": null
    }
   ],
   "outputs": [
    {
     "name": "seq_length_nt",
     "unit": "1",
     "description": null
    },
    {
     "name": "gc_pct",
     "unit": "%",
     "description": null
    },
    {
     "name": "orf_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "longest_orf_aa",
     "unit": "1",
     "description": null
    },
    {
     "name": "longest_orf_gc3_pct",
     "unit": "%",
     "description": null
    },
    {
     "name": "longest_protein",
     "unit": null,
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "10-aa poly-Ala ORF (ATG + 9xGCC + TAA) -> longest_orf_aa 10, 1 ORF, GC3 90.9%",
     "checks": [
      "gc_pct",
      "longest_orf_aa",
      "longest_protein",
      "orf_count"
     ]
    }
   ],
   "title": "6-frame ORF & codon usage",
   "needs_build": true,
   "category": "Genomics",
   "known_answers": 4
  },
  {
   "name": "pdb_parse",
   "version": "0.1.0",
   "summary": "Parses PDB or mmCIF protein/macromolecule coordinate files: chain and residue inventory, extracted sequences, center of mass, radius of gyration (\u00c5), bounding box, and a 3D backbone scene.glb.",
   "runtime": "native",
   "timeout_s": 60,
   "estimate_s": 0.1,
   "inputs": [
    {
     "name": "structure_text",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Inline PDB or mmCIF text."
    },
    {
     "name": "structure_file",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Staged .pdb or .cif file."
    }
   ],
   "outputs": [
    {
     "name": "atom_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "hetatm_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "chain_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "residue_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "radius_of_gyration_A",
     "unit": "\u00c5",
     "description": null
    },
    {
     "name": "chains",
     "unit": null,
     "description": null
    },
    {
     "name": "scene.glb",
     "unit": null,
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "4 CA atoms on a 3.8 \u00c5 square -> Rg = 1.9 * sqrt(2) = 2.687006 \u00c5",
     "checks": [
      "atom_count",
      "chain_count",
      "radius_of_gyration_A",
      "residue_count"
     ]
    }
   ],
   "title": "PDB / mmCIF structure summary",
   "needs_build": true,
   "category": "Structural biology",
   "known_answers": 4
  },
  {
   "name": "pendulum",
   "version": "0.1.0",
   "summary": "Rigid pendulum released from rest at any amplitude, with optional viscous damping: exact period by the arithmetic-geometric mean (T/T0 = 1/AGM(1, cos(a/2))), the error of the small-angle formula and the amplitude up to which it holds, an RK4 time history with its period, energy drift, speed and rod tension at the bottom, and the measured decay rate of the swing. Writes trace.csv and peaks.csv.",
   "runtime": "native",
   "timeout_s": 30,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "length_m",
     "type": "number",
     "unit": "m",
     "default": 1.0,
     "enum": null,
     "description": "Pivot to the centre of the bob (point mass on a massless rigid rod)."
    },
    {
     "name": "gravity_m_per_s2",
     "type": "number",
     "unit": "m/s^2",
     "default": 9.80665,
     "enum": null,
     "description": "Local gravity. Default is standard gravity (exact by definition)."
    },
    {
     "name": "amplitude_deg",
     "type": "number",
     "unit": "deg",
     "default": 30.0,
     "enum": null,
     "description": "Release angle from the hanging position; released from rest."
    },
    {
     "name": "damping_ratio",
     "type": "number",
     "unit": "1",
     "default": 0.0,
     "enum": null,
     "description": "Fraction of critical damping zeta in theta'' + 2 zeta w0 theta' + w0^2 sin(theta) = 0. 0 is no damping."
    },
    {
     "name": "periods",
     "type": "integer",
     "unit": "1",
     "default": 10,
     "enum": null,
     "description": "Length of the time history, in exact undamped periods at this amplitude."
    },
    {
     "name": "steps_per_period",
     "type": "integer",
     "unit": "1",
     "default": 2000,
     "enum": null,
     "description": "RK4 steps in one exact period."
    },
    {
     "name": "small_angle_tolerance_pct",
     "type": "number",
     "unit": "%",
     "default": 1.0,
     "enum": null,
     "description": "Period error accepted from T0 = 2 pi sqrt(L/g); sets the verdict and small_angle_limit_deg."
    }
   ],
   "outputs": [
    {
     "name": "small_angle_period_s",
     "unit": "s",
     "description": "T0 = 2 pi sqrt(L/g)."
    },
    {
     "name": "exact_period_s",
     "unit": "s",
     "description": "Undamped period at this amplitude, T0 / AGM(1, cos(a/2))."
    },
    {
     "name": "period_ratio",
     "unit": "1",
     "description": "T / T0 = 2 K(sin(a/2)) / pi."
    },
    {
     "name": "small_angle_error_pct",
     "unit": "%",
     "description": "(T0 - T) / T: negative, the small-angle formula reads short."
    },
    {
     "name": "small_angle_ok",
     "unit": null,
     "description": "true when the error is within small_angle_tolerance_pct."
    },
    {
     "name": "small_angle_limit_deg",
     "unit": "deg",
     "description": "Largest amplitude at which T0 stays within the tolerance."
    },
    {
     "name": "natural_frequency_rad_per_s",
     "unit": "rad/s",
     "description": "w0 = sqrt(g/L)."
    },
    {
     "name": "rk4_period_s",
     "unit": "s",
     "description": "Mean period of the time history, from its zero crossings; null when it never swings through."
    },
    {
     "name": "rk4_period_rel_error",
     "unit": "1",
     "description": "|RK4 period - exact| / exact, no damping only."
    },
    {
     "name": "energy_initial_J_per_kg",
     "unit": "J/kg",
     "description": "g L (1 - cos a)."
    },
    {
     "name": "energy_drift_rel",
     "unit": "1",
     "description": "Largest |E - E0| / E0 over the history, no damping only."
    },
    {
     "name": "energy_final_fraction",
     "unit": "1",
     "description": "E at the end over E at release."
    },
    {
     "name": "bottom_speed_m_per_s",
     "unit": "m/s",
     "description": "sqrt(2 g L (1 - cos a)): no damping, closed form."
    },
    {
     "name": "rk4_bottom_speed_m_per_s",
     "unit": "m/s",
     "description": "Bob speed at the first pass through the bottom, from the time history (with damping)."
    },
    {
     "name": "bottom_tension_over_weight",
     "unit": "1",
     "description": "Rod tension over the bob's weight at the first pass through the bottom, 1 + v^2 / (g L)."
    },
    {
     "name": "decay_rate_per_s",
     "unit": "1/s",
     "description": "Measured: ln(first amplitude / last turning point) / time between them. Null without damping."
    },
    {
     "name": "decay_rate_theory_per_s",
     "unit": "1/s",
     "description": "zeta w0, the small-angle envelope rate."
    },
    {
     "name": "damping_ratio_measured",
     "unit": "1",
     "description": "decay_rate_per_s / w0."
    },
    {
     "name": "amplitude_ratio_per_cycle",
     "unit": "1",
     "description": "Amplitude after one cycle over the amplitude before, from the measured rate and period."
    },
    {
     "name": "half_amplitude_time_s",
     "unit": "s",
     "description": "ln 2 / measured decay rate."
    },
    {
     "name": "damped_period_small_angle_s",
     "unit": "s",
     "description": "T0 / sqrt(1 - zeta^2)."
    },
    {
     "name": "quality_factor",
     "unit": "1",
     "description": "1 / (2 zeta)."
    },
    {
     "name": "amplitude_final_deg",
     "unit": "deg",
     "description": "Size of the last turning point in the history."
    },
    {
     "name": "turning_points",
     "unit": "1",
     "description": null
    },
    {
     "name": "steps",
     "unit": "1",
     "description": null
    },
    {
     "name": "step_s",
     "unit": "s",
     "description": null
    },
    {
     "name": "duration_s",
     "unit": "s",
     "description": null
    },
    {
     "name": "warnings",
     "unit": null,
     "description": "Plain-word cautions."
    },
    {
     "name": "trace_file",
     "unit": null,
     "description": "out/trace.csv: t_s, theta_deg, omega_rad_per_s, energy_J_per_kg (at most about 4000 rows)."
    },
    {
     "name": "peaks_file",
     "unit": null,
     "description": "out/peaks.csv: t_s, theta_deg, amplitude_deg at every turning point."
    }
   ],
   "selftests": [
    {
     "name": "small-angle formula T0 = 2 pi sqrt(L/g): L = 0.25 m with g = pi^2 m/s^2 is exactly 1 s; at 0.1 deg the ratio is the textbook series 1 + a^2/16 + 11 a^4/3072 = 1.00000019038592 (closed forms, 1e-9)",
     "checks": [
      "natural_frequency_rad_per_s",
      "period_ratio",
      "small_angle_period_s"
     ]
    },
    {
     "name": "90 deg: T/T0 = 2K(1/sqrt 2)/pi = Gamma(1/4)^2 / (2 pi^1.5) = 1.1803405990161 (lemniscate case; Abramowitz & Stegun table 17.1, K(45 deg) = 1.85407467730137); small-angle error 1/1.18034 - 1 = -15.2787 %; closed forms, 1e-9",
     "checks": [
      "exact_period_s",
      "period_ratio",
      "small_angle_error_pct",
      "small_angle_ok"
     ]
    },
    {
     "name": "60 deg: T/T0 = 2K(1/2)/pi = 1.0731820071494 (Abramowitz & Stegun table 17.1, K(30 deg) = 1.68575035481260; checked by the power series in k^2); closed form, 1e-9",
     "checks": [
      "period_ratio"
     ]
    },
    {
     "name": "120 deg: T/T0 = 2K(sin 60 deg)/pi = 1.3728805006183 (Abramowitz & Stegun table 17.1, K(60 deg) = 2.15651564749964); closed form, 1e-9",
     "checks": [
      "period_ratio"
     ]
    },
    {
     "name": "RK4 against exact answers, release from horizontal with L = g so T0 = 2 pi: period 2 pi x 1.18034059901610 = 7.41629870920549 s, bottom speed sqrt(2 g L) = g sqrt 2, rod tension 3 x weight, energy conserved. RK4 at 2000 steps per period has a global error near (w h)^4 = 2e-10, so 1e-7 on the readings and 1e-8 on the energy drift",
     "checks": [
      "bottom_speed_m_per_s",
      "bottom_tension_over_weight",
      "energy_drift_rel",
      "energy_final_fraction",
      "energy_initial_J_per_kg",
      "rk4_bottom_speed_m_per_s",
      "rk4_period_rel_error",
      "rk4_period_s",
      "small_angle_period_s"
     ]
    },
    {
     "name": "light damping, linear theory: zeta = 0.02 with w0 = 1 rad/s gives an envelope exp(-zeta w0 t), so decay rate 0.02 /s, period 2 pi / sqrt(1 - zeta^2) = 6.28444232135785 s, amplitude ratio per cycle exp(-2 pi zeta / sqrt(1 - zeta^2)) = 0.881889207074743. Run at 0.1 deg, where sin(theta) differs from theta by a^2/6 = 5e-7, hence 2e-6",
     "checks": [
      "amplitude_ratio_per_cycle",
      "damped_period_small_angle_s",
      "damping_ratio_measured",
      "decay_rate_per_s",
      "decay_rate_theory_per_s",
      "half_amplitude_time_s",
      "quality_factor",
      "rk4_period_s"
     ]
    },
    {
     "name": "where the small-angle formula stops being good: by the series T/T0 = 1 + a^2/16 + 11 a^4/3072, so T0/T = 1 - a^2/16 + a^4/3072, a period error of 1e-4 % is reached at a = 0.004 rad x (1 + 4e-8) = 0.2291831276 deg; 10 deg (error about a^2/16 = 0.19 %) is outside that tolerance; series truncation is below 1e-9 here, 1e-6",
     "checks": [
      "small_angle_limit_deg",
      "small_angle_ok"
     ]
    },
    {
     "name": "critical damping and beyond does not swing: zeta = 2 gives no zero crossing, so no period (null) and energy only falls (final fraction below 1)",
     "checks": [
      "energy_final_fraction",
      "quality_factor",
      "turning_points"
     ]
    }
   ],
   "title": "Pendulum at any amplitude",
   "needs_build": true,
   "category": "Dynamics and control",
   "known_answers": 31
  },
  {
   "name": "peptide_fragments",
   "version": "0.1.0",
   "summary": "Peptide fragment ions for tandem MS: a, b, c, x, y, z and z+1 series m/z at chosen charges, built from element monoisotopic masses, with fixed and variable modifications (Da or formula), precursor m/z, and matching of an observed peak list within a ppm window with bond coverage.",
   "runtime": "native",
   "timeout_s": 30,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "sequence",
     "type": "string",
     "unit": null,
     "default": "PEPTIDE",
     "enum": null,
     "description": "One-letter residue codes (upper case, 2 to 500). A modification goes in brackets after its residue: PEPM[+15.994915]K or PEPS[HPO3]K; N-terminal: [+42.010565]-PEPK; C-terminal: PEPK-[-0.984016]."
    },
    {
     "name": "ion_types",
     "type": "array",
     "unit": null,
     "default": [
      "b",
      "y"
     ],
     "enum": null,
     "description": "Fragment series. z is y - NH3, zdot (z+1, the z radical of ECD/ETD) is z + H."
    },
    {
     "name": "charges",
     "type": "array",
     "unit": "1",
     "default": [
      1
     ],
     "enum": null,
     "description": "Fragment charge states."
    },
    {
     "name": "precursor_charge",
     "type": "integer",
     "unit": "1",
     "default": 2,
     "enum": null,
     "description": null
    },
    {
     "name": "fixed_mods",
     "type": "object",
     "unit": null,
     "default": {},
     "enum": null,
     "description": "Applied to every site: {\"C\": \"C2H3NO\"} (carbamidomethyl), {\"N-term\": 42.010565}. Values are Da or a formula with optional sign."
    },
    {
     "name": "variable_mods",
     "type": "array",
     "unit": null,
     "default": [],
     "enum": null,
     "description": "Mods at one site: [{\"position\": 3, \"delta_Da\": 79.966331}] or [{\"position\": \"N-term\", \"formula\": \"C2H2O\"}]. Positions run 1..n."
    },
    {
     "name": "tolerance_ppm",
     "type": "number",
     "unit": null,
     "default": 20,
     "enum": null,
     "description": "Match window, |observed - theory| / theory."
    },
    {
     "name": "observed_mz",
     "type": "array",
     "unit": "1",
     "default": [],
     "enum": null,
     "description": "Observed centroid m/z (Th = Da per elementary charge). Empty: no matching."
    },
    {
     "name": "observed_intensity",
     "type": "array",
     "unit": "1",
     "default": [],
     "enum": null,
     "description": "One intensity per observed peak (optional)."
    },
    {
     "name": "precursor_observed_mz",
     "type": "number",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "Measured precursor m/z (Th), for its ppm error. Optional."
    }
   ],
   "outputs": [
    {
     "name": "sequence",
     "unit": "1",
     "description": null
    },
    {
     "name": "length",
     "unit": "1",
     "description": null
    },
    {
     "name": "formula_unmodified",
     "unit": "1",
     "description": "Hill-order formula of the unmodified neutral peptide."
    },
    {
     "name": "residue_masses_Da",
     "unit": "Da",
     "description": null
    },
    {
     "name": "n_term_delta_Da",
     "unit": "Da",
     "description": null
    },
    {
     "name": "c_term_delta_Da",
     "unit": "Da",
     "description": null
    },
    {
     "name": "neutral_mass_Da",
     "unit": "Da",
     "description": "Monoisotopic neutral mass M."
    },
    {
     "name": "mh_mz",
     "unit": "1",
     "description": "[M+H]+ m/z in Th."
    },
    {
     "name": "precursor_charge",
     "unit": "1",
     "description": null
    },
    {
     "name": "precursor_mz",
     "unit": "1",
     "description": "(M + z proton)/z in Th."
    },
    {
     "name": "precursor_error_ppm",
     "unit": null,
     "description": "parts per million (no kernel unit for ppm, left undeclared)"
    },
    {
     "name": "constants",
     "unit": null,
     "description": null
    },
    {
     "name": "series_mz",
     "unit": null,
     "description": "Per series, singly charged m/z of ions 1..n-1 in Th."
    },
    {
     "name": "ions",
     "unit": null,
     "description": null
    },
    {
     "name": "ions_total",
     "unit": "1",
     "description": null
    },
    {
     "name": "complement_residual_max_Da",
     "unit": "Da",
     "description": "max |b_i + y_(n-i) - ([M+H]+ + proton)|; zero by construction, a check on the two opposite sums."
    },
    {
     "name": "tolerance_ppm",
     "unit": null,
     "description": "parts per million (no kernel unit for ppm, left undeclared)"
    },
    {
     "name": "series_coverage",
     "unit": null,
     "description": null
    },
    {
     "name": "peaks",
     "unit": null,
     "description": null
    },
    {
     "name": "ions_matched",
     "unit": "1",
     "description": null
    },
    {
     "name": "peaks_total",
     "unit": "1",
     "description": null
    },
    {
     "name": "peaks_matched",
     "unit": "1",
     "description": null
    },
    {
     "name": "peaks_explained_fraction",
     "unit": "1",
     "description": null
    },
    {
     "name": "intensity_explained_fraction",
     "unit": "1",
     "description": null
    },
    {
     "name": "bonds_covered",
     "unit": "1",
     "description": null
    },
    {
     "name": "bonds_total",
     "unit": "1",
     "description": null
    },
    {
     "name": "sequence_coverage",
     "unit": "1",
     "description": "Backbone bonds with a matched fragment on either side, over n-1."
    },
    {
     "name": "mean_error_ppm",
     "unit": null,
     "description": "parts per million (no kernel unit for ppm, left undeclared)"
    },
    {
     "name": "rms_error_ppm",
     "unit": null,
     "description": "parts per million (no kernel unit for ppm, left undeclared)"
    },
    {
     "name": "max_abs_error_ppm",
     "unit": null,
     "description": "parts per million (no kernel unit for ppm, left undeclared)"
    },
    {
     "name": "ladder",
     "unit": "1",
     "description": "Sequence with | at covered bonds and . at uncovered ones."
    }
   ],
   "selftests": [
    {
     "name": "Gly b1 = C2H3NO residue + proton, closed form from AME2020 element masses + CODATA 2018 proton (58.028740; textbook 58.0287); y1 of Ala = protonated alanine C3H8NO2+ (90.054955; textbook 90.0550); rel 1e-9, float sums only",
     "checks": [
      "constants.water_Da",
      "formula_unmodified",
      "series_mz.b.0",
      "series_mz.y.0"
     ]
    },
    {
     "name": "PEPTIDE C34H53N7O15: textbook [M+H]+ 800.3672, y1 148.0604, b2 227.1026, y2 263.0874 (4 decimals, abs 5e-5); M and 2+ m/z closed form from element masses (rel 1e-9)",
     "checks": [
      "complement_residual_max_Da",
      "formula_unmodified",
      "mh_mz",
      "neutral_mass_Da",
      "precursor_mz",
      "series_mz.b.1",
      "series_mz.y.0",
      "series_mz.y.1"
     ]
    },
    {
     "name": "a/c/x/z/z+1 offsets (Roepstorff-Fohlman/Biemann), closed form for GA: a1 = Gly immonium CH4N+ 30.033826, c1 75.055289, x1 = y1+CO-2H 116.034219, z1 = y1-NH3 73.028406, z+1 = z1+H 74.036231; rel 1e-9",
     "checks": [
      "series_mz.a.0",
      "series_mz.c.0",
      "series_mz.x.0",
      "series_mz.z.0",
      "series_mz.zdot.0"
     ]
    },
    {
     "name": "modifications, closed form by composition: ACDK with fixed carbamidomethyl C (+C2H3NO) = C18H32N6O8S, [M+H]+ 493.207510 (z=1 so precursor m/z equals it); rel 1e-9",
     "checks": [
      "mh_mz",
      "modified",
      "precursor_mz"
     ]
    },
    {
     "name": "variable phospho on S1 of SAK (+HPO3), closed form C12H25N4O8P [M+H]+ 385.148277; rel 1e-9",
     "checks": [
      "mh_mz"
     ]
    },
    {
     "name": "doubly charged fragment, closed form: PEPTIDE y2(2+) = (D + E + H2O + 2 proton)/2 = 132.047327; rel 1e-9",
     "checks": [
      "ions.3.mz",
      "ions.3.name"
     ]
    },
    {
     "name": "matching, exact by construction: PEPTIDE peaks at b2 +10 ppm, y1 +10, y2 -10, y3 +30 (outside 20 ppm), 500 (decoy) -> 3 of 5 peaks, bonds 2,5,6 of 6 (coverage 0.5), mean 10/3 ppm, rms 10 ppm, intensity 200/250; ppm abs 1e-6",
     "checks": [
      "bonds_covered",
      "intensity_explained_fraction",
      "ladder",
      "max_abs_error_ppm",
      "mean_error_ppm",
      "peaks_explained_fraction",
      "peaks_matched",
      "rms_error_ppm",
      "sequence_coverage"
     ]
    }
   ],
   "title": "Peptide fragment ions",
   "needs_build": true,
   "category": "Mass spectrometry",
   "known_answers": 32
  },
  {
   "name": "ph_speciation",
   "version": "0.1.0",
   "summary": "Exact Henderson-Hasselbalch polyprotic acid-base microspecies solver: species fractions, net charge at pH, molar buffer capacity, and pH-dependent logD from intrinsic logP.",
   "runtime": "native",
   "timeout_s": 30,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "pkas",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Acid dissociation constants pKa1, pKa2, ..."
    },
    {
     "name": "max_charge",
     "type": "integer",
     "unit": null,
     "default": 0,
     "enum": null,
     "description": "Charge of the fully protonated species (0 for carboxylic acid, +1 for amine/amino acid)."
    },
    {
     "name": "ph",
     "type": "number",
     "unit": "1",
     "default": 7.4,
     "enum": null,
     "description": null
    },
    {
     "name": "logp",
     "type": "number",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "Optional intrinsic neutral logP to compute logD(pH)."
    }
   ],
   "outputs": [
    {
     "name": "ph",
     "unit": "1",
     "description": null
    },
    {
     "name": "net_charge",
     "unit": "1",
     "description": null
    },
    {
     "name": "dominant_charge",
     "unit": "1",
     "description": null
    },
    {
     "name": "neutral_fraction",
     "unit": "1",
     "description": null
    },
    {
     "name": "buffer_capacity",
     "unit": "1",
     "description": null
    },
    {
     "name": "logd",
     "unit": "1",
     "description": null
    },
    {
     "name": "species",
     "unit": null,
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "acetic acid (pKa 4.76) at pH 4.76 -> charge -0.5, neutral 0.5, beta = ln(10)/4 = 0.575646",
     "checks": [
      "buffer_capacity",
      "logd",
      "net_charge",
      "neutral_fraction"
     ]
    },
    {
     "name": "glycine (pKa 2.34, 9.60; max_charge +1) at pH 5.97 -> zwitterion net charge 0.0",
     "checks": [
      "dominant_charge",
      "net_charge"
     ]
    }
   ],
   "title": "Acid-base pH speciation & logD",
   "needs_build": true,
   "category": "Chemistry",
   "known_answers": 6
  },
  {
   "name": "phylo_tree",
   "version": "0.1.0",
   "summary": "Evolutionary distances from aligned DNA (p-distance, Jukes-Cantor 1969, Kimura two-parameter 1980, with large-sample standard errors) or a distance matrix given directly, and trees from them by neighbour joining (Saitou-Nei, Studier-Keppler form) and UPGMA: Newick text, branch lengths, tree-against-input residuals, cophenetic correlation, and the three-point (ultrametric) and four-point (additive) tests.",
   "runtime": "native",
   "timeout_s": 120,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "model",
     "type": "string",
     "unit": null,
     "default": "jc69",
     "enum": [
      "p",
      "jc69",
      "k2p"
     ],
     "description": "Distance from sequences: \"p\" proportion of differing sites, \"jc69\" Jukes-Cantor d = -(3/4) ln(1 - 4p/3), \"k2p\" Kimura two-parameter d = -(1/2) ln(1 - 2P - Q) - (1/4) ln(1 - 2Q). Ignored for a matrix."
    },
    {
     "name": "gaps",
     "type": "string",
     "unit": null,
     "default": "pairwise",
     "enum": [
      "pairwise",
      "complete"
     ],
     "description": "Missing sites ('-', '?', N, IUPAC ambiguity letters): \"pairwise\" skips a site only for the pairs where it is missing; \"complete\" skips a site missing in any sequence for all pairs."
    },
    {
     "name": "sequences",
     "type": "object",
     "unit": null,
     "default": {},
     "enum": null,
     "description": "Aligned DNA as {\"name\": \"ACGT...\"}; all the same length. Note: names are taken in sorted order. Give this, or fasta / fasta_file, or a matrix."
    },
    {
     "name": "fasta",
     "type": "string",
     "unit": null,
     "default": "",
     "enum": null,
     "description": "Aligned DNA as FASTA text ('>name' lines, then the bases)."
    },
    {
     "name": "fasta_file",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "An aligned FASTA file."
    },
    {
     "name": "names",
     "type": "array",
     "unit": null,
     "default": [],
     "enum": null,
     "description": "Taxon names, one per row of 'distances' (t1, t2, ... if left out)."
    },
    {
     "name": "distances",
     "type": "array",
     "unit": "1",
     "default": [],
     "enum": null,
     "description": "A square symmetric distance matrix with a zero diagonal, 2 to 200 taxa (substitutions per site or any one unit; the tree's branch lengths come out in the same unit)."
    }
   ],
   "outputs": [
    {
     "name": "taxa_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "site_count",
     "unit": "1",
     "description": "Alignment length (sequences only)."
    },
    {
     "name": "sites_compared_min",
     "unit": "1",
     "description": null
    },
    {
     "name": "ts_tv_ratio",
     "unit": "1",
     "description": "Transitions over transversions, summed over all pairs (null with no transversion)."
    },
    {
     "name": "distance_matrix",
     "unit": "1",
     "description": null
    },
    {
     "name": "min_distance",
     "unit": "1",
     "description": null
    },
    {
     "name": "max_distance",
     "unit": "1",
     "description": null
    },
    {
     "name": "mean_distance",
     "unit": "1",
     "description": null
    },
    {
     "name": "ultrametric",
     "unit": null,
     "description": "Three-point condition holds (to 1e-9 of the largest distance)."
    },
    {
     "name": "three_point_max_violation",
     "unit": "1",
     "description": null
    },
    {
     "name": "additive",
     "unit": null,
     "description": "Four-point condition holds (to 1e-9 of the largest distance)."
    },
    {
     "name": "four_point_max_violation",
     "unit": "1",
     "description": null
    },
    {
     "name": "triangle_violations",
     "unit": "1",
     "description": null
    },
    {
     "name": "nj_newick",
     "unit": null,
     "description": "Neighbour-joining tree, unrooted (the last three nodes meet at the top level)."
    },
    {
     "name": "nj_tree_length",
     "unit": "1",
     "description": null
    },
    {
     "name": "nj_internal_branches",
     "unit": "1",
     "description": "Internal branch lengths, largest first."
    },
    {
     "name": "nj_min_branch",
     "unit": "1",
     "description": null
    },
    {
     "name": "nj_negative_branches",
     "unit": "1",
     "description": null
    },
    {
     "name": "nj_max_abs_residual",
     "unit": "1",
     "description": null
    },
    {
     "name": "nj_rms_residual",
     "unit": "1",
     "description": null
    },
    {
     "name": "nj_cophenetic_r",
     "unit": "1",
     "description": null
    },
    {
     "name": "upgma_newick",
     "unit": null,
     "description": "UPGMA tree, rooted, ultrametric."
    },
    {
     "name": "upgma_tree_length",
     "unit": "1",
     "description": null
    },
    {
     "name": "upgma_root_height",
     "unit": "1",
     "description": null
    },
    {
     "name": "upgma_merge_heights",
     "unit": "1",
     "description": null
    },
    {
     "name": "upgma_merges",
     "unit": null,
     "description": null
    },
    {
     "name": "upgma_max_abs_residual",
     "unit": "1",
     "description": null
    },
    {
     "name": "upgma_rms_residual",
     "unit": "1",
     "description": null
    },
    {
     "name": "upgma_cophenetic_r",
     "unit": "1",
     "description": null
    },
    {
     "name": "leaves",
     "unit": null,
     "description": null
    },
    {
     "name": "pairs",
     "unit": null,
     "description": null
    },
    {
     "name": "better_fit",
     "unit": null,
     "description": "\"nj\", \"upgma\" or \"tie\": the smaller rms residual."
    },
    {
     "name": "tree_ok",
     "unit": null,
     "description": "No negative neighbour-joining branch and no broken triangle inequality."
    },
    {
     "name": "warnings",
     "unit": null,
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "Jukes-Cantor 1969 closed form: 3 of 10 sites differ, p = 0.3, d = -(3/4) ln(0.6) = 0.383119; SE = sqrt(p(1-p)/n)/(1-4p/3) = 0.241523 (rel 1e-9, exact formula)",
     "checks": [
      "max_distance",
      "nj_tree_length",
      "pairs.s1|s2.p_distance",
      "pairs.s1|s2.standard_error"
     ]
    },
    {
     "name": "Kimura 1980 two-parameter closed form: P = Q = 0.1 over 20 sites, d = -(1/2) ln 0.7 - (1/4) ln 0.8 = 0.234123; Kimura variance gives SE = 0.123863; ts/tv = 1 (rel 1e-9, exact formula)",
     "checks": [
      "max_distance",
      "pairs.s1|s2.standard_error",
      "pairs.s1|s2.transitions",
      "pairs.s1|s2.transversions",
      "ts_tv_ratio"
     ]
    },
    {
     "name": "Neighbour joining, five-taxon textbook example (Saitou-Nei method; Wikipedia 'Neighbor joining'): ab 5 ... de 3 gives branches a 2, b 3, c 4, d 2, e 1, internal 3 and 2; additive, so residual 0 (abs 1e-9, exact arithmetic)",
     "checks": [
      "additive",
      "leaves.a.nj_branch",
      "leaves.b.nj_branch",
      "leaves.c.nj_branch",
      "leaves.d.nj_branch",
      "leaves.e.nj_branch",
      "nj_cophenetic_r",
      "nj_internal_branches.0",
      "nj_internal_branches.1",
      "nj_max_abs_residual",
      "nj_tree_length",
      "ultrametric"
     ]
    },
    {
     "name": "UPGMA recovers an ultrametric matrix exactly: the tree ((a:1,b:1):2,(c:2,d:2):1) gives ab 2, cd 4, others 6; merges at heights 1, 2, 3, tree length 9, residual 0, cophenetic r = 1 (abs 1e-12, exact arithmetic)",
     "checks": [
      "ultrametric",
      "upgma_cophenetic_r",
      "upgma_max_abs_residual",
      "upgma_merge_heights.0",
      "upgma_merge_heights.1",
      "upgma_newick",
      "upgma_root_height",
      "upgma_tree_length"
     ]
    },
    {
     "name": "Neighbour joining recovers an additive, non-ultrametric six-taxon matrix exactly: path lengths on the tree ((a:1,b:4):2,(c:3,d:1):5,(e:2,f:6):1) give leaf branches 1,4,3,1,2,6, internal 5,2,1, length 25, residual 0 (abs 1e-9, exact arithmetic)",
     "checks": [
      "additive",
      "leaves.a.nj_branch",
      "leaves.b.nj_branch",
      "leaves.c.nj_branch",
      "leaves.d.nj_branch",
      "leaves.e.nj_branch",
      "leaves.f.nj_branch",
      "nj_internal_branches.0",
      "nj_internal_branches.1",
      "nj_internal_branches.2",
      "nj_max_abs_residual",
      "nj_tree_length",
      "ultrametric"
     ]
    }
   ],
   "title": "Distance tree: neighbour joining and UPGMA",
   "needs_build": true,
   "category": "Genomics",
   "known_answers": 42
  },
  {
   "name": "plate_bending",
   "version": "0.1.0",
   "summary": "Thin rectangular plate simply supported on all four edges (Kirchhoff theory, small deflection) under a uniform pressure, a half-sine pressure or a central force (true point or spread over a patch), by the Navier double sine series: largest deflection, bending and twisting moments, surface and von Mises stresses, corner reaction, convergence with the number of terms; deflection and moment field csv.",
   "runtime": "native",
   "timeout_s": 60,
   "estimate_s": 0.3,
   "inputs": [
    {
     "name": "load",
     "type": "string",
     "unit": null,
     "default": "uniform",
     "enum": [
      "uniform",
      "sinusoidal",
      "point"
     ],
     "description": "uniform pressure over the whole plate; sinusoidal: q0 sin(pi x/a) sin(pi y/b) (one-term exact solution); point: a force at the centre, a true point or spread evenly over patch_x_mm by patch_y_mm."
    },
    {
     "name": "a_m",
     "type": "number",
     "unit": "m",
     "default": 1.0,
     "enum": null,
     "description": "Side along x."
    },
    {
     "name": "b_m",
     "type": "number",
     "unit": "m",
     "default": 1.0,
     "enum": null,
     "description": "Side along y."
    },
    {
     "name": "h_mm",
     "type": "number",
     "unit": "mm",
     "default": 10.0,
     "enum": null,
     "description": "Plate thickness."
    },
    {
     "name": "E_GPa",
     "type": "number",
     "unit": "GPa",
     "default": 200.0,
     "enum": null,
     "description": "Young's modulus (an input: no material table inside)."
    },
    {
     "name": "nu",
     "type": "number",
     "unit": "1",
     "default": 0.3,
     "enum": null,
     "description": "Poisson's ratio."
    },
    {
     "name": "pressure_kPa",
     "type": "number",
     "unit": "kPa",
     "default": 10.0,
     "enum": null,
     "description": "Uniform pressure, or the peak q0 of the half-sine pressure; negative is suction."
    },
    {
     "name": "force_N",
     "type": "number",
     "unit": "N",
     "default": 1000.0,
     "enum": null,
     "description": "Central force (load=point)."
    },
    {
     "name": "patch_x_mm",
     "type": "number",
     "unit": "mm",
     "default": 0.0,
     "enum": null,
     "description": "Width along x of the patch the central force is spread over; 0 with patch_y_mm=0 is a true point."
    },
    {
     "name": "patch_y_mm",
     "type": "number",
     "unit": "mm",
     "default": 0.0,
     "enum": null,
     "description": "Width along y of the load patch."
    },
    {
     "name": "allow_MPa",
     "type": "number",
     "unit": "MPa",
     "default": 0.0,
     "enum": null,
     "description": "Allowable von Mises stress for the pass/fail check; 0 skips the check."
    },
    {
     "name": "terms",
     "type": "integer",
     "unit": "1",
     "default": 399,
     "enum": null,
     "description": "Highest harmonic m and n kept (odd ones carry a centred load)."
    },
    {
     "name": "grid",
     "type": "integer",
     "unit": "1",
     "default": 41,
     "enum": null,
     "description": "Grid points per side for the field csv and the field maxima (made odd so the centre is on it)."
    }
   ],
   "outputs": [
    {
     "name": "ok",
     "unit": "1",
     "description": "true when small deflection, thin plate, settled series and (if asked) the stress check all pass."
    },
    {
     "name": "flexural_rigidity_N_m",
     "unit": "N m",
     "description": "D = E h^3 / (12 (1 - nu^2))."
    },
    {
     "name": "load_total_N",
     "unit": "N",
     "description": null
    },
    {
     "name": "deflection_centre_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "deflection_max_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "deflection_max_at_m",
     "unit": "m",
     "description": null
    },
    {
     "name": "deflection_coeff",
     "unit": "1",
     "description": "w D/(q s^4) (pressure) or w D/(P s^2) (force); s = shorter side: Timoshenko's alpha."
    },
    {
     "name": "moment_x_centre_N_m_per_m",
     "unit": "N m/m",
     "description": null
    },
    {
     "name": "moment_y_centre_N_m_per_m",
     "unit": "N m/m",
     "description": null
    },
    {
     "name": "moment_coeff_short_span",
     "unit": "1",
     "description": "Centre moment spanning the short side over q s^2 (or P): Timoshenko's beta."
    },
    {
     "name": "moment_coeff_long_span",
     "unit": "1",
     "description": "Centre moment spanning the long side over q s^2 (or P): Timoshenko's beta1."
    },
    {
     "name": "moment_max_N_m_per_m",
     "unit": "N m/m",
     "description": "Largest principal bending moment on the grid."
    },
    {
     "name": "moment_max_at_m",
     "unit": "m",
     "description": null
    },
    {
     "name": "stress_max_MPa",
     "unit": "MPa",
     "description": "6 M_max / h^2 at the surface."
    },
    {
     "name": "von_mises_max_MPa",
     "unit": "MPa",
     "description": null
    },
    {
     "name": "twist_corner_N_m_per_m",
     "unit": "N m/m",
     "description": null
    },
    {
     "name": "corner_force_N",
     "unit": "N",
     "description": "Concentrated corner reaction R = 2 Mxy that holds each corner down."
    },
    {
     "name": "corner_force_coeff",
     "unit": "1",
     "description": "R/(q s^2) or R/P: Timoshenko's n."
    },
    {
     "name": "deflection_over_thickness",
     "unit": "1",
     "description": null
    },
    {
     "name": "span_over_deflection",
     "unit": "1",
     "description": null
    },
    {
     "name": "thickness_over_span",
     "unit": "1",
     "description": null
    },
    {
     "name": "terms_used",
     "unit": "1",
     "description": null
    },
    {
     "name": "harmonics_per_side",
     "unit": "1",
     "description": null
    },
    {
     "name": "grid_used",
     "unit": "1",
     "description": null
    },
    {
     "name": "truncation_rel_deflection",
     "unit": "1",
     "description": "Relative change of the centre deflection from the upper half of the harmonics."
    },
    {
     "name": "truncation_rel_moment",
     "unit": "1",
     "description": null
    },
    {
     "name": "convergence",
     "unit": null,
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "Timoshenko & Woinowsky-Krieger, Theory of Plates and Shells, SS plate uniform load table, b/a=1, nu=0.3: alpha=0.00406, beta=beta1=0.0479, corner n=0.065 (tol = half a unit in the table's last digit); D = E h^3/(12(1-nu^2)) closed form rel 1e-9",
     "checks": [
      "corner_force_coeff",
      "deflection_coeff",
      "flexural_rigidity_N_m",
      "moment_coeff_long_span",
      "moment_coeff_short_span"
     ]
    },
    {
     "name": "Timoshenko & Woinowsky-Krieger, SS plate uniform load table, b/a=2, nu=0.3: alpha=0.01013, beta=0.1017, beta1=0.0464 (tol = half a unit in the table's last digit)",
     "checks": [
      "deflection_coeff",
      "moment_coeff_long_span",
      "moment_coeff_short_span"
     ]
    },
    {
     "name": "long plate b/a=20 tends to the strip in cylindrical bending: w = 5 q a^4/(384 D), M = q a^2/8, M_long = nu q a^2/8 (closed form; b/a=20 differs by ~1e-12 per the Levy term e^(-10 pi), series truncation < 1e-7, so rel 1e-6)",
     "checks": [
      "deflection_coeff",
      "moment_coeff_long_span",
      "moment_coeff_short_span"
     ]
    },
    {
     "name": "Navier one-term exact solution, half-sine load q0 sin(pi x/a) sin(pi y/b), a=1 m, b=2 m, q0=10 kPa, E=200 GPa, h=10 mm, nu=0.3: w0 = q0/(pi^4 D (1/a^2+1/b^2)^2), Mx = q0 (1/a^2+nu/b^2)/(pi^2 (1/a^2+1/b^2)^2), My likewise, R = 2 D (1-nu) w0 pi^2/(a b) (closed form, rel 1e-9)",
     "checks": [
      "corner_force_N",
      "deflection_centre_mm",
      "moment_x_centre_N_m_per_m",
      "moment_y_centre_N_m_per_m"
     ]
    },
    {
     "name": "Timoshenko & Woinowsky-Krieger, SS plate central point load table, b/a=1: w = 0.01160 P a^2/D (tol = half a unit in the table's last digit); moments at a true point load are unbounded so they must be null",
     "checks": [
      "deflection_coeff",
      "moment_coeff_short_span"
     ]
    }
   ],
   "title": "Simply supported plate (Navier series)",
   "needs_build": true,
   "category": "Mechanics, CAD and finite elements",
   "known_answers": 17
  },
  {
   "name": "plddt_analyze",
   "version": "0.1.0",
   "summary": "Analyzes AlphaFold pLDDT confidence scores from PDB/mmCIF B-factors: mean/median pLDDT, 4-band confidence fractions, contiguous disordered spans (<50) and confident domains (>=70), plus a pLDDT-colored 3D scene.glb.",
   "runtime": "native",
   "timeout_s": 60,
   "estimate_s": 0.1,
   "inputs": [
    {
     "name": "structure_text",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "structure_file",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "chain",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": null
    }
   ],
   "outputs": [
    {
     "name": "residue_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "mean_plddt",
     "unit": "1",
     "description": null
    },
    {
     "name": "median_plddt",
     "unit": "1",
     "description": null
    },
    {
     "name": "very_high_pct",
     "unit": "%",
     "description": null
    },
    {
     "name": "confident_pct",
     "unit": "%",
     "description": null
    },
    {
     "name": "low_pct",
     "unit": "%",
     "description": null
    },
    {
     "name": "disordered_pct",
     "unit": "%",
     "description": null
    },
    {
     "name": "disordered_region_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "confident_domain_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "scene.glb",
     "unit": null,
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "6 residues [95,92,78,42,35,85] -> mean 71.167, 33.33% disordered, 1 disordered span",
     "checks": [
      "confident_domain_count",
      "disordered_pct",
      "disordered_region_count",
      "mean_plddt",
      "very_high_pct"
     ]
    }
   ],
   "title": "AlphaFold pLDDT confidence",
   "needs_build": true,
   "category": "Structural biology",
   "known_answers": 5
  },
  {
   "name": "plot",
   "version": "0.2.0",
   "summary": "Line plot of columns from a CSV (a file from an earlier run, or inline text), optionally one line per value of a group column, and a second CSV overlaid dashed (theory against simulation). Writes plot.png. Readings: point count, series drawn, the range of each y column.",
   "runtime": "native",
   "timeout_s": 60,
   "estimate_s": 2,
   "inputs": [
    {
     "name": "csv",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "A CSV file with a header row."
    },
    {
     "name": "data",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Inline CSV text, used when csv is not given."
    },
    {
     "name": "x",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Column for the x axis. Default: the first column."
    },
    {
     "name": "y",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Comma-separated columns to plot. Default: every column but x."
    },
    {
     "name": "title",
     "type": "string",
     "unit": null,
     "default": "",
     "enum": null,
     "description": null
    },
    {
     "name": "xlabel",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "ylabel",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "logy",
     "type": "boolean",
     "unit": null,
     "default": false,
     "enum": null,
     "description": null
    },
    {
     "name": "group",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "A column whose values split the rows into separate lines (e.g. one per precompression)."
    },
    {
     "name": "overlay_csv",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "A second CSV with the same columns, drawn dashed in the same colours."
    },
    {
     "name": "label",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Legend name for the first CSV."
    },
    {
     "name": "overlay_label",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Legend name for the overlay."
    }
   ],
   "outputs": [
    {
     "name": "points",
     "unit": null,
     "description": null
    },
    {
     "name": "<column>_min",
     "unit": null,
     "description": null
    },
    {
     "name": "<column>_max",
     "unit": null,
     "description": null
    },
    {
     "name": "plot.png",
     "unit": null,
     "description": null
    },
    {
     "name": "series",
     "unit": null,
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "inline data: three points, y from 0 to 4",
     "checks": [
      "points",
      "y_max",
      "y_min"
     ]
    },
    {
     "name": "grouped: two groups of two points are two lines",
     "checks": [
      "points",
      "series",
      "y_max"
     ]
    }
   ],
   "title": "Plot",
   "needs_build": true,
   "category": "Measurement and data",
   "known_answers": 6
  },
  {
   "name": "potion",
   "version": "0.1.0",
   "summary": "PotionCraft's chemistry engine: draw structures and reactions from SMILES, formula and masses, reaction tables (mmol, equivalents, limiting reagent, yield), MOL/SD/SVG/PNG export, 1D NMR processing. Runs a batch of engine commands on one document (new, smiles, or a staged file); commands=\"<filter>\" lists them with parameters. Save under out/.",
   "runtime": "native",
   "timeout_s": 300,
   "estimate_s": 1,
   "inputs": [
    {
     "name": "steps",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Commands in order: [{\"id\": \"draw.reactionSmiles\", \"params\": {\"text\": \"A.B>>C\"}}, {\"id\": \"reaction.setAmount\", \"params\": {\"row\": 0, \"massMg\": 500, \"reference\": true}}, {\"id\": \"reaction.table\"}, ...]"
    },
    {
     "name": "smiles",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Start from this structure instead of an empty document."
    },
    {
     "name": "open",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Start from a staged file (.potion, .mol, .sdf, ...)."
    },
    {
     "name": "save",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Save the document after the steps, e.g. out/route.potion."
    },
    {
     "name": "commands",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "List the engine's commands whose id contains this text instead of running steps."
    }
   ],
   "outputs": [
    {
     "name": "completed",
     "unit": null,
     "description": null
    },
    {
     "name": "results",
     "unit": null,
     "description": null
    },
    {
     "name": "batch.json",
     "unit": null,
     "description": null
    },
    {
     "name": "out/*",
     "unit": null,
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "aspirin from 1.000 g salicylic acid (138.122 g/mol): 7.240 mmol; 1.000 g aspirin back is a 76.7 % yield",
     "checks": [
      "results.3.rows.0.mmol",
      "results.3.rows.0.mw",
      "results.3.rows.2.formula",
      "results.3.rows.2.yield"
     ]
    }
   ],
   "title": "Chemistry batch",
   "needs_build": true,
   "category": "Chemistry",
   "known_answers": 4
  },
  {
   "name": "primer_check",
   "version": "0.1.0",
   "summary": "PCR primer quality check by counting and exact matching only (no nearest-neighbour tables): length, GC %, GC clamp, homopolymer runs and dinucleotide repeats, self- and cross-complementarity (longest run and longest run at a 3' end), hairpin stems, Wallace and Marmur-Doty melting estimates, and exact primer sites and amplicon size on a template.",
   "runtime": "native",
   "timeout_s": 60,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "forward",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Forward primer, 5'->3', A/C/G/T (spaces, digits, hyphens and primes are skipped)."
    },
    {
     "name": "reverse",
     "type": "string",
     "unit": null,
     "default": "",
     "enum": null,
     "description": "Reverse primer, 5'->3', as ordered (not reverse-complemented). Empty: check the forward primer alone."
    },
    {
     "name": "template",
     "type": "string",
     "unit": null,
     "default": "",
     "enum": null,
     "description": "Template top strand 5'->3', plain or FASTA. Empty: no amplicon."
    },
    {
     "name": "template_file",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Template as a FASTA or plain-text file (used when template is empty)."
    },
    {
     "name": "len_min_nt",
     "type": "integer",
     "unit": "1",
     "default": 18,
     "enum": null,
     "description": "Shortest acceptable primer, nucleotides."
    },
    {
     "name": "len_max_nt",
     "type": "integer",
     "unit": "1",
     "default": 30,
     "enum": null,
     "description": "Longest acceptable primer, nucleotides."
    },
    {
     "name": "gc_min_pct",
     "type": "number",
     "unit": "%",
     "default": 40,
     "enum": null,
     "description": null
    },
    {
     "name": "gc_max_pct",
     "type": "number",
     "unit": "%",
     "default": 60,
     "enum": null,
     "description": null
    },
    {
     "name": "max_run_nt",
     "type": "integer",
     "unit": "1",
     "default": 4,
     "enum": null,
     "description": "Longest acceptable run of one base."
    },
    {
     "name": "max_dinuc_repeats",
     "type": "integer",
     "unit": "1",
     "default": 4,
     "enum": null,
     "description": "Most acceptable consecutive copies of a two-base unit (ATATAT = 3)."
    },
    {
     "name": "max_3p_bp",
     "type": "integer",
     "unit": "1",
     "default": 3,
     "enum": null,
     "description": "Longest acceptable complementary run that includes a 3' end (self or cross dimer), base pairs."
    },
    {
     "name": "max_any_bp",
     "type": "integer",
     "unit": "1",
     "default": 7,
     "enum": null,
     "description": "Longest acceptable complementary run anywhere (self or cross dimer), base pairs."
    },
    {
     "name": "max_hairpin_bp",
     "type": "integer",
     "unit": "1",
     "default": 3,
     "enum": null,
     "description": "Longest acceptable hairpin stem, base pairs."
    },
    {
     "name": "min_hairpin_loop_nt",
     "type": "integer",
     "unit": "1",
     "default": 3,
     "enum": null,
     "description": "Smallest hairpin loop counted, nucleotides."
    },
    {
     "name": "max_tm_diff_K",
     "type": "number",
     "unit": "K",
     "default": 5,
     "enum": null,
     "description": "Largest acceptable Marmur-Doty Tm difference between the primers."
    },
    {
     "name": "max_amplicon_bp",
     "type": "integer",
     "unit": "1",
     "default": 10000,
     "enum": null,
     "description": "Longest product reported, base pairs."
    }
   ],
   "outputs": [
    {
     "name": "forward_length_nt",
     "unit": "1",
     "description": null
    },
    {
     "name": "forward_gc_pct",
     "unit": "%",
     "description": null
    },
    {
     "name": "forward_gc_clamp",
     "unit": "1",
     "description": "G or C among the last five bases."
    },
    {
     "name": "forward_tm_wallace_degC",
     "unit": null,
     "description": "2(A+T) + 4(G+C), in degrees Celsius."
    },
    {
     "name": "forward_tm_marmur_doty_degC",
     "unit": null,
     "description": "64.9 + 41 (G + C - 16.4) / N, in degrees Celsius."
    },
    {
     "name": "forward_max_run_nt",
     "unit": "1",
     "description": null
    },
    {
     "name": "forward_max_dinuc_repeats",
     "unit": "1",
     "description": null
    },
    {
     "name": "forward_self_any_bp",
     "unit": "1",
     "description": null
    },
    {
     "name": "forward_self_3p_bp",
     "unit": "1",
     "description": null
    },
    {
     "name": "forward_hairpin_stem_bp",
     "unit": "1",
     "description": null
    },
    {
     "name": "forward_hairpin_loop_nt",
     "unit": "1",
     "description": null
    },
    {
     "name": "forward_palindrome",
     "unit": "1",
     "description": null
    },
    {
     "name": "reverse_length_nt",
     "unit": "1",
     "description": null
    },
    {
     "name": "reverse_gc_pct",
     "unit": "%",
     "description": null
    },
    {
     "name": "reverse_gc_clamp",
     "unit": "1",
     "description": null
    },
    {
     "name": "reverse_tm_wallace_degC",
     "unit": null,
     "description": "2(A+T) + 4(G+C), in degrees Celsius."
    },
    {
     "name": "reverse_tm_marmur_doty_degC",
     "unit": null,
     "description": "64.9 + 41 (G + C - 16.4) / N, in degrees Celsius."
    },
    {
     "name": "reverse_max_run_nt",
     "unit": "1",
     "description": null
    },
    {
     "name": "reverse_max_dinuc_repeats",
     "unit": "1",
     "description": null
    },
    {
     "name": "reverse_self_any_bp",
     "unit": "1",
     "description": null
    },
    {
     "name": "reverse_self_3p_bp",
     "unit": "1",
     "description": null
    },
    {
     "name": "reverse_hairpin_stem_bp",
     "unit": "1",
     "description": null
    },
    {
     "name": "reverse_hairpin_loop_nt",
     "unit": "1",
     "description": null
    },
    {
     "name": "reverse_palindrome",
     "unit": "1",
     "description": null
    },
    {
     "name": "cross_any_bp",
     "unit": "1",
     "description": null
    },
    {
     "name": "cross_3p_bp",
     "unit": "1",
     "description": null
    },
    {
     "name": "tm_diff_wallace_K",
     "unit": "K",
     "description": null
    },
    {
     "name": "tm_diff_marmur_doty_K",
     "unit": "K",
     "description": null
    },
    {
     "name": "template_length_bp",
     "unit": "1",
     "description": null
    },
    {
     "name": "forward_sites",
     "unit": "1",
     "description": null
    },
    {
     "name": "reverse_sites",
     "unit": "1",
     "description": null
    },
    {
     "name": "amplicon_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "amplicon_bp",
     "unit": "1",
     "description": null
    },
    {
     "name": "amplicon_start",
     "unit": "1",
     "description": "1-based position of the first base on the template top strand."
    },
    {
     "name": "amplicon_end",
     "unit": "1",
     "description": "1-based position of the last base."
    },
    {
     "name": "amplicon_gc_pct",
     "unit": "%",
     "description": null
    },
    {
     "name": "products",
     "unit": null,
     "description": null
    },
    {
     "name": "primers",
     "unit": null,
     "description": null
    },
    {
     "name": "all_ok",
     "unit": "1",
     "description": null
    },
    {
     "name": "n_warnings",
     "unit": "1",
     "description": null
    },
    {
     "name": "warnings",
     "unit": "1",
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "Wallace 2(A+T)+4(G+C), Marmur-Doty 64.9+41(GC-16.4)/N, GC % by count: M13 fwd(-20) GTAAAACGACGGCCAGT has A6 C4 G5 T2 -> 52 degC, 47.0529411765 degC, 9/17 = 52.9411764706 %; last five CCAGT clamp 3; AAAA run 4 (exact arithmetic, rel 1e-9)",
     "checks": [
      "forward_gc_clamp",
      "forward_gc_pct",
      "forward_length_nt",
      "forward_max_run_nt",
      "forward_tm_marmur_doty_degC",
      "forward_tm_wallace_degC"
     ]
    },
    {
     "name": "palindrome ACGTGAATTCGAATTCACGT equals its reverse complement, so two copies pair over all 20 bases including both 3' ends; GC 8/20 = 40 %, Wallace 2*12+4*8 = 56 degC, Marmur-Doty 64.9+41(8-16.4)/20 = 47.68 degC (exact, rel 1e-9)",
     "checks": [
      "forward_gc_pct",
      "forward_palindrome",
      "forward_self_3p_bp",
      "forward_self_any_bp",
      "forward_tm_marmur_doty_degC",
      "forward_tm_wallace_degC"
     ]
    },
    {
     "name": "amplicon by construction: template = (AC)5 + M13 fwd(17) + C10 T10 + revcomp(M13 rev CAGGAAACAGCTATGAC)(17) + (AC)5 = 74 bp; product 17+20+17 = 54 bp at 11..64, one site each, GC 27/54 = 50 % (exact counts)",
     "checks": [
      "amplicon_bp",
      "amplicon_count",
      "amplicon_end",
      "amplicon_gc_pct",
      "amplicon_start",
      "forward_sites",
      "reverse_sites",
      "template_length_bp"
     ]
    },
    {
     "name": "hairpin by construction: A5 + GGCGG + A4 + CCGCC (its reverse complement) + A5, no T so A pairs nowhere -> stem 5 bp, loop 4 nt (exact)",
     "checks": [
      "forward_hairpin_loop_nt",
      "forward_hairpin_stem_bp",
      "forward_length_nt",
      "forward_max_run_nt"
     ]
    },
    {
     "name": "primer dimer by construction: forward A13+GACCT, reverse C13+AGGTC; the 3' pentamers are reverse complements -> 3'-end cross run 5 bp; Wallace 42 vs 68 degC, difference 26 K; run A13 (exact counts)",
     "checks": [
      "all_ok",
      "cross_3p_bp",
      "cross_any_bp",
      "forward_max_run_nt",
      "forward_tm_wallace_degC",
      "reverse_tm_wallace_degC",
      "tm_diff_wallace_K"
     ]
    }
   ],
   "title": "PCR primer check",
   "needs_build": true,
   "category": "Genomics",
   "known_answers": 31
  },
  {
   "name": "protein_digest",
   "version": "0.1.0",
   "summary": "In-silico protease digestion of one protein sequence (trypsin with the proline rule, trypsin without it, Lys-C, chymotrypsin, Glu-C, CNBr, or a custom rule) with up to 5 missed cleavages: every peptide with its positions, formula, monoisotopic and average mass and m/z at charges 1 to 3, the mass balance of the complete digest, and sequence coverage by peptides in a mass window. Masses come from element counts and IUPAC element masses, never from a residue mass table.",
   "runtime": "native",
   "timeout_s": 60,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "sequence",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Protein in one-letter code (20 standard letters, plus U and O), plain or one FASTA record; white space, digits and a final * are ignored. Up to 40000 residues."
    },
    {
     "name": "sequence_file",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "A staged FASTA or plain-text file with one protein, used when sequence is empty."
    },
    {
     "name": "protease",
     "type": "string",
     "unit": null,
     "default": "trypsin",
     "enum": [
      "trypsin",
      "trypsin_p",
      "lys_c",
      "chymotrypsin",
      "chymotrypsin_high",
      "glu_c",
      "glu_c_de",
      "cnbr",
      "none",
      "custom"
     ],
     "description": "trypsin: after K, R, not before P. trypsin_p: after K, R. lys_c: after K. chymotrypsin: after F, Y, W, L, not before P. chymotrypsin_high: after F, Y, W, not before P. glu_c: after E, not before P. glu_c_de: after D, E, not before P. cnbr: after M. none: the intact chain. custom: cut_after and not_before."
    },
    {
     "name": "cut_after",
     "type": "string",
     "unit": null,
     "default": "",
     "enum": null,
     "description": "protease = custom only: residues the cut follows, e.g. \"KR\"."
    },
    {
     "name": "not_before",
     "type": "string",
     "unit": null,
     "default": "",
     "enum": null,
     "description": "protease = custom only: residues that block the cut when they come next, e.g. \"P\"."
    },
    {
     "name": "missed_cleavages",
     "type": "integer",
     "unit": "1",
     "default": 0,
     "enum": null,
     "description": "Most cleavage sites one peptide may span uncut."
    },
    {
     "name": "mass_min_Da",
     "type": "number",
     "unit": "Da",
     "default": 500,
     "enum": null,
     "description": "Lower edge of the monoisotopic neutral mass window used for coverage."
    },
    {
     "name": "mass_max_Da",
     "type": "number",
     "unit": "Da",
     "default": 5000,
     "enum": null,
     "description": "Upper edge of the mass window (greater than mass_min_Da)."
    },
    {
     "name": "cys",
     "type": "string",
     "unit": null,
     "default": "free",
     "enum": [
      "free",
      "carbamidomethyl",
      "carboxymethyl"
     ],
     "description": "Fixed Cys chemistry: free thiol, + C2H3NO (iodoacetamide) or + C2H2O2 (iodoacetic acid)."
    },
    {
     "name": "cnbr_product",
     "type": "string",
     "unit": null,
     "default": "homoserine_lactone",
     "enum": [
      "homoserine_lactone",
      "homoserine",
      "methionine"
     ],
     "description": "protease = cnbr: what each Met cut after becomes (lactone: - CH4S; homoserine: - CH4S + H2O)."
    }
   ],
   "outputs": [
    {
     "name": "protein_length",
     "unit": "1",
     "description": null
    },
    {
     "name": "protein_formula",
     "unit": "1",
     "description": null
    },
    {
     "name": "protein_mono_mass_Da",
     "unit": "Da",
     "description": null
    },
    {
     "name": "protein_avg_mass_Da",
     "unit": "Da",
     "description": null
    },
    {
     "name": "cleavage_sites",
     "unit": "1",
     "description": null
    },
    {
     "name": "n_pieces",
     "unit": "1",
     "description": null
    },
    {
     "name": "n_peptides",
     "unit": "1",
     "description": null
    },
    {
     "name": "longest_piece_length",
     "unit": "1",
     "description": null
    },
    {
     "name": "sum_limit_mono_mass_Da",
     "unit": "Da",
     "description": null
    },
    {
     "name": "sum_limit_avg_mass_Da",
     "unit": "Da",
     "description": null
    },
    {
     "name": "water_mono_mass_Da",
     "unit": "Da",
     "description": null
    },
    {
     "name": "mass_balance_residual_Da",
     "unit": "Da",
     "description": null
    },
    {
     "name": "n_in_window",
     "unit": "1",
     "description": null
    },
    {
     "name": "covered_residues",
     "unit": "1",
     "description": null
    },
    {
     "name": "coverage_pct",
     "unit": "%",
     "description": null
    },
    {
     "name": "peptides_listed",
     "unit": "1",
     "description": null
    },
    {
     "name": "peptides",
     "unit": null,
     "description": "The first 200 peptides; out/peptides.csv holds all. m/z is in thomson (Da per elementary charge), written as plain numbers."
    },
    {
     "name": "files",
     "unit": null,
     "description": "out/peptides.csv (every peptide: positions, formula, masses, m/z 1-3, in window), out/coverage.csv (per residue: peptides in the window covering it)."
    }
   ],
   "selftests": [
    {
     "name": "hand count, trypsin with the proline rule: MAKRPGLKFRPSKKEDRAWK cuts to MAK|RPGLK|FRPSK|K|EDR|AWK (R-P and R-P bonds kept); 2 missed cleavages give 6+5+4 = 15 peptides; masses are hand formulas x IUPAC element masses (closed form, rel 1e-9); pieces sum to protein + 5 H2O",
     "checks": [
      "cleavage_sites",
      "limit_peptides",
      "mass_balance_residual_Da",
      "n_peptides",
      "n_pieces",
      "peptides.2.missed_cleavages",
      "peptides.2.mono_mass_Da",
      "peptides.2.mz2",
      "peptides.2.sequence",
      "protein_formula",
      "protein_mono_mass_Da",
      "sum_limit_mono_mass_Da"
     ]
    },
    {
     "name": "angiotensin II DRVYIHPF intact (protease none): published formula C50H71N13O12; M = 1045.534515 Da from IUPAC element masses (closed form, rel 1e-9); [M+H]+ = 1046.5418, the textbook MS calibrant value (abs 1e-4, 4 decimals); m/z at z = 2, 3 from (M + z m_p)/z with CODATA m_p; average mass from standard atomic weights",
     "checks": [
      "n_pieces",
      "peptides.0.mz1",
      "peptides.0.mz2",
      "peptides.0.mz3",
      "protein_avg_mass_Da",
      "protein_formula",
      "protein_mono_mass_Da"
     ]
    },
    {
     "name": "peptide count n + (n-1) + ... + (n-m): Lys-C on (GK)x10 gives n = 10 pieces, m = 3 gives 10+9+8+7 = 34; GK = Gly + Lys - H2O = C8H17N3O3 and GKGK by hand formula x IUPAC element masses (closed form, rel 1e-9)",
     "checks": [
      "cleavage_sites",
      "mass_balance_residual_Da",
      "n_peptides",
      "n_pieces",
      "peptides.0.formula",
      "peptides.0.mono_mass_Da",
      "peptides.1.mono_mass_Da",
      "peptides.3.sequence"
     ]
    },
    {
     "name": "CNBr on GAMSLMK: cuts after each Met, which becomes homoserine lactone (- CH4S): GA-Hsl = C9H15N3O4, SL-Hsl = C13H23N3O5, K; pieces sum = M + 2 H2O - 2 CH4S (closed form, element masses, rel 1e-9)",
     "checks": [
      "limit_peptides",
      "mass_balance_residual_Da",
      "n_pieces",
      "peptides.0.formula",
      "peptides.0.mono_mass_Da",
      "peptides.1.formula",
      "peptides.1.mono_mass_Da",
      "protein_mono_mass_Da",
      "sum_limit_mono_mass_Da"
     ]
    },
    {
     "name": "hand count, chymotrypsin (after F, Y, W, L, not before P) on AFPAYGWLE: AFPAY|GW|L|E (F-P kept), 4 pieces; GW mass by hand formula x element masses (rel 1e-9)",
     "checks": [
      "limit_peptides",
      "n_pieces",
      "peptides.1.mono_mass_Da"
     ]
    },
    {
     "name": "hand count, Glu-C in phosphate (after D, E, not before P) on AEPGEKDE: AEPGE|KD|E (E-P kept), 3 pieces; AEPGE by hand formula x element masses (rel 1e-9)",
     "checks": [
      "limit_peptides",
      "n_pieces",
      "peptides.0.mono_mass_Da"
     ]
    },
    {
     "name": "coverage by hand: of the tryptic pieces of MAKRPGLKFRPSKKEDRAWK only RPGLK (569.365 Da) and FRPSK (633.360 Da) lie in 500-700 Da, so 10 of 20 residues are covered = 50 % (exact count)",
     "checks": [
      "coverage_pct",
      "covered_residues",
      "n_in_window"
     ]
    },
    {
     "name": "carbamidomethyl Cys (iodoacetamide adds C2H3NO): ACK intact = C14H27N5O5S, mass by hand formula x IUPAC element masses (closed form, rel 1e-9)",
     "checks": [
      "protein_formula",
      "protein_mono_mass_Da"
     ]
    }
   ],
   "title": "Protein digest",
   "needs_build": true,
   "category": "Mass spectrometry",
   "known_answers": 47
  },
  {
   "name": "protein_props",
   "version": "0.1.0",
   "summary": "Computes ProtParam-style physicochemical properties from an amino acid sequence: average MW (Da), isoelectric point (pI), net charge at pH, 280 nm extinction coefficients (oxidized/reduced), GRAVY hydropathy, and aromaticity.",
   "runtime": "native",
   "timeout_s": 30,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "sequence",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Protein sequence (FASTA or raw one-letter amino acids)."
    },
    {
     "name": "ph",
     "type": "number",
     "unit": "1",
     "default": 7.4,
     "enum": null,
     "description": null
    }
   ],
   "outputs": [
    {
     "name": "length",
     "unit": "1",
     "description": null
    },
    {
     "name": "mw_Da",
     "unit": "Da",
     "description": null
    },
    {
     "name": "isoelectric_point",
     "unit": "1",
     "description": null
    },
    {
     "name": "net_charge_at_ph",
     "unit": "1",
     "description": null
    },
    {
     "name": "extinction_280_reduced",
     "unit": "1",
     "description": null
    },
    {
     "name": "extinction_280_oxidized",
     "unit": "1",
     "description": null
    },
    {
     "name": "gravy",
     "unit": "1",
     "description": null
    },
    {
     "name": "aromaticity",
     "unit": "1",
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "human insulin B-chain (30 aa): MW ~3429.9 Da, ext280 2980/3105, pI ~6.9",
     "checks": [
      "extinction_280_oxidized",
      "extinction_280_reduced",
      "isoelectric_point",
      "length",
      "mw_Da"
     ]
    }
   ],
   "title": "Protein physicochemical properties",
   "needs_build": true,
   "category": "Structural biology",
   "known_answers": 5
  },
  {
   "name": "qsar_ridge",
   "version": "0.1.0",
   "summary": "Small-N standardized Ridge QSAR/ADMET regressor with exact Hat-matrix Leave-One-Out cross-validation (R\u00b2, Q\u00b2_LOO, RMSE_LOO) and leverage applicability-domain checks for candidate predictions.",
   "runtime": "native",
   "timeout_s": 30,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "train_x",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "2D array of training feature vectors."
    },
    {
     "name": "train_y",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Training target values (e.g. pIC50)."
    },
    {
     "name": "alpha",
     "type": "number",
     "unit": "1",
     "default": 1.0,
     "enum": null,
     "description": null
    },
    {
     "name": "predict_x",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Optional 2D array of candidate feature vectors to score."
    }
   ],
   "outputs": [
    {
     "name": "n_train",
     "unit": "1",
     "description": null
    },
    {
     "name": "n_features",
     "unit": "1",
     "description": null
    },
    {
     "name": "r2_train",
     "unit": "1",
     "description": null
    },
    {
     "name": "q2_loo",
     "unit": "1",
     "description": null
    },
    {
     "name": "rmse_train",
     "unit": "1",
     "description": null
    },
    {
     "name": "rmse_loo",
     "unit": "1",
     "description": null
    },
    {
     "name": "first_prediction",
     "unit": "1",
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "exact linear SAR y = 2*x1 - 3*x2 + 5 -> R2 = 1.0, Q2_LOO = 1.0, predicts [3,1] = 8.0",
     "checks": [
      "first_prediction",
      "q2_loo",
      "r2_train"
     ]
    }
   ],
   "title": "Ridge QSAR / ADMET model",
   "needs_build": true,
   "category": "Chemistry",
   "known_answers": 3
  },
  {
   "name": "ramachandran",
   "version": "0.1.0",
   "summary": "Computes backbone dihedral angles (phi, psi, omega) from PDB/mmCIF N-CA-C atoms, assigns secondary structure and Ramachandran favored/allowed/outlier fractions, and writes an outlier-highlighted 3D scene.glb.",
   "runtime": "native",
   "timeout_s": 60,
   "estimate_s": 0.1,
   "inputs": [
    {
     "name": "structure_text",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "structure_file",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": null
    }
   ],
   "outputs": [
    {
     "name": "evaluated_residues",
     "unit": "1",
     "description": null
    },
    {
     "name": "favored_pct",
     "unit": "%",
     "description": null
    },
    {
     "name": "allowed_pct",
     "unit": "%",
     "description": null
    },
    {
     "name": "outlier_pct",
     "unit": "%",
     "description": null
    },
    {
     "name": "helix_pct",
     "unit": "%",
     "description": null
    },
    {
     "name": "sheet_pct",
     "unit": "%",
     "description": null
    },
    {
     "name": "first_phi_deg",
     "unit": "deg",
     "description": null
    },
    {
     "name": "first_psi_deg",
     "unit": "deg",
     "description": null
    },
    {
     "name": "scene.glb",
     "unit": null,
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "exact analytical 3-residue helix backbone -> phi = -60 deg, psi = -45 deg, 100% favored helix",
     "checks": [
      "evaluated_residues",
      "favored_pct",
      "first_phi_deg",
      "first_psi_deg",
      "helix_pct"
     ]
    }
   ],
   "title": "Ramachandran backbone validation",
   "needs_build": true,
   "category": "Structural biology",
   "known_answers": 5
  },
  {
   "name": "reaction_network",
   "version": "0.1.0",
   "summary": "Mass-action kinetics of a reaction network written as text ('A + B -> C; k = 0.5', 'A <=> B; kf = 2; kr = 0.5', sources '0 -> A', sinks 'A -> 0'), integrated by 3-stage Radau IIA (order 5, L-stable) with an exact Jacobian and step-doubling error control. Gives concentration histories, final state, half-lives, times and heights of maxima, the conserved totals (left null space of the stoichiometric matrix) and their drift, and an atom balance from formulas or a given composition. Rate of a reaction = k times the product of reactant concentrations raised to their coefficients; k is in (mol/L)^(1-order)/s.",
   "runtime": "native",
   "timeout_s": 120,
   "estimate_s": 0.1,
   "inputs": [
    {
     "name": "network",
     "type": "string",
     "unit": null,
     "default": "A -> B; k = 2\nB -> C; k = 1",
     "enum": null,
     "description": "Reactions and their rate constants, separated by ';' or new lines. One way: 'A + B -> C; k = 0.5'. Both ways: 'N2O4 <=> 2 NO2; kf = 4; kr = 1'. Source '0 -> A', sink 'A -> 0'. Whole coefficients 1 to 6; at most 40 species and 200 one-way steps; '#' starts a comment. k is in (mol/L)^(1-order)/s, order = sum of the reactant coefficients."
    },
    {
     "name": "initial",
     "type": "object",
     "unit": null,
     "default": {
      "A": 1.0
     },
     "enum": null,
     "description": "Starting concentration of each species in mol/L (0 to 1e6); species left out start at 0."
    },
    {
     "name": "t_end_s",
     "type": "number",
     "unit": "s",
     "default": 10.0,
     "enum": null,
     "description": "Length of the run."
    },
    {
     "name": "n_out",
     "type": "integer",
     "unit": "1",
     "default": 201,
     "enum": null,
     "description": "Rows of the history written to out/concentrations.csv (equal intervals, end points included)."
    },
    {
     "name": "rel_tol",
     "type": "number",
     "unit": "1",
     "default": 1e-09,
     "enum": null,
     "description": "Relative error allowed per step."
    },
    {
     "name": "abs_tol_mol_per_L",
     "type": "number",
     "unit": "mol/L",
     "default": 1e-12,
     "enum": null,
     "description": "Concentrations below this are not resolved."
    },
    {
     "name": "formulas",
     "type": "boolean",
     "unit": null,
     "default": false,
     "enum": null,
     "description": "Read species names as plain formulas (H2O, N2O4, CH3OH; no brackets or charges) and check that every reaction balances its atoms and that the atom totals stay put."
    },
    {
     "name": "composition",
     "type": "object",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Atoms of each species, for an atom balance with names that are not formulas: {\"E\": {\"X\": 1}, \"ES\": {\"X\": 1, \"S\": 1}}. Overrides formulas."
    }
   ],
   "outputs": [
    {
     "name": "ok",
     "unit": "1",
     "description": "No negative concentration beyond the tolerance, no conserved total drifting by more than both 1e-8 of its size and abs_tol times its coefficient sum, every reaction balances its atoms."
    },
    {
     "name": "warnings",
     "unit": "1",
     "description": null
    },
    {
     "name": "species",
     "unit": "1",
     "description": null
    },
    {
     "name": "n_species",
     "unit": "1",
     "description": null
    },
    {
     "name": "n_reactions",
     "unit": "1",
     "description": "One-way steps; a reversible reaction counts twice."
    },
    {
     "name": "reactions",
     "unit": null,
     "description": "k is in (mol/L)^(1-order)/s."
    },
    {
     "name": "t_end_s",
     "unit": "s",
     "description": null
    },
    {
     "name": "initial_mol_per_L",
     "unit": null,
     "description": null
    },
    {
     "name": "final_mol_per_L",
     "unit": null,
     "description": null
    },
    {
     "name": "final_rate_mol_per_L_per_s",
     "unit": null,
     "description": null
    },
    {
     "name": "half_life_s",
     "unit": null,
     "description": "First time a species falls to half its starting concentration; null if it never does or starts at 0."
    },
    {
     "name": "peak_time_s",
     "unit": null,
     "description": "Time of the largest concentration: an interior maximum, the start, or the end."
    },
    {
     "name": "peak_mol_per_L",
     "unit": null,
     "description": null
    },
    {
     "name": "peak_kind",
     "unit": "1",
     "description": null
    },
    {
     "name": "maxima_s",
     "unit": null,
     "description": "Every interior maximum of each species."
    },
    {
     "name": "species_table",
     "unit": null,
     "description": null
    },
    {
     "name": "conserved",
     "unit": null,
     "description": "Integer combinations of concentrations no reaction changes (computed from the stoichiometric matrix)."
    },
    {
     "name": "mass_balance_drift_rel",
     "unit": "1",
     "description": "Largest drift of a conserved total or atom total over the run, relative to its size; null if there is none to check."
    },
    {
     "name": "mass_balance_drift_mol_per_L",
     "unit": "mol/L",
     "description": "Largest absolute drift of a conserved total or atom total over the run."
    },
    {
     "name": "atoms",
     "unit": null,
     "description": null
    },
    {
     "name": "atoms_balanced",
     "unit": "1",
     "description": null
    },
    {
     "name": "steady",
     "unit": "1",
     "description": "The largest net rate times t_end is below 1e-6 of the total concentration."
    },
    {
     "name": "residual_rate_per_s",
     "unit": "1/s",
     "description": null
    },
    {
     "name": "stiffness_index",
     "unit": "1",
     "description": "Largest row sum of |Jacobian| times t_end over the output grid: above ~1e3 an explicit method would struggle."
    },
    {
     "name": "most_negative_mol_per_L",
     "unit": "mol/L",
     "description": null
    },
    {
     "name": "n_steps",
     "unit": "1",
     "description": null
    },
    {
     "name": "n_rejected",
     "unit": "1",
     "description": null
    },
    {
     "name": "files",
     "unit": "1",
     "description": "out/concentrations.csv (t_s and one column per species, mol/L), out/species.csv (one row per species)."
    }
   ],
   "selftests": [
    {
     "name": "first order A -> B, k = 0.3 /s, A0 = 1 M: [A](10 s) = exp(-3), [B] = 1 - exp(-3), half-life ln2/k (closed form, rel 1e-6)",
     "checks": [
      "final_mol_per_L.A",
      "final_mol_per_L.B",
      "half_life_s.A",
      "mass_balance_drift_rel"
     ]
    },
    {
     "name": "consecutive A -> B -> C, k1 = 2, k2 = 1 /s (Bateman): B peaks at ln(k1/k2)/(k1-k2) = ln 2 s at A0 (k2/k1)^(k2/(k1-k2)) = 0.5 M; [B](5 s) = 2(exp(-5) - exp(-10)) M (closed form, rel 1e-6)",
     "checks": [
      "final_mol_per_L.B",
      "peak_kind.B",
      "peak_mol_per_L.B",
      "peak_time_s.B"
     ]
    },
    {
     "name": "reversible A <=> B, kf = 2, kr = 0.5 /s: equilibrium [B]/[A] = kf/kr = 4 so [A] = 0.2, [B] = 0.8 M; [A] falls to half at ln(8/3)/(kf+kr) s (closed form, rel 1e-6)",
     "checks": [
      "final_mol_per_L.A",
      "final_mol_per_L.B",
      "half_life_s.A",
      "steady"
     ]
    },
    {
     "name": "second order 2A -> B, rate k[A]^2 per reaction, k = 0.5 L/(mol s): 1/[A] = 1/A0 + 2kt gives [A](9 s) = 0.1 M, half-life 1/(2 k A0) = 1 s; [A] + 2[B] conserved (closed form, rel 1e-6)",
     "checks": [
      "conserved.0.final_mol_per_L",
      "conserved.0.name",
      "final_mol_per_L.A",
      "final_mol_per_L.B",
      "half_life_s.A"
     ]
    },
    {
     "name": "N2O4 <=> 2 NO2, kf = 4, kr = 1 (Kc = 4 M): (2x)^2/(1-x) = 4 gives x = (sqrt5-1)/2, [NO2] = sqrt5 - 1, [N2O4] = (3 - sqrt5)/2 M; N and O atom totals exact (closed form, rel 1e-6; drift 1e-9)",
     "checks": [
      "atoms.N.final_mol_per_L",
      "atoms.O.final_mol_per_L",
      "atoms_balanced",
      "final_mol_per_L.N2O4",
      "final_mol_per_L.NO2",
      "mass_balance_drift_rel"
     ]
    },
    {
     "name": "stiff A -> B -> C, k1 = 1e4, k2 = 1 /s (Bateman, stiffness ratio 1e4): peak at ln(1e4)/9999 s, [B](5 s) = (1e4/9999)(exp(-5) - exp(-5e4)) M (closed form, rel 1e-6)",
     "checks": [
      "final_mol_per_L.B",
      "peak_mol_per_L.B",
      "peak_time_s.B",
      "stiffness_index"
     ]
    },
    {
     "name": "source and sink 0 -> A (k = 1 M/s), A -> 0 (k = 2 /s) from A0 = 0: [A] = (1 - exp(-2t))/2, [A](10 s) = 0.5(1 - exp(-20)) M (closed form, rel 1e-6)",
     "checks": [
      "final_mol_per_L.A",
      "mass_balance_drift_rel"
     ]
    },
    {
     "name": "Robertson (1966) stiff test A -> B (0.04), 2B -> C + B (3e7), B + C -> A + C (1e4) at t = 40 s: y1 = 0.7158270687, y2 = 9.185534765e-6, y3 = 0.2841637457, from an independent fixed-grid 3-stage Radau IIA integration in plain Python that agrees to 13 digits at three step sizes (packs/science2/refs/reaction_network_robertson.py) and matches the 7 digits usually quoted for this benchmark; rel 1e-6 covers the adaptive integrator's accumulated error",
     "checks": [
      "conserved.0.drift_rel",
      "final_mol_per_L.A",
      "final_mol_per_L.B",
      "final_mol_per_L.C"
     ]
    }
   ],
   "title": "Reaction network kinetics",
   "needs_build": true,
   "category": "Chemistry",
   "known_answers": 33
  },
  {
   "name": "resolving_power",
   "version": "0.1.0",
   "summary": "Mass resolving power: FWHM and m/FWHM of a profile peak; the resolving power two formulas or m/z values need (FWHM and 10 % valley), and what a given analyser shows of the doublet (valley, two maxima, peak pull); scaling of resolving power with m/z on Orbitrap, FT-ICR, quadrupole and time-of-flight analysers.",
   "runtime": "native",
   "timeout_s": 30,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "mode",
     "type": "string",
     "unit": null,
     "default": "separate",
     "enum": [
      "separate",
      "peak",
      "scaling"
     ],
     "description": "separate: two species and an analyser; peak: FWHM of a profile peak; scaling: resolving power at another m/z"
    },
    {
     "name": "formula_a",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "first species as a plain formula (e.g. CO); monoisotopic mass from the AME element table"
    },
    {
     "name": "formula_b",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "second species as a plain formula (e.g. N2)"
    },
    {
     "name": "mz_a",
     "type": "number",
     "unit": "Da",
     "default": null,
     "enum": null,
     "description": "first species as an m/z value, used when formula_a is not given"
    },
    {
     "name": "mz_b",
     "type": "number",
     "unit": "Da",
     "default": null,
     "enum": null,
     "description": "second species as an m/z value, used when formula_b is not given"
    },
    {
     "name": "charge",
     "type": "integer",
     "unit": "1",
     "default": 0,
     "enum": null,
     "description": "ion charge for formulas (electron mass removed per charge); 0 compares neutral masses"
    },
    {
     "name": "shape",
     "type": "string",
     "unit": null,
     "default": "gaussian",
     "enum": [
      "gaussian",
      "lorentzian"
     ],
     "description": "peak shape of the doublet"
    },
    {
     "name": "criterion",
     "type": "string",
     "unit": null,
     "default": "fwhm",
     "enum": [
      "fwhm",
      "valley_10pct"
     ],
     "description": "what 'resolved' means: peaks one FWHM apart, or a 10 % valley (each peak 5 % at the midpoint)"
    },
    {
     "name": "analyser",
     "type": "string",
     "unit": null,
     "default": "constant",
     "enum": [
      "constant",
      "orbitrap",
      "fticr",
      "quadrupole",
      "tof"
     ],
     "description": "how resolving power moves with m/z"
    },
    {
     "name": "resolving_power",
     "type": "number",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "FWHM resolving power m/dm of the analyser at reference_mz (not for tof)"
    },
    {
     "name": "reference_mz",
     "type": "number",
     "unit": "Da",
     "default": 200,
     "enum": null,
     "description": "m/z at which resolving_power is quoted"
    },
    {
     "name": "target_mz",
     "type": "number",
     "unit": "Da",
     "default": null,
     "enum": null,
     "description": "scaling: m/z at which the resolving power is wanted"
    },
    {
     "name": "flight_length_m",
     "type": "number",
     "unit": "m",
     "default": 1.0,
     "enum": null,
     "description": "tof: effective flight path"
    },
    {
     "name": "accel_voltage_V",
     "type": "number",
     "unit": "V",
     "default": 20000,
     "enum": null,
     "description": "tof: accelerating voltage"
    },
    {
     "name": "time_spread_ns",
     "type": "number",
     "unit": "ns",
     "default": 1.0,
     "enum": null,
     "description": "tof: FWHM of the arrival-time spread"
    },
    {
     "name": "mz",
     "type": "array",
     "unit": "Da",
     "default": null,
     "enum": null,
     "description": "peak: profile m/z samples, strictly increasing, both sides below half height"
    },
    {
     "name": "intensity",
     "type": "array",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "peak: intensity at each m/z sample"
    },
    {
     "name": "baseline",
     "type": "number",
     "unit": "1",
     "default": 0,
     "enum": null,
     "description": "peak: background subtracted before the widths are measured"
    }
   ],
   "outputs": [
    {
     "name": "mode",
     "unit": "1",
     "description": null
    },
    {
     "name": "required_resolving_power",
     "unit": "1",
     "description": null
    },
    {
     "name": "required_resolving_power_10pct_valley",
     "unit": "1",
     "description": null
    },
    {
     "name": "valley_10pct_over_fwhm_factor",
     "unit": "1",
     "description": null
    },
    {
     "name": "mz_a",
     "unit": "Da",
     "description": null
    },
    {
     "name": "mz_b",
     "unit": "Da",
     "description": null
    },
    {
     "name": "mean_mz",
     "unit": "Da",
     "description": null
    },
    {
     "name": "delta_mDa",
     "unit": "mDa",
     "description": null
    },
    {
     "name": "delta_ppm",
     "unit": null,
     "description": "mass difference over mean m/z, in parts per million (ppm is not in the kernel unit table)"
    },
    {
     "name": "resolving_power",
     "unit": "1",
     "description": null
    },
    {
     "name": "fwhm_mDa",
     "unit": "mDa",
     "description": null
    },
    {
     "name": "separation_in_fwhm",
     "unit": "1",
     "description": null
    },
    {
     "name": "valley_over_single_peak",
     "unit": "1",
     "description": "summed signal at the midpoint, in units of one peak's height"
    },
    {
     "name": "sum_at_centre_over_single_peak",
     "unit": "1",
     "description": null
    },
    {
     "name": "summed_maximum_over_single_peak",
     "unit": "1",
     "description": null
    },
    {
     "name": "valley_percent_of_maximum",
     "unit": "%",
     "description": null
    },
    {
     "name": "two_maxima",
     "unit": "1",
     "description": null
    },
    {
     "name": "peak_pull_mDa",
     "unit": "mDa",
     "description": null
    },
    {
     "name": "peak_pull_ppm",
     "unit": null,
     "description": "apex shift in parts per million (ppm is not in the kernel unit table)"
    },
    {
     "name": "resolving_power_margin",
     "unit": "1",
     "description": null
    },
    {
     "name": "resolved",
     "unit": "1",
     "description": null
    },
    {
     "name": "resolved_fwhm",
     "unit": "1",
     "description": null
    },
    {
     "name": "resolved_10pct_valley",
     "unit": "1",
     "description": null
    },
    {
     "name": "apex_mz",
     "unit": "Da",
     "description": null
    },
    {
     "name": "apex_intensity",
     "unit": "1",
     "description": null
    },
    {
     "name": "half_height_left_mz",
     "unit": "Da",
     "description": null
    },
    {
     "name": "half_height_right_mz",
     "unit": "Da",
     "description": null
    },
    {
     "name": "sigma_equivalent_mDa",
     "unit": "mDa",
     "description": null
    },
    {
     "name": "width_10pct_mDa",
     "unit": "mDa",
     "description": null
    },
    {
     "name": "width_10pct_over_fwhm",
     "unit": "1",
     "description": null
    },
    {
     "name": "asymmetry",
     "unit": "1",
     "description": null
    },
    {
     "name": "centroid_mz",
     "unit": "Da",
     "description": null
    },
    {
     "name": "samples_across_fwhm",
     "unit": "1",
     "description": null
    },
    {
     "name": "sample_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "target_mz",
     "unit": "Da",
     "description": null
    },
    {
     "name": "reference_mz",
     "unit": "Da",
     "description": null
    },
    {
     "name": "reference_resolving_power",
     "unit": "1",
     "description": null
    },
    {
     "name": "ratio_to_reference",
     "unit": "1",
     "description": null
    },
    {
     "name": "scaling_exponent",
     "unit": "1",
     "description": null
    },
    {
     "name": "flight_time_us",
     "unit": "us",
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "CO vs N2 from AME2016 masses (C 12, O 15.99491461957, N 14.00307400443): R = mean m / dm = 2492.6 (closed form, 1e-9); Gaussian 10 % valley factor sqrt(ln 20 / ln 2)",
     "checks": [
      "delta_mDa",
      "required_resolving_power",
      "required_resolving_power_10pct_valley",
      "valley_10pct_over_fwhm_factor"
     ]
    },
    {
     "name": "sampled Gaussian, sigma 2 mDa at m/z 500: FWHM = 2 sqrt(2 ln 2) sigma = 2.35482 sigma, W10/FWHM = sqrt(ln 10 / ln 2); tol 1e-6 rel because the crossings come from a local cubic at sigma/20 sampling (error ~4e-7)",
     "checks": [
      "apex_mz",
      "fwhm_mDa",
      "resolving_power",
      "width_10pct_over_fwhm"
     ]
    },
    {
     "name": "two equal Gaussians one FWHM apart (closed form): midpoint 2 exp(-ln 2) = 1, at a centre 1 + 2^-4 = 1.0625, two maxima (separation > 2 sigma), no 10 % valley",
     "checks": [
      "resolved_10pct_valley",
      "separation_in_fwhm",
      "sum_at_centre_over_single_peak",
      "two_maxima",
      "valley_over_single_peak"
     ]
    },
    {
     "name": "two equal Lorentzians one FWHM apart (closed form): midpoint 1, at a centre 1.2, summed maximum (1 + sqrt 2)/2 from d/dw[(4+2w)/(w^2+4)] = 0, valley 200 (sqrt 2 - 1) %",
     "checks": [
      "sum_at_centre_over_single_peak",
      "summed_maximum_over_single_peak",
      "valley_10pct_over_fwhm_factor",
      "valley_over_single_peak",
      "valley_percent_of_maximum"
     ]
    },
    {
     "name": "Orbitrap R ~ (m/z)^-1/2 (axial frequency law): 140000 at m/z 200 gives 70000 at m/z 800 (closed form, 1e-9)",
     "checks": [
      "fwhm_mDa",
      "ratio_to_reference",
      "resolving_power"
     ]
    },
    {
     "name": "time of flight t = L sqrt(m / 2 z e U) and R = t / (2 dt): L 1 m, U 20 kV, m/z 1000, dt 1 ns (CODATA 2018 dalton, exact e; closed form, 1e-9)",
     "checks": [
      "flight_time_us",
      "resolving_power"
     ]
    },
    {
     "name": "FT-ICR R ~ (m/z)^-1 (cyclotron frequency law): 1000000 at m/z 400 gives 250000 at m/z 1600 (closed form, 1e-9)",
     "checks": [
      "resolving_power"
     ]
    }
   ],
   "title": "Mass resolving power",
   "needs_build": true,
   "category": "Mass spectrometry",
   "known_answers": 24
  },
  {
   "name": "resonator",
   "version": "0.1.0",
   "summary": "A vibration energy harvester as a base-excited mass-spring-damper (Williams and Yates): mass, tuned frequency, mechanical and electrical damping, the source's vibration (RMS acceleration or velocity). Readings: harvested power, relative swing, half-power bandwidth, the power when the source runs off tune, the margin against a power budget, the piezo coupling needed (estimate). File: power.csv (power and swing across +-20 % of the tuned frequency).",
   "runtime": "native",
   "timeout_s": 60,
   "estimate_s": 1,
   "inputs": [
    {
     "name": "mass_kg",
     "type": "number",
     "unit": "kg",
     "default": 0.01,
     "enum": null,
     "description": null
    },
    {
     "name": "natural_frequency_Hz",
     "type": "number",
     "unit": "Hz",
     "default": 25.0,
     "enum": null,
     "description": null
    },
    {
     "name": "zeta_mech",
     "type": "number",
     "unit": "1",
     "default": 0.01,
     "enum": null,
     "description": "Mechanical damping ratio (air, clamps, material)."
    },
    {
     "name": "zeta_elec",
     "type": null,
     "unit": "1",
     "default": "matched",
     "enum": null,
     "description": "Harvested (electrical) damping ratio, or \"matched\" (= mechanical: the most power)."
    },
    {
     "name": "frequency_Hz",
     "type": "number",
     "unit": "Hz",
     "default": null,
     "enum": null,
     "description": "The source's frequency (default: the tuned one)."
    },
    {
     "name": "accel_rms_mps2",
     "type": "number",
     "unit": "m/s^2",
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "velocity_rms_mmps",
     "type": "number",
     "unit": "mm/s",
     "default": null,
     "enum": null,
     "description": "RMS vibration velocity, as machine-condition standards give it."
    },
    {
     "name": "detune_pct",
     "type": "number",
     "unit": "%",
     "default": 2.0,
     "enum": null,
     "description": null
    },
    {
     "name": "power_budget_uW",
     "type": "number",
     "unit": "\u00b5W",
     "default": null,
     "enum": null,
     "description": null
    }
   ],
   "outputs": [
    {
     "name": "power_uW",
     "unit": "\u00b5W",
     "description": null
    },
    {
     "name": "swing_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "bandwidth_Hz",
     "unit": "Hz",
     "description": null
    },
    {
     "name": "power_detuned_uW",
     "unit": "\u00b5W",
     "description": null
    },
    {
     "name": "margin",
     "unit": "1",
     "description": null
    },
    {
     "name": "power.csv",
     "unit": null,
     "description": null
    },
    {
     "name": "zeta_total",
     "unit": "1",
     "description": null
    },
    {
     "name": "coupling_k2_needed",
     "unit": "1",
     "description": null
    },
    {
     "name": "stiffness_N_per_m",
     "unit": "N/m",
     "description": null
    },
    {
     "name": "base_accel_peak_mps2",
     "unit": "m/s^2",
     "description": null
    },
    {
     "name": "peak_power_uW",
     "unit": "\u00b5W",
     "description": null
    },
    {
     "name": "power_budget_uW",
     "unit": "\u00b5W",
     "description": null
    },
    {
     "name": "detune_pct",
     "unit": "%",
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "tuned, matched damping: P = m A^2 / (16 zeta w_n) (Williams and Yates)",
     "checks": [
      "power_uW"
     ]
    },
    {
     "name": "far below resonance the mass follows the base: swing -> A/w_n^2 (A/w_n^2 at 1 % of f_n, to 1e-3)",
     "checks": [
      "swing_mm"
     ]
    },
    {
     "name": "half-power bandwidth = 2 zeta_total f_n for light damping (to 2 %)",
     "checks": [
      "bandwidth_Hz"
     ]
    }
   ],
   "title": "Harvester power",
   "needs_build": true,
   "category": "Dynamics and control",
   "known_answers": 3
  },
  {
   "name": "restriction_map",
   "version": "0.1.0",
   "summary": "Restriction digest of one DNA sequence, linear or circular, with named enzymes (66 common sites built in, IUPAC degenerate codes, type IIS enzymes that cut outside their site, custom sites): every cut on both strands, overhang type and sequence, fragments in map order and by size, single cutters and non-cutters, and a gel-like band table that says which fragments would run together. It finds sites by exact matching on both strands; it knows nothing of methylation, star activity or buffer.",
   "runtime": "native",
   "timeout_s": 120,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "sequence",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "DNA, plain or one FASTA or GenBank record; A C G T (U read as T) and IUPAC codes; white space and digits are ignored. Up to 5 000 000 bases. A second FASTA record is refused. An ambiguous base matches a site only if every expansion fits."
    },
    {
     "name": "sequence_file",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "A staged FASTA, GenBank or plain-text file with one sequence, used when sequence is empty."
    },
    {
     "name": "topology",
     "type": "string",
     "unit": null,
     "default": "linear",
     "enum": [
      "linear",
      "circular"
     ],
     "description": "circular: sites across the origin are found and n cuts give n fragments."
    },
    {
     "name": "enzymes",
     "type": "array",
     "unit": null,
     "default": [
      "EcoRI",
      "BamHI",
      "HindIII"
     ],
     "enum": null,
     "description": "Built-in enzyme names (case ignored), or [\"all\"] for every built-in one."
    },
    {
     "name": "custom_sites",
     "type": "array",
     "unit": null,
     "default": [],
     "enum": null,
     "description": "Extra sites as \"Name=SITE\": IUPAC letters with ^ at the top-strand cut (G^AATTC), _ at the bottom-strand cut for a non-palindromic site (GAGTCNNNN^N_), or SITE(a/b) for cuts a and b bases past the site on top and bottom strand (GGTCTC(1/5))."
    },
    {
     "name": "resolution_pct",
     "type": "number",
     "unit": "%",
     "default": 5,
     "enum": null,
     "description": "Fragments whose sizes differ by less than this share of the larger one are reported as one gel band."
    }
   ],
   "outputs": [
    {
     "name": "length_bp",
     "unit": "1",
     "description": "sequence length, base pairs"
    },
    {
     "name": "gc_percent",
     "unit": "%",
     "description": null
    },
    {
     "name": "n_enzymes",
     "unit": "1",
     "description": null
    },
    {
     "name": "n_cuts",
     "unit": "1",
     "description": "distinct top-strand cut positions, all enzymes together"
    },
    {
     "name": "n_fragments",
     "unit": "1",
     "description": "0 for an uncut circle"
    },
    {
     "name": "fragments_bp",
     "unit": "1",
     "description": "combined digest, largest first, base pairs"
    },
    {
     "name": "fragments_in_order_bp",
     "unit": "1",
     "description": "combined digest in map order, base pairs"
    },
    {
     "name": "sum_fragments_bp",
     "unit": "1",
     "description": null
    },
    {
     "name": "largest_fragment_bp",
     "unit": "1",
     "description": null
    },
    {
     "name": "smallest_fragment_bp",
     "unit": "1",
     "description": null
    },
    {
     "name": "n_bands",
     "unit": "1",
     "description": null
    },
    {
     "name": "enzymes",
     "unit": null,
     "description": "Per enzyme alone: site, cuts as 'after base p' (1-based, top-strand numbering) on each strand, overhang, its own fragments largest first."
    },
    {
     "name": "cuts",
     "unit": null,
     "description": "Every cut in map order (first 2000; all in out/cuts.csv). strand: + site on top, - on bottom, both palindromic."
    },
    {
     "name": "fragments",
     "unit": null,
     "description": "Combined digest in map order (first 2000; all in out/fragments.csv)."
    },
    {
     "name": "gel",
     "unit": null,
     "description": "Bands largest first; mass_fraction is the share of the DNA in the band."
    },
    {
     "name": "files",
     "unit": null,
     "description": "out/cuts.csv, out/fragments.csv, out/gel.csv"
    }
   ],
   "selftests": [
    {
     "name": "site placement by hand, EcoRI G^AATTC on a linear 50-mer with sites starting at bases 11 and 37: top strand cut after 11 and 37, bottom after 15 and 41 (4-nt 5' overhang AATT); a palindromic site is counted once (2 cuts, not 4); linear n cuts give n + 1 = 3 fragments of 11, 26, 13 bp summing to 50 (exact counts)",
     "checks": [
      "cuts.0.overhang",
      "enzymes.EcoRI.cuts_bottom_after_bp",
      "enzymes.EcoRI.cuts_top_after_bp",
      "enzymes.EcoRI.overhang_nt",
      "enzymes.EcoRI.overhang_type",
      "enzymes.EcoRI.palindromic",
      "fragments_in_order_bp",
      "length_bp",
      "n_cuts",
      "n_fragments",
      "non_cutters",
      "single_cutters",
      "sum_fragments_bp"
     ]
    },
    {
     "name": "the same 50-mer as a circle: n = 2 cuts give n = 2 fragments, 37 - 11 = 26 bp and 50 - 26 = 24 bp (exact counts)",
     "checks": [
      "enzymes.EcoRI.cuts_top_after_bp",
      "fragments_bp",
      "n_cuts",
      "n_fragments",
      "sum_fragments_bp"
     ]
    },
    {
     "name": "site across the origin of a 20-bp circle (AATTC...G, the G is base 20): one EcoRI cut after base 20 on top and after base 4 on the bottom strand, the circle opens to one 20-bp fragment (exact counts)",
     "checks": [
      "cuts.0.overhang",
      "enzymes.EcoRI.cuts_bottom_after_bp",
      "enzymes.EcoRI.cuts_top_after_bp",
      "fragments_bp",
      "n_cuts",
      "n_fragments",
      "single_cutters"
     ]
    },
    {
     "name": "the same 20-mer read as linear has no complete site: 0 cuts, 1 fragment of 20 bp, EcoRI a non-cutter (exact counts)",
     "checks": [
      "fragments_bp",
      "n_cuts",
      "n_fragments",
      "non_cutters"
     ]
    },
    {
     "name": "overhang types from the textbook sites, one site each on a linear 34-mer: EcoRI G^AATTC at 5 cuts after 5/9 (5' overhang, 4 nt), PstI CTGCA^G at 15 cuts after 19/15 (3' overhang, 4 nt, TGCA), EcoRV GAT^ATC at 25 cuts after 27/27 (blunt); fragments 5, 14, 8, 7 bp (exact counts)",
     "checks": [
      "cuts.1.overhang",
      "enzymes.EcoRI.cuts_bottom_after_bp",
      "enzymes.EcoRI.cuts_top_after_bp",
      "enzymes.EcoRI.overhang_nt",
      "enzymes.EcoRI.overhang_type",
      "enzymes.EcoRV.cuts_bottom_after_bp",
      "enzymes.EcoRV.cuts_top_after_bp",
      "enzymes.EcoRV.overhang_nt",
      "enzymes.EcoRV.overhang_type",
      "enzymes.PstI.cuts_bottom_after_bp",
      "enzymes.PstI.cuts_top_after_bp",
      "enzymes.PstI.overhang_nt",
      "enzymes.PstI.overhang_type",
      "fragments_bp",
      "fragments_in_order_bp",
      "n_cuts",
      "n_fragments",
      "single_cutters",
      "sum_fragments_bp"
     ]
    },
    {
     "name": "degenerate site matches every expansion: HincII GTY^RAC cuts GTCAAC, GTCGAC, GTTAAC, GTTGAC (sites at 5, 15, 25, 35: cuts after 7, 17, 27, 37) and not the near miss GTAAAC at 45; SalI G^TCGAC cuts only the second (after 15), HpaI GTT^AAC only the third (after 27, shared with HincII); 5 distinct cuts, fragments 7, 8, 2, 10, 10, 17 bp summing to 54 (exact counts)",
     "checks": [
      "enzymes.HincII.cuts_top_after_bp",
      "enzymes.HincII.n_cuts",
      "enzymes.HincII.overhang_type",
      "enzymes.HpaI.cuts_top_after_bp",
      "enzymes.SalI.cuts_bottom_after_bp",
      "enzymes.SalI.cuts_top_after_bp",
      "fragments_in_order_bp",
      "n_cuts",
      "n_fragments",
      "single_cutters",
      "sum_fragments_bp"
     ]
    },
    {
     "name": "type IIS enzyme from its definition GGTCTC(1/5), on both strands of a linear 52-mer: the forward site at 11-16 cuts 1 nt past it on top (after 17) and 5 nt past on the bottom (after 21); the reverse-strand site (GAGACC on top at 37-42) cuts 5 nt before it on top (after 31) and 1 nt before on the bottom (after 35); 4-nt 5' overhangs; fragments 17, 14, 21 bp (exact counts)",
     "checks": [
      "cuts.0.strand",
      "cuts.1.strand",
      "enzymes.BsaI.cuts_bottom_after_bp",
      "enzymes.BsaI.cuts_top_after_bp",
      "enzymes.BsaI.overhang_nt",
      "enzymes.BsaI.overhang_type",
      "enzymes.BsaI.palindromic",
      "fragments_in_order_bp",
      "n_cuts",
      "sum_fragments_bp"
     ]
    },
    {
     "name": "custom site X=GG^CC against built-in HaeIII (GG^CC, blunt) on a linear 20-mer with GGCC at 5 and 14: both cut after 6 and 15, 2 distinct cuts, fragments 6, 9, 5 bp (exact counts)",
     "checks": [
      "enzymes.HaeIII.cuts_top_after_bp",
      "enzymes.X.cuts_bottom_after_bp",
      "enzymes.X.cuts_top_after_bp",
      "enzymes.X.overhang_type",
      "fragments_in_order_bp",
      "n_cuts",
      "n_enzymes",
      "sum_fragments_bp"
     ]
    },
    {
     "name": "IUPAC N in a site, by hand: HinfI G^ANTC on a linear 54-mer with GAATC, GACTC, GAGTC, GATTC starting at bases 5, 15, 25, 35 (all four expansions of N) and the near miss GAAATC at 45: top cuts after 5, 15, 25, 35, bottom after 8, 18, 28, 38 (3-nt 5' overhangs AAT, ACT, AGT, ATT); fragments 5, 10, 10, 10, 19 bp (exact counts)",
     "checks": [
      "cuts.0.overhang",
      "cuts.1.overhang",
      "cuts.2.overhang",
      "cuts.3.overhang",
      "enzymes.HinfI.cuts_bottom_after_bp",
      "enzymes.HinfI.cuts_top_after_bp",
      "enzymes.HinfI.overhang_nt",
      "enzymes.HinfI.overhang_type",
      "fragments_in_order_bp",
      "n_cuts",
      "sum_fragments_bp"
     ]
    },
    {
     "name": "reverse-strand cuts of non-palindromic sites, by hand from the definitions, linear 40-mer: ACTGG(1/-1) (top cut 1 nt past the site, bottom 1 nt inside it; 2-nt 3' overhang) lies on the bottom strand where the top reads CCAGT at 13-17, so the top strand is cut after 13 and the bottom after 11; the same enzyme written ACTG_GN^ must agree; built-in SapI GCTCTTC(1/4) lies on the bottom strand where the top reads GAAGAGC at 26-32: top cut 4 nt before it (after 21), bottom 1 nt before it (after 24), 3-nt 5' overhang; fragments 13, 8, 19 bp (exact counts)",
     "checks": [
      "cuts.0.overhang",
      "cuts.0.strand",
      "cuts.2.overhang",
      "cuts.2.strand",
      "enzymes.SapI.cuts_bottom_after_bp",
      "enzymes.SapI.cuts_top_after_bp",
      "enzymes.SapI.overhang_nt",
      "enzymes.SapI.overhang_type",
      "enzymes.X.cuts_bottom_after_bp",
      "enzymes.X.cuts_top_after_bp",
      "enzymes.X.overhang_nt",
      "enzymes.X.overhang_type",
      "enzymes.X.palindromic",
      "enzymes.Y.cuts_bottom_after_bp",
      "enzymes.Y.cuts_top_after_bp",
      "enzymes.Y.overhang_nt",
      "enzymes.Y.overhang_type",
      "fragments_in_order_bp",
      "n_cuts",
      "n_enzymes",
      "single_cutters",
      "sum_fragments_bp"
     ]
    },
    {
     "name": "non-palindromic site across the origin of a 30-bp circle, by hand: BsaI GGTCTC(1/5) with GGT at bases 28-30 and CTC at 1-3; the top cut is 1 nt past the site (after base 4), the bottom 5 nt past (after base 8), overhang bases 5-8 = ACGT; one cut opens the circle to one 30-bp fragment (exact counts)",
     "checks": [
      "cuts.0.overhang",
      "cuts.0.site_start_bp",
      "cuts.0.strand",
      "enzymes.BsaI.cuts_bottom_after_bp",
      "enzymes.BsaI.cuts_top_after_bp",
      "enzymes.BsaI.overhang_nt",
      "enzymes.BsaI.overhang_type",
      "fragments_bp",
      "n_cuts",
      "n_fragments",
      "single_cutters"
     ]
    },
    {
     "name": "ambiguous bases in the sequence, by the rule that every expansion must fit, linear 33-mer: GANTC at 5 is a HinfI site whatever N is (cut after 5, bottom after 8); GRATTC at 14 is not an EcoRI site (GGATTC is not); GAATTC at 24 is (cut after 24); fragments 5, 19, 9 bp (exact counts)",
     "checks": [
      "enzymes.EcoRI.cuts_bottom_after_bp",
      "enzymes.EcoRI.cuts_top_after_bp",
      "enzymes.HinfI.cuts_bottom_after_bp",
      "enzymes.HinfI.cuts_top_after_bp",
      "fragments_in_order_bp",
      "n_cuts",
      "sum_fragments_bp"
     ]
    }
   ],
   "title": "Restriction map",
   "needs_build": true,
   "category": "Genomics",
   "known_answers": 128
  },
  {
   "name": "rigid_body_spin",
   "version": "0.1.0",
   "summary": "Torque-free rotation of a rigid body: Euler's equations in the principal body frame, integrated by classical RK4. Gives the angular velocity history, the conserved rotational energy and angular momentum and how far RK4 drifted from them, the polhode (body-frame precession) period by the Jacobi-elliptic closed form and as measured from the history, the body- and space-frame precession rates of an axisymmetric body, and for steady spin about each principal axis whether it is stable, with the wobble or growth rate by the linearised closed form and as measured by a perturbed RK4 probe. The body is given by its three principal moments or as a uniform box. Writes out/trace.csv and out/stability.csv.",
   "runtime": "native",
   "timeout_s": 30,
   "estimate_s": 0.1,
   "inputs": [
    {
     "name": "body",
     "type": "string",
     "unit": null,
     "default": "moments",
     "enum": [
      "moments",
      "box"
     ],
     "description": "\"moments\": give I1_kg_m2, I2_kg_m2, I3_kg_m2. \"box\": a uniform rectangular block, give mass_kg and size_x_m, size_y_m, size_z_m (axis 1 is x, 2 is y, 3 is z)."
    },
    {
     "name": "I1_kg_m2",
     "type": "number",
     "unit": "kg m^2",
     "default": 1.0,
     "enum": null,
     "description": "Principal moment of inertia about body axis 1."
    },
    {
     "name": "I2_kg_m2",
     "type": "number",
     "unit": "kg m^2",
     "default": 2.0,
     "enum": null,
     "description": "Principal moment of inertia about body axis 2."
    },
    {
     "name": "I3_kg_m2",
     "type": "number",
     "unit": "kg m^2",
     "default": 3.0,
     "enum": null,
     "description": "Principal moment of inertia about body axis 3."
    },
    {
     "name": "mass_kg",
     "type": "number",
     "unit": "kg",
     "default": 1.0,
     "enum": null,
     "description": "Box only: mass."
    },
    {
     "name": "size_x_m",
     "type": "number",
     "unit": "m",
     "default": 0.1,
     "enum": null,
     "description": "Box only: edge along body axis 1."
    },
    {
     "name": "size_y_m",
     "type": "number",
     "unit": "m",
     "default": 0.2,
     "enum": null,
     "description": "Box only: edge along body axis 2."
    },
    {
     "name": "size_z_m",
     "type": "number",
     "unit": "m",
     "default": 0.3,
     "enum": null,
     "description": "Box only: edge along body axis 3."
    },
    {
     "name": "omega1_rad_per_s",
     "type": "number",
     "unit": "rad/s",
     "default": 0.0,
     "enum": null,
     "description": "Initial angular velocity about body axis 1."
    },
    {
     "name": "omega2_rad_per_s",
     "type": "number",
     "unit": "rad/s",
     "default": 0.01,
     "enum": null,
     "description": "Initial angular velocity about body axis 2."
    },
    {
     "name": "omega3_rad_per_s",
     "type": "number",
     "unit": "rad/s",
     "default": 1.0,
     "enum": null,
     "description": "Initial angular velocity about body axis 3."
    },
    {
     "name": "duration_s",
     "type": "number",
     "unit": "s",
     "default": 60.0,
     "enum": null,
     "description": "How long to integrate."
    },
    {
     "name": "steps",
     "type": "integer",
     "unit": "1",
     "default": 60000,
     "enum": null,
     "description": "RK4 steps over duration_s."
    },
    {
     "name": "perturbation",
     "type": "number",
     "unit": "1",
     "default": 1e-06,
     "enum": null,
     "description": "Stability probe: the sideways kick given to steady spin about each axis, as a fraction of the spin rate."
    }
   ],
   "outputs": [
    {
     "name": "body",
     "unit": "1",
     "description": null
    },
    {
     "name": "I1_kg_m2",
     "unit": "kg m^2",
     "description": null
    },
    {
     "name": "I2_kg_m2",
     "unit": "kg m^2",
     "description": null
    },
    {
     "name": "I3_kg_m2",
     "unit": "kg m^2",
     "description": null
    },
    {
     "name": "omega0_rad_per_s",
     "unit": "rad/s",
     "description": "initial spin rate |omega|"
    },
    {
     "name": "energy_J",
     "unit": "J",
     "description": "rotational kinetic energy at the start, (I1 w1^2 + I2 w2^2 + I3 w3^2)/2"
    },
    {
     "name": "angular_momentum_kg_m2_per_s",
     "unit": "kg m^2/s",
     "description": "|L| at the start"
    },
    {
     "name": "energy_drift_rel",
     "unit": "1",
     "description": "largest relative change of the energy over the RK4 history"
    },
    {
     "name": "angular_momentum_drift_rel",
     "unit": "1",
     "description": "largest relative change of |L| over the RK4 history"
    },
    {
     "name": "omega1_final_rad_per_s",
     "unit": "rad/s",
     "description": null
    },
    {
     "name": "omega2_final_rad_per_s",
     "unit": "rad/s",
     "description": null
    },
    {
     "name": "omega3_final_rad_per_s",
     "unit": "rad/s",
     "description": null
    },
    {
     "name": "omega_min_rad_per_s",
     "unit": "rad/s",
     "description": "lowest value of each body-frame component over the history"
    },
    {
     "name": "omega_max_rad_per_s",
     "unit": "rad/s",
     "description": "highest value of each body-frame component over the history"
    },
    {
     "name": "omega_max_change_rad_per_s",
     "unit": "rad/s",
     "description": "largest distance of the body-frame angular velocity from its start"
    },
    {
     "name": "max_axis_deviation_deg",
     "unit": "deg",
     "description": "largest angle between the body-frame angular velocity and its start"
    },
    {
     "name": "polhode_period_s",
     "unit": "s",
     "description": "closed form 4 K(k) / lambda (Landau & Lifshitz, Mechanics, section 37); for spin exactly about the largest or smallest axis it is the period of a vanishingly small wobble; null for a sphere, on the separatrix (which includes spin exactly about the intermediate axis) and for spin in the plane of two equal moments"
    },
    {
     "name": "polhode_period_measured_s",
     "unit": "s",
     "description": "from zero crossings of the intermediate-axis component in the RK4 history"
    },
    {
     "name": "polhode_period_rel_error",
     "unit": "1",
     "description": null
    },
    {
     "name": "precession_rate_rad_per_s",
     "unit": "rad/s",
     "description": "2 pi / polhode_period_s"
    },
    {
     "name": "precession_rate_measured_rad_per_s",
     "unit": "rad/s",
     "description": null
    },
    {
     "name": "body_precession_rate_rad_per_s",
     "unit": "rad/s",
     "description": "axisymmetric body only: (I_axis - I_side) / I_side * omega_axis, signed; null otherwise"
    },
    {
     "name": "space_precession_rate_rad_per_s",
     "unit": "rad/s",
     "description": "axisymmetric body only: |L| / I_side, the rate the symmetry axis cones about L"
    },
    {
     "name": "polhode_circles_axis",
     "unit": "1",
     "description": "1, 2 or 3: the principal axis the angular velocity circles in the body"
    },
    {
     "name": "regime",
     "unit": "1",
     "description": "largest or smallest: the principal axis the angular velocity circles; separatrix: on the dividing line (includes spin exactly about the intermediate axis); steady: spin in the plane of two equal moments, it does not move; sphere"
    },
    {
     "name": "nearest_axis",
     "unit": "1",
     "description": null
    },
    {
     "name": "start_off_axis_deg",
     "unit": "deg",
     "description": null
    },
    {
     "name": "unstable_axis",
     "unit": "1",
     "description": "the intermediate axis, or null when two moments are equal"
    },
    {
     "name": "spin_stable",
     "unit": "1",
     "description": "false when the largest component of the starting spin is about the intermediate axis; a rule of thumb, read max_axis_deviation_deg for what the spin actually did"
    },
    {
     "name": "stability",
     "unit": null,
     "description": "steady spin at omega0 about each principal axis: kind (stable, unstable, or neutral when the axis is one of two equal moments: a kick then neither oscillates nor grows exponentially, it can drift in proportion to time), closed-form and measured rate, measured growth of the kick"
    },
    {
     "name": "steps",
     "unit": "1",
     "description": null
    },
    {
     "name": "step_s",
     "unit": "s",
     "description": null
    },
    {
     "name": "duration_s",
     "unit": "s",
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "axisymmetric body I=(2,2,3), w=(0.1,0,1): body-frame precession (I3-I1)/I1*w3 = 0.5 rad/s, period 4 pi; after two periods (8 pi s) w returns to its start (Goldstein, free symmetric top). RK4 tolerance 1e-8 at h = 2.5e-4 s",
     "checks": [
      "angular_momentum_drift_rel",
      "angular_momentum_kg_m2_per_s",
      "body_precession_rate_rad_per_s",
      "energy_J",
      "energy_drift_rel",
      "omega1_final_rad_per_s",
      "omega2_final_rad_per_s",
      "omega3_final_rad_per_s",
      "polhode_period_s",
      "precession_rate_measured_rad_per_s",
      "space_precession_rate_rad_per_s"
     ]
    },
    {
     "name": "sphere I=(2.5,2.5,2.5): Euler's equations give zero rate of change, so the angular velocity never moves; E = I|w|^2/2 = 2.1125 J, L = I|w| = 3.25",
     "checks": [
      "angular_momentum_kg_m2_per_s",
      "energy_J",
      "omega1_final_rad_per_s",
      "omega2_final_rad_per_s",
      "omega3_final_rad_per_s",
      "omega_max_change_rad_per_s",
      "regime",
      "unstable_axis"
     ]
    },
    {
     "name": "triaxial I=(1,2,3), w=(sqrt 3, 0, sqrt 2): modulus k^2 = 1/2 exactly, so the polhode period is 4 K / sqrt 2 with K(1/2) = Gamma(1/4)^2 / (4 sqrt pi) = 1.8540746773013719 (lemniscatic value), T = 5.244115108584239 s (Landau & Lifshitz section 37); E = 4.5 J, L = sqrt 21. Measured period 1e-6: linear interpolation of zero crossings at h = 1e-3 s",
     "checks": [
      "angular_momentum_drift_rel",
      "angular_momentum_kg_m2_per_s",
      "energy_J",
      "energy_drift_rel",
      "polhode_circles_axis",
      "polhode_period_measured_s",
      "polhode_period_s"
     ]
    },
    {
     "name": "I=(1,2,3), w=(0,1,0.01) so |w| = sqrt 1.0001: linearised Euler equations for steady spin at |w| give growth rate |w| sqrt((I2-I1)(I3-I2)/(I1 I3)) = sqrt(1.0001/3) about axis 2 and wobble rates |w| sqrt((Ia-Ij)(Ia-Ik)/(Ij Ik)) = sqrt(1.0001/3) (axis 1) and sqrt 1.0001 (axis 3); the spin near axis 2 leaves it (flips past 90 deg), a kick about axes 1 and 3 stays at its size (amplification 1). Measured rates 1e-3: linear theory read from a finite 1e-6 kick",
     "checks": [
      "energy_drift_rel",
      "max_axis_deviation_deg",
      "omega0_rad_per_s",
      "spin_stable",
      "stability.axis_1.amplification",
      "stability.axis_1.kind",
      "stability.axis_1.rate_measured_rad_per_s",
      "stability.axis_2.amplification",
      "stability.axis_2.kind",
      "stability.axis_2.rate_closed_rad_per_s",
      "stability.axis_2.rate_measured_rad_per_s",
      "stability.axis_3.amplification",
      "stability.axis_3.kind",
      "stability.axis_3.rate_measured_rad_per_s",
      "unstable_axis"
     ]
    },
    {
     "name": "uniform box 1.2 kg, 0.1 x 0.2 x 0.4 m: I = m (b^2 + c^2) / 12 gives (0.02, 0.017, 0.005) kg m^2 (textbook cuboid); the intermediate axis is axis 2 (y), growth rate at 10 rad/s = 10 sqrt((0.003)(0.012)/(0.02*0.005)) = 6 rad/s",
     "checks": [
      "I1_kg_m2",
      "I2_kg_m2",
      "I3_kg_m2",
      "energy_J",
      "omega_max_change_rad_per_s",
      "spin_stable",
      "stability.axis_2.rate_closed_rad_per_s",
      "stability.axis_2.rate_measured_rad_per_s",
      "unstable_axis"
     ]
    },
    {
     "name": "I=(3,2,1), steady spin 2 rad/s about axis 3 (smallest moment): linearised wobble rate w sqrt((I3-I1)(I3-I2)/(I1 I2)) = 2/sqrt 3, so the small-wobble polhode period is 2 pi sqrt 3 / 2 = pi sqrt 3 (k -> 0, K = pi/2); the wobble is an ellipse with axis ratio sqrt(I1 (I3-I1) / (I2 (I3-I2))) = sqrt 3, so a kick about axis 1 grows to sqrt 3 times its size and no further; axis 1 wobbles at 2 sqrt((3-2)(3-1)/(2*1)) = 2 rad/s; axis 2 grows at 2 sqrt((3-2)(2-1)/(3*1)) = 2/sqrt 3. Amplification 1e-5: the peak is read from 2000 samples per wobble",
     "checks": [
      "angular_momentum_kg_m2_per_s",
      "energy_J",
      "polhode_circles_axis",
      "polhode_period_s",
      "regime",
      "spin_stable",
      "stability.axis_1.rate_closed_rad_per_s",
      "stability.axis_1.rate_measured_rad_per_s",
      "stability.axis_2.kind",
      "stability.axis_2.rate_closed_rad_per_s",
      "stability.axis_3.amplification",
      "stability.axis_3.kind",
      "stability.axis_3.rate_closed_rad_per_s",
      "stability.axis_3.rate_measured_rad_per_s",
      "stability.axis_3.wobble_amplification_closed",
      "unstable_axis"
     ]
    },
    {
     "name": "scale check, I=(1,2,3)e-300 kg m^2, w=(sqrt 3, 0, sqrt 2): Euler's equations hold only ratios of the moments, so the period is the same T = 4 K(1/2) / sqrt 2 = 5.244115108584239 s as for I=(1,2,3) (Landau & Lifshitz section 37) and the stability rates are |w| sqrt(1/3) and |w| with |w| = sqrt 5",
     "checks": [
      "polhode_circles_axis",
      "polhode_period_measured_s",
      "polhode_period_s",
      "stability.axis_2.rate_closed_rad_per_s",
      "stability.axis_3.kind",
      "stability.axis_3.rate_closed_rad_per_s",
      "unstable_axis"
     ]
    }
   ],
   "title": "Rigid body spin (torque-free)",
   "needs_build": true,
   "category": "Dynamics and control",
   "known_answers": 73
  },
  {
   "name": "sasa",
   "version": "0.1.0",
   "summary": "Solvent-accessible surface area by Shrake-Rupley point counting (probe 1.4 \u00c5) from PDB or mmCIF text or a file: total, per-residue and per-chain area, polar and apolar parts, relative accessibility against the residue alone, buried residues, area lost between chains.",
   "runtime": "native",
   "timeout_s": 300,
   "estimate_s": 0.5,
   "inputs": [
    {
     "name": "structure_text",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "PDB (fixed columns) or mmCIF text. Only the first model is used; water is always left out."
    },
    {
     "name": "structure_file",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "A PDB or mmCIF file instead of structure_text (@r0001/model.pdb)."
    },
    {
     "name": "probe_radius_A",
     "type": "number",
     "unit": "\u00c5",
     "default": 1.4,
     "enum": null,
     "description": "Solvent probe radius; 1.4 \u00c5 is water. 0 gives the van der Waals surface."
    },
    {
     "name": "n_points",
     "type": "integer",
     "unit": "1",
     "default": 1000,
     "enum": null,
     "description": "Points on each atom sphere (golden-spiral lattice). 100 is quick, about 1 %; 1000 is about 0.1 %."
    },
    {
     "name": "radii_A",
     "type": "object",
     "unit": null,
     "default": {
      "C": 1.7,
      "N": 1.55,
      "O": 1.52,
      "S": 1.8,
      "P": 1.8,
      "SE": 1.9,
      "H": 1.2
     },
     "enum": null,
     "description": "Atom radius per element symbol. The default is the Bondi (1964) van der Waals set (J. Phys. Chem. 68, 441). Every element present must be listed."
    },
    {
     "name": "polar_elements",
     "type": "array",
     "unit": null,
     "default": [
      "N",
      "O"
     ],
     "enum": null,
     "description": "Elements whose area counts as polar."
    },
    {
     "name": "buried_below",
     "type": "number",
     "unit": "1",
     "default": 0.2,
     "enum": null,
     "description": "A residue is buried when its relative accessibility is below this."
    },
    {
     "name": "max_asa_A2",
     "type": "object",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Optional reference area per residue name (e.g. a published maximum-ASA scale). Left out, the reference is the same residue with every other residue removed."
    },
    {
     "name": "chains",
     "type": "string",
     "unit": null,
     "default": "",
     "enum": null,
     "description": "Chain ids to keep, comma separated; empty keeps all."
    },
    {
     "name": "include_hetatm",
     "type": "boolean",
     "unit": null,
     "default": false,
     "enum": null,
     "description": "Count HETATM records (ligands). Their elements must be in radii_A."
    },
    {
     "name": "include_hydrogens",
     "type": "boolean",
     "unit": null,
     "default": false,
     "enum": null,
     "description": "Count hydrogen atoms (most radius sets assume united atoms without them)."
    }
   ],
   "outputs": [
    {
     "name": "total_sasa_A2",
     "unit": "\u00c5^2",
     "description": null
    },
    {
     "name": "polar_sasa_A2",
     "unit": "\u00c5^2",
     "description": null
    },
    {
     "name": "apolar_sasa_A2",
     "unit": "\u00c5^2",
     "description": null
    },
    {
     "name": "polar_fraction",
     "unit": "1",
     "description": null
    },
    {
     "name": "exposed_fraction",
     "unit": "1",
     "description": "Total over the area of every atom alone."
    },
    {
     "name": "free_atoms_sasa_A2",
     "unit": "\u00c5^2",
     "description": null
    },
    {
     "name": "min_atom_sasa_A2",
     "unit": "\u00c5^2",
     "description": null
    },
    {
     "name": "max_atom_sasa_A2",
     "unit": "\u00c5^2",
     "description": null
    },
    {
     "name": "n_atoms",
     "unit": "1",
     "description": null
    },
    {
     "name": "n_residues",
     "unit": "1",
     "description": null
    },
    {
     "name": "n_chains",
     "unit": "1",
     "description": null
    },
    {
     "name": "n_buried_residues",
     "unit": "1",
     "description": null
    },
    {
     "name": "buried_fraction",
     "unit": "1",
     "description": null
    },
    {
     "name": "mean_relative_accessibility",
     "unit": "1",
     "description": null
    },
    {
     "name": "buried_between_chains_A2",
     "unit": "\u00c5^2",
     "description": "Sum of each chain alone minus the assembly: the interface area counted on both sides."
    },
    {
     "name": "half_points_total_sasa_A2",
     "unit": "\u00c5^2",
     "description": null
    },
    {
     "name": "convergence_rel",
     "unit": "1",
     "description": null
    },
    {
     "name": "converged",
     "unit": null,
     "description": "Halving the points moves the total by 1 % or less."
    },
    {
     "name": "point_area_A2",
     "unit": "\u00c5^2",
     "description": null
    },
    {
     "name": "chains",
     "unit": null,
     "description": null
    },
    {
     "name": "residues",
     "unit": null,
     "description": null
    },
    {
     "name": "files",
     "unit": null,
     "description": "out/residues.csv, out/chains.csv, out/atoms.csv"
    }
   ],
   "selftests": [
    {
     "name": "closed form: isolated C atom (r 1.7 A, probe 1.4 A) exposes 4 pi (r + 1.4)^2 = 120.763 A^2; rel 1e-9 (every point is exposed, no counting error)",
     "checks": [
      "exposed_fraction",
      "n_atoms",
      "polar_sasa_A2",
      "total_sasa_A2"
     ]
    },
    {
     "name": "closed form: C and O 30 A apart, polar part 4 pi (1.52+1.4)^2 = 107.146 A^2, apolar 4 pi (1.7+1.4)^2; rel 1e-9 (no overlap); each residue alone so relative accessibility 1",
     "checks": [
      "apolar_sasa_A2",
      "mean_relative_accessibility",
      "polar_fraction",
      "polar_sasa_A2"
     ]
    },
    {
     "name": "closed form: two equal spheres R = 3.1 A at d = 3.1 A along the lattice axis each expose 2 pi R (R + d/2) = 90.572 A^2; exact on the golden-spiral lattice because n (1 - d/2R) / 2 = 250 points is whole, so rel 1e-9; relative accessibility (R + d/2)/2R = 0.75; area lost between chains 2 pi R (2R - d)",
     "checks": [
      "buried_between_chains_A2",
      "max_atom_sasa_A2",
      "mean_relative_accessibility",
      "n_buried_residues",
      "total_sasa_A2"
     ]
    },
    {
     "name": "closed form: O atom wholly inside an S atom (2.92 + 0.2 < 3.2 A) exposes 0; the S exposes its whole 4 pi (1.8+1.4)^2 = 128.680 A^2; rel 1e-9",
     "checks": [
      "min_atom_sasa_A2",
      "total_sasa_A2"
     ]
    },
    {
     "name": "convergence: same pair along x (a general direction for the lattice) with 20000 points within 1e-3 of the closed form 4 pi R (R + d/2) = 181.144 A^2 (point counting; Fibonacci cap error falls as n^-3/4 = 6e-4 here); with buried_below 0.8 both residues (relative 0.75) are buried",
     "checks": [
      "converged",
      "mean_relative_accessibility",
      "n_buried_residues",
      "total_sasa_A2"
     ]
    }
   ],
   "title": "Solvent-accessible surface area",
   "needs_build": true,
   "category": "Structural biology",
   "known_answers": 19
  },
  {
   "name": "seq_align",
   "version": "0.1.0",
   "summary": "Exact Needleman-Wunsch (global) and Smith-Waterman (local) pairwise sequence alignment for proteins (BLOSUM62) and DNA/RNA: alignment score, percent identity, gaps, CIGAR, and aligned strings.",
   "runtime": "native",
   "timeout_s": 60,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "seq_a",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "seq_b",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "mode",
     "type": "string",
     "unit": null,
     "default": "global",
     "enum": [
      "global",
      "local"
     ],
     "description": null
    },
    {
     "name": "seq_type",
     "type": "string",
     "unit": null,
     "default": "protein",
     "enum": [
      "protein",
      "dna"
     ],
     "description": null
    },
    {
     "name": "gap_penalty",
     "type": "integer",
     "unit": null,
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "match_score",
     "type": "integer",
     "unit": null,
     "default": 2,
     "enum": null,
     "description": null
    },
    {
     "name": "mismatch_score",
     "type": "integer",
     "unit": null,
     "default": -1,
     "enum": null,
     "description": null
    }
   ],
   "outputs": [
    {
     "name": "score",
     "unit": "1",
     "description": null
    },
    {
     "name": "aligned_length",
     "unit": "1",
     "description": null
    },
    {
     "name": "matches",
     "unit": "1",
     "description": null
    },
    {
     "name": "gaps",
     "unit": "1",
     "description": null
    },
    {
     "name": "identity_pct",
     "unit": "%",
     "description": null
    },
    {
     "name": "cigar",
     "unit": null,
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "identical protein PAWHEAE global BLOSUM62 -> score 44, 100% identity",
     "checks": [
      "cigar",
      "identity_pct",
      "score"
     ]
    },
    {
     "name": "DNA global ACGTACGT vs ACGTGCGT (match 2, mismatch -1) -> score 13, 87.5% identity",
     "checks": [
      "gaps",
      "identity_pct",
      "score"
     ]
    }
   ],
   "title": "Pairwise sequence alignment",
   "needs_build": true,
   "category": "Genomics",
   "known_answers": 6
  },
  {
   "name": "servo_control",
   "version": "0.1.0",
   "summary": "Generic closed-loop PID electromechanical actuator simulator (RK4) with torque saturation, anti-windup, viscous damping, and load torque: computes rise time, 2% settling time, percent overshoot, steady-state error, peak torque, and mechanical energy. Writes response.csv and plot.png.",
   "runtime": "native",
   "timeout_s": 30,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "inertia_kg_m2",
     "type": "number",
     "unit": "kg m^2",
     "default": 0.005,
     "enum": null,
     "description": null
    },
    {
     "name": "viscous_damping_Nm_s_per_rad",
     "type": "number",
     "unit": "N m s/rad",
     "default": 0.01,
     "enum": null,
     "description": null
    },
    {
     "name": "kp",
     "type": "number",
     "unit": "1",
     "default": 5.0,
     "enum": null,
     "description": null
    },
    {
     "name": "ki",
     "type": "number",
     "unit": "1",
     "default": 0.0,
     "enum": null,
     "description": null
    },
    {
     "name": "kd",
     "type": "number",
     "unit": "1",
     "default": 0.3,
     "enum": null,
     "description": null
    },
    {
     "name": "max_torque_Nm",
     "type": "number",
     "unit": "N m",
     "default": 1000.0,
     "enum": null,
     "description": null
    },
    {
     "name": "load_torque_Nm",
     "type": "number",
     "unit": "N m",
     "default": 0.0,
     "enum": null,
     "description": null
    },
    {
     "name": "target_rad",
     "type": "number",
     "unit": "rad",
     "default": 1.0,
     "enum": null,
     "description": null
    },
    {
     "name": "duration_s",
     "type": "number",
     "unit": "s",
     "default": 2.0,
     "enum": null,
     "description": null
    },
    {
     "name": "dt_s",
     "type": "number",
     "unit": "s",
     "default": 0.0005,
     "enum": null,
     "description": null
    }
   ],
   "outputs": [
    {
     "name": "final_position_rad",
     "unit": "rad",
     "description": null
    },
    {
     "name": "steady_state_error_rad",
     "unit": "rad",
     "description": null
    },
    {
     "name": "overshoot_pct",
     "unit": "%",
     "description": null
    },
    {
     "name": "rise_time_s",
     "unit": "s",
     "description": null
    },
    {
     "name": "settling_time_2pct_s",
     "unit": "s",
     "description": null
    },
    {
     "name": "peak_torque_Nm",
     "unit": "N m",
     "description": null
    },
    {
     "name": "saturation_pct",
     "unit": "%",
     "description": null
    },
    {
     "name": "mechanical_energy_J",
     "unit": "J",
     "description": null
    },
    {
     "name": "closed_loop_wn_rad_s",
     "unit": "rad/s",
     "description": null
    },
    {
     "name": "closed_loop_zeta",
     "unit": "1",
     "description": null
    },
    {
     "name": "response.csv",
     "unit": null,
     "description": null
    },
    {
     "name": "plot.png",
     "unit": null,
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "critically damped PD (J=1, kp=100, kd=20 -> wn=10, zeta=1.0): 0% overshoot, exact settling",
     "checks": [
      "closed_loop_wn_rad_s",
      "closed_loop_zeta",
      "overshoot_pct",
      "steady_state_error_rad"
     ]
    },
    {
     "name": "underdamped PD (zeta=0.5) matches exact analytical overshoot exp(-pi/sqrt(3)) = 16.303%",
     "checks": [
      "closed_loop_zeta",
      "overshoot_pct"
     ]
    }
   ],
   "title": "Closed-loop actuator control",
   "needs_build": true,
   "category": "Dynamics and control",
   "known_answers": 6
  },
  {
   "name": "smiles_graph",
   "version": "0.1.0",
   "summary": "Pure-Rust SMILES molecular graph analyzer: Hill formula, exact monoisotopic mass (Da), average MW (g/mol), RDBE, SSSR ring count, aromaticity, HBD/HBA, rotatable bonds, Ertl TPSA (\u00c5\u00b2), and Lipinski/Veber drug-likeness checks.",
   "runtime": "native",
   "timeout_s": 30,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "smiles",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "SMILES string of a molecule."
    }
   ],
   "outputs": [
    {
     "name": "formula",
     "unit": null,
     "description": null
    },
    {
     "name": "exact_mass_Da",
     "unit": "Da",
     "description": null
    },
    {
     "name": "mw_g_per_mol",
     "unit": "g/mol",
     "description": null
    },
    {
     "name": "rdbe",
     "unit": "1",
     "description": null
    },
    {
     "name": "heavy_atoms",
     "unit": "1",
     "description": null
    },
    {
     "name": "rings",
     "unit": "1",
     "description": null
    },
    {
     "name": "hbd",
     "unit": "1",
     "description": null
    },
    {
     "name": "hba",
     "unit": "1",
     "description": null
    },
    {
     "name": "rotatable_bonds",
     "unit": "1",
     "description": null
    },
    {
     "name": "tpsa_A2",
     "unit": "\u00c5^2",
     "description": null
    },
    {
     "name": "lipinski_pass",
     "unit": null,
     "description": null
    },
    {
     "name": "veber_pass",
     "unit": null,
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "aspirin CC(=O)Oc1ccccc1C(=O)O: C9H8O4, 180.042259 Da, RDBE 6, 1 ring, TPSA 63.60 \u00c5\u00b2",
     "checks": [
      "exact_mass_Da",
      "formula",
      "hba",
      "hbd",
      "rdbe",
      "rings",
      "tpsa_A2"
     ]
    }
   ],
   "title": "SMILES graph & drug-likeness",
   "needs_build": true,
   "category": "Chemistry",
   "known_answers": 7
  },
  {
   "name": "solid",
   "version": "0.2.0",
   "summary": "One parametric solid model of a part or an assembly, built from a model script by SolidCraft's headless CLI (pinned release 0.45.0, B-rep kernel solidcore). The script names parameters (numbers or expressions; `parameters` overrides them), parts made of features (box, cylinder, extruded polygon, hole, fillet, chamfer; each in mode add, cut or intersect) with a density each, and an assembly of instances placed by rotations about world axes then a translation. Readings per instance (`parts.<name>`: volume, mass, centre of mass, bounding box, area), per part summed over its instances (`by_part.<part>`), and for the assembly (mass, centre of mass, bounding box). Files: model.step (AP242, one named body per instance, read back and checked), scene.glb (one mesh per instance, named as it, mm), parts.csv; with drawing_data, drawing.json for the `drawing` instrument (each part in its own frame: exact faces with planes and cylinders, edges, bounding box, mass, and projected views front, top, right, iso and one auxiliary view per slanted hole axis, hidden edges dashed; the assembly's views). Lengths in mm, densities in g/cm3.",
   "runtime": "native",
   "timeout_s": 600,
   "estimate_s": 3,
   "inputs": [
    {
     "name": "model",
     "type": "object",
     "unit": null,
     "default": {
      "name": "plate with a hole",
      "parameters": {
       "L": 40,
       "W": 20,
       "T": 10,
       "D": 6
      },
      "parts": {
       "plate": {
        "material": "aluminium 6061",
        "density_g_cm3": 2.7,
        "features": [
         {
          "op": "box",
          "size": [
           "L",
           "W",
           "T"
          ]
         },
         {
          "op": "hole",
          "at": [
           "L / 4",
           "W / 2",
           "T"
          ],
          "diameter": "D"
         }
        ]
       }
      }
     },
     "enum": null,
     "description": "The model script: {name, parameters: {name: number or expression}, parts: {name: {material, density_g_cm3, color?: [r,g,b], finish?: [metallic, roughness], features: [...]}}, assembly?: [{name, part, rotate?: [{axis: X|Y|Z|[x,y,z], deg}], position?: [x,y,z]}]} (no assembly: each part once, where it is built). Features: {op: box, size: [x,y,z], corner? | center?}, {op: cylinder, radius | diameter, height, base?, axis?: X|Y|Z|[x,y,z]}, {op: extrude, profile: [[x,y]...], distance, origin?, x_dir?, y_dir?, direction?: positive|negative|symmetric}, each with mode?: add|cut|intersect; {op: hole, at: [x,y,z] on a face, diameter, direction?, depth? (default through)}; {op: fillet, edges: [[x,y,z] on an edge], radius}; {op: chamfer, edges, distance}. Any number may be an expression over the parameters (\"L / 2\", sin/cos/tan in degrees). Names: a-z, 0-9, _."
    },
    {
     "name": "model_file",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "The model script as a JSON file instead of `model`."
    },
    {
     "name": "parameters",
     "type": "object",
     "unit": null,
     "default": {},
     "enum": null,
     "description": "Overrides of the model's parameters by name, e.g. {\"T\": 12}."
    },
    {
     "name": "quality",
     "type": "string",
     "unit": null,
     "default": "standard",
     "enum": [
      "standard",
      "fine",
      "finest"
     ],
     "description": "How closely the scene's meshes follow curved faces (picture only; every reading is exact)."
    },
    {
     "name": "drawing_data",
     "type": "boolean",
     "unit": null,
     "default": false,
     "enum": null,
     "description": "Also write drawing.json for the `drawing` instrument: each part built again in its own frame (its volume must equal its placed instances', rel 1e-9), measured on the B-rep (faces with their plane normals and cylinder axes and radii, edges, bounding box, mass) and projected by SolidCraft (file.export_view_dxf: front, top, right, iso, and an auxiliary view along each slanted hole axis; hidden edges kept dashed, hidden pieces lying under visible edges dropped), plus the assembly's views. Readings drawing.parts.<part>.views.<view>.{n_visible, n_hidden} count the edges a person would count."
    }
   ],
   "outputs": [
    {
     "name": "parts",
     "unit": null,
     "description": "per instance: part, material, density_g_cm3, volume_mm3, mass_g, mass_kg, com_mm [x,y,z], com_x_mm.., bbox_min_mm, bbox_max_mm, size_mm, area_mm2, faces"
    },
    {
     "name": "by_part",
     "unit": null,
     "description": "per part, summed over its instances: count, volume_mm3, mass_g, mass_kg, area_mm2"
    },
    {
     "name": "assembly",
     "unit": null,
     "description": "count, mass_g, mass_kg, volume_mm3, area_mm2 (sum of the parts'), com_mm, bbox_min_mm, bbox_max_mm, size_mm"
    },
    {
     "name": "total_mass_kg",
     "unit": "kg",
     "description": null
    },
    {
     "name": "total_mass_g",
     "unit": "g",
     "description": null
    },
    {
     "name": "com_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "size_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "step_ok",
     "unit": null,
     "description": "model.step read back: same number of bodies, volumes within 1e-6"
    },
    {
     "name": "model.step",
     "unit": null,
     "description": null
    },
    {
     "name": "scene.glb",
     "unit": null,
     "description": null
    },
    {
     "name": "parts.csv",
     "unit": null,
     "description": null
    },
    {
     "name": "drawing.json",
     "unit": null,
     "description": "with drawing_data: the facts and views the drawing instrument draws from"
    },
    {
     "name": "drawing",
     "unit": null,
     "description": "with drawing_data: ok, parts.<part>.{mass_g, volume_rel_diff, views.<view>.{n_visible, n_hidden}}, assembly_views, volume_max_rel_diff"
    }
   ],
   "selftests": [
    {
     "name": "box 40 x 20 x 10 mm, 2.70 g/cm3: V = 8000 mm3, A = 2800 mm2, centroid (20, 10, 5), mass 21.6 g",
     "checks": [
      "parts.block.area_mm2",
      "parts.block.com_mm.0",
      "parts.block.com_mm.1",
      "parts.block.com_mm.2",
      "parts.block.mass_g",
      "parts.block.size_mm.0",
      "parts.block.size_mm.1",
      "parts.block.size_mm.2",
      "parts.block.volume_mm3",
      "scene_meshes",
      "step_ok"
     ]
    },
    {
     "name": "cylinder r 5, h 20 mm on Z: V = pi r^2 h = 500 pi, A = 2 pi r h + 2 pi r^2 = 250 pi, centroid (0, 0, h/2)",
     "checks": [
      "parts.rod.area_mm2",
      "parts.rod.com_mm.0",
      "parts.rod.com_mm.1",
      "parts.rod.com_mm.2",
      "parts.rod.mass_g",
      "parts.rod.size_mm.0",
      "parts.rod.size_mm.2",
      "parts.rod.volume_mm3"
     ]
    },
    {
     "name": "box 40 x 20 x 10 with a 6 mm through hole at x 10, y 10: V = 8000 - 90 pi, A = 2800 + 42 pi, centroid x = (8000 x 20 - 90 pi x 10) / V",
     "checks": [
      "parts.plate.area_mm2",
      "parts.plate.com_mm.0",
      "parts.plate.com_mm.1",
      "parts.plate.com_mm.2",
      "parts.plate.volume_mm3"
     ]
    },
    {
     "name": "assembly: steel cube 10 mm (7.85 g/cm3) at the origin and an aluminium pin r 5 x 10 (2.70 g/cm3), both built at the origin, the pin turned 90 deg about Y and moved to (100, 20, 0): combined centre sum(m c) / sum(m) with the cube at (5, 5, 5) and the pin at (105, 20, 0)",
     "checks": [
      "com_mm.0",
      "com_mm.1",
      "com_mm.2",
      "parts.pin.com_mm.0",
      "parts.pin.com_mm.1",
      "parts.pin.com_mm.2",
      "parts.pin.size_mm.0",
      "parts.pin.size_mm.2",
      "scene_meshes",
      "size_mm.0",
      "size_mm.1",
      "size_mm.2",
      "step_bodies",
      "total_mass_g"
     ]
    },
    {
     "name": "trapezoid (0,0) (30,0) (30,10) (0,20) extruded 5 mm: V = 5 x 450, polygon centroid (shoelace), A = 2 x 450 + perimeter x 5",
     "checks": [
      "parts.wedge.area_mm2",
      "parts.wedge.com_mm.0",
      "parts.wedge.com_mm.1",
      "parts.wedge.com_mm.2",
      "parts.wedge.volume_mm3"
     ]
    },
    {
     "name": "parameter override L = 30 on a box L x 20 x 20 (L declared 20), one long edge filleted r 2: V = 20 x 20 x L - (4 - pi) r^2 / 4 x L",
     "checks": [
      "parameters.L",
      "parts.bar.size_mm.0",
      "parts.bar.volume_mm3"
     ]
    },
    {
     "name": "half cylinder R 4 x 12 (a cylinder with a box cut away): V = pi R^2 L / 2, centroid 4R / 3 pi off the flat face, A = pi R^2 + pi R L + 2 R L",
     "checks": [
      "parts.half.area_mm2",
      "parts.half.com_mm.0",
      "parts.half.com_mm.1",
      "parts.half.com_mm.2",
      "parts.half.mass_g",
      "parts.half.volume_mm3"
     ]
    },
    {
     "name": "box 30 x 20 x 10 less a r 2 cylinder cut along Y (80 pi), less a right triangle 10 x 10 extruded through from a sketch at z -1 (500), less a 1 mm chamfer on a 30 mm edge (15): V = 6000 - 80 pi - 515",
     "checks": [
      "parts.block.size_mm.0",
      "parts.block.volume_mm3",
      "step_ok"
     ]
    },
    {
     "name": "drawing data: a box 40 x 20 x 10 with a 6 mm through hole at (10, 10), and an L profile (30 x 20, legs 5 wide) extruded 8: edges a person counts in each view (box: top 4 lines + 1 circle, front and side 4 lines and the hole's 2 hidden lines; L: top 6, front 4 with 1 hidden, side 5), the part rebuilt in its own frame with its instance's volume",
     "checks": [
      "drawing.parts.ell.views.front.n_hidden",
      "drawing.parts.ell.views.front.n_visible",
      "drawing.parts.ell.views.right.n_hidden",
      "drawing.parts.ell.views.right.n_visible",
      "drawing.parts.ell.views.top.n_visible",
      "drawing.parts.plate.mass_g",
      "drawing.parts.plate.views.front.n_hidden",
      "drawing.parts.plate.views.front.n_visible",
      "drawing.parts.plate.views.right.n_hidden",
      "drawing.parts.plate.views.right.n_visible",
      "drawing.parts.plate.views.top.n_hidden",
      "drawing.parts.plate.views.top.n_visible",
      "drawing.volume_max_rel_diff",
      "drawing_ok"
     ]
    }
   ],
   "title": "Solid model",
   "needs_build": true,
   "category": "Mechanics, CAD and finite elements",
   "known_answers": 69
  },
  {
   "name": "spectral_match",
   "version": "0.1.0",
   "summary": "Computes greedy-matched cosine similarity, mass-shifted modified (analog) cosine similarity, and peak-count & intensity-weighted spectral coverage between two MS2 spectra.",
   "runtime": "native",
   "timeout_s": 30,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "query_peaks",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "ref_peaks",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "tol_da",
     "type": "number",
     "unit": "Da",
     "default": 0.01,
     "enum": null,
     "description": null
    },
    {
     "name": "query_precursor_mz",
     "type": "number",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "ref_precursor_mz",
     "type": "number",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": null
    }
   ],
   "outputs": [
    {
     "name": "cosine_similarity",
     "unit": "1",
     "description": null
    },
    {
     "name": "modified_cosine",
     "unit": "1",
     "description": null
    },
    {
     "name": "matched_peaks",
     "unit": "1",
     "description": null
    },
    {
     "name": "peak_coverage",
     "unit": "1",
     "description": null
    },
    {
     "name": "intensity_coverage",
     "unit": "1",
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "identical spectra give cosine 1.0 and 100% coverage",
     "checks": [
      "cosine_similarity",
      "intensity_coverage",
      "peak_coverage"
     ]
    },
    {
     "name": "CH2-shifted analog (+14.01565 Da) has cosine 0.0 but modified cosine 1.0",
     "checks": [
      "cosine_similarity",
      "modified_cosine"
     ]
    }
   ],
   "title": "MS2 spectral similarity & coverage",
   "needs_build": true,
   "category": "Mass spectrometry",
   "known_answers": 5
  },
  {
   "name": "spectrum_clean",
   "version": "0.1.0",
   "summary": "Preprocesses an MS2 fragment peak list: m/z windowing, optional precursor-region removal, centroid merging within tolerance, relative noise cutoff, top-N filtering, and base-peak normalization.",
   "runtime": "native",
   "timeout_s": 30,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "peaks",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Measured MS2 peaks as [[mz, intensity], ...]."
    },
    {
     "name": "min_mz",
     "type": "number",
     "unit": "1",
     "default": 0.0,
     "enum": null,
     "description": null
    },
    {
     "name": "max_mz",
     "type": "number",
     "unit": "1",
     "default": 2000.0,
     "enum": null,
     "description": null
    },
    {
     "name": "min_rel_intensity",
     "type": "number",
     "unit": "1",
     "default": 0.01,
     "enum": null,
     "description": null
    },
    {
     "name": "merge_tol_da",
     "type": "number",
     "unit": "Da",
     "default": 0.01,
     "enum": null,
     "description": null
    },
    {
     "name": "max_peaks",
     "type": "integer",
     "unit": null,
     "default": 200,
     "enum": null,
     "description": null
    },
    {
     "name": "precursor_mz",
     "type": "number",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "precursor_window_da",
     "type": "number",
     "unit": "Da",
     "default": 1.5,
     "enum": null,
     "description": null
    }
   ],
   "outputs": [
    {
     "name": "input_peak_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "peak_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "removed_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "base_peak_mz",
     "unit": "1",
     "description": null
    },
    {
     "name": "total_intensity",
     "unit": "1",
     "description": null
    },
    {
     "name": "peaks",
     "unit": null,
     "description": null
    },
    {
     "name": "cleaned_spectrum.tsv",
     "unit": null,
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "merges split peak, drops noise and precursor ion",
     "checks": [
      "base_peak_mz",
      "peak_count",
      "total_intensity"
     ]
    }
   ],
   "title": "MS2 spectrum preprocessing",
   "needs_build": true,
   "category": "Mass spectrometry",
   "known_answers": 3
  },
  {
   "name": "spectrum_fft",
   "version": "0.1.0",
   "summary": "Spectrum of an equally sampled signal (inline samples, a csv, or a synthetic test signal): windowed FFT amplitude spectrum, peak frequencies and amplitudes refined between bins by a least-squares sine fit, power spectral density (one periodogram or Welch's average), total harmonic distortion, SNR, SINAD, effective bits, SFDR and the noise floor. Writes the spectrum, PSD, peaks and harmonics as csv.",
   "runtime": "native",
   "timeout_s": 120,
   "estimate_s": 0.2,
   "inputs": [
    {
     "name": "samples",
     "type": "array",
     "unit": null,
     "default": [],
     "enum": null,
     "description": "Equally spaced samples, oldest first (16 to 1048576). Give exactly one of samples, csv_text/csv_file, synth."
    },
    {
     "name": "csv_text",
     "type": "string",
     "unit": null,
     "default": "",
     "enum": null,
     "description": "The samples as csv text: one row per sample, one header line allowed, # comments skipped."
    },
    {
     "name": "csv_file",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "The same csv as a file, e.g. \"@r0003/trace.csv\"."
    },
    {
     "name": "column",
     "type": "integer",
     "unit": "1",
     "default": -1,
     "enum": null,
     "description": "csv column holding the signal, counted from 0 (-1: the last column)."
    },
    {
     "name": "time_column",
     "type": "integer",
     "unit": "1",
     "default": -1,
     "enum": null,
     "description": "csv column holding time in seconds, counted from 0; the sample rate is then read from it and the steps must be equal to 0.1 % (-1: none, use sample_rate_Hz)."
    },
    {
     "name": "sample_rate_Hz",
     "type": "number",
     "unit": "Hz",
     "default": 1.0,
     "enum": null,
     "description": "Samples per second."
    },
    {
     "name": "unit",
     "type": "string",
     "unit": null,
     "default": "1",
     "enum": null,
     "description": "Unit of the samples (V, m/s^2, 1). Amplitudes are in it; the PSD is in its square per Hz."
    },
    {
     "name": "window",
     "type": "string",
     "unit": null,
     "default": "hann",
     "enum": [
      "rect",
      "hann",
      "hamming",
      "blackman"
     ],
     "description": "Window over the record (periodic cosine-sum form). rect only when the record holds a whole number of periods."
    },
    {
     "name": "detrend",
     "type": "string",
     "unit": null,
     "default": "mean",
     "enum": [
      "mean",
      "none"
     ],
     "description": "mean: subtract the record's mean before the transform."
    },
    {
     "name": "segment_length",
     "type": "integer",
     "unit": "1",
     "default": 0,
     "enum": null,
     "description": "Welch segment length in samples for the PSD (0: one periodogram of the whole record). Peaks and tone figures always use the whole record."
    },
    {
     "name": "overlap",
     "type": "number",
     "unit": "1",
     "default": 0.5,
     "enum": null,
     "description": "Share of each Welch segment shared with the next."
    },
    {
     "name": "fundamental_Hz",
     "type": "number",
     "unit": "Hz",
     "default": null,
     "enum": null,
     "description": "Optional: the fundamental to measure distortion against (left out: the largest peak)."
    },
    {
     "name": "harmonics",
     "type": "integer",
     "unit": "1",
     "default": 10,
     "enum": null,
     "description": "Highest harmonic order counted as distortion; harmonics above Nyquist are folded back. 0: every harmonic below Nyquist."
    },
    {
     "name": "n_peaks",
     "type": "integer",
     "unit": "1",
     "default": 5,
     "enum": null,
     "description": "Largest number of peaks reported."
    },
    {
     "name": "min_peak_ratio",
     "type": "number",
     "unit": "1",
     "default": 0.001,
     "enum": null,
     "description": "Peaks below this share of the largest amplitude are not reported."
    },
    {
     "name": "synth",
     "type": "object",
     "unit": null,
     "default": {},
     "enum": null,
     "description": "A synthetic signal instead of data: n samples of dc + tones (amplitude sin(2 pi f t + phase)) + a square wave (+amplitude for the first half period) + Gaussian noise (seeded), then an ideal mid-tread quantiser of quantise_bits over +-full_scale."
    }
   ],
   "outputs": [
    {
     "name": "source",
     "unit": null,
     "description": "samples, csv or synth"
    },
    {
     "name": "unit",
     "unit": null,
     "description": "the unit amplitudes are in"
    },
    {
     "name": "sample_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "sample_rate_Hz",
     "unit": "Hz",
     "description": null
    },
    {
     "name": "record_length_s",
     "unit": "s",
     "description": null
    },
    {
     "name": "resolution_Hz",
     "unit": "Hz",
     "description": "bin width of the whole-record spectrum"
    },
    {
     "name": "enbw_bins",
     "unit": "1",
     "description": "equivalent noise bandwidth of the window, in bins"
    },
    {
     "name": "mean",
     "unit": null,
     "description": null
    },
    {
     "name": "rms",
     "unit": null,
     "description": "root mean square after detrending"
    },
    {
     "name": "variance",
     "unit": null,
     "description": "population variance, in the unit squared"
    },
    {
     "name": "peak_to_peak",
     "unit": null,
     "description": null
    },
    {
     "name": "fundamental_Hz",
     "unit": "Hz",
     "description": "refined between bins"
    },
    {
     "name": "fundamental_amplitude",
     "unit": null,
     "description": "peak amplitude of the fitted sine"
    },
    {
     "name": "fundamental_rms",
     "unit": null,
     "description": null
    },
    {
     "name": "fundamental_phase_deg",
     "unit": "deg",
     "description": "phase of A sin(2 pi f t + phase), t = 0 at the first sample"
    },
    {
     "name": "fundamental_bin",
     "unit": "1",
     "description": null
    },
    {
     "name": "fundamental_bin_offset",
     "unit": "1",
     "description": null
    },
    {
     "name": "peak_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "peak2_frequency_Hz",
     "unit": "Hz",
     "description": "the second largest peak, if any"
    },
    {
     "name": "peak2_amplitude",
     "unit": null,
     "description": null
    },
    {
     "name": "peaks",
     "unit": null,
     "description": "the fundamental, then the other peaks by size"
    },
    {
     "name": "harmonics_counted",
     "unit": "1",
     "description": null
    },
    {
     "name": "harmonics",
     "unit": null,
     "description": "first 20 harmonics (all in out/harmonics.csv); relative is amplitude over the fundamental's"
    },
    {
     "name": "harmonic_2_rel",
     "unit": "1",
     "description": null
    },
    {
     "name": "harmonic_3_rel",
     "unit": "1",
     "description": null
    },
    {
     "name": "harmonic_5_rel",
     "unit": "1",
     "description": null
    },
    {
     "name": "thd",
     "unit": "1",
     "description": "sqrt(harmonic power / fundamental power)"
    },
    {
     "name": "thd_percent",
     "unit": "%",
     "description": null
    },
    {
     "name": "thd_dB",
     "unit": null,
     "description": "dB relative to the fundamental"
    },
    {
     "name": "snr_dB",
     "unit": null,
     "description": "fundamental over everything that is not DC, fundamental or a counted harmonic, in dB"
    },
    {
     "name": "sinad_dB",
     "unit": null,
     "description": "fundamental over noise plus harmonics, in dB"
    },
    {
     "name": "enob_bits",
     "unit": "1",
     "description": "(SINAD - 10 log10 1.5) / (20 log10 2)"
    },
    {
     "name": "sfdr_dB",
     "unit": null,
     "description": "fundamental over the largest other spectral line, in dB"
    },
    {
     "name": "signal_power",
     "unit": null,
     "description": "mean square held by the fundamental, unit squared"
    },
    {
     "name": "harmonic_power",
     "unit": null,
     "description": null
    },
    {
     "name": "noise_power",
     "unit": null,
     "description": null
    },
    {
     "name": "psd_method",
     "unit": null,
     "description": "periodogram or welch"
    },
    {
     "name": "segment_length",
     "unit": "1",
     "description": null
    },
    {
     "name": "segment_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "psd_resolution_Hz",
     "unit": "Hz",
     "description": null
    },
    {
     "name": "psd_integral",
     "unit": null,
     "description": "the PSD summed over frequency: the mean square, unit squared"
    },
    {
     "name": "noise_floor_psd",
     "unit": null,
     "description": "noise level of the PSD, unit squared per Hz: the median over frequency (tones do not move it), divided by ln 2 for one periodogram or by (1 - 1/(9 K))^3 for a Welch average of K segments, which is what the median of Gaussian noise falls short of its mean by"
    },
    {
     "name": "warnings",
     "unit": null,
     "description": null
    },
    {
     "name": "spectrum.csv",
     "unit": null,
     "description": null
    },
    {
     "name": "psd.csv",
     "unit": null,
     "description": null
    },
    {
     "name": "peaks.csv",
     "unit": null,
     "description": null
    },
    {
     "name": "harmonics.csv",
     "unit": null,
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "hand-written samples 2.5 sin(pi n / 2), 16 points at 1 kHz: tone at fs/4 = 250 Hz, amplitude 2.5, RMS 2.5/sqrt 2, mean square A^2/2 = 3.125 (definition of a sampled sine; rel 1e-9)",
     "checks": [
      "fundamental_Hz",
      "fundamental_amplitude",
      "fundamental_rms",
      "psd_integral",
      "signal_power"
     ]
    },
    {
     "name": "Parseval on hand-written data: the integers 1..16 have mean 8.5 and variance (n^2-1)/12 = 21.25, and the PSD integrates to it (rel 1e-9)",
     "checks": [
      "mean",
      "psd_integral",
      "variance"
     ]
    },
    {
     "name": "sine of amplitude 3 on bin 200 with offset 1.5, Hann window: amplitude 3, RMS 3/sqrt 2, power 4.5, no distortion (a Hann-windowed tone on a bin occupies exactly 3 bins; rel 1e-9)",
     "checks": [
      "fundamental_Hz",
      "fundamental_amplitude",
      "fundamental_rms",
      "mean",
      "psd_integral",
      "signal_power",
      "thd"
     ]
    },
    {
     "name": "Parseval with Welch (Hann, 1024-sample segments, half overlap): tones of amplitude 2 and 1 on segment bins give variance (2^2+1^2)/2 = 2.5 = integral of the PSD; (16384-1024)/512+1 = 31 segments (rel 1e-9)",
     "checks": [
      "fundamental_Hz",
      "peak2_amplitude",
      "peak2_frequency_Hz",
      "psd_integral",
      "segment_count",
      "variance"
     ]
    },
    {
     "name": "two tones between bins (123.4 Hz amplitude 1 phase 30 deg; 310.7 Hz amplitude 0.25; 4096 points at 1 kHz, Hann): both found at their frequencies and amplitudes (rel 1e-6: the other tone leaks into each fit far below that)",
     "checks": [
      "fundamental_Hz",
      "fundamental_amplitude",
      "fundamental_phase_deg",
      "peak2_amplitude",
      "peak2_frequency_Hz"
     ]
    },
    {
     "name": "square wave (Fourier series 4/pi sum sin(n w t)/n over odd n), 8192 points per period: fundamental 4/pi, 3rd and 5th harmonics 1/3 and 1/5, no 2nd, THD = sqrt(pi^2/8 - 1) = 48.34 % (rel 2e-6: sampling moves harmonic n by (n^2-1)(pi/8192)^2/6)",
     "checks": [
      "fundamental_Hz",
      "fundamental_amplitude",
      "harmonic_2_rel",
      "harmonic_3_rel",
      "harmonic_5_rel",
      "rms",
      "thd",
      "thd_percent"
     ]
    },
    {
     "name": "ideal 12-bit quantiser on a full-scale sine (1021 cycles in 65536 points): SINAD = 6.02 N + 1.76 dB = 74.008 dB, 12 effective bits (abs 0.1 dB, 0.02 bit: the uniform-error model q^2/12 is an approximation)",
     "checks": [
      "enob_bits",
      "fundamental_amplitude",
      "sinad_dB",
      "snr_dB"
     ]
    },
    {
     "name": "white Gaussian noise of RMS 0.5 at 1 kHz, 262144 points, Welch 1024: one-sided PSD = sigma^2/(fs/2) = 5e-4 per Hz, integral sigma^2 = 0.25 (statistical: 2 %, about 8 standard errors)",
     "checks": [
      "noise_floor_psd",
      "psd_integral",
      "rms"
     ]
    },
    {
     "name": "inline samples, no generator: 64 points at 6.4 kHz of 2 sin(2 pi 4n/64 + 30 deg) + 0.5 sin(2 pi 12n/64), rect window: 400 Hz, amplitude 2, phase 30 deg, 3rd harmonic 0.5/2, THD = 0.25, SINAD = SFDR = 20 log10 4, mean square (2^2 + 0.5^2)/2 = 2.125 (Parseval; samples rounded to 1e-12, rel 1e-9)",
     "checks": [
      "fundamental_Hz",
      "fundamental_amplitude",
      "fundamental_phase_deg",
      "fundamental_rms",
      "harmonic_2_rel",
      "harmonic_3_rel",
      "mean",
      "peak2_amplitude",
      "peak2_frequency_Hz",
      "psd_integral",
      "rms",
      "sfdr_dB",
      "signal_power",
      "sinad_dB",
      "thd",
      "thd_percent",
      "variance"
     ]
    },
    {
     "name": "inline samples, no generator: 64 points at 64 Hz of 0.75 + 1.5 cos(2 pi 5n/64) + 0.3 sin(2 pi 10n/64) + 0.15 sin(2 pi 15n/64), Hann window: 5 Hz, amplitude 1.5, phase 90 deg, harmonics 0.2 and 0.1, THD = sqrt(0.2^2 + 0.1^2) = sqrt 0.05, SFDR = 20 log10 5, mean 0.75, variance (1.5^2 + 0.3^2 + 0.15^2)/2 = 1.18125 = PSD integral, Hann noise bandwidth 1.5 bins (samples rounded to 1e-12, rel 1e-9)",
     "checks": [
      "enbw_bins",
      "fundamental_Hz",
      "fundamental_amplitude",
      "fundamental_phase_deg",
      "harmonic_2_rel",
      "harmonic_3_rel",
      "mean",
      "peak2_amplitude",
      "peak2_frequency_Hz",
      "psd_integral",
      "resolution_Hz",
      "sfdr_dB",
      "signal_power",
      "sinad_dB",
      "thd",
      "variance"
     ]
    },
    {
     "name": "inline samples, no generator: +1.5, -1.5 alternating, 16 points at 1 kHz, is 1.5 cos(pi n): a line at the Nyquist frequency fs/2 = 500 Hz of in-phase amplitude 1.5 and RMS 1.5, mean 0, mean square 1.5^2 = 2.25 = PSD integral (definition; rel 1e-9)",
     "checks": [
      "fundamental_Hz",
      "fundamental_amplitude",
      "fundamental_rms",
      "mean",
      "psd_integral",
      "signal_power",
      "thd",
      "variance"
     ]
    },
    {
     "name": "white Gaussian noise of RMS 0.5 at 1 kHz, 262144 points, one periodogram: the noise floor (median / ln 2, the median of an exponential distribution) is the one-sided PSD sigma^2/(fs/2) = 5e-4 per Hz (statistical: 3 %, about 6 standard errors of the median of 131072 Hann-correlated bins)",
     "checks": [
      "noise_floor_psd",
      "psd_integral",
      "segment_count"
     ]
    }
   ],
   "title": "Spectrum (FFT)",
   "needs_build": true,
   "category": "Measurement and data",
   "known_answers": 85
  },
  {
   "name": "spring_design",
   "version": "0.1.0",
   "summary": "Helical compression spring of round wire from wire and coil diameter, active coils, moduli, free length and load: rate, deflection, shear stress with the Wahl factor (Bergstrasser and direct-shear alongside), solid length and clash allowance by end type, buckling (critical deflection and the never-buckles free length), surge frequency, safety factor against a given allowable shear stress. Material figures are inputs; no strength table is built in.",
   "runtime": "native",
   "timeout_s": 30,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "wire_diameter_mm",
     "type": "number",
     "unit": "mm",
     "default": 2.0,
     "enum": null,
     "description": "Wire diameter d."
    },
    {
     "name": "mean_coil_diameter_mm",
     "type": "number",
     "unit": "mm",
     "default": 16.0,
     "enum": null,
     "description": "Mean coil diameter D = outside diameter minus the wire diameter. Must exceed the wire diameter."
    },
    {
     "name": "active_coils",
     "type": "number",
     "unit": "1",
     "default": 10.0,
     "enum": null,
     "description": "Active coils Na (the ones that deflect). Fractions allowed."
    },
    {
     "name": "shear_modulus_GPa",
     "type": "number",
     "unit": "GPa",
     "default": 79.3,
     "enum": null,
     "description": "Shear modulus G of the wire. Default: carbon spring steel."
    },
    {
     "name": "elastic_modulus_GPa",
     "type": "number",
     "unit": "GPa",
     "default": 207.0,
     "enum": null,
     "description": "Elastic modulus E of the wire, used by the buckling check only. Must exceed G. Default: carbon steel."
    },
    {
     "name": "free_length_mm",
     "type": "number",
     "unit": "mm",
     "default": 50.0,
     "enum": null,
     "description": "Unloaded length L0. Must exceed the solid length."
    },
    {
     "name": "load_N",
     "type": "number",
     "unit": "N",
     "default": 40.0,
     "enum": null,
     "description": "Compressive working load F."
    },
    {
     "name": "end_type",
     "type": "string",
     "unit": null,
     "default": "squared_ground",
     "enum": [
      "plain",
      "plain_ground",
      "squared",
      "squared_ground"
     ],
     "description": "How the end coils are finished: sets total coils, solid length and pitch."
    },
    {
     "name": "end_fixity",
     "type": "string",
     "unit": null,
     "default": "fixed_fixed",
     "enum": [
      "fixed_fixed",
      "fixed_pinned",
      "pinned_pinned",
      "fixed_free"
     ],
     "description": "How the ends are held, for buckling (alpha = 0.5, 0.707, 1, 2) and surge (1/2 sqrt(k/m), or 1/4 with a free end). fixed_fixed is a spring between flat parallel plates."
    },
    {
     "name": "density_kg_per_m3",
     "type": "number",
     "unit": "kg/m^3",
     "default": 7850.0,
     "enum": null,
     "description": "Wire density, for the surge frequency. Default: steel."
    },
    {
     "name": "allowable_shear_MPa",
     "type": "number",
     "unit": "MPa",
     "default": null,
     "enum": null,
     "description": "Allowable shear stress of the wire (its torsional yield strength, from the datasheet). Leave out and strength is not judged."
    },
    {
     "name": "min_safety_factor",
     "type": "number",
     "unit": "1",
     "default": 1.2,
     "enum": null,
     "description": "Required allowable / Wahl shear stress at the load."
    },
    {
     "name": "min_clash_allowance",
     "type": "number",
     "unit": "1",
     "default": 0.15,
     "enum": null,
     "description": "Required (force at solid - load) / load: the reserve before the coils touch."
    },
    {
     "name": "operating_frequency_Hz",
     "type": "number",
     "unit": "Hz",
     "default": null,
     "enum": null,
     "description": "Frequency of the applied load, to compare with the surge frequency. Optional."
    },
    {
     "name": "min_surge_ratio",
     "type": "number",
     "unit": "1",
     "default": 15.0,
     "enum": null,
     "description": "Required surge frequency / operating frequency (15 to 20 is the usual rule). Judged only when an operating frequency is given."
    }
   ],
   "outputs": [
    {
     "name": "spring_index",
     "unit": "1",
     "description": null
    },
    {
     "name": "rate_N_per_mm",
     "unit": "N/mm",
     "description": null
    },
    {
     "name": "deflection_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "length_at_load_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "wahl_factor",
     "unit": "1",
     "description": null
    },
    {
     "name": "bergstrasser_factor",
     "unit": "1",
     "description": null
    },
    {
     "name": "direct_shear_factor",
     "unit": "1",
     "description": null
    },
    {
     "name": "shear_stress_MPa",
     "unit": "MPa",
     "description": null
    },
    {
     "name": "shear_stress_uncorrected_MPa",
     "unit": "MPa",
     "description": null
    },
    {
     "name": "shear_stress_bergstrasser_MPa",
     "unit": "MPa",
     "description": null
    },
    {
     "name": "shear_stress_static_MPa",
     "unit": "MPa",
     "description": null
    },
    {
     "name": "total_coils",
     "unit": "1",
     "description": null
    },
    {
     "name": "solid_length_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "pitch_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "travel_to_solid_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "force_at_solid_N",
     "unit": "N",
     "description": null
    },
    {
     "name": "shear_stress_at_solid_MPa",
     "unit": "MPa",
     "description": null
    },
    {
     "name": "clash_margin_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "clash_allowance",
     "unit": "1",
     "description": null
    },
    {
     "name": "solid_at_load",
     "unit": null,
     "description": null
    },
    {
     "name": "buckling_slenderness",
     "unit": "1",
     "description": null
    },
    {
     "name": "stable_free_length_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "absolutely_stable",
     "unit": null,
     "description": null
    },
    {
     "name": "buckling_deflection_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "buckling_margin",
     "unit": "1",
     "description": null
    },
    {
     "name": "buckles",
     "unit": null,
     "description": null
    },
    {
     "name": "active_mass_g",
     "unit": "g",
     "description": null
    },
    {
     "name": "surge_frequency_Hz",
     "unit": "Hz",
     "description": null
    },
    {
     "name": "surge_ratio",
     "unit": "1",
     "description": null
    },
    {
     "name": "safety_factor",
     "unit": "1",
     "description": null
    },
    {
     "name": "safety_factor_at_solid",
     "unit": "1",
     "description": null
    },
    {
     "name": "energy_stored_J",
     "unit": "J",
     "description": null
    },
    {
     "name": "outer_diameter_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "inner_diameter_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "wire_length_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "all_ok",
     "unit": null,
     "description": null
    },
    {
     "name": "problems",
     "unit": null,
     "description": null
    },
    {
     "name": "advisories",
     "unit": null,
     "description": null
    },
    {
     "name": "files",
     "unit": null,
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "closed forms k = G d^4/(8 D^3 Na), Kw = (4C-1)/(4C-4) + 0.615/C, tau = Kw 8FD/(pi d^3): d = 2, D = 16, Na = 10, G = 80 GPa, F = 39.0625 N give k = 3.90625 N/mm and y = 10 mm exactly, C = 8, Kw = 31/28 + 0.615/8, KB = 34/29, Ks = 17/16, tau = Kw 625/pi MPa, energy = k y^2/2 = 0.1953125 J (1e-9: exact arithmetic)",
     "checks": [
      "bergstrasser_factor",
      "deflection_mm",
      "direct_shear_factor",
      "energy_stored_J",
      "rate_N_per_mm",
      "shear_stress_MPa",
      "shear_stress_uncorrected_MPa",
      "spring_index",
      "wahl_factor"
     ]
    },
    {
     "name": "solid length and clash, squared and ground ends (Nt = Na + 2, Ls = d Nt, p = (L0 - 2d)/Na): d = 2, Na = 10, L0 = 50 give Nt = 12, Ls = 24 mm, pitch 4.6 mm, travel 26 mm, force at solid 26 k = 101.5625 N; at F = 39.0625 N length 40 mm, margin 16 mm, allowance 62.5/39.0625 = 1.6; allowable 500 MPa gives safety factor 500/(Kw 625/pi) and 500/(Kw 1625/pi) at solid (1e-9: exact arithmetic)",
     "checks": [
      "all_ok",
      "clash_allowance",
      "clash_margin_mm",
      "force_at_solid_N",
      "length_at_load_mm",
      "pitch_mm",
      "safety_factor",
      "safety_factor_at_solid",
      "shear_stress_at_solid_MPa",
      "solid_at_load",
      "solid_length_mm",
      "total_coils",
      "travel_to_solid_mm"
     ]
    },
    {
     "name": "textbook: Shigley, Mechanical Engineering Design, Example 10-1 (no. 16 music wire d = 0.037 in, OD 7/16 in so D = 0.4005 in, squared ends, 12.5 total turns so Na = 10.5, G = 11.85 Mpsi, load 6.46 lbf, L0 = 2.06 in), converted to SI. Book: k = 4.13 lbf/in, y = 1.56 in, C = 10.8, KB = 1.124, Ls = (Nt + 1) d = 0.4995 in, pitch 0.186 in, stress at that load = Ssy = 145.9 kpsi. Tolerances 0.5 % (1 % on y) because the book carries three figures and rounds between steps (its k is 0.35 % above the closed form); Ls is exact",
     "checks": [
      "bergstrasser_factor",
      "deflection_mm",
      "pitch_mm",
      "rate_N_per_mm",
      "shear_stress_bergstrasser_MPa",
      "solid_length_mm",
      "spring_index",
      "total_coils"
     ]
    },
    {
     "name": "buckling closed form (Shigley eqs. 10-10 to 10-12): E = 200, G = 80 GPa give C1 = 5/6, C2 = 2 pi^2/3; D = 16 mm between flat plates (alpha = 0.5): never buckles below 32 pi sqrt(2/3) = 82.0832 mm; L0 = 100 mm gives lambda = 3.125, y_cr = 100 (5/6)(1 - sqrt(1 - (2 pi^2/3)/3.125^2)) = 35.7358 mm; load 39.0625 N deflects 10 mm so margin = y_cr/10 and no buckling (1e-9: exact arithmetic)",
     "checks": [
      "absolutely_stable",
      "buckles",
      "buckling_deflection_mm",
      "buckling_margin",
      "buckling_slenderness",
      "stable_free_length_mm"
     ]
    },
    {
     "name": "buckling, same spring on pivoted ends (alpha = 1): lambda = 6.25, never-buckles length halves to 16 pi sqrt(2/3) = 41.0416 mm, y_cr = 100 (5/6)(1 - sqrt(1 - (2 pi^2/3)/6.25^2)) = 7.34180 mm, below the 10 mm deflection: buckles, verdict fails (1e-9: exact arithmetic)",
     "checks": [
      "all_ok",
      "buckles",
      "buckling_deflection_mm",
      "buckling_slenderness",
      "stable_free_length_mm"
     ]
    },
    {
     "name": "textbook: Shigley eq. 10-13 and Example 10-1(g), steel springs never buckle when L0 < 2.63 D/alpha: E = 207, G = 79.3 GPa, D = 0.4005 in = 10.1727 mm, alpha = 0.5 give the book's 2.11 in = 53.594 mm (0.5 %: the book rounds the coefficient to 2.63, the closed form gives 2.626); L0 = 50 mm is below it, so absolutely stable",
     "checks": [
      "absolutely_stable",
      "buckles",
      "stable_free_length_mm"
     ]
    },
    {
     "name": "surge closed form f = (1/2) sqrt(k/m) = d/(2 pi D^2 Na) sqrt(G/(2 rho)), m = rho pi^2 d^2 D Na/4: d = 2 mm, D = 16 mm, Na = 10, G = 81 GPa, rho = 8000 kg/m^3 give sqrt(G/(2 rho)) = 2250 m/s exactly, f = 878.90625/pi = 279.76455 Hz, m = 1.28 pi^2 = 12.63309 g; drive at 10 Hz gives ratio f/10 (1e-9: exact arithmetic)",
     "checks": [
      "active_mass_g",
      "surge_frequency_Hz",
      "surge_ratio"
     ]
    },
    {
     "name": "surge with one end free, f = (1/4) sqrt(k/m): half the two-plate value, 439.453125/pi = 139.88227 Hz (1e-9: exact arithmetic)",
     "checks": [
      "surge_frequency_Hz"
     ]
    },
    {
     "name": "surge check: the two-plate spring above (f = 878.90625/pi Hz) driven at 20 Hz gives ratio 43.9453125/pi = 13.98823 < 15, so the verdict fails on resonance alone (1e-9: exact arithmetic)",
     "checks": [
      "all_ok",
      "surge_ratio"
     ]
    },
    {
     "name": "overload: F = 150 N exceeds the force at solid 101.5625 N (same spring as the first case), so the spring is solid: deflection capped at the travel 26 mm, length = Ls = 24 mm, clash margin 0, allowance (101.5625 - 150)/150 = -0.3229166667, verdict fails",
     "checks": [
      "all_ok",
      "clash_allowance",
      "clash_margin_mm",
      "deflection_mm",
      "length_at_load_mm",
      "shear_stress_MPa",
      "solid_at_load"
     ]
    }
   ],
   "title": "Helical compression spring",
   "needs_build": true,
   "category": "Mechanics, CAD and finite elements",
   "known_answers": 57
  },
  {
   "name": "stoich_balance",
   "version": "0.1.0",
   "summary": "Balances a chemical equation, ionic ones too (charge is a conserved row), by the exact integer null space of its composition matrix; molar masses from formulas with brackets and hydrates; limiting reagent, theoretical and percent yield, excess left over, atom economy.",
   "runtime": "native",
   "timeout_s": 10,
   "estimate_s": 0.01,
   "inputs": [
    {
     "name": "equation",
     "type": "string",
     "unit": "1",
     "default": "",
     "enum": null,
     "description": "Reactants -> products, without coefficients (they are computed). '=', '=>', '<=>' also work. Charges: Fe2+, MnO4-, SO4^2-, [Fe(CN)6]4-; electron e-; phase labels (aq) (s) (l) (g) are dropped. Empty: no balance, only 'formula'."
    },
    {
     "name": "formula",
     "type": "string",
     "unit": "1",
     "default": "",
     "enum": null,
     "description": "One formula for its molar mass and mass composition: Ca3(PO4)2, K4[Fe(CN)6], CuSO4.5H2O, SO4^2-. Empty: skipped."
    },
    {
     "name": "masses_g",
     "type": "object",
     "unit": null,
     "default": {},
     "enum": null,
     "description": "Mass of each reactant you have, in grams, by species as written in the equation: {\"H2\": 4, \"O2\": 16}. A reactant left out is taken to be in excess. Each above 0 and at most 1e12 g."
    },
    {
     "name": "moles_mol",
     "type": "object",
     "unit": null,
     "default": {},
     "enum": null,
     "description": "Amount of each reactant in moles, instead of masses_g (a reactant in only one of the two)."
    },
    {
     "name": "product",
     "type": "string",
     "unit": "1",
     "default": "",
     "enum": null,
     "description": "The product whose yield is reported, as written in the equation. Empty: the first product."
    },
    {
     "name": "actual_yield_g",
     "type": "number",
     "unit": "g",
     "default": null,
     "enum": null,
     "description": "Mass of the product you obtained, for the percent yield. Optional: leave it out for no percent yield."
    },
    {
     "name": "coefficients",
     "type": "array",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "Optional: coefficients you already know, one per species in the order written. They are checked for atoms and charge, not computed. Needed when atoms and charge alone allow more than one balance."
    },
    {
     "name": "atomic_weights",
     "type": "object",
     "unit": null,
     "default": {},
     "enum": null,
     "description": "Atomic weights that replace the built-in IUPAC abridged standard atomic weights (CIAAW 2021), or supply one for an element without a standard weight (Tc, Pm, Po, ...): {\"Tc\": 98.0}. Each above 0 and at most 1000 g/mol."
    }
   ],
   "outputs": [
    {
     "name": "balanced_equation",
     "unit": "1",
     "description": "The equation with the smallest whole-number coefficients."
    },
    {
     "name": "coefficients",
     "unit": "1",
     "description": "Coefficients in the order the species are written."
    },
    {
     "name": "coefficients_given",
     "unit": "1",
     "description": "true when the coefficients were given as an input and only checked."
    },
    {
     "name": "species",
     "unit": "1",
     "description": null
    },
    {
     "name": "coefficient_sum",
     "unit": "1",
     "description": null
    },
    {
     "name": "charge_per_side",
     "unit": "1",
     "description": "Total charge on each side, in elementary charges (equal on both sides by construction)."
    },
    {
     "name": "limiting_reagent",
     "unit": "1",
     "description": null
    },
    {
     "name": "extent_mol",
     "unit": "mol",
     "description": "Extent of reaction set by the limiting reagent: its moles over its coefficient."
    },
    {
     "name": "product",
     "unit": "1",
     "description": null
    },
    {
     "name": "theoretical_yield_g",
     "unit": "g",
     "description": null
    },
    {
     "name": "theoretical_yield_mol",
     "unit": "mol",
     "description": null
    },
    {
     "name": "percent_yield_pct",
     "unit": "%",
     "description": null
    },
    {
     "name": "excess_left_g",
     "unit": "g",
     "description": "Total mass of the given reactants left unreacted."
    },
    {
     "name": "atom_economy_pct",
     "unit": "%",
     "description": "Mass of the chosen product over the mass of all reactants, with the coefficients."
    },
    {
     "name": "species_table",
     "unit": "1",
     "description": null
    },
    {
     "name": "atom_balance",
     "unit": "1",
     "description": null
    },
    {
     "name": "formula_hill",
     "unit": "1",
     "description": null
    },
    {
     "name": "molar_mass_g_per_mol",
     "unit": "g/mol",
     "description": null
    },
    {
     "name": "formula_charge",
     "unit": "1",
     "description": null
    },
    {
     "name": "composition",
     "unit": "1",
     "description": null
    },
    {
     "name": "ok",
     "unit": "1",
     "description": "false when the actual yield is above the theoretical yield."
    },
    {
     "name": "warnings",
     "unit": "1",
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "propane combustion, textbook: C3H8 + 5 O2 -> 3 CO2 + 4 H2O (exact integers)",
     "checks": [
      "coefficient_sum",
      "coefficients"
     ]
    },
    {
     "name": "permanganate oxidises HCl, textbook redox: 2 KMnO4 + 16 HCl -> 2 KCl + 2 MnCl2 + 8 H2O + 5 Cl2 (exact integers)",
     "checks": [
      "coefficients"
     ]
    },
    {
     "name": "ionic, textbook half-reactions: MnO4- + 5 Fe2+ + 8 H+ -> Mn2+ + 5 Fe3+ + 4 H2O, charge +17 on each side (exact integers)",
     "checks": [
      "charge_per_side",
      "coefficients"
     ]
    },
    {
     "name": "ionic with carets, textbook dichromate-iron(II): Cr2O7^2- + 6 Fe^2+ + 14 H^+ -> 2 Cr^3+ + 6 Fe^3+ + 7 H2O, charge +24 per side (exact integers)",
     "checks": [
      "charge_per_side",
      "coefficients"
     ]
    },
    {
     "name": "classic hard redox with a complex ion, literature coefficients: 10 K4[Fe(CN)6] + 122 KMnO4 + 299 H2SO4 -> 162 KHSO4 + 5 Fe2(SO4)3 + 122 MnSO4 + 60 HNO3 + 60 CO2 + 188 H2O (exact integers)",
     "checks": [
      "coefficients"
     ]
    },
    {
     "name": "4 g H2 + 16 g O2 with H = 1, O = 16 exactly, closed form: O2 limits (0.5 mol), 18 g water, 2 g H2 left, 9 g weighed = 50 % yield, atom economy 100 % (rel 1e-9)",
     "checks": [
      "atom_economy_pct",
      "excess_left_g",
      "extent_mol",
      "limiting_reagent",
      "percent_yield_pct",
      "theoretical_yield_g",
      "theoretical_yield_mol"
     ]
    },
    {
     "name": "4 g H2 + 16 g O2 with IUPAC weights, textbook: O2 limits, 18.0 g water (textbook gives 3 significant figures, so abs 0.05 g)",
     "checks": [
      "limiting_reagent",
      "theoretical_yield_g"
     ]
    },
    {
     "name": "copper(II) sulfate pentahydrate CuSO4.5H2O, textbook molar mass 249.68 g/mol (textbook gives 2 decimals, so abs 0.005)",
     "checks": [
      "formula_hill",
      "molar_mass_g_per_mol"
     ]
    },
    {
     "name": "brackets, exact by construction with integer weights Ca = 40, P = 31, O = 16: Ca3(PO4)2 = 3*40 + 2*31 + 8*16 = 310 g/mol (rel 1e-12)",
     "checks": [
      "composition.0.count",
      "molar_mass_g_per_mol"
     ]
    },
    {
     "name": "two balances possible, coefficients given and checked: 3 H2 + 2 O2 -> 2 H2O + H2O2 conserves H (6 = 4 + 2) and O (4 = 2 + 2) by hand count (exact integers)",
     "checks": [
      "charge_per_side",
      "coefficients",
      "coefficients_given"
     ]
    }
   ],
   "title": "Chemical equation balance and yield",
   "needs_build": true,
   "category": "Chemistry",
   "known_answers": 24
  },
  {
   "name": "strip",
   "version": "0.3.0",
   "summary": "A precompressed strip clamped at both ends at given angles (the exact planar elastica, inextensible), pushed sideways at a point under displacement control, followed by pseudo-arclength continuation along one branch, from a margin below the lowest resting state to a margin above the highest (it says where the branch ends: margin, force cap, nearly taut, or a fold). Finds every resting state (zero force): deflection, energy, push stiffness, and stability by the second variation of the energy (smallest eigenvalue of the constrained Hessian, ends clamped, end shortening held; stable when positive). The barrier along the pushed path (its energy peak is itself a resting state, refined exactly: the path saddle), kept apart from the energy of other stationary states. Shortcuts for end angles alpha +- beta: bidirectional (parallel ends, exterior alternate angles) and unidirectional (ends tilted to one side). Dimensionless (d/L, F L^2/EI, U L/EI, k L^3/EI); with E, thickness, width and length (or EI and length): the curve in m, N, J, stiffness in N/m, barriers in mJ, bending stress at rest and per mm of vibration, and length_m and EI_Nm2 as readings for a chained instrument; with a mass, natural frequencies. Files: curves.csv (precompression_pct, d_over_L, force, energy, case, deflection_m, force_N, energy_J), scene.glb. 0.3.0: the old energy_barrier_* readings now mean the path barrier; the S-shaped state's energy is other_state_energy_above_lower.",
   "runtime": "native",
   "timeout_s": 900,
   "estimate_s": 10,
   "inputs": [
    {
     "name": "config",
     "type": "string",
     "unit": null,
     "default": "bidirectional",
     "enum": [
      "bidirectional",
      "unidirectional",
      "angles"
     ],
     "description": "bidirectional: left alpha+beta, right alpha-beta (parallel ends at beta 0). unidirectional: left alpha+beta, right -(alpha-beta). angles: theta_left_deg and theta_right_deg as given."
    },
    {
     "name": "alpha_deg",
     "type": "number",
     "unit": "deg",
     "default": 5.0,
     "enum": null,
     "description": "Starting angle."
    },
    {
     "name": "beta_deg",
     "type": "number",
     "unit": "deg",
     "default": 0.0,
     "enum": null,
     "description": "Tuning angle."
    },
    {
     "name": "theta_left_deg",
     "type": "number",
     "unit": "deg",
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "theta_right_deg",
     "type": "number",
     "unit": "deg",
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "precompressions",
     "type": "array",
     "unit": "1",
     "default": [
      0.01
     ],
     "enum": null,
     "description": "End shortening dl/L, one case each."
    },
    {
     "name": "load_at",
     "type": "number",
     "unit": "1",
     "default": 0.5,
     "enum": null,
     "description": "Where the strip is pushed, as a fraction of its length."
    },
    {
     "name": "margin",
     "type": "number",
     "unit": null,
     "default": 0.5,
     "enum": null,
     "description": "How far the force-deflection path runs past the lowest and the highest resting state, as a fraction of that state's deflection. The branch can end sooner (force cap, nearly taut, fold): see cases.*.curve."
    },
    {
     "name": "margin_d_over_L",
     "type": "number",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "The margin as an absolute d/L instead (overrides margin)."
    },
    {
     "name": "force_cap",
     "type": "number",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Stop a branch when the push force passes this (F L^2/EI). Default: 5 x the rest stiffness x the margin, i.e. 5 times what a linear spring would need at the margin."
    },
    {
     "name": "imperfection_deg",
     "type": "number",
     "unit": "deg",
     "default": 0.01,
     "enum": null,
     "description": "A tiny parallel tilt of both clamps, so the strip can take the asymmetric snap path a real strip takes (keeps parallel-end symmetry)."
    },
    {
     "name": "nodes",
     "type": "integer",
     "unit": null,
     "default": 400,
     "enum": null,
     "description": null
    },
    {
     "name": "EI_Nm2",
     "type": "number",
     "unit": "N m^2",
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "length_m",
     "type": "number",
     "unit": "m",
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "mass_kg",
     "type": "number",
     "unit": "kg",
     "default": null,
     "enum": null,
     "description": "A mass at the pushed point: natural frequencies of the resting states."
    },
    {
     "name": "E_Pa",
     "type": "number",
     "unit": "Pa",
     "default": null,
     "enum": null,
     "description": "Young's modulus: with thickness and width gives EI, and stresses."
    },
    {
     "name": "thickness_m",
     "type": "number",
     "unit": "m",
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "width_m",
     "type": "number",
     "unit": "m",
     "default": null,
     "enum": null,
     "description": null
    }
   ],
   "outputs": [
    {
     "name": "cases",
     "unit": null,
     "description": "per precompression (key dl_<pct>pct): states (d_over_L, energy, stiffness = push stiffness, stable (by stability_eigenvalue > 0), stability_eigenvalue, unstable_directions, lowest_eigenvalues, push_stiffness_positive, stable_by_old_test, inflections, found_from, energy_above_lower, SI fields), stable_count, bistable, curve (from/to, end_below/end_above with reason, beyond_lower/upper_state, reaches_margin_*, energy_vs_force_integral, oddness_mismatch, SI), path_saddle (the resting state at the top of the pushed path: d, energy, axial force, eigenvalues, same_as_state), path_barrier_from_lower/upper (+_mJ), curve_energy_peak_above_lower (from the curve's own energy column), other_state_energy_above_lower (+_mJ: the highest other stationary state, e.g. the S-shaped one found from the antisymmetric guess), pushed_path_passes_s_state, energy_barrier_* (= path barrier since 0.3.0), push_up/down_snap_force, symmetry_mismatch, energy_difference, stiffness_ratio_upper_to_lower, natural_frequency_Hz, stable_stiffness_N_per_m, rest_stress_MPa, stress_per_mm_MPa, min_stability_eigenvalue_of_stable_states"
    },
    {
     "name": "EI_Nm2",
     "unit": "N m^2",
     "description": "bending stiffness (given, or E w t^3/12)"
    },
    {
     "name": "length_m",
     "unit": "m",
     "description": "the strip's length as given (for a chained instrument: @run:length_m)"
    },
    {
     "name": "mass_kg",
     "unit": "kg",
     "description": null
    },
    {
     "name": "all_states",
     "unit": null,
     "description": "every resting state of every case, and each path saddle, in one list (for the window)"
    },
    {
     "name": "curves.csv",
     "unit": null,
     "description": "one continuous branch per case, single-valued in d (truncated at a fold), sorted by d; SI columns empty without sizes"
    },
    {
     "name": "scene.glb",
     "unit": null,
     "description": null
    },
    {
     "name": "theta_left_deg",
     "unit": "deg",
     "description": null
    },
    {
     "name": "theta_right_deg",
     "unit": "deg",
     "description": null
    },
    {
     "name": "load_at",
     "unit": "1",
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "nearly straight clamped strip (dl/L 1e-4): rests at d/L = (2/pi) sqrt(dl/L) under the Euler load 4 pi^2; the snap passes the first antisymmetric mode, load 80.763 (kL = 8.9868); stability (derived in NOTES.md): the constrained second variation of the Euler state has smallest eigenvalue k2^2 - 4 pi^2 = 41.2845 (k2 = 8.98682, tan(k/2) = k/2) and the S state the negative of that, with exactly one unstable direction",
     "checks": [
      "cases.dl_0p01pct.stable_count",
      "cases.dl_0p01pct.states.0.stability_eigenvalue",
      "cases.dl_0p01pct.states.0.stable",
      "cases.dl_0p01pct.states.0.unstable_directions",
      "cases.dl_0p01pct.states.1.axial_force",
      "cases.dl_0p01pct.states.1.stability_eigenvalue",
      "cases.dl_0p01pct.states.1.stable",
      "cases.dl_0p01pct.states.1.unstable_directions",
      "cases.dl_0p01pct.states.2.axial_force",
      "cases.dl_0p01pct.states.2.stability_eigenvalue",
      "cases.dl_0p01pct.upper_state_d_over_L"
     ]
    },
    {
     "name": "clamped strip, exact elastica (k = sin 15 deg): dl/L = 2 - 2E(k)/K(k), rise kL/K(k), PL^2/EI = (4K(k))^2; the curve of a strip symmetric about its middle point is odd, F(-d) = -F(d) (tolerance 1e-3: linear interpolation between path points); its energy column is the integral of its force column, U = U0 + int F dd (virtual work, tolerance 5e-5 of the energy range: spline quadrature measures 5e-6 here, the trapezoid rule 3e-5 to 7e-4, so the limit fails a curve whose energy is off by more than quadrature error); both Euler states stable",
     "checks": [
      "cases.dl_6p75678pct.curve.energy_vs_force_integral",
      "cases.dl_6p75678pct.curve.oddness_mismatch",
      "cases.dl_6p75678pct.curve.reaches_upper_state",
      "cases.dl_6p75678pct.min_stability_eigenvalue_of_stable_states",
      "cases.dl_6p75678pct.states.0.stable",
      "cases.dl_6p75678pct.states.2.axial_force",
      "cases.dl_6p75678pct.states.2.stable",
      "cases.dl_6p75678pct.upper_state_d_over_L"
     ]
    },
    {
     "name": "nearly straight clamped strip: peak curvature 4 pi sqrt(dl/L)/L (the buckled cosine), bending stress E t/2 x that; EI = E w t^3/12 and the length come back as readings",
     "checks": [
      "EI_Nm2",
      "cases.dl_0p01pct.rest_stress_MPa",
      "length_m"
     ]
    },
    {
     "name": "nearly flat clamped strip (dl/L 1e-4, imperfection 1e-3 deg): the pushed path crosses the first antisymmetric (S) mode, a saddle with one unstable direction and axial load k2^2 = 80.763; the barrier along it is (k2^2 - 4 pi^2) dl/L = 41.2845e-4 (U = P dl/L for a buckled mode, derived in NOTES.md). The imperfection shifts it linearly (1.5 % at 0.01 deg, 0.16 % at 1e-3, 0.05 % at 3e-4): tolerance 0.5 %. The curve's own energy peak agrees; the curve is odd and its energy is the integral of its force; with margin 0.05 the path stops 5 % of the rest deflection (2/pi) sqrt(dl/L) = 6.3662e-3 past each state, 3.1831e-4 (tolerance 5 %: the last continuation step overshoots by under 1 %)",
     "checks": [
      "cases.dl_0p01pct.curve.beyond_lower_state_d_over_L",
      "cases.dl_0p01pct.curve.beyond_upper_state_d_over_L",
      "cases.dl_0p01pct.curve.energy_vs_force_integral",
      "cases.dl_0p01pct.curve.oddness_mismatch",
      "cases.dl_0p01pct.curve.reaches_margin_above",
      "cases.dl_0p01pct.curve.reaches_margin_below",
      "cases.dl_0p01pct.curve.reaches_upper_state",
      "cases.dl_0p01pct.curve_energy_peak_above_lower",
      "cases.dl_0p01pct.path_barrier_from_lower",
      "cases.dl_0p01pct.path_barrier_from_upper",
      "cases.dl_0p01pct.path_saddle.axial_force",
      "cases.dl_0p01pct.path_saddle.stability_eigenvalue",
      "cases.dl_0p01pct.path_saddle.unstable_directions"
     ]
    }
   ],
   "title": "Clamped strip (exact)",
   "needs_build": true,
   "category": "Mechanics, CAD and finite elements",
   "known_answers": 35
  },
  {
   "name": "surface_finish",
   "version": "0.1.0",
   "summary": "Generic procedural PBR surface finish & texture synthesizer (pure Rust): generates tileable albedo.png, tangent-space normal.png, glTF metallic_roughness.png, and a 3D embossed swatch scene.glb for brushed_metal, knurled, anodized, carbon_weave, fdm_print, machined_swirl, or smooth finishes, with Ra/Rq surface roughness metrics.",
   "runtime": "native",
   "timeout_s": 30,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "finish",
     "type": "string",
     "unit": null,
     "default": "brushed_metal",
     "enum": [
      "smooth",
      "brushed_metal",
      "knurled",
      "anodized",
      "carbon_weave",
      "fdm_print",
      "machined_swirl"
     ],
     "description": null
    },
    {
     "name": "resolution",
     "type": "integer",
     "unit": null,
     "default": 256,
     "enum": null,
     "description": null
    },
    {
     "name": "tile_size_mm",
     "type": "number",
     "unit": "mm",
     "default": 20.0,
     "enum": null,
     "description": null
    },
    {
     "name": "depth_mm",
     "type": "number",
     "unit": "mm",
     "default": 0.05,
     "enum": null,
     "description": null
    },
    {
     "name": "pitch_mm",
     "type": "number",
     "unit": "mm",
     "default": 1.0,
     "enum": null,
     "description": null
    },
    {
     "name": "base_roughness",
     "type": "number",
     "unit": "1",
     "default": 0.3,
     "enum": null,
     "description": null
    },
    {
     "name": "metallic",
     "type": "number",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "base_color",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": null
    }
   ],
   "outputs": [
    {
     "name": "ra_um",
     "unit": "um",
     "description": null
    },
    {
     "name": "rq_um",
     "unit": "um",
     "description": null
    },
    {
     "name": "mean_roughness",
     "unit": "1",
     "description": null
    },
    {
     "name": "metallic",
     "unit": "1",
     "description": null
    },
    {
     "name": "normal_unit_error",
     "unit": "1",
     "description": null
    },
    {
     "name": "albedo.png",
     "unit": null,
     "description": null
    },
    {
     "name": "normal.png",
     "unit": null,
     "description": null
    },
    {
     "name": "metallic_roughness.png",
     "unit": null,
     "description": null
    },
    {
     "name": "scene.glb",
     "unit": null,
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "smooth surface gives Ra = 0, Rq = 0, unit normals",
     "checks": [
      "normal_unit_error",
      "ra_um",
      "rq_um"
     ]
    },
    {
     "name": "diamond knurling (pitch 1 mm, depth 0.3 mm) produces positive Ra/Rq and unit-length normal map",
     "checks": [
      "normal_unit_error",
      "ra_um",
      "rq_um"
     ]
    }
   ],
   "title": "Procedural PBR surface finish",
   "needs_build": true,
   "category": "Mechanics, CAD and finite elements",
   "known_answers": 6
  },
  {
   "name": "thin_film",
   "version": "0.1.0",
   "summary": "Multilayer thin-film stack by the transfer-matrix (characteristic-matrix) method: reflectance, transmittance and absorptance for s and p polarisation at one wavelength and angle, across a wavelength band and across an angle scan. Layers are listed from the incident side to the substrate, each with a complex index n + i k (k >= 0 absorbs) and a thickness in nm or in quarter-waves at the design wavelength. Indices are constants: give them at the wavelength of interest (no dispersion model, no material table). Coherent, flat, isotropic layers; the substrate is semi-infinite (no back-face reflection).",
   "runtime": "native",
   "timeout_s": 60,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "n_incident",
     "type": "number",
     "unit": "1",
     "default": 1.0,
     "enum": null,
     "description": "Refractive index of the lossless medium the light comes from (1.0 for air)."
    },
    {
     "name": "layers",
     "type": "array",
     "unit": null,
     "default": [],
     "enum": null,
     "description": "Layers from the incident side to the substrate. Each is {\"n\": index, \"k\": extinction (optional, >= 0), and either \"d_nm\": physical thickness or \"qwot\": optical thickness in quarter-waves at design_wavelength_nm, \"name\": optional label}. Empty list: a bare interface."
    },
    {
     "name": "repeat",
     "type": "integer",
     "unit": "1",
     "default": 1,
     "enum": null,
     "description": "The layer list is laid down this many times in a row, e.g. [H, L] with repeat 8 is a 16-layer mirror. At most 2000 layers in all."
    },
    {
     "name": "substrate_n",
     "type": "number",
     "unit": "1",
     "default": 1.52,
     "enum": null,
     "description": "Real part of the substrate (exit medium) index."
    },
    {
     "name": "substrate_k",
     "type": "number",
     "unit": "1",
     "default": 0.0,
     "enum": null,
     "description": "Extinction coefficient of the substrate (0 for a clear one; a metal has k of a few)."
    },
    {
     "name": "wavelength_nm",
     "type": "number",
     "unit": "nm",
     "default": 550.0,
     "enum": null,
     "description": "Vacuum wavelength of the headline readings and of the angle scan."
    },
    {
     "name": "design_wavelength_nm",
     "type": "number",
     "unit": "nm",
     "default": 550.0,
     "enum": null,
     "description": "Reference wavelength for thicknesses given as qwot: d = qwot * design_wavelength / (4 n)."
    },
    {
     "name": "angle_deg",
     "type": "number",
     "unit": "deg",
     "default": 0.0,
     "enum": null,
     "description": "Angle of incidence from the normal, in the incident medium; used for the headline readings and the spectrum."
    },
    {
     "name": "wavelength_min_nm",
     "type": "number",
     "unit": "nm",
     "default": 400.0,
     "enum": null,
     "description": "Start of the spectrum."
    },
    {
     "name": "wavelength_max_nm",
     "type": "number",
     "unit": "nm",
     "default": 800.0,
     "enum": null,
     "description": "End of the spectrum."
    },
    {
     "name": "wavelength_points",
     "type": "integer",
     "unit": "1",
     "default": 201,
     "enum": null,
     "description": "Points in the spectrum, evenly spaced in wavelength."
    },
    {
     "name": "angle_max_deg",
     "type": "number",
     "unit": "deg",
     "default": 89.0,
     "enum": null,
     "description": "The angle scan runs from 0 to this angle at wavelength_nm."
    },
    {
     "name": "angle_points",
     "type": "integer",
     "unit": "1",
     "default": 90,
     "enum": null,
     "description": "Points in the angle scan."
    }
   ],
   "outputs": [
    {
     "name": "Rs",
     "unit": "1",
     "description": "Reflectance (fraction of incident power), s polarisation, at wavelength_nm and angle_deg."
    },
    {
     "name": "Rp",
     "unit": "1",
     "description": "Reflectance, p polarisation."
    },
    {
     "name": "R_avg",
     "unit": "1",
     "description": "Reflectance of unpolarised light, (Rs + Rp) / 2."
    },
    {
     "name": "Ts",
     "unit": "1",
     "description": "Transmittance into the substrate, s; from the transmitted flux, not from 1 - R."
    },
    {
     "name": "Tp",
     "unit": "1",
     "description": "Transmittance into the substrate, p."
    },
    {
     "name": "T_avg",
     "unit": "1",
     "description": "Transmittance of unpolarised light."
    },
    {
     "name": "As",
     "unit": "1",
     "description": "Absorptance in the layers, 1 - R - T, s (|A| below 1e-12 is written as 0)."
    },
    {
     "name": "Ap",
     "unit": "1",
     "description": "Absorptance in the layers, p."
    },
    {
     "name": "A_avg",
     "unit": "1",
     "description": "Absorptance of unpolarised light."
    },
    {
     "name": "R_plus_Ts",
     "unit": "1",
     "description": "R + T for s as computed: 1 for a lossless stack, below 1 with absorption."
    },
    {
     "name": "R_plus_Tp",
     "unit": "1",
     "description": "R + T for p as computed."
    },
    {
     "name": "phase_r_s_deg",
     "unit": "deg",
     "description": "Phase of the amplitude reflection coefficient, s, exp(-i w t) convention; null when r is zero."
    },
    {
     "name": "phase_r_p_deg",
     "unit": "deg",
     "description": "Phase of r for p in the tangential-E (admittance) convention, in which r_p = r_s at normal incidence; null when r is zero."
    },
    {
     "name": "brewster_bare_deg",
     "unit": "deg",
     "description": "atan(substrate_n / n_incident), the Brewster angle of the uncoated interface; null for an absorbing substrate."
    },
    {
     "name": "critical_angle_deg",
     "unit": "deg",
     "description": "asin(substrate_n / n_incident) when the substrate is the rarer lossless medium; otherwise null."
    },
    {
     "name": "R_avg_min",
     "unit": "1",
     "description": "Lowest unpolarised reflectance in the band at angle_deg (grid minimum refined between its neighbours)."
    },
    {
     "name": "wavelength_at_R_min_nm",
     "unit": "nm",
     "description": null
    },
    {
     "name": "R_avg_max",
     "unit": "1",
     "description": "Highest unpolarised reflectance in the band."
    },
    {
     "name": "wavelength_at_R_max_nm",
     "unit": "nm",
     "description": null
    },
    {
     "name": "R_avg_band_mean",
     "unit": "1",
     "description": "Mean unpolarised reflectance over the band (trapezoid rule on the wavelength grid)."
    },
    {
     "name": "T_avg_band_mean",
     "unit": "1",
     "description": "Mean unpolarised transmittance over the band."
    },
    {
     "name": "Rp_min",
     "unit": "1",
     "description": "Lowest p reflectance in the angle scan."
    },
    {
     "name": "angle_at_Rp_min_deg",
     "unit": "deg",
     "description": "Angle of that minimum: the Brewster angle of a bare dielectric, a pseudo-Brewster angle otherwise."
    },
    {
     "name": "layer_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "total_thickness_nm",
     "unit": "nm",
     "description": null
    },
    {
     "name": "lossless",
     "unit": null,
     "description": "true when every layer and the substrate have k = 0."
    },
    {
     "name": "energy_ok",
     "unit": null,
     "description": "true when R + T <= 1 + 1e-9 and every number is finite at the headline point, over the spectrum and over the angle scan."
    },
    {
     "name": "warnings",
     "unit": null,
     "description": "Plain-language cautions: total internal reflection, evanescent layers, very thick layers."
    },
    {
     "name": "layers",
     "unit": null,
     "description": "The layer list as resolved (one period), incident side first."
    },
    {
     "name": "spectrum.csv",
     "unit": null,
     "description": "wavelength_nm, Rs, Rp, R_avg, Ts, Tp, T_avg, As, Ap, A_avg at angle_deg."
    },
    {
     "name": "angle_scan.csv",
     "unit": null,
     "description": "angle_deg and the same nine columns at wavelength_nm."
    }
   ],
   "selftests": [
    {
     "name": "Fresnel, normal incidence, air to glass n = 1.5: R = ((1 - 1.5)/(1 + 1.5))^2 = 0.04, T = 0.96, reflection phase 180 deg (Hecht, Optics, sec. 4.6); closed form, 1e-9",
     "checks": [
      "R_avg",
      "Rp",
      "Rs",
      "Tp",
      "Ts",
      "layer_count",
      "phase_r_s_deg"
     ]
    },
    {
     "name": "Ideal quarter-wave antireflection layer, n1 = sqrt(n0 ns) = sqrt(1.5): R = 0 and T = 1 at the design wavelength 550 nm, and the band minimum sits there; closed form (abs 1e-12 on R; 1e-3 nm on the refined minimum)",
     "checks": [
      "R_avg_min",
      "Rp",
      "Rs",
      "Ts",
      "wavelength_at_R_min_nm"
     ]
    },
    {
     "name": "Quarter-wave MgF2-like layer n1 = 1.38, d = 552/(4*1.38) = 100 nm, on ns = 1.52 at 552 nm: R = ((n0 ns - n1^2)/(n0 ns + n1^2))^2 = 0.01260079021463 (1.26 %), minimum of the band at 552 nm; closed form, 1e-9",
     "checks": [
      "R_avg",
      "R_avg_min",
      "Rs",
      "Ts",
      "total_thickness_nm",
      "wavelength_at_R_min_nm"
     ]
    },
    {
     "name": "Half-wave (absentee) layer n1 = 2.3 on ns = 1.52: R is the bare-substrate value ((1 - 1.52)/(1 + 1.52))^2 = 0.04257999496095; closed form, 1e-9",
     "checks": [
      "Rp",
      "Rs",
      "T_avg"
     ]
    },
    {
     "name": "Brewster angle atan(1.5) = 56.30993247402 deg on bare glass: Rp = 0, Tp = 1, Rs = ((n^2 - 1)/(n^2 + 1))^2 = 0.147928994083, and the angle scan finds the same angle; closed form (abs 1e-12 on Rp, 1e-5 deg on the refined scan minimum)",
     "checks": [
      "Rp",
      "Rp_min",
      "Rs",
      "Tp",
      "angle_at_Rp_min_deg",
      "brewster_bare_deg"
     ]
    },
    {
     "name": "Fresnel at 45 deg on glass n = 1.5: Rs = ((cos t - sqrt(n^2 - sin^2 t))/(cos t + sqrt(n^2 - sin^2 t)))^2 = 0.0920133630455 and the exact identity Rp = Rs^2 = 0.00846645897895; closed form, 1e-9",
     "checks": [
      "R_plus_Tp",
      "R_plus_Ts",
      "Rp",
      "Rs"
     ]
    },
    {
     "name": "Quarter-wave mirror air|(HL)^4|glass, nH = 2.3, nL = 1.38, ns = 1.52: Y = (nH/nL)^8 ns, R = ((1 - Y)/(1 + Y))^2 = 0.956760461605 (Macleod, Thin-Film Optical Filters, quarter-wave stack); closed form, 1e-9",
     "checks": [
      "Rs",
      "Ts",
      "layer_count"
     ]
    },
    {
     "name": "Absorbing substrate N = 0.2 + 3i at normal incidence: R = ((n - 1)^2 + k^2)/((n + 1)^2 + k^2) = 9.64/10.44, T = 4n/((n + 1)^2 + k^2) = 0.8/10.44 (Born and Wolf, metal reflection); closed form, 1e-9",
     "checks": [
      "Rp",
      "Rs",
      "Ts"
     ]
    },
    {
     "name": "Absorbing film N = 2.0 + 0.5i, 80 nm, on ns = 1.52, 600 nm, 30 deg: Airy single-film formula r = (r01 + r12 e^{2i d})/(1 + r01 r12 e^{2i d}) with Fresnel coefficients, evaluated apart from this program; closed form, 1e-9",
     "checks": [
      "Ap",
      "As",
      "Rp",
      "Rs",
      "Tp",
      "Ts"
     ]
    },
    {
     "name": "Total internal reflection, glass n = 1.5 to air at 45 deg (critical angle asin(1/1.5) = 41.8103148958 deg): R = 1, T = 0 for both polarisations; exact",
     "checks": [
      "Rp",
      "Rs",
      "Tp",
      "Ts",
      "critical_angle_deg"
     ]
    },
    {
     "name": "Energy conservation, lossless five-layer stack at 45 deg, 633 nm: R + T = 1 and A = 0 for s and p (T comes from the transmitted flux, not from 1 - R); exact, abs 1e-12",
     "checks": [
      "A_avg",
      "R_plus_Tp",
      "R_plus_Ts",
      "energy_ok",
      "lossless"
     ]
    }
   ],
   "title": "Thin-film stack: reflectance and transmittance",
   "needs_build": true,
   "category": "Waves, optics and circuits",
   "known_answers": 53
  },
  {
   "name": "tm_score",
   "version": "0.1.0",
   "summary": "TM-score, GDT-TS/GDT-HA and RMSD between two protein structures: CA atoms from PDB or mmCIF text, a staged file or coordinate lists, paired by residue number; TM-maximising superposition (fragment-seeded search after Zhang & Skolnick 2004), least-squares or none; d0 = 1.24 (L - 15)^(1/3) - 1.8 \u00c5; score normalised by the reference length; per-residue distances.",
   "runtime": "native",
   "timeout_s": 120,
   "estimate_s": 0.2,
   "inputs": [
    {
     "name": "reference_file",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Reference structure, PDB or mmCIF (first model)."
    },
    {
     "name": "reference_text",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Reference structure as PDB or mmCIF text."
    },
    {
     "name": "reference_xyz",
     "type": "array",
     "unit": "\u00c5",
     "default": null,
     "enum": null,
     "description": "Reference CA coordinates [[x, y, z], ...] in \u00c5, used instead of text or file; numbered 1, 2, 3, ... unless reference_resnums is given."
    },
    {
     "name": "reference_resnums",
     "type": "array",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "Residue numbers for reference_xyz."
    },
    {
     "name": "reference_chain",
     "type": "string",
     "unit": null,
     "default": "",
     "enum": null,
     "description": "Chain of the reference to use; empty = every chain."
    },
    {
     "name": "model_file",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Model structure, PDB or mmCIF (first model)."
    },
    {
     "name": "model_text",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Model structure as PDB or mmCIF text."
    },
    {
     "name": "model_xyz",
     "type": "array",
     "unit": "\u00c5",
     "default": null,
     "enum": null,
     "description": "Model CA coordinates [[x, y, z], ...] in \u00c5, used instead of text or file; numbered 1, 2, 3, ... unless model_resnums is given."
    },
    {
     "name": "model_resnums",
     "type": "array",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "Residue numbers for model_xyz."
    },
    {
     "name": "model_chain",
     "type": "string",
     "unit": null,
     "default": "",
     "enum": null,
     "description": "Chain of the model to use; empty = every chain."
    },
    {
     "name": "superposition",
     "type": "string",
     "unit": null,
     "default": "tm_search",
     "enum": [
      "tm_search",
      "kabsch",
      "none"
     ],
     "description": "tm_search: the superposition that maximises TM (heuristic search); kabsch: least-squares on all pairs; none: coordinates as given."
    },
    {
     "name": "norm_length",
     "type": "integer",
     "unit": "1",
     "default": 0,
     "enum": null,
     "description": "Length L that normalises the score and sets d0; 0 = the reference length. Not below the matched residues."
    },
    {
     "name": "d0_A",
     "type": "number",
     "unit": "\u00c5",
     "default": 0,
     "enum": null,
     "description": "Override of d0; 0 = 1.24 (L - 15)^(1/3) - 1.8 \u00c5, floored at 0.5 \u00c5."
    },
    {
     "name": "tm_threshold",
     "type": "number",
     "unit": "1",
     "default": 0.5,
     "enum": null,
     "description": "TM-score at or above which the pair is called the same fold (0.5 is the usual line)."
    }
   ],
   "outputs": [
    {
     "name": "tm_score",
     "unit": "1",
     "description": "TM-score normalised by norm_length, in the scoring frame."
    },
    {
     "name": "above_threshold",
     "unit": null,
     "description": "tm_score >= tm_threshold."
    },
    {
     "name": "tm_threshold",
     "unit": "1",
     "description": null
    },
    {
     "name": "d0_A",
     "unit": "\u00c5",
     "description": null
    },
    {
     "name": "d0_source",
     "unit": null,
     "description": "formula, floor 0.5 \u00c5, or input."
    },
    {
     "name": "norm_length",
     "unit": "1",
     "description": null
    },
    {
     "name": "rmsd_A",
     "unit": "\u00c5",
     "description": "RMSD over the matched pairs after least-squares superposition."
    },
    {
     "name": "rmsd_frame_A",
     "unit": "\u00c5",
     "description": "RMSD over the matched pairs in the scoring frame."
    },
    {
     "name": "tm_score_least_squares_frame",
     "unit": "1",
     "description": null
    },
    {
     "name": "gdt_ts_pct",
     "unit": "%",
     "description": null
    },
    {
     "name": "gdt_ha_pct",
     "unit": "%",
     "description": null
    },
    {
     "name": "within_0p5A_pct",
     "unit": "%",
     "description": null
    },
    {
     "name": "within_1A_pct",
     "unit": "%",
     "description": null
    },
    {
     "name": "within_2A_pct",
     "unit": "%",
     "description": null
    },
    {
     "name": "within_4A_pct",
     "unit": "%",
     "description": null
    },
    {
     "name": "within_8A_pct",
     "unit": "%",
     "description": null
    },
    {
     "name": "n_reference",
     "unit": "1",
     "description": null
    },
    {
     "name": "n_model",
     "unit": "1",
     "description": null
    },
    {
     "name": "n_matched",
     "unit": "1",
     "description": null
    },
    {
     "name": "coverage",
     "unit": "1",
     "description": null
    },
    {
     "name": "max_distance_A",
     "unit": "\u00c5",
     "description": null
    },
    {
     "name": "mean_distance_A",
     "unit": "\u00c5",
     "description": null
    },
    {
     "name": "rotation",
     "unit": "1",
     "description": "3x3 rotation applied to the model (row-major)."
    },
    {
     "name": "translation_A",
     "unit": "\u00c5",
     "description": null
    },
    {
     "name": "superposition",
     "unit": null,
     "description": null
    },
    {
     "name": "paired_by",
     "unit": null,
     "description": null
    },
    {
     "name": "search_starts",
     "unit": "1",
     "description": null
    },
    {
     "name": "frames_scored",
     "unit": "1",
     "description": null
    },
    {
     "name": "warnings",
     "unit": null,
     "description": null
    },
    {
     "name": "files",
     "unit": null,
     "description": "out/per_residue.csv (distance and TM term per residue), out/distance_cutoff_curve.csv (share of the reference within 0.5 to 10 \u00c5)."
    }
   ],
   "selftests": [
    {
     "name": "identical structures, 100 CA (Zhang & Skolnick 2004 definition): TM = 1, RMSD = 0, GDT-TS = GDT-HA = 100, d0(100) = 1.24*85^(1/3) - 1.8; tol 1e-9 (exact arithmetic)",
     "checks": [
      "d0_A",
      "gdt_ha_pct",
      "gdt_ts_pct",
      "n_matched",
      "rmsd_A",
      "tm_score"
     ]
    },
    {
     "name": "rotated (37 deg about (1,2,3)) and translated copy (rigid-motion invariance): TM = 1, RMSD = 0, GDT-TS = 100; tol 1e-9 (eigen-solver round-off ~1e-14)",
     "checks": [
      "gdt_ts_pct",
      "rmsd_A",
      "tm_score",
      "tm_score_least_squares_frame"
     ]
    },
    {
     "name": "every pair at distance d0 in a fixed frame (definition: 1/(1+1) per residue): TM = 1/2, GDT-TS = 50, GDT-HA = 25, frame RMSD = d0; least-squares frame removes the shift (TM = 1); tol 1e-9",
     "checks": [
      "gdt_ha_pct",
      "gdt_ts_pct",
      "rmsd_frame_A",
      "tm_score",
      "tm_score_least_squares_frame"
     ]
    },
    {
     "name": "half the residues moved 1000 A away (definition): TM = 1/2 + 1/2/(1 + (1000/d0)^2) = 0.5000067, GDT-TS = 50; tol 1e-9 rel (the true optimum lies higher only at second order, ~1e-14)",
     "checks": [
      "gdt_ts_pct",
      "tm_score",
      "within_8A_pct"
     ]
    },
    {
     "name": "normalised by a longer length (definition): 100 identical CA, norm_length = 200 -> TM = 100/200 = 0.5, GDT-TS = 50, d0(200) = 1.24*185^(1/3) - 1.8; tol 1e-9",
     "checks": [
      "d0_A",
      "gdt_ts_pct",
      "tm_score"
     ]
    },
    {
     "name": "PDB text, model has 24 of 30 reference residues, rotated 90 deg + translated, calcium ion named CA ignored (definition: missing residues score 0): TM = 24/30 = 0.8, GDT-TS = 80, d0(30) = 1.24*15^(1/3) - 1.8; tol 1e-9 (coordinates exact in 3 decimals)",
     "checks": [
      "d0_A",
      "gdt_ts_pct",
      "n_matched",
      "n_reference",
      "rmsd_A",
      "tm_score"
     ]
    }
   ],
   "title": "Structure similarity (TM-score)",
   "needs_build": true,
   "category": "Structural biology",
   "known_answers": 27
  },
  {
   "name": "torsion_shaft",
   "version": "0.1.0",
   "summary": "Round shaft in torsion, solid or hollow, stepped in segments carrying one torque in series. From torque, or from power and speed (P = T omega): peak surface shear stress per segment (tau = T (D/2) / J, J = pi (D^4 - d^4)/32), twist per segment (T L / (G J)) and total, torsional stiffness (series), and the safety factor against shear yield (Tresca Sy/2 or von Mises Sy/sqrt 3). Elastic, uniform torque; step fillets only through a user-given kt.",
   "runtime": "native",
   "timeout_s": 30,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "segments",
     "type": "array",
     "unit": null,
     "default": [
      {
       "name": "S1",
       "length_mm": 1000,
       "outer_diameter_mm": 50,
       "inner_diameter_mm": 0,
       "kt": 1
      }
     ],
     "enum": null,
     "description": "Shaft segments end to end, all carrying the same torque. Each: name, length_mm, outer_diameter_mm, inner_diameter_mm (0 or left out = solid), kt (stress concentration factor on the nominal stress, default 1)."
    },
    {
     "name": "load",
     "type": "string",
     "unit": null,
     "default": "torque",
     "enum": [
      "torque",
      "power"
     ],
     "description": "torque: use torque_Nm. power: torque = power_kW / omega from speed_rpm."
    },
    {
     "name": "torque_Nm",
     "type": "number",
     "unit": "N m",
     "default": 1000,
     "enum": null,
     "description": "Transmitted torque (load 'torque')."
    },
    {
     "name": "power_kW",
     "type": "number",
     "unit": "kW",
     "default": 100,
     "enum": null,
     "description": "Transmitted power (load 'power')."
    },
    {
     "name": "speed_rpm",
     "type": "number",
     "unit": "rpm",
     "default": 1500,
     "enum": null,
     "description": "Shaft speed; sets torque in 'power' mode, reported power in 'torque' mode."
    },
    {
     "name": "shear_modulus_GPa",
     "type": "number",
     "unit": "GPa",
     "default": 80,
     "enum": null,
     "description": "Shear modulus G of the shaft material (steel about 80)."
    },
    {
     "name": "yield_strength_MPa",
     "type": "number",
     "unit": "MPa",
     "default": 250,
     "enum": null,
     "description": "Tensile yield strength Sy of the material."
    },
    {
     "name": "criterion",
     "type": "string",
     "unit": null,
     "default": "tresca",
     "enum": [
      "tresca",
      "von_mises"
     ],
     "description": "Shear yield: tresca tau_y = Sy/2, von_mises tau_y = Sy/sqrt(3)."
    },
    {
     "name": "required_safety_factor",
     "type": "number",
     "unit": "1",
     "default": 2,
     "enum": null,
     "description": null
    }
   ],
   "outputs": [
    {
     "name": "load",
     "unit": null,
     "description": null
    },
    {
     "name": "torque_Nm",
     "unit": "N m",
     "description": null
    },
    {
     "name": "power_kW",
     "unit": "kW",
     "description": null
    },
    {
     "name": "speed_rpm",
     "unit": "rpm",
     "description": null
    },
    {
     "name": "shear_modulus_GPa",
     "unit": "GPa",
     "description": null
    },
    {
     "name": "criterion",
     "unit": null,
     "description": null
    },
    {
     "name": "shear_yield_MPa",
     "unit": "MPa",
     "description": null
    },
    {
     "name": "peak_shear_stress_MPa",
     "unit": "MPa",
     "description": null
    },
    {
     "name": "critical_segment",
     "unit": null,
     "description": null
    },
    {
     "name": "total_twist_rad",
     "unit": "rad",
     "description": null
    },
    {
     "name": "total_twist_deg",
     "unit": "deg",
     "description": null
    },
    {
     "name": "total_length_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "torsional_stiffness_Nm_per_rad",
     "unit": "N m/rad",
     "description": null
    },
    {
     "name": "min_safety_factor",
     "unit": "1",
     "description": null
    },
    {
     "name": "required_safety_factor",
     "unit": "1",
     "description": null
    },
    {
     "name": "all_ok",
     "unit": null,
     "description": null
    },
    {
     "name": "warnings",
     "unit": null,
     "description": null
    },
    {
     "name": "segment_count",
     "unit": "1",
     "description": null
    },
    {
     "name": "segments",
     "unit": null,
     "description": "per segment: name, length_mm, outer_diameter_mm, inner_diameter_mm, J_mm4, kt, shear_stress_MPa, twist_rad, twist_deg, twist_per_length_deg_per_m, stiffness_Nm_per_rad, safety_factor"
    },
    {
     "name": "twist_along_shaft.csv",
     "unit": null,
     "description": null
    },
    {
     "name": "segments.csv",
     "unit": null,
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "solid shaft closed form (Timoshenko/Gere): d=50 mm, L=1 m, T=1000 N m, G=80 GPa -> tau=16T/(pi d^3)=40.744 MPa, phi=TL/(GJ)=0.020372 rad, k=GJ/L, Tresca SF=(Sy/2)/tau; rel 1e-9 (exact arithmetic)",
     "checks": [
      "all_ok",
      "min_safety_factor",
      "peak_shear_stress_MPa",
      "segments.0.J_mm4",
      "torsional_stiffness_Nm_per_rad",
      "total_twist_deg",
      "total_twist_rad"
     ]
    },
    {
     "name": "hollow shaft closed form: D=60, d=40 mm, L=500 mm, T=2000 N m, G=79.3 GPa -> J=pi(D^4-d^4)/32, tau=16TD/(pi(D^4-d^4))=58.765 MPa at the outer surface, phi=TL/(GJ); rel 1e-9",
     "checks": [
      "peak_shear_stress_MPa",
      "segments.0.J_mm4",
      "torsional_stiffness_Nm_per_rad",
      "total_twist_rad"
     ]
    },
    {
     "name": "power and speed P = T omega: 100 kW at 1500 rpm -> T = 1e5/(50 pi) = 636.62 N m; solid d=40 mm, L=800 mm, G=80 GPa -> tau=50.661 MPa, phi=0.025330 rad; rel 1e-9",
     "checks": [
      "peak_shear_stress_MPa",
      "power_kW",
      "torque_Nm",
      "total_twist_rad"
     ]
    },
    {
     "name": "stepped shaft, segments in series (twists add, 1/k = sum L/(GJ)): T=800 N m, G=80 GPa; A 300 mm x D60, B 400 mm x D45 with kt=1.5, C 200 mm x D50 bore 30 -> total 0.016039 rad, k=49880 N m/rad, peak 1.5*16T/(pi 45^3)=67.068 MPa in B; rel 1e-9",
     "checks": [
      "critical_segment",
      "peak_shear_stress_MPa",
      "segments.0.shear_stress_MPa",
      "segments.0.twist_rad",
      "segments.1.twist_rad",
      "segments.2.shear_stress_MPa",
      "segments.2.twist_rad",
      "torsional_stiffness_Nm_per_rad",
      "total_length_mm",
      "total_twist_deg",
      "total_twist_rad"
     ]
    },
    {
     "name": "von Mises shear yield tau_y = Sy/sqrt(3): d=30 mm, T=300 N m, Sy=350 MPa -> tau=56.588 MPa, SF=3.5709 < required 4 so the verdict fails; rel 1e-9",
     "checks": [
      "all_ok",
      "min_safety_factor",
      "peak_shear_stress_MPa",
      "shear_yield_MPa"
     ]
    }
   ],
   "title": "Shaft in torsion",
   "needs_build": true,
   "category": "Mechanics, CAD and finite elements",
   "known_answers": 30
  },
  {
   "name": "trajectory",
   "version": "0.1.0",
   "summary": "Generic 3D point-mass flight and aiming solver (RK4) with quadratic aerodynamic drag, 3D wind, and optional Magnus lift: forward trajectory (range, apex, flight time, impact energy) or inverse aiming (exact azimuth & elevation to hit a 3D target). Writes trajectory.csv, plot.png, and 3D scene.glb.",
   "runtime": "native",
   "timeout_s": 60,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "mode",
     "type": "string",
     "unit": null,
     "default": "forward",
     "enum": [
      "forward",
      "aim"
     ],
     "description": null
    },
    {
     "name": "speed_mps",
     "type": "number",
     "unit": "m/s",
     "default": 20.0,
     "enum": null,
     "description": null
    },
    {
     "name": "elevation_deg",
     "type": "number",
     "unit": "deg",
     "default": 45.0,
     "enum": null,
     "description": null
    },
    {
     "name": "azimuth_deg",
     "type": "number",
     "unit": "deg",
     "default": 0.0,
     "enum": null,
     "description": null
    },
    {
     "name": "mass_kg",
     "type": "number",
     "unit": "kg",
     "default": 0.01,
     "enum": null,
     "description": null
    },
    {
     "name": "diameter_m",
     "type": "number",
     "unit": "m",
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "area_m2",
     "type": "number",
     "unit": "m^2",
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "cd",
     "type": "number",
     "unit": "1",
     "default": 0.47,
     "enum": null,
     "description": null
    },
    {
     "name": "air_density_kg_m3",
     "type": "number",
     "unit": "kg/m^3",
     "default": 1.225,
     "enum": null,
     "description": null
    },
    {
     "name": "g_mps2",
     "type": "number",
     "unit": "m/s^2",
     "default": 9.80665,
     "enum": null,
     "description": null
    },
    {
     "name": "start_m",
     "type": "array",
     "unit": null,
     "default": [
      0,
      0,
      0
     ],
     "enum": null,
     "description": null
    },
    {
     "name": "target_m",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "wind_mps",
     "type": "array",
     "unit": null,
     "default": [
      0,
      0,
      0
     ],
     "enum": null,
     "description": null
    },
    {
     "name": "spin_rad_s",
     "type": "array",
     "unit": null,
     "default": [
      0,
      0,
      0
     ],
     "enum": null,
     "description": null
    },
    {
     "name": "cl_magnus",
     "type": "number",
     "unit": "1",
     "default": 0.0,
     "enum": null,
     "description": null
    },
    {
     "name": "ground_z_m",
     "type": "number",
     "unit": "m",
     "default": 0.0,
     "enum": null,
     "description": null
    },
    {
     "name": "high_arc",
     "type": "boolean",
     "unit": null,
     "default": false,
     "enum": null,
     "description": null
    },
    {
     "name": "dt_s",
     "type": "number",
     "unit": "s",
     "default": 0.001,
     "enum": null,
     "description": null
    },
    {
     "name": "max_time_s",
     "type": "number",
     "unit": "s",
     "default": 20.0,
     "enum": null,
     "description": null
    }
   ],
   "outputs": [
    {
     "name": "elevation_deg",
     "unit": "deg",
     "description": null
    },
    {
     "name": "azimuth_deg",
     "unit": "deg",
     "description": null
    },
    {
     "name": "range_m",
     "unit": "m",
     "description": null
    },
    {
     "name": "apex_z_m",
     "unit": "m",
     "description": null
    },
    {
     "name": "flight_time_s",
     "unit": "s",
     "description": null
    },
    {
     "name": "impact_speed_mps",
     "unit": "m/s",
     "description": null
    },
    {
     "name": "launch_energy_J",
     "unit": "J",
     "description": null
    },
    {
     "name": "impact_energy_J",
     "unit": "J",
     "description": null
    },
    {
     "name": "terminal_velocity_mps",
     "unit": "m/s",
     "description": null
    },
    {
     "name": "miss_distance_m",
     "unit": "m",
     "description": null
    },
    {
     "name": "trajectory.csv",
     "unit": null,
     "description": null
    },
    {
     "name": "plot.png",
     "unit": null,
     "description": null
    },
    {
     "name": "scene.glb",
     "unit": null,
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "vacuum 45-deg launch at 20 m/s matches exact closed-form range v0^2/g, apex v0^2/(4g), flight time sqrt(2)v0/g",
     "checks": [
      "apex_z_m",
      "flight_time_s",
      "range_m"
     ]
    },
    {
     "name": "aim mode with quadratic drag + crosswind hits 3D target [4.0, 1.0, 0.5] within 0.5 mm",
     "checks": [
      "miss_distance_m",
      "reachable"
     ]
    }
   ],
   "title": "3D flight & aiming trajectory",
   "needs_build": true,
   "category": "Dynamics and control",
   "known_answers": 5
  },
  {
   "name": "transducer",
   "version": "0.1.0",
   "summary": "A cantilever with a tip mass and bonded piezoelectric patches (31 mode) reduced to the one-mass numbers dynamics takes, referred to the motion of the tip mass's centre: force per volt (theta), clamped capacitance, short-circuit stiffness, effective and forcing mass, coupling k^2, short- and open-circuit frequencies; the beam's worst bending stress and each patch's peak strain per mm of motion, judged at a swing against a strain limit. Stepped Euler-Bernoulli beam (composite section per piece: neutral axis, EI), cubic finite elements, first mode with the tip mass or the static tip-load shape; series or parallel wiring; optional bond layer; length tuned to a frequency. Built-in PZT-5A and PVDF constants (CC BY sources). Files: shape.csv, scene.glb (the beam, patches and mass deflected, coloured by surface strain).",
   "runtime": "native",
   "timeout_s": 120,
   "estimate_s": 2,
   "inputs": [
    {
     "name": "beam_E_Pa",
     "type": "number",
     "unit": "Pa",
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "beam_thickness_m",
     "type": "number",
     "unit": "m",
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "beam_width_m",
     "type": "number",
     "unit": "m",
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "beam_density_kg_per_m3",
     "type": "number",
     "unit": "kg/m^3",
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "length_m",
     "type": "number",
     "unit": "m",
     "default": null,
     "enum": null,
     "description": "Free length, clamp to the beam's end (the start value when tune_length_to_Hz is given)."
    },
    {
     "name": "tip_mass_kg",
     "type": "number",
     "unit": "kg",
     "default": 0,
     "enum": null,
     "description": null
    },
    {
     "name": "tip_offset_m",
     "type": "number",
     "unit": "m",
     "default": 0,
     "enum": null,
     "description": "How far the tip mass's centre sits beyond the beam's end (rigidly attached). Readings per mm refer to that centre's motion."
    },
    {
     "name": "tip_inertia_kg_m2",
     "type": "number",
     "unit": "kg m^2",
     "default": 0,
     "enum": null,
     "description": "Rotary inertia of the tip mass about its centre."
    },
    {
     "name": "patches",
     "type": "array",
     "unit": null,
     "default": [],
     "enum": null,
     "description": null
    },
    {
     "name": "wiring",
     "type": "string",
     "unit": null,
     "default": "parallel",
     "enum": [
      "parallel",
      "series"
     ],
     "description": "How every patch layer is connected (polarities taken to add)."
    },
    {
     "name": "bond_thickness_m",
     "type": "number",
     "unit": "m",
     "default": 0,
     "enum": null,
     "description": "An adhesive layer under every patch (perfectly bonded, carries load)."
    },
    {
     "name": "bond_E_Pa",
     "type": "number",
     "unit": "Pa",
     "default": 3000000000.0,
     "enum": null,
     "description": null
    },
    {
     "name": "bond_density_kg_per_m3",
     "type": "number",
     "unit": "kg/m^3",
     "default": 1200,
     "enum": null,
     "description": null
    },
    {
     "name": "shape",
     "type": "string",
     "unit": null,
     "default": "mode",
     "enum": [
      "mode",
      "static"
     ],
     "description": "Shape the lumped constants are taken over: the first mode with the tip mass, or the static shape under a force at the mass's centre. Both are reported."
    },
    {
     "name": "elements",
     "type": "integer",
     "unit": null,
     "default": 240,
     "enum": null,
     "description": null
    },
    {
     "name": "tune_length_to_Hz",
     "type": "number",
     "unit": "Hz",
     "default": null,
     "enum": null,
     "description": "Find the free length that gives this short-circuit frequency (patches stay where they are)."
    },
    {
     "name": "tune_length_range_m",
     "type": "array",
     "unit": "m",
     "default": null,
     "enum": null,
     "description": "[shortest, longest] searched; default half to twice length_m."
    },
    {
     "name": "swing_mm",
     "type": "number",
     "unit": "mm",
     "default": null,
     "enum": null,
     "description": "Motion amplitude of the mass's centre (e.g. @run:swing_mm from dynamics): stress and strain at it."
    },
    {
     "name": "strain_limit",
     "type": "number",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "The patch's allowed peak strain (judged when swing_mm is given)."
    },
    {
     "name": "base_velocity_rms_mmps",
     "type": "number",
     "unit": "mm/s",
     "default": null,
     "enum": null,
     "description": "The base vibration: returns dynamics.velocity_rms_mmps scaled by forcing_ratio, so dynamics' one mass is forced as the beam is."
    }
   ],
   "outputs": [
    {
     "name": "length_m",
     "unit": "m",
     "description": null
    },
    {
     "name": "theta_N_per_V",
     "unit": "N/V",
     "description": null
    },
    {
     "name": "capacitance_F",
     "unit": "F",
     "description": null
    },
    {
     "name": "stiffness_N_per_m",
     "unit": "N/m",
     "description": null
    },
    {
     "name": "effective_mass_kg",
     "unit": "kg",
     "description": null
    },
    {
     "name": "beam_share_kg",
     "unit": "kg",
     "description": null
    },
    {
     "name": "forcing_mass_kg",
     "unit": "kg",
     "description": "int(rho A phi) + M_tip: the mass the base acceleration pushes"
    },
    {
     "name": "forcing_ratio",
     "unit": "1",
     "description": null
    },
    {
     "name": "coupling_k2",
     "unit": "1",
     "description": "theta^2/(K C), as dynamics' coupling_k2"
    },
    {
     "name": "sc_frequency_Hz",
     "unit": "Hz",
     "description": null
    },
    {
     "name": "oc_frequency_Hz",
     "unit": "Hz",
     "description": null
    },
    {
     "name": "frequency_split_pct",
     "unit": "%",
     "description": null
    },
    {
     "name": "static_stiffness_N_per_m",
     "unit": "N/m",
     "description": null
    },
    {
     "name": "second_mode_Hz",
     "unit": "Hz",
     "description": null
    },
    {
     "name": "stress_per_mm_MPa",
     "unit": "MPa/mm",
     "description": "beam outer fibre, worst point, per mm of the mass's motion, patches bonded perfectly"
    },
    {
     "name": "stress_per_mm_bare_MPa",
     "unit": "MPa/mm",
     "description": "the same moment on the bare beam section: the bound when shear lag leaves the beam bare near patch ends and at the clamp (what fatigue gets)"
    },
    {
     "name": "stress_bare_peak_at_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "stress_at_swing_bare_MPa",
     "unit": "MPa",
     "description": null
    },
    {
     "name": "stress_peak_at_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "patch_strain_per_mm",
     "unit": "1/mm",
     "description": null
    },
    {
     "name": "beam_mass_kg",
     "unit": "kg",
     "description": null
    },
    {
     "name": "tip_mass_kg",
     "unit": "kg",
     "description": null
    },
    {
     "name": "swing_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "stress_at_swing_MPa",
     "unit": "MPa",
     "description": null
    },
    {
     "name": "patch_strain_at_swing",
     "unit": "1",
     "description": null
    },
    {
     "name": "strain_limit",
     "unit": "1",
     "description": null
    },
    {
     "name": "strain_ok",
     "unit": null,
     "description": null
    },
    {
     "name": "ok",
     "unit": null,
     "description": null
    },
    {
     "name": "warnings",
     "unit": null,
     "description": null
    },
    {
     "name": "tuned_to_Hz",
     "unit": "Hz",
     "description": null
    },
    {
     "name": "patches",
     "unit": null,
     "description": "per patch layer (name_face): theta, capacitance, k31^2, clamped permittivity, e31, strain per mm, strain at the swing, ok"
    },
    {
     "name": "sections",
     "unit": null,
     "description": "per piece of constant layup: from, to, neutral axis from the beam's bottom face, EI, mass per length"
    },
    {
     "name": "other_shape",
     "unit": null,
     "description": "the same constants over the other shape"
    },
    {
     "name": "dynamics",
     "unit": null,
     "description": "for dynamics, by reference: @run:dynamics.theta_N_per_V and so on"
    },
    {
     "name": "fatigue",
     "unit": null,
     "description": "for fatigue: @run:fatigue.alternating_per_mm_MPa (the bare-section bound; alternating_per_mm_bonded_MPa with a perfect bond)"
    },
    {
     "name": "scene",
     "unit": null,
     "description": null
    },
    {
     "name": "shape.csv",
     "unit": null,
     "description": null
    },
    {
     "name": "scene.glb",
     "unit": null,
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "bare cantilever, static tip-load shape: K = 3EI/L^3 = 500 N/m, effective mass M_t + 33/140 m L, forcing mass M_t + 3/8 m L, root stress 3EI/L^3 x 1 mm x L x (h/2)/I = 30 MPa per mm (tolerance 1e-6: the stiffness solve's round-off at 240 elements)",
     "checks": [
      "beam_mass_kg",
      "effective_mass_kg",
      "forcing_mass_kg",
      "static_stiffness_N_per_m",
      "stiffness_N_per_m",
      "stress_per_mm_MPa",
      "stress_per_mm_bare_MPa"
     ]
    },
    {
     "name": "bare cantilever, first mode, no tip mass: f = 1.87510407^2/(2 pi) sqrt(EI/(m L^4)) = 81.799 Hz, modal mass at the tip m L/4 (tolerance 1e-5: mesh)",
     "checks": [
      "effective_mass_kg",
      "sc_frequency_Hz",
      "stiffness_N_per_m"
     ]
    },
    {
     "name": "cantilever with a point tip mass, first mode: root of 1 + cos l cosh l + mu l (cos l sinh l - sin l cosh l) = 0, mu = 1.282, l = 1.18550, f = 32.6967 Hz (tolerance 1e-6)",
     "checks": [
      "sc_frequency_Hz"
     ]
    },
    {
     "name": "two-layer section over the whole length (steel 1 mm + piezo 0.5 mm, E 66 GPa), static shape: neutral axis and EI of the two-layer section, K = 3EI/L^3, theta = |e31| b (z_p - z_n) x 3/(2L) (slope difference of the tip-load shape), C = eps33S b L / h_p",
     "checks": [
      "capacitance_F",
      "sections.S1.EI_Nm2",
      "sections.S1.neutral_axis_mm",
      "stiffness_N_per_m",
      "theta_N_per_V"
     ]
    },
    {
     "name": "stepped beam: a PZT-5A patch (built-in constants) 8 x 15 x 0.2 mm from 5 mm on a 0.5 mm steel strip, tip load: compliance and the patch's slope difference by integrating M/EI piecewise (quadrature), theta and C by hand, root stress K x 1 mm x L x (h/2)/I on the bare root (tolerance 1e-6)",
     "checks": [
      "capacitance_F",
      "sections.S2.EI_Nm2",
      "sections.S2.neutral_axis_mm",
      "stiffness_N_per_m",
      "stress_peak_at_mm",
      "stress_per_mm_MPa",
      "stress_per_mm_bare_MPa",
      "theta_N_per_V"
     ]
    },
    {
     "name": "a PZT-5A bimorph on brass with a 12 g tip mass (geometry and materials as restated, CC BY, in Machu et al., Sensors 21 (2021) 6759, Tables 1-2) wired in parallel: capacitance 2 eps33S b L/h_p (4 x the series value) while the coupling and the short-circuit frequency are the series wiring's (values pinned from this instrument's series run; that run was compared, read only, with the resonances published for this bimorph: within 0.4 %)",
     "checks": [
      "capacitance_F",
      "coupling_k2",
      "sc_frequency_Hz"
     ]
    },
    {
     "name": "tune the free length of a bare cantilever to 100 Hz: L = sqrt(1.8751^2/(2 pi f) sqrt(EI/m)) = 90.4428 mm (tolerance 1e-5, mesh; the frequency hit to 1e-7: eigenvalue round-off)",
     "checks": [
      "length_m",
      "sc_frequency_Hz"
     ]
    },
    {
     "name": "a tip mass whose centre sits 20 mm beyond the end of a bare cantilever, static: a force F there bends the beam by a tip force F and moment F e, so the centre moves F((L+e)^3 - e^3)/(3EI): K = 290.698 N/m; root moment F (L+e): 20.930232558139533 MPa per mm (tolerance 1e-6)",
     "checks": [
      "stiffness_N_per_m",
      "stress_per_mm_MPa"
     ]
    },
    {
     "name": "PVDF unimorph on steel with a 2.6 g tip mass over its last 4 mm, measured first resonance 18.7 Hz (Sensors 21 (2021) 6759, CC BY: Tables 1 and 2 and section 3.3); the tip mass taken as a point at its centre on a rigid 2 mm arm (tolerance 3 %: the mass's shape is not given; as a point at the end of a 69.9 mm beam it gives 1.4 % lower)",
     "checks": [
      "sc_frequency_Hz"
     ]
    }
   ],
   "title": "Piezo cantilever",
   "needs_build": true,
   "category": "Waves, optics and circuits",
   "known_answers": 32
  },
  {
   "name": "transmission_line",
   "version": "0.1.0",
   "summary": "Lossless transmission line: characteristic impedance (given, air- or dielectric-filled coax, or microstrip by Hammerstad's quasi-static formulas), load reflection coefficient, standing-wave ratio, return and mismatch loss, input impedance of the loaded line at a physical or electrical length, voltage maxima and minima, quarter-wave transformer and single shunt-stub matching (short or open stub, both solutions). No conductor or dielectric loss, no dispersion, zero strip thickness.",
   "runtime": "native",
   "timeout_s": 30,
   "estimate_s": 0.02,
   "inputs": [
    {
     "name": "line",
     "type": "string",
     "unit": null,
     "default": "z0",
     "enum": [
      "z0",
      "coax",
      "microstrip"
     ],
     "description": "How Z0 is set: z0 (give z0_ohm; eps_r then sets the wavelength), coax (coax_outer_mm, coax_inner_mm, eps_r) or microstrip (strip_width_mm, substrate_height_mm, eps_r)."
    },
    {
     "name": "z0_ohm",
     "type": "number",
     "unit": "ohm",
     "default": 50.0,
     "enum": null,
     "description": "Characteristic impedance, used when line = z0."
    },
    {
     "name": "eps_r",
     "type": "number",
     "unit": "1",
     "default": 1.0,
     "enum": null,
     "description": "Relative permittivity of the dielectric (coax filling or microstrip substrate). For line = z0 it is the effective permittivity that sets the guided wavelength."
    },
    {
     "name": "coax_outer_mm",
     "type": "number",
     "unit": "mm",
     "default": 7.0,
     "enum": null,
     "description": "Inner diameter of the coax shield (D)."
    },
    {
     "name": "coax_inner_mm",
     "type": "number",
     "unit": "mm",
     "default": 3.04,
     "enum": null,
     "description": "Diameter of the coax centre conductor (d), smaller than D."
    },
    {
     "name": "strip_width_mm",
     "type": "number",
     "unit": "mm",
     "default": 3.0,
     "enum": null,
     "description": "Microstrip width w (zero thickness assumed)."
    },
    {
     "name": "substrate_height_mm",
     "type": "number",
     "unit": "mm",
     "default": 1.6,
     "enum": null,
     "description": "Microstrip substrate height h between strip and ground."
    },
    {
     "name": "frequency_Hz",
     "type": "number",
     "unit": "Hz",
     "default": 1000000000.0,
     "enum": null,
     "description": "Operating frequency; with eps_eff it sets the guided wavelength."
    },
    {
     "name": "length_mm",
     "type": "number",
     "unit": "mm",
     "default": null,
     "enum": null,
     "description": "Physical length of the line from load to input. Give this or length_wavelengths, not both; with neither the line is a quarter wave."
    },
    {
     "name": "length_wavelengths",
     "type": "number",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "Electrical length in guided wavelengths (0.25 = quarter wave)."
    },
    {
     "name": "load",
     "type": "string",
     "unit": null,
     "default": "impedance",
     "enum": [
      "impedance",
      "short",
      "open"
     ],
     "description": "The termination: impedance (load_r_ohm + j load_x_ohm), short or open."
    },
    {
     "name": "load_r_ohm",
     "type": "number",
     "unit": "ohm",
     "default": 100.0,
     "enum": null,
     "description": "Load resistance (passive: 0 or more)."
    },
    {
     "name": "load_x_ohm",
     "type": "number",
     "unit": "ohm",
     "default": 0.0,
     "enum": null,
     "description": "Load reactance: positive inductive, negative capacitive."
    },
    {
     "name": "swr_limit",
     "type": "number",
     "unit": "1",
     "default": 2.0,
     "enum": null,
     "description": "Largest SWR accepted; sets the verdict."
    }
   ],
   "outputs": [
    {
     "name": "z0_ohm",
     "unit": "ohm",
     "description": "Characteristic impedance of the line."
    },
    {
     "name": "eps_eff",
     "unit": "1",
     "description": "Effective relative permittivity (eps_r for coax and z0; Hammerstad's for microstrip)."
    },
    {
     "name": "velocity_factor",
     "unit": "1",
     "description": "Phase velocity over c, 1/sqrt(eps_eff)."
    },
    {
     "name": "phase_velocity_m_per_s",
     "unit": "m/s",
     "description": null
    },
    {
     "name": "wavelength_mm",
     "unit": "mm",
     "description": "Guided wavelength at frequency_Hz."
    },
    {
     "name": "length_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "length_wavelengths",
     "unit": "1",
     "description": null
    },
    {
     "name": "length_source",
     "unit": null,
     "description": "Which input set the length, or 'default quarter wave'."
    },
    {
     "name": "electrical_length_deg",
     "unit": "deg",
     "description": null
    },
    {
     "name": "gamma_mag",
     "unit": "1",
     "description": "|Gamma| of the load."
    },
    {
     "name": "gamma_phase_deg",
     "unit": "deg",
     "description": "Phase of Gamma at the load; null for a matched load."
    },
    {
     "name": "swr",
     "unit": "1",
     "description": "Voltage standing-wave ratio; null (infinite) when |Gamma| = 1."
    },
    {
     "name": "return_loss_dB",
     "unit": null,
     "description": "-20 log10 |Gamma|; null (infinite) for a matched load."
    },
    {
     "name": "mismatch_loss_dB",
     "unit": null,
     "description": "-10 log10(1 - |Gamma|^2); null when all power is reflected."
    },
    {
     "name": "power_delivered_fraction",
     "unit": "1",
     "description": "1 - |Gamma|^2."
    },
    {
     "name": "zin_r_ohm",
     "unit": "ohm",
     "description": "Input resistance of the loaded line; null when the input impedance is infinite."
    },
    {
     "name": "zin_x_ohm",
     "unit": "ohm",
     "description": "Input reactance; null when infinite."
    },
    {
     "name": "zin_infinite",
     "unit": null,
     "description": "True when the line presents an open circuit at its input."
    },
    {
     "name": "gamma_in_phase_deg",
     "unit": "deg",
     "description": null
    },
    {
     "name": "vmax_from_load_wavelengths",
     "unit": "1",
     "description": "First voltage maximum, distance from the load in wavelengths (in [0, 0.5))."
    },
    {
     "name": "vmin_from_load_wavelengths",
     "unit": "1",
     "description": "First voltage minimum, distance from the load in wavelengths."
    },
    {
     "name": "quarter_wave_z_ohm",
     "unit": "ohm",
     "description": "Quarter-wave transformer for a real load, sqrt(Z0 RL); null for complex, short or open loads."
    },
    {
     "name": "quarter_wave_at_vmax_z_ohm",
     "unit": "ohm",
     "description": "Transformer impedance Z0 sqrt(SWR) when placed at the voltage maximum."
    },
    {
     "name": "quarter_wave_at_vmin_z_ohm",
     "unit": "ohm",
     "description": "Transformer impedance Z0 / sqrt(SWR) when placed at the voltage minimum."
    },
    {
     "name": "stub_match",
     "unit": null,
     "description": "The two single shunt-stub solutions, nearest the load first; empty when matched or unmatchable."
    },
    {
     "name": "stub1_d_wavelengths",
     "unit": "1",
     "description": null
    },
    {
     "name": "stub1_short_wavelengths",
     "unit": "1",
     "description": null
    },
    {
     "name": "stub1_open_wavelengths",
     "unit": "1",
     "description": null
    },
    {
     "name": "stub2_d_wavelengths",
     "unit": "1",
     "description": null
    },
    {
     "name": "stub2_short_wavelengths",
     "unit": "1",
     "description": null
    },
    {
     "name": "stub2_open_wavelengths",
     "unit": "1",
     "description": null
    },
    {
     "name": "stub_residual_gamma",
     "unit": "1",
     "description": "Largest |Gamma| left at the stub junction after adding the short stub; a check, ~1e-16."
    },
    {
     "name": "swr_limit",
     "unit": "1",
     "description": null
    },
    {
     "name": "swr_ok",
     "unit": null,
     "description": "SWR at or below swr_limit."
    },
    {
     "name": "warnings",
     "unit": null,
     "description": "List of plain-language warnings."
    }
   ],
   "selftests": [
    {
     "name": "Air coax, D/d = e: Z0 = eta0/(2 pi) ln(D/d) = 59.95849 ohm, eta0 = mu0 c (CODATA 2018 mu0; Pozar, Microwave Engineering, sec. 2.2); closed form, rel 1e-9",
     "checks": [
      "eps_eff",
      "phase_velocity_m_per_s",
      "wavelength_mm",
      "z0_ohm"
     ]
    },
    {
     "name": "PTFE-filled coax eps_r = 2.25, D/d = e: Z0 = 59.95849/sqrt(2.25) = 39.97233 ohm, velocity factor 1/sqrt(2.25) = 2/3; closed form, rel 1e-9",
     "checks": [
      "velocity_factor",
      "z0_ohm"
     ]
    },
    {
     "name": "100 ohm on a 50 ohm line (Pozar sec. 2.3): |Gamma| = 1/3, SWR = 2, return loss 20 log10 3 = 9.5424 dB, mismatch loss -10 log10(8/9); half-wave line repeats the load; quarter-wave transformer sqrt(50*100); stub at d = atan(sqrt 2)/(2 pi) lambda (shunt-stub closed form); closed forms, rel 1e-9",
     "checks": [
      "gamma_mag",
      "mismatch_loss_dB",
      "quarter_wave_z_ohm",
      "return_loss_dB",
      "stub1_d_wavelengths",
      "stub1_short_wavelengths",
      "stub2_d_wavelengths",
      "swr",
      "vmax_from_load_wavelengths",
      "vmin_from_load_wavelengths",
      "zin_r_ohm",
      "zin_x_ohm"
     ]
    },
    {
     "name": "Quarter-wave line: Zin = Z0^2/ZL (Pozar eq. 2.45); Z0 = 50, ZL = 30 + j40 gives Zin = 30 - j40; 250 mm at 299.792458 MHz in air is exactly lambda/4; closed form, rel 1e-9",
     "checks": [
      "length_wavelengths",
      "zin_r_ohm",
      "zin_x_ohm"
     ]
    },
    {
     "name": "Short-circuited eighth-wave line: Zin = j Z0 tan(pi/4) = j 75 ohm (Pozar eq. 2.46); |Gamma| = 1, SWR infinite (null), return loss 0 dB; closed form, abs 1e-9",
     "checks": [
      "gamma_mag",
      "return_loss_dB",
      "swr",
      "zin_r_ohm",
      "zin_x_ohm"
     ]
    },
    {
     "name": "Matched load 50 ohm on 50 ohm: Gamma = 0, SWR = 1, return loss infinite (null), Zin = Z0 at any length; closed form, abs 1e-12",
     "checks": [
      "gamma_mag",
      "return_loss_dB",
      "swr",
      "zin_r_ohm",
      "zin_x_ohm"
     ]
    },
    {
     "name": "Pozar, Microwave Engineering (4th ed.) Example 5.2, single shunt short stub for ZL = 60 - j80 on 50 ohm: d = 0.110 / 0.260 lambda, stub 0.095 / 0.405 lambda; textbook figures to 3 digits, abs 1e-3 lambda",
     "checks": [
      "stub1_d_wavelengths",
      "stub1_short_wavelengths",
      "stub2_d_wavelengths",
      "stub2_short_wavelengths",
      "stub_residual_gamma"
     ]
    },
    {
     "name": "Pozar, Microwave Engineering Example 3.7: microstrip on eps_r = 2.20, h = 1.27 mm, W/d = 3.081 is 50 ohm with eps_e = 1.87, 90 deg at 2.5 GHz is 21.9 mm; the book sized W with its synthesis formula, Hammerstad's analysis agrees to ~1 %: rel 1e-2 on Z0, abs 5e-3 on eps_e, 0.05 mm on length",
     "checks": [
      "eps_eff",
      "length_mm",
      "z0_ohm"
     ]
    },
    {
     "name": "Microstrip in air (eps_r = 1), w/h = 0.5: eps_eff = 1 exactly, Z0 = eta0/(2 pi) ln(8/u + u/4) = 166.7068 ohm (Hammerstad narrow-strip closed form); rel 1e-9",
     "checks": [
      "eps_eff",
      "z0_ohm"
     ]
    }
   ],
   "title": "Transmission line: impedance, mismatch and matching",
   "needs_build": true,
   "category": "Waves, optics and circuits",
   "known_answers": 41
  },
  {
   "name": "truss2d",
   "version": "0.1.0",
   "summary": "Plane pin-jointed truss by the direct stiffness method: joints, members (E, A), supports and joint loads give member axial forces and stresses, joint displacements, support reactions and the worst utilisation against a yield stress. Linear elastic, small displacements; compression members are checked against yield only, with the Euler second moment each one needs reported.",
   "runtime": "native",
   "timeout_s": 30,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "nodes",
     "type": "array",
     "unit": "m",
     "default": [
      [
       0,
       0
      ],
      [
       4,
       0
      ],
      [
       2,
       3
      ]
     ],
     "enum": null,
     "description": "Joints, 2 to 400: [x, y] in metres, or {\"x_m\", \"y_m\", \"name\"}. y is up. Node numbers start at 0 in list order."
    },
    {
     "name": "members",
     "type": "array",
     "unit": null,
     "default": [
      [
       0,
       1
      ],
      [
       1,
       2
      ],
      [
       0,
       2
      ]
     ],
     "enum": null,
     "description": "Members, 1 to 1500: [a, b], [a, b, A_mm2], [a, b, A_mm2, E_GPa], or {\"a\", \"b\", \"A_mm2\", \"E_GPa\", \"name\"}. Area and modulus left out take A_mm2 and E_GPa below."
    },
    {
     "name": "supports",
     "type": "array",
     "unit": null,
     "default": [
      {
       "node": 0,
       "fix": "xy"
      },
      {
       "node": 1,
       "fix": "y"
      }
     ],
     "enum": null,
     "description": "Restraints: {\"node\": i, \"fix\": \"xy\"} is a pin, \"x\" or \"y\" a roller held in that direction. At least 3 restrained directions in all."
    },
    {
     "name": "loads",
     "type": "array",
     "unit": null,
     "default": [
      {
       "node": 2,
       "fx_kN": 0,
       "fy_kN": -10
      }
     ],
     "enum": null,
     "description": "Joint loads: {\"node\": i, \"fx_kN\": .., \"fy_kN\": ..} or [node, fx_kN, fy_kN]. A weight is a negative fy_kN. Loads on one joint add up."
    },
    {
     "name": "E_GPa",
     "type": "number",
     "unit": "GPa",
     "default": 200,
     "enum": null,
     "description": "Young's modulus of every member that does not give its own (steel about 200, aluminium about 70)."
    },
    {
     "name": "A_mm2",
     "type": "number",
     "unit": "mm^2",
     "default": 1000,
     "enum": null,
     "description": "Cross-section area of every member that does not give its own."
    },
    {
     "name": "yield_MPa",
     "type": "number",
     "unit": "MPa",
     "default": 250,
     "enum": null,
     "description": "Yield stress the utilisation |stress| / yield is taken against (a design value: divide by your material factor first)."
    },
    {
     "name": "load_factor",
     "type": "number",
     "unit": "1",
     "default": 1,
     "enum": null,
     "description": "Multiplies every load (a partial safety factor on actions, or a sweep variable)."
    }
   ],
   "outputs": [
    {
     "name": "n_nodes",
     "unit": "1",
     "description": null
    },
    {
     "name": "n_members",
     "unit": "1",
     "description": null
    },
    {
     "name": "n_restrained",
     "unit": "1",
     "description": null
    },
    {
     "name": "static_indeterminacy",
     "unit": "1",
     "description": "members + restrained directions - 2 x joints: 0 statically determinate, >0 indeterminate."
    },
    {
     "name": "all_ok",
     "unit": null,
     "description": "true when every member's |stress| is at or below yield_MPa."
    },
    {
     "name": "warnings",
     "unit": null,
     "description": "One line per member above yield."
    },
    {
     "name": "worst_utilisation",
     "unit": "1",
     "description": "Largest |stress| / yield_MPa over the members."
    },
    {
     "name": "worst_member",
     "unit": "1",
     "description": "Index of that member (0-based, list order)."
    },
    {
     "name": "max_tension_kN",
     "unit": "kN",
     "description": null
    },
    {
     "name": "max_compression_kN",
     "unit": "kN",
     "description": "Largest compressive force, as a positive number."
    },
    {
     "name": "max_abs_stress_MPa",
     "unit": "MPa",
     "description": null
    },
    {
     "name": "max_displacement_mm",
     "unit": "mm",
     "description": null
    },
    {
     "name": "max_displacement_node",
     "unit": "1",
     "description": null
    },
    {
     "name": "load_sum_x_kN",
     "unit": "kN",
     "description": null
    },
    {
     "name": "load_sum_y_kN",
     "unit": "kN",
     "description": null
    },
    {
     "name": "reaction_sum_x_kN",
     "unit": "kN",
     "description": null
    },
    {
     "name": "reaction_sum_y_kN",
     "unit": "kN",
     "description": null
    },
    {
     "name": "joint_residual_kN",
     "unit": "kN",
     "description": "Largest out-of-balance force at a free joint, from the recovered member forces (0 up to roundoff)."
    },
    {
     "name": "moment_residual_kN_m",
     "unit": "kN m",
     "description": "Moment of loads plus reactions about the origin (0 up to roundoff)."
    },
    {
     "name": "strain_energy_J",
     "unit": "J",
     "description": null
    },
    {
     "name": "external_work_J",
     "unit": "J",
     "description": "Half the loads times their displacements; equals strain_energy_J (Clapeyron)."
    },
    {
     "name": "members",
     "unit": null,
     "description": "One row per member, list order."
    },
    {
     "name": "nodes",
     "unit": null,
     "description": "One row per joint, list order; rx_kN / ry_kN are null on a free direction."
    }
   ],
   "selftests": [
    {
     "name": "single bar (textbook N = P, sigma = P/A, extension PL/(EA)): 10 kN on 2 m, 100 mm2, 200 GPa -> 10 kN, 100 MPa, 1.000 mm; exact, rel 1e-9 roundoff only",
     "checks": [
      "members.0.elongation_mm",
      "members.0.force_kN",
      "members.0.stress_MPa",
      "nodes.0.rx_kN",
      "nodes.1.ux_mm",
      "worst_utilisation"
     ]
    },
    {
     "name": "symmetric two-bar truss, apex load (textbook N = P/(2 sin t), apex deflection PL/(2EA sin^2 t)): 3-4-5 geometry sin t = 0.6, P = 120 kN, L = 5 m, EA = 200 GPa x 1000 mm2 -> N = -100 kN, v = -4.16667 mm, thrust 80 kN; exact, rel 1e-9",
     "checks": [
      "members.0.force_kN",
      "members.1.force_kN",
      "nodes.0.rx_kN",
      "nodes.0.ry_kN",
      "nodes.1.rx_kN",
      "nodes.2.ux_mm",
      "nodes.2.uy_mm"
     ]
    },
    {
     "name": "determinate 3-4-5 triangle by the method of joints: pin (0,0), roller (4,0), 12 kN sideways at (0,3) -> AB +12, BC -15, AC +9 kN, reactions (-12,-9) and 9 kN, roller slides NL/(EA) = 0.24 mm; exact, rel 1e-9",
     "checks": [
      "members.0.force_kN",
      "members.1.force_kN",
      "members.1.stress_MPa",
      "members.2.force_kN",
      "nodes.0.rx_kN",
      "nodes.0.ry_kN",
      "nodes.1.ry_kN",
      "nodes.1.ux_mm",
      "static_indeterminacy",
      "worst_member",
      "worst_utilisation"
     ]
    },
    {
     "name": "reactions balance the loads (statics: sum F, sum M about the pin) on a two-panel Warren truss, plus the top chord by the method of sections -50/3 kN; exact, rel 1e-9, residuals abs 1e-9 kN",
     "checks": [
      "joint_residual_kN",
      "members.2.force_kN",
      "moment_residual_kN_m",
      "nodes.0.rx_kN",
      "nodes.0.ry_kN",
      "nodes.2.ry_kN",
      "reaction_sum_x_kN",
      "reaction_sum_y_kN"
     ]
    },
    {
     "name": "indeterminate three-bar truss (Timoshenko, Strength of Materials: N_v = P/(1+2cos^3 a), N_i = N_v cos^2 a, v = N_v L/(EA)): cos a = 0.6, P = 100 kN, L = 3 m -> 69.8324, 25.1397 kN, 1.04749 mm; exact, rel 1e-9",
     "checks": [
      "members.0.force_kN",
      "members.1.force_kN",
      "members.2.force_kN",
      "nodes.0.uy_mm",
      "static_indeterminacy"
     ]
    }
   ],
   "title": "Plane truss (direct stiffness)",
   "needs_build": true,
   "category": "Mechanics, CAD and finite elements",
   "known_answers": 37
  },
  {
   "name": "uncertainty",
   "version": "0.1.0",
   "summary": "Measurement uncertainty budget after the GUM (JCGM 100): a formula over named quantities with standard uncertainties, optional dof and correlations gives the combined standard uncertainty from numeric sensitivities, Welch-Satterthwaite effective dof, coverage factor from Student's t, expanded uncertainty, a contribution table, and a fixed-seed Monte Carlo cross-check validated as in GUM Supplement 1 (JCGM 101) section 8.",
   "runtime": "native",
   "timeout_s": 60,
   "estimate_s": 0.3,
   "inputs": [
    {
     "name": "formula",
     "type": "string",
     "unit": null,
     "default": "m/(pi*r^2*h)",
     "enum": null,
     "description": "The measurement model y = f(x) over the names in quantities. Operators + - * / ^ (or **), parentheses, constants pi and e, functions sqrt exp ln log10 sin cos tan asin acos atan sinh cosh tanh abs pow hypot atan2. Angles in radians."
    },
    {
     "name": "quantities",
     "type": "object",
     "unit": null,
     "default": {
      "m": {
       "value": 0.5,
       "u_rel": 0.002
      },
      "r": {
       "value": 0.02,
       "u_rel": 0.005
      },
      "h": {
       "value": 0.05,
       "u_rel": 0.004
      }
     },
     "enum": null,
     "description": "Input quantities by name: {\"value\": best estimate, \"u\": standard uncertainty in the value's unit, or \"u_rel\": standard uncertainty as a fraction of |value|, optional \"dof\": degrees of freedom (left out = infinite), optional \"dist\": \"normal\" (default) or \"rectangular\" for the Monte Carlo draw}. Each quantity carries its own unit; the formula must be consistent in them."
    },
    {
     "name": "correlations",
     "type": "array",
     "unit": null,
     "default": [],
     "enum": null,
     "description": "Correlation coefficients between pairs of quantities: [{\"a\": name, \"b\": name, \"r\": -1 .. 1}]. Pairs left out are uncorrelated."
    },
    {
     "name": "coverage_p",
     "type": "number",
     "unit": "1",
     "default": 0.95,
     "enum": null,
     "description": "Coverage probability of the expanded uncertainty and of the Monte Carlo interval."
    },
    {
     "name": "mc_samples",
     "type": "integer",
     "unit": "1",
     "default": 200000,
     "enum": null,
     "description": "Number of Monte Carlo draws."
    },
    {
     "name": "seed",
     "type": "integer",
     "unit": "1",
     "default": 1,
     "enum": null,
     "description": "Seed of the Monte Carlo generator (xoshiro256**); the same seed gives the same draws."
    },
    {
     "name": "y_unit",
     "type": "string",
     "unit": null,
     "default": "1",
     "enum": null,
     "description": "Unit of the formula's result (written on y, u_c, U and the intervals), e.g. \"kg/m^3\". \"1\" for a plain number."
    }
   ],
   "outputs": [
    {
     "name": "formula",
     "unit": null,
     "description": null
    },
    {
     "name": "y_unit",
     "unit": null,
     "description": null
    },
    {
     "name": "y",
     "unit": null,
     "description": "estimate f(x) at the best estimates"
    },
    {
     "name": "u_c",
     "unit": null,
     "description": "combined standard uncertainty (GUM eq. 13)"
    },
    {
     "name": "u_rel",
     "unit": "1",
     "description": "u_c / |y|"
    },
    {
     "name": "nu_eff",
     "unit": "1",
     "description": "Welch-Satterthwaite effective degrees of freedom; null when infinite"
    },
    {
     "name": "nu_used",
     "unit": "1",
     "description": "nu_eff truncated to the next lower integer (GUM G.6.4)"
    },
    {
     "name": "coverage_p",
     "unit": "1",
     "description": null
    },
    {
     "name": "k",
     "unit": "1",
     "description": "coverage factor: Student's t quantile at nu_used, or the normal quantile"
    },
    {
     "name": "U",
     "unit": null,
     "description": "expanded uncertainty k u_c"
    },
    {
     "name": "low",
     "unit": null,
     "description": null
    },
    {
     "name": "high",
     "unit": null,
     "description": null
    },
    {
     "name": "correlation_share_pct",
     "unit": "%",
     "description": "share of u_c^2 from the correlation terms"
    },
    {
     "name": "contributions",
     "unit": null,
     "description": "per quantity: value, u, dof, dist, sensitivity (df/dx), rel_sensitivity (x/y df/dx), u_y (|c| u, in y's unit), share_pct (of u_c^2)"
    },
    {
     "name": "mc_samples",
     "unit": "1",
     "description": null
    },
    {
     "name": "mc_seed",
     "unit": "1",
     "description": null
    },
    {
     "name": "mc_mean",
     "unit": null,
     "description": null
    },
    {
     "name": "mc_u",
     "unit": null,
     "description": "standard deviation of the Monte Carlo output"
    },
    {
     "name": "mc_u_se",
     "unit": null,
     "description": "sampling error of mc_u (from the sample kurtosis)"
    },
    {
     "name": "mc_mean_se",
     "unit": null,
     "description": null
    },
    {
     "name": "mc_low",
     "unit": null,
     "description": null
    },
    {
     "name": "mc_high",
     "unit": null,
     "description": null
    },
    {
     "name": "mc_u_rel_diff",
     "unit": "1",
     "description": "(mc_u - u_c) / u_c"
    },
    {
     "name": "mc_check_delta",
     "unit": null,
     "description": "GUM S1 numerical tolerance: half a unit in the 2nd significant digit of u_c"
    },
    {
     "name": "mc_check_tol",
     "unit": null,
     "description": "delta plus three sampling errors of a Monte Carlo endpoint"
    },
    {
     "name": "mc_d_low",
     "unit": null,
     "description": null
    },
    {
     "name": "mc_d_high",
     "unit": null,
     "description": null
    },
    {
     "name": "mc_nonfinite",
     "unit": "1",
     "description": null
    },
    {
     "name": "mc_agrees",
     "unit": null,
     "description": "true when both interval endpoints agree within mc_check_tol"
    },
    {
     "name": "warnings",
     "unit": null,
     "description": null
    },
    {
     "name": "contributions.csv",
     "unit": null,
     "description": null
    },
    {
     "name": "mc_histogram.csv",
     "unit": null,
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "sum y = a + b (GUM eq. 10 closed form): u = sqrt(0.3^2 + 0.4^2) = 0.5 exactly, k = normal 97.5 % quantile 1.959963984540054 (textbook), rel 1e-9 (finite-difference sensitivity)",
     "checks": [
      "k",
      "mc_agrees",
      "mc_u",
      "u_c",
      "y"
     ]
    },
    {
     "name": "product y = a b (GUM 5.1.6): relative u adds in quadrature, sqrt(1%^2 + 2%^2) = sqrt(5e-4) = 0.022360679774998, u = 6 x that = 0.134164078649987, rel 1e-9",
     "checks": [
      "u_c",
      "u_rel",
      "y"
     ]
    },
    {
     "name": "square y = x^2: u = 2 x u_x = 2 * 3 * 0.1 = 0.6 (closed form), rel 1e-9",
     "checks": [
      "contributions.x.sensitivity",
      "u_c",
      "y"
     ]
    },
    {
     "name": "difference a - b fully correlated (r = 1) with equal u = 0.2: u_c = 0 exactly (GUM eq. 16); abs 1e-9 for finite-difference roundoff",
     "checks": [
      "mc_u",
      "u_c",
      "y"
     ]
    },
    {
     "name": "cylinder density m/(pi r^2 h): rho = 0.5/(pi 0.02^2 0.05) = 7957.747154594767, u_rel = sqrt(0.002^2 + 4 0.005^2 + 0.004^2) = sqrt(1.2e-4) = 0.010954451150103 (closed form), rel 1e-9",
     "checks": [
      "contributions.r.share_pct",
      "u_c",
      "u_rel",
      "y"
     ]
    },
    {
     "name": "Welch-Satterthwaite a + b, u = 1 and dof = 1 each: nu_eff = 2^2/(1+1) = 2; k = t(0.975, 2) = 0.95 sqrt(2/0.0975) = 4.302652729749461 (closed form for nu = 2); U = k sqrt 2, rel 1e-9",
     "checks": [
      "U",
      "k",
      "nu_eff"
     ]
    },
    {
     "name": "t quantile nu = 1: one quantity with dof 1 gives k = t(0.975, 1) = tan(0.475 pi) = 12.706204736174696 (Cauchy closed form), rel 1e-9",
     "checks": [
      "k",
      "nu_eff",
      "u_c"
     ]
    },
    {
     "name": "Welch-Satterthwaite with unequal terms, y = 2a + b, u_a = sqrt(3)/2 (dof 3), u_b = 1 (dof 1): c u = sqrt 3 and 1, u_c = 2, nu_eff = 16/(9/3 + 1/1) = 4; k = t(0.975, 4) = 2 sqrt(q - 1), q = cos(acos(sqrt A)/3)/sqrt A, A = 4 p (1 - p) (closed form for nu = 4) = 2.7764451051977934; U = 2 k, rel 1e-9",
     "checks": [
      "U",
      "k",
      "nu_eff",
      "u_c"
     ]
    },
    {
     "name": "truncation of nu_eff (GUM G.6.4) at 99 %: same model with dof_b = 1.8 gives nu_eff = 16/(3 + 1/1.8) = 4.5, used as 4; k = t(0.995, 4) = 4.604094871349992 (same nu = 4 closed form), rel 1e-9",
     "checks": [
      "k",
      "nu_eff",
      "nu_used"
     ]
    },
    {
     "name": "Monte Carlo y = x^2, x ~ N(1, 0.5): exact E = x^2 + u^2 = 1.25, sd = sqrt(4 x^2 u^2 + 2 u^4) = 1.0606601717798212 (normal moments); GUM gives 1.0 and is not validated; tol 0.012 = about 4.5 sampling errors at 200000 draws",
     "checks": [
      "mc_agrees",
      "mc_mean",
      "mc_u",
      "u_c"
     ]
    }
   ],
   "title": "Measurement uncertainty budget (GUM)",
   "needs_build": true,
   "category": "Measurement and data",
   "known_answers": 35
  },
  {
   "name": "variant_effect",
   "version": "0.1.0",
   "summary": "Annotates coding DNA variants (SNVs and indels): classifies synonymous, missense, nonsense, frameshift, inframe indel, start/stop loss, generates HGVS protein notation, and computes BLOSUM62 and Grantham severity scores.",
   "runtime": "native",
   "timeout_s": 30,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "cds",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "Reference coding DNA sequence starting at ATG."
    },
    {
     "name": "pos",
     "type": "integer",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "1-based nucleotide coordinate in cds."
    },
    {
     "name": "ref_allele",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": null
    },
    {
     "name": "alt_allele",
     "type": "string",
     "unit": null,
     "default": null,
     "enum": null,
     "description": null
    }
   ],
   "outputs": [
    {
     "name": "consequence",
     "unit": null,
     "description": null
    },
    {
     "name": "hgvs_p",
     "unit": null,
     "description": null
    },
    {
     "name": "blosum62",
     "unit": "1",
     "description": null
    },
    {
     "name": "grantham_distance",
     "unit": "1",
     "description": null
    }
   ],
   "selftests": [
    {
     "name": "Val->Glu missense (GTG>GAG): p.Val2Glu, Grantham 121, BLOSUM62 -2",
     "checks": [
      "blosum62",
      "consequence",
      "grantham_distance",
      "hgvs_p"
     ]
    },
    {
     "name": "synonymous GTG>GTA -> p.Val2=, Grantham 0",
     "checks": [
      "consequence",
      "grantham_distance",
      "hgvs_p"
     ]
    }
   ],
   "title": "Coding variant effect annotation",
   "needs_build": true,
   "category": "Genomics",
   "known_answers": 7
  },
  {
   "name": "vle_flash",
   "version": "0.1.0",
   "summary": "Vapour-liquid equilibrium of an ideal mixture (Raoult's law, Antoine vapour pressures given as inputs per component): bubble and dew pressure at a temperature, bubble and dew temperature at a pressure, isothermal flash by Rachford-Rice at both, relative volatility; P-x-y and T-x-y csv for a binary.",
   "runtime": "native",
   "timeout_s": 30,
   "estimate_s": 0.05,
   "inputs": [
    {
     "name": "components",
     "type": "array",
     "unit": null,
     "default": null,
     "enum": null,
     "description": "One object per component: {name, A, B, C, T_min, T_max}, with log P = A - B / (T + C) in the convention set by antoine_log, antoine_pressure_unit and antoine_temperature_unit. T_min and T_max (optional) are the validity range of the fit, in the Antoine temperature unit. Coefficients are the caller's data: nothing is tabulated in the instrument."
    },
    {
     "name": "z",
     "type": "array",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "Overall mole fractions, one per component in the same order, summing to 1 (within 1e-6, then normalised). May be left out for a single component."
    },
    {
     "name": "temperature_K",
     "type": "number",
     "unit": "K",
     "default": null,
     "enum": null,
     "description": "Temperature. Alone: bubble and dew pressure. With pressure_kPa: also the isothermal flash."
    },
    {
     "name": "pressure_kPa",
     "type": "number",
     "unit": "kPa",
     "default": null,
     "enum": null,
     "description": "Absolute pressure (1 atm = 101.325 kPa). Alone: bubble and dew temperature. With temperature_K: also the isothermal flash."
    },
    {
     "name": "antoine_log",
     "type": "string",
     "unit": null,
     "default": "log10",
     "enum": [
      "log10",
      "ln"
     ],
     "description": "log10 for log10(P) = A - B/(T + C), ln for ln(P) = A - B/(T + C)."
    },
    {
     "name": "antoine_pressure_unit",
     "type": "string",
     "unit": null,
     "default": "mmHg",
     "enum": [
      "mmHg",
      "kPa",
      "bar",
      "Pa",
      "atm"
     ],
     "description": "Pressure unit the coefficients were fitted in. mmHg is taken as 1/760 atm (the torr; the conventional mmHg differs by 1.4e-7 relative)."
    },
    {
     "name": "antoine_temperature_unit",
     "type": "string",
     "unit": null,
     "default": "C",
     "enum": [
      "C",
      "K"
     ],
     "description": "Temperature unit the coefficients were fitted in: C for degrees Celsius, K for kelvin."
    },
    {
     "name": "reference_component",
     "type": "integer",
     "unit": "1",
     "default": null,
     "enum": null,
     "description": "Position (1-based) of the component relative volatilities are taken against: alpha_i = Psat_i / Psat_ref. Default: the last component."
    },
    {
     "name": "curve_points",
     "type": "integer",
     "unit": "1",
     "default": 41,
     "enum": null,
     "description": "Points on the binary P-x-y and T-x-y curves."
    }
   ],
   "outputs": [
    {
     "name": "mode",
     "unit": null,
     "description": "at temperature, at pressure, or flash at T and P"
    },
    {
     "name": "names",
     "unit": null,
     "description": "component names, in input order"
    },
    {
     "name": "n_components",
     "unit": "1",
     "description": null
    },
    {
     "name": "z",
     "unit": "1",
     "description": null
    },
    {
     "name": "psat_kPa",
     "unit": "kPa",
     "description": "pure vapour pressures at temperature_K"
    },
    {
     "name": "bubble_pressure_kPa",
     "unit": "kPa",
     "description": "sum x_i Psat_i, with x = z"
    },
    {
     "name": "y_at_bubble_pressure",
     "unit": "1",
     "description": null
    },
    {
     "name": "dew_pressure_kPa",
     "unit": "kPa",
     "description": "1 / sum (y_i / Psat_i), with y = z"
    },
    {
     "name": "x_at_dew_pressure",
     "unit": "1",
     "description": null
    },
    {
     "name": "relative_volatility",
     "unit": "1",
     "description": "Psat_i / Psat_ref at relative_volatility_at_K"
    },
    {
     "name": "relative_volatility_at_K",
     "unit": "K",
     "description": null
    },
    {
     "name": "bubble_temperature_K",
     "unit": "K",
     "description": null
    },
    {
     "name": "y_at_bubble_temperature",
     "unit": "1",
     "description": null
    },
    {
     "name": "dew_temperature_K",
     "unit": "K",
     "description": null
    },
    {
     "name": "x_at_dew_temperature",
     "unit": "1",
     "description": null
    },
    {
     "name": "boiling_range_K",
     "unit": "K",
     "description": "dew minus bubble temperature"
    },
    {
     "name": "pure_boiling_temperature_K",
     "unit": "K",
     "description": null
    },
    {
     "name": "relative_volatility_at_bubble",
     "unit": "1",
     "description": null
    },
    {
     "name": "relative_volatility_at_dew",
     "unit": "1",
     "description": null
    },
    {
     "name": "k_values",
     "unit": "1",
     "description": "K_i = Psat_i(T) / P"
    },
    {
     "name": "phase",
     "unit": null,
     "description": "two-phase, bubble point, dew point, subcooled liquid, superheated vapour, or saturated (pure component on its boiling line: vapour fraction null)"
    },
    {
     "name": "vapor_fraction",
     "unit": "1",
     "description": "Rachford-Rice vapour fraction b (molar)"
    },
    {
     "name": "x",
     "unit": "1",
     "description": "liquid mole fractions; null for a superheated vapour"
    },
    {
     "name": "y",
     "unit": "1",
     "description": "vapour mole fractions; null for a subcooled liquid"
    },
    {
     "name": "material_balance_residual",
     "unit": "1",
     "description": "max_i |z_i - (1 - b) x_i - b y_i|"
    },
    {
     "name": "sum_x",
     "unit": "1",
     "description": null
    },
    {
     "name": "sum_y",
     "unit": "1",
     "description": null
    },
    {
     "name": "components",
     "unit": null,
     "description": "per component: z, psat_kPa, boiling_temperature_K, relative_volatility, k_value, x, y"
    },
    {
     "name": "antoine_in_range",
     "unit": null,
     "description": "true when every computed temperature is inside the given Antoine ranges; null when no range was given"
    },
    {
     "name": "warnings",
     "unit": null,
     "description": "temperatures outside a given Antoine range"
    },
    {
     "name": "files",
     "unit": null,
     "description": "components.csv; pxy.csv (binary, at T); txy.csv (binary, at P)"
    }
   ],
   "selftests": [
    {
     "name": "pure component, log10 Antoine in kPa and K (A=4, B=600, C=0) at 100 kPa: closed form T = B/(A - log10 P) = 300 K exactly, bubble = dew (rel 1e-9: bisection to neighbouring floats)",
     "checks": [
      "boiling_range_K",
      "bubble_temperature_K",
      "dew_temperature_K",
      "pure_boiling_temperature_K.0"
     ]
    },
    {
     "name": "pure component, log10 Antoine in mmHg and degC (A=7, B=1500, C=200) at 101.325 kPa = 760 mmHg (exact by definition): closed form T = B/(A - log10 760) - C + 273.15 = 437.299579924097 K (rel 1e-9)",
     "checks": [
      "boiling_range_K",
      "bubble_temperature_K",
      "dew_temperature_K"
     ]
    },
    {
     "name": "binary at 300 K with Psat = 100 and 10 kPa by construction (10^(4-600/300), 10^(4-900/300)), z = [0.4, 0.6]: Raoult P_bubble = 46 kPa, y1 = 40/46 = 20/23; P_dew = 1/(0.4/100 + 0.6/10) = 15.625 kPa, x1 = 0.0625; alpha = 10 (closed forms, rel 1e-9)",
     "checks": [
      "bubble_pressure_kPa",
      "dew_pressure_kPa",
      "psat_kPa.0",
      "psat_kPa.1",
      "relative_volatility.0",
      "x_at_dew_pressure.0",
      "y_at_bubble_pressure.0"
     ]
    },
    {
     "name": "binary flash at 300 K, 25 kPa (K = 4 and 0.4): lever-rule closed form x1 = (1 - K2)/(K1 - K2) = 1/6, y1 = 2/3, b = (z1 - x1)/(y1 - x1) = 7/15; z = (1 - b) x + b y (rel 1e-9; balance abs 1e-12)",
     "checks": [
      "k_values.0",
      "material_balance_residual",
      "phase",
      "vapor_fraction",
      "x.0",
      "y.0"
     ]
    },
    {
     "name": "binary flash at its own bubble pressure (300 K, 46 kPa from the closed form above): vapour fraction 0, incipient vapour y1 = 20/23 (abs 1e-9 on b, rel 1e-9 on y1)",
     "checks": [
      "vapor_fraction",
      "y.0"
     ]
    },
    {
     "name": "binary flash at its own dew pressure (300 K, 15.625 kPa from the closed form above): vapour fraction 1, incipient liquid x1 = 0.0625 (abs 1e-9 on b, rel 1e-9 on x1)",
     "checks": [
      "vapor_fraction",
      "x.0"
     ]
    },
    {
     "name": "binary at 50 kPa with equal B (constant alpha = 10^(A1-A2) = 10), z = [0.5, 0.5]: closed forms T_bubble = B/log10((x1 10^A1 + x2 10^A2)/P) = 600/log10(110), T_dew = -B/log10(P (y1 10^-A1 + y2 10^-A2)) = -600/log10(0.0275), y1 = 10/11, x1 = 1/11 (rel 1e-9)",
     "checks": [
      "bubble_temperature_K",
      "dew_temperature_K",
      "relative_volatility_at_bubble.0",
      "relative_volatility_at_dew.0",
      "x_at_dew_temperature.0",
      "y_at_bubble_temperature.0"
     ]
    },
    {
     "name": "ternary Rachford-Rice, exact by construction: Psat = 100, 10, 1 kPa at 300 K, P = 10 kPa (K = 10, 1, 0.1); x = (0.05, 0.45, 0.5), y = K x = (0.5, 0.45, 0.05), b = 0.25 give z = (1-b) x + b y = (0.1625, 0.45, 0.3875); RR is monotonic so b is unique (rel 1e-9)",
     "checks": [
      "material_balance_residual",
      "phase",
      "vapor_fraction",
      "x.0",
      "x.2",
      "y.0",
      "y.2"
     ]
    }
   ],
   "title": "Vapour-liquid equilibrium (ideal mixture, Raoult)",
   "needs_build": true,
   "category": "Chemistry",
   "known_answers": 37
  }
 ]
}
