Showing posts with label SWAT Model. Show all posts
Showing posts with label SWAT Model. Show all posts

Sunday, July 29, 2012

Application of genetic algorithm for watershed model [SWAT] calibration:

Introductory words:
Watershed models are parameter driven. Therefore, getting a better model performance we need to optimize the parameters. A sensitivity test could help identifying the set of parameter most sensitive parameter for specific watershed. A cleaver idea would be to list down all the parameter in a text file and tune individual parameters and rerun the model each time to see the performance.


Manuel calibration with MATLAB
After building a SWAT model all the input files will be stored in the txtinout folder which should be located in the scenario folder. [Considering discharge and water quality modeling]
Step 1: Copy the input files from txtinout folder to a folder name sensin or we can rename the txtinout folder with the name sensin.
Step 2: make an observe discharge file with the sub basin number [as example “obs_daily7.csv] in put in the folder name user input.
Step 3: Check the ifinfo.txt file located in the user_inputs folder and tunes the specifications with your watershed information. and finally run 'mcalib.m' file.


The good thing is all the parameters are listed in par_ file where we can change parameter and rerun the model until a certain level of accuracy is achieved.

[Applying Genetic algorithm]
Manuel calibration is often time consuming and setting a range of parameter needs a lot of iteration. In that case we can select a set of parameter and the computer does the iterations. There are various optimization algorithms are now available. Here I am going to discuss about AMALGAM. In this video present contribution, the a Multi algorithm genetically adaptive multiobjective (AMALAGM) approach was applied [J.A. Vrugt and B.A. Robinson, 2007]. AMALGAM is a  multi-objective optimization method that searches efficiently for the Pareto-optimal front by applying four alternative multiobjective algorithms based on evolution theory.

AMALGAM comprises four different genetic algorithms, they are:

(i) non dominated sorted genetic algorithm-II (NSGA-II) [Deb et al., 2002], (ii) particle swarm optimization (PSO) [Kennedy and Eberhart, 1995], (iii) adaptive Metropolis search (AMS) [Haario et al., 2001], and (iv) differential evolution (DE) [Storn and Price, 1997].By crossing information between algorithms and assigning them more or less importance according to their past performance in the optimization run, the AMALGM approach is able to maintain efficiency and outperform the multi objecive algorithms it employs [J.A. Vrugt 118 and B.A. Robinson, 2007].


References:
Deb, K., A. Pratap, S. Agarwal, and T. Meyarivan (2002), A fast and elitist multiobjective  genetic algorithm: NSGA-II, IEEE Transactions on Evolutionary Computation, 6(2), 182-197.
Haario, H., E. Saksman, and J. Tamminen (2001), An adaptive Metropolis algorithm, Bernoulli, 470 7(2), 223-242.
Kennedy, J., and R. Eberhart (1995), Particle swarm optimization, IEEE International Conference on Neural Networks - Conference Proceedings, 4, 1942-1948.
Vrugt, J. A., and B. A. Robinson (2007), Improved evolutionary optimization from genetically adaptive multimethod search, Proceedings of the National Academy of Sciences, 104(3), 708.

Thursday, June 28, 2012

Hydrologic model [SWAT] development based on open source data

[1] Hydrological Modeling:

Hydrologic models are simplified; conceptual representations of a part of the hydrologic cycle [1A].They are primarily used for hydrologic prediction and for understanding hydrologic processes. Two major types of hydrologic models can be distinguished. (A) Stochastic Models. These models are black box systems, based on data and using mathematical and statistical concepts to link a certain input (as example rainfall) to the model output (for instance runoff). Commonly used techniques are regression, transfer functions, neural networks and system identification. These models are known as stochastic hydrology models.(B)  Process-Based Models. These models try to represent the physical processes observed in the real world. Typically, such models contain representations of surface runoff, subsurface flow, evapotranspiration, and channel flow, but they can be far more complicated. These models are known as deterministic hydrology models. Deterministic hydrology models can be subdivided into single-event models and continuous simulation models. There are various type of hydrological models are now a days available in public domain [1B][1C]

Citations:


[2] SWAT model and its application:
SWAT model (Arnold et al., 1998) is a semi-distributed, continuous watershed simulator operating on a daily time step [2A]. It is developed with the joint effort with USDA and Texas University for assessing the impact of management and climate on water supplies, sediment, and agricultural chemical yields in watersheds and larger river basins. The model is semi-physically based, and allows simulation of a high level of spatial detail by dividing the watershed into a large number of sub-watersheds. The major components of SWAT include hydrology, Water supply, Water quality, weather, erosion, plant growth, nutrients, pesticides, land management, and stream routing. The robust application of SWAT model has extended all over the world because of its diversified application [2B].  Government agencies like EPA USDA  uses SWAT for tracking environmental problems like water quantity, water quality, nutrient cycling and in stream process ete[2C, 2D,]. Wider application of SWAT is mostly in the government agency and research organization of USA and EU.  . SWAT model output often uses indirectly as it has the flexibility of coupling with other models. A large number of climate and land use studies has been done all over the world with SWAT model for land use and climate change study [2E, 2F]. Large scale European Projects also uses SWAT as a central hydrologic model frequently [2G] Here is an example of SWAT model application in the Himalayan region for impact assessment of climate change [2H]






Citations



[3] Watershed Delineation
Watershed delineation is required to provide a boundary of the watershed. SWAT uses ArcHydro algorithm for watershed delineation [3A]. The watershed delineation carries out advanced GIS functions to aid the user in segmenting watersheds in to several ‘hydrologically’ connected sub watersheds for use in watershed modeling in SWAT. [3B] There are two methods for watershed delineation in SWAT model, one is the DEM-based method, which is based on the DEM of the study area  and the other is the pre-defined method in which users can define the reaches and sub basins manually. Most of the researchers use the first method at present, which has high precision only in the area with certain terrain slope [3C].  During watershed delineation flow direction and flow accumulation process is done.





Citations:





[4] HRU analysis
Hydrological response units are areas within a watershed that respond hydrologically similarly to given input. It is a means to representing the spatial heterogeneity of a watershed.  With the introduction of hydrologic response unit (HRU), it is possible to expect similar hydrologic behaviour in each unit, which can be modeled easily. Plenty of hydrological models use HRU as unit response for a sub basin [4B][4C] .





Citations


[5] Weather Inputs and First simulation
The weather data definition window is divided in six tabs. (1)  Weather Generator (2) Rainfall Data (3) Temperature Data (4) Solar Radiation Data (5) Wind Speed data and (6) Relative Humidity Data. The first section for weather data is for the location of stations. The interface will not allow the user to perform other input data processing until the Weather Generator Data is defined. The other five sections allow the user to choose between simulated or measured data for specific type of data. We will use only precipitation and temperature data for this case study and let the model generate other data.





[6] Primary results and need of calibration
We obtained a daily discharge time series from 1996 to 2010 for Mendoza river watershed at downstream (pointed with the GPS at the sub basin no 7).  We will simulate the model 6 years from 1999 to 2004. First 3 years from 1996-1998 we will keep for warming up period it will stabilize some initial model parameters. And the remaining period 2005 to 2010 we will keep for validation. We will discuss with daily and monthly time step with some hydrograph analysis. Together with visual observation we will discuss with statistical performance of hydrological model. For this post we will not go in detail the calibration process which will be done in another complete post.





[7] Running SWAT in R environment
The statistical programming tool ‘R’ is also open source [7A]  In order to get a better result from SWAT we need to test the parameter ranges and each time we have to run (for Manuel calibration). If we use excel we have to plot each time which is time consuming and tedious. Therefore, we can program the statistical performance equations like NSE MSE or Percent Bias etc etc. After that changing the basin parameter we can re run the model without plotting in excel. Recently there is a R package and a multi objective genetic algorithm tool in R is available [7B][7C]





Citations:
[7C] Multi objective Automatic Calibration of SWAT Using NSGAII in R


In the next post I will focus three issues. They are [1] SWAT calibration in MATLAB environment. [2] Application of genetic logarithm for SWAT calibration [3] Spatial map preparation from SWAT output. SO PLEASE KEEP TUNED...


Acknowledgements: Contribution of Dr. John Joseph (from South Texas Uni, USA) greatly acknowledged for sharing his ideas to calibrate SWAT in R environment and special thanks to Rocio Julia and Gissela for sharing the observed data file of Mendoza river watershed which is the part of their M.Sc thesis work.