Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
HTML |
---|
<script type="text/javascript"> AJS.toInit(function() { // unbind directly-embedded images AJS.$("img.confluence-embedded-image").unbind("click.fb"); }); </script> |
scrollbar |
---|
Create a new region for this section of the script.
We will create a new graph to plot all the results corresponding to the calibration procedure. We start by creating a new line series corresponding to the results of the initial model set up. Remember that the first element (with index 0) of the list timeSeriesToCompare corresponds to the measurements. Therefore, the results for the initial set up are kept in the second element (with index 1) of the list.
Code Block | ||||
---|---|---|---|---|
| ||||
lineFirstResults = CreateLineSeries(timeSeriesToCompare[1]) lineFirstResults.Title = "Initial model" lineFirstResults.ShowInLegend = True lineFirstResults.PointerVisible = False lineFirstResults.Color = Color.LightGreen series = [lineFirstResults] |
Next, we will add an additional line series for each of the combinations of the calibration parameters. All these curves will be, in principle, drawn with the same color, since the goodness of the fit will be quantitatively calculated later on, and not in a qualitative visual manner, based on this chart. This common color will be however different from the one previously used for the initial model set up. Keep in mind that the first time series stored in timeSeriesToCompare (corresponding to index 0) is the one holding the measured data. And the second time series (index 1) corresponds to the initial model set up. The simulations corresponding to the calibration start at the third element (index 2) of timeSeriesToCompare.
Code Block | ||||
---|---|---|---|---|
| ||||
for timeseries in timeSeriesToCompare[2:]: lineResults = CreateLineSeries(timeseries) lineResults.ShowInLegend = False lineResults.Color = Color.Orange lineResults.PointerVisible = False series.append(lineResults) lineResults.ShowInLegend = True lineResults.Title = "Calibration results" |
The last two lines in the code above add the very last calibration series to the legend of the chart, under a generic name "Calibration results". The reason that this is done outside the loop is to avoid getting one entry in the legend for each calibration simulation (in total 18).
Next, the measured data will be added to the plot as a point series. Subsequently, the chart object is created (but still not shown).
Code Block | ||||
---|---|---|---|---|
| ||||
# create series for measurements measurementsSeries = CreatePointSeries(measuredTimeSeries) measurementsSeries.Title = "Measurements" measurementsSeries.Color = Color.Red measurementsSeries.Size = 4 measurementsSeries.LineVisible = True measurementsSeries.LineColor = Color.Black series.append(measurementsSeries) chartCalibration = CreateChart(series) |
The chart as a whole is now customized with different enhancements:
- A name is added to the chart (view that will be opened later on).
- A title is added to the graph, and then made visible, as well as the legend of the chart (both objects are, by default, invisible).
- Both axes get a title and the range for the vertical one (LeftAxis) is modified.
Finally, the view corresponding to the chart is opened containing at once from the beginning all the improvement improvements in layout and style previously implemented.
Code Block | ||||
---|---|---|---|---|
| ||||
chartCalibration.Name = "Calibration using water level at center Zwolle channels" chartCalibration.Title = "Comparison measurements vs results" chartCalibration.TitleVisible = True chartCalibration.Legend.Visible = True chartCalibration.BottomAxis.Title = "Time" chartCalibration.LeftAxis.Title = "Waterlevel [m]" chartCalibration.LeftAxis.Automatic = False chartCalibration.LeftAxis.Maximum = 2 chartCalibration.LeftAxis.Minimum = -0.5 # Show the chart viewCalibration = OpenView(chartCalibration) |
If you zoom in the area where a plateau seems to be reached (you can do it "manually" or via scripting by adapting the ranges to be shown in the plot as indicated above) you will see more in detail how the different calibration runs approach the measured data.
The selection of the best fit will be quantitatively carried out in the next section.
scrollbar |
---|