The Chemical Bond
Model was written in NetLogo 5.0.4
•
Viewed 438 times
•
Downloaded 87 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
breed [ nuclei nucleus ] breed [ electrons electron ] breed [ electronLs electronL ] breed [ electronRs electronR ] breed [ protons proton ] breed [ neutrons neutron ] globals [distnaceab AtomL_size AtomR_size ElectronegativityL ElectronegativityR ] ;electrons-own to electorn_attributes set color black set shape "circle" set size 1 set heading random 360 end ;protons-own to proton_attributes set color brown set shape "circle" set size 1.3 set heading random 360 end ;setup to setup clear-all ask patches [ set pcolor 87 ] create-turtles 2 ask turtles [set ycor 0 ] ask turtles [ set shape "circle 22" ] ;;;;;;;;;;;;;;;;setup AtomL :::::::::::::::::::::::::::: ask turtle 0 [ set label "AtomL" set AtomL_size 15 - 0.2 * ProtonsL + AtomL_ValE * 3 set size AtomL_size set xcor min-pxcor + AtomL_size / 1.5 set color 129 - AtomL_ValE set ElectronegativityL AtomL_ValE * 4 / 7 set heading 90 ] ;;;;;;;;;;;;;;;;;;setup AtomR :::::::::::::::::::::::::: ask turtle 1 [ set label "AtomR" set heading -90 set AtomR_size 20 - 0.2 * ProtonsR + ( 8 - AtomL_ValE ) * 3 set size AtomR_size set xcor max-pxcor - AtomR_size / 1.5 set color 129 - ( 8 - AtomL_ValE ) set ElectronegativityR ( 8 - AtomL_ValE ) * 4 / 7 ] ;;;;;;;;;;;;;;setup valence electrons: on Left atom and on Right atom ;;;;;;;;;;;;;;; create-electronLs AtomL_ValE [ electorn_attributes setxy [ xcor ] of one-of turtles with [ label = "AtomL" ] [ ycor ] of one-of turtles with [ label = "AtomL" ] fd AtomL_size / 2 set heading [ heading ] of one-of turtles with [ label = "AtomL" ] ] create-electronRs ( 8 - AtomL_ValE ) [ electorn_attributes setxy [ xcor ] of one-of turtles with [ label = "AtomR" ] [ ycor ] of one-of turtles with [ label = "AtomR" ] fd AtomR_size / 2 set heading [ heading ] of one-of turtles with [ label = "AtomR" ] ] ;;;;;;;;;;;;;;;setup protons create-protons ProtonsL [ proton_attributes setxy item 0 [ xcor ] of turtles with [ label = "AtomL" ] item 0 [ ycor ] of turtles with [ label = "AtomL" ] set heading random 360 fd size / 2 set heading item 0 [ heading ] of turtles with [ label = "AtomL" ] ] create-protons ProtonsR [ proton_attributes setxy item 0 [ xcor ] of turtles with [ label = "AtomR" ] item 0 [ ycor ] of turtles with [ label = "AtomR" ] set color color + random-float 2 set heading random 360 fd size / 2 set heading item 0 [ heading ] of turtles with [ label = "AtomR" ] ] ask turtle 0 [ set distnaceab distance turtle 1 ] reset-ticks display end ;;;;;;;;;;;;;;;;;;;;;;;;; move electrons ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; to moving-e [ electron_id ] let AtomR one-of turtles with [ label = "AtomR" ] let distance_toAtom 0 ask electron_id [ face AtomR set distance_toAtom distance AtomR - AtomR_size / 2 ] ; move all electrons foreach n-values 20 [?] [ ask electron_id [fd distance_toAtom / 20] display ] ask electron_id [ set heading [ heading ] of AtomR set breed electronRs] end ; atoms meet to go ask turtles [ forward 0.5 ] if ( [ xcor ] of turtle 1 - [ xcor ] of turtle 0 < ( AtomL_size / 1.5 + AtomR_size / 1.5 ) ) [ ask electronLs [moving-e electronl who] ] ask turtle 0 [ set distnaceab distance turtle 1 ] if ( [ xcor ] of turtle 1 - [ xcor ] of turtle 0 < ( AtomL_size / 2 + AtomR_size / 2 ) ) [ stop ] tick end ; F (between q1 and q2) = - (q1 * q2) / r^2 ; F (between every e and the two nucleus 1 and 2 ) = -q1e/r1e^2 - q2e/r2e^2 ; F = - qL * eL / (eL to AtomR) - qR * eR / (eR to AtomL) ; qL = ProtonsL ; eL = AtomL_ValE ; r1e = distance eL - xcor of turtle 1 ; qR = ProtonsR ; eR = AtomR_ValE ; r2e = distance eR - xcor of turtle 0
There are 9 versions of this model.
Attached files
File | Type | Description | Last updated | |
---|---|---|---|---|
Preview.jpg | jpeg | Preview | over 11 years ago, by Asnat Zohar | Download |
The Chemical Bond.png | preview | Bigger pict | over 11 years ago, by Asnat Zohar | Download |
The Chemical Bond.png | preview | The chemical bond preview | over 11 years ago, by Asnat Zohar | Download |
The Chemical Bond.png | preview | Updated preview file | over 11 years ago, by Asnat Zohar | Download |
The Chemical Bond.png | preview | Updated preview file | over 11 years ago, by Asnat Zohar | Download |
The Chemical Bond.png | preview | Updated preview file | over 11 years ago, by Asnat Zohar | Download |
The Chemical Bond.png | preview | bigger | over 11 years ago, by Asnat Zohar | Download |
הפוסטר של סינא ואסנת.docx | word | Poster | over 11 years ago, by Asnat Zohar | Download |
מטלה מסכמת סינא ואסנת.doc | word | Final task, Sinna and Asnat | over 11 years ago, by Asnat Zohar | Download |
This model does not have any ancestors.
This model does not have any descendants.