Blood sugar regulation by the muscle

Blood sugar regulation by the muscle preview image

1 collaborator

Screen_shot_2018-02-02_at_12.53.50_pm lin xiang (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by the author
Model was written in NetLogo 6.2.0 • Viewed 258 times • Downloaded 46 times • Run 0 times
Download the 'Blood sugar regulation by the muscle' modelDownload this modelEmbed this model

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]
glucose-own [bonding cyto glycogen]
I-receptors-own [bonding]
G-receptors-own [bonding]
glucagons-own [bonding]

Globals [clock]

to-report blood-sugar
  report count glucose with [ycor > 2 and color = white and bonding = 0]
end 

to-report cyto-glucose
  report count glucose with [ycor < 2 and color = white and bonding = 0 and glycogen = 0]
end 

to-report glycogen-level
  report count glucose with [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
 set-insulin-sensitivity


reset-ticks
end 

to go
  if blood-sugar < 54 [user-message "The blood sugar level is dangerously low." Stop]


check-glucose-location
food-intake
set-insulin-sensitivity
setup-insulin
glucose-movement
insulin-movement
glut-movement
recover-lipids
glucagon-movement
glycolysis
glycogenesis-glycogenolysis

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]

;add Insulin receptors (I-R) into the membrane
  ask patches with [pcolor = 49] [
    if  pxcor = -3
    [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 Starting-Blood-sugar-level
  [set color white
    set shape "glucose"
    set size 0.75
    set bonding 0
    set glycogen 0
    setxy (max-pxcor - 1) - random-float ((max-pxcor - 1) * 2) 2.5 + random-float 5]

  create-glucose Starting-cytoplasmic-glucose
  [set color white
    set shape "glucose"
    set size 0.75
    set bonding 0
    set glycogen 0
    setxy (max-pxcor - 1) - random-float ((max-pxcor - 1) * 2) 1 + random-float -4]

  create-glucose 200        ;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]
end 

to setup-glut

 create-gluts 1
  [set shape "glut" set color 123 set size 1.25 set bonding 2 set name 1 set lock 0
    setxy -10 + 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
    setxy -1 + 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
    setxy 4 + 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
    setxy 9 + random 2  -0.75]
; ask patches with [(pxcor = 0 or pxcor = 4 or pxcor = -10 or pxcor = 10)  and pycor = 2 and pcolor = 49]
;[if any? lipids-here
;[ask lipids-here [die]
;sprout-gluts 1 [set shape "glut" set color 126.5 set size 1.25 set heading 0 set bonding 0]
;]]
end 

to setup-insulin

 if blood-sugar > 140 and Can-produce-insulin?
  [if not any? insulins with [ycor > 2] [
    create-insulins 10
    [ set bonding 0
    set shape "insulin"
    set size 2
    set color 95
      setxy -6 + random-float 16 2.5 + random-float 5]]]

  if blood-sugar < 120
  [if count insulins != 0
    [ask insulins with [ycor > 2] [die]]
  ]
end 

to setup-legend
 create-legends 10
  [set shape "legend"]

 ask legend 0
  [set label "lipids"
    setxy -8 -4.75 ]

  create-lipids 1
  [set color 7
    set shape "lipid-1"
    set size 0.75
    set heading 0
    setxy -8 -4.25 ]

  ask legend 1
  [set label "Glucose"
    setxy -2.75 -4.75]

  Create-glucose 1
  [set color white
    set shape "glucose"
    set size 1.25
    set heading 0
    set glycogen 2
    setxy -3 -4.25]

  ask legend 2
  [set label "Glycogen"
    setxy 2.75 -4.75 ]

  Create-glucose 2
  [set color 138
    set shape "glucose"
    set size 1.25
    set glycogen 2
    setxy 2 + random-float 0.5 -4.25]

  ask legend 3
  [set label "Glucose Transporter 4"
    setxy 10 -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 8 -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.75]




  create-lipids 1
  [set color 7
    set shape "line"
    set size 22
    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 set color 127.5]]]]
  [
    ifelse blood-sugar > cyto-glucose
      [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 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]]]
      ]

  ask I-receptors with [bonding = 1]
  [if count insulins with [ycor > 2] = 0 [set bonding 0 set color yellow - 2]]
end 

to glut-movement

  ifelse count I-receptors with [bonding = 1] > 0 or exercise?
    [ask gluts with [lock = 0]
      [glut-recruiting]]

    [ask gluts with [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 = 9 [ifelse pxcor > 0 [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
  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]]
end 

to glycolysis
  ask glucose with [glycogen = 0 and cyto = 1] [
    if random 1000000 < metabolic-rate  [die]
  ]
end 

to glycogenesis-glycogenolysis

  if glycogen-level = 0
   [if count glucose with [cyto = 1] != nobody
     [ask one-of glucose with [cyto = 1]    ;set a starter
        [set glycogen 1
         set color 138
         setxy (max-pxcor - 1) - random-float ((max-pxcor - 1) * 2) -2 + random-float -1 ]]]

  if cyto-glucose > 80 and glycogen-level < 400 [
    ask glucose with [cyto = 1 and glycogen = 0]      ;glycogenesis
     [if any? other glucose-here with [glycogen = 1]
      [if random 100 < (1 + (count insulins with [bonding = 1])* 70)
        [ set glycogen 1 set color 138]
  ]]]

  if cyto-glucose <= 80               ;glycogenolysis
    [ask glucose with [cyto = 1 and glycogen = 1]
     [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 food-intake
  set clock clock + 1
  if clock = 1200 [
    if eat-every-4-hrs?
  [create-glucose 100
  [set color white
    set shape "glucose"
    set size 1
    set bonding 0
    set glycogen 0
    setxy (max-pxcor - 1) - random-float ((max-pxcor - 1) * 2) 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 stream glucose"
    plotxy 1 blood-sugar
    set-current-plot-pen "Cytoplasm glucose"
    plotxy 2 cyto-glucose
    set-current-plot-pen "Glycogen"
    plotxy 3 glycogen-level
end 


; Copyright 2021 by Lin Xiang.  All rights reserved.

There are 5 versions of this model.

Uploaded by When Description Download
lin xiang over 3 years ago Fix info typos Download this version
lin xiang almost 4 years ago Adjust the parameters Download this version
lin xiang almost 4 years ago Adjust regular food intake Download this version
lin xiang almost 4 years ago Adjust the parameters Download this version
lin xiang almost 4 years ago Initial upload Download this version

Attached files

File Type Description Last updated
Blood sugar regulation by the muscle.png preview Preview for 'Blood sugar regulation by the muscle' almost 4 years ago, by lin xiang Download

This model does not have any ancestors.

This model does not have any descendants.