patches-own [ HeightA ; Current height of the column HeightB ; Past height of the column (velocity) Height_new ; Temporal variable to store the new height of the column ] to setup ca ask patches [ set HeightA 0 set HeightB 0 ] reset-ticks end to go ask patches [ let Nb-Height sum [heightA] of neighbors set Height_new fluidity * Nb-Height / (count neighbors ) + (1 - fluidity) * HeightB set Height_new Height_new * (1 - dissipation) ] ask patches [ set HeightB HeightA set HeightA Height_new set pcolor scale-color sky HeightA -0.2 1.2 ] if mouse-inside? [ ask patch mouse-xcor mouse-ycor [ ask (patches in-radius 2) [set HeightA 1] ] ] tick end @#$#@#$#@ GRAPHICS-WINDOW 196 10 611 446 75 75 2.68212 1 10 1 1 1 0 0 0 1 -75 75 -75 75 1 1 1 ticks 30.0 SLIDER 16 10 188 43 fluidity fluidity 0 2 1.94 0.01 1 NIL HORIZONTAL BUTTON 36 88 99 121 NIL setup NIL 1 T OBSERVER NIL NIL NIL NIL 1 BUTTON 111 88 174 121 NIL go T 1 T OBSERVER NIL NIL NIL NIL 1 SLIDER 16 47 188 80 dissipation dissipation 0 1 7.0E-4 .0001 1 NIL HORIZONTAL @#$#@#$#@ @#$#@#$#@ default true 0 Polygon -7500403 true true 150 5 40 250 150 205 260 250 @#$#@#$#@ NetLogo 5.3 @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ default 0.0 -0.2 0 0.0 1.0 0.0 1 1.0 0.0 0.2 0 0.0 1.0 link direction true 0 Line -7500403 true 150 150 90 180 Line -7500403 true 150 150 210 180 @#$#@#$#@ 0 @#$#@#$#@