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

Compare with Current View Page History

« Previous Version 5 Next »

We will create a new graph to plot all the results corresponding tot he calibration procedure. We start by creating a new line series corresponding to the results of the initial model set up.

Create line series for initial results
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 calculated quantitatively later on, and not qualitatively, based on this chart. This common color will be however different from the one previously used for the initial model set up. Remember that the first time series kept 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.

Add line series for all calibration cases
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 one entry in the legend for each calibration simulation.

Next, the measured data will be added to the plot as a point series. Subsequently, the chart object is created (still not shown).

Adding measured data to calibration graph
# 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 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 all the improvement in layout and style previously implemented. 

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.

 

  • No labels