ValidateResult - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


FMUTester

  

ValidateResult

  

validate a simulation result against a reference result

 

Calling Sequence

Parameters

Returns

Options

Description

Examples

Compatibility

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

withFMUTester:

Simulate the FMU

fmunameFileTools:-JoinPathFMUs,CoupledClutches.fmu,base=datadir:

inputcsvFileTools:-JoinPathFMUs,CoupledClutches_in.csv,base=datadir:

resultSimulateFMUfmuname,inputfile=inputcsv,returntype=Matrix

Specify the reference file

referenceFileTools:-JoinPathFMUs,CoupledClutches_ref.csv,base=datadir:

Compare and validate the simulation result with the reference file

ValidateResultresult,reference

true

(1)

Compatibility

• 

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

• 

For more information on Maple 2019 changes, see Updates in Maple 2019.

See Also

FMUTester

FMUTester[FetchFMU]

FMUTester[FMUInfo]

FMUTester[SimulateFMU]