1. Blood loss simulation

In this simulation, we will see how the physiological variable is affected by a blood loss of 20% of the total blood volume. The inputs drug rates will remain constant.

[13]:
import matplotlib.pyplot as plt
import python_anesthesia_simulator as pas

1.1. Definition of the patient simulation

In this cell, a class instance of the simulator is created and initialized at maintenance phase.

Then the rate of the blood loss and fluid replacement are detailled.

[14]:
ts = 5 # time step in seconds
age, height, weight, sex = 74, 164, 88, 1
George = pas.Patient([age, height, weight, sex], ts=ts,
                           model_propo="Eleveld", model_remi="Eleveld", co_update=True)

simulator = pas.Simulator(
    George,
    tci_propo='Effect_site',
    tci_remi='Effect_site',
)
target_remi = 2 # target remifentanil concentration (ng/ml)
target_propo = 4 # target propofol concentration (ug/ml)

# details of the blood loss
start_bleeding_time = 20 # 20 minute
blood_loss = 0.3 # 10% blood loss
blood_loss_time = 1 # 1 minute
bleeding_rate = George.blood_volume*blood_loss*1000/blood_loss_time # blood loss rate (ml/min)
# details of the fluid replacement
start_transfusion_time = start_bleeding_time + 5 # 25 minutes
transfusion_time = 10 # 10 minutes
transfusion_rate = George.blood_volume*blood_loss*1000/transfusion_time # fluid replacement rate (ml/min)

1.2. Simulation

[16]:
N_simu = int(60 * 60/ts) # 30 minutes simulation
for index in range(N_simu):
    if index*ts/60 > start_bleeding_time and index*ts/60 < start_bleeding_time+blood_loss_time:
        blood_rate = - bleeding_rate
    elif index*ts/60 > start_transfusion_time and index*ts/60 < start_transfusion_time+transfusion_time:
        blood_rate = transfusion_rate
    else:
        blood_rate = 0
    simulator.one_step(
        input_propo=target_propo,
        input_remi=target_remi,
        blood_rate=blood_rate,
    )

1.3. Results

[17]:
# plot concentration of propofol, remifentanil and norepinephrine
fig, ax = plt.subplots(2, figsize=(10, 5))
Time = simulator.dataframe['Time']/60
ax[0].plot(Time, simulator.dataframe['blood_volume'])
ax[0].set_ylabel("Blood_volume (L)")
ax[0].grid()
ax[1].plot(Time, simulator.dataframe['x_propo_4'], label="Propofol")
ax[1].plot(Time, simulator.dataframe['x_remi_4'], label="Remifentanil")
# ax[1].plot(Time, simulator.dataframe['x_nore_1'], label="Norepinephrine")
# ax[1].set_ylim(0, 10)
ax[1].set_ylabel("Blood Concentration")
ax[1].set_xlabel("Time (min)")
plt.legend()
plt.grid()
plt.show()
../_images/examples_blood_loss_simu_7_0.png
[18]:
# plot bis, map and co
fig, ax = plt.subplots(4, figsize=(10, 10))
ax[0].plot(Time, simulator.dataframe['blood_volume'])
ax[0].set_ylabel("Blood_volume (L)")
ax[0].grid()
ax[1].plot(Time, simulator.dataframe['BIS'])
ax[1].set_ylabel("BIS")
ax[1].grid()
ax[2].plot(Time, simulator.dataframe['MAP'], label="MAP")
ax[2].plot(Time, simulator.dataframe['CO']*10, label="CO (x10)")
ax[2].set_ylabel("MAP and CO")
ax[2].grid()
ax[2].legend(loc="upper right")
ax[3].plot(Time, simulator.dataframe['HR'], label="HR")
ax[3].plot(Time, simulator.dataframe['SV'], label="SV")
ax[3].plot(Time, simulator.dataframe['TPR']*4000, label="TPR (x4000)")
ax[3].set_ylabel("other hemo")
ax[3].set_xlabel("Time (min)")
# ax[2].set_xlim([30,50])
# ax[2].set_ylim((30,60))
plt.legend(loc="upper right")
plt.grid()
plt.show()

../_images/examples_blood_loss_simu_8_0.png

Here 5 phases can be distinguished:

  • Induction phase: the patient is induced with propofol and remifentanil

  • Bleeding phase: the patient loses blood

  • Maintenance phase: No fluid management but low blood volume

  • Transfusion phase: the patient receives blood

  • Recovery phase: No fluid management, normal blood volume right after the transfusion

During the bleeding phase, the patient loses blood and the blood volume decreases. The BIS decrease because the propofol sensitivity of the patient increase.
MAP and CO decrease as well due to the assumption of direct proportionality between blood volume and stroke volume.

During the maintenance phase, the concentration of all drugs increase because of the low blood volume and the constant drug rate, thus BIS decrease. Due to the compensatory mecanisme of the hemodynamic HR and TPR increase which lead to a MAP increasing and a constant CO.

During the transfusion phase, the blood volume increases. The BIS increase because the propofol sensitivity of the patient decrease. MAP and CO increase as well due to the assumption of direct proportionality between blood volume and stroke volume.

During the recovery phase, the concentration of all drugs decrease because of the higher blood volume and the constant drug rate. Thus all the variable return to their initial value.