# Building BiPAP Machine

**URL:** https://discourse.kitware.com/t/building-bipap-machine/1188
**Category:** Pulse Physiology Engine
**Created:** [January 12, 2024, 3:41pm UTC](https://discourse.kitware.com/t/building-bipap-machine/1188 "2024-01-12T15:41:11Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![NucleusDev](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/n/ba8739/32.png) [@NucleusDev](https://discourse.kitware.com/u/NucleusDev)
#### Post date: [January 12, 2024, 3:41pm UTC](https://discourse.kitware.com/t/building-bipap-machine/1188/1 "2024-01-12T15:41:12Z")

</div>

While making the Mechanical Ventilator with BiPAP Mode i came across a few variables that might conflict each other. Additionally I was wondering since the BiPAP is a non invasive ventilator,

1. does pulse account for the dead space in the mask.
2. and the pressure and volume loss due to the mask ?

What parameters would be ideal to expose to the user when making the BiPAP Mode.

Would i need to par it with a simple mask to simulate the mask of the BiPAP Machine

---

<div class="post-metadata">

### Author: ![coolwebb](https://discourse.kitware.com/user_avatar/discourse.kitware.com/coolwebb/32/25_2.png) [@coolwebb](https://discourse.kitware.com/u/coolwebb)
#### Post date: [January 15, 2024, 6:29pm UTC](https://discourse.kitware.com/t/building-bipap-machine/1188/2 "2024-01-15T18:29:21Z")

</div>

A good resource for understanding the ventilator configuration settings is the online [documentation](https://pulse.kitware.com/_mechanical_ventilator_methodology.html).

Probably the easiest way to simulate a BiPAP machine is to use the CPAP mode and set the _PositiveEndExpiredPressure_ to the EPAP value and the _DeltaPressureSupport_ value to your IPAP-EPAP value. You can see an example of these settings in [HowTo-MechanicalVentilator.cpp](https://gitlab.kitware.com/physiology/engine/-/blob/integration/src/cpp/howto/HowTo-MechanicalVentilator.cpp?ref_type=heads) and looks like this:

```auto
  SEMechanicalVentilatorContinuousPositiveAirwayPressure cpap;
  cpap.SetConnection(eSwitch::On);
  cpap.SetInspirationWaveform(eDriverWaveform::Square);
  cpap.GetDeltaPressureSupport().SetValue(10.0, PressureUnit::cmH2O);
  cpap.GetPositiveEndExpiredPressure().SetValue(5.0, PressureUnit::cmH2O);

```

The CPAP model automatically maps to _SEMechanicalVentilatorConfiguration_ parameters. You can use the _ToSettings_ method to expose all configuration settings.

> 1. does pulse account for the dead space in the mask.
> 2. and the pressure and volume loss due to the mask ?

Pulse does account for those things. The dead space can be changed with the _ConnectionVolume_ setting. You can modify air escaping by using the _MechanicalVentilatorLeak_ action, which is also shown in the [HowTo-MechanicalVentilator.cpp](https://gitlab.kitware.com/physiology/engine/-/blob/integration/src/cpp/howto/HowTo-MechanicalVentilator.cpp?ref_type=heads) example.

> What parameters would be ideal to expose to the user when making the BiPAP Mode.

I think the existing CPAP mode probably has the standard parameters you would want.

> Would i need to par it with a simple mask to simulate the mask of the BiPAP Machine

No. It will assume the mask is being used with the ventilator if you don’t explicitly set the intubate action.
