Files
medicallib_rust/docs/research_summary.md
zack3d 31a0b8a485
Multi-Platform CI / test-platforms (ubuntu-22.04) (push) Successful in 18s
Multi-Platform CI / test-platforms (windows-latest) (push) Successful in 18s
Multi-Platform CI / Package for Linux x86_64 (push) Has been skipped
Multi-Platform CI / Package for Windows x86_64 (push) Has been skipped
Multi-Platform CI / Create GitHub Release (push) Has been skipped
feat(ffi): add bloodstream and bladder metrics API
- add C FFI enums MLBladderPhase, MLMetabolicState, MLPerfusionState
- add C FFI structs MLBloodstreamMetrics and MLBladderMetrics
- add ml_patient_bloodstream_metrics and ml_patient_bladder_metrics
  to populate metrics for a patient (mirrored in src/ffi.rs)
- update examples/c/ffi_example.c to print new metrics
- add tests for FFI metrics (tests/ffi.rs)

organ model expansions
- bloodstream: add metrics() snapshot and detailed physiology:
  plasma proteins/oncotic pressure, lymph return, RBC cohort tracking,
  erythropoiesis/clearance with HIF, iron/folate/B12 stores, platelets,
  coagulation/fibrinolysis, immune cell counts, complement, acid–base
- bladder: introduce adaptive compliance, reflex gating, cortical/voluntary
  modulators, safety indices; add metrics(), summary, and unit tests
- brain: add homeostatic drives (respiratory, thirst, hunger, thermo, pain),
  brainstem nuclei (NTS/RVLM/CVLM, nAmb/DMV, RTN), sleep cycle timing,
  cerebrovascular autoregulation; wire drives into autonomic control
- heart: add phase-based cycle (valves and atria), conduction system,
  RAAS regulation, improved coronary perfusion
- intestines: add micronutrient absorption feeding erythropoiesis

patient coupling
- expose Patient::bloodstream_metrics() and ::bladder_metrics()
- integrate new organ signals (kidney osmolality, spleen culling, liver
  proteins) and brain–lung/continence control pathways
- re-export BladderMetrics and BloodstreamMetrics in lib.rs

note
- existing FFI remains compatible; this is a surface addition
- ffi/medicallib.h kept in sync with src/ffi.rs
2025-09-30 02:38:27 -07:00

45 KiB
Raw Permalink Blame History

Research Summary

Heart

Current simulation coverage

  • Lumped ventricular pump tracks heart rate, arterial pressures, stroke volume, end-diastolic/systolic volumes, ejection fraction, contractility, preload/afterload and systemic vascular resistance, all coupled to cardiac output control (src/organs/heart.rs:20-218).
  • Baroreflex-like autonomic loop adjusts sinoatrial pacing, AV delay, vascular resistance and contractility while classifying rhythm states and arrhythmia burden (src/organs/heart.rs:125-260).
  • Coronary perfusion, myocardial oxygen supply/demand balance and stroke work are approximated through simple pressure-driven formulas (src/organs/heart.rs:199-247).

Physiology findings and observed gaps

  • Model lacks explicit atrial chambers and valve mechanics, yet real hearts rely on four coordinated valves guiding flow through right/left atria and ventricles for one-way circulation and chamber filling.[1][2]
  • The cardiac cycle here omits staged systole/diastole events (atrial kick, isovolumic contraction/relaxation, rapid and reduced filling) that shape physiologic pressure-volume loops and heart sounds.[6]
  • Electrical conduction is reduced to SA node rate and an AV delay; physiological activation propagates through the bundle of His, bundle branches and Purkinje fibers to synchronize ventricular contraction and prevent dys-synchrony.[3]
  • Coronary supply is approximated by linear clamps, whereas left ventricular perfusion primarily occurs during diastole and depends on the aortic diastolic pressure minus LV end-diastolic pressure (coronary perfusion pressure).[4]
  • No endocrine or renal modulation is represented even though the renin-angiotensin-aldosterone system governs long-term blood pressure, volume status and sympathetic tone that in turn alter preload/afterload.[5]

Opportunities for improvement

  • Introduce discrete atrial compartments and valve state logic (open/closed/regurgitant) to capture atrial kick, regurgitation, shunts and valve pathology scenarios.[1][2][6]
  • Extend conduction modeling with explicit His-Purkinje pathways, refractory periods and conduction delays to support bundle branch blocks, paced rhythms and ventricular dyssynchrony cases.[3]
  • Replace fixed coronary supply proxies with a diastolic perfusion model that references coronary perfusion pressure, heart rate-dependent diastolic time fraction and metabolic autoregulation.[4]
  • Layer hormonal regulation (e.g., RAAS-driven blood volume and vascular tone adjustments) atop existing autonomic controls to reflect chronic adaptations and pharmacologic interventions.[5]
  • Incorporate phase-based cardiac cycle state machine (atrial systole, isovolumic contraction, ejection, isovolumic relaxation, filling) to align simulated pressures/volumes with physiologic waveforms and auscultation cues.[6]

Sources

  1. Cleveland Clinic - Heart Valves: What They Are and How They Work.[1]
  2. Cleveland Clinic - Chambers of the Heart.[2]
  3. Cleveland Clinic - Heart Conduction System.[3]
  4. StatPearls/NCBI - Coronary Perfusion Pressure.[4]
  5. Cleveland Clinic - Renin-Angiotensin-Aldosterone System (RAAS).[5]
  6. Merck Manual - Diagram of the Cardiac Cycle.[6]

Brain

Current simulation coverage

  • Sleep-wake regulation couples circadian phase, homeostatic sleep pressure, and a stage state machine to drive cortical arousal, sleep stage transitions, and EEG proxies (src/organs/brain.rs:54-219).
  • Brainstem autonomic drive aggregates respiratory, pain, thirst, hunger, and thermoregulatory inputs to modulate sympathetic tone and variability (src/organs/brain.rs:220-298).
  • Cerebral perfusion, intracranial pressure, oxygenation, and cerebral blood flow are updated each tick via simplified clamp models tied to metabolic demand and autonomic output (src/organs/brain.rs:299-373).
  • Neurotransmitter proxies for glutamate, GABA, and dopamine modulate metabolic demand, arousal, seizure risk, and cognitive load (src/organs/brain.rs:374-445).
  • Consciousness index, seizure risk, and syncope propensity summarize global cortical state for downstream consumers (src/organs/brain.rs:446-480).

Physiology findings and observed gaps

  • The sleep model advances through staged NREM and REM sequences but lacks representation of REM atonia, stage-specific EEG waveforms, and variable cycle length that characterize physiologic sleep architecture.[7]
  • Brainstem autonomic control is condensed into a single drive, omitting the reflex circuitry across nucleus tractus solitarii, ventrolateral medulla, and dorsal vagal outputs that regulate cardiovascular and respiratory coupling.[8]
  • Cerebral perfusion is linearized around a fixed CPP target, whereas real brains maintain ~50 mL/100 g/min flow using autoregulation across 60-160 mmHg CPP and react strongly to CO2 shifts, ischemic thresholds, and gray/white matter differences.[9]
  • Neurotransmitter variables float within heuristically clamped ranges, yet physiological excitatory-inhibitory balance depends on compartmentalized glutamatergic and GABAergic signaling, receptor kinetics, and astrocytic clearance that drive excitotoxic risk.[10][11]
  • Hunger, thirst, and thermoregulatory drives evolve independently of endocrine and hypothalamic feedback, diverging from integrated osmo- and volumetric sensing networks that coordinate angiotensin, vasopressin, and circadian cues.[12]

Opportunities for improvement

  • Extend the sleep state machine with polysomnographic markers (e.g., REM atonia, spindle counts) and adaptive cycle timing informed by age or prior sleep debt to better match clinical sleep staging.[7]
  • Model key brainstem nuclei, allowing baroreflex, chemoreflex, and vagal pathways to feed back into cardiovascular and respiratory organs with latency and gain parameters derived from physiology texts.[8]
  • Replace static CPP/CBF clamps with an autoregulatory module that tracks vessel resistance, CO2 reactivity, and ischemic thresholds to capture plateau and failure zones of cerebral flow.[9]
  • Introduce neurotransmitter pools and receptor-specific dynamics (AMPA/NMDA, GABA_A/GABA_B) with astrocytic buffering to simulate excitotoxic cascades and pharmacologic interventions.[10][11]
  • Tie hunger, thirst, and thermoregulation drives to hypothalamic and endocrine mediators (e.g., ghrelin, vasopressin, angiotensin II) so fluid and energy balance respond to hormonal and circadian signals.[12]

Sources 7. StatPearls - Physiology of Sleep.[7] 8. Frontiers in Physiology - Synaptic Mechanisms Underlying Elevated Sympathetic Outflow.[8] 9. Stroke Manual - Regulation of Cerebral Blood Flow.[9] 10. NCBI Bookshelf - Glutamate and Aspartate Are the Major Excitatory Transmitters in the Brain.[10] 11. StatPearls - GABA Receptor.[11] 12. Springer Review - Thirst: Neuroendocrine Regulation in Mammals.[12]

Bladder

Current simulation coverage

  • Three-phase state machine (Filling, Voiding, PostVoidRefractory) governs storage dynamics, reflex triggers, and refractory timing to avoid immediate reactivation (src/organs/bladder.rs:5-133).
  • Afferent stretch and urgency perception derive from volume thresholds and compliance normalization so filling maps to sensation (src/organs/bladder.rs:58-96).
  • Autonomic (parasympathetic/sympathetic) and somatic drives converge toward phase-specific targets to coordinate detrusor activation with internal and external sphincter tone (src/organs/bladder.rs:34-88).
  • Pressure dynamics blend passive compliance, abdominal baseline, and detrusor contraction to clamp intravesical pressure during filling and voiding (src/organs/bladder.rs:97-147).
  • Cortical inhibition and pontine guarding/void loops drive hypogastric, pudendal, and detrusor outputs with metrics exposed through Bladder::metrics and FFI for voluntary continence modeling (src/organs/bladder.rs:170-452; src/ffi.rs).[14][15]

Physiology findings and observed gaps

  • Compliance and capacity stay fixed, yet healthy bladders accommodate volume with minimal pressure rise and elevate detrusor pressure only near voiding; sustained storage pressures above safety limits threaten upper tract health.[13][17]
  • Guarding-loop magnitudes still use heuristic gains; calibrating cortical-pontine gating and pudendal discharge against human EMG and urodynamic datasets is needed to capture pathology-specific continence changes.[14][15]
  • Urgency is volume-only, whereas mature continence uses cortical oversight of the pontine micturition center to suppress reflex voiding until socially appropriate.[14][15]
  • Internal and external sphincters are merged, despite smooth-muscle alpha-adrenergic tone and striated, pudendal-innervated control failing independently in disease.[16]
  • Urge and micturition thresholds remain static, even though typical reflex activation spans roughly 250-400 mL and shifts with age, hydration, and neurologic status.[14][18]

Opportunities for improvement

  • Replace static compliance with a pressure-volume curve that adapts to bladder history, hydration, or pathology while tracking detrusor pressure against safety limits.[13][17]
  • Model explicit guarding and voiding reflex pathways (pontine storage/micturition centers, hypogastric, pelvic, pudendal nerves) so autonomic and somatic loops respond to systemic inputs.[14][15]
  • Separate internal and external sphincter models with receptor-specific pharmacology to simulate outlet obstruction, pelvic floor dysfunction, or targeted therapies.[16]
  • Couple urgency and continence to cortical and behavioral inputs so developmental milestones, stress, or voluntary suppression can modulate voiding thresholds.[14]
  • Parameterize urge and micturition thresholds by age, renal output, or neurologic status to span pediatric, neurogenic, and overactive bladder scenarios.[18]

Sources 13. StatPearls - Urodynamic Testing and Interpretation.[13] 14. StatPearls - Physiology, Urination.[14] 15. Nature Reviews Neuroscience - The Neural Control of Micturition.[15] 16. StatPearls - Anatomy of the bladder wall and sphincter receptor distributions.[16] 17. Physiological Reviews - Detrusor mechanics and compliance regulation in health and disease.[17] 18. Indiana University Pressbooks - Typical micturition reflex thresholds and nerve pathways.[18]

Bloodstream

Current simulation coverage

  • Maintains plasma volume, red cell volume, total circulating volume, hematocrit, and hemoglobin while syncing cardiac output, mean arterial pressure, and oxygen saturation targets (src/organs/bloodstream.rs:18-170).
  • Computes arterial/venous oxygen content, delivery, consumption, supply-demand ratio, and circulation time, feeding perfusion and metabolic state classifiers (src/organs/bloodstream.rs:70-210).
  • Aggregates metabolic waste load, lactate, pH proxy, temperature, glucose, and clearance indices for renal and hepatic pathways (src/organs/bloodstream.rs:120-270).
  • Maintains albumin and globulin pools with hepatic synthesis targets, Starling oncotic pressure terms, lymphatic return modulation, and edema risk scoring in the plasma volume controller (src/organs/bloodstream.rs:170-230).[19][20]
  • Tracks erythrocyte age cohorts with spleen-mediated clearance, platelet tagging, and reticuloendothelial iron recycling feeding hepatic stores and transferrin saturation metrics (src/organs/bloodstream.rs:240-320).[21][22]
  • Couples hypoxia-inducible EPO drive with micronutrient sufficiency (iron saturation, folate, cobalamin) to gate erythropoiesis and reticulocyte surges (src/organs/bloodstream.rs:320-360).[23][24]
  • Integrates platelet mass, coagulation factor activity, fibrinogen dynamics, fibrinolysis feedback, and thrombosis/bleeding risk indices modulated by splenic platelet reservoirs (src/organs/bloodstream.rs:360-820).[25][26]
  • Drives leukocyte, differential counts, complement activation, and inflammation indices from spleen immune activity for downstream organs and telemetry surfaces (src/organs/bloodstream.rs:720-860).[27][28]
  • Replaces the static pH clamp with bicarbonate, base excess, anion gap, arterial PCO2, and lactate guided respiratory/renal compensation to update systemic pH targets (src/organs/bloodstream.rs:851-910).[29][30]
  • Sets ventilation-perfusion, pulmonary gas exchange targets, and renal/hepatic clearance goals to coordinate with lung and kidney controllers (src/organs/bloodstream.rs:150-310).

Physiology findings and observed gaps

  • Acute-phase shifts, capillary leak syndromes, and protein-losing pathologies are not yet parameterized, limiting how the new oncotic module responds to inflammation or liver dysfunction.[19][20]
  • Cohort-based erythrocyte turnover lacks explicit macrophage phenotypes, hemolysis triggers, or disease-specific remodeling compared with observed splenic clearance pathways.[21][22]
  • Hemostasis dynamics still rely on generic activation/fibrinolysis curves and omit factor-specific deficiencies, platelet granule secretion, and transfusion or antithrombotic therapy responses.[25][26]
  • Leukocyte modeling excludes adaptive lymphocyte subsets, cytokine networks, and pathogen-specific complement cascades necessary for sepsis or immunosuppression case studies.[27][28]
  • Acid-base controller does not yet simulate strong ion difference, renal ammoniagenesis, or mixed metabolic-respiratory disorders beyond linear compensation curves.[29][30]

Opportunities for improvement

  • Calibrate acute-phase protein responses and capillary permeability effects within the new oncotic and lymphatic model to capture edema and hypoalbuminemia scenarios.[19][20]
  • Add macrophage/monocyte phenotypes, hemolysis triggers, and disease-specific erythrocyte remodeling pathways to the cohort turnover logic.[21][22]
  • Expand coagulation modeling with von Willebrand interactions, factor-specific deficits, platelet granule release, and transfusion protocols to reflect trauma and anticoagulation management.[25][26]
  • Introduce cytokine-mediated leukocyte recruitment, adaptive immune compartments, and pathogen load feedback to enrich inflammation signaling.[27][28]
  • Extend acid-base buffering with strong ion difference, renal ammoniagenesis, and ventilatory control loops tied to organ dysfunction scenarios.[29][30]

Sources 19. Hahn RG. Plasma Volume Oscillations Induced by Hyperoncotic Albumin Infusion. Life (Basel). 2025;15(1):111.[19] 20. Wu JW, Mack GW. Effect of lymphatic outflow on albumin flux from exercising skeletal muscle. J Appl Physiol. 2001;90(5):1912-1918.[20] 21. Vautrinot J, Poole AW. Platelets mediate the clearance of senescent red blood cells. Blood. 2024;143(7):800-812.[21] 22. Mohandas N, Gallagher PG. Accelerated aging of red blood cells in pathologic states. Blood. 2021;137(18):2429-2437.[22] 23. Peng W, Zhan Y, Yu T, et al. Regulation of erythropoiesis by hypoxia-inducible factors and nutrient availability. BMC Med. 2024;22(1):194.[23] 24. Coneyworth LJ, Ford D, Mathers JC. Vitamin B12 and folate interactions in erythropoiesis and neurological function. Nutrients. 2023;15(5):1120.[24] 25. Real-time imaging of platelet-initiated plasma clot formation and lysis unveils distinct impacts of anticoagulants. Res Pract Thromb Haemost. 2024.[25] 26. Thrombopoiesis regulation by hepatic thrombopoietin and splenic clearance ensures platelet homeostasis. J Thromb Thrombolysis. 2025.[26] 27. The role of complement in thromboinflammation. J Trauma Acute Care Surg. 2024.[27] 28. Complement orchestrates innate immune cell differentiation in sepsis. iScience. 2025.[28] 29. Limitations of serum bicarbonate in the ED for diagnosing acid-base disorders. J Emerg Med. 2024.[29] 30. A physiology-based approach to acid-base disorders. BJA Educ. 2024.[30]

Esophagus

Current simulation coverage

  • State machine cycles swallow initiation, primary/secondary peristalsis, clearing, and reflux exposure while tracking bolus volume and peristaltic progress (src/organs/esophagus.rs:105-218).
  • Swallow drive integrates oral dryness and mucosal irritation to retune swallow intervals, vagal tone, and peristaltic strength (src/organs/esophagus.rs:113-131).
  • Lower and upper esophageal sphincter tones adapt via stage-specific modifiers and approach dynamics (src/organs/esophagus.rs:133-150).
  • Hiatal pressure gradient and reflux propensity are blended with sphincter tone to govern reflux transitions and event rates (src/organs/esophagus.rs:153-244).
  • Acid balance updates saliva buffering, mucosal integrity, luminal pH, and estimated reflux frequency each tick (src/organs/esophagus.rs:221-249).

Physiology findings and observed gaps

  • Physiologic swallowing relies on proximal striated and distal smooth muscle with deglutitive inhibition orchestrated by nucleus ambiguus and enteric circuits, but the model uses a single peristaltic strength scalar without segmental timing.[26][27]
  • Primary peristaltic waves in healthy adults traverse ~3-6 cm/s with durations modulated by bolus consistency and posture, whereas wave speeds and bolus emptying here stay fixed regardless of load or position.[27][28]
  • Esophageal acid clearance depends on saliva-stimulated secondary swallows, gravity assistance, and esophageal shortening; current logic omits clearance latency, posture effects, and bicarbonate secretion variability.[29][30]
  • The anti-reflux barrier combines intrinsic LES tone with diaphragmatic crural pinch and transient LES relaxations triggered by gastric distention, yet the simulation only scales a hiatal gradient without diaphragmatic coupling or TLESR triggers.[31]

Opportunities for improvement

  • Split the tube into proximal striated and distal smooth segments with deglutitive inhibition timing and enteric reflex loops to cover neurogenic dysphagia and achalasia variants.[26][27]
  • Parameterize peristaltic velocity and bolus transport against meal consistency, volume, and posture, and allow failed primary waves to spawn variable secondary peristalsis.[27][28]
  • Extend acid clearance to track saliva flow, sequential swallows, gravitational drainage, and bicarbonate buffering so supine, xerostomia, and nocturnal reflux scenarios emerge.[29][30]
  • Model diaphragmatic contributions and transient LES relaxation triggers tied to gastric load, belching, and vagal reflexes to enable GERD, hiatal hernia, and fundoplication training cases.[31]

Sources 26. StatPearls - Physiology, Esophagus.[26] 27. GI Motility Online - Physiology of esophageal motility.[27] 28. TSRA Primer - Esophageal Motility & Function Testing.[28] 29. PubMed - Esophageal acid clearance testing and clinical significance.[29] 30. PubMed - Salivary bicarbonate secretion in gastroesophageal reflux disease.[30] 31. Gastroenterology & Hepatology - Gastroesophageal Reflux Disease: Pathophysiology.[31]

Gallbladder

Current simulation coverage

  • Tracks bile reservoir dynamics (volume, acid concentration, hepatic inflow, bile acid pool, recycling efficiency, mucosal absorption, and gallstone index) within the gallbladder struct (src/organs/gallbladder.rs:24-102).
  • Meal-drive controller sequences fasting clock, meal signal decay, CCK level targeting, and vagal tone adjustments to gate activation cues (src/organs/gallbladder.rs:103-145).
  • Phase state machine (Filling -> Primed -> Contraction -> Expulsion -> Recovery) tunes sphincter of Oddi tone and bile outflow during each stage (src/organs/gallbladder.rs:146-208).
  • Bile pool updater concentrates or dilutes bile, clamps cholesterol saturation, and updates the gallstone nucleation index for downstream risk reporting (src/organs/gallbladder.rs:209-233).

Physiology findings and observed gaps

  • Real gallbladders absorb about 90% of bile water during fasting and eject 50-75% of their contents when CCK triggers contraction alongside sphincter of Oddi relaxation; the model uses fixed constants rather than hormone- and pressure-driven coupling.[32]
  • Interdigestive motility features motilin-driven emptying pulses and sphincter phasic contractions preceding migrating motor complex phase III, but the simulation lacks motilin signaling and oscillatory sphincter behavior.[33][37]
  • Enterohepatic circulation recycles a roughly 3 g bile acid pool 4-12 times per day with 95% ileal reabsorption; the current model does not exchange bile acids with intestinal or hepatic compartments, obscuring pool depletion or malabsorption states.[34]
  • Gallstone formation requires cholesterol supersaturation, mucin-mediated nucleation, and gallbladder stasis, whereas the simulation reduces risk to a single scalar that omits mucin dynamics, bile composition shifts, and sludge progression.[35][36]

Opportunities for improvement

  • Replace fixed absorption and outflow clamps with transport models that concentrate bile via electrolyte exchange, allow fractional emptying, and coordinate sphincter relaxation with CCK levels to match post-prandial kinetics.[32]
  • Introduce motilin and vagovagal reflex inputs that trigger intermittent fasting-phase contractions and modulate sphincter of Oddi tone, enabling biliary dyskinesia and post-cholecystectomy motility scenarios.[33][37]
  • Link the gallbladder bile acid pool to a shared enterohepatic circuit with hepatic synthesis, intestinal reuptake, and fecal losses so bile acid sequestrants or ileal disease deplete the pool and alter digestion.[34]
  • Expand the gallstone framework to track bile lipid composition, mucin secretion, sludge accumulation, and stasis duration to differentiate cholesterol versus pigment stone risks and evaluate preventive therapies.[35][36]

Sources 32. Merck Manual Professional Edition - Overview of Biliary Function.[32] 33. PubMed - Cyclic motility of the sphincter of Oddi.[33] 34. PMC - Nuclear receptor control of enterohepatic circulation.[34] 35. StatPearls - Gallstones (Cholelithiasis).[35] 36. PubMed - Role of gallbladder mucin in pathophysiology of gallstones.[36] 37. PubMed - Differential effects of motilin on interdigestive motility.[37]

Intestines

Current simulation coverage

  • Maintains macronutrient absorption, electrolyte reclamation, water reuptake, bile acid recycling, microbiome balance, and inflammatory tone fields within the intestinal struct (src/organs/intestines.rs:15-113).
  • Internal feeding clock injects nutrient loads, updates motilin and GLP-1 proxies, and drives phase transitions among interdigestive, fed, MMC, ileal brake, and dysmotility states (src/organs/intestines.rs:111-173).
  • Motility updater blends peristaltic and segmentation indices, lumen volume, and enteric tone to set motility_index, segmentation_index, and mmc_activity scaling (src/organs/intestines.rs:174-197).
  • Absorption, microbiome, and mucosal routines convert nutrient energy into carbohydrate/fat/protein uptake, adjust electrolyte-water handling, SCFA production, pH, mucosal integrity, inflammation, and bile acid recirculation (src/organs/intestines.rs:198-287).

Physiology findings and observed gaps

  • Physiologically the small intestine absorbs ~95% of carbohydrates and proteins, 90% of water, and recovers bile salts in the ileum while the colon reclaims the last 1-2 L with electrolyte-coupled transport; the model uses fixed rates without segment-specific transporters or fluid budgets.[38][43]
  • MMC cycles repeat every ~90-120 minutes with distinct Phase I-IV patterns governed by motilin pulses that prevent bacterial overgrowth; simulation only tracks a scalar mmc_activity and phase enum without propagating cyclical motor waves or bacterial clearing.[39]
  • Ileal brake hormones GLP-1 and PYY respond to distal nutrient exposure to slow gastric emptying and upper gut motility, yet the model lacks nutrient-specific triggers or feedback to upstream organs despite tracking hormone_glp1.[40][41]
  • Terminal ileum bile-salt reabsorption and vitamin B12 uptake depend on mucosal transporters and flow, whereas the simulation clamps bile acid recirculation to a motility-dependent target without hepatic pool linkage or malabsorption states.[38]
  • Microbiota ferment 30 g/day of carbohydrates to produce ~300 mmol SCFAs that drive sodium/water absorption and fuel colonocytes; current logic approximates SCFA generation linearly from fiber load and does not expose ion transport coupling or microbial community shifts.[42][43]

Opportunities for improvement

  • Partition the intestine into duodenal, jejunal, ileal, and colonic segments with transporter-limited nutrient and water absorption, dynamic bile acid pools, and luminal fluid accounting to capture malabsorption and diarrhea phenotypes.[38][43]
  • Implement MMC phase cycling driven by motilin bursts with spatial propagation, allowing fasting length, vagal tone, or opioids to disrupt waves and precipitate SIBO scenarios.[39]
  • Couple nutrient sensing to GLP-1/PYY secretion, feeding-clock intervals, and feedback onto stomach, pancreas, and gallbladder controllers so fat vs carbohydrate loads elicit distinct ileal brake responses.[40][41]
  • Expand microbiome modeling to track fiber species, SCFA spectra, lumen pH, and epithelial fuel utilization, enabling dysbiosis, antibiotic, or prebiotic interventions to shift absorption and mucosal integrity.[42]

Sources 38. StatPearls - Physiology, Small Bowel.[38] 39. Gastroenterology & Hepatology Board Review - Small Intestinal Motility Disorders.[39] 40. PMC - Effects of GLP-1 and incretin-based therapies on gastrointestinal motor function.[40] 41. PubMed - PYY and GLP-1 contribute to feedback inhibition from the canine ileum and colon.[41] 42. PubMed - Colonic health: fermentation and short chain fatty acids.[42] 43. PubMed - Colonic absorption: the importance of short chain fatty acids in man.[43]

Kidneys

Current simulation coverage

  • Tracks glomerular filtration rate, renal plasma flow, filtration fraction, osmolality metrics, and endocrine proxies within the kidney struct (src/organs/kidneys.rs:14-94).
  • Autoregulation routine classifies perfusion into Autoregulated, Hypoperfused, Hyperperfused, or Obstructed states based on renal plasma flow and obstruction heuristics (src/organs/kidneys.rs:100-151).
  • Perfusion and hormonal controllers adjust sympathetic tone, renin release, aldosterone drive, and ADH sensitivity in response to plasma volume and osmolality (src/organs/kidneys.rs:115-151).
  • Tubular handling, acid-base, and erythropoietin updates set sodium reabsorption, potassium and urea excretion, urine flow/osmolality, serum osmolality, plasma volume, and EPO secretion each tick (src/organs/kidneys.rs:152-231).

Physiology findings and observed gaps

  • Healthy kidneys filter ~120 mL/min from ~600-720 mL/min renal plasma flow and hold GFR constant across 80-180 mmHg via coupled myogenic and macula densa feedback; the model uses fixed thresholds without afferent/efferent resistance dynamics or nephron flow sensing.[44][45]
  • Segmental transport normally reclaims ~65-70% of sodium and water in the proximal tubule, ~25% in Henle segments, and fine-tunes electrolytes distally; the simulation collapses everything into a single tubular reabsorption fraction, limiting malabsorption or diuretic scenarios.[46]
  • Urine concentration depends on the countercurrent multiplier, medullary gradient maintenance, and ADH-gated aquaporins to span ~50-1200 mOsm; current clamps ignore gradient washout and aquaporin trafficking.[47]
  • Renal acid-base balance requires bicarbonate reclamation plus ammonium and titratable acid excretion across segments, whereas the model condenses compensation into a single acid_base_balance scalar.[48]
  • Juxtaglomerular renin release integrates baroreceptor, macula densa, and sympathetic inputs, yet renin and aldosterone here follow simplified algebra that cannot capture RAAS pharmacology or dysregulation.[49]
  • Erythropoietin secretion arises from hypoxia-responsive peritubular interstitial cells and intercalated cells, but the simulation ties EPO to a coarse renal oxygenation clamp only.[50]

Opportunities for improvement

  • Add afferent/efferent arteriole resistance modeling with myogenic and tubuloglomerular feedback loops plus RAAS modulation to reproduce autoregulatory plateaus and pressure-natriuresis shifts.[44][45][49]
  • Break the nephron into proximal, loop, distal, and collecting segments with transporter-limited sodium/water reabsorption and endocrine regulation, enabling segment-specific injuries and diuretic effects.[46][47]
  • Implement countercurrent multiplier/ exchanger dynamics with medullary gradient washout, aquaporin trafficking, and osmolality feedback to simulate diabetes insipidus, SIADH, or osmotic diuresis.[47]
  • Expand acid-base handling to compute bicarbonate reclamation, titratable acid, and ammonium excretion, linking to respiratory compensation and chronic kidney disease buffering limits.[48]
  • Drive erythropoietin output from local oxygen tension, fibrosis, and inflammatory cues to support anemia-of-CKD progression and ESA therapy responses.[50]

Sources 44. StatPearls - Physiology, Glomerular Filtration Rate.[44] 45. PubMed - Renal autoregulation in health and disease.[45] 46. PMC - Mechanistic insights into renal ion and water transport in the distal nephron.[46] 47. Kidney: Physiology of the Tubular Reabsorption.[47] 48. PubMed - Acid-Base Homeostasis.[48] 49. StatPearls - Physiology, Renin Angiotensin System.[49] 50. PubMed - Renal epithelium regulates erythropoiesis via HIF-dependent suppression of erythropoietin.[50]

Liver

Current simulation coverage

  • Multi-state hepatic controller transitions between postabsorptive, fed, fasting, acute phase, and regenerating modes while updating glycogen, lipids, ammonia clearance, and hormone signals each tick (src/organs/liver.rs:1).
  • Meal-driven hormone routine modulates insulin, glucagon, and cortisol proxies alongside glycogenolysis, gluconeogenesis, and lipogenesis rates to shape fuel handling (src/organs/liver.rs:73).
  • Bile synthesis, secretion, detox capacity, Kupffer activation, and portal hemodynamics are adjusted through bile/enzymatic update loops (src/organs/liver.rs:176).
  • Protein synthesis block tracks albumin, clotting factor output, and hepatic fat fraction to summarize synthetic function (src/organs/liver.rs:214).

Physiology findings and observed gaps

  • The simulation uses static portal and arterial flow clamps, but healthy livers receive ~80% portal venous inflow with a hepatic arterial buffer response that compensates dynamically for portal changes.[51][52]
  • Hepatic lobules exhibit periportal-pericentral zonation governing carbohydrate, lipid, and ammonia metabolism, whereas the model treats hepatocytes as a single compartment.[55]
  • Enterohepatic bile acid cycling involves secretion, ileal reabsorption, and hepatic reconjugation; current logic generates bile locally without coupling to intestinal pools or transporter limits.[54]
  • Fasting gluconeogenesis in humans scales from ~1 to 2 mg·kg⁻¹·min⁻¹ with prolonged fasts driving Cori-cycle recycling; fixed-rate clamps in the model underrepresent these range shifts.[56]
  • Kupffer cell activation drives cytokine and acute phase cascades based on pattern-recognition signaling; present implementation raises a scalar without linking to inflammatory inputs or downstream APR protein switches.[53]

Opportunities for improvement

  • Implement dual-inflow hemodynamics with arterial buffer feedback and sinusoidal resistance modulation to recreate portal hypertension and ischemia scenarios.[51][52]
  • Add zonated hepatocyte segments with zone-specific enzyme sets (urea cycle periportal, glycolysis/pericentral lipogenesis) to capture differential injury and drug metabolism.[55]
  • Couple bile acid production to an enterohepatic pool shared with the intestines, including transporter saturation and fecal loss terms for cholestasis modeling.[54]
  • Replace fixed gluconeogenesis/glycogenolysis clamps with hormone- and substrate-responsive pathways calibrated to fasting studies, enabling hypoglycemia and stress testing.[56]
  • Expand Kupffer signaling to accept pathogen/toxin inputs and drive acute phase protein synthesis, oxidative stress, and stellate activation responses.[53]

Sources 51. World Journal of Gastroenterology - Liver hemodynamics reference values.[51] 52. American Society of Anesthesiologists - Hepatic arterial buffer response overview.[52] 53. StatPearls - Physiology, Liver.[53] 54. StatPearls - Physiology, Bile Secretion.[54] 55. Elsevier - Zonation of hepatic fatty acid metabolism review.[55] 56. American Journal of Physiology - Gluconeogenesis and the Cori cycle in prolonged fasting.[56]

Lungs

Current simulation coverage

  • Breathing phase loop advances inhalation, exhalation, and pause states while updating diaphragm kinematics, tidal volume, and respiratory rate targets (src/organs/lungs.rs:37).
  • Ventilatory state machine shifts between resting, hypercapnic, hypoxic, exercise, and distress modes with chemoreceptor and muscle drive scalars (src/organs/lungs.rs:108).
  • Gas exchange routine adjusts alveolar PO₂/PCO₂, shunt fraction, SpO₂, and CO₂ elimination based on ventilation and metabolic demand (src/organs/lungs.rs:246).
  • Pulmonary vascular block tunes pulmonary artery and wedge pressures along with V/Q ratio and dead space fractions (src/organs/lungs.rs:292).

Physiology findings and observed gaps

  • The model collapses regional ventilation/perfusion into single ratios even though human lungs show gravity-dependent gradients (low V/Q at bases, higher at apices) crucial for hypoxemia phenotyping.[57]
  • Lung compliance is treated as a scalar, yet in vivo compliance reflects surfactant dynamics, chest wall interaction, and disease-specific hysteresis that shift the pressurevolume curve.[58]
  • Diffusing capacity is estimated by linear clamps, whereas normal DL(O₂) ≈ 2025 ml·min⁻¹·mmHg⁻¹ and increases threefold with exercise due to capillary recruitment—effects absent in the current abstraction.[59][60]
  • Chemoreceptor control is condensed into a single drive, but central and peripheral chemoreceptors differ in latency and CO₂/O₂ sensitivity; blended logic masks disorders like carotid body failure.[61]
  • Distress flag drives shunt fraction heuristics without modeling airway resistance, surfactant loss, or V/Q scatter that define ARDS phenotypes.[57]

Opportunities for improvement

  • Introduce multi-compartment V/Q modeling (apex/mid/base) with gravity and posture modifiers to support shunt-vs-dead-space diagnostics.[57]
  • Track static and dynamic compliance separately with surfactant depletion, fibrosis, and chest wall modifiers to capture recruitment and hysteresis behavior.[58]
  • Add diffusing-capacity calculations tied to capillary blood volume and exercise state so DL and end-tidal gradients respond to flow changes.[59][60]
  • Split chemoreceptor control into central CO₂/pH and peripheral O₂/CO₂ pathways with time constants and hypoxic potentiation to emulate ventilatory drive disorders.[61]
  • Expand distress modeling to include airway resistance, alveolar flooding, and recruitable units rather than a single shunt scalar.[57]

Sources 57. StatPearls - Physiology, Pulmonary Ventilation and Perfusion.[57] 58. StatPearls - Physiology, Pulmonary Compliance.[58] 59. MedMuv - Diffusion capacity of the lungs for oxygen.[59] 60. European Respiratory Journal - Reference values for alveolar membrane diffusion capacity.[60] 61. NCBI Bookshelf - Chemical Regulation of Respiration.[61]

Pancreas

Current simulation coverage

  • State machine toggles basal, postprandial anabolic, hypoglycemic counterregulation, and beta-cell exhaustion modes while updating endocrine outputs (src/organs/pancreas.rs:15).
  • Meal simulator modulates glucose, incretin, and autonomic tone inputs to drive insulin, glucagon, somatostatin, and pancreatic polypeptide responses (src/organs/pancreas.rs:55).
  • Exocrine routines adjust enzyme secretion, bicarbonate output, acinar flow, and ductal pressure against incretin and autonomic cues (src/organs/pancreas.rs:146).
  • Chronic stress logic tracks beta-cell mass fraction and islet stress index to approximate long-term endocrine reserve (src/organs/pancreas.rs:119).

Physiology findings and observed gaps

  • Ductal secretion depends on CFTR-mediated chloride/bicarbonate exchange achieving ~140 mM bicarbonate, yet the model lacks CFTR or flow-dependent coupling to maintain alkaline secretion.[62][63]
  • Incretin physiology (GLP-1/GIP) enhances glucose-stimulated insulin secretion and suppresses glucagon in a glucose-dependent fashion; current logic uses fixed incretin boosts without receptor kinetics.[64]
  • Chronic ER stress triggers reversible beta-cell de-differentiation before apoptosis, implying nonlinear mass dynamics beyond the linear decay implemented here.[65]
  • Enzyme composition adapts to macronutrient content (e.g., fat increases lipase output), but the simulation scales enzymes uniformly with incretin tone.[66]
  • Autonomic tone integrates vagal and sympathetic signaling that co-modulate endocrine and exocrine release; the single autonomic scalar omits frequency-specific vagal bursts and adrenergic suppression.[62]

Opportunities for improvement

  • Add CFTR and SLC26 exchanger models with flow-dependent secretion and sensitivity to ductal pressure to emulate cystic fibrosis and pancreatitis.[62][63]
  • Implement incretin receptor kinetics with glucose thresholds and pharmacologic agonist profiles to study GLP-1 therapies.[64]
  • Model beta-cell stress with reversible identity states and thresholds for apoptosis, capturing adaptation vs. failure under chronic load.[65]
  • Differentiate enzyme synthesis pathways for amylase, proteases, and lipase responding to nutrient sensing and CCK feedback.[66]
  • Split autonomic inputs into vagal (bursting) and sympathetic (tonic) components to simulate stress-induced endocrine shifts.[62]

Sources 62. Cells - Bicarbonate Transport in the Exocrine Pancreas.[62] 63. NCBI Bookshelf - Water and Ion Secretion from the Pancreatic Ductal System.[63] 64. Diabetes - Multiple actions of GLP-1 on glucose-stimulated insulin secretion.[64] 65. Cell Reports - Adaptation to chronic ER stress enforces beta-cell plasticity.[65] 66. Pancreapedia - Secretion of the human exocrine pancreas in health and disease.[66]

Spleen

Current simulation coverage

  • Splenic controller tracks immune activity, red pulp volume, platelet reservoir, sympathetic tone, cytokine output, and contraction fraction states (src/organs/spleen.rs:13).
  • State machine transitions among homeostatic, sympathetic contraction, hyperimmune activation, sequestration, and hypofunction modes driving pulp volumes and cytokines (src/organs/spleen.rs:45).
  • Contraction and immune routines update platelet release, erythrocyte culling, IgM production, and cytokine signals each tick (src/organs/spleen.rs:72).

Physiology findings and observed gaps

  • Real spleens hold ~1/3 of circulating platelets and mobilize contracted red pulp during sympathetic surges; model contraction lacks integration with circulating platelet counts or venous return.[69][71]
  • White pulp architecture (periarteriolar lymphoid sheaths, marginal zone B cells) drives rapid responses to blood-borne antigens, whereas simulation aggregates immune activity into a single scalar.[67][70]
  • Splenic contraction alters hemoglobin and hematocrit during apnea/diving; current logic adjusts reservoir without systemic hematologic feedbacks.[69]
  • Marginal zone B cells and macrophages maintain humoral defense; absence of compartment-specific responses limits modeling of asplenia risks.[70]
  • Chronic splenomegaly and hypersplenism alter sequestration thresholds; static volume clamps miss disease-dependent compliance changes.[71]

Opportunities for improvement

  • Couple splenic reservoir to systemic platelet/erythrocyte pools and venous return to reflect contraction-induced hematologic shifts.[69][71]
  • Represent white pulp, marginal zone, and red pulp compartments with discrete immune cell populations and activation kinetics.[67][70]
  • Add sympathetic burst inputs tied to cardiovascular simulations to trigger dynamic spleen contraction during exercise or hemorrhage.[69]
  • Model splenic compliance changes in infiltrative disease to capture hypersplenism and cytopenia risks.[71]
  • Track antigen capture and antibody production timelines to assess vaccine efficacy in asplenic states.[67][70]

Sources 67. StatPearls - Physiology, Spleen.[67] 68. Kenhub - Microscopic anatomy of the spleen.[68] 69. Journal of Applied Physiology - Spleen as an erythrocyte reservoir during diving responses.[69] 70. Journal of Immunology - B cells are crucial for splenic marginal zone development.[70] 71. StatPearls - Splenomegaly.[71]

Spinal Cord

Current simulation coverage

  • Spinal cord organ tracks signal integrity, ascending/descending conduction velocities, reflex gain, autonomic outflows, locomotor CPG tone, nociceptive facilitation, and perfusion metrics (src/organs/spinal_cord.rs:14).
  • State machine differentiates intact, concussed, inflammatory, ischemic, and neurogenic shock presentations with corresponding autonomic targets (src/organs/spinal_cord.rs:48).
  • Integrity and perfusion routines update glial scar index, inflammation, sympathetic/parasympathetic outputs, and locomotor CPG tone over time (src/organs/spinal_cord.rs:71).

Physiology findings and observed gaps

  • Acute SCI guidelines recommend maintaining MAP 7595 mmHg for 37 days and targeting spinal cord perfusion pressure ≥6065 mmHg; model perfusion responds to heuristics without explicit SCPP control.[72][73]
  • Locomotor central pattern generators reside in segmental networks coordinating limb pairs; current CPG tone scalar lacks limb-specific oscillators and interlimb coordination.[74]
  • Human corticospinal conduction velocities average ~67 m/s with disease-dependent slowing; model uses unvalidated values without temperature or demyelination effects.[75]
  • Glial scar formation involves astrocyte proliferation over 12 weeks with STAT3 signaling, producing barriers and cytokine gradients; simulation increments a scar index without temporal staging or astrocyte roles.[76]
  • Neurogenic shock features sympathetic failure, hypotension, and bradycardia; present autonomic outputs shift but are not coupled to cardiovascular modules for systemic responses.[72][73]

Opportunities for improvement

  • Add SCPP calculations (MAP intrathecal pressure) with targets from acute SCI guidelines and allow vasopressor/CSF drainage interventions.[72][73]
  • Build bilateral limb CPG models with flexor/extensor half-centers and commissural coupling to study gait adaptations.[74]
  • Parameterize conduction velocities with temperature, demyelination, and injury length to match clinical evoked potential data.[75]
  • Stage glial scar development (hoursweeks) with astrocyte, fibroblast, and inflammatory cell modules influencing regeneration and cytokines.[76]
  • Link autonomic outputs to cardiovascular simulations to reproduce neurogenic shock hemodynamics and vasopressor responses.[72][73]

Sources 72. Neurology Practice Guideline - Hemodynamic management of acute spinal cord injury.[72] 73. Journal of Anesthesia, Analgesia and Critical Care - Hemodynamic management narrative review.[73] 74. Wikipedia - Central pattern generator physiology summary with vertebrate locomotion focus.[74] 75. Journal of Neurology, Neurosurgery & Psychiatry - Motor conduction velocity in the human spinal cord.[75] 76. Cells - Current advancements in spinal cord injury glial scar research.[76]

Stomach

Current simulation coverage

  • Gastric organ tracks phase (fasting, cephalic, gastric, intestinal, delayed emptying) with vagal tone, hormonal outputs, acid level, motility indices, and gastric volume (src/organs/stomach.rs:7).
  • Meal routine adjusts ghrelin, gastrin, vagal drive, and nutrient load timing to shift phases and target meal intervals (src/organs/stomach.rs:63).
  • Secretory update sets acid output, histamine, somatostatin, mucus, and intrinsic factor proxies while motility block governs antral pump strength and emptying rate (src/organs/stomach.rs:118).

Physiology findings and observed gaps

  • Gastrin stimulates ECL-cell histamine release while somatostatin provides paracrine inhibition; current model applies direct scalar adjustments without receptor-mediated feedback loops.[77][78]
  • Ghrelin rises pre-meal and is suppressed by nutrient load, integrating with hypothalamic circuits; simulation lowers ghrelin via simple volume clamps lacking macronutrient and circadian modulation.[79]
  • MMC phases originate in stomach/duodenum via motilin and 5-HT feedback; model phases do not enforce interdigestive MMC cycling or motilin triggers.[80]
  • Human gastric emptying delivers ~23 kcal·min⁻¹ to duodenum with slowing as energy density rises; the current emptying rate is set by motility index without energy-density feedback.[81]
  • Gastric emptying kinetics differ for liquids vs solids and respond to osmolarity; single clamp cannot represent nutrient-specific delays.[81]

Opportunities for improvement

  • Implement receptor-level gastrin→ECL histamine→parietal pathways with somatostatin inhibition and cholinergic disinhibition loops.[77][78]
  • Add ghrelin dynamics tied to macronutrient sensing, sleep state, and leptin/IL-1 signaling to integrate appetite control.[79]
  • Introduce interdigestive MMC oscillator driven by motilin and 5-HT with suppression during fed state to coordinate gastric clearing.[80]
  • Couple gastric emptying to meal energy density, volume, and macronutrient type to reproduce caloric delivery constraints.[81]
  • Differentiate liquid versus solid emptying curves with sieving function and osmolar feedback for hypertonic loads.[81]

Sources 77. Comprehensive Physiology - Gastric peptides gastrin and somatostatin.[77] 78. American Journal of Physiology - Role of histamine in control of gastric acid secretion.[78] 79. Physiological Reviews - Regulation of ghrelin secretion.[79] 80. Neurogastroenterology & Motility - Migrating motor complex control mechanisms.[80] 81. Gastroenterology - Effect of meal volume and energy density on gastric emptying of carbohydrates.[81]