BioGears: A C++ library for whole body physiology simulations

BioGears is an open source, extensible human physiology computational engine that is designed to enhance medical education, research, and training technologies. BioGears is primarily written in C++ and uses an electric circuit analog to characterize the fluid dynamics of the cardiopulmonary system. As medical training requirements become more complex, there is a need to supplement traditional simulators with physiology simulations. To this end, BioGears provides an extensive number of validated injury models and related interventions that may be applied to the simulated patient. In addition, BioGears compiled libraries may be used for computational medical research to construct in-silico clinical trials related to patient treatment and outcomes. Variable patient inputs support diversity and specification in a given application. The engine can be used standalone or integrated with simulators, sensor interfaces, and models of all fidelities. The Library, and all associated projects, are published under the Apache 2.0 license and are made available through the public GitHub repository. BioGears aims to lower the barrier to create complex physiological simulations for a variety of uses and requirements.


Summary
BioGears is an open source, extensible human physiology computational engine that is designed to enhance medical education, research, and training technologies. BioGears is primarily written in C++ and uses an electric circuit analog to characterize the fluid dynamics of the cardiopulmonary system. As medical training requirements become more complex, there is a need to supplement traditional simulators with physiology simulations. To this end, BioGears provides an extensive number of validated injury models and related interventions that may be applied to the simulated patient. In addition, BioGears compiled libraries may be used for computational medical research to construct in-silico clinical trials related to patient treatment and outcomes. Variable patient inputs support diversity and specification in a given application. The engine can be used standalone or integrated with simulators, sensor interfaces, and models of all fidelities. The Library, and all associated projects, are published under the Apache 2.0 license and are made available through the public GitHub repository. BioGears aims to lower the barrier to create complex physiological simulations for a variety of uses and requirements.
Physiological models have been used for healthcare simulation for many years but generally, complex models of the human physiology are not implemented and the patient state is preprogrammed by the instructor. The most prominent commercial implementation of similar software is Maestro, developed by Canadian Aviation Electronics, Inc. This product is proprietary and it is not clear to the authors how models are developed, implemented, and validated. Other similar open source projects include: pk-sim the pharmacological modeling framework (Willmann et al., 2003), CellML a generic biological modeling markup language with applications spanning biological applications (Lloyd et al., 2004), and Pulse a maintained BioGears fork lacking some of the recent models but instead focusing on Unity VR integration. Each of these either has submodels that are integrated into BioGears (like a pkpd pharmacological model), or is a more generic implementation of biological modeling, like CellML. BioGears is unique in the depth of integrated models, while being free and open-source for the research community.

Statement of need
The fields of Medical simulation and computational medicine are growing in application diversity and complexity (Sweet, 2017). Simple CPR manikins are now being replaced with complex robotic systems that can simulate breathing and react to the performance of the trainee. As these systems use cases grow, there is a requirement that they be supplemented with physiology modeling. BioGears fills this need by providing a free computational framework to use as a backbone to many of these robotic training manikins and may support other computational medicine research applications. The BioGears project aims to better democratize the construction of high-fidelity medical training by providing a sophisticated, complex physiology engine to developers that is easy to integrate and free to use.
BioGears uses a lumped circuit model to describe the circulatory and respiratory systems. This approximation of the simulated cardiopulmonary system has been studied in the past and shown to accurately represent the hemodynamics of the arterial system by using resistance and compliance elements (Otto, 1899;Westerhof et al., 2009). This approximation creates a system that can be solved for rapidly, decreasing the simulation run-time and computational requirements. In addition, BioGears implements models of diffusion and substance transport to properly simulate the gas/blood interface in the lungs. To handle more complex models of physiology, such as pharmacological models, BioGears constructs a set of hierarchal compartments built on top of the circuit analogs. Top-most compartments represents the system level data, such as the liver, with sub-compartments representing more granular biology of the patient such as the nephron, extravascular tissue, and even intracellular spaces. A generic data request framework, leveraging XML, is used to access various substance, fluid, thermal, and gas information for a specific compartment of the body.

Features
The BioGears engine, once compiled, provides a set of libraries that may be included in any application that wishes to leverage a physiological simulation of a patient. In addition, BioGears provides build support and testing for all major user platforms (MacOS, Windows, Linux, and ARM). An instance of a BioGears engine models a single patient's physiology and can be edited at the start of runtime or during the simulation, in the following ways: • The patient is defined by parameters, such as height, weight, systolic and diastolic pressure. • Initialize the patient with specific chronic and/or disease states via conditions. • Modify the patients external environmental conditions (weather, submerge in water, etc.) • Apply various actions: acute insults/injuries, interventions, conscious breathing, exercise, etc. • Interact with equipment models, such as an Anesthesia and/or an ECG Machine as well as an Inhaler via the action framework.