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
| Type | Name | Default | Description |
|---|---|---|---|
| Real | x_1 | Values of interest | |
| Real | x_2 | Reference values | |
| Real | errorExpected | 1e-6 | if Error_rms < errorExpected then test = Passed |
| Real | tolerance | 100*Modelica.Constants.eps | To avoid division by 0 |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| Real | Error_rms | Root Mean Square error sqrt(sum(Error_abs.^2)/n) | |
| Real | Error_rmsRel | Root Mean Square error sqrt(sum(Error_rel.^2)/n) | |
| Real | Error_abs | Absolute error (x_1 - x_2) | |
| Units.NonDim | Error_rel | Relative error (x_1 - x_2)/x_2 | |
| Real | passedTest | if 0 (false) then expected and actual values to not match within the expected error |