You are here: Menu Commands > Block model > Attributes > Maths
GEOVIA Surpac

Block maths

This function allows you to carry out the assignment of attribute values based on the values of other attributes (for example, calculating the gold equivalent of a polymetallic deposit). The mathematical operations are defined as free format algebraic expressions with the flexibility to use parentheses and conditional statements (an important feature).

To run this function: Choose Block model > Attributes > Maths, or...

  • In the Function Chooser, type BM BLOCK MATHS, and press ENTER.

Note: It is important that you define numeric attributes that should not be averaged during sub-blocking or reblocking as calculated attributes. For example, tonnage should be defined as a calculated attribute based on block size and density, with the generic formula tonnage = _xext x _yext x _zext x sg.

Attribute Name

Enter the name of the attribute to be assigned values.

Expression

Enter a free format algebraic expression to define the operation to be performed so that a new value can be calculated and then assigned to the named attribute field. The expression may include be any expression allowed by the generic expression syntax with the addition of :

  • Attribute field names - expressed by using the actual field name, e.g. gold
  • Special attribute names (case sensitive)

    _xorg - x coordinate of block origin
    _yorg - y coordinate of block origin
    _zorg - z coordinate of block origin

    _xext - x extent of block
    _yext - y extent of block
    _zext - z extent of block

    _xcen - x coordinate of block
    _ycen - y coordinate of block
    _zcen - z coordinate of block

NOTE: In versions of the software prior to 4.0 the '^' character was allowed as an alternative exponentiation operator. To make the various expression syntaxes in the product more consistent this has been changed to do a bitwise exclusive or of its operands. For an interim period the software will warn if the '^' operator is used within a block maths expression to allow users to modify any existing macros which may use the '^' operator to use the ** operator. To invoke the bitwise exclusive or operation without a warning use the BITXOR(a,b) function.
For example, if you wanted to square an attribute called avg_dist, you would use:

avg_dist**2

In v4.0 and later, you are NO LONGER allowed to use:

avg_dist^2

Below are some examples of different expressions which you might use:

Attribute field Type Expression and description
gold_average real (gold1 + gold2)/2 calculate average gold value from 2 different gold fields
total_metal real (gold * 0.9 + silver * 0.1) Determine the effective total metal content by combining a number of elements together
cut_gold real iif(gold > 30, 30, gold) If gold grade is greater than 30 then Cut the gold grades to a maximum value of 30 otherwise use the actual gold grade
material_type character iif ((weathering == "oxide"),
iif ((gold > 1),
iif (((cu < 800) and (gold > 3)),
"mill",
"stockpile1"),
iif ((cu < 800),
"leach pad",
"stockpile2")),
iif(weathering == "sulphide",
"sulphide stockpile",
"waste"))
Determine the material type, i.e. the destination of the ore for subsequent processing. The groupings achieved using this statement are shown in the following table:

 

weathering gold cu material type
not oxide or sulphide waste
sulphide sulphide stockpile
oxide < 1 < 800 leach pad
oxide < 1 > 800 stockpile2
oxide > 3 < 800 mill
oxide 1 < gold < 3 >= 800 stockpile1

Constrain

Enter `YES' if the block model is to be constrained by a value or feature. Enter `NO' for an unconstrained operation.

See Make Constraint.

Complete the BLOCK MATHS -DEFINE REQUIRED OPERATIONS form and choose Apply or Cancel.