AnaSim
AnaSim simulates adult anesthesia for education and research. It combines published pharmacology and cardiorespiratory models with an interface for the patient monitor and anesthesia machine.
Run AnaSim
Open robche.com/AnaSim in your browser.
To run it locally, install it 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 an open simulation or a case, then select Open session and Start. Use Apply to confirm changes to settings.
Features
| Feature | Supported controls and measurements |
|---|---|
| Patient variation | Age, body size, renal and hepatic function, coronary disease, heart failure, COPD, obesity, pregnancy with maternal positioning, and optional random variation in drug response |
| Anesthesia | Propofol, remifentanil, fentanyl, hydromorphone, morphine, midazolam, etomidate, ketamine, lidocaine, sevoflurane, nitrous oxide, rocuronium, succinylcholine, and sugammadex |
| Cardiovascular drugs | Norepinephrine, epinephrine, phenylephrine, ephedrine, vasopressin, dobutamine, milrinone, esmolol, labetalol, atropine, glycopyrrolate, and amiodarone |
| 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) and single-twitch monitoring, temperature, arterial blood gases, fluid balance, trends, and alarms |
| Circulation and events | Fluids and blood, chest compressions, defibrillation and synchronized cardioversion, surgical stimulation, airway obstruction, bronchospasm, laryngospasm, hemorrhage, anaphylaxis, sepsis, arrhythmias, and lidocaine toxicity with lipid emulsion |
| Cases | Total intravenous anesthesia (TIVA) and balanced induction, TIVA and inhalational emergence, hemorrhage, anaphylaxis, septic shock, oxygen supply failure, and cardiac arrest, each guided or independent with a debrief |
Depending on the drug, delivery options include boluses, manual infusions, and target-controlled infusion (TCI) to a plasma or effect-site target.
Limits
AnaSim supports adults aged 18 to 70 years within the input limits. The architecture guide describes how the models represent patient conditions.
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 files | 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 which checks to run | Contributing |
| Review release changes | Changelog |
Citation and license
To cite AnaSim, use CITATION.cff.
AnaSim 1.6 and later use the proprietary, source-available AnaSim noncommercial license.
| Use | Terms |
|---|---|
| Individual use | Free |
| Noncommercial use at nonprofit or government institutions | Free |
| Commercial or other institutional use | Paid license |
Contact Robert Chen for paid licenses or written fee waivers. The license terms allow you to share copies.
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.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| anasim_simulator-1.8.tar.gz | 384.2 kB | With provenance | Details for anasim_simulator-1.8.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| anasim_simulator-1.8-py3-none-any.whl | Python 3 | none | any | Details for anasim_simulator-1.8-py3-none-any.whl |
Total release size: 673.0 kB
Release files / anasim_simulator-1.8.tar.gz
| Download URL | anasim_simulator-1.8.tar.gz |
|---|---|
| Size | 384.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5f1098628da8a81660007d5d9f81dc6b61e5e9819eb3b263134f2f462689f099
|
|
BLAKE2b-256 checksum How to use checksums |
7b3e7459f7482e8066d63c073ef7dee056adfcc661bcf25988615319d38cf0b1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 7, 2026.
Transparency logRelease files / anasim_simulator-1.8-py3-none-any.whl
| Download URL | anasim_simulator-1.8-py3-none-any.whl |
|---|---|
| Size | 288.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b25f49ec484f5a000a02f7b7ed45dbc626eb007b3f07c51ca821811485479b11
|
|
BLAKE2b-256 checksum How to use checksums |
d22491c4e94cb10b1278997b71489537d4bb93673d21b11b1881e6307045b783
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 7, 2026.
Transparency logSecurity for anasim-simulator 1.8
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for anasim_simulator-1.8.tar.gz
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 Nov 7, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.