AnaSim
AnaSim simulates adult anesthesia for education and research. It combines published pharmacology and cardiorespiratory models with a patient monitor and anesthesia machine interface.
Run AnaSim
Open robche.com/AnaSim in your browser.
For local use, install with Python 3.10 or later.
python3 -m venv .venv
source .venv/bin/activate
python -m pip install anasim-simulator
anasim
In Windows Command Prompt, use python in place of python3 and activate with
.venv\Scripts\activate.bat.
anasim opens the interface in your browser and works offline after installation.
Press Ctrl+C in the terminal to stop the server.
Choose a guided scenario or open simulation, then select Start simulation and Start. Use Apply to confirm setting changes.
Features
| Feature | Supported controls and measurements |
|---|---|
| Anesthesia | Propofol, remifentanil, fentanyl, midazolam, etomidate, ketamine, lidocaine, sevoflurane, nitrous oxide, rocuronium, and sugammadex |
| Cardiovascular drugs | Norepinephrine, epinephrine, phenylephrine, vasopressin, dobutamine, milrinone, esmolol, labetalol, and glycopyrrolate |
| Anesthesia machine | Facemask or tracheal tube, fresh gas flow, vaporizer, and bag-mask ventilation |
| Ventilation | Volume control (VCV), pressure control (PCV), pressure control with volume guarantee (PCV-VG), synchronized intermittent mandatory ventilation (SIMV), pressure support (PSV), and continuous positive airway pressure (CPAP) |
| Monitoring | ECG, pulse oximetry, arterial and noninvasive blood pressure, capnography, ventilation waveforms and loops, gas concentrations, bispectral index (BIS), train-of-four (TOF), temperature, fluid balance, trends, and alarms |
| Fluids and events | Fluids and blood, surgical stimulation, airway obstruction, bronchospasm, laryngospasm, hemorrhage, anaphylaxis, sepsis, and arrhythmias |
| Guided scenarios | Total intravenous anesthesia (TIVA) and balanced induction, TIVA and inhalational emergence, hemorrhage, anaphylaxis, septic shock, and oxygen supply failure |
Drug delivery supports boluses, manual infusions, and plasma or effect-site TCI, depending on the drug.
Limits
AnaSim supports adults aged 18 to 70 years within the input limits. The architecture guide describes source populations, simulator calibrations, and model limits. Acid-base balance, lactate, tissue oxygen debt, machine pneumatics, and cardiopulmonary resuscitation are not modeled.
Headless use
Run a 60-second simulation and save a CSV recording.
anasim --mode headless --duration 60 --record
Documentation
| Task | Guide |
|---|---|
| Configure patients, run scripts, or interpret CSV | CLI and Python usage |
| Understand model behavior and assumptions | Architecture |
| Find the source studies | Model references |
| Compare model outputs with clinical recordings | VitalDB validation |
| Change the code and choose checks | Contributing |
| Review release changes | Changelog |
Citation and license
Cite using CITATION.cff.
AnaSim 1.6 and later use the proprietary, source-available AnaSim noncommercial license.
| Use | Terms |
|---|---|
| Individual study, experimentation, and code changes | Free, including for students, residents, and clinicians |
| Noncommercial teaching, assessment, research, and internal deployment at nonprofit or government institutions | Free, including internal hosting for participants |
| Commercial use, other institutional use, or hosting outside that exemption | Paid license |
Contact Robert Chen for paid licenses or written fee waivers. Sharing copies is allowed under the license terms. Earlier releases retain their MIT terms.
Early AnaSim versions adapted code from Python Anesthesia Simulator, licensed under GPL-3.0. Those implementations have since been substantially rewritten. Third-party material retains its own terms.
Metadata
Release files for anasim-simulator 1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| anasim_simulator-1.6.tar.gz | 248.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| anasim_simulator-1.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 450.8 kB
Release files / anasim_simulator-1.6.tar.gz
| Download URL | anasim_simulator-1.6.tar.gz |
|---|---|
| Size | 248.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3b62c7eab0b251028c34f8284c93c6a9a29f768316c7f226f10d03b144da2944
|
|
BLAKE2b-256 checksum How to use checksums |
0c8925e9d71ae5a1d50fd152c2941d86854b4c215175b2ab99bba15f6bc544e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.
Transparency logRelease files / anasim_simulator-1.6-py3-none-any.whl
| Download URL | anasim_simulator-1.6-py3-none-any.whl |
|---|---|
| Size | 202.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
82f6c4b461ee51073754b05c333878d7cf0bc720b4ac02d4773c066258783b07
|
|
BLAKE2b-256 checksum How to use checksums |
192fe0213843270a3a5f94e4db2b016716733952da71dca1583e426b55ed1df9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.
Transparency log