AmesimKnowledge

Description of the Expression Editor functions

Functions from Export Parameters Setup dialog or Post-Processing tab

When you open the Expression Editor from the Export Parameters Setup dialog box, or the Post-Processing tab, all the functions described in Functions available from the Tools menu or when changing a submodel parameter are available, as well as the extra functions described here:

differ(A) dist(A,B)
filter(A, n, wc) globMax(A)
globMaxTime(A) globMin(A)
globMinTime(A) integ(A)
leftTrunc(A,T) locMax(A)
locMaxTime(A) locMin(A)
locMinTime(A) mean(A)
reachTime(A,B) readTableConvertedTimeCubic
readTableConvertedTimeLinear readTableTimeCubic
readTableTimeLinear readTableVarCubic
readTableVarLinear responseTime(A,S)
restrict(A,T1,T2) rightTrunc(A,T)
valueAt(A,T)

differ(A)

differ(A)

Brief description Derivation
Full description Computes the derivative of a variable A. The result value is defined as: Except for TN=EndTime where the formula used is:
Domain of definition differ(A) is defined for every Ti where A(Ti) and A(Ti+k) are defined where k is the first integer for which Ti≠Ti+k. It is also defined for TN=EndTime if A(TN-k) is defined where k is the first integer for which TN≠TN-k.

dist(A,B)

dist(A,B)

Brief description Distance between two curves
Full description The definition of the distance between two signals is the classic one: dist(A,B) is then computed as integ(fabs(A-B)).
Domain of definition It is defined as soon as A and B are defined at a given time T.

filter(A, n, wc)

filter(A, n, wc)

Brief description This function returns a filtered signal at a given cut-off frequency and a specified order.
Full description A is the input signal the user wants to filter. n is the filter order 1 ≤ n ≤ 5 (wc) is the relative cut-off frequency 0≤ wc ≤ 0.5 The relative cut-off frequency is the ratio between the desired cut-off frequency and the signal sampling frequency. The maximum value of (0.5) is the Nyquist frequency. This function applies an IIR, nth order Butterworth round trip filter to a signal. If this function is used in a stand-alone version, the last value of the filtered signal is returned. Warning: The filter function relies on equidistant points. This means that the signal to which you are applying the filter must have been obtained using a constant print interval. You must make sure that: the simulation was launched without discontinuity printouts. the submodel TI001 was not enclosed in the simulated system.
Domain of definition The domain of definition is the same as that of the original signal.

globMax(A)

globMax(A)

Brief description Global Maximum
Full description globMax is calculated in three stages: We determine the communication time Tj (from the various time steps) for which A is maximal. In other words, we look for: j ϵ{0,..,N} such that A(Tj)= Max {A(Tk), k ϵ{0,..,N}} We approximate A using a second degree polynomial between Tj-1 and Tj+1, using the reference values A(Tj-1), A(Tj) and A(Tj+1). globMax thus corresponds to the maximum value of the polynomial calculated in step 2 between the communication times Tj-1 and Tj+1. For more information, see Local and Global Max.
Domain of definition It is defined as soon as A(t) is defined for at least one t. Remark: In most cases, globMax(A) ≠ Max {A(Tk), k ϵ{0,..,N}} but instead corresponds to the maximum value of a polynomial interpolation of A between Tj-1 and Tj+1.

globMaxTime(A)

globMaxTime(A)

Brief description Global Maximum Time
Full description Computes the time for which globMax(A) is reached.
Domain of definition The result of globMaxTime does not necessarily correspond to a Simcenter Amesim communication time.

globMin(A)

globMin(A)

Brief description Global Minimum
Full description This function is defined as globMin(A) = globMax(-A)
Domain of definition cf globMax(A).

globMinTime(A)

globMinTime(A)

Brief description Global Minimum Time
Full description This function is defined as globMinTime(A) = globMaxTime(-A)
Domain of definition cf globMaxTime(A).

integ(A)

integ(A)

Brief description Integration
Full description Returns the value of the integration of A on the whole domain of definition of A. To compute the integral we are using the following approximation (trapezoidal method):
Domain of definition It is defined as soon as A(t) is defined for at least one t. valueAt(integ(A), T) is defined if and only if T belongs to the domain of definition of A and is Thus, if A is defined on [T1, T2], integ(restrict(A, T1, T2)) is: valueAt(integ(restrict(A, T1, T2)), T) is defined only if T belongs to [T1, T2] and is:

leftTrunc(A,T)

leftTrunc(A,T)

Brief description Left truncation of a signal
Full description Allows the user to ignore the left part of a simulation result. If used alone, the result value is the value at time t= Final Time.
Domain of definition The domain of definition is limited to [T,Final time]. This means that valueAt(leftTrunc(A, T),t) is undefined for t < T. It is also undefined on every point where A is undefined.

locMax(A)

locMax(A)

Brief description Local Maximum
Full description Computes the maximum value of all the local maxima reached by the variable or expression A in its domain of definition. The value is computed by: where: T0 = start time TN = end time
Domain of definition If at least one local maximum is found, the domain of definition is [Start Time, Final time]. Otherwise, the domain of definition is empty. This means that valueAt(locMax(A, T),t) is either never defined or defined and constant only for t in [Start time, Final Time] (using valueAt with locMax is not useful at all). It may also be defined even on point where A is undefined. But it is always undefined if A is never defined for 3 consecutive communication times on [Start Time, Final time].

locMaxTime(A)

locMaxTime(A)

Brief description Local Maximum Time
Full description Computes the time for which the highest local maximum is found.
Domain of definition The domain of definition is the same as for locMax function

locMin(A)

locMin(A)

Brief description Local Minimum
Full description defined as locMin(A) = -locMax(-A).
Domain of definition cf. locMax(A).

locMinTime(A)

locMinTime(A)

Brief description Local Minimum Time
Full description This function is defined as locMinTime(A) = locMaxTime(-A).
Domain of definition cf. locMaxTime(A).

mean(A)

mean(A)

Brief description Mean Value
Full description The mean value definition of a signal used here is the classic one: and if
Domain of definition The domain of definition is the same as for the integ function.

reachTime(A,B)

reachTime(A,B)

Brief description Reach Time
Full description Tries to find the first communication time ti for which: - A(ti) and B(ti) are defined and are such as: A(ti) = B(ti) OR - A(ti-1), B(ti-1), A(ti) and B(ti) are defined and are such as: A(ti-1) < B(ti-1) AND A(ti) ≥ B(ti) OR A(ti-1) > B(ti-1) AND A(ti) ≤ B(ti)
Domain of definition If no such time is found, the function is never defined. Otherwise, valueAt(reachTime(A, B), t) is defined and constant only for t in [Start Time, Final Time] and is not defined for any other t. It may also be defined even on point where A or B are undefined.

readTableConvertedTimeCubic

readTableConvertedTimeCubic

Brief description Read tables from files using cubic splines, converting the time line to the requested unit
Full description readTableConvertedTimeCubic(file_path, boundary_conditions, extrapolation_type, left_slope, right_slope, time_unit) file_path is the path to the file containing the table to read. It must be enclosed in double quote characters. The format of the file must be of type 1D Table. boundary_conditions are the conditions at the edges for the extrapolation. extrapolation_type is the extrapolation method to use. left_slope is the slope to apply when extrapolation on the left is needed. This is available when boundary_conditions is specified as the slopes mode. right_slope is the slope to apply when extrapolation on the right is needed. This is available when boundary_conditions is specified as the slopes mode. time_unit is the unit time range that has to be converted. For example if, in the table being read, the time line has been saved using ms time unit, you will have to set this third argument to "ms". Default unit is s.
Domain of definition boundary_conditions: 0: Not valid out of table range 1: Natural (y"=0). 2: Specified slopes 3: Cyclic - first and last values of the table must be the same. extrapolation_type: 1: Linear. 2: Cubic.

readTableConvertedTimeLinear

readTableConvertedTimeLinear

Brief description Read tables from files using linear splines, converting time line to the requested unit
Full description readTableConvertedTimeLinear(file_path, extrapolation_type, time_unit) file_path is the path to the file containing the table to read. It must be enclosed in double quote characters. The format of the file must be of type 1D Table. extrapolation_type is the extrapolation method to use. time_unit is the unit time range that has to be converted. For example if, in the table being read, the time line has been saved using ms time unit, you will have to set this third argument to "ms". Default unit is s.
Domain of definition extrapolation_type: 0: Not valid out of table range. 1: Extrapolation. 2: Extreme values. 3: Cyclic - first and last values of the table must be the same.

readTableTimeCubic

readTableTimeCubic

Brief description Read tables from files using cubic splines
Full description readTableTimeCubic(file_path, boundary_conditions, extrapolation_type, left_slope, right_slope) file_path is the path to the file containing the table to read. It must be enclosed in double quote characters. The format of the file must be of type 1D Table. boundary_conditions are the conditions at the edges for the extrapolation. extrapolation_type is the extrapolation method to use. left_slope is the slope to apply when extrapolation on the left is needed. This is available when boundary_conditions is specified as the slopes mode. right_slope is the slope to apply when extrapolation on the right is needed. This is available when boundary_conditions is specified as the slopes mode.
Domain of definition boundary_conditions: 0: Not valid out of table range. 1: Natural (y"=0). 2: Specified slopes. 3: Cyclic - first and last values of the table must be the same. extrapolation_type: 1: Linear. 2: Cubic.

readTableTimeLinear

readTableTimeLinear

Brief description Read tables from files using linear splines
Full description readTableTimeLinear(file_path, extrapolation_type) file_path is the path to the file containing the table to read. It must be enclosed in double quote characters. The format of the file must be of type 1D Table. extrapolation_type is the extrapolation method to use.
Domain of definition extrapolation_type: 0: Not valid out of table range. 1: Extrapolation. 2: Extreme values. 3: Cyclic - first and last values of the table must be the same.

readTableVarCubic

readTableVarCubic

Brief description Identical to readTableTimeCubic except that it has an extra argument which is the table input expression.
Full description
Domain of definition Table input is a token, or expression of tokens, recognized by the Expression Editor.

readTableVarLinear

readTableVarLinear

Brief description Identical to readTableTimeLinear except that it has an extra argument which is the table input expression.
Full description
Domain of definition Table input is a token, or expression of tokens, recognized by the Expression Editor.

responseTime(A,S)

responseTime(A,S)

Brief description Response Time
Full description Returns the last time at which a specified signal was outside a specified range ‘I’ of its final value. I = [1-S/100)*XFinal ; (1+S/100)*Xfinal] Syntax: responseTime(A,S) A is the input signal the user wants to analyze. S is a percentage This computation is based on the stabilization of a signal at the end of a simulation. It is the user’s responsibility to ensure this criterion is respected. The function does not return an error message in the case of a non-stabilized signal.
Domain of definition The function is defined as soon as A(t) is defined for at least one t.

restrict(A,T1,T2)

restrict(A,T1,T2)

Brief description Restriction to a time interval
Full description Allows the user to only consider part of a simulation result. If used alone, the result value is the value at time t= T2.
Domain of definition The domain of definition is limited to [T1, T2]. This means that valueAt(restrict(A, T1, T2),t) is undefined for t < T1 and t > T2. It is also undefined on every point where A is undefined.

rightTrunc(A,T)

rightTrunc(A,T)

Brief description Right truncation of a signal
Full description Allows the user to ignore the right part of a simulation result. If used alone, the result value is the value at time t= T.
Domain of definition The domain of definition is limited to [Start Time, T]. This means that valueAt(rightTrunc(A, T),t) is undefined for t > T. It is also undefined on every point where A is undefined.

valueAt(A,T)

valueAt(A,T)

Brief description Value at time t
Full description Returns the value of a variable or expression at a given time. If the specified time is not a communication time, the nearest communication time is considered.
Domain of definition The result value is said to be undefined if: the specified time is outside the domain of definition of the variable or expression. A or T are undefined. T is lower than Start Time or greater than Final Time

Local and Global Max

Local and Global Max

Figure 511: GlobMax

Figure 512: LocMax

Figure 513: LocMax and GlobMax

Source: https://docs.sw.siemens.com/en-US/doc/254352342/PL20250521841123434.amesim_collection.Reference/id38646 · retrieved 2026-07-17