This work demonstrates an integration of a water quality model with an optimization component utilizing evolutionary algorithms to solve for optimal (lowest-cost) placement of agricultural conservation practices for a specified set of water quality improvement objectives. The solutions are generated using a multi-objective approach, allowing for explicit quantification of tradeoffs.
Finding the cost-efficient (i.e., lowest-cost) ways of targeting conservation practice investments for the achievement of specific water quality goals across the landscape is of primary importance in watershed management. Traditional economics methods of finding the lowest-cost solution in the watershed context (e.g.,5,12,20) assume that off-site impacts can be accurately described as a proportion of on-site pollution generated. Such approaches are unlikely to be representative of the actual pollution process in a watershed, where the impacts of polluting sources are often determined by complex biophysical processes. The use of modern physically-based, spatially distributed hydrologic simulation models allows for a greater degree of realism in terms of process representation but requires a development of a simulation-optimization framework where the model becomes an integral part of optimization.
Evolutionary algorithms appear to be a particularly useful optimization tool, able to deal with the combinatorial nature of a watershed simulation-optimization problem and allowing the use of the full water quality model. Evolutionary algorithms treat a particular spatial allocation of conservation practices in a watershed as a candidate solution and utilize sets (populations) of candidate solutions iteratively applying stochastic operators of selection, recombination, and mutation to find improvements with respect to the optimization objectives. The optimization objectives in this case are to minimize nonpoint-source pollution in the watershed, simultaneously minimizing the cost of conservation practices. A recent and expanding set of research is attempting to use similar methods and integrates water quality models with broadly defined evolutionary optimization methods3,4,9,10,13-15,17-19,22,23,25. In this application, we demonstrate a program which follows Rabotyagov et al.’s approach and integrates a modern and commonly used SWAT water quality model7 with a multiobjective evolutionary algorithm SPEA226, and user-specified set of conservation practices and their costs to search for the complete tradeoff frontiers between costs of conservation practices and user-specified water quality objectives. The frontiers quantify the tradeoffs faced by the watershed managers by presenting the full range of costs associated with various water quality improvement goals. The program allows for a selection of watershed configurations achieving specified water quality improvement goals and a production of maps of optimized placement of conservation practices.
1. Prepare Watershed Model and Provide Input Data for Optimization
The total cost of a candidate solution is the sum of costs of conservation practices applied to watershed units ("hydrologic response units", or HRUs). The optimization program considers an optimal assignment of a single conservation practice from a particular set of conservation practices in every cropland HRU in the watershed. The sets of possible conservation practices assigned to an HRU are called allele sets.
2. Select Optimization Parameters
Figure 1. Setting optimization objectives and parameters.
Optimization parameters to be selected:
Preset: Select the watershed to be optimized. Clicking "Apply" selects entries from the presets file "watershed presets.csv" to fill control values on this screen.
Output Variable: Select the environmental objectives for optimization. As selected (N Outlet, P Outlet), this defines a 3-dimensional objective function: Nitrogen (Organic N + NO3 + NH4 + NO2) averaged for 5 years at the outlet, Phosphorus (Organic P + Mineral P) averaged for 5 years at the outlet, and the total cost of conservation practices. Note that this will create a 3-dimensional tradeoff frontier. Alternative output variables can be selected, where the multiobjective program is to minimize ({Output Variable}, Total Cost).
Population size: Set initial population size. This determines the initial number of candidate solutions. When "Seed with each allele" option is selected, candidate solutions representing a uniform application of each conservation practice specified in the allele set to all cropland HRUs in the watershed are created first. The remaining candidate solutions are created by a random assignment of conservation practices from the allele set to cropland HRUs. When selecting the "Seed with each allele" option, one needs to make sure that the initial population size is at least as large as the number of alleles in an allele set (23 in this demonstration).
Number of generations: Set the desired number of generations (iterations) for the optimization run (note that the run can be restarted).
Crossover probability: When two candidate solutions are selected for creating new candidate solutions, crossover probability specifies the probability that distinct new solutions are created (set to 1 for this demonstration).
Size of temporary population: This determines the number of new candidate solutions created. Processor resources are used most efficiently when this value is an integer multiple of the number of processor threads (16 in this demonstration).
Mutation probability: Specify the probability of random change in HRU assignment to another conservation practice from the allele set. (It is set to 0.03 for this demonstration).
Number of threads: Select the number of processors or threads used. 16 is used in this demonstration.
Curve No. calibration factor: This is provided from the SWAT model calibration.
Save Population in text file: This is important to select if one wishes to restart the optimization run after the specified number of iterations is completed. Checking this option produces a text file with the allele values of every HRU in every surviving candidate solution (individual). This can be read back in to restart and continue a run.
Secondary optimization parameters
First Year: Must be set to a year after start of historical weather information, and no later than 7 years before end of this data.
Price of Corn: Used with the yield loss equation to estimate the cost of fertilizer reductions.
Scoring Method: SPEA2 Archive. Scoring determines how likely a surviving individual is to be selected for crossover.
Purge Method: Dominated. Individuals which are worse in all 3 dimensions are dominated and purged.
HUC Source: Set to "Specified Location", meaning the value "7100006" from the following field "Watershed HUC" is used to find a row in the HUC Zone table. The value "07100006" is the eight-digit HUC code for the Raccoon watershed.
Cost Source: Set to "County (HRU Location Code)" to indicate that costs other than CRP will be determined by county FIPS codes in the practice costs table above.
Cost Source CRP: Set to "1 Location" to indicate that CRP cost will be determined by county FIPS codes in the practice costs table above.
SWAT version: SWAT2005
3. Representative Results
GeneticiSWAT.exe produces a log file showing the settings and results for all candidate solutions (individuals), as well as a "save" file which encodes the results from the final algorithm iteration and which can be used to restart the optimization run.
At this point, one can visualize the entire set of Pareto-efficient solutions (the tradeoff frontier) by following the steps below:
Figure 2. Screenshot for creating "snapshots" for 3-dimensional frontier visualization.
Output is a series of files which can be rendered all at once into image files by using POV-RAY program and selecting "Render", then "File Queue". The images can be used on their own or combined into a movie showing the algorithm progression.
Figure 3. Static visualization of the tradeoff frontier.
If desired, a movie showing the algorithm progression can be created by running "Framescanner.exe" and following these steps:
Each point in the frontier represents a watershed configuration (a specific assignment of conservation practices on a landscape). Maps of these configurations can be seen for the entire frontier by following these steps:
Figure 4. Screenshot of creating a map of each individual in the final frontier.
Exporting specific watershed configurations (individuals) of interest.
Often a question of interest is to select specific watershed configurations (individuals) achieving particular water quality objectives. For example, one may wish to find an individual in the frontier which reduces Nitrogen by 30% and Phosphorus by 20% relative to baseline loadings. MapSWAT allows one to search the frontier for the individual with the smallest Euclidean distance to the specified objective. This can be done by doing the following:
Figure 5. Screenshot of searching for a specific individual in the frontier based on water quality objectives.
Figure 6. Screenshot of search output
Figure 7. Screenshot of a sample map describing the selected individual in the frontier. Click here to view larger figure.
Exporting map data for further analysis is possible by following these steps:
Name of Program | Source | Description |
Rotator | CARD | Creates and fills an i_SWAT database with soil, weather, and management data for a watershed. |
Swat2005GA.exe | USDA Grassland, Soil & Water Research Laboratory | Watershed simulation model |
i_SWAT.exe | CARD | SWAT database interface |
GeneticISWAT.exe | CARD | Evolutionary algorithm SWAT controller. Incorporates GALib from http://lancet.mit.edu/ga/. |
MapSWAT.exe | CARD | Reads i_SWAT databases and shapefiles, produces images of generations and individuals. |
POV-Ray | Povray.org | Persistence of Vision raytracer. |
Framescanner.exe | Todd Campbell | PNG image to AVI converter |
Windows Live Movie Maker | Microsoft | Used to compress AVI to WMV |
Table 1. Table of programs required.
Name of File | Type | Description |
Raccoon GA.mdb | Access database | Structure and management descriptions of Raccoon watershed. Read by GeneticiSWAT and MapSWAT. |
watershed presets.csv | Text | Setting presets for GeneticiSWAT.exe and MapSWAT |
Alleles.csv | Text | List of allele sets for evolutionary algorithm. |
Raccoon Allele HRU.txt | Text | File created by GeneticISWAT listing those alleles determined to be cropland. Read by MapSWAT. |
Practice costs by subbasin Josh.mdb | Access Database | Costs by management practice and county. |
Terrace Zones.mdb | Access Database | Table [HUC Data] holds the terrace and yield zone numbers for the watershed. |
NRI Budgets.mdb | Access Database | Read by GeneticISWAT.exe for crop & machine tables which are not used in this run. |
phucrp 2008-12-15.dat | Text | Plant Heat Unit lookup table, not used in this run. |
Management.mdb | Access Database | Rotation lookup table, not used in this run. |
Raccoon GA 2011-09-28 1313.log, Raccoon GA 2011-09-29 0732.log, Raccoon GA 2011-10-07 0644.log | Text | Log files of GeneticISWAT run. |
Raccoon GA.wmv | Animation | 3d display of individuals by generation |
Subbasin.shp | ESRI Shapefile | Outlines of subbasins in the watershed. |
Raccoon Map.wmv | Animation | Display of dominant alleles for each subbasin for each individual on the frontier. |
Table 2. Table of sample files required.
We build an integrated simulation-optimization framework to search for Pareto-efficient sets of watershed configurations involving lowest-cost mix and location of agricultural conservation practices to achieve a range of watershed-level nutrient reduction objectives. A conceptual diagram of the simulation-optimization system is presented in Figure 8. Watershed simulation, including simulating the water quality impacts of agricultural conservation practices are handled by the hydrologic model, SWAT2005, coupled with a Windows-based database control system, i_SWAT6,8. The optimization component operates on the hydrologic response units (HRUs) of SWAT and employs the logic of an evolutionary algorithm26 to find the allocation of conservation practices which simultaneously minimizes nutrient loadings (N, P, or both) and the cost of conservation practices. After the algorithm iterations are terminated, a set of surviving individuals represents the approximate tradeoff frontier. Since two nutrients are being considered simultaneously (nitrate-N and total phosphorus), we obtain a three-dimensional tradeoff frontier. Each individual point on the tradeoff frontier prescribes a particular configuration of conservation practices for each decision-making unit (cropland HRU) in the watershed. To see which conservation practices are selected, we have to specify nutrient targets and then search the tradeoff frontier for individual configurations which meet the nutrient reduction criteria. The location and the mix of conservation practices selected can be mapped back to the field-level spatial decision-making units in the watershed (if such data is available at the time of creating HRUs). Our approach, which specifies a particular mix and distribution of conservation practices, can provide policymakers with tools for better targeting of conservation policy aimed at water quality improvements. In terms of implementation, armed with the algorithm’s prescriptions, policymakers can offer targeted payments (method suggested by11), or elicit bids and accept or reject them using modeling results as guidance. Of course, the specific set of practices targeted depends on particular water quality goals and the specific watershed studied. However, future improvements in the hydrologic model and the economic cost estimates can readily be incorporated into the simulation-optimization system. The framework developed is readily generalizable and is capable of providing useful and policy-relevant insight into a complex problem of nonpoint source pollution reductions.
Figure 8. Overall flow of the experiment.
The authors have nothing to disclose.
This research was funded in part from support received from the U.S. Environmental Protection Agency’s Targeted Watersheds Grants Program (Project # WS97704801), the National Science Foundation’s Dynamics of Coupled Natural and Human Systems (Project #DEB1010259-CARD-KLIN), and the U.S. Department of Agriculture-National Institute of Foodand Agriculture’s Coordinated Agricultural Project (Project # 20116800230190-CARD-).