The simulation source
The physics is published in full. Read it, run it, and check the numbers on this site against your own run.
Nothing here is a description of the model — it is the model. Every constant, every flux law and every citation is in these files, and the tests below are the ones that hold them to account.
What is not here. Two modules are withheld: they carry the
control algorithm's gains and set-points, which are a pending patent matter. Everything the physics
needs in order to be reproduced is published; what is withheld is how the device decides,
not how the body and membrane behave. The published control interface is described on the
main page.
Physics
| File | Lines | What it is |
|---|---|---|
physics_core.py | 813 | Conservation substrate and the constitutive laws — every flux the model can perform, and the two primitives that make mass conservation structural. |
physics_sim.py | 2284 | The integrator: peritoneal cavity geometry, membrane transport, whole-body physiology, the regeneration circuit, and the per-minute step. |
physics_patient.py (source withheld) | 541 | The patient outside the device: diet, thirst, residual renal function, stool and insensible losses, endogenous acid production, and the fatal-condition checks. Runs against the withheld control module, so its source is not published. |
physics_geometry.py | 249 | Ovoid cavity geometry — slab volumes, wall areas, fluid height and the hydrostatic column. |
Tests
| File | Lines | What it is |
|---|---|---|
test_oncotic_landis.py | 218 | Colloid osmotic pressure by Landis-Pappenheimer, and the transperitoneal gradient against the measured 22 mmHg. |
test_conservation_guard.py (source withheld) | 41 | Water and every solute conserve to floating-point precision. Runs against the withheld control module, so its source is not published. |
test_constants_literature.py | 238 | Every constant against its published range. |
test_engine_equivalence.py | 62 | The integrator computes the same physics as the reference laws. |
test_published_regression.py (source withheld) | 342 | The ten published patient outcomes still reproduce. Runs against the withheld control module, so its source is not published. |
test_blindness_structural.py (source withheld) | 251 | No serum concentration reaches the control decision path. Runs against the withheld control module, so its source is not published. |
3864 lines of published source in total. The withheld modules are physics_controller.py, physics_nn_controller.py.