Contents

1 Introduction

1.1 SGE Circus user manual

1.2 SGE CalcGuide user manual

1.3 SGE Circus videos (external)

2 Keyboard shortcuts, mouse gestures

3 Features

4 Data

4.1 Data preprocessing

4.2 Load data

4.3 Drag and drop, paste clipboard

4.4 Rename inputs / outputs

4.5 Order inputs / outputs

4.6 Check files

4.7 Save data

4.8 (Data) Info

4.9 Scatter plot

4.10 Input / Output correlation plot

4.11 Reduce data

5 View

5.1 Zoom, pan, reset view

5.2 Cursors

Snap to data

Copy cursor

Set cursor position

5.3 Element visibility

Toggle element visibility

Data point display

Automatic display reduction

5.4 Data subset indication / synchronization

5.5 Color, Marker size, Line width

5.6 Background color

5.7 Window arrangement

6 Model

6.1 Train model

6.2 Edit model

6.3 Model quality judgment

Model training result

Correlation plot

Error plot

6.4 Pareto plot

6.5 Input interaction plot

6.6 Model export

Model grid export

Model list export

Model usage in Simulink

Model usage in MATLAB

6.7 Model import

6.8 Model section

7 Optimize

7.1 Calibration parameter optimization

Single parameter optimization

Multiple parameter optimization

Multiple criteria optimization

7.2 Calibration system optimization

Settings

Optimization

Post processing

Smoothing the optimization result

Mixing the optimization result

System signals visualization

7.3 Mark optimum

8 Save data

8.1 Save session

9 Design of Experiment (DoE)

10 Present, print data

11 General information

SGE ModelArtist – User Manual

www.sge-ing.de – Version 1.62.67 (2022-07-24 22:21)

1 Introduction

The SGE ModelArtist is a tool to visualize and model multirelational data as well as to enable model based calibration.

You can load an arbitrary number of input and output channels and the correlation between each input / output combination is displayed in a matrix intersection view. Cursors and zoom functionality is used to adjust the display to the relevant data.

Different kinds of models can be trained to fit the data and enable the homogeneous display of scattered data as intersection plots. Thus the optimization of the calibration of systems with multiple inputs is assisted.

This manual contains information concerning specifically the SGE ModelArtist only. The SGE ModelArtist is part of the SGE Circus. For help topics regarding general features please refer to the corresponding documentation accessible using the links below.

1.1 SGE Circus user manual

The SGE Circus documentation makes available general information regarding data loading procedure, input handling, preferences, history and other topics concerning all tools.

1.2 SGE CalcGuide user manual

The SGE CalcGuide is a tool to implement calculation routines by creating graphical flow chart diagrams - included with all tools.

1.3 SGE Circus videos (external)

Videos and tutorials are available on the internet.


For information regarding the version dependent software changes please refer to the Release notes accessible using the corresponding menu item inside the SGE Circus.

2 Keyboard shortcuts, mouse gestures

Many functions are quickly accessible via keyboard shortcuts. For a list of available keyboard shortcuts, see the list below. In addition, the entries in the menus and context menus as well as the tooltips of the toolbar point to shortcuts.

Data Handling

Ctrl + o

Load data...

Ctrl + s

Save data...

Ctrl + v

Paste files from clipboard into present session...

Ctrl + Shift + i

Data info...

Ctrl + Shift + s

Save session...

F2

Rename inputs / outputs...

Ctrl + c

Copy cursor values to clipboard

View

Mouse left button drag

Zoom in x / y direction

Mouse right button drag

Pan in x / y direction

Ctrl + shift + + / - / F12

Increase / decrease / automatic display reduction

Ctrl + +/-

Increase / decrease max. data distance...

Ctrl + r

Ctrl + F12

Reset ranges of all axes in x- and y-direction. Activate automatic display reduction.

Ctrl + a

Fit all y-axes

Shift + a

Reset range of actual x- and y-axis

Ctrl + x

Set x-axis range...

Double click axes

Set y-axis range...

Double click cursor line

Set cursor position...

Ctrl + 1..9

Toggle visibility of inputs

Shift + 1..9

Toggle visibility of outputs

Ctrl + d

Toggle visibility of data points

Ctrl + m

Toggle visibility of model

Ctrl + f

Toggle visibility of 95% confidence interval

Shift + Enter

Color data points / model...

Model

Ctrl + Shift + m

Train model(s)...

Ctrl + Delete

Delete model(s)...

Ctrl + e

Export model(s)...

Ctrl + t

Model section...

Optimization

Shift + o

Optimize calibration parameter...

Ctrl + Shift + o

Optimize calibration system...

Miscellaneous

F1

Show manual...

Shift+F1

Show keyboard shortcut manual...

Ctrl + z

Undo (views, models)

Ctrl + y

Redo (views, models)

Ctrl + shift + c

Copy window to clipboard..., Print window...

System optimization (waitbar shortcuts)

Ctrl + a

Show status...

Ctrl + i

Show system signals...

Ctrl + p

Show progress course...

Ctrl + s

Save calibration parameter file...

3 Features

The main features of the SGE ModelArtist are listed in this introduction. For details please see the following sections.

Visualization

Modeling

Calibration Parameter Optimization

Calibration System Optimization

Graphic Export



4 Data

Data points are loaded for display purposes, to train models or to perform optimization. The data may e.g. result from measurements or simulations. You can load any number of input and output channels. Input channels will be displayed as horizontal axes and output channels as vertical axes. This way the intersection plots are generated.

In a simple example a testbench measurement is loaded and engine speed and throttle position are selected as input channels and load and torque as output channels. In a more realistic use you will for example also select lambda, ignition timing and cam timings as inputs and emission concentrations, cylinder mean pressures, centers of combustion and specific fuel consumption as outputs.

The data loading procedure is explained in the documentation of the SGE_Circus as it is something all tools have in common. We recommend that you read that section first as useful features like sample reduction, logical load conditions and calculated channels are explained there.

4.1 Data preprocessing

The quality of the data loaded is essential for the model quality as well as for the model training effort in terms of memory usage and computing time. To ensure optimal results it is recommended to check the data before loading for measurement inaccuracies and drifts. At least use the correlation and errors plots after model training to check the results.

If the model training duration or memory effort exceeds a reasonable limit you should first try to reduce the number of data points by data preprocessing – for example points with similar input value combinations should be reduced to single points by calculating the average values of input and output value. This can also happen automatically during the model training by using the clustering feature – see “Train model“ for details.

4.2 Load data

You can load data points initially after starting the ModelArtist. It is also possible to reload data (Ctrl + o) afterwards. Choose all input and output channels to display at a time. You have to activate the “common axis” feature to ensure the equal number values for each channel. The logical load condition can be used to load exactly the data you need and calculated channels assist you to create channels with new features or combinations of multiple channels.

After loading the data a dialog will be shown to select the output channels from the list of all channels loaded.

If the loaded data contains invalid values (e.g. NaN, inf), you must decide how to handle them. No invalid values are allowed in inputs. They are allowed in outputs, but may be undesirable. You can therefore decide for each input and output whether invalid values should be replaced with a fixed value or whether invalid values should be removed.







Afterwards a dialog shown allows to modify the display order of the loaded input and output channels. The order just influences the display and does not effect the model or optimization. By selecting the same order number for multiple outputs they will share the same axis. In contrast the order numbers of the inputs must be unique.

Finally the input channels to define as global will be asked. Global channels define e.g. the operating point and will not be judged as a variable value to optimize the outputs. Optimization will be done separately for different global input value. For example engine speed and engine load/torque usually are global inputs.

If the loaded input data contains NaN or infinite values these points will be removed automatically for all channels. If the loaded output data contains NaN or infinite values these points will be set to NaN just for the affected output channel.

Finally the initial view will be presented. Data points can be reloaded at any time. You can reload data with models existing. In this case models will be deleted automatically when the outport channel is not existing in the reloaded data. If the reloaded input channels do not match the existing ones all models will be deleted.

4.3 Drag and drop, paste clipboard

In addition to using the file load dialog, you can load sessions and data files by using drag and drop or the clipboard. To do this, one or more files can be dragged directly to a ModelArtist session or inserted via keyboard shortcut (Ctrl + v). It is also possible to copy files directly to the clipboard as well as strings containing the file names line by line.

4.4 Rename inputs / outputs

By default the names and units of the channels loaded are displayed besides the axes. Especially if many axes are displayed these names may lead to overlapping axes labels. Therefore you can rename the channels in a two step procedure (F2).

In the first step you will be asked for replacement patterns. These are applied to all channels and are useful to do common renaming tasks. The replacement patterns are given one rule per line. The string to look for and the replacement are separated by two colons, like "EngineSpeed :: rpm". The replacement is case sensitive and done in the order of lines from top to bottom. If the corresponding check box is set the strings are interpreted as regular expression.

In the second step you will be asked for each channel individually to modify the name and / or unit.

4.5 Order inputs / outputs

The display order of the inputs and outputs can be adjusted even after loading the data and training models. The order just influences the display and does not effect the model or optimization. By selecting the same order number for multiple outputs they will share the same axis. In contrast the order numbers of the inputs must be unique.

4.6 Check files

The files data was loaded from is remembered and will be used e.g. to prefill the dialog when reloading data. They can also be displayed using the data info (Ctrl + Shift + i).

It may happen that files have been renamed or moved during the work or after reloading a session. Use the “Check files” option in this case to search the missing files and update their names and path automatically. Remember that sometimes it is not possible to find missing files. Especially all files must be located in the same directory. The option “Continue + Remember” allows you to save search results and apply them quickly next time without prompting. To reset these saved replacements, the software must be restarted or the corresponding option must be used when the message after automatic replacement is displayed.

4.7 Save data

Also the saving of data points in different file formats is supported.

The storable data consists of the loaded data and the model values at the inputs of the loaded data. In this way, for example, data cleaned from outliers and interpolated model data can be stored (Ctrl + s). It is also supported to save an additional channel indicating the training data.

4.8 (Data) Info

You can display some information about the models and loaded data (Ctrl + Shift + i) like file names, comments, data loading / model history and calculated channels. This may be helpful to document the work done. Remember that the model quality information like RMSE represent the status after model training. Reloading the data, removing outliers will change this quality status but the information from the Data Info will not get updated.

Calculated channels will be shown by opening them in the CalcGuide. This is just for display purpose. Modifications done in the CalcGuide will be discarded. The data can be copied to the clipboard. In order to be able to find calculated channels quickly but also to be able to view the sequence of the calculation, they are displayed unsorted and sorted.



4.9 Scatter plot

Scatter plots enable to visualize relations between arbitrary inputs and outputs based on the training / test data and the model axes grid points. This helps to judge the loaded data and to detect outliers.

Data and model grid points shown are the ones that are allocated inside the actual axes ranges in the main window. So you can influence the scatter plot section by using the zoom functionality in the main window. Additionally when the scatter plot was created for the global operating point it will update automatically when the cursor positions in the main view are changed. For automatic updates the feature must be enabled in the menu of the scatter plot.

The following options will be asked when creating a scatter plot.

Data subset indication

Subsets of the data points can be marked and colored. This can be done just for visualization and data analysis or as a preliminary work for the outlier removal – see the following section for details. The synchronized view of the data subsets supports the correlated judgment of the single scatter plots and additionally allows to establish a connection to their input values if both axes of a scatter plot are outputs.

By using the mouse you can mark single data points or rectangular sections. Afterwards you will be asked to choose a color for the subset. Since subsets are managed related to their color you can create discontinuous subsets by multiple selection when assigning a common color.

By selecting a subset in a scatter plot the cursors will be positioned at the mean value of the input values of the subset.

Data subset synchronization

Data subsets will be synchronized between the single plots. So when creating a subset in a scatter plot you will recognize the subset also in the scatter plots of other outputs, the correlation plots, the error plots and the Pareto plots. The subset also will be displayed in the intersection plots. By selecting a subset in a scatter plot the cursors will be positioned at the mean value of the input values of the subset. See “Data subset indication / synchronization” for details.

Data / outlier removal

Using the corresponding menu items or keyboard shortcuts data points can be removed. Before they must be combined in one or more data subsets. Then the selected or all subsets can be removed. Usually this feature is used to remove outliers from model training.

After closing the error plot window you will be remembered to retrain the model to adjust to the modified data.

4.10 Input / Output correlation plot

The data correlation visualizes the correlation between arbitrary inputs and outputs based on the training / test data points. This helps to quickly judge the relevance of the single inputs regarding the outputs (sensitivity analysis) and to identifying dependencies of the inputs.

The correlation values are in the range 0 to 1. 0 means no correlation and 1 perfect correlation. The displayed correlation coefficients are statistical values incl. their 95% confidence bounds. They provide a first indication of the interactions of the signals. In general, a low correlation between the inputs and a high correlation between the inputs and outputs is desired.

The data points regarded for calculating the correlation are the ones that are allocated inside the actual axes ranges in the main window. So you can influence the correlation plot section by using the zoom functionality in the main window. For automatic updates the feature must be enabled in the menu of the scatter plot.

The following options will be asked when creating a data correlation plot.

4.11 Reduce data

The data reduction feature enables to reduce the current data points in a way that preserves the model quality in the best or generates a spacefilling distribution. This can be for example used to speed up e.g. model training or system optimization.

Starting from a few points, data points are constantly added and the progress (quality of the resulting models or spacefilling distance criterion) is visualized. You decide how much you want to reduce the data based on this progress from the complete models or data points.

During data reduction, the progress is continuously displayed. When a model based quality criterion was selected the mean and maximum deviation for all selected models is displayed. When a spacefilling distribution was requested the relative mean and maximum distance of the points is visualized. When you are satisfied with the progress, close the window. The number of data points to be used is then queried. Use the graphic representation to choose an axis value that represents a good compromise between the number of points and the quality of the models or the spacefilling distribution. It is no problem to run the calculation longer than finally selected. The selected number of data points can lie in the entire section already processed.

The elected data amount is finally applied. means that only this number of most suitable data points is retained. All other data points are removed. The models remain unchanged. If the models are to be adapted to the reduced data, they must be retrained afterwards.

5 View

5.1 Zoom, pan, reset view

By zooming and paning the axes ranges one can quickly adjust the view to the relevant data. This does also influence the display of the data points inside all other plots, see Data point display.

The following techniques assist the view adjustment:

5.2 Cursors

For each input channel a cursor is displayed. The cursor can be moved by dragging it with the mouse. While moving the actual axis value is displayed as well as the model value if any. Together all cursors define the actual input value set. This is used to determine the visibility and color of the data points regarding the max. distance criterion. See Data point display for further information.

5.2.1 Snap to data

If “Snap to data” is activated in the menu the cursors will always place themselves on the nearest data point.

5.2.2 Copy cursor

The actual input values at the cursor locations can be visualized and copied to clipboard. Output values from the data points are only copied when all cursors match the same data point – this is quite rare, because each cursor can be located at any data point.

When a model is trained also the output values of the model are shown.

5.2.3 Set cursor position

To place the cursors at dedicated input value positions use the corresponding menu item or double click a cursor line. The input value positions must be within the range of the data points or model axes.

5.3 Element visibility

5.3.1 Toggle element visibility

5.3.2 Data point display

Usually a measurement consists of a number of single measurement samples. These are displayed as single points then. When all points are displayed this would look like in the following figure. One can hardly judge the input – output correlations.

There are two ways to reduce and emphasize the data points to illustrate the correlations.

5.3.3 Automatic display reduction

To accelerate the display a sample reduction factor is used by default. It is automatically adjusted according to the performance of the computer. The actual display reduction value can be identified in the ?-menu.

Keyboard shortcuts can be used to quickly adjust the sample reduction factor (Ctrl + shift + + / - / F12). Changing the display reduction manually does turn off the automatic adjustment.

5.4 Data subset indication / synchronization

Subsets of the data points can be marked and colored in the correlation, error, Pareto and scatter plots. This can be done just for visualization and data analysis or as a preliminary work for the outlier removal.

By using the mouse you can mark single data points or rectangular sections. Afterwards you will be asked to choose a color for that subset. Since subsets are managed related to their color you can create discontiguous subsets by multiple selection when assigning a common color. In the correlation plots creating a subset can additionally be performed in relation to the error of the data points – see “Correlation plot” for details.

It is possible to mark data and model points. In this case you will be asked which ones should be processed to a subset.

Data subset synchronization

Data subsets will be synchronized between the single plots. So when creating a subset in an e.g. correlation plot you will recognize the subset also in the correlation plots of other outputs, the error plots, the Pareto plots and the scatter plots. The subset also will be displayed in the intersection plots. By adding a subset the cursors will be positioned at the mean value of the input values of the subset.

The synchronized view of the data subsets supports the correlated judgment of the single plots and additionally allows to establish a connection between the plots that may be solely based on output values (correlation plot, Pareto plot, scatter plot) and their input values. In the following figures the synchronization of the representation of two data subsets selected in the Pareto plot (red / yellow colored points) is illustrated.

Edit data subsets

In the "Data" menu of plots containing data subsets, the subsets can be reset or deleted. Reset only means that the points are no longer highlighted in color. Delete means that the corresponding data points are actually removed. Deleting is only possible for data points and not model points. When deleting subsets of model points, they are ignored. Depending on the context, data points can be deleted for the current or all outputs.

Reset and delete is provided for the selected or all data subsets. To select a data subset, you can mark it with the mouse.

Copy data subsets

In case data subsets are marked they can be visualized in a numeric view and also copied to clipboard using the corresponding menu items or keyboard shortcuts (Ctrl + c). For each data or model point a line will be included containing the values of all inputs and outputs and additionally a “Source” column showing whether its a data or model point. Using the “Copy to clipboard” button copies the data into the clipboard in a format that can be inserted in e.g. a spreadsheet software.

5.5 Color, Marker size, Line width

The color of the model line and data points can be modified for each output separately. Additionally the marker size and line width can be influenced. Use the corresponding menu items to access these features.

5.6 Background color

Using the corresponding menu item enables to adjust the background color of the intersection plots.

5.7 Window arrangement

Since the ModelArtist offers to open a considerable number of windows (e.g. correlation, error, Pareto, scatter plots) an automatic window arrangement feature is implemented. Using the corresponding menu item enables to arrange all or a subset of the windows of the current session.

6 Model

6.1 Train model

From the data loaded a model can be trained (Ctrl + Shift + m). This model can then be used for optimization or just to visualize scattered data in a homogeneous way.

A model predicts some output channel values based on input channel values. The output channel values are the optimization targets. They will be minimized or maximized. There are two types of inputs channels. Parameter input channels are tuning factors to optimize the output channels values. Global channels define e.g. the operating point and will not be judged as a variable value to optimize the outputs.

A typical example is an emission model as shown in the following schema.

Selecting the model type, axes and options has significant influence on the ability to fit the data course. Consult the help corresponding to the single input fields and this manual. Always judge the result using the correlation and error plots.

The model is displayed as a line. The line style is continuous inside the confidence limit. Outside the confidence limit the line style of the model is a dotted line when the model type supports confidence information. In this case also the 95% confidence bounds (= two times the standard deviation) can be displayed as dotted lines. The displayed confidence bounds always show the 95% confidence interval. The editable confidence limit determines the solid/dotted display of the model itself. See “Edit model” for details.

Each output has a individual model. Not all outputs necessarily need to have a model. All models trained in one run will have the same model type. If you need different model types for some outputs you need to run model training for the outputs separately.

Training data part

Select the part of the data loaded to use for model training. This part is called training data. The rest of the data is called test data and will not be regarded during model training but e.g. in the correlation and error plots. Therefore the test data allows a better judgment of the model prediction quality. Keep in mind that the amount of test data reduces the training data accordingly.

Cluster width

Clustering enables to concentrate the input data by means of an adjustable tolerance. All points whose input values are within the tolerance are combined to form a single point for modeling by forming the mean value of each input and output value. This reduces the data point number for the model training and combines repeated measurement points to reduce their tolerance.

Zero disables the clustering and higher values mean an increasing concentration of the data points. The tolerance refers to the value ranges of model axes and data points of the individual input channels. For an input with a model axis from 1000 to 10000 and data points from 500 to 9500 this means that 1% tolerance refers to the range 500 to 10000 and is thus 95.

Use small values (e.g. 0.1%) if unsure.

Model types

Different types of models to train are available. The model types differ regarding ability to fit data courses and training speed. Always use the error plots available after model training to judge the quality of the model fit.

Gaussian process

Description

A Gaussian process model is a set of random variables, where every single variable associates an input value combination with a stochastic distribution of the output value.

To achieve a good quality for a Gaussian process model it is important that the data points are measured with high quality and little noise. If this requirement is not met in addition to a poor model quality the model training may last very long or even fail. Always use the correlation and error plots available after model training to judge the quality of the model fit, remove outliers and retrain the model.

For training a Gaussian process model with a high number of data points it is recommended to reserve most of the computers processing and memory capabilities because this will not just speed up the model training but also increase the model quality. If available use a computer with 64bit operating system and sufficient memory capacities.

  • Training effort

    Highly depending on the number of data points, axes breakpoints and the Gaussian model type chosen. The “Accuracy <-> speed” setting allows to influence the training effort.

  • Universal data fit capability

    Unrivaled good. Depending on the Gaussian model type chosen.

  • Variance criterion available

    Yes.

Parameters / Options

  • Model type

    Different types of models to train are available. The model types differ regarding ability to fit data courses and training speed and memory effort. If unsure which type to use evaluate the model types in the order listed in the drop down menu. Always use the correlation and error plots available after model training to judge the quality of the model fit.

  • Apply input transformation

    Choose whether to apply an input transformation to improve the model fit for some special output shapes. The input transformation can only be used together with "SEard" model type.

    This option should only be used if no adequate model quality can be obtained varying the other options. Be aware that this transformation significantly increases the calculation and memory effort and in some cases may even deteriorate the model fit.

  • Apply output transformation

    Choose whether to apply an output transformation to improve the model fit for some output shapes.

    Be aware that the transformation increases the calculation and memory effort.

  • Accuracy <-> speed

    A trade off level between accuracy and speed of calculation can be selected. During model training a progress bar will be shown. By closing it you can abort the optimization prematurely or change the trade off level between accuracy and speed.

    In general you should always prefer accuracy. If the model training duration or memory effort exceeds a reasonable limit you should first try to reduce the number of data points by data preprocessing. If you experience no progress for a long time using "very accurate" reduce the accuracy to "more accurate".

  • Allow multiple instance interruption

    If chosen it is possible to train models of different ModelArtists sequentially. A training started will pause any other running training of this Matlab instance. When finished the interrupted training will proceed.

  • Skip model training

    If enabled and Gaussian models do already exist these models will be reused and just transformed to the new axes and actual training data. This way the time consuming model training can be skipped when the task is to just modify the axes. This option is only reasonable if the training data did not change in a relevant way.

Quick view

Description

The quick view model is created by calculating the mean value of the data points near to the model breakpoints.

  • Training effort

    In general fast but highly depending on the number of data points and axes breakpoints.

  • Universal data fit capability

    Good. The fit behavior is depending on the parameter settings (see below). In general a quick view model will deliver satisfying results if the data points are distributed sufficiently dense regarding the axes values.

  • Variance criterion available

    Yes.

Parameters / Options

  • Data point number factor

    The number of points to use is automatically calculated from the total data point number per model breakpoint. This value can be scaled with a factor. Lower values lead to a better model fit because only the nearest values are used. Higher values give a better robustness against data variance.

  • Distance exponent

    The influence of the single data points is weighted with their distance from the axes breakpoints. This weighting is done in a exponential manner. You can choose the exponent here. Higher values lead to a better model fit in bend model areas because the nearest points are preferred. Lower values give a better robustness against data variance.

Linear

Description

The model output will have a linear correlation to the inputs.

  • Training effort

    Very fast even for high number of data points and axes breakpoints.

  • Universal data fit capability

    Very poor. Only suitable for applications assumed to have linear behavior.

  • Variance criterion available

    No.

Parameters / Options

None.

Polynomial

Description

The model output will have a polynomial correlation to the inputs. The polynomial order can be chosen.

  • Training effort

    Highly depending in data point number, axes breakpoint number and polynomial order.

  • Universal data fit capability

    Adequate. Suitable for applications assumed to have polynomial behavior.

  • Variance criterion available

    No.

Parameters / Options

  • Polynomial order

    Choose the polynomial order of the model.

Exponential

Description

The model output will have a exponential correlation to the inputs.

  • Training effort

    Very fast even for high number of data points and axes breakpoints.

  • Universal data fit capability

    Poor. Only suitable for applications assumed to have exponential behavior.

  • Variance criterion available

    No.

Parameters / Options

None.



Model axes

You will also be asked to define the axes breakpoints of the models to train.

Enter an axes definition for each model input - one per line. The number of lines must match the input number. Alternatively you could enter only one line which then will be used for all inputs.

The axes breakpoints can be defined by just entering a scalar numeric value for the breakpoint number. In this case the breakpoints will be equally distributed in the range of the data values of the input. If you put only one line, it is considered for all inputs, if more lines are applied they must match the input number and are applied to the corresponding input. Alternatively you could enter an explicit breakpoint definition or enter "auto" for automatic breakpoint selection.

Example 1:

6 → Equally spaces axes with 6 breakpoints for all inputs.

Example 2:

auto → Automatically determine breakpoint number and values.

6 → Equally spaces axes with 6 breakpoints (input 1).

0 2000 4000 8000 → Explicit definition of axis (input 2).

0:2000:10000 → Explicit definition of equally spaced axes (input 3).

linspace(0,10000,20) → Explicit definition of equally spaced axes (input 4).

Select a suitable breakpoint number / definition considering the following factors:

After axes definition a visualization of the axes distribution and the data points will be displayed. When the axes do not include all data points a warning message will be generated. The message also indicates the data range necessary for full data coverage.

Selecting the model axes has significant influence on the ability to fit the data course. Always judge the result using the correlation and error plots. Especially the error plots are very useful when judging the suitability of the axes chosen. See the corresponding section ”Error plot” for details.

6.2 Edit model

Some model properties are editable after model training.

6.3 Model quality judgment

To judge the correlation of the model values vs. the measured values and therefore the model quality different views are available.

Especially for Gaussian process models it is essentially important to use these views to detect and remove outliers from the data points and retrain the models afterwards.

6.3.1 Model training result

After completing the model training a result will be displayed that summarizes information regarding the archived model qualities. For each model trained the root mean square error and the determination coefficient are shown as well as the data parts exceeding certain error levels. The message also allows to directly show the corresponding error or correlation plots.

In case of unexpected training events a hint will be shown and it is recommended to check the model thoroughly and retrain as required with different settings. In case of Gaussian process models you could for example try another model type or use transformations.

The root mean square error is explained in the following formula where y* are the data values, m* the model values and n* the number of data values.

The determination coefficient is explained in the following formula where y* are the data values, m* the model values, y is the mean value of all data values, m the mean value of all model values and n* the number of data values.

Generally spoken the RMSE is the much more robust and reliable error criterion and is a good starting point for model judgment.

6.3.2 Correlation plot

A correlation plot can be displayed for every output separately. It contains a representation of the output values of the data points (x-axis) and their model values (y-axis). The ideal correlation and some standard error lines are available. The data points shown are the ones that are allocated inside the actual axes ranges in the main window. So you can influence the correlation plot section by using the zoom functionality in the main window – if this feature is enabled in the menu of the correlation plot. The relative number of visible data points is shown in the legend and the window title.

The correlation plot also informs about the root mean square error and the determination correlation criterion. The view can be adjusted using zoom and reset functionality – available by menu items or keyboard shortcuts.

Data subset indication

Subsets of the data points can be marked and colored. This can be done just for visualization and data analysis or as a preliminary work for the outlier removal – see the following section for details.

By using the mouse you can mark single data points or rectangular sections. Afterwards you will be asked to choose a color for the subset. Since subsets are managed related to their color you can create discontiguous subsets by multiple selection when assigning a common color.

Creating a subset can additionally be performed in relation to the error of the data points. This can be done by specifying a relative of absolute error limit.

Data subset synchronization

Data subsets will be synchronized between the single plots. So when creating a subset in a correlation plot you will recognize the subset also in the correlation plots of other outputs, the error plots, the Pareto plots and the scatter plots. The subset also will be displayed in the intersection plots. By selecting a subset in a correlation plot the cursors will be positioned at the mean value of the input values of the subset. See “Data subset indication / synchronization” for details.

Data / outlier removal

Using the corresponding menu items or keyboard shortcuts data points can be removed. Therefore create one or more data subsets. Then the selected or all subsets can be removed. Usually this feature is used to remove outliers from model training.

When removing outliers you will be asked whether to remove them only for the output related to the correlation plot or for all outputs. In case the outlier is caused by e.g. the measurement system of the output it is sufficient to remove it only for this output. If e.g. the input measurement was affected by some inaccuracy it may be necessary to remove it for all outputs.

The decision is assisted by the synchronized view of the data subsets. When opening all correlation plots at the same time the subset used for outlier removal can be judged easily to see whether multiple outputs are affected or only the actual one.

After closing the correlation plot window you will be reminded to retrain the model to adjust to the modified data.

6.3.3 Error plot

A representation of the model error (y-axis) related to every input (x-axis) separately can be displayed. This helps to judge the location of the model error related to the inputs and may be useful to adjust the model axes. The view additionally contains a plot of the model error and model output values related to the data point number which may help to detect drifts or varying data inaccuracy during data acquisition.

The error plot is generated for each output separately.

The data points shown are the ones that are allocated inside the actual axes ranges in the main window. So you can influence the error plot section by using the zoom functionality in the main window – if this feature is enabled in the menu of the error plot.

Model axes judgment

The following figure shows an example of the influence of the axes chosen for model creation to the model fit. On the left side the model axes are sufficiently fine spaced and located which results in only little error for all inputs while on the right side the too rare axes breakpoints lead to a drastically increasing model error.

Data subset indication

Subsets of the data points can be marked and colored. This can be done just for visualization and data analysis or as a preliminary work for the outlier removal – see the following section for details.

By using the mouse you can mark single data points or rectangular sections. Afterwards you will be asked to choose a color for the subset. Since subsets are managed related to their color you can create discontinuous subsets by multiple selection when assigning a common color.

Data subset synchronization

Data subsets will be synchronized between the single plots. When creating a subset in an error plot you will recognize the subset also in the error plots of other outputs, the correlation plots, the Pareto plots and the scatter plots. The subset also will be displayed in the intersection plots. By selecting a subset in an error plot the cursors will be positioned at the mean value of the input values of the subset. See “Data subset indication / synchronization” for details.

Data / outlier removal

Using the corresponding menu items or keyboard shortcuts data points can be removed. Before they must be combined in one or more data subsets. Then the selected or all subsets can be removed. Usually this feature is used to remove outliers from model training.

When removing outliers you will be asked whether to remove them only for the output related to the error plot or for all outputs. In case the outlier is caused by e.g. the measurement system of the output it is sufficient to remove it only for this output. If e.g. the input measurement was affected by some inaccuracy it may be necessary to remove it for all outputs.

The decision is assisted by the synchronized view of the data subsets. When opening all error plots at the same time the subset used for outlier removal can be judged easily to see whether multiple outputs are affected or only the actual one.

After closing the error plot window you will be reminded to retrain the model to adjust to the modified data.

6.4 Pareto plot

The Pareto plot shows the relation of two or three model outputs. It allows to judge a state in which it is not possible to improve one output without having to simultaneously degrade another. A typical example would be different emission components or fuel consumption vs emissions.

The data and model grid points shown are the ones that are allocated inside the actual axes ranges in the main window. So you can influence the Pareto plot section by using the zoom functionality in the main window. Additionally when the Pareto plot was created for the global operating point it will update automatically when the cursor positions in the main view are changed. For automatic updates the feature must be enabled in the menu of the Pareto plot.

In the following example the trade off of some emission components is shown for a combustion engine. In the 2D view the model grid points are shown and surrounded by a convex hull. Additionally the training and test data points are included. In the 3D view only model grid points are shown for a single global operating point. The hull is representing the Pareto front and allows the judgment of the influence on an output if the other one is optimized.

The following options will be asked when creating a Pareto plot.

Data subset indication / synchronization

Subsets of the data points can be marked and colored. Data subsets will be synchronized between the single plots. So when creating a subset in a Pareto plot you will recognize the subset also in the correlation plots and the error plots. The subset also will be displayed in the intersection plots.

The synchronized view of the data subsets supports the correlated judgment of the single Pareto plots and additionally allows to establish a connection to their input values. Therefore trade off selections in the Pareto plot can be evaluated regarding their input value settings. See “Data subset indication / synchronization” for details.

By using the mouse you can mark single data points or rectangular sections in 2D Pareto plots. In 3D Pareto plots you can select single points of the data or hull. Afterwards you will be asked to choose a color for the subset. Since subsets are managed related to their color you can create discontiguous subsets by multiple selection when assigning a common color. When marking sections containing model and data points at a time only the model points will be considered to create a subset.

By selecting a subset in a Pareto plot the cursors will be positioned at the mean value of the input values of the subset.

6.5 Input interaction plot

Input interaction plots visualize for each input channel combination the output or confidence interval of the model. All other input values result from the actual cursor settings. When the cursor in the intersection plot is moved, the input interaction plots will be updated – if this feature is enabled in the menu.

The following options are available:

The following figures show the interaction plots for one output. On the left side the unmodified results are compared to the detrended ones the right side.

6.6 Model export

Models can be exported to different formats.

6.6.1 Model grid export

When a model is exported (Ctrl + e) it will be converted to an n-dimensional grid where n is the number of inputs. So for example a model with two inputs will generate a map, with three inputs a cube and so on. The grid axes will be the model axes. So the granularity of the grid will be given by the breakpoints defined during model training. Therefore the axes must be chosen carefully and adequate finely graduated and e.g. concern the later usage of the export (e.g. interpolation method). Some interpolation methods provide no extrapolation and therefore outside the axes ranges NaN values will be generated.

The following formats are available to export models to:

6.6.2 Model list export

Alternatively models can be exported (Ctrl + e) as a list of the grid points in different file formats. This results in a data file containing the model grid points sequentially and may be for example suitable for map creation.

In case all models exported share the same grid axes the target file will contain these axes only once. Otherwise the axes will be exported separately for the single models. Therefore the target file format chosen must support separate axes.

6.6.3 Model usage in Simulink

A model grid exported as a DCMAT file is adequate to use the model in MATLAB/Simulink. You can use an “Interpreted MATLAB Fcn” block or an “n-D Lookup Table” block in Simulink.

Interpreted MATLAB Fcn

The “Interpreted MATLAB Fcn block” enables to interpolate the models with only little manual interaction but it is not suitable for code generation. Make sure to adjust the configuration at the beginning of the file and of the Simulink block according to the requirements.

Save the following function to a file called InterpolateModel.m in the Matlab search path and follow the instructions at the beginning of the file.


% #####################################################################

% # SGE InterpolateModel #

% # Use ModelArtist model grid export (*.dcmat file) in Simulink #

% #####################################################################

%

% SGE Ingenieur GmbH

% 05.11.2017

%

% This function is intended to interpolate a ModelArtist model grid export

% from a *.dcmat file in Simulink using a "Interpreted Matlab Fcn" block.

% Save this file to a path available in Matlab / Simulink and make sure

% to adjust the Configuration section at the beginning.

%

% Set the block parameters in Simulink and connect the inputs to a bus creator

% that concatenates as many signals as model inports.

%

% Block parameters:

% Output dimensions: Number of labels in "LabelNamesModel" configuration

% for scalar input. In case of vector inputs enter the

% total number of data samples.

% "1" for one label, "2" for two labels (scalar input)

% MATLAB function : "InterpolateModel"

%

function[out] = InterpolateModel(in)



% ############# Configuration ################

% Label names of models grid inside DCMAT file

LabelNamesModel = {'Model_CUBE_5_BrakePower','Model_CUBE_5_BrakePower'};



% DCMAT file

LabelFile = 'Condor_20160418_GT_ModelSession_AllOutputs_ModelExport_power.dcmat';



% Interpolation method

InterpolationMethod = 'linear'; % linear, nearest, pchip, cubic, spline



% Extrapolation method

ExtrapolationMethod = 'none'; % none (=NaN), linear, nearest, pchip, cubic, spline



% Replacement value for NaN interpolation result (outside axes range)

NanReplacementValue = 0;



% ######## End of configuration ##############

persistent ticLastRun GriddedInterpolant



% Check if file exists

if ~exist(LabelFile,'file')

error('File does not exist: %s',LabelFile);

end



% Check label format

if ~iscell(LabelNamesModel)

error('Configuration "LabelNamesModel" must be a cell of label name strings.');

end



% Load file. Reuse data if last run was recently.

if isempty(ticLastRun) || toc(ticLastRun) > 0.1

try

FileData = load(LabelFile,'-mat');

catch err

error('Error loading file: %s',err.message);

end



% Data included

if ~isfield(FileData,'CalibrationDataStruct')

error('File does not contain "CalibrationDataStruct" (%s).',LabelFile);

end



% Create persistent gridded interpolants for for single labels

for iL = 1:length(LabelNamesModel)



% Search for label

LabelIndex = find(strcmp(FileData.CalibrationDataStruct.LabelNames,LabelNamesModel{iL}),1);

if isempty(LabelIndex)

error('Label "%s" not found in file "%s".',LabelNamesModel{iL},LabelFile);

end



% Get label data

Label = FileData.CalibrationDataStruct.LabelW{LabelIndex};

AxX = FileData.CalibrationDataStruct.LabelX{LabelIndex};

AxY = FileData.CalibrationDataStruct.LabelY{LabelIndex};



% Must be numeric

if ~isnumeric(Label)

error('Label must be numeric and not of class "%s".',class(Label));

end



% Create interpolant

if isscalar(Label)

GriddedInterpolant{iL}.Type = 1;

GriddedInterpolant{iL}.NumInputs = 0;

GriddedInterpolant{iL}.Interpolant = Label;

elseif isvector(Label)

GriddedInterpolant{iL}.Type = 2;

GriddedInterpolant{iL}.NumInputs = 1;

GriddedInterpolant{iL}.Interpolant = griddedInterpolant(AxX,Label,InterpolationMethod,ExtrapolationMethod);

elseif ismatrix(Label)

GriddedInterpolant{iL}.Type = 3;

GriddedInterpolant{iL}.NumInputs = 2;

GriddedInterpolant{iL}.Interpolant = griddedInterpolant({AxX,AxY},Label,InterpolationMethod,ExtrapolationMethod);

else

GriddedInterpolant{iL}.Type = 4;

GriddedInterpolant{iL}.NumInputs = ndims(Label);

GriddedInterpolant{iL}.Interpolant = griddedInterpolant([{AxX},AxY(:)'],Label,InterpolationMethod,ExtrapolationMethod);

end

end

end



% Dimension check

if GriddedInterpolant{1}.Type == 1

if ~isempty(in)

error('Input must be empty for a scalar parameter.');

end

end



% Initialize result

out = cell(length(LabelNamesModel),1);



% Reshape input in case of input vectors

if GriddedInterpolant{1}.NumInputs > 2

in_act = num2cell(reshape(in,numel(in)/GriddedInterpolant{1}.NumInputs,GriddedInterpolant{1}.NumInputs),1);

end

% Loop for single labels

for iL = 1:length(LabelNamesModel)



% Perform interpolation

if GriddedInterpolant{iL}.Type == 1

out{iL} = GriddedInterpolant{iL}.Interpolant;

elseif GriddedInterpolant{iL}.Type == 2

out{iL} = GriddedInterpolant{iL}.Interpolant(in_act);

else

out{iL} = GriddedInterpolant{iL}.Interpolant(in_act{:});

end



% Check for valid output. No NaN or inf allowed in Interpreted Matlab fcn

out{iL}(isnan(out{iL}) | isinf(out{iL})) = NanReplacementValue;

end

clear iL



% Create matrix from cell

out = [out{:}];



ticLastRun = tic;

end


n-D Lookup Table

The “n-D Lookup Table” block enables to interpolate the models and also supports code generation. But some manual interaction is required to setup. Make sure to adjust the configuration at the beginning of the file and of the Simulink block according to the requirements.

Save the following function to a file called ModelExport2Workspace.m in the Matlab search path and follow the instructions at the beginning of the file. The file must be executed before simulation and code generation to make the model data and axes available in the MATLAB workspace. The variable names are generated automatically and must be inserted into the block configuration. Use the MATLAB command “who” to retrieve the variable names after executing the function.


% #####################################################################

% # SGE ModelExport2Workspace #

% # Export ModelArtist model grid export (*.dcmat file) to workspace #

% # for usage in LoopUp Table blocks. #

% #####################################################################

%

% SGE Ingenieur GmbH

% 04.06.2019

%

% This function is intended to export a ModelArtist model grid export

% from a *.dcmat file to Matlab workspace for usage in Simulink in

% LoopUp Table blocks.

% Save this file to a path available in Matlab / Simulink.

%

% Set the block parameters in Simulink to adjust the label names and dimension.

%

function[] = ModelExport2Workspace()



% Load file

[File,Path] = uigetfile('*.dcmat','Select ModelArtist Export File');

if isequaln(File,0)

return;

end

LabelFile = fullfile(Path,File);



% Load file

FileData = load(LabelFile,'-mat');



% Data included

if ~isfield(FileData,'CalibrationDataStruct')

error('File does not contain "CalibrationDataStruct" (%s).',LabelFile);

end



% Find models names

ModelNames = {};

for i=1:length(FileData.CalibrationDataStruct.LabelNames)

if isnumeric(FileData.CalibrationDataStruct.LabelW{i}) && ~isempty(regexp(FileData.CalibrationDataStruct.LabelNames{i},'^Model_','once'))

ModelNames(end+1) = FileData.CalibrationDataStruct.LabelNames(i); %#ok

end

end

[~,SortInds] = sort(lower(ModelNames));

ModelNames = ModelNames(SortInds);

if isempty(ModelNames)

error('No models found in file: %s',LabelFile);

end



% Select models

[IndsSelected,Ok] = listdlg('ListString',ModelNames,'PromptString','Select Models To Transfer To Workspace','SelectionMode','multiple');

if ~Ok || isempty(IndsSelected)

return;

end

LabelNamesModel = ModelNames(IndsSelected);



% Remember names

WorkspaceNames = {};



for iL = 1:length(LabelNamesModel)



% Search for label

LabelIndex = find(strcmp(FileData.CalibrationDataStruct.LabelNames,LabelNamesModel{iL}),1);



if isempty(LabelIndex)

error('Label "%s" not found in file "%s".\n\nAvailable labels: %s',LabelNamesModel{iL},LabelFile,strjoin(FileData.CalibrationDataStruct.LabelNames(:)',', '));

end



% Get label data

Label = FileData.CalibrationDataStruct.LabelW{LabelIndex};

AxX = FileData.CalibrationDataStruct.LabelX{LabelIndex};

AxY = FileData.CalibrationDataStruct.LabelY{LabelIndex};



% Must be numeric

if ~isnumeric(Label)

error('Label must be numeric and not of class "%s".',class(Label));

end



% Transform to target name and put to workspace

Name = [genvarname(LabelNamesModel{iL}) '_data'];

assignin('base',Name,Label);

WorkspaceNames{end+1} = sprintf('\n%s',Name); %#ok



if ~isempty(AxX)

Name = [genvarname(LabelNamesModel{iL}) '_ax1'];

assignin('base',Name,AxX);

WorkspaceNames{end+1} = sprintf(', %s',Name); %#ok

end



for iAx = 1:length(AxY)

Name = [genvarname(LabelNamesModel{iL}) '_ax' num2str(iAx+1)];

assignin('base',Name,AxY{iAx});

WorkspaceNames{end+1} = sprintf(', %s',Name); %#ok

end

end

% Report

fprintf('\n%d model(s) were transferred to the workspace. Each model consists of a data grid and axes vectors. These are suitable for usage in a Simulink n-D-lookup-table or the MATLAB interpn() function. The generated variable names are:\n%s\n',length(LabelNamesModel),strjoin(WorkspaceNames(:)',''));

end

6.6.4 Model usage in MATLAB

A model grid exported using the format “MATLAB function (*.m)” is adequate to use the model in MATLAB. It includes a MATLAB function that can be called using the filename as function name. The input parameters must be numeric vectors – one for each input of the model exported. All input parameter vectors must have same length. The output will be a column vector of identical length for the model output prediction. Additionally the confidence bounds can be retrieved as output parameters if they were exported.

See the header of the file for details calling the function. The following lines show a sample usage and remember that the *.mat file that is also created must be present for proper functionality.


[y_Predict, y_ConfidenceMin, y_ConfidenceMax] = exhaust_pressure(eng_speed, throttle_pos, exhaust_flap)

y_Predict = exhaust_pressure(eng_speed, throttle_pos, exhaust_flap)


6.7 Model import

Models can be imported from a CDF/DCM calibration parameter file. This is an ASAM standard calibration parameter format.

Curves, maps and parameter types with more than three dimensions can be loaded. The dimension of the parameters loaded must match the input number if data is already loaded. For example to load a map exactly two inputs must exist and to load a cuboid exactly three inputs must exist.

If more than one output exists or if more than one label is loaded you will be asked to correlate the parameters loaded to the output(s). To not assign any model to an output keep the corresponding field empty.

Afterwards you will be asked to assign the inputs to the axes of the parameters loaded. The axes ranges of the first parameter loaded are shown to ease the choice. The correlation will be used commonly for all parameters loaded. If the axes assignment of the parameters is not identical the import must be done sequentially for the single parameters.

6.8 Model section

The dimension of a model matches its input number. A model section reduces the model dimension by setting some of its inputs to fixed values (Ctrl + t). The resulting section can have two, one or no inputs and therefore be a map, curve or a scalar value.

A model section is a quick way to get an illustrative representation of a part of the model. For example a model with five inputs can be reduced to two inputs and therefore just a map remains. A model section may be useful just for visualization purposes but also to derive calibration parameters. Creating a section for multiple models simultaneously allows to judge a model trade off.

To create a model section first of all the models to derive sections from have to be selected. Afterwards the fixed input values and some options will be asked.

Finally the resulting model section will be shown graphically. If selected, a dialog will be shown to save the model section and additional information to a calibration parameter file.

7 Optimize

7.1 Calibration parameter optimization

A model can be used to optimize calibration parameters. These are maps or curves that assign a z-value based on x/y-axes input values or scalars. Parameters to calibrate must have a model parameter input channel as z-value and global model input channels as axes values.

To pick up the emission model example a typical calibration parameter would be the injection angle map. Its axes engine speed and load are global input channels of the model and its z-value to calibrate (injection angle) is a parameter input channel of the model.

So the calibration optimization task would be to find for every map breakpoint combination the injection angle that leads to minimal CO emissions. If you like to optimize a criterion depending on multiple channels or need to regard constraints you may create a calculated channel as output to optimize. See section Multiple criteria optimization for details.

A calibration optimization returns a result only for one input channel at a time. This does not mean that the other channels are not optimized (see below) but the result will only be shown for one input. If you want to optimize multiple input channel calibration values this must be done sequentially. See Multiple parameter optimization for details.

7.1.1 Single parameter optimization

Starting the optimizing of a calibration parameters some options will be asked.

Depending on the calibration parameter source chosen the DCM/PaCo/CDF file and parameter will be asked or the default map/curve/scalar value will be created.

Once the input channel to calibrate was chosen you have to decide how to handle the remaining parameter input channels. In our example these are the cam angle and the ignition offset.

You may choose between the following alternatives:

Then the axes of the parameters need to be assigned to global input values of the model. If at that time the input channels were not defined as global this may be done using the corresponding menu item without reloading the data.

If the calibration parameters were loaded from file the axes ranges will be shown to ease the channel assignment.

A model may have more global inputs than the calibration parameters axes number. In this case a fixed value for all not assigned global values will be asked. Also input channels may be set to fixed values (see above) that will be asked here. In our example the coolant temperature is defined as a global channel and will be asked as it is not an axis of the calibration map for the injection angle. Also the cam angle will be asked because we decided not to optimize it and not to read it from a already existing calibration parameter.

After supplying all needed input the calibration parameter is optimized. If a tolerance was given also the upper and lower boundary parameters will be created. A dialog will be shown to save the parameters and additional information to a calibration parameter file and the resulting parameters will be shown graphically. Scalar parameters will be displayed numerically.

In case the parameters contain invalid values (NaN) you will be asked for a replacement value because invalid values cannot be written to a calibration parameter file. Leave empty to keep the invalid values.

7.1.2 Multiple parameter optimization

A calibration optimization gives a result only for one input channel at a time. This does not mean that the other channels are not optimized but the result will only be shown for one input. If you want to optimize multiple input channel calibration values this must be done sequentially.

When the task is to optimize the injection angle and the ignition angle to minimize some emissions we would first select for example the injection angle for optimization. During this optimization we already set the handling for the ignition angle input to **optimize**. This will be done in the background and you will not be able to see the resulting values. Optimization will be done by selecting the optimum from the model axes values. Therefore during model training the axes must be chosen carefully regarding the granularity to enable effective optimization.

This way we retrieve a optimized injection angle map that can afterwards be smoothed and limited.

In a second step we repeat the optimization for the ignition angle map. This time we set the input handling for the injection angle input to use the already optimized map resulting from the first optimization. For the map to be available for selection it must be stored in the same source that is used to retrieve the ignition calibration parameter to optimize. When the source is set to DCP/PaCo/CDF file it must also contain the optimized injection angle map. When the source is set to ETAS INCA software the dataset must contain the optimized injection angle map.

The advantage of this approach is that the results of previous optimizations can already be taken into account for each optimization.

7.1.3 Multiple criteria optimization

Apart from the actual goal of optimization - thus minimizing a model output, you can consider other options such as boundary conditions or the weighting of different outputs by calculated channels.

Here are some examples:

Multiple channel optimization operating point independent

Here the three emission components are converted to a single mean value and at the same time normalized because of their widely different ranges of values. The result is a channel to use as model output to minimize with equal consideration all emission components – in the same manner for all global operating points.

Multiple channel optimization operating point dependent

Here the three emission components are converted to a single mean value with operating point (speed, load) dependent weighting at the same time. The weighting is performed by maps, which are read from a calibration parameter file. It is also possible to specify the maps directly in the calculation ("InterpolMap" object).

The result is again a channel to use as model output to minimize. Thus, e.g. at higher loads the NOX are valued more, whereas at low loads, the other components are in the foreground.

Constraints / limits

To consider boundary conditions can be realized by "punishing functions". In the following example, the CO emissions are increased by a factor depending on the exhaust gas temperature and misfiring rate. The factor is interpolated from curves that consist of an axis (for example, [800 850 900]) and a penalty factor (for example [1 1.1 2]).

By punishing the emissions the optimization will avoid optimization results where the constraints or limits are violated.

7.2 Calibration system optimization

Usually ECU function systems are physically based and include maps, curves and scalar calibration parameters that are connected using mathematical operations. This way they calculate an output value depending on some input values.

The calibration task is to find values for all parameters of an ECU system that minimize the deviation of the system output compared to reference values that are usually generated from measurement or simulation. This task might be very challenging because an ECU function cannot yet represent the correlations of arbitrary systems in a complete and real-time manner – e.g. internal combustion engines. Thus, often only main effects are implemented in a way that an entirely exact setting of the calibration parameters is no longer feasible and a compromise has to be made through prioritization. Additionally sometimes calibration parameters cannot be determined directly or not in the entire operating range. For example, Otto engine torque models or exhaust-gas temperature models often contain parameters which apply to 100% ignition efficiency and lambda one. If these operating ranges cannot be measured for reasons of knocking limits or component protection, only an indirect determination is possible.

The ModelArtist supports to automatically calibrate ECU systems (Ctrl + Shift + o) to match the ECU system behavior with one or more models or the loaded data points. This is done avoiding the mentioned problems and resolving the challenges and therefore provides the calibration engineer and software developer an universal tool for the automated calibration of ECU functions.

The following figure shows a typical ECU system to calculate the intake mass flow for two cylinders individually depending on engine speed, throttle position and exhaust flap position.

For each cylinder a minimum and maximum mass flow map exists and a central weighting map MAP_EXH_FLAP implements the exhaust flap influence. While the two mass flow maps could easily be calibrated by measurements the weighting map cannot. It has to balance the two cylinders and also the engine_speed influence, because the map itself has no engine speed input.

To perform a calibration system optimization first of all we create models to exactly describe the system behavior. The models have the same inputs and outputs as the ECU system. Though one model does have exactly one output we need two models – one for each cylinder. As usual the models are trained using measurement data. The following figure shows the models. As an alternative it is also possible to use just the loaded data points for optimization without need for any model.

Then we can start the system optimization.

7.2.1 Settings

Starting a calibration system optimization some options will be asked.

The following figure shows the implementation of the ECU system for cylinder 1 – first with the CalcGuide representation of the ECU function and then with an integrated Simulink system. See the CalcGuide documentation for details regarding the Simulink integration.

SGE CalcGuide documentation

The output is the difference of the ECU function and the corresponding model output. Additionally big deviations are amplified keeping the sign.

After detection of all calibration parameters inside the systems a list is presented to ask some more options. For optimization success it is essential to provide a plausible initial parameter calibration. Make sure to insert initial parameters into the calibration parameter file(s) with plausible range, shape and roughness. To speed up the optimization or to exclude sections of the parameters from the optimization the parameters may contain NaN values. These values will be ignored during optimization.

Bounds are also used to achieve a reproducible result for under-determined functions. This need exists when calibration parameters are summed up or multiplied and an infinite number of combinations exists that provide the same result. So when for example to calibration parameters to optimize are multiplied bounds must be applied to fix at least one single breakpoint value of of one of these parameters to ensure a reproducible result.

Make sure to only separate the lower and upper bound definition by spaces but not to use spaces inside the bounds definitions itself.

Examples:

"0 100" -> Lower limit 0, upper limit 100.

"+(-2) +(5%)" -> Lower limit initial - 2, upper limit initial +5%.

"Map_BoundMin Map_BoundMax" -> Lower limit defined by DCM parameter "Map_BoundMin", upper limit by parameter "Map_BoundMax".

"0 Map_BoundMax" -> Definition types can be mixed.

After entering all options some plausibility checks will be done and corresponding warning messages may be displayed. This is true when calibration parameters selected for optimization do have nearly no influence to the optimization result. Several reasons can cause this behavior:

Anyway this is only a hint and does not necessarily mean that a fault is present. Decide for yourself whether the behavior is desired and terminate the optimization if you want to change the settings.

7.2.2 Optimization

In general the optimization is a two step procedure. First the actual optimization is done. Afterwards a smoothing step (post processing) is done to retrieve plausible and smooth calibration parameters.

The optimization will minimize the value of the absolute system outport data by modifying the selected calibration parameters. The “System output evaluation” setting determines how to retrieve a scalar value from the outport data.

In case multiple systems are specified their resulting values will be merged using the same evaluation as for the single systems (mean, maximum, minimum). So in our example the optimization will try to minimize the mean value of the two mean values of the two system outputs.

During optimization a progress bar is shown indicating the actual optimization state and the progress for some periods in the past. Using the “Options” button or closing the progress bar enables to terminate the optimization, to view and save intermediate results or to reconfigure the optimization settings. Some post processing options are already available from the waitbar directly using keyboard shortcuts (Status: Ctrl + a, Progress course: Ctrl + p, System signal visualization: Ctrl + i, Save calibration parameter file: Ctrl + s).

The post processing to access the intermediate results is explained in the following section.



7.2.3 Post processing

The post processing enables to obtain plausible results from the raw mathematical optimization result which may be mendable in terms of plausibility and smoothness. Visualization, evaluation and smoothing routines support this post processing. It can be carried out as an interim result during optimization and as a final result after optimization.

Before starting the post processing all systems are evaluated once with the current best optimization result. So when an integrated Simulink system is used you can explore the simulation output (e.g. scopes, MATLAB workspace...) after starting post processing to judge the result.

Post processing options

The post processing options available differ when executed during or after optimization because some options are only available during optimization. For example as an intermediate result only some calibration parameters may be selected while as the final result all parameters will be selected automatically.

The following figures show the post processing options during (left) and after (right) optimization.

Select the calibration parameters to include into the post processing. As an intermediate result only some calibration parameters may be selected while as the final result all parameters will be selected automatically.

This setting does only apply to parameters with the “Only significant parameter sections” setting active.

7.2.4 Smoothing the optimization result

The smoothing during post processing is a highly recommended option to obtain plausible results from the raw mathematical optimization result which may be amendable in terms of plausibility and smoothness. If selected, the parameters are smoothed automatically. This is accompanied by an elaborate graphical representation of the parameters, which also allows manual judgment and editing of the parameters.

The smoothing algorithm does not perform the smoothing on its own. The quality is always taken into account by means of the system outputs. Also during manual editing you will always have the option to visualize and judge the effects of the work done considering the systems output. This is a major advantage compared to all later post processing.

During smoothing progress windows are displayed separately for the single calibration parameters which are maps or curves. They are split into two sections. The left sections shows the actual parameter shape at the actual smoothing progress in addition to the initial shape and the raw optimized shape before smoothing start. The right section uses the same axes to visualize the system outputs. For each parameter breakpoint all relevant systems output values are calculated to a mean absolute value. The view for the system outputs is updated automatically during smoothing periodically. During mixing these views will be hided when parameters are set to inactive or edited manually. You need to update them manually using the corresponding menu or context menu item.

So the left section enables to judge the smoothness progress while the right section simultaneously enables to judge the resulting effect regarding the system outputs and therefore the optimization target.

The following options are available to influence the post processing:

Each progress window has a button to disable the smoothing for the individual parameters separately at sufficient progress. Disabling will also turn of the update of the right section and hide the display for the smoothed calibration parameter. When disabled the parameter will no longer be modified automatically.

Each progress window has a button to pause the entire smoothing. This helps to find time for a thorough assessment of the status and manual actions like editing or freezing sections. During pause the view of the system output will still get refreshed to visualize e.g. effects of manual changes.

You can use this menu to influence the smoothing process. It is possible to manually adjust the parameter before or during smoothing as well as to freeze sections that are considered to be sufficiently smooth. To do this, the parameter is opened in the MapArtist. While the MapArtist is opened the automatic smoothing of the parameters is paused. To proceed and accept the manual changes terminate the MapArtist.

The menu allows you to quickly adapt the display to your needs. It is possible to deactivate the automatic axis adaptation and arrange the active windows according to different criteria.

During smoothing a waitbar is visible to present the actual progress and the phase number. The smoothing process may consist of multiple phases. Smoothness will increase with ascending phase number as well as the system output values and therefore the loss of optimization target. The transition to the next phase is done automatically. When a quick increase in smoothness is desired a premature transition to the next phase can be forced using the “Intensify smoothing” option presented after pressing the “Options” button or closing the waitbar.

When the progress windows indicate a sufficient condition smoothing can be terminated also by closing the waitbar and choosing “Finish smoothing”. Afterwards post processing will proceed with an assisted consolidation – called mixing. See the following section for details.

Smoothing is not supported for calibration parameters with more than 2 dimensions (3D+).

7.2.5 Mixing the optimization result

The last result of smoothing is not always the optimal one with regard to all criteria. The smoothing may have run too long and caused increased errors. Or the assessment is not the same for all parameters. Some of them may be too smooth, others are not yet smooth enough. Therefore the final best result can now be put together individually, since after smoothing a large number of variations of the parameters are available, which differ in terms of plausibility, smoothness and errors. These are generated by the phases of automatic smoothing, manual changes during smoothing and freezing of parts of the parameters.

A smoothing mixer will show up and enables to balance the smoothing result between the initial state before smoothing and this set of parameter variations. All progress windows will update dynamically when moving the mixers slider. In this way, the entire smoothing process can be followed in detail and the decision can be made at which point the optimum result is achieved in every respect.

In addition to the system output visualization for every calibration parameter, the system signals visualization is also available to support the decision at any mixer state which enables to judge the inputs, outputs or intermediate results of the calculations for the current smoothing mixer state – see “System signals visualization” for details.

The view for the system outputs will be hided when parameters are set to inactive or edited manually because it cannot be generated from a saved state and needs to be recalculated. Therefore you need to update them manually using the corresponding menu or context menu item.

If no satisfactory state can be found in this way, there are additional options to create any combination of parameters that are not linked by the single mixer state.

The final slider state before closing the mixer window defines the smoothing state that will be used for further post processing – e.g. for visualization and saving to file.

Additionally an arbitrary number of additional mixer states can be added to a result list and also restored from the list. The corresponding parameters will also be available as a result in the visualization and saved files. The states can be given names and can be deleted individually.

7.2.6 System signals visualization

The evaluation of the result of the optimization is supported by the visualization of various signals, which are either inputs, outputs or intermediate results of the calculation. All signals are made available for the states before optimization, after optimization before and after smoothing as well as all mixer states. The System signals visualization is available from post processing during and after optimization as well as during smoothing and mixing. Quick access is available using the shortcut Ctrl + i from the waitbar during optimization and smoothing.

Inputs and outputs will be visualized by default. In addition, there is the possibility to insert “Interim” objects into the calculation which make these signals available for the analysis after optimization too. This way also signals in the middle of the calculation are accessible, e.g. the output of a Simulink simulation before application of differences and weightings.

The following figure shows an example of a system and the visualization of its inputs, outputs and the Interim signals “ECU massflow output” and “Model massflow output”.

If the result of the optimization is not satisfying the resulting DCM may be used as initial values for a next optimization loop. A typical proceeding would look like this:

7.3 Mark optimum

You can quickly set the cursors to an extreme of one output channel. You can select to use the data points or the model values (if any) and if you are interested in the maximum or minimum value.

After the cursors were positioned at the optimum the resulting input and output values are displayed.

8 Save data

8.1 Save session

The whole session including data can be stored as file (Ctrl + Shift + s). After re-opening the whole functionality can be used again immediately.

Session files can be opened the same way as data files or using the SGE Viewer. Session files may get very large as they contain the loaded data.

9 Design of Experiment (DoE)

The SGE DoEArtist enables to create and visualize statistical test designs (DoE). Please see the corresponding documentation for further information.

SGE DoEArtist documentation

10 Present, print data

To be able to use the data and model also for presentation purposes, the ModelArtist makes it available to export the actual view into clipboard or file formatted in a way that is suitable to be useful for different targets (Ctrl + shift + c).

This can be different sizes of clipboard content. "Email" and "Document" are specially sized to fit into a email or document software. Some paper formats are also available and all windows can be printed and saved to various file formats.

The created plot is configurable. So you can move elements like legend or cursor boxes. It is also possible to add lines, arrows, text boxes etc. to the plot to explain or highlight.

During creation some options will be asked to define the base layout of the plot.

After closing the window the content will be copied to clipboard and can be pasted / used in the target software.

11 General information

Duplication, processing, distribution or any form of commercialization of the documents content beyond the scope of the copyright law shall require the prior written consent of the SGE Ingenieur GmbH. All trade and product names given in this document may also be legally protected even without special labeling (e.g. as a trademark).


The SGE Circus includes Third Party Software. For details please refer to the → SGE Circus documentation.


SGE Ingenieur GmbH – www.sge-ing.de

Copyright 2011-2022. All rights reserved.