AnaSim
AnaSim is an interactive adult anesthesia and physiology simulator for teaching and model exploration.
[!WARNING] Education and research use
AnaSim is simulation software, not a medical device. Do not use its output to guide clinical care.
What AnaSim models
AnaSim simulates drug delivery, pharmacokinetics, pharmacodynamics, cardiorespiratory physiology, ventilation, fluids, temperature, and common perioperative events in real time. The desktop interface uses standard patient monitor and anesthesia machine conventions. Headless mode supports scripted runs and CSV recording.
AnaSim includes propofol, remifentanil, sevoflurane, rocuronium, sugammadex, norepinephrine, epinephrine, phenylephrine, vasopressin, dobutamine, and milrinone. Ventilation modes include VCV, PCV, PSV, CPAP, and bag-mask ventilation.
Install and start
AnaSim requires Python 3.10 or later. Install it in a virtual environment:
python3 -m venv .venv
source .venv/bin/activate
python -m pip install anasim-simulator
anasim
On Windows, activate the environment with .venv\Scripts\activate.
The package name is anasim-simulator. The command and Python module are both
named anasim.
First session
Run the guided TIVA induction to become familiar with the interface:
- Launch
anasim. - Select Guided scenario and Induction (TIVA).
- Confirm the default patient and select Start simulation.
- Use Open machine, Open medications, and Open events in the objective panel to open each control area.
- Start the clock when you are ready to observe the physiologic response.
Interface
| Area | Purpose |
|---|---|
| Monitor | Waveforms, displayed vital signs, anesthetic gas, temperature, neuromuscular function, and fluid balance |
| Machine | Airway connection, fresh gas flow, vaporizer, manual ventilation, and mechanical ventilation |
| Medications | Manual infusions, effect-site TCI, boluses, vasoactive agents, and reversal |
| Events and fluids | Fluids, blood products, surgical stimulation, airway events, hemorrhage, anaphylaxis, and sepsis |
Guided scenarios cover TIVA and inhalational induction, emergence, hemorrhage, anaphylaxis, septic shock, and oxygen supply failure. Open simulation mode provides direct control of the same environment.
Model scope and limits
AnaSim accepts these patient inputs:
| Input | Supported range |
|---|---|
| Age | 18 to 70 years |
| Weight | 50 to 100 kg |
| Height | 150 to 200 cm |
| BMI derived from weight and height | 18 to 32 kg/m² |
| Hemoglobin | 6 to 20 g/dL |
| Hematocrit | 0.18 to 0.60 |
| Renal function factor | 0.4 to 1.0 |
| Hepatic function factor | 0.5 to 1.0 |
The body-size limits enclose the observed ranges in the healthy-adult cohort used by the Su hemodynamic and Li norepinephrine models. Weight and height must also produce a BMI within the supported range. Renal and hepatic factors are dimensionless model inputs.
AnaSim combines published component models with simulator-specific models for respiratory drug interaction, neuromuscular block and reversal, vasoactive drug response, and arterial pressure display. See model references for sources and implementation details.
Display values include simulated monitor response and may differ from the underlying physiologic state. Acid-base balance, lactate, tissue oxygen debt, and complete anesthesia machine pneumatics are outside the current model scope.
Headless use
Run a reproducible ten-second simulation:
anasim --mode headless --duration 10 --config patient.json --record
Configuration files set patient characteristics, model choices, initial state, random seed, and runtime options. See the CLI guide for the available fields.
Documentation
Development
git clone https://github.com/robchiral/AnaSim.git
cd AnaSim
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -e ".[dev]"
ruff check .
QT_QPA_PLATFORM=offscreen python -m pytest -q
Regenerate the animated demo with python scripts/capture_demo.py.
Initial TIVA implementations were derived from Python Anesthesia Simulator.
Citation and license
For teaching or research use, cite the software and release described in
CITATION.cff.
AnaSim is available under the
MIT License.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file anasim_simulator-1.1.tar.gz.
File metadata
- Download URL: anasim_simulator-1.1.tar.gz
- Upload date:
- Size: 191.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2f8228a25383dd5cf4356c12c590be3e825308ea7473bf228966a4f95d2241be
|
|
| MD5 |
5c7bd14c48fb392fd2365ae991f02468
|
|
| BLAKE2b-256 |
21f5eb70bae92f65a05d6a1afa9825127615b8f8724f13445e5d328e646fc1c1
|
Provenance
The following attestation bundles were made for anasim_simulator-1.1.tar.gz:
Publisher:
publish.yml on robchiral/AnaSim
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
anasim_simulator-1.1.tar.gz -
Subject digest:
2f8228a25383dd5cf4356c12c590be3e825308ea7473bf228966a4f95d2241be - Sigstore transparency entry: 2655199600
- Sigstore integration time:
-
Permalink:
robchiral/AnaSim@7ad83793e228a72fc756345249d0eb0ab5657ae7 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/robchiral
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7ad83793e228a72fc756345249d0eb0ab5657ae7 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file anasim_simulator-1.1-py3-none-any.whl.
File metadata
- Download URL: anasim_simulator-1.1-py3-none-any.whl
- Upload date:
- Size: 163.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
84beef8fe31701a683a3c4501d137834ff9bc8b1ec60a6c7fa07a247a7d745c9
|
|
| MD5 |
55c8ef5fe37bce558df3bf349db5515c
|
|
| BLAKE2b-256 |
1e2ebb1aad28be73b2636e5289b1bfee0b1ea171df98bf39391ff709f0bf07e8
|
Provenance
The following attestation bundles were made for anasim_simulator-1.1-py3-none-any.whl:
Publisher:
publish.yml on robchiral/AnaSim
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
anasim_simulator-1.1-py3-none-any.whl -
Subject digest:
84beef8fe31701a683a3c4501d137834ff9bc8b1ec60a6c7fa07a247a7d745c9 - Sigstore transparency entry: 2655199609
- Sigstore integration time:
-
Permalink:
robchiral/AnaSim@7ad83793e228a72fc756345249d0eb0ab5657ae7 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/robchiral
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7ad83793e228a72fc756345249d0eb0ab5657ae7 -
Trigger Event:
workflow_dispatch
-
Statement type: