 ValidateResult - Maple Help

FMUTester

 ValidateResult
 validate a simulation result against a reference result Calling Sequence ValidateResult(result, reference, options) Parameters

 result - one of Matrix, python or string; simulation result reference - one of Matrix, python or string; reference result Returns true if result matches reference with maximum relative deviation maxrelout; otherwise, false Options

 • maxrelout: numeric
 Maximum relative deviation for all output signals. This value is used as a boundary to determine if the validation is successful or not. The validation is unsuccessful if there is an output signal in result with relative deviation greater than maxrelout (more than maxrelout*100% of the samples are outside of the epsilon band around its corresponding reference signal). The default is 0.1. Description

 • The ValidateResult procedure validates a simulation result against a reference result.
 • ValidateResult uses the "fmpy.util.validate_result" function from the Python FMPy library, which creates an epsilon band around the reference signal and finds the values in the result signal that are outside of this band. This function returns the largest relative deviation of all output signals, i.e., the relative deviation for the output signal with the most outliers. The validation criterion is the same as that used in the "fmpy.cross_check" function, and can be changed through the maxrealout option.
 • The result and reference arguments can be specified as:
 – a Matrix : its first row contains strings specifying the time (first column) and the output variable names for the data in each subsequent Matrix column.
 – a python object : structured NumPy array (ndarray), or
 – a string : filename of the comma-separated value (CSV) file containing the data. This CSV file complies with the FMU GitHub repository rules, i.e., its first row must be a header with double-quoted strings which specify the time and the output variable names. Examples

 > $\mathrm{with}\left(\mathrm{FMUTester}\right):$

Simulate the FMU

 > $\mathrm{fmuname}≔\mathrm{FileTools}:-\mathrm{JoinPath}\left(\left["FMUs","CoupledClutches.fmu"\right],'\mathrm{base}'='\mathrm{datadir}'\right):$
 > $\mathrm{inputcsv}≔\mathrm{FileTools}:-\mathrm{JoinPath}\left(\left["FMUs","CoupledClutches_in.csv"\right],'\mathrm{base}'='\mathrm{datadir}'\right):$
 > $\mathrm{result}≔\mathrm{SimulateFMU}\left(\mathrm{fmuname},'\mathrm{inputfile}'=\mathrm{inputcsv},'\mathrm{returntype}'=\left["Matrix"\right]\right)$ Specify the reference file

 > $\mathrm{reference}≔\mathrm{FileTools}:-\mathrm{JoinPath}\left(\left["FMUs","CoupledClutches_ref.csv"\right],'\mathrm{base}'='\mathrm{datadir}'\right):$

Compare and validate the simulation result with the reference file

 > $\mathrm{ValidateResult}\left(\mathrm{result},\mathrm{reference}\right)$
 ${\mathrm{true}}$ (1) Compatibility

 • The FMUTester[ValidateResult] command was introduced in Maple 2019.