More...

#include <Energy.h>

Inherits SEEnergySystem, PulseEnergySystem, and PulseSystem.

Public Member Functions

 ~Energy (void)
 
void Clear ()
 
- Public Member Functions inherited from SEEnergySystem
 SEEnergySystem (Logger *logger)
 
virtual ~SEEnergySystem ()
 
virtual const SEScalarGetScalar (const std::string &name)
 
virtual bool HasAchievedExerciseLevel () const
 
virtual SEScalar0To1GetAchievedExerciseLevel ()
 
virtual double GetAchievedExerciseLevel () const
 
virtual bool HasCoreTemperature () const
 
virtual SEScalarTemperatureGetCoreTemperature ()
 
virtual double GetCoreTemperature (const TemperatureUnit &unit) const
 
virtual bool HasCreatinineProductionRate () const
 
virtual SEScalarAmountPerTimeGetCreatinineProductionRate ()
 
virtual double GetCreatinineProductionRate (const AmountPerTimeUnit &unit) const
 
virtual bool HasExerciseMeanArterialPressureDelta () const
 
virtual SEScalarPressureGetExerciseMeanArterialPressureDelta ()
 
virtual double GetExerciseMeanArterialPressureDelta (const PressureUnit &unit) const
 
virtual bool HasFatigueLevel () const
 
virtual SEScalar0To1GetFatigueLevel ()
 
virtual double GetFatigueLevel () const
 
virtual bool HasKetoneProductionRate () const
 
virtual SEScalarAmountPerTimeGetKetoneProductionRate ()
 
virtual double GetKetoneProductionRate (const AmountPerTimeUnit &unit) const
 
virtual bool HasLactateProductionRate () const
 
virtual SEScalarAmountPerTimeGetLactateProductionRate ()
 
virtual double GetLactateProductionRate (const AmountPerTimeUnit &unit) const
 
virtual bool HasSkinTemperature () const
 
virtual SEScalarTemperatureGetSkinTemperature ()
 
virtual double GetSkinTemperature (const TemperatureUnit &unit) const
 
virtual bool HasSweatRate () const
 
virtual SEScalarMassPerTimeGetSweatRate ()
 
virtual double GetSweatRate (const MassPerTimeUnit &unit) const
 
virtual bool HasTotalMetabolicRate () const
 
virtual SEScalarPowerGetTotalMetabolicRate ()
 
virtual double GetTotalMetabolicRate (const PowerUnit &unit) const
 
virtual bool HasTotalWorkRateLevel () const
 
virtual SEScalar0To1GetTotalWorkRateLevel ()
 
virtual double GetTotalWorkRateLevel () const
 
- Public Member Functions inherited from SESystem
 SESystem (Logger *logger)
 
virtual ~SESystem ()
 
- Public Member Functions inherited from Loggable
 Loggable ()
 
 Loggable (Logger *log)
 
virtual ~Loggable ()
 
virtual LoggerGetLogger () const
 
virtual void Debug (std::string const &msg, std::string const &origin=empty) const
 
virtual void Debug (std::stringstream &msg, std::string const &origin=empty) const
 
virtual void Debug (std::ostream &msg, std::string const &origin=empty) const
 
virtual void Info (std::string const &msg, std::string const &origin=empty) const
 
virtual void Info (std::stringstream &msg, std::string const &origin=empty) const
 
virtual void Info (const std::stringstream &msg, std::string const &origin=empty) const
 
virtual void Info (std::ostream &msg, std::string const &origin=empty) const
 
virtual void Warning (std::string const &msg, std::string const &origin=empty) const
 
virtual void Warning (std::stringstream &msg, std::string const &origin=empty) const
 
virtual void Warning (std::ostream &msg, std::string const &origin=empty) const
 
virtual void Error (std::string const &msg, std::string const &origin=empty) const
 
virtual void Error (std::stringstream &msg, std::string const &origin=empty) const
 
virtual void Error (std::ostream &msg, std::string const &origin=empty) const
 
virtual void Fatal (std::string const &msg, std::string const &origin=empty) const
 
virtual void Fatal (std::stringstream &msg, std::string const &origin=empty) const
 
virtual void Fatal (std::ostream &msg, std::string const &origin=empty) const
 

Protected Member Functions

 Energy (PulseController &data)
 
void Initialize ()
 Initializes system properties to valid homeostatic values. More...
 
void SetUp ()
 Initializes the energy specific quantities. More...
 
void AtSteadyState ()
 Applies an imposed dehydration time to the current fluid stores. More...
 
void PreProcess ()
 Prepares the energy system for the circuit solver. More...
 
void Process ()
 Processes the temperature circuit and calculates extravascular transport. More...
 
void PostProcess ()
 Updates the parameters for the temperature circuit. More...
 
void CalculateMetabolicHeatGeneration ()
 Calculates the metabolic rate, depending on the current state of the patient. More...
 
void CalculateSweatRate ()
 Calculates the sweat rate if the core temperature is too high. More...
 
void UpdateHeatResistance ()
 Updates the variable core to skin heat transfer resistance. More...
 
void Exercise ()
 The exercise function updates the patient's metabolic rate if the exercise action is present and computes energy-store recovery post exercise. More...
 
void CalculateBasalMetabolicRate ()
 Calculates the basal metabolic rate from the Harris-Benedict formula. More...
 
void CalculateVitalSigns ()
 Checks the patient's thermal and metabolic state. More...
 

Protected Attributes

PulseControllerm_data
 
double m_UsableEnergyStore_J
 
double m_PeakPowerEnergyStore_J
 
double m_MediumPowerEnergyStore_J
 
double m_EnduranceEnergyStore_J
 
SERunningAveragem_BloodpH
 
SERunningAveragem_BicarbonateMolarity_mmol_Per_L
 
double m_dT_s
 
SEPatientm_Patient
 
SELiquidSubstanceQuantitym_AortaHCO3
 
SEThermalCircuitNodem_coreNode
 
SEThermalCircuitNodem_skinNode
 
SEThermalCircuitPathm_temperatureGroundToCorePath
 
SEThermalCircuitPathm_coreToSkinPath
 
SEFluidCircuitPathm_skinExtravascularToSweatingGroundPath
 
SEThermalCircuitm_InternalTemperatureCircuit
 
SEThermalCircuitm_TemperatureCircuit
 
SEThermalCircuitCalculatorm_circuitCalculator
 
- Protected Attributes inherited from SEEnergySystem
SEScalar0To1m_AchievedExerciseLevel
 
SEScalarTemperaturem_CoreTemperature
 
SEScalarAmountPerTimem_CreatinineProductionRate
 
SEScalarPressurem_ExerciseMeanArterialPressureDelta
 
SEScalar0To1m_FatigueLevel
 
SEScalarAmountPerTimem_KetoneProductionRate
 
SEScalarAmountPerTimem_LactateProductionRate
 
SEScalarTemperaturem_SkinTemperature
 
SEScalarMassPerTimem_SweatRate
 
SEScalarPowerm_TotalMetabolicRate
 
SEScalar0To1m_TotalWorkRateLevel
 
- Protected Attributes inherited from SESystem
std::stringstream m_ss
 
- Protected Attributes inherited from Loggable
Loggerm_Logger
 

Friends

class PBPulsePhysiology
 
class PulseController
 
class PulseEngineTest
 

Additional Inherited Members

- Static Public Member Functions inherited from SESystem
static const SEScalarGetScalar (const std::string &name, std::vector< SESystem *> *systems)
 
- Static Public Attributes inherited from Loggable
static const std::string empty
 

Detailed Description

Constructor & Destructor Documentation

◆ Energy()

Energy::Energy ( PulseController data)
protected

◆ ~Energy()

Energy::~Energy ( void  )

Member Function Documentation

◆ AtSteadyState()

void Energy::AtSteadyState ( )
protectedvirtual

Applies an imposed dehydration time to the current fluid stores.

Starvation uses a coarse time-step approach with an assumed time-step of one day. This coarse time-step is used to to manually decrement all of the fluid stores which represents the loss due to urination, sweating, and other mechanisms. For time-steps longer than one day there is a reduced fluid loss. Applies an imposed starvation time to the current nutrient stores

Starvation uses a coarse time-step approach with an assumed time-step of one day. This coarse time-step is used to to manually decrement all of the nutrient stores which represents the loss due to metabolic consumption. For time durations greater than one day, there is a decrease in the basal metabolic rate due to mass loss from increased starvation times.

Reimplemented from PulseSystem.

◆ CalculateBasalMetabolicRate()

void Energy::CalculateBasalMetabolicRate ( )
protected

Calculates the basal metabolic rate from the Harris-Benedict formula.

The Harris-Benedict formula uses the patient height, weight age and sex to determine the basal metabolic requirements.

[232]

◆ CalculateMetabolicHeatGeneration()

void Energy::CalculateMetabolicHeatGeneration ( )
protected

Calculates the metabolic rate, depending on the current state of the patient.

The metabolic rate is dictated by the current state of the core temperature. This function includes states of increased metabolic rate due to shivering or severe hyperthermia. Additionally, an extreme drop in core temperature leads to decreasing metabolic rate. If the core temperature does not meet any of the criteria for increases/decreases, the metabolic rate will be calculated as the basal metabolic rate.

[herman2008physics]

[164]

[162]

◆ CalculateSweatRate()

void Energy::CalculateSweatRate ( )
protected

Calculates the sweat rate if the core temperature is too high.

The sweat rate is calculated from a core temperature control function. The mass lost due to sweating is accounted for and a flow source from the skin extravascular to ground path is updated to ensure fluid loss

[herman2008physics]

Todo:
Convert to sweat density once specific gravity calculation is in

◆ CalculateVitalSigns()

void Energy::CalculateVitalSigns ( )
protected

Checks the patient's thermal and metabolic state.

The core and skin temperatures are recorded in this function. In addition, the current metabolic state of the patient may trigger the following events: hypothermia, hyperthermia, dehydration, fasciculation or fatigue. These events are only triggered if the current state falls within the criteria of the specific event

[Stocks2004HumanPhysiologicalResponseCold]

[mallet2001hypothermia]

Event:
Patient: Core temperature has fallen below 35 degrees Celsius. Patient is hypothermic.
Irreversible:
State: Core temperature has fallen below 20 degrees Celsius.

[mallet2001hypothermia]

Event:
Patient: Core temperature has exceeded 38.3 degrees Celsius. Patient is hyperthermic.
Todo:
Move to blood chemistry
Event:
The patient is in a state of metabolic acidosis
Irreversible:
State: arterial blood pH has dropped below 6.5.
Event:
The patient has exited the state state of metabolic acidosis
Event:
The patient is in a state of metabolic alkalosis
Irreversible:
State: arterial blood pH has increased above 8.5.
Event:
The patient has exited the state of metabolic alkalosis

◆ Clear()

void Energy::Clear ( )
virtual

Reimplemented from SEEnergySystem.

◆ Exercise()

void Energy::Exercise ( )
protected

The exercise function updates the patient's metabolic rate if the exercise action is present and computes energy-store recovery post exercise.

The exercise function adds to the body's basal metabolic rate a value that is specified by the exercise action. The metabolic rate set-point is specified by the action but limited by the amount of energy available. The energy limit is computed, and the actual metabolic rate is ramped to the limited set-point. The body's actual work rate as a fraction of the total possible work rate and the body's actual work rate as a fraction of the action-requested work rate are set in this method.

Event:
Patient: Fatigue - Energy stores are sub-maximal.
Todo:
Log an event or info message that available energy is insufficient to meet demand.

◆ Initialize()

void Energy::Initialize ( )
protectedvirtual

Initializes system properties to valid homeostatic values.

[herman2008physics]

[205]

[68]

[110]

Reimplemented from PulseSystem.

◆ PostProcess()

void Energy::PostProcess ( )
protectedvirtual

Updates the parameters for the temperature circuit.

Updates the resulting heat transfer rates, temperatures and nodal heat values; effectively moving the next values to the current ones before time can be advanced.

Implements PulseSystem.

◆ PreProcess()

void Energy::PreProcess ( )
protectedvirtual

Prepares the energy system for the circuit solver.

The PreProcess function performs function in preparation to update the thermal circuit. It also processes energy-related actions (exercise) and computes a sweat rate.

Implements PulseSystem.

◆ Process()

void Energy::Process ( )
protectedvirtual

Processes the temperature circuit and calculates extravascular transport.

The Process function solves the temperature circuit for all path heat transfer rates and nodal temperatures. Additionally, the process function also initiates the flow transport of the metabolic substance quantities from the vascular to extravascular space. After this is complete, the vital signs of the patient are updated with regards to the new state.

Implements PulseSystem.

◆ SetUp()

void Energy::SetUp ( )
protectedvirtual

Initializes the energy specific quantities.

The energy local member variables, system level quantities, and metabolic-specific substance quantities are initialized here. These variables are used in the numerous metabolic and thermal regulation functions contained in the energy system. Encompassing them in this function allows for easy initialization either at the beginning of a simulation or after a system crash

Implements PulseSystem.

◆ UpdateHeatResistance()

void Energy::UpdateHeatResistance ( )
protected

Updates the variable core to skin heat transfer resistance.

The variable core to skin heat transfer resistance is updated here according to the inverse of the skin blood flow.

Friends And Related Function Documentation

◆ PBPulsePhysiology

friend class PBPulsePhysiology
friend

◆ PulseController

friend class PulseController
friend

◆ PulseEngineTest

friend class PulseEngineTest
friend

Member Data Documentation

◆ m_AortaHCO3

SELiquidSubstanceQuantity* Energy::m_AortaHCO3
protected

◆ m_BicarbonateMolarity_mmol_Per_L

SERunningAverage* Energy::m_BicarbonateMolarity_mmol_Per_L
protected

◆ m_BloodpH

SERunningAverage* Energy::m_BloodpH
protected

◆ m_circuitCalculator

SEThermalCircuitCalculator* Energy::m_circuitCalculator
protected

◆ m_coreNode

SEThermalCircuitNode* Energy::m_coreNode
protected

◆ m_coreToSkinPath

SEThermalCircuitPath* Energy::m_coreToSkinPath
protected

◆ m_data

PulseController& Energy::m_data
protected

◆ m_dT_s

double Energy::m_dT_s
protected

◆ m_EnduranceEnergyStore_J

double Energy::m_EnduranceEnergyStore_J
protected

◆ m_InternalTemperatureCircuit

SEThermalCircuit* Energy::m_InternalTemperatureCircuit
protected

◆ m_MediumPowerEnergyStore_J

double Energy::m_MediumPowerEnergyStore_J
protected

◆ m_Patient

SEPatient* Energy::m_Patient
protected

◆ m_PeakPowerEnergyStore_J

double Energy::m_PeakPowerEnergyStore_J
protected

◆ m_skinExtravascularToSweatingGroundPath

SEFluidCircuitPath* Energy::m_skinExtravascularToSweatingGroundPath
protected

◆ m_skinNode

SEThermalCircuitNode* Energy::m_skinNode
protected

◆ m_TemperatureCircuit

SEThermalCircuit* Energy::m_TemperatureCircuit
protected

◆ m_temperatureGroundToCorePath

SEThermalCircuitPath* Energy::m_temperatureGroundToCorePath
protected

◆ m_UsableEnergyStore_J

double Energy::m_UsableEnergyStore_J
protected