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.
Start a session
Choose Guided scenario for a structured case or Open simulation for independent practice. Sessions start with an awake patient or an anesthetized patient under maintenance. Select Start simulation, then Start below the monitor.
Manual infusion rates are the default. To use target-controlled infusion (TCI), select Allow TCI during setup. This enables concentration targets and TCI dosing instructions, including maintenance infusions. Propofol and remifentanil infusion rates use mcg/kg/min.
Use Apply or Enter to apply settings and Escape to cancel edits. For mechanical ventilation, select a facemask or tracheal tube, apply a mode, and choose Start ventilator.
Choose Record CSV to record a session. Local recordings go to recordings/ in
the directory where you launched anasim. In the hosted app, choose Stop
recording to download the file.
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, and alarms |
| 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 |
| Change the code and choose checks | Contributing |
| Review release changes | Changelog |
Citation and license
Cite using CITATION.cff.
Licensed under MIT.
AnaSim includes code adapted from
Python Anesthesia Simulator.
Metadata
Release files for anasim-simulator 1.5
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.5.tar.gz | 222.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| anasim_simulator-1.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 409.0 kB
Release files / anasim_simulator-1.5.tar.gz
| Download URL | anasim_simulator-1.5.tar.gz |
|---|---|
| Size | 222.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0c31cd0ffa24280459d8e5e65da43a11d97ee7aa4c2fd1942d77eb9953ef34e5
|
|
BLAKE2b-256 checksum How to use checksums |
d833b9ab6a1b342f6916cf19f801305fc0dba4f6ba00dc39d39b705a7f7b5e37
|
| 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 10, 2026.
Transparency logRelease files / anasim_simulator-1.5-py3-none-any.whl
| Download URL | anasim_simulator-1.5-py3-none-any.whl |
|---|---|
| Size | 186.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f00abee6f1f417f9d0f2e4de5c4bd1d96e76655daee2dafe493bd47ae534236e
|
|
BLAKE2b-256 checksum How to use checksums |
2ccbd66dce98163c635027441c96a38717c738e1b8efb7b0187c5c997039eb02
|
| 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 10, 2026.
Transparency log