Energy Conservation Model

No preview image

1 collaborator

Default-person Dean Reese (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by everyone
Model was written in NetLogo 5.0.4 • Viewed 241 times • Downloaded 25 times • Run 0 times
Download the 'Energy Conservation 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

; This is a Conservation of Mechanical Energy model made by Dean Reese - dreese@tusd.net, Teacher at Tracy High School,
; Instructor for the SIMMS Project, and Instructor for LLNL's Computer Simulation Teacher Research Academy.  


globals [K U v g t]                                   ; defines the following variables: K - Kinetic Energy, U - Potential Energy, v - velocity, g - gravity, t - time

to setup                                              ; procedure for the setup button
  clear-all                                           ; restarts the world to the default setting
  reset-ticks                                         ; establishes a clock and sets clock to zero
  ask patches [set pcolor 98]                         ; sets background color
  create-turtles 1                                    ; creates the falling object
  [set shape "box"                                    ; sets shape to box
   set size 1.2                                       ; sets size of box to 1
   set color red                                      ; sets color of box to red
   set heading 180                                    ; sets direction of box to point down initially
   set xcor 5                                         ; sets x-position of box to 5
   set ycor height]                                   ; sets y-position of box to height chosen by the height slider
  
  set v 0                                             ; sets the initial value of velocity to 0
  set g 10                                            ; sets the value of gravity to 10
  set t 0                                             ; sets the initial value of time to 0
  set K .5 * mass * v * v                             ; sets initial Kinetic Energy value to be 1/2 m v^2
  set U mass * g * height                             ; sets initial Potential Energy to be m g h
end 

to go                                                 ; procedure for the go button
  every .0001 [set t t + .0001]                       ; allows time to tick up by increments of .0001 seconds for a smooth transition on graphs
  set v (g * t)                                       ; updates velocity every .0001 s via the equation vf = vo + a t
  set K .5 * mass * v * v                             ; updates Kinetic Energy every .0001 s via the equation 1/2 m v^2
  set U mass * g * ([ycor] of turtle 0)               ; updates Potential Energy very .0001 s via the equation m g h
  ask turtle 0 [set ycor ( height - (5 * t * t))]     ; updates the height of the box via the equation yf = yo + vo t + 1/2 a t^2
  if t >= sqrt ((2 * height) / g) [ stop]             ; stops the program when the box reaches the bottom of the frame via t = sqrt (2 height/g)
  tick                                                ; ticks ahead one iteration of the go procedure   
end 
  

There is only one version of this model, created about 8 years ago by Dean Reese.

Attached files

No files

This model does not have any ancestors.

This model does not have any descendants.