Water demands can be met by numerous sources of water. AWASH performs the allocation of water by solving an optimization problem resulting in the least costly solution to meet water demands under the environmental constraints. In this notebook, we conduct a sensitivity analysis to the choice of cost model for water.
Water use estimates are generally known at facility-, municipality- or county-level (e.g. USGS). To relate these numbers to the natural system, an optimization problem is solved to determine the withdrawals at each canals linking nodes of the network (gauges) to the counties, and groundwater extractions.
Two situations are considered here: 1. cost is uniform, 2. cost is proportional to the relative elevation of the point of source and point of use. We explore four scenarios:
A. SW: 1 | GW: 1
B. SW: 2 | GW: 1
C. SW: 1 | GW: 2
D. SW: 2 | GW: 2
In [1]:
cd("../../src/");
include("nui.jl");
include("lib/readconfig.jl");
config = readconfig("../configs/standard-1year.yml")
# setting extraction cost to 0 (option 1: cost is uniform)
config["watercost-extraction"] = false;
config["watercost-treatment"] = false;
include("optimize-waterallocation.jl");
include("simulate.jl");
# getting volumes and costs at the county level from the simulation
sw11 = getdata(:Allocation, :swsupply);
swc11 = getdata(:WaterCost, :swcost);
gw11 = getdata(:Allocation, :gwsupply);
gwc11 = getdata(:WaterCost, :gwcost);
In [2]:
# setting extraction cost proportional to relative elevation (option 2)
config["watercost-extraction"] = true;
config["watercost-treatment"] = false;
include("optimize-waterallocation.jl");
include("simulate.jl");
# getting volumes and costs at the county level from the simulation
sw22 = getdata(:Allocation, :swsupply);
swc22 = getdata(:WaterCost, :swcost);
gw22 = getdata(:Allocation, :gwsupply);
gwc22 = getdata(:WaterCost, :gwcost);
In [3]:
# comparison with usgs estimates - loading the data
recorded = readtable(datapath("extraction/USGS-2010.csv"));
swusgs = recorded[:, :TO_SW] * 1383. / 12 *config["timestep"] * numsteps;
gwusgs = recorded[:, :TO_GW] * 1383. / 12 *config["timestep"] * numsteps;
In [4]:
# verifying that demands are met
include("mapping.jl")
println("Total differences between USGS and model case 1: ", sum(abs(swusgs.data+gwusgs.data-sum(sw11+gw11,2))), " 1000m3")
println("Total differences between USGS and model case 2: ", sum(abs(swusgs.data+gwusgs.data-sum(sw22+gw22,2))), " 1000m3")
#mapdatacty(swusgs.data -sum(sw2+supw2,2), true)
In [5]:
# comparing case 11 and case 22
println("Total volume model case 11: ", sum(gw11)+sum(sw11), " 1000m3")
println("Total volume model case 22: ", sum(gw22)+sum(sw22), " 1000m3")
println("Total sw volume model case 11: ", sum(sw11), " 1000m3")
println("Total sw volume model case 22: ", sum(sw22), " 1000m3")
println("Total gw volume model case 11: ", sum(gw11), " 1000m3")
println("Total gw volume model case 22: ", sum(gw22), " 1000m3")
println("Total sw volume differences between model case 11 and 22: ", sum(abs(sw11-sw22)), " 1000m3")
println("Total gw volume differences between model case 11 and 22: ", sum(abs(gw11-gw22)), " 1000m3")
In [6]:
# Reliance sw option 11
mapdatacty(sum(sw11,2))
Out[6]:
In [7]:
# Reliance sw option 22
mapdatacty(sum(sw22,2))
Out[7]:
In [8]:
# Comparison of reliance on surface water between option 11 and 22
mapdatacty(sum(sw11-sw22,2),true)
Out[8]:
Counties in red use more surface water when extraction costs are taken in consideration.
In [9]:
# Reliance gw option 11
mapdatacty(sum(gw11,2))
Out[9]:
In [10]:
# Reliance gw option 22
mapdatacty(sum(gw22,2))
Out[10]:
In [11]:
# Comparison of reliance on groundwater between option 11 and 22
mapdatacty(sum(gw11-gw22,2),true)
Out[11]:
In [12]:
# Percentage of sw option 11
mapdatacty(sum(sw11,2)./sum(sw11+gw11,2)*100)
Out[12]:
In [13]:
# Percentage of sw option 22
mapdatacty(sum(sw22,2)./sum(sw22+gw22,2)*100)
Out[13]:
In [14]:
# Percentage of sw option 22
mapdatacty(sum(gw22,2)./sum(sw22+gw22,2)*100)
Out[14]:
In [15]:
# Comparison percentage of reliance on surface water
mapdatacty(sum(sw11,2)./sum(sw11+gw11,2)*100-sum(sw22,2)./sum(sw22+gw22,2)*100, true)