The Pulse engine is discretized into the main human physiological systems. Details about the design and architecture of Pulse systems can be found in the system methodology document.
In this post, we will cover how to modify the system circuits and compartments. For information on modifying Actions and Conditions associated with Systems see the pages below:
Modifying/Adding Circuits Elements
Most Pulse systems contain at least one fluid (gas or liquid) or thermal lumped parameter circuit. Functionality to define circuit nodes, paths, and elements is included in the CDM and the Pulse platform includes a circuit solver to determine the state of all circuit parameters each time-step. Details about Pulse circuits can be found in the circuit methodology document.
Nodes and Paths
To add a new node or path, you much first find the circuit's node/path class in the PulseCircuit header file and add the new name. For example, to add a path named "NewPath" to the respiratory system you would add the following:
class RespiratoryPath
{
public:
DEFINE_STATIC_STRING(NewPath);
...
};
The node/path can be added to the circuit in the system's controller setup method using CreateNode or CreatePath. For example, adding our "NewPath" to the respiratory circuit in the controller would look like this:
void PulseController::SetupRespiratory()
{
SEFluidCircuit& cRespiratory = m_Circuits->GetRespiratoryCircuit();
SEFluidCircuitPath& NewPath = cRespiratory.CreatePath(pulse::RespiratoryPath::NewPath );
...
};
Elements
Elements (i.e., resistances, compliances, pressure sources, etc.) can be added to any circuit path. Note that there may only be one element per path. Elements can be removed and added during the simulation, but are generally initialized at startup and the instantaneous values are modified while running. The baseline value should represent the unmodified original homeostatic value. For example, to add a resistance of 1 cmH2O-s/L to the "NewPath" we created in the respiratory system you would do the following in the controller:
NewPath.GetResistanceBaseline().SetValue(1.0, FlowResistanceUnit::cmH2O_s_Per_L);
Modifying/Adding Compartments
A compartment represents the fluid dynamics of an anatomical organ or equipment component. Compartments can represent various fidelities of data for these components, such as:
- An anatomical space, such as the body's skin, muscles
- An organ, such as the liver
- An organ substructure, such as the Left Heart
- Extravascular tissue of an organ
- A component of a piece of equipment, such as an anesthesia machine ventilator
Details about compartments can be found in the Compartment Interface.
To add a new compartment, you much first find the compartment's class in the PulsePhysiologyEngine header file and add the new name. For example, to add a compartment named "NewCompartment" to the Cardiovascular system you would add the following:
class VascularCompartment
{
public:
DEFINE_STATIC_STRING(NewCompartment);
...
};
If you would like to link this NewCompartment to an existing or new compartment you will repeat this process for NewCompartmentLink, as shown below.
class VascularLink
{
public:
DEFINE_STATIC_STRING(NewCompartmentLink);
...
};
You will then need to map the nodes and paths in the circuits to the compartment structure using *MapNode and *MapPath functions. You will do this in the Pulse Controller. The example below sets up maps a Node to the Compartment and then links the compartment to the Vena Cava compartment through a path.
void PulseController::SetupRespiratory()
{
...
SELiquidCompartment& vNewCompartment = m_Compartments->CreateLiquidCompartment(pulse::VascularCompartment::NewCompartment);
vNewCompartment.MapNode(Node);
SELiquidCompartmentLink& vNewCompartmentLink = m_Compartments->CreateLiquidLink(vNewCompartmentLink, vVenaCava, pulse::VascularLink::NodeToVenaCava);
vNewCompartmentLink.MapPath(NodeToVenaCava);
...
}