Inhaltsverzeichnis

Interpolations

CGRAPH can create interpolated graphs for a list of values and, in classic cases, also determine the underlying function. Value pairs can be entered as values or graphically, or they can be imported as a CSV file and also saved.

Types of interpolation

The following types of interpolation are available:

Name Function Description
linear y=mx+b interpolates a straight line from the entered values
quadratic y=ax²+bx+c interpolates a quadratic parabola from the entered values
exponential y=c*eax interpolates an exponential curve from the entered values
limit value y=c*(1-eax) interpolates a negative exponential curve from the entered values that approaches a limit value
Fourier series y=∑ck*sin(akx) This type of interpolation is suitable for periodic processes. The individual coefficients of a Fourier series are determined
Chain line y=c*cosh(ax) Interpolates a chain line from the entered values that follows the hyperbolic cosine
Akima y=ak+bk*(x-xk)+ck* (x-xk)2+dk*(x-xk)3 draws a graph that continuously connects all points with individual cubic polynomials
Bar graph no interpolation - simply draws the values as bars in the graph
Line display No interpolation - simply draws the values as connected lines in the graph

Details on the mathematical implementation of the interpolations can be found in the Mathematical Basics

The automatic interpolation type is preselected. CGRAPH then attempts to determine the best interpolation type based on the values entered – this is the type that results in the smallest deviation of the calculated curve from the input values.

Entering values via keyboard

Individual values can be entered in the left-hand area and added to the list. Either a colon ‘:’ or a semicolon ‘;’ can be used as a separator. If only a number is entered, it is interpreted as an x-value. The corresponding y-value is automatically added and set to 0.

Once values have been entered, they can be changed. To do this, simply click on the desired value in the list. It will then be displayed in the left-hand area and can be changed. After clicking on the Change value button, the new value will also be displayed in the list. Clicking on Cancel change will return you to the new value entry screen without making any changes.

By switching the tab on the right-hand side to graphical input, the entered values can be displayed in advance in a graphics window. By right-clicking in the list on the right-hand side, the values can be easily shown or hidden.

Graphical input

By switching the tab on the right-hand side to graphical input, values can also be entered in a graphics window. To do this, simply tick the Graphical input activated checkbox. Each click in the graphic window then generates another point. To zoom and scroll in the graphic, this checkbox must be deactivated – after zooming or scrolling, further values can then be entered.

All graphical entries are then also displayed in the List of values.

Loading and saving

Values can also be read from CSV files using the Load from file button. CGRAPH uses the first two columns of the file, separated by semicolons, which must contain numerical values. If only one column is available, CGRAPH interprets it as a y-value and adds a consecutive x-value.

Entered value pairs can be saved as CSV files at any time using the Export button.

Converting values

CGRAPH offers several predefined interpolation types that do not fit every value pair relationship. Even an offset b in the function y=c*eax+b prevents an exponential curve from being calculated cleanly. In this case, it helps to remove the (usually recognisable) offset using a function f(t) = t-b. Another example is logarithmic curves. A curve that follows the function y=c*log(a*x) can be converted into a straight line using (f(t) = exp(t)), where linear interpolation is then used. After clicking on Convert values, an additional window opens.

The original output values are displayed on the left side of the window. Two functions can be entered for x and y at the top; only the variable t is permitted. The function for x(t) is primarily used to define a more suitable division for values loaded from a file without ordinate reference (i.e. only y-values for which CGRAPH has automatically assigned consecutive x-values). The function for y(t) converts the y values. However, both functions together can be used, for example, to convert value pairs in polar coordinate format to Cartesian format.

The converted values are displayed on the right-hand side of the window either graphically (with scales adjusted to the value pairs so that all values are visible) or as a list. The conversion takes place immediately after the functions have been entered. By clicking on Apply values, the converted values are then transferred to the list in the main window.

Graphical representation

After clicking on the Execute interpolation button, CGRAPH calculates (automatically, if desired) the coefficients of the (best) interpolation method and switches to the graphical representation.

The graphical representation then displays the entered values and the calculated curve in different colours.

Editing the determined interpolation

The determined coefficients and the calculated function are displayed above the graph.

The display of the coefficients depends on the interpolation method. In the example, there are three coefficients a, b and c for a quadratic parabola. The determined function is displayed in the right-hand area. It can be edited; the result is then immediately visible in the graphic. In this way, the function can be further adjusted to the individual values.

With the Save function button, the function is added to the list of function terms managed by CGRAPH and is then available within the Functions graphic type.

The Back to original function button restores the original parameters – the function then corresponds to the calculated interpolation again.

The calculated values are also displayed in the tree view. Here, the interpolated values and the calculated function can also be hidden and shown again.

Notes on operating the graphic display

Back to overview