Water Table
WHAT IS IT?
This project simulates a community and its interactions with its climate and water table. Various parameters may be set which can simulate many different municipal situations. The student can see how these parameters might affect the health of the water table. Our project sets up an environment of roadways, a river, variable number of lakes, variable number of buildings, degree of aridity of climate, number or bushes, trees, and amount of open land. Slightly variable periods of drying are punctuated with storms when the program runs. The user has the option to either buy or sell water rights as the programs runs as well as setting three levels of "progressive" conservation of water from the storms. Many connections between these are working in the background and the program leads to many commonly know ecological conclusions. The graph shows the total water table value over time and reflects the periodic nature of the storms. One can observe long term trends toward flooding, drying up, or and equilibrium which can be affected by buying or selling the water rights during the run of the program or other possible setup options. There is an output option to send the average water table value with the number or water right sales which can be acessed via Excel. The user is encouraged to make both macropscopic observations of what one sees on the screen as well as comparisons of the runs and the "real world" consequences of those situations. What happens when you change various parameters inside the code? Go for it and learn.
HOW TO USE IT
The 'go' button starts the simulation. The simulation progresses randomly through dry and rain cycles. Rain adds water randomly over the area; drying is universal. Algorithms also have effects of growing more vegetation near water sources, simulating natural phenomena. The 'Purchase' button simulates a community purchasing water rights from neighboring land. Likewise 'Sell' sells water rights. These can be operated by the user during the simulation to assist in a dust bowl or flooding situation. Sliders: Lakes: These do little in the simulation other than add water reserves. Functionally they are little other than that. Climate: The higher this is set, the more water is initially put in the system and the more often it can be expected to rain. Metro Measure: This determines the size of the city. Effects of setting it higher include additional building space, reduced folliage, increased roads and higher water usage (by the population). Progressiveness: This determines the community's commitment to preserving water. 0 indicates no measures are taken; 1 indicates water is collected and used off roadways; 2 indicates water is collected and used from roadways and houses; 3 indicates all of the above plus a population that uses grey water.
THINGS TO NOTICE
The effects of moisture can be monitored in several ways. First, vegetation changes show the effects of soil moisture content. The Average Saturation window shows how much moisture the average plot has. The 'plot' shows total water in the community. Finally the 'Save Data' button will export average saturation as a function of time to a data file which can be read and manipulated by spreadsheet programs such as Corel Paradox.
EXPLORATIONS
Various parameters may be set which can simulate many different municipal situations. The student can see how these parameters might affect the health of the water table.
Mathematics 1. What is your prediction of the patterns the data will represent? 2. How periodic is the data? How does this compare with your prediction? 3. Are there longer term patterns that defy short term predictions?
Earth Science 1. Can you accurately predict the outcomes based on your initial settings? 2. What factors are ignored by this simulation which will actually affect the water table? 3. How realistic is this simulation? 4. Is the topograhpy of an area represented in this model? Is topography important in water tables? Can the model be improved by further use of topography?
Biology 1. What effects to bodies of water have on surrounding vegetation? 2. Research the growth patterns of your exerience. Do they match those represented by this model? How would you change the model to reflect your experience?
Civics 1. What is the role of the individual in a society? 2. What responsibility does the individual have towards his/her community? 3. Does "progressivism" always produce a positive effect? 4. If you intervene early in a decaying system, can you prevent eventual disaster?
Computer Science 1. Are computer models useful in representing real-world situations? 2. How would you make this simulation better?
Turtle procedures
to setup1 ;draw river with random wetness, landuse 0
setc blue
ht
pd
if (xcor > 82 and ycor < -71) [die]
seth towards-nowrap 83 -72
set water (random 2) + 15 + .1 * wetness
set landuse -1
fd 1
if (xcor > 82 and ycor < -71) [die]
seth towards-nowrap 83 -72
set water (random 2) + 15 + .1 * wetness
set landuse -1
fd 1
if (xcor > 82 and ycor < -71) [die]
seth towards-nowrap 83 -72
set water (random 2) + 15 + .1 * wetness
set landuse -1
fd 1
if (xcor > 82 and ycor < -71) [die]
wiggle
set water (random 2) + 15 + .1 * wetness
set landuse -1
if (xcor > 82 and ycor < -71) [die]
setup1
end
to setup2 ;draw lakes with random wetness, landuse 0
setc blue
ht
pd
repeat (wetness * 150) [
set water (random 2) + 13 + .1 * wetness
set landuse -1
wiggle]
end
to setup3 ;draw roads with 0 wetness, landuse 1
setc grey
ht
seth (random 2) * 90
pd
repeat ((random 25) + 75) [
set landuse 1
set water 0
fd 1]
end
to setup4 ;draw buildings with 0 wetness, landuse 2
setc black
ht
repeat (metro * 25) [
wiggle
if pc = 33 [
stamp black
set water 0
set landuse 2]]
end
to setup5 ;draw trees with random wetness, landuse 0
setc 66
ht
repeat ((10 - metro) * wetness * 5) [
wiggle
if pc = 33 [
stamp lime
set water ((random 5) + 5) + .1 * wetness]]
end
to wiggle ;supplies random movement when needed
seth (random 360)
fd 1
end
to storm ;turtles randomly drop water
setc random 10
repeat ((wetness) * 5) [
wiggle
if prog >= landuse [ ;water only dropped on buildings and roads
set water (water + .3 + purch * .1) ;based on progressiveness of community
checkcolor]]
ht
end
to wash
repeat 10 [
ifelse landuse > 0 [
set load (load + water) ;pick up water from road or building
set water 0]
[set water (water + load) ;drop water on unimproved land
set load 0]
wiggle]
set water (water + load) ;drop water load before turtle dies
die
end
to drain ;drains backyard floods into the river or lake
repeat (screen-height * 1.5) [
if (landuse = 0 and water > 12) [ ;pick up excess water where it doesn't belong
set load load + 7
set water water - 7
checkcolor]
if landuse = -1 [ ;drop water in river or lake
set water water + load
set load 0]
fd 1]
die
end
to flood ;spreads overfull river or lake
repeat (screen-width * 1.5) [
if ((landuse = -1) and (water > 20)) [ ;picks up water from overfull spot
set load load + 7
set water water - 7
checkcolor]
if ((landuse = 0) and (load > 0)) [ ;designates new water spot and drops water
set water water + load
set landuse -1
set load 0]
fd 1]
die
end
to checkcolor ;foliates, defoliates, dries or swamps
if landuse = 0 [ ;land based on its relative wetness
case water [
(water < 4) [stamp 33] ;defoliate
((water < 7) and (water >= 4)) [stamp 66] ;shrubbery
((water < 12) and (water >= 7)) [stamp 52] ;trees
(water > 12) [stamp blue]]] ;standing water
end
Observer procedures
patches-own [
water
landuse
]
turtles-own [load]
globals [
newnumber
purch
saved
]
;; setup procedure
;; called by the setup button
;; Initialize purchase, clear all, then setup the background, river, roads, lakes, buildings, and trees.
;;
to setup
set purch 0
ca
setup-background
setup-river
setup-lakes
setup-roads
setup-buildings
setup-trees
end
to setup-background
crt 147
ask-turtles [
ht
setxy 0 who
seth 90
setc 33
pd
repeat 170 [
fd 1
set landuse 0
set water random 5]
]
ct
end
to setup-river
crt ((prog + 1) * 2)
ask-turtles [
ht
setxy -83 73
setup1
]
ct
end
to setup-lakes
crt lakes
ask-turtles [
ht
setxy random screen-width random screen-height
setup2
]
ct
end
to setup-roads
crt metro * 13
ask-turtles [
setxy random screen-width random screen-height
setup3
]
ct
end
to setup-buildings
crt metro * 30
ask-turtles [
setxy random screen-width random screen-height
setup4
]
ct
end
to setup-trees
crt (10 - metro) * 20
ask-turtles [
setxy random screen-width random screen-height
setup5
]
ct
end
to go ;runs the simulation
repeat (10 - (random wetness))
[dry] ;random number of dry spells before storm based on climate
storm
if (count-patches-with [landuse = 0 and water > 12] ) > (.05 * count-patches-with [landuse = -1])
[drain]
if (count-patches-with [water > 20]) > 5
[flood]
end
to storm ;simulates rain storm
create-turtles-and-do 5000 [
setc gray
set load 0 ;creates world peace
setxy random screen-width random screen-height
storm ;turtles rain
wash] ;moves rain from buildings and roads if applicable
plot sum-of-patches [water] ;output to plot
diffuse water .80
output-data ;output to file
end
to dry ;simulates the community's use of the water table
ifelse prog = 3 [ask-patches [set water (max 0 (water - .02 * metro))]] ;this community uses grey water, reduce impact
[ask-patches [set water (max 0 (water - .04 * metro))]] ;this community does not use grey water
plot sum-of-patches [water] ;output to plot
output-data ;output to file
end
to drain
create-turtles-and-do screen-width [ ;creates one invisible turtle per width of the screen
set load 0 ;facing randomly up or down
setxy who 0
ht
seth ((random 2) * 180)
drain]
end
to flood
ifelse (random 2) = 1
[create-turtles-and-do screen-width [ ;creates one invisible turtle per width of the screen
set load 0 ;facing randomly up or down
setxy who 0
ht
seth ((random 2) * 180)
flood]]
[create-turtles-and-do screen-height [ ;creates one invisible turtle per height of the screen
set load 0 ;facing randomly up or down
setxy 0 who
ht
seth (90 + (random 2) * 180)
flood]]
end
to purchase ;simulates community buying water rights
if purch < 1 ;can only result in an advantage of 1
[set purch (purch + 1)]
end
to sell ;simulates community selling water rights
if purch > -1 ;can only result in a detriment of 1
[set purch (purch - 1)]
end
to output-data ;sends data to output que
type purch
type ","
print average-of-patches [water]
end
to save-data ;sends data to file
set-output-name (to-string ["Water Table" newnumber] ) ; reset the output window for data file clearing
set newnumber newnumber + 1
save-output
end
