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.
Code Block |
---|
language | py |
---|
title | Main calibration loop |
---|
|
# 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) |