HEC-HMS version 4.10 was used to create this tutorial.

Download the Initial project files here - Initial.zip

Background

An optimization trial is a simulation type that can identify model parameters which improve the model results compared to observations. Each trial is composed of a basin model, meteorologic model, and information about the simulation time window and time step. The trial also includes selections for the objective function, search method, and adjustable parameters.  Optimization involves automated parameter adjustments so that the simulated results are similar to observations.  The objective functions measure the goodness of fit between the simulated results and observed data.  In this tutorial, you will learn how HEC-HMS can be used to optimize a model by adjusting unit hydrograph and loss rate parameters, given measured discharge and precipitation data. 

Overview

In this workshop you will set up and compute an optimization trial and review results of the trial and make additional trials as necessary.

  1. Open HEC-HMS and select the File menu. Choose the Open menu option and select the Optimization Workshop project.
  2. Create a discharge gage in HEC-HMS following information in this tutorial -  Creating Time Series Data. The observed flow gage will be used by the optimization trial, results from the simulation will be compared to the observed flow gage and an objective function value will be computed for each iteration during the optimization. Name the discharge gage PNXP, the flow data is located in the ...\Initial\Optimization_Workshop\data\observe.dss file.
  3. Open the Punxsutawney basin model by clicking on it in the Watershed Explorer. Click on the subbasin Mahoning Cr in the Watershed Explorer or in the basin map to make it the selected element; its Component Editor will automatically load.
  4. Click on the Options tab in the Component Editor. Select the PNXP gage, created in step 2, for the Observed Flow as shown below.
    Adding observed flow to a Subbasin Element
  5. Create three new simulation runs and compute them to make sure they function correctly. All three will have the same basin model, Punxsutawney, and the same meteorologic model, Specified Gage Wt. Each run will use a different control specifications: Apr 94, May 95, and May 96 (use descriptive names for the simulation runs, Run Apr 94, Run May 95, and Run May 96) as shown below. Run the simulations and look at the results. Ideally, you would have a separate basin model for each simulation to account for initial conditions (initial baseflow and channel flow).
    Simulation runs in the Watershed Explorer
  6. Open the Create an Optimization Trial wizard by selecting the Compute | Create Compute | Optimization Trial.
  7. The first trial will be used to optimize the model to the April 1994 flood event. Choose a name for the trial (Opt Apr 94), and then select the Punxsutawney basin model, and the Specified Gage Wt meteorologic model. 
  8. Select the new optimization trial in the Watershed Explorer (go to the Optimization Trials folder on the Compute tab) and move to the Component Editor. Verify that the correct Basin Model and Meteorologic Model are selected. Enter a start and end date that match the control specifications for the Apr 94 simulation and select a Time Interval of 1-hour as shown below.
    Optimization Trial Component Editor
  9. On the Search tab, select the Simplex method, set a tolerance of 0.01, and a maximum number of iterations of 20 as shown below. The optimization simulation has a feature where the optimization search will pick up where it left off if the simulation reaches the maximum number of iterations or the tolerance is met. 
    Set the search criteria
  10. Switch to the Objective tab. Verify that the objective function will be evaluated at the Mahoning Cr subbasin element. Select Minimization as the goal, and set the statistic to Peak-Weighted RMSE.  Make sure the objective function will be evaluated from the beginning to the end of the simulation time window as shown below.
    Configuring the Objective function tab
  11. Place the mouse pointer on top of the Opt Apr 94 optimization trial's name in the Watershed Explorer, click the right mouse button, and select the Add Parameter menu option as shown below. A new parameter node will be added to the Watershed Explorer. Add three more parameters the same way so there are a total of four parameters. 
    Adding a parameter to the Optimization Trial
  12. Click on the first parameter node and then move to the Component Editor. First select the Mahoning Cr subbasin element. Select the Clark Unit Hydrograph - Storage Coefficient for the parameter as shown below.
    Setting Parameter 1 to the Clark Storage Coefficient
  13. Click on the other parameter nodes and select the Clark Unit Hydrograph - Time of Concentration, Initial and Constant - Constant Rate, and Initial and Constant - Initial Loss parameters as shown below. In practice, edit the minimum and maximum values to reflect a reasonable parameter range for the watershed.
    Setting Parameter 2 to the Clark Time of Concentration
    Setting Parameter 3 to the Constant Rate
    Setting Parameter 4 to the Initial Loss

    Notice the default minimum and maximum parameter ranges. These values exceed reasonable parameters for the Mahoning Cr watershed. A reasonable range for the Clark Storage Coefficient is between 10 hours and 25 hours, Clark Time of Concentration is between 5 hours and 30 hours, constant loss rate is between 0.05 inches/hour and 0.4 inches/hour, and initial loss is between 0 inches and 2 inches. Edit the minimum and maximum values before running the optimization trial.

  14. Use the Compute toolbar to select and compute the optimization trial as shown below.
    Compute the Optimization Trial
  15. You should get a Warning message, WARNING 17101:  Simplex search failed to converge after 20 iterations. This message tells us the optimization could not converge on a final parameter set after 20 iterations (the search tolerance was not met). Increase the maximum number of iterations to 100 and rerun the optimization trial. Notice the compute picks up at iteration 21. 
  16. The compute progress window is shown below. Notice the search converged at 85 iterations. 
    Optimization compute progress window
  17. Switch to the Results tab of the Watershed Explorer and examine the various results for the optimization trial.
  18. Open the Objective Function Summary table to compare the volume, peak flow, and time of peak between the simulated and observed hydrographs.
    Optimization trial summary results
  19. Open the Optimized Parameters table to examine initial values and optimized values. Notice the final constant loss rate value is 0.05 inches/hour. This value is at the minimum value we set as reasonable for the watershed. You could try decreasing the minimum on the Parameter 3 tab and rerunning the trial. The model results will improve, but such a low infiltration rate for the watershed indicates some possible deficiencies with the precipitation being applied to the model. 
    Initial and final parameters
  20. You can also assess the model's goodness of fit by simply looking at the time-series graph as shown below. Choose the Observed Data graph. 
    Simulated and observed hydrograph
  21. The Objective Function graph shows the objective function value at each iteration in the search process.

    Objective function plot
  22. You can open a plot of each parameter to see how the parameter value varied for each iteration (parameter from the best node in the simplex). The figure below shows the results for the Clark Unit Hydrograph - Storage Coefficient.
    Plot of the Clark Storage Coefficient value during the optimization search
  23. You can create optimization trials for the other two events by creating a copy of the Opt Apr 94 optimization trial. Be sure you update the start and end date and times used to run the optimization trial and to compute the objective function. Because only one basin model was added to the project, you will need to take care of the initial baseflow for the May 1995 and May 1996 optimization trials. Add a fifth parameter to both the Opt May 95 and Opt May 96 optimization trials. Choose the Recession - Initial Baseflow parameter and set it to 300 for the Opt May 95 optimization trial and 280 for the Opt May 96 optimization trial as shown below. Also, make sure to Lock the initial baseflow parameter, we do not want the optimization trial to adjust the initial baseflow. 
    Example showing how to use the Locked option
  24. Run the two new optimization trials. You might need to increase the maximum iterations for the trials. Experiment with different objective functions and consider modify the minimum and maximum parameter values. The figure below shows results from the two additional optimization trials (contained in the project below). The final parameter set contains a number of parameters that were at the end of the minimum and maximum range, which indicates additional thought and experimentation are needed. 
    Optimization results for the May 95 trial
    Optimization results for the May 96 trial

Download the Final project files here - Final.zip