Overview & Learning Objectives:
The BioGears engine models human physiology using mathematical models that represent the different organ systems in the body and their feedback mechanisms. The fluid dynamics (pressure, flow, and volumes) and thermal properties (temperature and heat transfer) are calculated using lumped-parameter models (electric circuit analog). A variety of feedback mechanisms then affect the circuits in a single system or multiple systems via system interactions.
This presentation was given at MMVR 2016, audience members learned how to use the capabilities of BioGears to understand how it could influence undergraduate, graduate, and professional education, power training simulations, and interface with hardware (sensors).
Unlocking the Potential: Deep dive into ocean of Ceramic Magnets.pptx
MMVR BioGears Overview
1. 1
Agenda (1:30pm – 5:00 pm)
1. Engine Overview [~50min]
• Bio Break [10min]
2. Using the Graphical User Interface (GUI) [~50min]
• Bio Break [10min]
3. Interacting with the Application Program Interface (API)
[~50min]
4. Questions and Help [until 5pm]
Recommended Preparation
• If you would like to follow along using the GUI (item 2), please
download and unzip the Toolkit from:
https://biogearsengine.com/download
BioGears: An OpenSource Human Physiology Engine
2. 2
Presentation for MMVR
Presenters: Jeff Webb, Rachel Clipp, PhD, Aaron Bray
Applied Research Associates, Inc. (ARA)
7 April 2016
BioGears Overview
3. 3
• Program Overview
• Modeling Approach
• Verification and Validation
• Systems Review
• Architecture and Tools
• Coming Soon
BioGears Overview Agenda
5. 5
• Organization: Applied Research Associates, Inc. (ARA)
• Telemedicine & Advanced Technology Research Center (TATRC)
Award #: W81XWH-13-2-0068
• Principal Investigator: Mr. Jeff Webb
• Amount: $6,959,593
• Period of Performance: Sept 2013 – Sept 2018
• License: Apache 2.0 permissive free software
• Disclaimer: This work is supported by the US Army Medical Research and
Materiel Command. The views, opinions and/or findings contained in this report are
those of the author(s) and should not be construed as an official Department of the
Army position, policy, or decision unless so designated by other documentation.
Project Information
6. 6
High Level Objectives
• Create a publicly available physiology
research platform that enables accurate and
consistent simulated physiology across
training applications
• Lower the barrier to create medical training
content
• Engage the community to develop and
extend physiology models
• Meet the training needs of the military
• Expand the body of knowledge regarding
the use of simulated physiology for medical
education
8. 8
Milestones
2015
Link to Version History
FY13 September: project kick-off
FY14
FY15
October: Alpha Build 1.0.0 release and website launch
March: 2.0.0 release
July: 3.0.0 release
FY16
October: Beta Build 4.0.0 release and users conference
December: 5.0.0 release
March: 5.1.0 release
Summer: planned Release Candidate 6.0.0
• System updates
• Serialization, modularity, and optimization
FY17
Several releases throughout
• New systems/features
FY18
October: Final Contractual release
Maintenance only
We are here
9. 9
Current Collaborators and Integrators
• 2,700+ downloads of the engine and related files since the Alpha Build Release
(October 2014)
• 1,400+ pages of physiology modeling methodology and software documentation, and
validation data available to our user community
• Used by the government/military, academic institutions, and commercial businesses
• Let us know if/when you use BioGears and we can add you to the home page of our
website!
11. 11
Engine Overview
Computation Approach:
• Time-stepping transient analysis for linearization of differential equations
• Currently 90Hz for 2x real-time simulation on standard laptops
• Dynamically change/add/remove elements to represent physiological mechanisms
• Stabilization analysis for initialization and implementation of conditions
• Designed with low computational overhead
• Faster than real-time on typical PC, multiple instances on single or multicore processors
• Build Targets include Windows, Mac, Linux, and Raspberry Pi
Modeling Approach:
• Top-down approach to model development with bottom-up hooks for engine expansion
• Multi-scale for varying fidelity, allowing integration of models from any level
12. 12
• Discrete entities that
approximate the behavior
of a distributed system
• Electronic-
Hydraulic/Thermal
Analogy: body system fluid
dynamics and
thermodynamics modeled
using electrical circuit
math
• Generalized definitions of
Nodes, Paths, and
Elements for simple
understanding,
implementation, and
modification
Background: Lumped Parameter Modeling
Lumped Parameter Modeling of Fluids
P=Pressure, F=Flow, R=Resistance, C=Compliance, I=Inertance
13. 13
• Data model
• Generic and reusable node and path definitions
• Uses the same equations/code with native units
• Other element types not in table:
• Switch
• Valve/diode
• Polarized elements
Lumped Parameter Approach
Circuit Types and Elements
Definitions
14. 14
Connection types:
• Direct circuit connection – e.g. Anesthesia Machine and
Respiratory
• Feedback – e.g. Nervous and Endocrine
• Substance exchange – e.g. Respiratory and Cardiovascular gas
exchange
Physiology System Interaction
Environment
PK/PD
Cardiovascular
Blood
Tissue
Extravascular
Respiratory
Anesthesia Machine
Renal
Gastrointestinal
Energy
Nervous
Endocrine
Inhaler
15. 15
System Data Flow and Modeling
Approach Advantages
• Modular and extensible
• Model fidelity easily modified by adding/removing nodes and
elements to circuit
• Fully dynamic physics based mechanistic models (rather than
state based) – cascading effects
• Unlimited stacking/combining of conditions, insults,
interventions, interfaces, etc.
• Homeostasis based modeling with pathophysiology actions
• Able to integrate existing/new models
• Not necessarily lumped parameter
• Mixed fidelity
• Able to simultaneously run any number of instances/patients
Preprocess
Uses feedback mechanisms to
modify elements for the next time
step.
Process
Calculates the entire state of the
system for the next time step
Assessments
Called on demand to calculate and
set assessment specific data
Reset
Initializes the system
Initialization
Resting: Functionality specific to
resting patient stabilization
Conditions: Functionality specific
to applying conditions
PostProcess
Advances time by moving the next
time step to current
16. 16
Engine Initialization
Resting Conditions Running
Stabilization Simulation
Time = 0
• Dynamic stabilization drives towards patient homeostasis
• Each step the engine executes until all specified stabilization criteria are
satisfied
Step 1: Patient
initialization
• Systems feedback
modifies values to
achieve specified
patient parameters
(e.g. baseline mean
arterial pressure)
• Standard
environment used
Step 2: Condition
initialization
• Conditions applied
to represent new
patient homeostatic
state
• Environment
changes applied to
simulate long term
acclimation
Simulation begins
• Acute insults,
interventions, and
parameter
modification
applied
instantaneously
through actions
Step 3: Feedback
Mechanisms
• Feedback
mechanisms that
would interfere
with chronic
conditions (e.g.
baroreceptors) are
activated
Feedback
17. 17
Engine Data Library
Tidal Volume varies with
weight
Circuit is modified to
vary arterial pressure
Driver is modified to vary
heart rate
1
2 3
Patient File Parameters
Gender FunctionalResidualCapacity
Age 2: HeartRateBasline
1: Weight 3: MeanArterialPressureBaseline
Height RespirationRateBaseline
BodyFatFraction RightLungRatio
CarinaToTeethDistance TotalBloodVolumeBaseline
Contractility
Patient Modification Example
Patients
• Properties modify
system setup, circuit
values, and feedback
parameters
Substances
• Physical and transport
related properties
• E.g. MolarMass,
IonicState, Sedation
Compounds
• Concentrations of
multiple substances
• E.g. Saline, Blood
Environments
• Surrounding properties
• E.g.
AmbientTemperature,
ClothingResistance
Nutrition
• Meal composition
(masses)
• E.g. Protein, Calcium
Stabilization
• Percent difference
criteria for stabilization
– resting and
conditions
18. 18
• Anatomical Compartments defined by sub-
circuits and allow access via an anatomy tree
• Several overlapping compartment types
• Fluid
• Liquid
• Vascular
• Urine
• Chyme
• Gas
• Pulmonary
• Tissue
• Thermal
• Electrical
• Compartment properties are combined from
children (liquid example)
• Volume is a sum
• InFlow is a sum
• OutFlow is a sum
• Pressure comes from an assigned child node
(sum does not make sense)
• Substance quantities (mass, concentration,
etc.) are calculated on demand for any level in
hierarchy
• There are thousands of compartment data
values that are updated each time-step
Left Kidney
Left Renal Artery
Left Renal Vein
Left Nephron
Left Afferent Arteriole
Left Glomerular Capillaries
Left Efferent Arteriole
Left Peritubular Capillaries
Left Bowmans Capsules
Left Tubules
Left Ureter
Compartment Example: Kidney Definition
Key:
Vascular
Urine
20. 20
1. Full Scenario Suite: BioGears test suite includes scenarios to test all patient files, patient actions, substance effects, and equipment
performance. Completed for 3 circuit unit tests and 80+ scenarios.
2. Circuit Verification: Verify that the BioGears circuit solver is producing comparable results to established circuit solvers. Completed for
100+ circuit elements/combinations.
3. Timing: Suite is executed by team members throughout development. It is also automatically executed when the code base is altered in
the repository.
4. Output: Each scenario indicates the physiologic outputs for validation. Each output is tested to ensure it is within 2% of the results in the
code repository. Comparison and error plots (shown) are generated.
5. Full Results: An email is sent to all team members when verification is complete. Each scenario either Passes (green) or Fails (red).
Failures must be addressed by the team.
Verification
Source of Failure
VentilatorPressureLossScenarioResultsReport 1 1 21.258999824523926
YpieceDisconnectScenarioResultsReport 1 1 23.98900008201599
AirwayInsultObstructionResultsReport 0 1 14.930999994277954
AtropineScenarioResultsReport 0 1 13.121000051498413
BasicScenario1ResultsReport 0 1 18.195000171661377
Scenario Verification
Circuit Verification
21. 21
1. Verification: Unit tests ensure correct implementation and sound physics principles
for all tools
2. System Level Validation: All major systems (cardiovascular, respiratory, blood
chemistry, etc.) are validated for clinical output level data
3. Compartment Level Calibration: Individual organs (kidney, liver, etc.) or functional
units (trachea, alveoli, etc.) are validated wherever possible
4. Scenario Calibration & Validation: Every insult, intervention, and assessment
includes a matrix with validation data for whole body combined effects from multiple
systems
5. Combined Scenario Validation: All four showcases and several other scenarios
validated for combined effects – heavily leveraged SME consultants Bryan Bergeron
MD and Nicholas Moss PhD
Showcase Scenario Combined Effects Validation
Calibration and Validation
Scenario
Number (%) of Validation Measures in Deviation Category
Total
< 10% 10 – 30% > 30%
Combat Multitrauma 59 (64.8%) 10 (11.0%) 22 (24.2%) 91
Asthma Attack 26 (65.0%) 7 (17.5%) 7 (17.5%) 40
Heat Stroke 52 (76.5%) 10 (14.7%) 6 (8.8%) 68
Exposure 26 (86.7%) 2 (6.7%) 2 (6.7%) 30
33. 33
• Common Data Model (CDM):
Well-defined, intuitive,
interchangeable format to
standardize interfaces
• Standardized inputs, outputs,
units, and naming conventions
to aid model additions and
external model integrators
• Application Programming
Interface (API): Easy
integration and interaction in
any programming language
• Data organized logically by
Anatomy so that users are able
to easily find and pull relevant
data
• Software Development Kit
(SDK): Application examples
and stand-alone execution
• Tutorials, How-to’s, scenario
examples
Software Architecture
34. 34
• Common data structures for modeling and simulation of the human body
• Not specific to any methodology, including BioGears
• Separates the physiological data from the physiological modeling methodology
• Object Oriented Design of class structures providing a unified set of tools that
promotes fast development, compatible data sets, and well-defined interfaces
• Provides a well-defined data interchange format that disparate models can use
for standardizing inputs and outputs between each other
• Allows for specific extensions, but interfaces are defined by the CDM
Common Data Model Overview
Conceptual Data Model
XSD Schema Files
• Properties.xsd
• System.xsd
• Substance.xsd
• Scenario.xsd
• Circuit.xsd
• Anatomy.xsd
• Patient & Actions.xsd
• Equipment & Actions.xsd
• BioGears.xsd
Data forms, variables,
definitions, and relationships
Data Model Binding
Code Synthesis DLL
• Properties.cxx
• System.cxx
• Substance.cxx
• Scenario.cxx
• Circuit.cxx
• Anatomy.cxx
• Patient & Actions.cxx
• Equipment & Actions.cxx
• BioGears.cxx
Auto generated C++ Classes
-Turnkey Serialization Support
Common Data Model API
C++ DLL
• SEProperty.cpp, SEScalar.cpp,
SEScalarVolume.cpp, etc.
• SECardiovascular.cpp,
SERespiratory.cpp, etc.
• SECircuit.cpp, SECircuitNode.cpp,
SECircuitPath.cpp, etc.
• SEPatient.cpp, SESubstance.cpp,
SEDrug.cpp, etc.
• SESubstanceAdministration.cpp,
SEHemorrhage.cpp, etc.
Class library reflects the binding
and utilizes serialization support
• Unit Conversion
• Logging (log4cpp)
• Unit Test Framework
• Generic Circuit Solver
• Generic Circuit Transport
• Generic Math
• Pure Virtual Physiology Engine
Interface
• Scenario Definition and Execution
Additional general algorithms
35. 35
Setup/Modify
Next Values
Modified Nodal
Analysis
Calculate
Fluxes
Valves
Pass?
Set Node
Quantities
Advance Time
Modify Valve
States
Yes
No
Calculate
Quantities
Preprocess:
1. Systems use “Current” values to setup/modify “Next”
values via feedback mechanisms (outside of the solver)
Process:
2. Perform numerical integration by using linearization
(first order approximations) through Modified Nodal
Analysis (Ax=b)
a. Use KCL (total Flux at each node = 0) to
Calculate the Jacobian matrix (A) and right-
hand side vector (b) for each Node Potential
and Potential Source Flux (x)
b. Use the Eigen templated library linear solver
(FullPivLU) to solve for x vector
3. Calculate unknown Fluxes – using Trapezoid Rule
where applicable
4. Calculate Valves using assumed diode states (cannot
be solved directly) – iterate as necessary
5. Calculate and increment Compliance Path Quantities
– No other elements have dynamic Quantities (rigid
pipes)
6. Set Node Quantities (based on Path Quantities)
• Note: Transporter is called here
Postprocess:
7. Advance time by moving “Next” to “Current” values
Process
Preprocess
Postprocess
1
2
3
5
67
4
Circuit Solver
• Fully dynamic Modified Nodal Analysis
solver for any valid closed-loop circuit
• Solves circuit types with any units:
Electrical, Fluid, Thermal
36. 36
• Common Data Model:
• Substances move with the fluid to each node
in the circuit
• No particle deposition
• Mass is updated as at each time step based
on flow into and out of nodes
• Concentration and partial pressure are
updated after the mass
• Systems Interactions:
• Partial pressure driven diffusion moves
substances between two nodes (O2, CO2, N2)
• Perfusion limited diffusion moves substances
across the blood/tissue barrier based on flow
and partition coefficients (Drugs)
• Systemic clearance removes substances
from the vena cava to represent metabolic or
other clearance mechanisms
• Hepatic clearance removes substances from
the liver to represent the ability of the liver to
metabolize or remove substances
Transporter
Lung Vascular
Lung Tissue
Heart
Kidney Tissue
Kidney Vascular
Lung Airway
Liver Tissue
Liver Vascular
Other Tissue
Other Vascular
Bladder
GI
37. 37
Motivation
• Data driven developers’ tool to
demonstrate basic functionality
• Test Engine without command line
• Ready for testing out-of-the-box (no
compiling)
• Simple interface for creating, editing, and
executing scenario file, and creating
resulting plots of requested data
Expectations
• Only requirements are to allow editing
and execution of scenarios – not a major
focus
• Not heavily QA’ed – some known bugs
being continuously fixed
Limitations
• Clunky Java Swing for rapid prototyping
via the API
Developer GUI
39. 39
Current (hopefully deployed this summer with version 6.0.0):
• Bug fixing and system refinement
• Optimization and increased simulation speed
• State serialization – saving and loading simulations
• Modularity – more easily replace entire systems
• Renal feedback updates
• Acid-base balance – O2 & CO2 saturation modifications
• Total body substance balance and new substances
Near-Term (FY16):
• Nervous system additions
• Exocrine additions
• Endocrine additions
• Vascular fluid exchange
• Pneumothorax updates
• Gastrointestinal updates
Long-Term (FY17):
• Patient modifications (gender, body mass, etc)
• Intoxications – Ketamine proof of concept
• Airborne agents (Nerve/Pulmonary/Smoke/CO) and vaporization
• Diuretics
• Additions to blood assessments and pulmonary function test improvement
High Level Near Term Tasks
40. 40
• Use the software for any and all applications (please let us
know)
• Report problems
• Submit code
• Currently just email us
(https://www.biogearsengine.com/workwithus)
• Moving to a public repository – GitHub/BitBucket hosted
• Post and respond to Forums
(https://www.biogearsengine.com/forums)
How to Contribute
41. 41
Please Come See Our Posters!
Showcases: Rodney Metoyer Renal: Dr. Austin Baird
PK/PD: Dr. Rachel Clipp Energy: Cam Thames
44. 44
Current System Capabilities
Systems Acute Insults & Interventions Chronic Conditions Events
Cardiovascular
& Blood Chemistry
Cardiac Arrest
CPR
Hemorrhage
Pericardial Effusion
Anemia
Arrhythmia
Bradycardia
Tachycardia
Heart Failure
Pericardial Effusion
Asystole
Bradycardia & Tachycardia
Bradypnea & Tachypnea
Brain & Myocardium Oxygen Deficit
Cardiac Arrest
Hypercapnia & Hypoxia
Hyperglycemia & Hypoglycemia
Hypovolemic Shock
Pulseless Rhythm
Respiratory Airway Obstruction
Bronchoconstriction
Asthma Attack
COPD Bronchitis
Intubation
Pneumothorax
Conscious Respiration
Occlusive Dressing
Needle Decompression
COPD
Lobar Pneumonia
Energy
& Environment
Exercise
Environment Changes
Thermal Application
Dehydration
Starvation
Environment Changes
Fasciculation
Fatigue
Hyperthermia
Heat Stroke
Metabolic/Respiratory Acidosis & Alkalosis
Renal
& GI
Urinate
Consume Meal
Renal Stenosis Diuresis & Antidiuresis
Natriuresis
Dehydration
Functional Incontinence
Drugs
& Substances
& Inhaler
IV Fluid Administration
IV Drug Administration
IM Drug Administration
Inhaler Drug Administration
Anesthesia Machine Configuration
Expiratory/Inspiratory Valve
Leaks/Obstructions
Soda Lime Failure
Mask/Tube Leak
Vaporizer Failure
Ventilator Pressure Loss
Oxygen Port/Tank Pressure
Loss
Endotracheal Intubation
Esophageal Intubation
Oxygen Bottle Exhausted
Relief Valve Active
Note: More to come
45. 45
Provided Data Examples
Systems System Vital Examples
(Hundreds Total)
Compartment Examples
(Thousands Total)
Assessments
(Exhaustive)
Cardiovascular Heart Rate
Cardiac Output
Mean Arterial Pressure
Blood Volume
Pulmonary Flow
Brain Pressure
Heart Volumes
Substance Concentrations
Complete Blood Count
Comprehensive Metabolic Panel
Blood Chemistry Blood pH
Oxygen Saturation
Shunt Fraction
Hemoglobin Content
Respiratory Respiration Rate
Tidal Volume
Total Lung Volume
Pulmonary Resistance
Lung Volumes
Lung Pressures
Air Flow
Substance Volume Fractions
Pulmonary Function Test
Energy Respiratory Quotient
Total Metabolic Rate
Skin Temp
Heat Transfer Rate
Environment Ambient Temperature
Clothing Resistance
Renal Glomerular Filtration Rate
Urine Specific Gravity
Renal Blood Flow
Bladder Substance Concentrations
Urinalysis
GI Digestion Rate Stomach Contents
Drugs & Substances Partition Coefficients
Anesthesia Level
Plasma Concentration
Tissue Concentration
Anesthesia Machine Oxygen Bottle Volume
Ventilator Pressure
Vaporizer substance fractions
Tube flows
Note: These are only example outputs – there are many, many more
46. 46
Other Included BioGears Tools
Unit Converter
Unit/Feature Testing
• Validate individual tools
• Verify individual feedback
• Alerts user to introduced bugs
Verification Testing
• Full scenario suite to test all patient
files, patient actions, substance
effects, and equipment performance
• Each scenario indicates the
physiologic outputs for comparison
and generates error plots
Validation Testing
• Spreadsheet with referenced baselines
• Color coded error tables automatically
generated for all System and relevant
compartment data
Developer GUI
VentilatorPressureLossScenarioResultsReport 1 1 21.258999824523926
YpieceDisconnectScenarioResultsReport 1 1 23.98900008201599
AirwayInsultObstructionResultsReport 0 1 14.930999994277954
AtropineScenarioResultsReport 0 1 13.121000051498413
BasicScenario1ResultsReport 0 1 18.195000171661377
Verification Results Example
Developer GUI
47. 47
• Virtual Heroes developed ‘Combat Medic’, for RDECOM STTC
• Uses BioGears for live physiology and after action data
• Intended to train Combat Medics on the top three preventable
causes of death on the battlefield: Hemorrhage, Airway Obstruction
and Tension Pneumothorax
• The prototype was tested at Fort Bliss, TX by Army combat medics
Combat Medic using BioGears
Images courtesy of Combat Medic project funded by Army RDECOM-STTC
Hemorrhage Airway Obstruction Tension Pneumothorax
Link to Video
49. 49
Documentation and Tutorials
• The website includes detailed documentation for each physiology system
and software components (e.g., CDM, Toolkit, SDK, Source Code)
• This includes text and tables that explain: system background, model
limitations, equations used, and validation data sources and matrices
• https://www.biogearsengine.com
Expand
50. 50
Envisioned User Groups
Adds or replaces
systems to extend the
functionality
Ex. Physiology Modelers
BioGears Contributor
Use the engine as is via
the API
Ex. Game Developers
Engine Integrator
Uses/extends CDM
Runs BioGears engine
and/or other engine(s)
Ex. Mannequin Builder
External Model/
Engine Developer
Creates custom input to
BioGears engine for
research or instruction
Ex. Teaching Assistant
Researcher/ Educator
• The physiology engine has been designed and implemented
with 4 user groups in mind.
• Engine functionality, fidelity and extensibility critical design
decisions made to make BioGears user friendly
• Scope:
• Providing an API with open source libraries
• BioGears is not a ‘game’ – it will power immersive training content and
other M&S tools
51. 51
• Worked with subcontractor UNC Eshelman School of Pharmacy
• Pharmacodynamics also validated through scenario validation
• All drugs validated in this manor
PK/Clearance Validation Examples
Bolus
InfusionBolus
Bolus
52. 52
Using BioGears
• Canned or Dynamic Scenarios
• Training and Simulation Scenarios
• Physiology and Modeling Classroom
Education
• Data Analysis
• Physiologic Response Scenarios
Use-Case Options
• Integration of New Models, Systems,
Actions, Conditions, and Events
• New Patients, Substances, and Drugs
• New Initialization Parameters (blood
tests, lab results)
• Validation and Verification
• Data Analysis
• Injury Assessment Scoring Input
Development Future
1. Needs and Requirements Assessment
2. Validation and Calibration Data Determination
3. Model Design and Implementation
4. Model Verification – Unit Tests to Verify Functionality
5. Model Calibration – Tuning Parameters to Meet Initial Data
6. Model Validation – Use of Model/Feature in Combination To Validate
Functionality
Model/Feature Development Steps
53. 53
Implementation
Setup/Modify
Next Values
Modified Nodal
Analysis
Calculate
Fluxes
Valves
Pass?
Set Node
Quantities
Advance Time
Modify Valve
States
Yes
No
Calculate
Quantities
Preprocess:
1. Systems use “Current” values to setup/modify “Next”
values via feedback mechanisms (outside of the solver)
Process:
2. Perform numerical integration by using linearization
(first order approximations) through Modified Nodal
Analysis (Ax=b)
a. Use KCL (total Flux at each node = 0) to
Calculate the Jacobian matrix (A) and right-
hand side vector (b) for each Node Potential
and Potential Source Flux (x)
b. Use the Eigen templated library linear solver
(FullPivLU) to solve for x vector
3. Calculate unknown Fluxes – using Trapezoid Rule
where applicable
4. Calculate Valves using assumed diode states (cannot
be solved directly) – iterate as necessary
5. Calculate and increment Compliance Path Quantities
– No other elements have dynamic Quantities (rigid
pipes)
6. Set Node Quantities (based on Path Quantities)
• Note: Transporter is called here
Postprocess:
7. Advance time by moving “Next” to “Current” values
Process
Preprocess
Postprocess
1
2
3
5
67
4
54. 54
• Provides a medium for substance transport through the
human body
• Feedback related to insults/interventions propagated
through entire body
BioGears System Example: Cardiovascular Interaction
Cardiovascular
Renal
TissueGastrointestinal
Respiratory
Alveolar
Transfer
Digestion
Clearance
Tissue Diffusion
55. 55
Example Scenario: Combat Multitrauma Showcase +
Environment Change
Hemorrhage & Tension Pneumothorax
Needle Decompression
Hemorrhage Reduced (Manual Pressure)
Tourniquet (Hemorrhage Stopped) & IV (Saline)
Morphine
High Altitude Environment (End of Current Validated Scenario)
12 min 60 min
Note: Does not include
sympathetic nervous system
– we are currently designing
58. 58
Pharmacokinetics – Partition Coefficients
• An example of the PK properties from the substance files
are shown below.
• Partition coefficients can be directly input into the substance
file, bypassing the engine calculation.
60. 60
Pharmacodynamics
∆𝐸 =
𝐸 𝑚𝑎𝑥 ∗ 𝐶 𝑝
𝐸𝐶50 + 𝐶 𝑝
𝐸𝐶50 =
𝐶 𝑚𝑎𝑥
32
• Drug effects are calculated based on the
plasma concentration, the drug effect,
and the concentration at 50% effect.
• The EC50 value was not readily available for
the majority of drugs in question, so the EC50
value was calculated from the max
concentration.
• The Cmax is shown circled on the
example plot.
61. 61
• The following clinical effects were calculated:
• Heart Rate
• Diastolic and Systolic Pressure
• Respiratory Rate
• Tidal Volume
• Bronchodilation Level
• Sedation Level
• Neuromuscular Block Level
Pharmacodynamics
62. 62
Agent Threat Example Scenario
• Cortexiphan is a fictitious threat agent administered through the air.
• The substance parameters were modified in the agent file and a
scenario was created changing the ambient air to be 9.5%
cortexiphan.
Time(s)
Cortexiphan-PlasmaConcentration(ug/mL)
50 75 100 125 150 175 200 225 250 275 300
0
50
100
150
200
250
300
350
400
450
Plasma concentration increases
with increased exposure time.
Time(s)
RespirationRate(1/min)
0 30 60 90 120 150 180 210 240 270 300
14
16
18
20
22
24
26
28
Respiration rate increases as
calculated by PK/PD response
model.
64. 64
• Common Data Model
• Overview
• Class Introduction
• Physiology Engine Interface
• Static vs. Dynamic Engine Execution
• Inputs
• Conditions
• Actions
• Outputs
• Systems
• Compartments
• Assessments
• We will not go over the entire code base, just the forward
facing classes available for application developers
Application Programming Interface Overview
65. 65
• Property – Scalar, Functions, Enums, etc.
• Scalar is a double with a unit, with embedded unit converter
• System
• Physiology – Cardiovascular, Respiratory, Drugs, etc.
• Equipment
• Anesthesia Machine – Generic Machine
• ECG – Generic Waveform reader
• Inhaler – Optional spacer
• Environment – Properties external patient
• Environmental Conditions – Meteorology, Heat/Cool, ChemBio, etc.
• Patient – Body characteristics, Baselines, State
• Compartment – Specific anatomical and machine dynamics
• Flow, Volume, Pressure,
• Substance Mass/Concentration or Volume/Volume Fraction
CDM Classes (SE prefix)
66. 66
• Substance – Anything being circulated in the blood or pulmonary
systems, including drugs
• Configuration – Engine specific data that does not fit anywhere
else
• Time step, Stabilization, Coefficients, etc.
• Circuit – Generic circuit solving library
• Scenario – Engine execution instructions
• Utils
• Unit Converter – Versatile conversion engine
• General Math – Generic saturation, Kelman equation, etc.
• Logging – Logging classes built on log4cpp
• Data Tracking – Write data to file each time step as the engine runs
• Physiology Engine Interface
• Generic interface for physiology methodology based on CDM
CDM Classes (SE prefix)
67. 67
• Static execution of the engine based on a scenario file
• Specify a patient file
• Request data to be output in a column tab delimited txt file
• Conditions
• Actions
• Dynamic execution of the engine
• Initialize Engine with a patient, any conditions, and an optional results
file
• Time Controls
• GetTimeStep, GetTime, AdvanceTime
• Provide Actions
• GetCompartments()
• GetSystems
• GetAssessment()
• GetSubstances()
Static vs. Dynamic Physiology Engine Interface
68. 68
• Set up the engine to start at a specific state
bool InitializeEngine(const SEPatient& patient, const
std::vector<const SECondition*>* conditions=nullptr)
• Patient
• Anemia, Bradycardia, COPD, Pulmonary Shunt, Renal Stenosis,
Tachycardia, Heart Failure, Meal, Lobar Pneumonia, Pericardial
Effusion
• Environmental
• Initial Environment Conditions
• We have tested each condition individually, but you do have
the option to stack conditions, we have not testing all
combinations
• Test that the engine can converge on stacked conditions
Conditions (Input)
69. 69
• Instruct the engine to change its state in some way
void AdvanceModelTime()// Single Time Step
void AdvanceModelTime(double time, const
std::shared_ptr<CCompoundUnit>& unit)
bool ProcessAction(const SEAction& action)
• Action Types
• Patient – Various Insults and Interventions
• Environment – Configuration and Application
• Anesthesia Machine – Configuration and Insults
• Inhaler - Configuration
Actions (Input)
70. 70
• Physiological state data
• Respiratory Rate, Heart Rate, Metabolic Rate, etc.
• Equipment and Environment state data
• Oxygen Tank Volume, Nozzle Loss, Heater Power, etc.
• Engine implementation does not have to provide every
output, although BioGears does
const SEEnvironment* GetEnvironment()
const SEBloodChemistrySystem* GetBloodChemistrySystem()
… (much more physiology) …
const SEAnesthesiaMachine* GetAnesthesiaMachine()
const SEElectroCardioGram* GetElectroCardioGram()
Systems (Output)
71. 71
• Compartments are a generic interface for the fluid dynamics data of the body, such as
Volumes, Pressures, In Flows, and Out Flows
• A compartment can represent various fidelities of data
• Skin, Right Arm, Liver, Left Heart
• Anesthesia Machine Ventilator, Mask, etc.
• Multiple compartment types to represent different fluid dynamic types
• Gas (Pulmonary), Liquid (Blood, Chyme, Urine), Thermal (Body Heat), Tissue (Extravascular)
• Compartments have a parent/child hierarchy
• There can be multiple compartments associated with anatomy
• Substance quantities for each substance is also provided in the compartment
• A vascular compartment includes the substance masses and concentration
• A pulmonary compartment will contain the volumes and volume fractions of all substances in that
compartment
const SEAnatomyCompartments* GetAnatomyCompartments()
const SEInhalerCompartments* GetInhalerCompartments()
const SEAnesthesiaMachineCompartments* GetAnesthesiaMachineCompartments()
Compartments (Output)
72. 72
• Assessments are physiology data formed into various medical
tests and panels intended for clinicians
• Some calculation may apply
• Complete Blood Panel, Complete Metabolic Panel, Pulmonary Function
Test, and Urnialysis
• Provide an assessment object to the Engine for it to fill out
SEPulmonaryFunctionTest pft(bg->GetLogger());
bg->GetPatientAssessment(pft);
• Various states on the patient or equipment can change during
execution and state flags can be polled for these changes
• Antidiuresis, Asystole, CardiacArrest, …, RespiratoryAlkalosis,
RightMainStemIntubation, Tachycardia, Tachypnea
• OxygenBottleExhausted, RefliefValveActive, etc.
GetPatient().IsEventActive(CDM::enumPatientEvent::CardiacArrest)
Patient Assessments and Events (Output)
73. 73
• Event Callbacks
• Along with polling for events, you can provide a callback object that
the engine will call when any event is triggered
• Exceptions
• Any time an engine gets out of its designed boundary conditions, it
will throw an exception of or derived from
CommonDataModelException
• Data Track
• You can have the engine write out any system or compartment
scalar into tab delimited file at each time step.
Callbacks, Error handling and Data Tracks
74. 74
• Each engine can have its own log and will log the following types of data
• The Logger has the option to be given a LoggerForward class that an
end user provides. The logger will call methods on this class whenever it
logs giving the application a way to programmatically react to the engine
Logs
Type Description
Debug Detailed information about engine execution
Info General information of what the engine is doing
Warning The engine received something or is doing something that may or may
not invalidate results
Error The engine has performed a calculation it was not designed for but will
keep running, results are most likely invalid
Fatal The engine has entered a state it was not designed for and will stop
execution immediately. BioGears will follow this by throwing an
exception
75. 75
• Each engine can have its own log and will log the following types
of data
• Debug – Detailed information about engine execution
• Info– General information of what the engine is doing
• Warning – The engine received something or is doing something that
may or may not invalidate results
• Error– The engine has performed a calculation it was not designed for
but will keep running, results are most likely invalid
• Fatal– The engine has entered a state it was not designed for and will
stop execution immediately. BioGears will follow this by throwing an
exception.
• The Logger has the option to be given a LoggerForward class
that an end user provides. The logger will call methods on this
class whenever it logs giving the application a way to
programmatically react to the engine
Logs
76. 76
• The engine executes out of a bin directory, this is a break down of
the directories and its files required for BioGears
• config – Stabilization parameters, you may need to tweak these files if
you combine conditions
• ecg – The waveform set to use for the ecg
• environments* – a set of canned environments for the engine that the
environment can initialize to
• nutrition* – a set of canned nutrition files that can be used with the
ConsumeMeal condition and ConsumeNutrition action
• patients – a set of tested and validated patient files
• substances – the set of substance files for BioGears
• UCEDefs.txt – Unit conversion configuration file
• BioGearsConfiguration.xml – Override any BioGears configuration
property. By default this file is empty.
*Not required by the engine
OnDisk Breakdown
Notes de l'éditeur
Common physiology system level model for modeling and simulation of the human body
Provides a well-defined data interchange format that disparate models can use for standardizing inputs and outputs between each other
Object Oriented Design of class structures providing a unified set of tools that promotes fast development, compatible data sets, and well-defined interfaces
Separates the physiological data from the physiological modeling methodology
Prevents “engineer” code mixing with data organization and design
Strongly typed design that is intended to grow via community adoption and involvement
Extension allowed for model specific extensions, but interfaces are defined by the common data model
Important to discuss that our delivery to combat medic team shows that biogears CAN be used by target audience
Integration with Unreal-based game is part of SOW requirement
Biogears engine powers all physiology, dynamically reacting to user actions
Mention UNC-CH and UT using in cirriculums – potential for student projects – ARA’s excellent intern program
We are developing these systems with 4 main user groups in mind
Design decisions and functionality are geared towards their use
Perfusion-limited is diffusion primarily driven by the flow to the space
Permeability-limited diffusion is primarily driven by the ability of the substance to be taken into the tissue. Not flow.