About undefined values in the Property Calculator
The Property Calculator (Workspace > Tools > Property Calculator) treats undefined or unknown values as a special number (NaN or 'Not a Number'), with rules covering how they are handled in mathematical expressions according to the IEEE 754 standard (see box From Kleene's to IEEE 754). This approach is widely used by today's programming languages.
Checking for Undefined (null) values
Since it is important to take into account the possibility of values being undefined, or null, the Property Calculator includes a button in the toolbar at the top of the Expression area to do this for you automatically. Click the
icon to add such checks to your current expression.
Automatic checks
Whenever you enter an expression in the Property Calculator and click Apply or OK, JewelSuite Geomechanics will automatically examine the expression to determine whether it explicitly takes into account undefined, or null, values in the input. If this is not the case, it will display a warning message. You are asked if you wish to continue with the calculation anyway.
If you wish to fix the issue, click No and then click the
icon in the toolbar of the Expression area. JewelSuite Geomechanics adds conditional expressions to your expression to check each property for null. Click OK to perform the calculations for the selected target property.
From JewelSuite 2018.3 onwards, the logic used for the treatment of undefined values in the Property Calculator is as in IEEE 754, which is the commonly used approach for most computing languages. Here, an undefined value is treated as NaN, or 'Not a Number'. In this case, expressions with undefined values as input always classify as True or False, never Undefined.
Example
Take the expression
if $Porosity$ > 0.20 then "Sand" else if $Porosity$ < 0.15 then "Clay" else "Silt"
Under the IEEE 754 approach, if the Porosity has an unknown or null value, the two comparisons evaluate to False, and the end result of the expression will be Silt. This means that the rock type will always be silt when the porosity is not known.
The possibility of the value being undefined, or null, should be explicitly considered in the expression, as in
if $Porosity$ = null then null else if $Porosity$ > 0.20 then "Sand" else if $Porosity$ < 0.15 then "Clay" else "Silt"
This will now yield the intended answer of Porosity = 0 to 0.15, type = Clay; Porosity = 0.15 to 0.20, type = Silt; Porosity = 0.20 to 1, type = Sand; Porosity unknown, type = unknown.
Click the Insert Undefined Checks
icon in the toolbar at the top of the Expression area to automatically add undefined checks to your expression.