open-psa/mef

Parameter "units" are underspecified

rakhimov opened this issue · 1 comments

The "unit" attribute and values of parameters (and mission time)
are underspecified, raising many questions, such as:

  1. Is it just for informational purposes?
  2. Is it meant to give types for expressions (related to #39)?
  3. Does the standard imply proper unit conversions in expressions?
  4. What happens if units don't match?
  5. What is the default unit for parameter and mission time?

Let's say, we have parameter lambda in inverse years
and assume that mission-time is in hours:

    <define-parameter name="lambda" unit="years-1">
        <float value="1e-7"/>
    </define-parameter>

Should there be implicit unit conversion (from years-1 to hours-1)
upon the parameter use?
Or mixing these parameters is an error?

    <exponential>
        <parameter name="lambda"/>
        <system-mission-time/>
    </exponential>

What happens if at the reference site, the parameter unit is different?

    <exponential>
        <parameter name="lambda" unit="hours-1"/>
        <system-mission-time/>
    </exponential>

Should units be checked for all expressions?
Probability should have no units, so should the following fail?

    <define-basic-event name="pump">
        <parameter name="lambda"/>
    </define-basic-event>

Moreover, for some reason (maybe for question 2),
the MEF "units" have bool, int, float,
which are not units of measurement.

The "unit" attribute is very confusing! We don't use it :-)
It mixes to many thing.
For a future format I think that we should have at least 2 attributes.
One for the user point of view: the dimension (length, time, velocity, rate (1/time), mass, no dimension ...) because he needs to know what kind of value he is dealing with. See https://en.wikipedia.org/wiki/Dimensional_analysis .
One for the software developer point of view: integer (long), float (double), Boolean
"Unit" could be a third one. For example for a parameter with "Time" dimension we could have Hour, Minute, Year, Month, ...
Everything should be in SI unit but reliability engineers don't use seconds.
We could assume (for built-in laws) that parameters have default unit (hours for exponential).
Anyway, these attributes have to be used only for parameter declaration, and not when they are used.
So if parameter is defined with "years", the value must be multiplied by 8760 when used in the law.
The problem of "years" is has that least 3 different definitions according to the industries, that why I think Unit is not mandatory in the OPEN-PSA format. Software can handle it, but write exchange format in default unit.