Simulation for lipids and bacteria

No preview image

1 collaborator

Default-person alvin lam (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.4.0 • Viewed 25 times • Downloaded 0 times • Run 0 times
Download the 'Simulation for lipids and bacteria' 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

globals [time speed R pHFactor TFactor Ea A pHs lipidConNow]
breed [bacteria bacterias]
breed [lipids lipid]
bacteria-own [age timing]

to setup
  clear-all
  set-default-shape bacteria "bacteria-2-membrane"
  create-bacteria 50 [
    set color green
    set size 1.5
    setxy random-xcor random-ycor
    set age 0
  ]

  set-default-shape lipids "circle"
  create-lipids lipid-concentration * 300 [
    set color white
    set size 1
    setxy random-xcor random-ycor
  ]

  set R 8.314
  set pHs pH
  set A 0
  set Ea 0

  check-Activation-energy T pH
  check-speed A Ea T
  set time 0
  reset-ticks
end 

to spawn
  create-bacteria 50 [
    set color green
    set size 1.5
    setxy random-xcor random-ycor
    set age 0
  ]
end 

to go
  ChangepH
  check-Activation-energy T pHs
  check-speed A Ea T

  ask bacteria [
    move
    reproduce
    aging
  ]

  ask lipids [
    move
  ]

  check-collisions
  tick
  set time time + 1
end 

to move
  rt random 360
  fd 1
end 

to reproduce
  set timing timing + speed
  if age > 10 and timing > 1 [
    hatch-bacteria 1 [
      set age 0
      set color green
      set timing 0
    ]
    set age 0
    set timing 0
  ]
end 

to aging
  set age age + 1
  if age > 20 [
    die
  ]
end 

to check-collisions
  ask bacteria [
    let collided-turtle one-of lipids with [distance myself < 1]
    if collided-turtle != nobody [
      ; Handle collision
        ask collided-turtle [ die ]
        die
    ]
  ]
end 

to check-speed[AV Energy TV]
  let Es Energy * -1
  let Arrhenius (A * exp ( Es / (R * TV)))
  if Arrhenius != 0 [
    set speed (ln 2 / Arrhenius)
  ]
end 

to check-Activation-energy[TV pHV]

  ifelse pHV < 5.5 [
    pHLow
  ] [
  ifelse pHV >= 5.5 and pH <= 8.5 [
    set pHFactor 1
  ] [

  if pHV > 8.5 [
    pHHigh
  ]
    ]
  ]

  ifelse TV < 30 [
    TLow
  ] [

  ifelse TV >= 30 and TV <= 45 [
    set TFactor 1
  ] [

  if TV > 45[
    THigh
  ]
      ]
  ]

  set Ea (50000 + random 50000) * pHFactor * TFactor
  set A (10 ^ 8 + random-float (10 ^ 12 - 10 ^ 8)) * pHFactor * TFactor
end 

to pHLow
  let Lower 5.5 - pHs
  set pHFactor (Lower / 10) + 1
end 

to pHHigh
  let High pHs - 8.5
  set pHFactor (High / 10) + 1
end 

to TLow
  let Lower 30 - T
  set TFactor (Lower / 10) + 1
end 

to THigh
  let High T - 45
  set TFactor (High / 10) + 1
end 

to ChangepH
  let lc100 lipid-concentration * 100
  let minusing pH - 7

  if pHs > 7
  [
    set pHs pH + ((count lipids / lc100) - minusing)
  ]


  set lipidConNow (count lipids / lc100 / 3) * lipid-concentration
  output-print (word "pH: " pHs word " lipidConcentration: "  lipidConNow)
end 

There is only one version of this model, created 3 months ago by alvin lam.

Attached files

No files

This model does not have any ancestors.

This model does not have any descendants.