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)
Out[15]:
We see that when we do consider extraction cost, counties bordering the atlantic ocean are relying entirely on gw.
In [16]:
R"par(mfrow=c(2,1))"
R"par(mar=c(4,4,2,0))"
sw11prct = sum(sw11,2)./sum(sw11+gw11,2)*100
sw22prct = sum(sw22,2)./sum(sw22+gw22,2)*100
R"hist($sw11prct, xlab='sw in %', main='without extraction cost',breaks=20,ylim=c(0,1500))";
R"hist($sw22prct, xlab='sw in %', main='with extraction cost',breaks=20,ylim=c(0,1500))";
Hereafter, we investigate how this depends on the quantity of demanded water.
In [17]:
R"par(mfrow=c(2,1))"
R"par(mar=c(4,4,1,0))"
x = swusgs + gwusgs;
R"plot($x,$sw11prct-$sw22prct, xlab = 'demand', ylab = 'difference in % of surface water withdrawals')";
x = log10(swusgs + gwusgs);
R"plot($x,$sw11prct-$sw22prct, xlab = 'log10(demand)', ylab = 'difference in % of surface water withdrawals')";
A few of the very large users (> 1e9 m3/year), who rely on surface water in case 11, are using groundwater in case 22. I do not believe it is possible to conclude anything else.
The last aspect is the cost of water. We plot hereafter the cost per 1000m3 of water to understand where it was not possible to withdraw water without pumping water uphill
In [18]:
# Surface water extraction cost per 1000m3
mapdatacty(sum(swc22,2)./sum(sw22,2))
Out[18]:
In [19]:
# Ground water extraction cost per 1000m3
mapdatacty(sum(gwc22,2)./sum(gw22,2))
Out[19]:
In [20]:
# Ground water extraction cost per 1000m3
mapdatacty(log10(sum(gwc22,2)))
Out[20]:
In [ ]: