Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagepy
titleCalculate goodness of current model settings
# Deviation of current model results with respect to measurements
roughnessInitialValue = roughnessMain.DefaultValue
bcInitialValue = bcCalibration.Flow
warmUpTimeSteps = 20
dev = GetAverageDeviation(measuredTimeSeries, waterlevelResults , startAt = warmUpTimeSteps)
listCalibration = [[bcInitialValue, roughnessInitialValue, dev]]

  

We are now ready to build the main loop corresponding to the model calibration.

If you want to see how the BC is calibration parameters (BC at Boxbergen and roughnesss of the section type main) are modified by the script, you can look at the corresponding item items on the project explorer view (only for the BC). Additionally, you can double click on this item the items on the project explorer to open the their corresponding editor view.

The other object that will be used for tuning the model up is the roughness .You can save the current value for future reference, as done before with the BC.

Code Block
languagepy
titleSelecting Roughness for calibration
roughnessMain = flowModel.RoughnessSections[0].RoughnessNetworkCoverage
roughnessInitialValue = roughnessMain.DefaultValue

This is not necessary though.

 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.