You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

First of all, we will keep the time series corresponding to the measured data and to the results of the original model set up in a list. This variable will be used later on to compare them quickly with each other.

Create a list containing the already known time series
# Save measurements and initial model results in a list of time series to compare 

timeSeriesToCompare = [measuredTimeSeries, waterlevelResults]

The model calibration will be done by changing the less reliable parameters from the loaded model. Let’s assume that these factors are the flow boundary condition at the node Boxbergen, and the roughness of the main tributaries leading to Zwolle:

The boundary conditions are not known yet in the scripting environment as variables. The complete name of the flow boundary condition at Boxbergen is, as shown in the previous figure, composed by the name of the location and the current value (Boxbergen - Q:25.064 m^3/s). However, the function GetBoundaryDataByName defined in API library SobekWaterFlowFunctions already takes this into account, so you don't have to worry about it. Assign the boundary data object corresponding to the B.C. Boxbergen to the variable bcCalibration. Also, we assume that this parameters could have a value between 8 and 12 m3/s. Create therefore a list containing the cases in thatrange of variation:

First parameter used in the calibration: B.C. at Boxbergen
# Selection of parameters used for calibration and their range of variation
bcCalibration = GetBoundaryDataByName(flowModel, "Boxbergen")
rangeBC = [8, 10, 12]

The other parameter that will be used to calibrate the model is the roughness of the main cross section type. We will assume that this parameter can change from 24 to 34 m1/3 s-1 in steps of 2, so a total of 6 different cases.

Second parameter used in the calibration: roughness
 roughnessMain = GetItemByName(flowModel.RoughnessSections, "Main").RoughnessNetworkCoverage
rangeRoughness = [24, 26, 28, 30, 32, 34] 

 

The property Flow of this object contains the current numeric value of this constant flow boundary. We will save this number in the variable bcInitialValue.

Selecting Boundary Condition for calibration
bcCalibrationName = "Boxbergen"
bcCalibration = GetBoundaryDataByName(flowModel,bcCalibrationName)
bcInitialValue = bcCalibration.Flow

If you want to see how the BC is modified by the script you can look at the corresponding item on the project explorer view. Additionally, you can double click on this item to open the corresponding editor view.

The other object that will be used for tuning the model up is the roughness at the main tributaries. First of all, this object should be available in the scripting environment. Look for the object RoughnessType in the online help, and add the corresponding import to the first region of the script. The roughness at the main tributaries is the first object (so the index is [0]) in the list of roughness items, as shown in the picture above. The object to grab is the corresponding network coverage. You can save the current value for future reference, as done before with the BC.

Selecting Roughness for calibration
roughnessMain = flowModel.RoughnessSections[0].RoughnessNetworkCoverage
roughnessInitialValue = roughnessMain.DefaultValue

Similarly, if you double click on the item in the project explorer panel, you will open the corresponding editor view and will be able to see how it automatically changes while the calibration loop is being run.

  • No labels