# PD parameter effects

**URL:** https://discourse.kitware.com/t/pd-parameter-effects/1319
**Category:** Pulse Physiology Engine
**Created:** [June 27, 2024, 2:28pm UTC](https://discourse.kitware.com/t/pd-parameter-effects/1319 "2024-06-27T14:28:17Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![Yiwen\_Hu](https://discourse.kitware.com/user_avatar/discourse.kitware.com/yiwen_hu/32/889_2.png) [@Yiwen\_Hu](https://discourse.kitware.com/u/Yiwen_Hu)
#### Post date: [June 27, 2024, 2:28pm UTC](https://discourse.kitware.com/t/pd-parameter-effects/1319/1 "2024-06-27T14:28:17Z")

</div>

Hi, I am still experimenting Propofol infsion with Pulse Physiology Engine. I try to understand the effect of each PD parameters, so I changed one PD parameters at once. However, I observe the following phenomenem. For example, I changed the DiastolicPressureModifier, but all the vital signs output, including heart rate and systolic pressure change. I wonder if that is expected(probably stablizing the patient?), and why it happens? Could you point me to the base code that does this stablizing?

This is the plot where I modified the DiastolicPressureModifier. The baseline is -0.1.

 ![dia](https://discourse.kitware.com/uploads/default/original/1X/41f35140bf440103e044856ae0c871884b20374a.png)

Thank you very much!  
Shawn

---

<div class="post-metadata">

### Author: ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)
#### Post date: [June 27, 2024, 2:58pm UTC](https://discourse.kitware.com/t/pd-parameter-effects/1319/2 "2024-06-27T14:58:08Z")

</div>

Yes, this is expected.  
Pulse is a mechanistic system, so if you modify one thing, it will have down stream effects to the system

Take a look at the [`HeartDriver`](https://gitlab.kitware.com/physiology/engine/-/blob/integration/src/cpp/engine/common/system/physiology/CardiovascularModel.cpp?ref_type=heads#L2361), `BeginDriverCycle`, `CalculateHeartElastance` and [`AdjustVascularTone`](https://gitlab.kitware.com/physiology/engine/-/blob/integration/src/cpp/engine/common/system/physiology/CardiovascularModel.cpp?ref_type=heads#L2610) (where drugs are applied)

The translation of the [drug effects to the cardiovascular system is here](https://gitlab.kitware.com/physiology/engine/-/blob/integration/src/cpp/engine/common/system/physiology/DrugModel.cpp?ref_type=heads#L515)

---

<div class="post-metadata">

### Author: ![Yiwen\_Hu](https://discourse.kitware.com/user_avatar/discourse.kitware.com/yiwen_hu/32/889_2.png) [@Yiwen\_Hu](https://discourse.kitware.com/u/Yiwen_Hu)
#### Post date: [June 27, 2024, 3:59pm UTC](https://discourse.kitware.com/t/pd-parameter-effects/1319/3 "2024-06-27T15:59:23Z")

</div>

Thanks for your reply!

Just here to check my understanding. It seems that `HeartDriver()` is called every timestep in the `PreProcess()`, and `BeginDriverCycle` , `CalculateHeartElastance` and `AdjustVascularTone` are called in the `HeartDriver()`. In `HeartDriver`, the heart rate and elastance, and vascular resistance and compliance will be modified based on the drug effect (which I think based mostly on the change in heart rate and mean blood pressure). Then `CalculateVitalSigns()` computes the vital signs. So the calculated change in diastolic and systolic pressure (`deltaDiastolicBP_mmHg` in `DrugModel.cpp`) are not directly applied to the vital signs?

Many thanks,  
Shawn

---

<div class="post-metadata">

### Author: ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)
#### Post date: [June 27, 2024, 4:08pm UTC](https://discourse.kitware.com/t/pd-parameter-effects/1319/4 "2024-06-27T16:08:09Z")

</div>

That is correct

By applying the delta modifiers to the heart, the circuit calculates the new volumes, pressures, and flows per those adjustments by advancing time 0.02s on the circuit, and the new volume, pressue, flow values are used to calculate clinical vital sign values.

I pointed you to the integration branch  
Now that you have looked at that, take a look at the latest and greatest updates here:  
[https://gitlab.kitware.com/physiology/engine/-/blob/feature/ventilator\_updates/src/cpp/engine/common/system/physiology/CardiovascularModel.cpp?ref\_type=heads#L2612](https://gitlab.kitware.com/physiology/engine/-/blob/feature/ventilator_updates/src/cpp/engine/common/system/physiology/CardiovascularModel.cpp?ref_type=heads#L2612)

This branch is providing a finer adjustment of the circuit for pressure based modifiers

We are about to merge this branch into integration.

---

<div class="post-metadata">

### Author: ![Yiwen\_Hu](https://discourse.kitware.com/user_avatar/discourse.kitware.com/yiwen_hu/32/889_2.png) [@Yiwen\_Hu](https://discourse.kitware.com/u/Yiwen_Hu)
#### Post date: [June 27, 2024, 6:09pm UTC](https://discourse.kitware.com/t/pd-parameter-effects/1319/5 "2024-06-27T18:09:40Z")

</div>

Thanks!

The functions `HeartDriver()`, `BeginDriverCycle`, `CalculateHeartElastance` and `AdjustVascularTone`, look the same though. Am I looking at the right functions? Probably you changed the other parts?

---

<div class="post-metadata">

### Author: ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)
#### Post date: [June 27, 2024, 6:26pm UTC](https://discourse.kitware.com/t/pd-parameter-effects/1319/6 "2024-06-27T18:26:42Z")

</div>

You are right, we did rebase integration on this branch, the current updates are only for cardiovascular effects related to pulmonary injury, sorry for the confusion

So you can see how systolic and diastolic PD modifiers are combined into a Mean Pressure modifers in `Drugs::CalculateDrugEffects` which is then used in the `Cardiovascular::AdjustVascularTone` method is where modifiers are applied to systemic vascular resistances

---

<div class="post-metadata">

### Author: ![Yiwen\_Hu](https://discourse.kitware.com/user_avatar/discourse.kitware.com/yiwen_hu/32/889_2.png) [@Yiwen\_Hu](https://discourse.kitware.com/u/Yiwen_Hu)
#### Post date: [June 27, 2024, 8:10pm UTC](https://discourse.kitware.com/t/pd-parameter-effects/1319/7 "2024-06-27T20:10:14Z")

</div>

Thanks! I get a better understanding of the drug effects in Pulse engine now!  
I have another question about the output vital signs. They seem to remain the same for every 0.96 second. I wonder if you have done any quantization to the vital signs?

---

<div class="post-metadata">

### Author: ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)
#### Post date: [June 27, 2024, 8:15pm UTC](https://discourse.kitware.com/t/pd-parameter-effects/1319/8 "2024-06-27T20:15:37Z")

</div>

Some of the clinical values only get updated at the end of a cardiac cycle in the [`RecordAndResetCardiacCycle`](https://gitlab.kitware.com/physiology/engine/-/blob/integration/src/cpp/engine/common/system/physiology/CardiovascularModel.cpp?ref_type=heads#L1336) method

---

<div class="post-metadata">

### Author: ![Yiwen\_Hu](https://discourse.kitware.com/user_avatar/discourse.kitware.com/yiwen_hu/32/889_2.png) [@Yiwen\_Hu](https://discourse.kitware.com/u/Yiwen_Hu)
#### Post date: [June 27, 2024, 8:34pm UTC](https://discourse.kitware.com/t/pd-parameter-effects/1319/9 "2024-06-27T20:34:36Z")

</div>

Ah, I see the method is called only in `BeginDriverCycle`. I see now. For example, ArterialPressureis updated in the `CalculateVitalSigns`, so it’s updated time to time. Diastolic and systolic pressure, and heart rate are only updated in `RecordAndResetCardiacCycle`, so they are updated every cycle.

---

<div class="post-metadata">

### Author: ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)
#### Post date: [June 27, 2024, 8:42pm UTC](https://discourse.kitware.com/t/pd-parameter-effects/1319/10 "2024-06-27T20:42:38Z")

</div>

Yeah, at 60 bpm = per second, higher heart rate, more frequent the update is

---

<div class="post-metadata">

### Author: ![Yiwen\_Hu](https://discourse.kitware.com/user_avatar/discourse.kitware.com/yiwen_hu/32/889_2.png) [@Yiwen\_Hu](https://discourse.kitware.com/u/Yiwen_Hu)
#### Post date: [June 29, 2024, 7:19pm UTC](https://discourse.kitware.com/t/pd-parameter-effects/1319/11 "2024-06-29T19:19:40Z")

</div>

Hi,

I’m wondering when is this aorta pressure calculated. I can see that it’s in the compliance and resistance path. Is it the CircuitCalculator that’s doing the job? May I ask if you can point me to the code? I guess it’s modeled as potential?

Aorta pressure code: [https://gitlab.kitware.com/physiology/engine/-/blob/integration/src/cpp/engine/common/system/physiology/CardiovascularModel.cpp?ref\_type=heads#L1099](https://gitlab.kitware.com/physiology/engine/-/blob/integration/src/cpp/engine/common/system/physiology/CardiovascularModel.cpp?ref_type=heads#L1099)

Thank you so much!  
Shawn

---

<div class="post-metadata">

### Author: ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)
#### Post date: [July 1, 2024, 12:48pm UTC](https://discourse.kitware.com/t/pd-parameter-effects/1319/12 "2024-07-01T12:48:17Z")

</div>

Yes, the circuit calculator computes the pressure, the process [starts here](https://gitlab.kitware.com/physiology/engine/-/blob/integration/src/cpp/engine/common/system/physiology/CardiovascularModel.cpp?ref_type=heads#L1060), and is [done by code here](https://gitlab.kitware.com/physiology/engine/-/blob/integration/src/cpp/cdm/circuit/SECircuitCalculator.cpp?ref_type=heads#L84). You can learn more about [it here](https://pulse.kitware.com/_circuit_methodology.html) and [here](https://ieeexplore.ieee.org/abstract/document/10155226)
