MIHS - Cell Culture Model

MIHS - Cell Culture Model preview image

1 collaborator

Larry_bencivengo Larry Bencivengo (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.1.1 • Viewed 64 times • Downloaded 8 times • Run 0 times
Download the 'MIHS - Cell Culture Model' 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

;; cell model

globals [#-cells #-O2 O2-target-level #-nutrients #-CO2 #-CO2-generated interval]
patches-own [cell? aerobic? energy O2-absorbed nutrients-absorbed]
breed [xO2 O2]
breed [xCO2 CO2]
breed [nutrients nutrient]

to setup
  clear-all
  ask patches [set pcolor white] ;; create a white background
  setup-cells                    ;; randomly identify starting-number-cells patches as cells

  ;; set up molecule shapes, starting numbers, etc.
  set #-CO2 0
  set #-CO2-generated 0
  set-default-shape xCO2 "molecule carbon dioxide"
  ;; generate starting O2
  set-default-shape xO2 "molecule oxygen"
  set O2-target-level 100 * (O2-concentration / 21)
  setup-O2
  ;; generate starting nutrients
  set-default-shape nutrients "hex"
  setup-nutrients
  reset-ticks
end 

to setup-cells
  ;; generate cells by selecting random patches and setting cell? to true
  ;; if using anaerobic cells, randomly determine whether aerobic? is true or false
  ;; repeat until the correct number of cells has been generated
  set #-cells 0
  while [#-cells < starting-number-cells] [
    ;; select a random patch - if it is not already a cell, make it a cell
      ask patch random-pxcor random-pycor [if cell? = 0 [
      become-cell
      set #-cells #-cells + 1
      ]
    ]
  ]
end 

to become-cell
  ;; check for aerobic? - needs to be added
  set cell? 1
  set aerobic? 1            ;; change when anaerobes added
  set energy 100
  set pcolor gray
end 

to setup-O2
  set #-O2 O2-target-level
  create-xO2 #-O2 [
    set color blue
    setxy random-xcor random-ycor
  ]
end 

to setup-nutrients
  set #-nutrients 1000 * (starting-nutrient-level / 100)
  create-nutrients #-nutrients [
    set color green
    set size 0.5
    setxy random-xcor random-ycor
  ]
end 


;; to go
;; molecules move randomly with a speed that depends on temperature
;; O2 and nutrient molecules are "absorbed" by cells as they pass through patches
;; metabolism of clls converts 1 O2 and 1 nutrient into x energy and 1 CO2 (waste)
;; the number of such transformations [per tick?] depends on O2/nutrients collected
;; and temperature
;; for energy conversion, "x" = 6 for aerobic cells; x = 2 for anaerobic (but no O2 needed)
;; when cells accumulate enough energy, they reproduce by turning random adjacent patch
;; into a cell
;; cells consume 1 energy [each tick?] to survive; if energy <= 0, cell dies
;; at a frequency determined by culture-change-frequency, CO2 are removed and nutrients added
;; O2 molecules are constantly added whenever to maintain the O2-concentration

to go
  if #-cells <= 0 [stop]
  ask turtles [move]
  set #-CO2-generated 0
  ask patches [metabolize]
  add-CO2
  ask patches [reproduce]
  add-O2                                 ;; replenish O2
  replace-culture-medium                 ;; periodically replace culture medium
  tick
end 

to move
  right random 30
  left random 30
  forward 1
end 

to metabolize  ;; absorb nutrients, generate energy and create wastes
  ;; only cells metabolize
  if cell? = 1 [
    ;; consume energy and check for cell death
    set energy energy - 1
    if energy <= 0 [cell-death]
    absorb-O2                             ;; absorb O2 and nutrients
    absorb-nutrients
    ;; consume 1 O2 and 1 nutrient to create energy and waste
    if nutrients-absorbed > 0 [
      set nutrients-absorbed nutrients-absorbed - 1
      ifelse aerobic? = 1 and O2-absorbed > 0 [
        set O2-absorbed O2-absorbed - 1
        set energy energy + 60
        set #-CO2-generated #-CO2-generated + 1
      ]
      [set energy energy + 20]
    ]
  ]
end 

to cell-death
  set cell? 0
  ;; set aerobic? = 0
  set pcolor white
  set energy 0
  set O2-absorbed 0
  set nutrients-absorbed 0
  set #-cells #-cells - 1
  set #-CO2-generated #-CO2-generated + 1
end 

to absorb-O2  ; cell procedure
  let available-O2 one-of xO2-here              ; grab a random O2 molecule
  if available-O2 != nobody  [
    ask available-O2 [die]
    set #-O2 #-O2 - 1
    set O2-absorbed O2-absorbed + 1
  ]
end 

to absorb-nutrients  ; cell procedure
  let available-nutrients one-of nutrients-here      ; grab a random nutrient molecule
  if available-nutrients != nobody  [
    ask available-nutrients [die]
    set #-nutrients #-nutrients - 1
    set nutrients-absorbed nutrients-absorbed + 1
  ]
end 

to add-CO2
  if #-CO2-generated > 0 [
    create-xCO2 #-CO2-generated [
      setxy random-xcor random-ycor
      set color red
      set size 1
     ]
   ]
   set #-CO2 #-CO2 + #-CO2-generated
   set #-CO2-generated 0
end 

to add-O2
  if #-O2 < O2-target-level * 0.9 [
  let new-O2 (O2-target-level - #-O2)
  create-xO2 new-O2 [
    set color blue
    setxy random-xcor random-ycor
    ]
  set #-O2 #-O2 + new-O2
  ]
end 

to reproduce
  ;; only cells reproduce
  if cell? = 1 and energy >= 200 [     ;; if enough energy generated, divide in two
    ;; check for empty adjacent patch
    if any? neighbors with [cell? = 0] [
      ;; use up energy for cell division
      set energy energy - 80
      ;; create a new cell in an adjacent patch
      set energy (energy / 2)
      ask one-of neighbors with [cell? = 0] [become-cell]
      set #-cells #-cells + 1
    ]
  ]
end 

to replace-culture-medium
  ;; check to see if it is time to replace the culture medium
  if medium-change-frequency > 0 and
  ticks > 10 and ticks mod (2500 / (medium-change-frequency * 10)) <= 1 and
  (ticks - interval) > 10 [            ;; prevent "double" changes
    ask patches [set pcolor black]      ;; set patches to gray during culture medium change
    ask xO2 [die]
    set #-O2 0
    add-O2
    ask xCO2 [die]
    set #-CO2 0
    ask nutrients [die]
    setup-nutrients
    ask patches [                      ;; reset patch pcolors to normal
      ifelse cell? = 1 [
        set pcolor gray]
      [set pcolor white]
    ]
    set interval ticks
  ]
end 

There is only one version of this model, created over 2 years ago by Larry Bencivengo.

Attached files

File Type Description Last updated
MIHS - Cell Culture Model.png preview Preview for 'MIHS - Cell Culture Model' over 2 years ago, by Larry Bencivengo Download

This model does not have any ancestors.

This model does not have any descendants.