Skip to main content

AnaSim

AnaSim is a real-time adult anesthesia simulator for teaching and model exploration. It combines published pharmacokinetic, pharmacodynamic, and cardiorespiratory models with a patient monitor and anesthesia machine.

CI PyPI Python 3.10+ License: MIT

AnaSim running the guided TIVA induction

Run AnaSim

In the browser: open robche.com/AnaSim. It runs on your device through Pyodide. The first visit downloads about 23 MB.

Locally (Python 3.10 or later):

python3 -m venv .venv
source .venv/bin/activate      # Windows: .venv\Scripts\activate
python -m pip install anasim-simulator
anasim

anasim opens the simulator in your browser and runs it in Python on your computer. It works offline. Stop it with Ctrl+C.

To begin, choose Guided scenario and TIVA induction, then Start simulation. The clock runs once you press Start simulation again below the monitor. Each objective has a button that opens the controls it needs.

What's included

  • Drugs: propofol, remifentanil, sevoflurane, rocuronium, sugammadex, norepinephrine, epinephrine, phenylephrine, vasopressin, dobutamine, and milrinone, given by infusion, bolus, or effect-site TCI.
  • Machine: facemask or tracheal tube, fresh gas flow, vaporizer, bag-mask ventilation, and VCV, PCV, PSV, or CPAP.
  • Monitor: ECG, SpO₂, arterial line, NIBP, capnography, BIS, TOF, temperature, fluid balance, and alarms.
  • Events: fluids and blood, surgical stimulation, airway obstruction, bronchospasm, laryngospasm, hemorrhage, anaphylaxis, sepsis, and arrhythmias.
  • Guided scenarios: TIVA and inhalational induction and emergence, hemorrhage, anaphylaxis, septic shock, and oxygen supply failure.

Record CSV saves the simulation as a time series. The local version writes it to recordings/ in the directory where you ran anasim; the browser version downloads it.

Limits

Patients must be adults aged 18 to 70 years, weighing 50 to 100 kg, 150 to 200 cm tall, with a BMI of 18 to 32 kg/m². These are the ranges of the volunteer studies used to build the hemodynamic and norepinephrine models.

Respiratory drug effects, neuromuscular block, the baroreflex, and vasoactive responses use AnaSim calibrations fitted to published data. The model references list the sources.

Displayed values include monitor lag and artifact. Acid-base balance, lactate, tissue oxygen debt, machine pneumatics, and resuscitation are not modeled.

Headless use

anasim --mode headless --duration 60 --record

This runs 60 simulated seconds without the interface and writes a CSV to recordings/. Use --config to set the patient, models, and starting state from a JSON file; the CLI guide lists the fields.

Documentation

Citation and license

Cite AnaSim using CITATION.cff. AnaSim is released under the MIT License. The first TIVA implementation was derived from Python Anesthesia Simulator.

Metadata

Release files for anasim-simulator 1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for anasim-simulator 1.3
File Size Uploaded
anasim_simulator-1.3.tar.gz 155.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for anasim-simulator 1.3
File Interpreter ABI Platform
anasim_simulator-1.3-py3-none-any.whl Python 3 none any Details

Total release size: 298.7 kB

Release files / anasim_simulator-1.3.tar.gz

Download URL anasim_simulator-1.3.tar.gz
Size 155.8 kB
Tags Source
SHA-256 checksum
How to use checksums
f7e790703d1798f3faa48b9f1b80f454d33450b7ad72ac1755e0425007445fe9
BLAKE2b-256 checksum
How to use checksums
91951b537a516b5afdf8ad1a5dda82dab24ca77210447370de97e12498cb21c9
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 Sep 30, 2026.

Transparency log

Release files / anasim_simulator-1.3-py3-none-any.whl

Download URL anasim_simulator-1.3-py3-none-any.whl
Size 142.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aca56b82d70b3d9279f3e12a898063b9debe6bdfaafb048c7ed1f90926a55168
BLAKE2b-256 checksum
How to use checksums
b6c5a25afc37580479569d2467e3061128fa000465fa0d72b5ec290a07393a0d
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 Sep 30, 2026.

Transparency log

Release history Release notifications | RSS feed

1.6

2 release files

1.5

2 release files

1.4

2 release files

This release

1.3 This release

2 release files

1.2

2 release files

1.1

2 release files

1.0

2 release 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