Skip to main content

AnaSim

AnaSim is an interactive adult anesthesia and physiology simulator for teaching and model exploration.

CI PyPI Python 3.10+ License: MIT

AnaSim guided induction demo

[!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:

  1. Launch anasim.
  2. Select Guided scenario and Induction (TIVA).
  3. Confirm the default patient and select Start simulation.
  4. Use Open machine, Open medications, and Open events in the objective panel to open each control area.
  5. 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

anasim_simulator-1.1.tar.gz (191.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

anasim_simulator-1.1-py3-none-any.whl (163.9 kB view details)

Uploaded Python 3

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

Hashes for anasim_simulator-1.1.tar.gz
Algorithm Hash digest
SHA256 2f8228a25383dd5cf4356c12c590be3e825308ea7473bf228966a4f95d2241be
MD5 5c7bd14c48fb392fd2365ae991f02468
BLAKE2b-256 21f5eb70bae92f65a05d6a1afa9825127615b8f8724f13445e5d328e646fc1c1

See more details on using hashes here.

Provenance

The following attestation bundles were made for anasim_simulator-1.1.tar.gz:

Publisher: publish.yml on robchiral/AnaSim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for anasim_simulator-1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 84beef8fe31701a683a3c4501d137834ff9bc8b1ec60a6c7fa07a247a7d745c9
MD5 55c8ef5fe37bce558df3bf349db5515c
BLAKE2b-256 1e2ebb1aad28be73b2636e5289b1bfee0b1ea171df98bf39391ff709f0bf07e8

See more details on using hashes here.

Provenance

The following attestation bundles were made for anasim_simulator-1.1-py3-none-any.whl:

Publisher: publish.yml on robchiral/AnaSim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

1.1 This release

2 files

1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page