Oxygen Delivery to Fetus

Oxygen Delivery to Fetus preview image

1 collaborator

Tags

Visible to everyone | Changeable by the author
Model was written in NetLogo 6.2.0 • Viewed 64 times • Downloaded 4 times • Run 0 times
Download the 'Oxygen Delivery to Fetus' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


Info tab cannot be displayed because of an encoding error

Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

globals [                  ;; setting the globals for the model functioning:
  F_count-down             ;; timer for the foetal cardiac driving function
  count-down               ;; timer for the maternal cardiac driving function
  F_tve                    ;; the foetal time varying elastance
  tve                      ;; the maternal time varying elastance
  F_list-p                 ;; the list for pressure values / foetus
  F_list-v                 ;; the list for volume values / foetus
  list-p                   ;; the list for pressure values / mother
  list-v                   ;; the list for volume values / mother

  HR-f                     ;; factor for 'balancing' heart rate and dt
  F_HR-f
  k                        ;; scalar  accountable for some extracardiac influence

 ]

breed [ m-erythrocytes m-erythrocyte ]
breed [ f-erythrocytes f-erythrocyte ]
breed [o-molecules o-molecule]
breed [cd-molecules cd-molecule]

patches-own                ;; property of patches to form physiological space zones
[
  membrane
]

to setup

  ca

  if (scenario = "Normal/Test")    ;; setting parameters for "Normal/Test" scenario
  [
   set E_v 0.0059
   set E_ao 0.6913
   set V0_lv 0
   set Vd_lv 0
   set P0_lv 0.1203
   set V_AO 50
   set V_LV 130
   set V_V 1300
   set R_mt 0.0158
   set R_ao 0.018
   set R_sys 1.0889
   set E_es_lv 2.8798
   set Lambda_lv 0.033
   set Preload_Volume-Status "Normal"
   set Afterload_Vascular-Resistance-sys "Normal-VR"
   set Myocardial-Contractility "Normal-contractility"
   set Vascular-Elastance-sys "Normal"

   set Heart-Rate 90
   set Hb_m-slider 120
   set Sa_m_O2-slider 0.95

   set PS 0.2
   set Vol_PL_f-slider 0.14
   set Vol_PL_m-slider 0.15


   set F_E_v 0.04
   set F_E_ao 4.351
   set F_V0_lv 0
   set F_Vd_lv 0
   set F_P0_lv 0.1203
   set F_V_AO 9
   set F_V_LV 4
   set F_V_V 225
   set F_R_mt 0.096
   set F_R_ao 0.138
   set F_R_sys 2.89
   set F_E_es_lv 2.8798
   set F_Lambda_lv 0.033

   set F_Heart-Rate 135
   set Hb_f-slider 170
   set Sa_f_O2-slider 0.51

  ]



  set count-down 0                       ;; initialising the timer and tve
  set tve 0

  set F_count-down 0
  set F_tve 0

  system-dynamics-setup

                                         ;; setting lists for volume and pressure parameters/mother and fetus
  set list-p []
  set list-v []

  set F_list-p []
  set F_list-v []

   create-m-erythrocytes 15              ;; creating RBC with respective properties
   ask m-erythrocytes
  [
    move-to one-of patches with [pxcor < 15 and pxcor > 2]
   set ycor random-ycor
   set color pink
   set size 18
   set shape "erythrocyte"
    set heading 180
  ]

   create-f-erythrocytes 15              ;; creating RBC with respective properties
   ask f-erythrocytes
  [
   move-to one-of patches with [pxcor < 49 and pxcor > 35]
   set ycor random-ycor
   set color pink
   set size 18
   set shape "erythrocyte"
   set heading 0
  ]


   create-cd-molecules 50
   ask cd-molecules
  [
   set ycor random-ycor
   set xcor random-xcor
   set color blue
   set size 4
   set shape "circle 2"
   set heading 270
  ]

   create-o-molecules 150
   ask o-molecules
  [
   set ycor random-ycor
   set xcor random-xcor
   set color red
   set size 4
   set shape "circle 2_w"
   set heading 90
  ]

  ask patches [ setup-membrane ] ;; setting preliminary conditions for the setup of 'extravascular space'
  let maternal-side patches with [pxcor < 15 and pxcor > 2]

                                 ;; seting parameters values for different variants with "Test" scenarios
  if (scenario = "Test") and (Preload_Volume-Status = "Decreased-preload-25%")
  [set V_V 625
   set V_lv 50]

  if (scenario = "Test") and (Preload_Volume-Status = "Decreased-preload-50%")
  [set V_V 250
  set V_lv 35]

  if (scenario = "Test") and (Preload_Volume-Status = "Increased-preload")
  [set V_V 1375]

  if (scenario = "Test") and (Myocardial-Contractility = "Decreased-contractility")
  [set E_es_lv 1.4]

   if (scenario = "Test") and (Myocardial-Contractility = "Increased-contractility")
  [set E_es_lv 4.0]

   if (scenario = "Test") and (Afterload_Vascular-Resistance-sys = "Increased VR X 2.0")
  [set R_sys 2.2]

   if (scenario = "Test") and (Afterload_Vascular-Resistance-sys = "Increased VR X 1.5")
  [set R_sys 1.6]

   if (scenario = "Test") and (Afterload_Vascular-Resistance-sys = "Decreased VR x 1.5")
  [set R_sys 0.67]


   if (scenario = "Test") and (Vascular-Elastance-sys = "Increased-arterial El+50%")
  [set E_ao 1.05]

   if (scenario = "Test") and (Vascular-Elastance-sys = "Decreased-arterial El-50%")
  [set E_ao 0.35]

   if (scenario = "Test") and (Vascular-Elastance-sys = "Increased-venous El+50%")
  [set E_v 0.009]

   if (scenario = "Test") and (Vascular-Elastance-sys = "Decreased-venous El-25%")
  [set E_v 0.0045]


  set HR-f round (( 90 / Heart-rate) * 1000)                                    ;; setting HR-f
  set F_HR-f round (( 60 / F_Heart-Rate) * 1000)

  set k (Heart-rate * 0.015)                                                    ;; setting the k-scalar

  if (scenario = "Maternal anemia")
  [ reset-test
    set Hb_m-slider 101
  ]

  if (scenario = "Abruptio placentae")
  [ reset-test]

  if (scenario = "Uterine contractions")
  [ reset-test]

  if (scenario = "Complex pathology")
  [ reset-test
    set Hb_m-slider 110
    set E_es_lv 1.4
    set Myocardial-Contractility "Decreased-contractility"
  ]

   if (scenario = "Anesthesia")
  [ reset-test
    set E_es_lv 2.4
    set E_v 0.005
  ]

  reset-ticks
end 

to setup-membrane

  ask patches with [pxcor = 25]
    [set pcolor gray]
  ask patches with [pxcor = 26]
    [set pcolor red]
end 

to go

  set count-down count-down + 1             ;; starting the timer which governs the cardiac driving function
  if count-down = HR-f
  [reset-count-down]

  set F_count-down F_count-down + 1         ;; starting the timer which governs the cardiac driving function
  if F_count-down = F_HR-f
  [reset-F_count-down]

 if ticks <= 2 [
   set list-p list (100) (101)
   set list-v list (102) (103)

   set F_list-p list (60) (61)
   set F_list-v list (23) (24)
  ]

  activate                                   ;; activating the cardiac driving function
  F_activate

  system-dynamics-go
  system-dynamics-do-plot

  create-list-v
  create-list-p
                                              ;; setting lists for volume and pressure values
  create-F_list-v                             ;; in mother and fetus
  create-F_list-p

  ask m-erythrocytes
    [ fd 0.05]
  ask f-erythrocytes
    [ fd 0.05]
  ask o-molecules
    [ fd 0.1]
  ask cd-molecules [fd 0.1]

 if (Scenario = "Maternal anemia") and ticks >= 13000 and ticks < 15000    ;; simulating a more sever maternal anemia while "Maternal anemia" scenario is running
  [set  Hb_m-slider 90 ]

 if (Scenario = "Maternal anemia") and ticks >= 15000     ;; adding to the maternal anemia a fetal anemia
  [set  Hb_f-slider 150 ]

 if (Scenario = "Abruptio placentae") and ticks >= 12000 and ticks < 13500 ;; simulating first step of abruptio placentae
  [
    set  Hb_m-slider 110
    set Vol_Pl_m-slider 0.2
    set Vol_Pl_f-slider 0.2
    set F_Heart-rate 145
    ask patches [set pcolor 12]
  ]

  if (Scenario = "Abruptio placentae") and ticks >= 13500  ;; simulating second step of abruptio placentae
  [
    set  Hb_m-slider 100
    set Vol_Pl_m-slider 0.5
    set Vol_Pl_f-slider 0.5
    set PS 2
    set E_v 0.0061
    set E_ao 0.5
    set F_Heart-rate 120
    ask o-molecules [die]
  ]

   if (Scenario = "Abruptio placentae") and ticks >= 17000
  [stop]

   if (scenario = "Uterine contractions") and ticks >= 12000 and ticks < 13000       ;; simulating periodic uterine contractions
  [
    set PS 7
  ]

  if (scenario = "Uterine contractions") and ticks >= 13000
  [
    set PS 0.1
  ]

   if (scenario = "Uterine contractions") and ticks >= 15000
  [
    stop
  ]

   if (scenario = "Complex pathology") and ticks >= 14000 and ticks < 15000          ;; simulating a uterine contraction under this scenario
  [
    set PS 7
  ]

   if (scenario = "Complex pathology") and ticks >= 15000
  [
    set PS 0.2
  ]

   if (scenario = "Complex pathology") and ticks >= 17000
  [
    stop
  ]

    if (scenario = "Anesthesia") and ticks >= 11000          ;; simulating the effect of anesthesia on different parameters
  [
    ask patches [
    set pcolor grey]
    set PS 0.5
  ]

     if (scenario = "Anesthesia") and ticks >= 11500 and ticks < 13000  ;; simulating uterine contaction under this scenario
  [
    set PS 3
  ]

  if (scenario = "Anesthesia") and ticks >= 13000
  [
    set PS 0.2
  ]

   if (scenario = "Anesthesia") and ticks >= 15000
  [
    stop
  ]

  tick
end 

to activate                                 ;; activation of the cardiac driving function and tve in mother
  ifelse count-down <= 500
  [set tve e ^ (-80 * ( count-down * 0.001 - 0.27 ) ^ 2)]
  [set tve 0]
end 

to F_activate                                ;; activation of the cardiac driving function and tve in fetus
  ifelse F_count-down <= 500
  [set F_tve e ^ (-80 * ( F_count-down * 0.001 - 0.27 ) ^ 2)]
  [set F_tve 0]
end 

to reset-count-down                           ;; reseting the timer for a new cardiac cycle (mother)
  set count-down 0
end 

to reset-F_count-down                         ;; reseting the timer for a new cardiac cycle (fetus)
  set F_count-down 0
end 

to-report result-v                            ;; generating lists with volume parameter values/mother
  report V_lv
end 

to-report result-p                            ;; generating lists with pressure parameter values/mother
  report P_lv
end 

to-report F_result-v                           ;; generating lists with volume parameter values/fetus
  report F_V_lv
end 

to-report F_result-p                           ;; generating lists with pressure parameter values/fetus
  report F_P_lv
end 

                                               ;; building up lists with volume &

to create-list-v                               ;; pressure parmeters values
  if ticks > 6000                              ;; /mother anf fetus
  [set list-v lput result-v list-v]
end 

to create-list-p
  if ticks > 6000
  [set list-p lput result-p list-p]
end 

to create-F_list-v
  if ticks > 6000
  [set F_list-v lput F_result-v F_list-v]
end 

to create-F_list-p
  if ticks > 6000
  [set F_list-p lput F_result-p F_list-p]
end 

to reset-test                                  ;; reseting initial condition in the "Test" mode = same
                                               ;; parameters as originally in "Normal/Test" Scenario
   set E_v 0.0059
   set E_ao 0.6913
   set V0_lv 0
   set Vd_lv 0
   set P0_lv 0.1203
   set V_AO 50
   set V_LV 130
   set V_V 1300
   set R_mt 0.0158
   set R_ao 0.018
   set R_sys 1.0889
   set E_es_lv 2.8798
   set Lambda_lv 0.033
   set Preload_Volume-Status "Normal"
   set Afterload_Vascular-Resistance-sys "Normal-VR"
   set Myocardial-Contractility "Normal-contractility"
   set Vascular-Elastance-sys "Normal"

   set Heart-Rate 90
   set Hb_m-slider 120
   set Sa_m_O2-slider 0.95

   set PS 0.2
   set Vol_PL_f-slider 0.14
   set Vol_PL_m-slider 0.15


   set F_E_v 0.04
   set F_E_ao 4.351
   set F_V0_lv 0
   set F_Vd_lv 0
   set F_P0_lv 0.1203
   set F_V_AO 9
   set F_V_LV 4
   set F_V_V 225
   set F_R_mt 0.096
   set F_R_ao 0.138
   set F_R_sys 2.89
   set F_E_es_lv 2.8798
   set F_Lambda_lv 0.033

   set F_Heart-Rate 135
   set Hb_f-slider 170
   set Sa_f_O2-slider 0.51
end 

There is only one version of this model, created 8 months ago by Victor Iapascurta.

Attached files

File Type Description Last updated
Oxygen Delivery to Fetus.png preview Preview for 'Oxygen Delivery to Fetus' 8 months ago, by Victor Iapascurta Download

This model does not have any ancestors.

This model does not have any descendants.