The possible values that the calibration parameters may have, can be indicated in different ways, for example, through their respective statistical distributions. However, as indicated before and for the sake of simplicity, in this tutorial, let’s assume that only a limited amount of values is possible for each of them, and that the possible combinations of those cases are equally likely.
The kernel of the calibration algorithm then be a double loop with which we will iterate along all possible combinations of the parameters used in the procedure, BC at Boxbergen and roughness for the main type.
Code Block | ||||
---|---|---|---|---|
| ||||
# Main calibration loop for bcValue in rangeBC: # Adjust boundary condition value bcCalibration.Flow = bcValue for roughnessValue in rangeRoughness: # Adjust default roughness value for roughness section Main roughnessMain.DefaultValue = roughnessValue RunModel(flowModel, showDialog=True) # Add deviation of results of current run with respect to measurements calibResults = GetTimeSeriesFromWaterFlowModel(flowModel, calculationPoint, "Water level") deviation = GetAverageDeviation(measuredTimeSeries, calibResults, startAt = warmUpTimeSteps) listCalibration.append([bcValue, roughnessValue, deviation]) # Add timeseries to timeSeriesToCompare list timeSeriesToCompare.append(calibResults) |
...