Cardiac_output-Simple_Model_01_01

Cardiac_output-Simple_Model_01_01 preview image

1 collaborator

Tags

Visible to everyone | Changeable by everyone
Model was written in NetLogo 6.0.3 • Viewed 544 times • Downloaded 23 times • Run 0 times
Download the 'Cardiac_output-Simple_Model_01_01' 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:
  count-down               ;; timer for the cardiac driving function
  tve                      ;; the time varying elastance
  list-p                   ;; the list for turtles coordinates (pressure)
  list-v                   ;; the list for turtles coordinates (volume)
  HR-f                     ;; factor for 'balancing' heart rate and dt
  k                        ;; scalar  accountable for some extracardiac influence
  axis                     ;; coordinate system
  LV-PV-loop-color         ;; color of the pressure-volume diagram
 ]

to setup

  ca

  if (scenario = "Normal") ;; setting parameters for "Normal" 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 1000
   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 Aortic-stenosis? false
   set Mitral-stenosis? false
   set Heart-Rate 70
   set LV-PV-loop-color 55
  ]

   if (scenario = "Test")
  [ set LV-PV-loop-color 15]

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

  system-dynamics-setup

                                                          ;; setting the lists to be used for turtles x-coordinates
  set list-p []
  set list-v []

  create-axis                                             ;; setting coordinates system

                                                          ;; seting parameters values for different "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]

   if (scenario = "Test") and (Aortic-stenosis? = true)
  [set R_ao 0.036]


   if (scenario = "Test") and (Mitral-stenosis? = true)
  [set R_mt 0.032]

  set HR-f round (( 60 / Heart-rate) * 1000)                                    ;; setting HR-f

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

  reset-ticks
end 

to create-axis                                                                  ;; creating coordinates system
  ask patches with [ pxcor = 0 ] [ set pcolor white ]
  ask patches with [ pycor = 0 ] [ set pcolor white ]

   ask patch -4 -4
  [ set plabel "0"
    set plabel-color white ]
  ask patch 50 190
  [ set plabel "Pressure mmHg"
    set plabel-color white
    ]
  ask patch 190 7
  [ set plabel "Volume ml"
    set plabel-color white
   ]

 ask patch -4 100
  [ set plabel "100"
    set plabel-color white
   ]

 ask patch -4 20
  [ set plabel "20"
    set plabel-color white
   ]

  ask patch -4 40
  [ set plabel "40"
    set plabel-color white
   ]

  ask patch -4 60
  [ set plabel "60"
    set plabel-color white
   ]

  ask patch -4 80
  [ set plabel "80"
    set plabel-color white
   ]

  ask patch -4 120
  [ set plabel "120"
    set plabel-color white
   ]

  ask patch -4 140
  [ set plabel "140"
    set plabel-color white
   ]

  ask patch -4 160
  [ set plabel "160"
    set plabel-color white
   ]

  ask patch -4 180
  [ set plabel "180"
    set plabel-color white
   ]

   ask patch 50 -7
  [ set plabel "50"
    set plabel-color white ]

   ask patch 100 -7
  [ set plabel "100"
    set plabel-color white ]

   ask patch 150 -7
  [ set plabel "150"
    set plabel-color white ]
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]

  activate                                              ;; activating the cardiac driving function

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

  create-list-v                              ;; generating coordinates for turtles coordinates as lists
  create-list-p

  if ticks > 15000
  [ create-turtles 1 [                       ;; creating a turtle every iteration/tick
    set color LV-PV-loop-color               ;; and ploting it according to the coordinates
    set shape "circle"                       ;; as values in the respective lists
    set size 1.0
    set xcor (last list-v)
    set ycor (last list-p)
    ]
  ]

  if (Scenario = "Normal") and ticks > 20000  ;; a stop command once the model reaches 20000 ticks and scenario = "Normal"
  [export-view "Norma1.png"                   ;; exporting the 'normal' pressure-volume diagram to be imported for comparison
  stop]                                       ;; as needed

  tick
end 

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

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

to-report result-v                            ;; generating lists with turtles coordinates
  report V_lv
end 

to-report result-p
  report P_lv
end 

to  Compare-N-PV-loops                         ;; importing the 'normal' PV-diagram
  import-drawing "Norma1.png"
end 

                                               ;; building up lists with turtles coordinates

to create-list-v
  if ticks > 15000
  [set list-v lput result-v list-v]
end 

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

to reset-test                                  ;; reseting initial condition in the "Test" mode = same parameters as in "Normal" 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 1000
   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 70
   set Aortic-stenosis? false
   set Mitral-stenosis? false
end 

to export-image                                 ;; exporting the world view to be used for comparison
  export-view user-new-file
end 

There is only one version of this model, created over 6 years ago by Victor Iapascurta.

Attached files

File Type Description Last updated
Cardiac_output-Simple_Model_01_01.png preview Preview for 'Cardiac_output-Simple_Model_01_01' over 6 years ago, by Victor Iapascurta Download

This model does not have any ancestors.

This model does not have any descendants.