This page is part of the tutorial on Applying the Simplex Optimization Search Method for Single Event Calibration. If you don't have the project model open, you can download it at the link below.

Download initial project files here.

Set up the observed flow and run the model

  1. 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 ...\Simplex_Initial\Optimization_Workshop\data\observe.dss file. Set the pathname to refer to the PNXP flow gage, as shown below.
    Selecting observed flow gage
  2. 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.
  3. 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
  4. 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. You can run the three computes simultaneously through Compute | Multiple Compute menu. Note that, 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
  5. Inspect the observed and modeled outflow for Run Apr 94 shown below. Note that there is not a good match between the modeled and observed flow, which is also reflected in the poor calibration statistics in the Summary Table.
    Initial results for Apr94 run

Set up optimization trials

  1. Open the Create an Optimization Trial wizard by selecting the Compute | Create Compute | Optimization Trial.
  2. 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. 
  3. 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
  4. 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 maximum number of iterations is increased or tolerance is decreased after the simulation reaches the maximum number of iterations or the tolerance is met. 
    Optimization Search method and criteria
  5. 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
  6. 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
  7. 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
  8. 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.
    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.  

In practice, the minimum and maximum values should reflect a reasonable parameter range for the watershed. 

Edit the minimum and maximum values before running the optimization trial.
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.

You can consult Applying HEC-HMS GIS Parameter Estimation Tools for more information on parameter estimation.

Compute optimization trials for Opt Apr 94 and examine the results

  1. Use the Compute toolbar to select and compute the optimization trial as shown below.
    Compute the Optimization Trial

    Go to the Results tab, expand the Opt Apr 94 node and select the Objective Function node to open the graph of the objective function values. 

    Discussion Question: Based on examining the evolution of the objective function value, do you believe it found the best mix of parameter values?

    The graph below shows the objective function value at each step in the search process for the first optimization trial. Hint: you can click on the Axis tab from the Edit | Plot Properties menu to change the range of X and Y axis.

    Objective function evolution for 20 optimization iterations

    For a good search evolution, the value of the objective function should decrease.  The search results are not valid if the objective function fails to decrease or fluctuates wildly.  In this graph it appears that the objective function is on its way to stabilizing but it still fluctuates considerably.  In addition, there are several warnings that the compute did not converge within the specified maximum number of iterations, so it is likely that finding the minimum will require additional iteration. It would be better to make the search tolerance smaller and increase the number of maximum iterations allowed and then recompute the optimization trial.

    Note that the number of evaluations is higher than the number of iterations (20), because the Simplex search algorithm performs multiple evaluations of the objective function at each iteration (see User's Manual Model Optimization).

  2. 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 200 and rerun the optimization trial. Notice the compute picks up at iteration 21. 
  3. The compute progress window is shown below. Notice the search converged at 106 iterations. 

  4. Switch to the Results tab of the Watershed Explorer and examine the various results for the optimization trial.
  5. Open the Objective Function Summary table to compare the volume, peak flow, and time of peak between the simulated and observed hydrographs. Your results might look slightly different. 
    image-2023-3-5_16-42-50.png
  6. 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. 

  7. 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. 
    Observed Data graph
  8. The Objective Function graph shows the objective function value at each evaluation in the search process. 

    Objective function evolution for 200 iterations

    The figure below zooms in into the final iterations. 
  9. 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.
    Parameter 1 (Clark Storage Coefficient)

Compute optimization runs for May 95 and May 96 events

  1. 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 (the time window for the 1995 trial should be 17May1995 01:00 to 23May1995 00:00 and the time window for the 1996 trial should be 29Apr1996 01:00 to 07May1996 00:00). Add a fifth parameter to both the Opt May 95 and Opt May 96 optimization trials. Choose the Recession - Initial Discharge 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
  2. Run the two new optimization trials for the May95 and May96 events. Remember to update the time window. You might need to increase the maximum iterations for the trials. Experiment with different objective functions and consider modifying the minimum and maximum parameter values. The figure below shows results from the two additional optimization trials (contained in the final project file below under Best May 95 and Best May 96 results). 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.

    image-2023-3-6_8-2-12.png



Download final project files here.

You can now answer some questions based on this workshop: Proceed to questions

Return to Applying the Simplex Optimization Search Method for Single Event Calibration.