@@ -348,37 +348,39 @@ end
348348; Copyright 1997 Uri Wilensky.
349349; See Info tab for full copyright and license.]]> </code >
350350 <widgets >
351- <view x =" 315" wrappingAllowedX =" true" y =" 10" frameRate =" 30.0" minPycor =" 0" height =" 328" showTickCounter =" true" patchSize =" 4.0" fontSize =" 10" wrappingAllowedY =" false" width =" 328" tickCounterLabel =" ticks" maxPycor =" 80" updateMode =" 1" maxPxcor =" 40" minPxcor =" -40" ></view >
352- <button x =" 7" y =" 43" height =" 33" disableUntilTicks =" true" forever =" true" kind =" Observer" display =" go/stop" width =" 86" sizeVersion =" 0" >go</button >
353- <button x =" 7" y =" 10" height =" 33" disableUntilTicks =" false" forever =" false" kind =" Observer" width =" 86" sizeVersion =" 0" >setup</button >
354- <slider x =" 96" step =" 1" y =" 10" max =" 1000" display =" number-of-particles" height =" 33" min =" 1" direction =" Horizontal" default =" 100.0" variable =" number-of-particles" width =" 206" sizeVersion =" 0" ></slider >
355- <monitor x =" 8" precision =" 2" y =" 212" height =" 45" fontSize =" 11" display =" average speed" width =" 123" sizeVersion =" 0" >avg-speed</monitor >
356- <plot x =" 613" autoPlotX =" false" yMax =" 10.0" autoPlotY =" false" yAxis =" count" y =" 390" xMin =" 0.0" height =" 196" legend =" true" xMax =" 400.0" yMin =" 0.0" xAxis =" energy" display =" Energy Histogram" width =" 289" sizeVersion =" 0" >
357- <setup >set-plot-x-range 0 (0.5 * ((init-particle-speed * 3) ^ 2 ) * particle-mass)
358- set-plot-y-range 0 ceiling (number-of-particles / 10)</setup >
351+ <view x =" 437" wrappingAllowedX =" true" y =" 21" frameRate =" 30.0" minPycor =" 0" height =" 353" showTickCounter =" true" patchSize =" 4.31" fontSize =" 10" wrappingAllowedY =" false" width =" 353" tickCounterLabel =" ticks" maxPycor =" 80" updateMode =" 1" maxPxcor =" 40" minPxcor =" -40" ></view >
352+ <plot x =" 840" autoPlotX =" true" yMax =" 500.0" autoPlotY =" true" yAxis =" energy" y =" 21" xMin =" 0.0" height =" 328" legend =" false" xMax =" 160.0" yMin =" 0.0" width =" 239" xAxis =" height" display =" Energy vs. Height" >
353+ <setup >set-plot-x-range 0 (max-pycor * 2)</setup >
359354 <update ></update >
360- <pen interval =" 1.0" mode =" 1" display =" fast" color =" -1893860" legend =" true" >
361- <setup >set-histogram-num-bars 45</setup >
362- <update >histogram [ energy ] of particles with [color = red]</update >
363- </pen >
364- <pen interval =" 1.0" mode =" 1" display =" medium" color =" -11686070" legend =" true" >
365- <setup >set-histogram-num-bars 45</setup >
366- <update >histogram [ energy ] of particles with [color = green]</update >
367- </pen >
368- <pen interval =" 1.0" mode =" 1" display =" slow" color =" -14979122" legend =" true" >
369- <setup >set-histogram-num-bars 45</setup >
370- <update >histogram [ energy ] of particles with [color = blue]</update >
371- </pen >
372- <pen interval =" 1.0" mode =" 0" display =" avg-energy" color =" -7500403" legend =" true" >
355+ <pen interval =" 4.0" mode =" 1" display =" default" color =" -11686070" legend =" true" >
373356 <setup ></setup >
374- <update >plot-pen-reset draw-vert-line avg-energy </update >
357+ <update >plot-pen-reset draw-graph </update >
375358 </pen >
376- <pen interval =" 1.0" mode =" 0" display =" init-avg-energy" color =" -16777216" legend =" true" >
377- <setup >draw-vert-line avg-energy-init</setup >
378- <update ></update >
359+ </plot >
360+ <plot x =" 840" autoPlotX =" true" yMax =" 160.0" autoPlotY =" true" yAxis =" count" y =" 210" xMin =" 0.0" height =" 165" legend =" false" xMax =" 160.0" yMin =" 0.0" width =" 239" xAxis =" height" display =" Density Histogram" >
361+ <setup >set-plot-x-range 0 (max-pycor * 2)
362+ set-plot-y-range 0 (max-pxcor * 2)
363+ set-histogram-num-bars round (max-pxcor / 2)</setup >
364+ <update ></update >
365+ <pen interval =" 1.0" mode =" 1" display =" default" color =" -11686070" legend =" true" >
366+ <setup ></setup >
367+ <update >histogram [ycor + max-pycor] of particles</update >
379368 </pen >
380369 </plot >
381- <plot x =" 10" autoPlotX =" true" yMax =" 100.0" autoPlotY =" true" yAxis =" count (%)" y =" 390" xMin =" 0.0" height =" 196" legend =" true" xMax =" 20.0" yMin =" 0.0" xAxis =" time" display =" Speed Counts" width =" 295" sizeVersion =" 0" >
370+ <switch x =" 103" y =" 67" height =" 37" on =" true" variable =" collide?" width =" 103" display =" collide?" ></switch >
371+ <monitor x =" 273" precision =" 1" y =" 312" height =" 60" fontSize =" 11" width =" 123" display =" percent lost particles" >percent-lost-particles</monitor >
372+ <slider x =" 103" step =" 1" y =" 7" max =" 1000" width =" 250" display =" number-of-particles" height =" 50" min =" 1" direction =" Horizontal" default =" 100.0" variable =" number-of-particles" ></slider >
373+ <slider x =" 103" step =" 1" y =" 117" max =" 20" width =" 250" display =" init-particle-speed" height =" 50" min =" 1" direction =" Horizontal" default =" 10.0" variable =" init-particle-speed" ></slider >
374+ <slider x =" 103" step =" 1" y =" 182" max =" 20" width =" 250" display =" particle-mass" height =" 50" min =" 1" direction =" Horizontal" default =" 1.0" variable =" particle-mass" ></slider >
375+ <slider x =" 103" step =" 0.2" y =" 247" max =" 15" width =" 250" display =" gravity-acceleration" height =" 50" min =" 0" direction =" Horizontal" default =" 9.8" variable =" gravity-acceleration" ></slider >
376+ <button x =" 5" y =" 117" height =" 35" disableUntilTicks =" false" forever =" false" kind =" Observer" width =" 78" display =" clear trace" >clear-drawing</button >
377+ <switch x =" 250" y =" 67" height =" 37" on =" true" variable =" trace?" width =" 103" display =" trace?" ></switch >
378+ <monitor x =" 8" precision =" 2" y =" 312" height =" 60" fontSize =" 11" width =" 123" display =" average speed" >avg-speed</monitor >
379+ <monitor x =" 144" precision =" 1" y =" 312" height =" 60" fontSize =" 11" width =" 118" display =" average energy" >avg-energy</monitor >
380+ <monitor x =" 10" precision =" 0" y =" 387" height =" 60" fontSize =" 11" width =" 121" display =" percent fast" >percent-fast</monitor >
381+ <monitor x =" 144" precision =" 0" y =" 387" height =" 60" fontSize =" 11" width =" 118" display =" percent medium" >percent-medium</monitor >
382+ <monitor x =" 273" precision =" 0" y =" 387" height =" 60" fontSize =" 11" width =" 123" display =" percent slow" >percent-slow</monitor >
383+ <plot x =" 10" autoPlotX =" true" yMax =" 100.0" autoPlotY =" true" yAxis =" count (%)" y =" 490" xMin =" 0.0" height =" 196" legend =" true" xMax =" 20.0" yMin =" 0.0" width =" 295" xAxis =" time" display =" Speed Counts" >
382384 <setup >set-plot-y-range 0 100</setup >
383385 <update ></update >
384386 <pen interval =" 1.0" mode =" 0" display =" fast" color =" -1893860" legend =" true" >
@@ -394,8 +396,7 @@ set-plot-y-range 0 ceiling (number-of-particles / 10)</setup>
394396 <update >plotxy ticks percent-slow</update >
395397 </pen >
396398 </plot >
397- <switch x =" 96" y =" 44" height =" 33" on =" true" variable =" collide?" display =" collide?" width =" 103" sizeVersion =" 0" ></switch >
398- <plot x =" 311" autoPlotX =" false" yMax =" 40.0" autoPlotY =" false" yAxis =" count" y =" 390" xMin =" 0.0" height =" 196" legend =" true" xMax =" 20.0" yMin =" 0.0" xAxis =" speed" display =" Speed Histogram" width =" 294" sizeVersion =" 0" >
399+ <plot x =" 402" autoPlotX =" false" yMax =" 40.0" autoPlotY =" false" yAxis =" count" y =" 490" xMin =" 0.0" height =" 196" legend =" true" xMax =" 20.0" yMin =" 0.0" width =" 294" xAxis =" speed" display =" Speed Histogram" >
399400 <setup >set-plot-x-range 0 (init-particle-speed * 3)
400401set-plot-y-range 0 ceiling (number-of-particles / 10)</setup >
401402 <update ></update >
@@ -420,34 +421,33 @@ set-plot-y-range 0 ceiling (number-of-particles / 10)</setup>
420421 <update ></update >
421422 </pen >
422423 </plot >
423- <slider x =" 7" step =" 0.2" y =" 156" max =" 15" display =" gravity-acceleration" height =" 33" min =" 0" direction =" Horizontal" default =" 9.8" variable =" gravity-acceleration" width =" 186" sizeVersion =" 0" ></slider >
424- <slider x =" 7" step =" 1" y =" 82" max =" 20" display =" init-particle-speed" height =" 33" min =" 1" direction =" Horizontal" default =" 10.0" variable =" init-particle-speed" width =" 186" sizeVersion =" 0" ></slider >
425- <slider x =" 7" step =" 1" y =" 119" max =" 20" display =" particle-mass" height =" 33" min =" 1" direction =" Horizontal" default =" 1.0" variable =" particle-mass" width =" 186" sizeVersion =" 0" ></slider >
426- <switch x =" 199" y =" 44" height =" 33" on =" true" variable =" trace?" display =" trace?" width =" 103" sizeVersion =" 0" ></switch >
427- <plot x =" 659" autoPlotX =" true" yMax =" 160.0" autoPlotY =" true" yAxis =" count" y =" 199" xMin =" 0.0" height =" 165" legend =" false" xMax =" 160.0" yMin =" 0.0" xAxis =" height" display =" Density Histogram" width =" 239" sizeVersion =" 0" >
428- <setup >set-plot-x-range 0 (max-pycor * 2)
429- set-plot-y-range 0 (max-pxcor * 2)
430- set-histogram-num-bars round (max-pxcor / 2)</setup >
424+ <plot x =" 793" autoPlotX =" false" yMax =" 10.0" autoPlotY =" false" yAxis =" count" y =" 490" xMin =" 0.0" height =" 196" legend =" true" xMax =" 400.0" yMin =" 0.0" width =" 289" xAxis =" energy" display =" Energy Histogram" >
425+ <setup >set-plot-x-range 0 (0.5 * ((init-particle-speed * 3) ^ 2 ) * particle-mass)
426+ set-plot-y-range 0 ceiling (number-of-particles / 10)</setup >
431427 <update ></update >
432- <pen interval =" 1.0" mode =" 1" display =" default " color =" -11686070 " legend =" true" >
433- <setup ></setup >
434- <update >histogram [ycor + max-pycor ] of particles</update >
428+ <pen interval =" 1.0" mode =" 1" display =" fast " color =" -1893860 " legend =" true" >
429+ <setup >set-histogram-num-bars 45 </setup >
430+ <update >histogram [ energy ] of particles with [color = red] </update >
435431 </pen >
436- </plot >
437- <plot x =" 659" autoPlotX =" true" yMax =" 500.0" autoPlotY =" true" yAxis =" energy" y =" 10" xMin =" 0.0" height =" 181" legend =" false" xMax =" 160.0" yMin =" 0.0" xAxis =" height" display =" Energy vs. Height" width =" 239" sizeVersion =" 0" >
438- <setup >set-plot-x-range 0 (max-pycor * 2)</setup >
439- <update ></update >
440- <pen interval =" 4.0" mode =" 1" display =" default" color =" -11686070" legend =" true" >
432+ <pen interval =" 1.0" mode =" 1" display =" medium" color =" -11686070" legend =" true" >
433+ <setup >set-histogram-num-bars 45</setup >
434+ <update >histogram [ energy ] of particles with [color = green]</update >
435+ </pen >
436+ <pen interval =" 1.0" mode =" 1" display =" slow" color =" -14979122" legend =" true" >
437+ <setup >set-histogram-num-bars 45</setup >
438+ <update >histogram [ energy ] of particles with [color = blue]</update >
439+ </pen >
440+ <pen interval =" 1.0" mode =" 0" display =" avg-energy" color =" -7500403" legend =" true" >
441441 <setup ></setup >
442- <update >plot-pen-reset draw-graph</update >
442+ <update >plot-pen-reset draw-vert-line avg-energy</update >
443+ </pen >
444+ <pen interval =" 1.0" mode =" 0" display =" init-avg-energy" color =" -16777216" legend =" true" >
445+ <setup >draw-vert-line avg-energy-init</setup >
446+ <update ></update >
443447 </pen >
444448 </plot >
445- <monitor x =" 10" precision =" 0" y =" 335" height =" 45" fontSize =" 11" display =" percent fast" width =" 88" sizeVersion =" 0" >percent-fast</monitor >
446- <monitor x =" 103" precision =" 0" y =" 336" height =" 45" fontSize =" 11" display =" percent medium" width =" 104" sizeVersion =" 0" >percent-medium</monitor >
447- <monitor x =" 212" precision =" 0" y =" 336" height =" 45" fontSize =" 11" display =" percent slow" width =" 92" sizeVersion =" 0" >percent-slow</monitor >
448- <monitor x =" 9" precision =" 1" y =" 274" height =" 45" fontSize =" 11" display =" percent lost particles" width =" 123" sizeVersion =" 0" >percent-lost-particles</monitor >
449- <monitor x =" 143" precision =" 1" y =" 212" height =" 45" fontSize =" 11" display =" average energy" width =" 118" sizeVersion =" 0" >avg-energy</monitor >
450- <button x =" 199" y =" 77" height =" 33" disableUntilTicks =" false" forever =" false" kind =" Observer" display =" clear trace" width =" 103" sizeVersion =" 0" >clear-drawing</button >
449+ <button x =" 5" y =" 22" height =" 35" disableUntilTicks =" false" forever =" false" kind =" Observer" width =" 86" >setup</button >
450+ <button x =" 5" y =" 67" height =" 35" disableUntilTicks =" true" forever =" true" kind =" Observer" width =" 86" display =" go/stop" >go</button >
451451 </widgets >
452452 <info ><![CDATA[ ## WHAT IS IT?
453453
0 commit comments