Equilíbrio Químico

No preview image

1 collaborator

Default-person Marcos Taira (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 68 times • Downloaded 11 times • Run 0 times
Download the 'Equilíbrio Químico' 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

turtles-own [
  ready-timer  ;; Cronômetro que tem com função impedir que as moléculas entrem
  ;;imediatamente em uma reação reversa.
]

;;Configurações iniciais

to setup
  clear-all
  set-default-shape turtles "circle"
  create-turtles moleculas-azuis [
    setup-molecules blue
  ]
  create-turtles moleculas-amarelas [
    setup-molecules yellow
  ]
  reset-ticks
end 

to setup-molecules [c] ;; turtle procedure
  set ready-timer 0 ;;Cronômetro que indica se a molécula está pronta ou não para reagar
  set color c ;;para zero, a cor da molécula, e a posição aleatória da molécula em x e y.
  setxy random-xcor random-ycor ;;
end 


;;  Procedimentos de tempo de execução

;;  As turtles se mexem e verificam se há uma reação. As turtles que têm um temporizador também o reduzem em um tique.

to go
  ask turtles [
    if ready-timer > 0 [
      set ready-timer ready-timer - 1
    ]
    wiggle

    ;;Se uma molécula azul se encontra com uma amarela, elas se tornam verde e rosas, respectivamente.
    check-for-reaction blue yellow green pink

    ;;Se uma molécula verde se encontra com uma rosa, elas se tornam azul e amarelas, respectivamente.

    check-for-reaction green pink blue yellow

  ]
  tick
end 

;; As turtles recebem um leve giro aleatório em sua direção.

to wiggle ;; Procedimento da turtle
  fd 1
  rt random-float 2
  lt random-float 2
end 

;; Uma reação é definida por quatro cores: As cores das duas moléculas que podem potencialmente
;; reagir entre si(molécula-cor1 e molécula-cor2) e a cor das duas moléculas
;; que serão produzidas se uma tal reação acontecer(produto de cor1 e produto de cor2).

to check-for-reaction [ reactant-1-color reactant-2-color product-1-color product-2-color ]
  ;; Primeiramente, verifica-se se a reação está pronta para ser executada
  ;; E se as cores estão corretas para ocorrer as reações.
  if ready-timer = 0 and color = reactant-1-color [
    ;; Tentativa de achar parceiro apropriado para reação

    if any? turtles-here with [ color = reactant-2-color ] [
      ;; condicional para identificar se há uma reação e executá-la
      react product-1-color
      ask one-of turtles-here with [ color = reactant-2-color ] [ react product-2-color ]
    ]
  ]
end 

;; Quando uma molécula reage, muda sua cor e seta uma nova direção,
;; e um temporizador que lhe dará tempo o suficiente se movimentar
;; antes de reagir novamente

to react [ new-color ]
  set color new-color
  rt random-float 360
  set ready-timer 2
end 

There are 4 versions of this model.

Uploaded by When Description Download
Marcos Taira over 3 years ago Reverted to older version Download this version
Marcos Taira over 3 years ago Reverted to older version Download this version
Marcos Taira over 3 years ago Pequena mudança no código e na info Download this version
Marcos Taira over 3 years ago Initial upload Download this version

Attached files

No files

This model does not have any ancestors.

This model does not have any descendants.