The BioGears Project is an open source, multi-purpose physiology engine. The Engine uses lump parameter models and electric analog circuits to model and simulate realistic human response to trauma and treatment. This presentation provides a brief overview of our circuit design and implementation.
2. 2
System/Circuit State Calculation Background
Goal: Create generic circuit math and
node based calculations
Requirements/Constraints:
• Electronic-Hydraulic Analogy for
lumped parameter modeling
• Undefined number of nodes and
paths
• Fixed time-step Transient analysis
• Dynamically changing elements
• Modular, extensible, and generic
Solutions investigated:
• 3rd Party Code (NgSpice)
• Positives
• Don’t “re-invent the wheel”
• Negatives
• Bugs
• Memory leaks
• Slow
• Transient analysis single stepping is
“unusable”
• Parsing inputs and outputs is difficult
– meant for text input/output files
• Generalized Circuit Analysis
• Ended up being less labor intensive
• Able to control every aspect of the
analysis
Lumped Parameter Modeling of Fluids
P=Pressure, F=Flow, R=Resistance, C=Compliance, I=Inertance
Our mathematical approach to solving circuits is straight
forward, but our Common Data Model implementation and
integration with Physiological models is novel.
3. 3
BioGears Cardiovascular Circuit Example
• Anatomical Compartments are defined by sub-circuits
• Each Physiological System will have an interconnected circuit
• Model fidelity can be easily modified by adding/removing
nodes and elements
4. 4
Setup/Modify
Next Values
Modified
Nodal Analysis
Calculate
Flows
Valves
Pass?
Invalidate
Flows
Set Node
Volumes
Do Transport
Advance Time
Modify Valve
States
Legend:
Circuit
Generic
System
Specific
Yes
No
Calculate
Volumes
Process
Preprocess
Postprocess
Assumptions/Limitations:
• Closed loop
• Idealized elements
• Must have a pressure reference node
Circuit Analysis:
• Perform numerical integration by using
linearization (first order approximations) through
Modified Nodal Analysis – Conservation of Energy
and Mass
1. Modified Nodal Analysis: Use KCL (sum of
flows is zero at each node) to calculate all Node
Pressures and Pressure Source
2. Linear Solver: Solve the x vector (Ax=b) of
unknowns using LU Decomposition
• Very stable and well tested generic approach to
solving linear equations with large matrices
• The matrix A is decomposed, where L is unit-lower-
triangular, U is upper-triangular, and P and Q are
permutation matrices
3. Calculate Flows from Pressures
4. Calculate Volumes for Compliances (using
trapezoid Rule) -> V=Volume
BioGears Circuit Analysis Methodology
5. 5
BioGears Transport Methodology
Vascular-Tissue
Diffusion
Renal Clearance
to Bladder
Hepatic Clearance
to GI Tract
Alveoli Transfer at
Pulmonary Capillaries
Legend:
Nodes
Paths
Deoxygenated Blood
Oxygenated Blood
Transport Only Path
• Substances
• Substance/Drug files
are defined in XML
files generated from a
Master spreadsheet
• All transport
parameters are in the
XML files
• Transport Flow
• Generic transport
methodology used to
calculate substance
quantities within a
circuit
• Substances flow with
fluid flow (air, blood,
urine, etc.)
• Substances are
incremented at each
node based on flow in
and out of the nodes at
each time step
• Transport Links Systems
– Substances move from CV
to Respiratory via Alveoli
transfer
– Renal clearance factors
used to move from CV to
bladder for elimination
– Hepatic clearance factors
used to move from CV to
GI for elimination
6. 6
Next Steps: Interconnected Circuits
Possible Solutions:
• Combine Circuits and calculate as one large circuit (with one giant
Jacobian matrix) – current implementation
• Able to dynamically combine and/or decouple at runtime (e.g. Anesthesia
Machine connected to Respiratory System and turned on/off)
• Setup at system level and calculated at body level
• Flow Source and Pressure Source coupled and set from “sister” circuit
outputs – similar to circuit supernodes
• Investigating other transient analysis techniques
Cardiovascular and
Renal Circuit
Example:
Coupled Flow
Source and
Pressure Source