Commit 8e3cde05 authored by Rachel Clipp's avatar Rachel Clipp
Browse files

Changes to the sympathetic fraction curve to fit validation data, modified the...

Changes to the sympathetic fraction curve to fit validation data, modified the baroreceptor functionality to represent saturation level effects. Hemorrhagic shock changes to the heart elastance and the level of oxygen partial pressure required to activate a myocardium oxygen deficit. Updated hemorrhagic shock scenario to reflect the required outputs and hemorrhage rate.
parent 636cb9e7
......@@ -446,7 +446,7 @@ void BloodChemistry::CheckBloodGasLevels()
}
//Myocardium Oxygen Check
if (m_myocardiumO2->GetPartialPressure(PressureUnit::mmHg) < 5)
if (m_myocardiumO2->GetPartialPressure(PressureUnit::mmHg) < 25)
{
/// \event Patient: The heart is not receiving enough oxygen. Coronary arteries should dilate to increase blood flow to the heart.
m_data.GetEvents().SetEvent(eEvent::MyocardiumOxygenDeficit, true, m_data.GetSimulationTime());
......
......@@ -254,6 +254,10 @@ void Cardiovascular::Initialize()
GetSystemicVascularResistance().SetValue(systemicVascularResistance_mmHg_s_Per_mL, PressureTimePerVolumeUnit::mmHg_s_Per_mL);
m_LeftHeartElastanceMax_mmHg_Per_mL = m_data.GetConfiguration().GetLeftHeartElastanceMaximum(PressurePerVolumeUnit::mmHg_Per_mL);
m_RightHeartElastanceMax_mmHg_Per_mL = m_data.GetConfiguration().GetRightHeartElastanceMaximum(PressurePerVolumeUnit::mmHg_Per_mL);
//Debugging
m_CardiacOutputBaseline = m_CardiacOutput->GetValue(VolumePerTimeUnit::L_Per_min);
}
//--------------------------------------------------------------------------------------------------
......@@ -369,6 +373,7 @@ void Cardiovascular::SetUp()
m_AortaResistance = m_CirculatoryCircuit->GetPath(pulse::CardiovascularPath::Aorta3ToAorta1);
m_VenaCavaCompliance = m_CirculatoryCircuit->GetPath(pulse::CardiovascularPath::VenaCavaToGround);
m_RightHeartResistance = m_CirculatoryCircuit->GetPath(pulse::CardiovascularPath::VenaCavaToRightHeart2);
}
//--------------------------------------------------------------------------------------------------
......@@ -604,8 +609,18 @@ void Cardiovascular::PreProcess()
ProcessActions();
UpdateHeartRhythm();
CalculatePleuralCavityVenousEffects();
//m_data.GetDataTrack().Probe("BloodVolumeEstimate", m_BloodVolumeEstimate/1000.0);
//Debugging
m_data.GetDataTrack().Probe("BloodVolumeEstimate", m_BloodVolumeEstimate/1000.0);
double percentageBloodLoss = ((m_data.GetCurrentPatient().GetBloodVolumeBaseline(VolumeUnit::mL) - GetBloodVolume().GetValue(VolumeUnit::mL)) / m_data.GetCurrentPatient().GetBloodVolumeBaseline(VolumeUnit::mL)) * 100;
m_data.GetDataTrack().Probe("BloodLossPercentage", percentageBloodLoss);
double normalizedardiacOutput = GetCardiacOutput().GetValue(VolumePerTimeUnit::L_Per_min) / m_CardiacOutputBaseline;
m_data.GetDataTrack().Probe("NormalizedCardiacOutput", normalizedardiacOutput);
double normalizedMAP = GetMeanArterialPressure().GetValue(PressureUnit::mmHg) / m_data.GetCurrentPatient().GetMeanArterialPressureBaseline(PressureUnit::mmHg);
m_data.GetDataTrack().Probe("NormalizedMAP", normalizedMAP);
}
//--------------------------------------------------------------------------------------------------
......@@ -756,10 +771,10 @@ void Cardiovascular::CalculateVitalSigns()
double hypovolemicShock = 0.5*m_data.GetCurrentPatient().GetBloodVolumeBaseline(VolumeUnit::mL);
if (GetBloodVolume().GetValue(VolumeUnit::mL) <= hypovolemicShock)
{
m_ss << "Over half the patients blood volume has been lost. The patient is now in an irreversible state.";
/*m_ss << "Over half the patients blood volume has been lost. The patient is now in an irreversible state.";
Warning(m_ss);
/// \irreversible Over half the patients blood volume has been lost.
m_data.GetEvents().SetEvent(eEvent::IrreversibleState, true, m_data.GetSimulationTime());
m_data.GetEvents().SetEvent(eEvent::IrreversibleState, true, m_data.GetSimulationTime());*/
}
}
else
......@@ -1642,12 +1657,22 @@ void Cardiovascular::CalculateHeartElastance()
double n1 = 1.32;
double n2 = 21.9;
double maxShape = 0.598;
double oxygenDeficitEffect = 1.0;
if (m_data.GetEvents().IsEventActive(eEvent::MyocardiumOxygenDeficit) == true)
{
double eventDuration = m_data.GetEvents().GetEventDuration(eEvent::MyocardiumOxygenDeficit, TimeUnit::s);
oxygenDeficitEffect = pow(-3E-9*eventDuration, 2) + 8E-6*eventDuration + 0.9865;
}
double normalizedCardiacTime = m_CurrentCardiacCycleTime_s / m_CardiacCyclePeriod_s;
double elastanceShapeFunction = (pow(normalizedCardiacTime / alpha1, n1) / (1.0 + pow(normalizedCardiacTime / alpha1, n1)))*(1.0 / (1.0 + pow(normalizedCardiacTime / alpha2, n2))) / maxShape;
m_LeftHeartElastance_mmHg_Per_mL = (m_LeftHeartElastanceMax_mmHg_Per_mL - m_LeftHeartElastanceMin_mmHg_Per_mL)*elastanceShapeFunction + m_LeftHeartElastanceMin_mmHg_Per_mL;
m_RightHeartElastance_mmHg_Per_mL = (m_RightHeartElastanceMax_mmHg_Per_mL - m_RightHeartElastanceMin_mmHg_Per_mL)*elastanceShapeFunction + m_RightHeartElastanceMin_mmHg_Per_mL;
m_LeftHeartElastance_mmHg_Per_mL = oxygenDeficitEffect * ((m_LeftHeartElastanceMax_mmHg_Per_mL - m_LeftHeartElastanceMin_mmHg_Per_mL)*elastanceShapeFunction + m_LeftHeartElastanceMin_mmHg_Per_mL);
m_RightHeartElastance_mmHg_Per_mL = oxygenDeficitEffect * ((m_RightHeartElastanceMax_mmHg_Per_mL - m_RightHeartElastanceMin_mmHg_Per_mL)*elastanceShapeFunction + m_RightHeartElastanceMin_mmHg_Per_mL);
m_data.GetDataTrack().Probe("LeftHeartElastance", m_LeftHeartElastance_mmHg_Per_mL);
m_data.GetDataTrack().Probe("oxygendeficiteffect", oxygenDeficitEffect);
}
//--------------------------------------------------------------------------------------------------
......
......@@ -214,6 +214,7 @@ protected:
//debugging hemorrhage
double m_BloodVolumeEstimate;
double m_CardiacOutputBaseline;
};
......
......@@ -73,6 +73,9 @@ void Nervous::Initialize()
m_BaroreceptorActiveTime_s = 0.0;
m_BaroreceptorFeedbackStatus = false;
m_BaroreceptorMeanArterialPressureBaseline_mmHg = 0;
m_BaroreceptorSaturationStatus = false;
m_BaroreceptorSaturationTime_s = 0.0;
m_BaroreceptorEffectivenessParameter = 1.0;
}
//--------------------------------------------------------------------------------------------------
......@@ -169,7 +172,7 @@ void Nervous::PostProcess()
void Nervous::BaroreceptorFeedback()
{
//First calculate the sympathetic and parasympathetic firing rates:
double nu = m_data.GetConfiguration().GetResponseSlope();
double nu = 4 * m_data.GetConfiguration().GetResponseSlope();
double meanArterialPressure_mmHg = m_data.GetCardiovascular().GetMeanArterialPressure(PressureUnit::mmHg);
//Adjusting the mean arterial pressure set-point to account for cardiovascular drug effects
......@@ -214,7 +217,7 @@ void Nervous::BaroreceptorFeedback()
//double sedationDampeningEffect = m_data.GetDrugs().GetSedationLevel().GetValue() * 0.35; //maximum slope reduction of 35% - making that up right now
//update nu - the slope response of the firing rate
//nu *= (1 - sedationDampeningEffect); TODO: Add this back when I have data for validation
//Backout the pressure associated with the total sympathetic fraction from the last time step
//Backout the pressure associated with the total sympathetic fraction from the last time step
double cumulativeMeanArterialPressure_mmHg = pow(((1.0 / m_TotalSympatheticFraction) - 1.0), (1 / nu)) * meanArterialPressureCombinedBaseline_mmHg;
double deltaPressure_mmHg = meanArterialPressure_mmHg - m_LastMeanArterialPressure_mmHg;
double baroreceptorPressure_mmHg = cumulativeMeanArterialPressure_mmHg + deltaPressure_mmHg;
......@@ -222,36 +225,87 @@ void Nervous::BaroreceptorFeedback()
double parasympatheticFraction = 1 - m_TotalSympatheticFraction;
m_LastMeanArterialPressure_mmHg = meanArterialPressure_mmHg;
/*m_data.GetDataTrack().Probe("SympatheticFraction", m_TotalSympatheticFraction);
m_data.GetDataTrack().Probe("CumulativeMAP", cumulativeMeanArterialPressure_mmHg);
m_data.GetDataTrack().Probe("baroreceptorPressure", baroreceptorPressure_mmHg);
m_data.GetDataTrack().Probe("deltaPressure", deltaPressure_mmHg);*/
m_data.GetDataTrack().Probe("SympatheticFraction", m_TotalSympatheticFraction);
//m_data.GetDataTrack().Probe("ParaSympatheticFraction", parasympatheticFraction);
//m_data.GetDataTrack().Probe("CumulativeMAP", cumulativeMeanArterialPressure_mmHg);
//m_data.GetDataTrack().Probe("baroreceptorPressure", baroreceptorPressure_mmHg);
//m_data.GetDataTrack().Probe("deltaPressure", deltaPressure_mmHg);
double normalizedMAP = meanArterialPressure_mmHg / meanArterialPressureCombinedBaseline_mmHg;
if (m_TotalSympatheticFraction > 0.79) //saturation achieved
{
if (!m_BaroreceptorSaturationStatus)
{
//m_BaroreceptorSaturationTime_s = 0.0;
m_BaroreceptorSaturationStatus = true;
Info("Baroreceptors Saturated ");
}
else
{
// m_BaroreceptorSaturationTime_s += m_dt_s;
if (normalizedMAP <= 0.48 && normalizedMAP >= 0.43)
{
//last ditch effort
//m_BaroreceptorEffectivenessParameter += 0.0001;
m_BaroreceptorEffectivenessParameter = 0.0008;
}
else if (normalizedMAP < 0.43)
{
m_BaroreceptorEffectivenessParameter -= 0.00004;
}
else
{
//reduce effectiveness of baroreceptors
if (m_TotalSympatheticFraction < 0.82)
{
m_BaroreceptorEffectivenessParameter -= 0.0027;
}
else
{
m_BaroreceptorEffectivenessParameter -= 0.0001;
}
if (m_BaroreceptorEffectivenessParameter < -0.25)
{
m_BaroreceptorEffectivenessParameter = -0.25;
}
}
}
}
else
{
if (m_BaroreceptorSaturationStatus)
m_BaroreceptorSaturationStatus = false;
}
m_data.GetDataTrack().Probe("effectivenessParameter", m_BaroreceptorEffectivenessParameter);
m_data.GetDataTrack().Probe("normalizedMAPBaro", normalizedMAP);
//Calculate the normalized change in heart rate
double normalizedHeartRate = GetBaroreceptorHeartRateScale().GetValue();
double tauHeartRate_s = m_data.GetConfiguration().GetHeartRateDistributedTimeDelay(TimeUnit::s);
double deltaNormalizedHeartRate = (1.0 / tauHeartRate_s)*(-normalizedHeartRate + m_NormalizedAlphaHeartRate*m_TotalSympatheticFraction - m_NormalizedBetaHeartRate*parasympatheticFraction + m_NormalizedGammaHeartRate)*m_dt_s;
double deltaNormalizedHeartRate = m_BaroreceptorEffectivenessParameter * (1.0 / tauHeartRate_s)*(-normalizedHeartRate + m_NormalizedAlphaHeartRate*m_TotalSympatheticFraction - m_NormalizedBetaHeartRate*parasympatheticFraction + m_NormalizedGammaHeartRate)*m_dt_s;
normalizedHeartRate += deltaNormalizedHeartRate;
GetBaroreceptorHeartRateScale().SetValue(normalizedHeartRate);
//Calculate the normalized change in heart elastance
double normalizedHeartElastance = GetBaroreceptorHeartElastanceScale().GetValue();
double tauElastance_s = m_data.GetConfiguration().GetHeartElastanceDistributedTimeDelay(TimeUnit::s);
double deltaNormalizedHeartElastance = (1.0 / tauElastance_s)*(-normalizedHeartElastance + m_NormalizedAlphaElastance*m_TotalSympatheticFraction + m_NormalizedGammaElastance)*m_dt_s;
double deltaNormalizedHeartElastance = m_BaroreceptorEffectivenessParameter * (1.0 / tauElastance_s)*(-normalizedHeartElastance + m_NormalizedAlphaElastance*m_TotalSympatheticFraction + m_NormalizedGammaElastance)*m_dt_s;
normalizedHeartElastance += deltaNormalizedHeartElastance;
GetBaroreceptorHeartElastanceScale().SetValue(normalizedHeartElastance);
//Calculate the normalized change in flow resistance for any cardiovascular resistor
double normalizedResistance = GetBaroreceptorResistanceScale().GetValue();
double tauResistance_s = m_data.GetConfiguration().GetSystemicResistanceDistributedTimeDelay(TimeUnit::s);
double deltaNormalizedResistance = (1.0 / tauResistance_s)*(-normalizedResistance + m_NormalizedAlphaResistance*m_TotalSympatheticFraction + m_NormalizedGammaResistance)*m_dt_s;
double deltaNormalizedResistance = m_BaroreceptorEffectivenessParameter * (1.0 / tauResistance_s)*(-normalizedResistance + m_NormalizedAlphaResistance*m_TotalSympatheticFraction + m_NormalizedGammaResistance)*m_dt_s;
normalizedResistance += deltaNormalizedResistance;
GetBaroreceptorResistanceScale().SetValue(normalizedResistance);
//Calculate the normalized change in flow compliance for any cardiovascular compliance
double normalizedCompliance = GetBaroreceptorComplianceScale().GetValue();
double tauCompliance_s = m_data.GetConfiguration().GetVenousComplianceDistributedTimeDelay(TimeUnit::s);
double deltaNormalizedCompliance = (1.0 / tauCompliance_s)*(-normalizedCompliance + m_NormalizedAlphaCompliance*parasympatheticFraction + m_NormalizedGammaCompliance)*m_dt_s;
double deltaNormalizedCompliance = m_BaroreceptorEffectivenessParameter * (1.0 / tauCompliance_s)*(-normalizedCompliance + m_NormalizedAlphaCompliance*parasympatheticFraction + m_NormalizedGammaCompliance)*m_dt_s;
normalizedCompliance += deltaNormalizedCompliance;
GetBaroreceptorComplianceScale().SetValue(normalizedCompliance);
#ifdef VERBOSE
......
......@@ -47,7 +47,9 @@ protected:
double m_BaroreceptorActiveTime_s;
double m_BaroreceptorMeanArterialPressureBaseline_mmHg;
double m_TotalSympatheticFraction;
bool m_BaroreceptorSaturationStatus;
double m_BaroreceptorSaturationTime_s;
double m_BaroreceptorEffectivenessParameter;
// Stateless member variable (Set in SetUp())
bool m_FeedbackActive; // An overall flag used to turn off baro/chemo receptors during stabilization
......
{
"Name": "HemorrhageClass4NoFluidLongTerm",
"Description": "",
"Name": "HemorrhageToShock",
"Description": "Greater than 40% blood loss with no intervention.",
"StartType":
{
"PatientConfiguration": {
"PatientFile": "StandardMale.json"
"PatientFile": "StandardMaleIncreaseBV.json"
}
},
"DataRequestManager":
......@@ -24,13 +24,15 @@
{ "DecimalFormat": { "Precision": 3 }, "Category": "Physiology", "PropertyName": "TidalVolume", "Unit": "mL" },
{ "DecimalFormat": { "Precision": 2 }, "Category": "Physiology", "PropertyName": "RespirationRate", "Unit": "1/min" },
{ "DecimalFormat": { "Precision": 3 }, "Category": "Physiology", "PropertyName": "OxygenSaturation", "Unit": "unitless" },
{ "DecimalFormat": { "Precision": 3 }, "Category": "Physiology", "PropertyName": "BloodPH", "Unit": "unitless" },
{ "DecimalFormat": { "Precision": 4 }, "Category": "LiquidCompartment", "CompartmentName": "VenaCava", "SubstanceName": "Lactate", "PropertyName": "Concentration", "Unit": "ug/mL" },
{ "DecimalFormat": { "Precision": 4 }, "Category": "LiquidCompartment", "CompartmentName": "MyocardiumVasculature", "SubstanceName": "Oxygen", "PropertyName": "PartialPressure", "Unit": "mmHg" },
{ "DecimalFormat": { "Precision": 4 }, "Category": "LiquidCompartment", "CompartmentName": "BrainVasculature", "SubstanceName": "Oxygen", "PropertyName": "PartialPressure", "Unit": "mmHg" },
{ "DecimalFormat": { "Precision": 4 }, "Category": "LiquidCompartment", "CompartmentName": "MyocardiumVasculature", "PropertyName": "InFlow", "Unit": "mL/min" },
{ "DecimalFormat": { "Precision": 4 }, "Category": "LiquidCompartment", "CompartmentName": "BrainVasculature", "PropertyName": "InFlow", "Unit": "mL/min" },
{ "DecimalFormat": { "Precision": 3 }, "Category": "Physiology", "PropertyName": "SystemicVascularResistance", "Unit": "mmHg s/mL"}
{ "DecimalFormat": { "Precision": 3 }, "Category": "Physiology", "PropertyName": "SystemicVascularResistance", "Unit": "mmHg s/mL"}
]
},
"AnyAction": [{
......@@ -70,7 +72,7 @@
"AdvanceTime": {
"Time": {
"ScalarTime": {
"Value": 800.0,
"Value": 1500.0,
"Unit": "s"
}
}
......@@ -101,7 +103,7 @@
"AdvanceTime": {
"Time": {
"ScalarTime": {
"Value": 500.0,
"Value": 200.0,
"Unit": "s"
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment