functionAbsRelRMS

Calculation of absolute, relative, and rms errors

Extends from Icons.Function (Icon for functions).

Information

Note: If abs(x_2[i]) <= eps then the relative error is simply x_1[i].

Inputs

TypeNameDefaultDescription
Realx_1Values of interest
Realx_2Reference values
RealerrorExpected1e-6if Error_rms < errorExpected then test = Passed
Realtolerance100*Modelica.Constants.epsTo avoid division by 0

Outputs

TypeNameDefaultDescription
RealError_rmsRoot Mean Square error sqrt(sum(Error_abs.^2)/n)
RealError_rmsRelRoot Mean Square error sqrt(sum(Error_rel.^2)/n)
RealError_absAbsolute error (x_1 - x_2)
Units.NonDimError_relRelative error (x_1 - x_2)/x_2
RealpassedTestif 0 (false) then expected and actual values to not match within the expected error