Blood sugar regulation by the liver and muscle
Model was written in NetLogo 6.2.0
•
Viewed 324 times
•
Downloaded 51 times
•
Run 0 times
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
Comments and Questions
Please start the discussion about this model!
(You'll first need to log in.)
Click to Run Model
;; ;; This model is developed by Dr. Lin Xiang at the University of Kentucky. Contact: lin.xiang@uky.edu ;; ;; If you see this page rather than a "download" button when downloading the model, click the "download" icon ;; in your browser to download this model file. ;; ;; This model is free for classroom or virtual learning or teacher professional development related to STEM education. ;; You are asked to provide citations when using this model in any published work. ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; breed [insulins insulin] breed [glucose a-glucose] breed [gluts glut] breed [I-receptors I-receptor] breed [G-receptors G-receptor] breed [lipids lipid] breed [glucagons glucagon] breed [legends legend] insulins-own [bonding] patches-own[protein] gluts-own[bonding name lock kind] glucose-own [bonding cyto glycogen] I-receptors-own [bonding] G-receptors-own [bonding] glucagons-own [bonding] globals [clock] to-report divider report patches with [pxcor = -6 and pycor > 2 and pycor < 8] end to-report blood-sugar ;all blood sugar level are based on the concentration i.e., glocuse / patch report count glucose with [ycor > 2 and color = white and bonding = 0] * 100 / (count patches with [pycor > 2 and pcolor = 0]) end to-report blood-sugar-l report count glucose with [xcor <= -6 and ycor > 2 and color = white and bonding = 0] * 100 / (count patches with [pxcor <= -6 and pycor > 2 and pcolor = 0]) end to-report blood-sugar-r report count glucose with [xcor > -6 and ycor > 2 and color = white and bonding = 0] * 100 / (count patches with [pxcor > -6 and pycor > 2 and pcolor = 0]) end to-report cyto-glucose-l report count glucose with [xcor <= -6 and ycor < 2 and color = white and bonding = 0 and glycogen = 0] * 100 / (count patches with [pxcor <= -6 and pycor < 2 and pcolor = 0]) end to-report cyto-glucose-r report count glucose with [xcor > -6 and ycor < 2 and color = white and bonding = 0 and glycogen = 0] * 100 / (count patches with [pxcor > -6 and pycor < 2 and pcolor = 0]) end to-report glycogen-level-l report count glucose with [xcor <= -6 and glycogen = 1 and color = 138] end to-report glycogen-level-r report count glucose with [xcor > -6 and glycogen = 1 and color = 138] end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; ;; Main Procedures (SETUP and GO) ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; to setup ;clear-turtles ;clear-patches ca setup-legend ; must be the first line setup-membrane-IR setup-glucose check-glucose-location setup-glut-4 setup-glut-2 setup-g-receptors set-insulin-sensitivity reset-ticks end to go if blood-sugar < 54 [user-message "The average blood sugar level is dangerously low." Stop] adjust-glucose-location check-glucose-location set-insulin-sensitivity setup-insulin setup-glucagon glucose-movement insulin-movement glut-4-movement recover-lipids glucagon-movement glycolysis glycogenesis-glycogenolysis food-intake plot-levels tick end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; ;; Sub-procedures of SETUP ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; to setup-membrane-IR ;make the membrane ask patches with [pycor = 2] [set pcolor 49 ] ; make boundary for the system ask patches with [abs pxcor = max-pxcor or abs pycor = max-pycor] [set pcolor 2] ask patches with [pycor <= min-pycor + 4 ] [set pcolor 2] ask patches with [pxcor = -6] [set pcolor 2] ;add Insulin receptors (I-R) into the membrane ask patches with [pcolor = 49] [ if pxcor = 4 or pxcor = 14 or ;muscle I-R pxcor = -17 or pxcor = -11 ;Liver I-R [set pcolor 123] ] ask patches with [pcolor = 123] [sprout-I-receptors 1 [set color yellow - 2 set size 2.5 set shape "I-R" set bonding 0 ] ] ; add bilayer ask patches with [ pycor = 2 and pcolor = 49] [sprout-lipids 1 [set color 7 set shape "lipid-1" set size 1 set heading 0 set ycor 2]] end to setup-glucose create-glucose round (Starting-Blood-sugar-level * 85 / 100) ;liver side glucose [set color white set shape "glucose" set size 0.75 set bonding 0 set glycogen 0 setxy -7 + random-float -16 2.5 + random-float 5] create-glucose round (Starting-Blood-sugar-level * 145 / 100) ;muscle side glucose [set color white set shape "glucose" set size 0.75 set bonding 0 set glycogen 0 setxy 23 + random-float -28 2.5 + random-float 5] create-glucose round (Starting-cytoplasmic-glucose * 85 / 100) [set color white set shape "glucose" set size 0.75 set bonding 0 set glycogen 0 setxy -7 + random-float -16 1 + random-float -4 ] create-glucose round (Starting-cytoplasmic-glucose * 145 / 100) [set color white set shape "glucose" set size 0.75 set bonding 0 set glycogen 0 setxy 23 + random-float -28 1 + random-float -4 ] create-glucose 400 ;set glycogen [set color 138 set shape "glucose" set size 0.75 set bonding 0 set glycogen 1 setxy (max-pxcor - 1) - random-float ((max-pxcor - 1) * 2) min-pycor + 5 + random-float 0.5] adjust-glucose-location end to adjust-glucose-location ask glucose with [ycor > min-pycor + 4 ] [if pcolor = 2 [ifelse random 2 = 0 [set xcor xcor + 1 ][set xcor xcor - 1 ]]] end to setup-glut-4 create-gluts 1 [set shape "glut" set color 123 set size 1.25 set bonding 2 set name 1 set lock 0 set kind 4 setxy -3 + random -2 -0.75] create-gluts 1 [set shape "glut" set color 123 set size 1.25 set bonding 2 set name 1 set lock 0 set kind 4 setxy 1 + random -2 -1.25] create-gluts 1 [set shape "glut" set color 123 set size 1.25 set bonding 2 set name 1 set lock 0 set kind 4 setxy 6 + random 2 -1] create-gluts 1 [set shape "glut" set color 123 set size 1.25 set bonding 2 set name 2 set lock 0 set kind 4 setxy 10 + random 2 -1.5] create-gluts 1 [set shape "glut" set color 123 set size 1.25 set bonding 2 set name 3 set lock 0 set kind 4 setxy 16 + random 2 -1.25] create-gluts 1 [set shape "glut" set color 123 set size 1.25 set bonding 2 set name 4 set lock 0 set kind 4 setxy 20 + random 2 -0.75] end to setup-glut-2 ask patches with [(pxcor = -22 or pxcor = -14 or pxcor = -8) and pycor = 2 and pcolor = 49] [if any? lipids-here [ask lipids-here [die] sprout-gluts 1 [set shape "glut" set color 86.5 set size 1.25 set kind 2 set heading 0 set bonding 0] ]] end to setup-g-receptors ask patches with [pxcor = -19 and pycor = 2 and pcolor = 49] [if any? lipids-here [ask lipids-here [die] sprout-G-receptors 1 [set shape "g-r" set color 26 set size 3 set heading 0 set bonding 0 setxy -19 2.35] ]] end to setup-glucagon ifelse [pcolor] of divider = 0 [ ;no divider if blood-sugar < 98 [if not any? glucagons with [ycor > 1] [ create-glucagons 10 [ set bonding 0 set shape "glucagon" set size 1.75 set color 64 setxy min-pxcor + 1 + random 5 2.5 + random-float 5]]] if blood-sugar > 103 [if count glucagons != 0 [ask glucagons with [ycor > 0] [die] ] ] ] [;with the divide if blood-sugar-l < 98 [if not any? glucagons with [ycor > 1 and xcor <= -6] [ create-glucagons 10 [ set bonding 0 set shape "glucagon" set size 1.75 set color 64 setxy min-pxcor + 1 + random 5 2.5 + random-float 5]]] if blood-sugar-l > 103 [if count glucagons with [ycor > 1 and xcor <= -6] != 0 [ask glucagons with [ycor > 1 and xcor <= -6] [die] ] ] if blood-sugar-r < 98 [if not any? glucagons with [ycor > 1 and xcor > -6] [ create-glucagons 10 [ set bonding 0 set shape "glucagon" set size 1.75 set color 64 setxy 0.5 + random 20 2.5 + random-float 5]]] if blood-sugar-r > 103 [if count glucagons with [ycor > 1 and xcor > -6] != 0 [ask glucagons with [ycor > 1 and xcor > -6] [die]] ] ] end to setup-insulin ifelse [pcolor] of divider = 0 ;no divider [ if blood-sugar > 140 and Can-produce-insulin? [if not any? insulins with [ycor > 2] [ create-insulins 20 [ set bonding 0 set shape "insulin" set size 2 set color 95 setxy (min-pxcor + 1) + random-float ((max-pxcor - 1) * 2) 2.5 + random-float 5]]] ask insulins with [ycor > -4] [if pcolor = 2 [ifelse random 2 = 0 [set xcor xcor + 1 ][set xcor xcor - 1 ]]] if blood-sugar < 120 [if count insulins != 0 [ask insulins with [ycor > 2] [die]] ] ] ;with the divider [ ;left if blood-sugar-l > 140 and Can-produce-insulin? [if not any? insulins with [ycor > 2 and xcor <= -6] [ create-insulins 10 [ set bonding 0 set shape "insulin" set size 2 set color 95 setxy -7 + random-float -16 2.5 + random-float 5]]] if blood-sugar-l < 120 [if count insulins with [ycor > 2 and xcor <= -6] != 0 [ask insulins with [ycor > 2 and xcor <= -6] [die]] ] ;right if blood-sugar-r > 140 and Can-produce-insulin? [if not any? insulins with [ycor > 2 and xcor > -6] [ create-insulins 10 [ set bonding 0 set shape "insulin" set size 2 set color 95 setxy 23 + random-float -28 2.5 + random-float 5]]] if blood-sugar-r < 120 [if count insulins with [ycor > 2 and xcor > -6] != 0 [ask insulins with [ycor > 2 and xcor > -6] [die]] ] ] end to setup-legend create-legends 13 [set shape "legend"] ask legend 0 [set label "lipids" setxy -13 -4.75 ] create-lipids 1 [set color 7 set shape "lipid-1" set size 0.75 set heading 0 setxy -13 -4.25 ] ask legend 1 [set label "Glucose" setxy -8 -4.75] Create-glucose 1 [set color white set shape "glucose" set size 1.25 set heading 0 set glycogen 2 setxy -8.5 -4.25] ask legend 2 [set label "Glycogen" setxy -2.5 -4.75 ] Create-glucose 2 [set color 138 set shape "glucose" set size 1.25 set glycogen 2 setxy -3 + random-float 0.5 -4.25] ask legend 3 [set label "Glucose Transporter 4" setxy 14 -4.75 ] create-gluts 1 [set shape "glut" set color 126.5 set size 0.75 set heading 0 set bonding 2 set lock 2 setxy 12 -4.25] ask legend 4 [set label "Insulin" setxy -7.8 -7.25 ] create-insulins 1 [ set bonding 0 set shape "insulin" set size 1.25 set color 95 setxy -8 -6.75] ask legend 5 [set label "Insulin" setxy -2.8 -7.15 ] ask legend 6 [set label "Receptor" setxy -2.5 -7.65 ] create-I-receptors 1 [set color yellow set size 0.75 set shape "I-R" setxy -3 -6.5] ask legend 7 [ set label "Glucose Transporter 2" setxy 7 -4.75 ] create-gluts 1 [set shape "glut" set color 86.5 set size 0.75 set heading 0 set bonding 2 setxy 5 -4.25] ask legend 8 [set label "Glucagon" setxy 2.75 -7.25 ] create-Glucagons 1 [set color 64 set shape "Glucagon" set size 1.25 set heading 90 setxy 2.25 -6.75 ] ask legend 9 [set label "Glucagon" setxy 8.5 -7.15 ] ask legend 10 [set label "Receptor" setxy 8.5 -7.65 ] create-G-receptors 1 [set color 26 set shape "g-r" set size 0.75 set heading 90 setxy 8 -6.5 ] ask legend 11 [set label "LIVER" setxy -20.5 -3.5 ] ask legend 12 [set label "MUSCLE" setxy 21 -3.5 ] create-lipids 1 [set color 7 set shape "line" set size 26 set heading 90 setxy 0 -5.75 ] end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; ;; Sub-procedures of GO ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; to glucose-movement ask glucose with [glycogen = 0] [ ifelse bonding = 0 [ if pcolor = 0 [right random 90 left random 90 ;wiggle if [pcolor] of patch-at dx dy = 0 [fd 0.2] ;If nothing is ahead, move forward ] if any? gluts-on patch-ahead 1 [ let my-channel one-of gluts-on patch-ahead 1 if [bonding] of my-channel = 0 [ set color red move-to my-channel set bonding 1 ask my-channel [set bonding 1 ifelse kind = 2 [set color 85][set color 127.5]]]]] [ifelse xcor <= -6 [ifelse blood-sugar-l > cyto-glucose-l [set heading 180 fd 0.1] [set heading 0 fd 0.1] if pcolor = 0 [set bonding 0 set color white]] [ifelse blood-sugar-r > cyto-glucose-r [set heading 180 fd 0.2] [set heading 0 fd 0.2] if pcolor = 0 [set bonding 0 set color white]] ] ] ask gluts with [bonding = 1] [if count glucose-here = 0 [set bonding 0 ifelse kind = 2 [set color 86.5][set color 126.5]]] end to check-glucose-location ;detemine glucose location ask glucose [ifelse ycor > 2 [set cyto 0][set cyto 1]] end to insulin-movement ask insulins with [ycor > 2] [if bonding = 0 [ if pcolor = 0 [right random 90 left random 90 ;wiggle if [pcolor] of patch-at dx dy = 0 [fd 0.2] ] if any? I-receptors in-radius 3 with [bonding = 0] [ let my-receptor one-of I-receptors in-radius 3 with [bonding = 0] set heading 0 move-to my-receptor set ycor ycor + 1.2 set bonding 1 ask my-receptor [set bonding 1 set color yellow]]] ] ifelse [pcolor] of divider = 0 [;no divide ask I-receptors with [bonding = 1] [if count insulins with [ycor > 2] = 0 [set bonding 0 set color yellow - 2]]] [;with the divide ask I-receptors with [bonding = 1 and xcor <= -6] [if count insulins with [ycor > 2 and xcor <= -6] = 0 [set bonding 0 set color yellow - 2]] ask I-receptors with [bonding = 1 and xcor > -6] [if count insulins with [ycor > 2 and xcor > -6] = 0 [set bonding 0 set color yellow - 2]] ] end to glut-4-movement ifelse count I-receptors with [bonding = 1 and xcor > -6 ] > 0 or exercise? [ask gluts with [kind = 4 and lock = 0] [glut-recruiting]] [ask gluts with [kind = 4 and lock = 1] [glut-restore]] end to glut-recruiting let loci min-one-of lipids with [pycor = 2] [distance myself] face loci ifelse (distancexy [xcor] of loci [ycor] of loci) > 0.3 [ifelse pcolor = 9 [rt random 90 lt random 90][fd 0.1]] [move-to loci set heading 0 set lock 1 set bonding 0 set color 126.5 ask lipids-here [die] ] end to glut-restore set bonding 2 if pcolor = 49 [set heading 180 fd 0.25] if pcolor = 0 [ifelse pcolor = 2 [ifelse pxcor > 10 [set heading -90 fd 0.5][set heading 90 fd 0.5]][rt random 15 lt random 15 fd 0.1 set color 123]] if pycor < -0.75 [if random 100 < 25 [set lock 0]] end to glucagon-movement ifelse [pcolor] of divider = 0 [;no divide ask glucagons with [ycor > 2] [if bonding = 0 [ if pcolor = 0 [right random 90 left random 90 ;wiggle if [pcolor] of patch-at dx dy = 0 [fd 0.2] ] if any? G-receptors in-radius 2 with [bonding = 0] [ let my-receptor one-of G-receptors in-radius 2 with [bonding = 0] set heading 0 move-to my-receptor set xcor xcor - 0.3 set ycor ycor + 0.95 set bonding 1 ask my-receptor [set bonding 1 set color 27]]] ] ask G-receptors with [bonding = 1] [if count glucagons with [ycor > 2] = 0 [set bonding 0 set color 26]] ] [;with the divide ask glucagons with [ycor > 2] [if bonding = 0 [ if pcolor = 0 [right random 90 left random 90 ;wiggle if [pcolor] of patch-at dx dy = 0 [fd 0.2] ] if any? G-receptors in-radius 2 with [bonding = 0] [ let my-receptor one-of G-receptors in-radius 2 with [bonding = 0] set heading 0 move-to my-receptor set xcor xcor - 0.3 set ycor ycor + 0.95 set bonding 1 ask my-receptor [set bonding 1 set color 27]]] ] ask G-receptors with [bonding = 1] [if count glucagons with [ycor > 2 and xcor <= -6] = 0 [set bonding 0 set color 26]] ] end to glycolysis ifelse [pcolor] of divider = 0 [;no divider ask glucose with [glycogen = 0 and cyto = 1] [ if random 100 < (20 + (count insulins with [bonding = 1])* 20) [ if random 100000 < metabolic-rate [die] ]]] [;with the divider ask glucose with [glycogen = 0 and xcor <= -6 and cyto = 1] [ if random 100 < (20 + (count insulins with [bonding = 1 and xcor <= -6])* 35) [ if random 100000 < metabolic-rate [die]]] ask glucose with [glycogen = 0 and xcor > -6 and cyto = 1] [ if random 100 < (20 + (count insulins with [bonding = 1 and xcor > -6])* 35) [ if random 100000 < metabolic-rate [die]]] ] end to glycogenesis-glycogenolysis ;left if glycogen-level-l = 0 [if count glucose with [cyto = 1 and xcor <= -6] != nobody [ask one-of glucose with [cyto = 1 and xcor <= -6] ;set a starter [set glycogen 1 set color 138 setxy (min-pxcor + 1) + random-float 10 -2 + random-float -1 ]]] if cyto-glucose-l > 80 and glycogen-level-l < 800 [ ask glucose with [cyto = 1 and glycogen = 0 and xcor <= -6 ] ;glycogenesis [if any? other glucose-here with [glycogen = 1] [if random 100 < (1 + (count insulins with [bonding = 1])* 45) [ set glycogen 1 set color 138] ]]] if any? G-receptors with [bonding = 1] ;glycogenolysis [ask glucose with [cyto = 1 and glycogen = 1 and xcor <= -6] [if random 1000 < 5 [set glycogen 0 set color white set heading 45 - random 90 fd 0.5]] ] ;right if glycogen-level-r = 0 [if count glucose with [cyto = 1 and xcor > -6] != nobody [ask one-of glucose with [cyto = 1 and xcor > -6] ;set a starter [set glycogen 1 set color 138 setxy 1 + random-float 20 -2 + random-float -1 ]]] if cyto-glucose-r > 80 and glycogen-level-r < 400 [ ask glucose with [cyto = 1 and glycogen = 0 and xcor > -6 ] ;glycogenesis [if any? other glucose-here with [glycogen = 1] [if random 100 < (1 + (count insulins with [bonding = 1])* 45) [ set glycogen 1 set color 138] ]]] if cyto-glucose-r <= 80 ;glycogenolysis [ask glucose with [cyto = 1 and glycogen = 1 and xcor > -6] [if random 1000 < 5 [set glycogen 0 set color white set heading 45 - random 90 fd 0.5]] ] end to recover-lipids ask patches with [pcolor = 49] [if not any? turtles-here [sprout-lipids 1[set color 7 set shape "lipid-1" set size 1 set heading 0 set ycor 2]]] end to set-insulin-sensitivity ask I-receptors with [ycor > 0] [ifelse Insulin-resistance? [set bonding 2 set color yellow - 2] [ifelse color = yellow [set bonding 1][set bonding 0]] ] end to divide ask divider [ifelse pcolor = 2 [set pcolor 0] [set pcolor 2]] end to food-intake set clock clock + 1 if clock = 1200 [ if eat-every-4-hrs? [ create-glucose round (100 * 85 / 100) ;add 100 liver side glucose [set color white set shape "glucose" set size 0.75 set bonding 0 set glycogen 0 setxy -7 + random-float -16 2.5 + random-float 5] create-glucose round (100 * 145 / 100) ;muscle side glucose [set color white set shape "glucose" set size 0.75 set bonding 0 set glycogen 0 setxy 23 + random-float -28 2.5 + random-float 5] ask glucose with [ycor > -4] [if pcolor = 2 [ifelse random 2 = 0 [set xcor xcor + 1 ][set xcor xcor - 1 ]]] ] set clock 0] end ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; ;; Supporting-procedures ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; to plot-levels ;; this creates creates the bar graph set-current-plot "Glucose Gradient" clear-plot plot-pen-down set-current-plot-pen "Blood sugar (Liver)" plotxy 1 blood-sugar-l set-current-plot-pen "Cytoplasmic glucose (Liver)" plotxy 2 cyto-glucose-l set-current-plot-pen "Blood sugar (Muscle)" plotxy 4 blood-sugar-r set-current-plot-pen "Cytoplasmic glucose (Muscle)" plotxy 5 cyto-glucose-r end ; Copyright 2021 by Lin Xiang. All rights reserved.
There are 8 versions of this model.
This model does not have any ancestors.
This model does not have any descendants.