Documente Academic
Documente Profesional
Documente Cultură
User Programming
Overview
Using MathPack
PetroWorks comes with a wide range of algorithms; from simple data
conversion, to standard porosity and fluid saturation calculations, to
complex processes for the simultaneous estimation of lithology,
porosity, and fluid saturation. Those algorithms reside in a variety of
applications under the PetroWorks Command Menu items of Data
Prep, PreInterp, and Interpret. In some cases, however, those prepackaged algorithms may not meet your specific needs.
MathPack provides an easy way for you to quickly create the
algorithms that will meet your needs in specific interpretive situations.
Remember that if you have very complex processing needs
(simultaneously accessing multiple depths, complex looping and
branching, or creating a process that can be securely distributed to
colleagues), you should also consider ModelBuilder as another
application in which to build your algorithms.
R2003.12.1
121
Landmark
MathPack Features
122
R2003.12.1
User Programming
MathPack Workflow
Open MathPack
Interpret > MathPack
Close MathPack
R2003.12.1
123
Landmark
2.
3.
To Close MathPack
124
1.
2.
If you have not saved the algorithm that you created, a warning
window will appear which will allow you to Cancel the Exit
command (so you can save the algorithm, then exit) or continue
with the exit of MathPack (OK) without saving the algorithm.
R2003.12.1
User Programming
This section will guide you through the steps of creating a simple
algorithm and running it. For information about how to create more
complex algorithms, see the Building Algorithms section of this
documentation.
Creating an Algorithm
You create an algorithm by typing in the curves, parameters, and
functions to create an equation. Some rules are:
The curve or parameter that you want to create is always on the left
side of the equal sign, which is interpreted as an assignment
statement.
Each equation in the algorithm always ends with a semi-colon (;).
The names of curves that you use are always enclosed in double
quotes ( ).
The names of parameters (Local Variables or Global Parameters)
or numbers are NOT enclosed in double-quotes.
R2003.12.1
125
Landmark
Once you have typed the equation into MathPack, click the Check
Syntax button below the Algorithm window. If you have typed the
algorithm correctly, >> Syntax check passed. will appear in the Status
Area. If you have made a mistake in your algorithm, the Status Area
will display an error message, and MathPack will highlight the part of
the algorithm that has the error.
Once you have passed the syntax check, you are ready to use the
algorithm for processing.
In the Well Selection window, pick the wells that you want to
process. You can use a combination of the Select All (Select None)
button and mouse clicks to select the wells.
2.
After you have selected all the wells that you want, click the
Apply Well Selections button. This causes MathPack to query the
OpenWorks database and (among other things) update the items in
the Unit Selections text field. This MUST be done before you
select the processing interval.
3.
4.
You can Set Sample Increment, but leaving the choice defaulted
to Follow Framework Rules will ensure that MathPack honors
non-resampleable curves like core data.
5.
The curves that you created during processing will be written to the
selected wells in the OpenWorks database, and are immediately
available for use and display.
126
R2003.12.1
User Programming
Main Menu
Interval and
Sample Framework Selection
Well Selection
Divider/ Sash
Button
Algorithm Field
Status Area
Main Menu
The Main Menu consists of 5 items.
File
New Algorithm clears the Algorithm Field and then enters the
following text in that field, in preparation for creation of a new
algorithm.
R2003.12.1
127
Landmark
New Algorithm... will clear the Algorithm Field WITHOUT asking if you want
to save the algorithm that is already there. There is no way to recover the text that
was in place before New Algorithm... is invoked.
Save Algorithm... allows you to save the algorithm that you created to
a file with your choice of name and location. The file will automatically
be appended with a suffix of .mathpack. See Save Algorithm
Window for details of the window and its use.
The first time you use this command after you have opened
MathPack, a window opens that allows you to set the name and
location of the file that you want to create.
Subsequent times that you use this command, the previouslyselected file is automatically updated with the contents of the
Algorithm Field. The window does not appear, but a message is
displayed in the Status Area.
To change the destination of subsequent changes in your algorithm, use Save As...
instead of Save Algorithm...
Save As... opens a window that allows you to save the algorithm that
you created to a file with your choice of name and location. The file
128
R2003.12.1
User Programming
Exit closes the MathPack application. If you have not saved the
information in the Algorithm Field, a window will appear that allows
you to
Cancel the exit and return to MathPack, or
OK the exit, and exit MathPack WITHOUT saving your current
work.
Edit
Cut removes highlighted text from the Algorithm Field.
Copy copies highlighted text in the Algorithm Field in preparation for
pasting the text in another part of the field or in the Symbolic
Equations window.
Paste pastes text that has been Cut or Copied in to a location in the
Algorithm Field starting at the current cursor location.
The three operations above can be accessed by clicking MB3 when the
cursor is in the Algorithm Field.
View
Clear Algorithm clears the entire contents of the Algorithm Field.
Once the field is cleared, you cannot recover the previous contents.
This feature can also be accessed by clicking MB3 when the cursor is
in the Algorithm Field.
Clear Status Area clears the entire contents of the Status Area. Once
the text field is cleared, you cannot recover the previous contents. This
feature can also be accessed by clicking MB3 when the cursor is in the
Status Area.
R2003.12.1
129
Landmark
Options
The History Insertions feature ensures that a curve history is created
each of the output curves. That information will help you to understand
where the curve came from. The curve history is accessed in Curve
Utility.
Automatic is the default option for curve history.
None is available only if you have Project Manager status for the
project.
Tools
Select Log Curves... opens the Log Curve Selection window. You can
insert curves into your algorithm from this window (by Curve Alias,
Curve Name, or Curve Details) instead of typing directly in the
Algorithm Field. See the Log Curve Selection Window section of
this documentation for more details.
Select Wellbore Parameters... opens the Parameter Selection
window. You can insert Global Parameters into your algorithm from
this window instead of typing directly in the Algorithm Field. See the
Parameter Selection Window section of this documentation for more
details.
Global Parameters
You can use two types of parameters in MathPack. Local parameters are defined
in your algorithm and are not available to any other algorithmic processes. Global
Parameters are available to all algorithmic processes including the algorithms
that you write in MathPack. The value of the global parameter at the time that the
MathPack algorithm is executed is used by the algorithm. See the Local Variables
and Global (Wellbore) Parameters sections for more details.
R2003.12.1
User Programming
Remarks... opens the Remarks window. You can add comments here
that will be included in the curve history of each curve created by your
algorithm. The remarks will come before information about how the
curve was created. See the Remarks Window section of this
documentation for more details.
Well Selection
The wells that appear in the list are from the Well List chosen in
OpenWorks Project Status Tool, or selected when you started
PetroWorks. The list responds to changes in the Well Format (in the
Project Status Tool) but does NOT respond to the Well Order.
There are several ways to select wells on the list:
You can click on the Select None button (which then becomes
Select All).
The display at the bottom of the well list shows how many wells have
been selected out of the total number of wells in the well list.
Select All/Select None button toggles between the two shown settings
and allows you to select or deselect all the wells in the well list.
The Apply Well Selections button causes MathPack to read well data
from the project database.
Press the Apply Well Selections button
You MUST press the Apply Well Selections button AFTER you have selected the
wells that you want to process, and BEFORE you make any Unit Selections, for
the algorithms to process properly.
R2003.12.1
131
Landmark
Algorithm Field
You can Output Petrophysical Parameters as Curves. This will
create curves with the parameter values over the interval which you
have processed the algorithm.
The text field is where you actually create the algorithm that you want
to use. Remember that the algorithm can have multiple lines, and can
132
R2003.12.1
User Programming
The Process button causes MathPack to process the algorithms that you
have created over the interval (or intervals) and wells that you have
specified. Process checks the syntax and ensures that all referenced
curves exist before MathPack begins processing for each well. If an
error is found, an informational message informs you of the type of
error and processing is attempted on the next well. Otherwise, the
application continues to process the algorithm currently displayed in
the Algorithm field.
Using MB3 in the Algorithm Field will invoke the menu shown at
left. Clear Algorithm clears the entire algorithm field. There is no
recovery from this action.
Status Area
Results of the syntax check and processing are reported in the Status
Area, as are other messages that are broadcast to all open applications,
such as when wells or projects are changed.
Using MB3 in the Status Area allows you to clear the status area.
Divider/Sash Buttons
These two buttons, on the right side of the MathPack window, between
the Interval and Sample Framework Selection area and the Algorithm
Field, and between the Algorithm Field and the Status Area, allow you
to resize the three panes in the MathPack window. When you move
R2003.12.1
133
Landmark
your cursor over the button, the cursor arrow turns to a plus (+). Hold
down MB1 and drag the cursor up or down to resize the pane. Each
pane has a minimum size.
Pointing Dispatcher
The OpenWorks PD (Pointing Dispatcher) allows you to import single
and multiple wells and curves from Curve Utility into MathPack. You
can PD OUT well names and PD IN well names and curve names.
Press Ctrl-l to activate/deactivate the PD facility. When the PD border
is green, PD is listening for other curve/well data. When the border is
red, PD is deactivated for this application.
Iconified windows can receive information.
You can PD information to a window that is iconified as long as the border on the
icon is green. If the iconified window is a StratUtil application and the border is red,
you can use the key combination Ctrl+l (lowercase letter el) or click on the
iconified window and select PD Listen from the menu that appears to turn the
border green and to enable listening capability.
134
1.
2.
3.
R2003.12.1
User Programming
Curve
Selection
Search/Filter
Curve List
Selection
Display
Action Buttons
135
Landmark
Search/Filter
The text box provides for entry of a text string by which to search or
filter the items in the Curve List.
If you enter a character string, all curves having that character
string anywhere in their identifier will be found.
* can be used to indicate any character, and can be used as part
of a character string.
I*M will find ILM, TIDMR, and CALIMAX.
^ can be used to indicate that the following character string
must occur at the beginning of the entry.
Search/Find Next highlights the next table entry that matches the text
string, and moves the list so that the highlighted entry is at the top of
the list.
Filter causes the list to be reduced to only those entries which match
the text string.
Reset causes the curve list to be returned to its original contents, and
deletes the text string from the text box.
Curve List
The curve list shows the curves in alphabetical order, based on the
selections made in the Curve Selection area. The list cannot be
reordered.
Selection Display
Immediately below the Curve List, the Selection Display shows the
number of curves that:
136
R2003.12.1
User Programming
Action Buttons
Insert causes the selected curve to be inserted into the algorithm at the
location of the cursor in the Algorithm Field. Insert must be used to
insert the curve into the algorithm; double-clicking on the curve
identifier to insert it in the algorithm is not supported.
Close closes the Log Curve Selection window with no further action.
R2003.12.1
137
Landmark
Search/Filter
Parameter List
Selection
Display
Action Buttons
138
R2003.12.1
User Programming
Parameter List
The parameter list shows the Global Parameters in alphabetical order.
The left-hand column is the actual parameter name; the right-hand
column is the title of the parameter as it appears as a column heading in
the Wellbore Parameter Editor. The list cannot be reordered.
More information about each Global Parameter is available in
Appendix 5: MathPack Syntax, and in the Wellbore Parameter
Editor documentation.
Appendix 5 shows the parameter Name, Title, Description,
Minimum and Maximum Values, optional Default Values, and the
Units of Measurement.
Wellbore Parameter Editor documentation contains the above
information, plus expanded default values for a small number of
parameters. To open Wellbore Parameter Editor:
Go to PetroWorks Command Menu > Utilities > Wellbore
Parameter Editor, make sure Applications is set to Global
Parameters and Columns (Parameter Group) is set to All.
Find the parameter that you want, then double-click on a cell in
that parameters column. The Cell/Parameter Detail window
will appear which provides details about the parameter and its
current value.
R2003.12.1
139
Landmark
Selection Display
Immediately below the Parameter List, the Selection Display shows
the number of parameters that:
Action Buttons
Insert causes the selected parameter to be inserted into the algorithm at
the location of the cursor in the Algorithm Field. Insert must be used
to insert the parameter into the algorithm; double-clicking on the
parameter to insert it in the algorithm is not supported.
Close closes the Parameter Selection window with no further action.
140
R2003.12.1
User Programming
Algorithm
Elements
Palette
Close button
R2003.12.1
141
Landmark
Close button
The Close button closes the Algorithm Elements window with no
further action.
142
R2003.12.1
User Programming
Main Menu
Equation
List
Equation Field
Equation
Name
Field
Action
Buttons
R2003.12.1
143
Landmark
Equation List
The Equation List shows all the symbolic equations and their names.
The equations are listed in alphabetical order by name. The equations
are defined in Appendix 2: Pre-Defined Symbolic Equations.
Equation Field
The Equation Field shows the selected equation. If you create a new
Symbolic Equation, you type the entire equation here (information
from BOTH sides of the equal sign), or paste the equation here from the
MathPack Main Window Algorithm Area.
Action Buttons
Add/Update adds a new Symbolic Equation to the Equation List, or
updates an existing Symbolic Equation.
Delete removes the Symbolic Equation in the Equation Name Field
from the list of equations.
Insert into Algorithm inserts the Symbolic Equation in the Equation
Field into the algorithm in the MathPack Main Window Algorithm
Area at the location of the cursor.
Close closes the Symbolic Equation window without further action.
144
1.
Enter a name for the equation in the Equation Name Field. Pick a
name that you can easily recognize at a later date.
2.
3.
R2003.12.1
User Programming
2.
3.
4.
Click File > Save to save the changes to the Symbolic Equations
file.
2.
Click the Delete button to delete the equation from the list.
3.
Click File > Save to save the changes to the Symbolic Equations
file.
R2003.12.1
145
Landmark
Remarks Window
The Remarks window allows you to add remarks to the history file of
curves. The same remarks are added to the history files of all curves
generated during a single MathPack processing event. The Remarks
Window is accessed from the Main Menu via Tools > Remarks...
Text Window
OK button
OK Button
The OK button closes the window and saves the text that you have
written for inclusion in the curve histories of all the curves processed in
the next MathPack processing instance.
146
R2003.12.1
User Programming
Go to File > Save Algorithm... or File > Save As... Either menu
item will open the Save Algorithm window shown above.
2.
3.
Type the file name that you want to use in the Selection Text Box
and click OK.
R2003.12.1
147
Landmark
148
R2003.12.1
User Programming
Algorithm Preview
R2003.12.1
1.
2.
3.
4.
If you are unsure of the contents of the file, you can click the
Preview button at the bottom of the window. The contents of the
file will be displayed in the Algorithm Preview window.
5.
149
Landmark
150
R2003.12.1
User Programming
Building Algorithms
This section provides the details of creating algorithms, including the
grammar and syntax of the algorithms, and an explanation of error
messages when they appear.
Introduction
Algorithms in MathPack are based on a simple language and grammar.
Algorithms can take on a free-form user-defined arrangement and may
be composed of any number of lines, including comments in separate
lines or in lines containing algorithms. Moreover, no limits are placed
on the number of lines or curves used, or the length of individual lines.
Arithmetic and logical (boolean) operators have their conventional
meanings and follow their conventional order of precedence. The order
of precedence (the order of evaluation) of the operators may be
modified by grouping expressions within parentheses. The groupings
may be of arbitrary complexity and may be repeated to any level.
Statements are processed sequentially in the algorithm from top to
bottom, for each valid sample point; i.e., the algorithms apply only to
the current depth; no access to depths other than the current depth is
possible.
The algorithm checker (parser) performs reasonable static checks on
the algorithm, searching for common errors in syntax and semantics.
When an error occurs, a message that indicates the nature of the error
(and where applicable, possible solutions to the problem) is generated
in the Status Area of the MathPack window. See Appendix 4:
Understanding Error Messages for more details.
A simple example
This section illustrates the different ways in which a simple algorithm
can be written. The basic algorithm calculates a sonic porosity
(PHIsonic) from acoustic wave travel time (DT) using the Raymer-HuntGardner transform:
DT DT matrix
PH I sonic = 0.625 -----------------------------------DT
R2003.12.1
151
Landmark
This version of the equation substitutes the Curve Alias (Acoustic_Wave_Travel_Time) for
the Curve Name (DT), and substitutes the Global Parameter (TransitTimeMatrix) for the locally-defined variable (DTmatrix). The Curve Alias provides the means to process wells with
variations in the
name of the
sonic measurement, and the
Global Parameter provides the means to access a parameter which is shared by several applications, and
which is defined in the Wellbore Parameter Editor.
Note that the Global Parameter is NOT declared in the algorithm.
This version of the equation is exactly like
the version immediately above, except
that it has been written on several lines to
limit the width of the text.
This version of the equation is in the same form as the two immediately above, and also includes an IFTHEN-ELSE statement. In this form, SPHI is calculated by the Raymer-Hunt-Gardner transform when
Acoustic_Wave_Travel_Time (DT) is greater than TransitTimeMatrix (DTmatrix). If the log measurement
is less than or equal to the matrix value, SPHI is set to 0.001 (0.1 percent porosity).
152
R2003.12.1
User Programming
Algorithmic Results
Some reasons that an expression cannot be computed:
Divide by zero;
The function call has an argument which is out of range;
One or more input curves does not exist.
Comments (optional)
Variable declarations (optional)
Statements
Comments
Comments are preceded by a double-dash ( -- ) and extend to the end of
the line on which they begin. They may appear anywhere on a line or
anywhere in an algorithm. Comments are an optional part of an
algorithm, but are strongly suggested, especially when creating
complex algorithms, or algorithms that you will share with others.
Comments do not affect the meaning of the line on which they appear
and are ignored when the algorithm is processed.
Comment examples:
Variable Declarations
Local Variables must be declared at the beginning of an algorithm,
before they are used in any statement. Variables can be assigned
R2003.12.1
153
Landmark
In the example above, Rw, m, and RHOB_calc are local variables. After
their declaration by the Variable statement, Rw is defined as a
constant while m and RHOB_calc are defined as expressions.
The example above also contains two Global Parameters,
DensityFluid and DensityMatrix. They are used like Local Variables,
and have the same appearance (they are used in expressions without
quotation marks). They are not explicitly declared in the algorithm, but
they are implicitly declared, and as such are available to all
applications. See Global (Wellbore) Parameters for more details.
154
R2003.12.1
User Programming
Statements
There are three types of statements:
Assignment Statements
IF Statements
LOOP Statements
Assignment Statements
Assignment statements evaluate an expression by computing a value,
and placing that value in the specified curve or variable at the given
depth for which the algorithm is being applied.
Examples of assignment statements:
IF Statements
IF statements allow a MathPack user to define conditional processing
on enclosed algorithm statements.
IF statements come in two forms:
IF (expression) THEN
(expression);
END IF;
If the expression immediately following IF is satisfied, the expression
immediately following THEN is evaluated. If the expression
R2003.12.1
155
Landmark
LOOP Statements
LOOP statements allow you to iteratively process data. By using a
LOOP statement you can converge on a value by using the previous
value determined by the expression in the same expression, and you can
also set a counter that will terminate a loop after a reasonable number
of iterations. The LOOP statement takes the form of the classic dowhile loop.
The LOOP statement has the form:
(expressions setting initial conditions);
WHILE (expressions) LOOP
156
R2003.12.1
User Programming
(expression);
(expressions to iterate values);
END LOOP;
The condition of each loop statement is evaluated once for each
iteration. If upon evaluation the condition is met, the loop body is
entered. Statements in the loop body are processed and control is
passed back to the top of the loop, where the condition of the loop body
is re-evaluated.
Static checks (via the Check Syntax button) are performed to
determine if the loop will be infinite or entered at all. If the loop is
determined to be infinite, the parser will produce an error message in
the Status Area. If the loop will never be entered, the parser will warn
the user and will remove all associated statements (including the
evaluation of the condition) from processing.
Loops are processed and must terminate or run to completion FOR
EACH DEPTH at which the algorithm is applied. Loops that require
large numbers of iterations to complete will greatly increase processing
time for an algorithm.
Example of a LOOP statement:
Variable declarations
Variable initialization
LOOP body
Statement Elements
Curve Identifiers
Curve identifiers are the way that you specify curves as inputs to
algorithms, and as outputs; that is, as the results of algorithm
R2003.12.1
157
Landmark
Identifier
Input Curve
Output Curve
Curve Alias
Curve Name
Curve Details
Case 1
Case 2
Case 3
Case 4
Case 1 shows the use of Curve Names as input and output curve
identifiers.
158
R2003.12.1
User Programming
Curve Identifiers:
Cannot contain quotes within the enclosing quotes. My new Curve is not a
valid curve name.
Are case sensitive. Sw SW and sw are interpreted as three different curves.
Are limited to 25 characters.
Can be Curve Names or Curve Aliases, or Curve Details. (See the table above for
identifier usage limitations.)
Numeric Literals
Numeric literals are numbers that are used in an algorithm. Numbers do
NOT have to contain a decimal point.
R2003.12.1
159
Landmark
Local Variables
Local Variables are algorithm components that you have defined in the
algorithm. As described in the Variable Declarations section, they are
declared at the beginning of the algorithm by the word VARIABLE.
The value of a Local Variable can be set to a constant, or can be
determined by an expression.
Local Variable names are not limited in length, and the names are case
sensitive. Local Variable names are used in algorithms WITHOUT
quotation marks.
R2003.12.1
User Programming
Function Calls
Function calls are references to built-in arithmetic and trigonometric
functions. MathPack provides a varied selection of functions and
maintains their conventional meanings. All but one function (MOD) act
as operations on a simple expression. MOD is a binary operation that
requires two values.
Function calls are case insensitive; LN, Ln, ln, lN are considered
the same function.
Trigonometric Function Calls expect Radians
The trigonometric Function Calls operate on a number or on a resolved expression
which are expected to be in RADIANS, NOT degrees.
The conversion from degrees to radians is:
Degrees
Radians = ---------------------- 2
360
R2003.12.1
161
Landmark
Exponentiation
Exponentiation is represented by the carat symbol ( ^ ) or by the
Function Call EXP. The expressions are equivalent.
Roots may be calculated by using a fractional exponent.
Fractions may be calculated by using a negative exponent.
Roots of negative values cannot be calculated.
Some examples of exponentiation are shown here:
162
R2003.12.1
User Programming
R2003.12.1
1.
Make sure that all curves used in calculations exist in the selected wells
2.
Check for a disk file of the algorithm youre interested in chances are it may
already have been written.
3.
Add any commonly-used constant (or equation) to the constant (equation) table. Edits
to that constant or equation then only need to be made once in the table.
4.
5.
6.
7.
Check for missing or misspelled reserved words such as thne for then.
8.
9.
Check for quoted curve names that span multiple lines. Note that curve names should
not exceed 25 characters.
10.
11.
12.
Use NEG (), not a minus sign (-) for negative values.
163
Landmark
Appendices
Appendix 1: Algorithm elements with definitions
Element
Definition
Arithmetic Operations
+
addition
subtraction
multiplication
division
Relational Operations
=
is equal to
!=
is not equal to
<
is less than
<=
>
is greater than
>=
Logical Operators
AND
OR
Function Calls
164
ABS( )
ACOS( )
ASIN( )
ATAN( )
R2003.12.1
User Programming
Element
Definition
COS( )
LN( )
LOG( )
MOD( )
NEG( )
SIN( )
SQRT( )
TAN( )
EXP( )
RANDOM( )
Statement Elements
VARIABLE
equal to
open parenthesis
close parenthesis
IF ( ) THEN
IF statement
( );
END IF;
IF ( ) THEN
IF-THEN statement
ELSE ( );
END IF;
WHILE ( )
LOOP
LOOP statement
( );
END LOOP;
R2003.12.1
165
Landmark
Element
--
Definition
Precedes comments, either at the beginning of a line, or at the end of a
line containing an expression, after the semi-colon.
Value Literals
166
TRUE
FALSE
NULL
R2003.12.1
User Programming
Equation Name
ARCHIE
Definition
a Rmf
Sw = ---------------------m
Rxo
1
--n
ARCHIE_SXO
BVW
R2003.12.1
a Rw n
Sxo = -----------------m
Rt
Sxo =SXO_ARCH (flushed zone water saturation
a = TortuosityFactor
Rmf = ResMudFiltrate (mud filtrate resistivity)
Rxo = Flushed_Zone_Resistivity
= Porosity
m = CementationExponent
n = SaturationExponent
BVW = S w
BVW = BVWC (bulk volume water)
Sw = Water_Saturation
= Effective_Porosity
167
Equation Name
DEN_to_POR
Landmark
Definition
DT_to_POR
F_FACTOR
matrix b
DPHI = ---------------------------------- matrix fluid
DPHI = DPHI (density porosity)
a
F = -----m
F = F (formation factor)
a = TortuosityFactor
= Porosity
m = CementationExponent
MOVEABLE_SH
168
Moveable hydrocarbon
saturation (also called
moveable oil saturation). The
fraction of in-place
hydrocarbons that can be
moved or produced.
MOS = Sxo Sw
MOS = MOS
Sxo = Flushed_Zone_Water_Sat
Sw = Water_Saturation
R2003.12.1
User Programming
Equation Name
Definition
POR_to_DEN
RESIDUAL_SH
Residual hydrocarbon
saturation (also called
residual oil saturation). The
fraction of in-place
hydrocarbons that cannot be
produced.
b = ( 1 ) matrix + fluid
b = RHOBC)
= Density_Porosity
matrix = DensityMatrix
fluid = DensityFluid
ROS = 1 Sxo
ROS = ROS
Sxo = Flushed_Zone_Water_Sat
m
RMFA
Rxo
Rmfa = ----------------------a
Rmfa = RMFA
Rxo = Flushed_Zone_Resistivity
a = TortuosityFactor
= Porosity
m = CementationExponent
RWA
Rt
Rwa = -----------------a
Rwa = RWA
Rt = True_Resistivity
a = TortuosityFactor
= Porosity
m = CementationExponent
R2003.12.1
169
Landmark
Equation Name
Definition
RWA_ARCH
Rt
Rwa = ----F
Rwa = RWA_ARCH
Rt = True_Resistivity
F = F_Factor
RWA_RATIO
Rt
Rwa = Rmf ----------
Rxo
Rwa = RWA_RATIO
Rmf = ResMudFiltrate (mud filtrate resistivity)
Rt = True_Resistivity
Rxo = Flushed_Zone_Resistivity
170
R2003.12.1
User Programming
Parameter Name
BitSize
Bit Size
60
8.75
inches
BottomHoleDepth
Bottom Hole
Depth
50000
10000
feet
BottomHoleTemperature
Bottom Hole
Temperature
600
175
degF
CementationExponent
Cementation
Exponent (m)
0.1
unitless
ConcentrationKcl
Concentration
KCl
Concentration KCl
30
DensityAnhydrite
Anhydrite
Density
2.95
3.1
2.98
g/cm3
DensityCasing
Casing Density
66.427
lbm/
galUS
DensityCoal
Coal Density
1.4
g/cm3
DensityDolomite
Dolomite
Density
2.82
2.92
2.87
g/cm3
DensityDryShale
Dry Shale
Density
2.65
g/cm3
DensityFluid
Fluid Density
g/cm3
DensityFormationWater
g/cm3
R2003.12.1
Units
171
Landmark
Parameter Name
DensityHydrocarbon
Hydrocarbon
Density
g/cm3
DensityLimestone
Limestone
Density
2.69
2.8
2.71
g/cm3
DensityMatrix
Matrix Density
1.5
3.5
2.65
g/cm3
DensityMudFiltrate
Mud Filtrate
Density
g/cm3
DensityPorosityCoal
Coal density
Porosity
0.65
v/v
decimal
DensityPorositySalt
Salt Density
Porosity
-1
-0.03
v/v
decimal
DensityPorosityShale
Shale Density
Porosity
0.2
v/v
decimal
DensitySalt
Salt Density
2.1
g/cm3
DensitySandstone
Sandstone
Density
2.62
2.68
2.65
g/cm3
DensityShale
Shale Density
2.65
g/cm3
DensityWetShale
Wet Shale
Density
2.3
g/cm3
DiameterBorehole
Borehole
Diameter
100
8.75
inches
DiameterCasing
36
inches
DiameterOfInvasion
Diameter of
Invasion
100
inches
DiameterTubing
inches
DielectricConstantHC
Hydrocarbon
Dielectric
Constant
2.2
fred
DielectricConstantMatrix
3.5
35
4.65
unitless
DielectricConstantShale
Shale Dielectric
Constant
10
55
25
unitless
EmpiricalInvasionFactor
Invasion Factor
Sw Sxo
0.5
unitless
EquivCationConductance
Equivalent
Equivalent cation conductance.
Cation
Conductance(B)
30
3.83
mho/m
per
meq/cc
GammaRayClean
Gamma Ray
Clean
500
20
API
GammaRayShale
Gamma Ray
Shale
500
100
API
HydrogenIndexFluid
1.5
unitless
NeutronPorosityAnhydrite
Anhydrite
Neutron porosity for Anhydrite.
Neutron Porosity
-0.025 0.025
-0.015
v/v
decimal
172
0
Diameter of the invasion of
drilling fluids into the surrounding
reservoir rock.
Units
R2003.12.1
User Programming
Parameter Name
NeutronPorosityClean
NeutronPorosityCoal
Coal Neutron
Porosity
0.38
v/v
decimal
NeutronPorosityDryShale
0.2
v/v
decimal
NeutronPorosityHM
Heavy Mineral
Neutron porosity for Heavy
Neutron Porosity Minerals.
0.6
0.03
v/v
decimal
NeutronPorositySalt
Salt Neutron
Porosity
-1
-0.03
v/v
decimal
NeutronPorosityShale
0.2
v/v
decimal
NeutronPorosityShale
0.4
v/v
decimal
NeutronPorosityWetShale
0.25
v/v
decimal
PermeabilityConstant
Permeability
Constant
10000
250
unitless
PhotoelecIndexWetShale
Wet Shale
Photoelectric
Factor
100
b/elec
PhotoelecXsecShale
Photoelectric
Cross Section
Shale
10
b/cm3
PorosityShale
Shale Porosity
Shale porosity
0.4
v/v
decimal
PropagationTimeDolomite
Propagation
Time Dolomite
15
8.7
ns/m
PropagationTimeHC
Propagation
Time
Hydrocarbons
10
4.7
ns/m
PropagationTimeLimestone
Propagation
Travel time in Limestone for high 0
Time Limestone frequency (microwave) waves.
15
9.7
ns/m
PropagationTimeSand
Propagation
Travel time in Sandstone for high 0
Time Sandstone frequency (microwave) waves.
15
7.2
ns/m
PropagationTimeShale
Propagation
Time Shale
20
12
ns/m
PropagationTimeWater
Propagation
Time Water
20
Travel Time in Water for High
Frequency (microwave) waves.
The rate of travel is determined
almost entirely by the dielectric
(insulating) properties of the
formation, which is largely related
to the water content of the
formation.
90
29.5
ns/m
ResBoundWater
0.01
100
0.04
ohm.m
ResBoundWaterInv
Mud Filtrate
Bound
Resistivity
0.01
0.2
0.04
ohm.m
R2003.12.1
Units
v/v
decimal
173
Landmark
Min. Max. Default
Value Value Value
Parameter Name
ResBoundWaterInvTemp
Mud Filtrate
Temperature which the resistivity 32
Bound
of the bound water in the invaded
Resistivity Temp zone was measured
500
75
degF
ResBoundWaterTemp
32
500
75
degF
ResistivityCleanLimit
True Resistivty
Clean limit
10000
ResistivityFlushZoneShale
20
12
ohm.m
ResistivityShale
0.001
2000
0.5
ohm.m
ResistivityShaleLimit
True Resistivity
Shale limit
10000
ohm.m
ResMud
Mud Resistivity
0.005
10
ohm.m
ResMudcake
Mudcake
Resistivity
0.005
10
ohm.m
ResMudcakeTemp
Mudcake
Temperature which the resistivity 32
Resistivity Temp of the mudcake was measured
500
degF
ResMudFiltrate
Mud Filtrate
Resistivity of the Mud Filtrate
Resistivity (Rmf) which is present in the invaded
zone.
10
ohm.m
ResMudFiltrateTemp
Mud Filtrate
Temperature which the resistivity 32
Resistivity Temp of the Mud Filtrate which is
(TRmf)
present in the invaded zone was
measured
500
degF
ResMudTemp
Mud Resistivity
Temp
500
degF
ResWater
ohm.m
ResWaterTemp
degF
RHGFactor
Raymer Hunt
Gardner Factor
(k)
SalinityBorehole
0.005
0.625
SalinityFormation
0.001
SalinityMudFiltrate
Mud Filtrate
Salinity
0.001
300000
SaturationExponent
Saturation
Exponent (n)
0.1
SigmaBoundWater
Bound Water
Sigma
174
ohm.m
500
Units
unitless
ppm
300000
ppm
ppm
150
unitless
cu
R2003.12.1
User Programming
Min. Max. Default
Value Value Value
Parameter Name
SigmaFreeWater
Free Water
Sigma
150
cu
SigmaHydrocarbon
Hydrocarbon
Sigma
25
cu
SigmaMatrix
Matrix Sigma
300
10
cu
SonicPorosityShale
Shale Sonic
Porosity
0.5
0.3
v/v
decimal
SpontaneousPotentialClean
Spontaneous
Potential Clean
-200
100
-100
mV
SpontaneousPotentialShale
Spontaneous
Potential Shale
100
mV
ThicknessCasing
Casing
Thickness
0.5
inches
TortuosityFactor
unitless
TransitTimeCoal
Coal Transit
Time
150
120
us/ft
TransitTimeCp
Transit Time
Compaction
Correction
10
unitless
TransitTimeDolomite
38.5
43.5
41
us/ft
TransitTimeDryShale
Dry Shale
Transit Time
20
150
50
us/ft
TransitTimeFluid
Fluid Transit
Time
100
500
189
us/ft
TransitTimeLimestone
Limestone
Transit Time
43.5
47.6
46
us/ft
TransitTimeMatrix
Matrix Transit
Time
20
150
50
us/ft
TransitTimeSalt
20
150
64.4
us/ft
R2003.12.1
20
Units
175
Landmark
Parameter Name
TransitTimeSandstone
Sandstone
Transit Time
51.3
55.5
53.4
us/ft
TransitTimeShale
Acoustic Transit
Time in Shale
20
150
50
us/ft
TransitTimeWetShale
Wet Shale
Transit Time
20
150
50
us/ft
WeightCasing
Casing Weight
120
30
lbm/ft
30
15
lbm/
galUS
28
11
lbm/
galUS
WeightCement
Cement Weight
WeightMud
Mud weight
176
Units
R2003.12.1
User Programming
Information messages
Error messages
Information Messages
Information messages are generated for different reasons, but are
always preceded by the pattern
>> INFO:
These messages may display the status of MathPack algorithm
processing or provide additional detail about a previous message. One
or more information messages often follow an error message. See the
discussion that follows.
Error Messages
Error messages are generated when the algorithm checker detects an
unresolved error in the specified algorithm. Error messages are always
preceded by the pattern
>> ERROR:
These messages state the nature of the error and attempt to provide the
lexical element (or part) of the algorithm causing the error. This
explanation generally consists of an element enclosed in quotes and the
line number of the offending occurrence in the algorithm. As in the
fragment:
at ")" on line 3
Note that the lines are not numbered as currently displayed in the
algorithm builder, but when possible, the offending element is
R2003.12.1
177
Landmark
Syntax errors
Semantic errors
Syntax Errors
Syntax errors originate when a grammar rule for the correct
specification of an algorithm has been violated. Examples include:
mismatched parentheses
missing or misplaced commas
unterminated statements
missing or misspelled reserved words
improperly quoted curve ids
Semantic Errors
Semantic errors may occur in syntactically correct algorithms, but
violate some meaning of a construct. Examples include:
R2003.12.1
User Programming
current dataset
depth and sampling parameters,
the algorithm specification
R2003.12.1
179
Landmark
/2) (I)
180
R2003.12.1
User Programming
R2003.12.1
181
Landmark
182
R2003.12.1
User Programming
R2003.12.1
183
Landmark
184
R2003.12.1
User Programming
The next several messages are related to the above message and will
appear in some combination, depending on the context.
Check terms and relations, if static condition
is not intended (I)
This message serves as an additional warning. Some static
conditions may be intentional.
Condition is always TRUE (I)
Condition is always FALSE (I)
The parser has detected a condition of an if or loop statement
that is statically determined to be TRUE (or FALSE).
If statement will never be performed (I)
The condition of an if statement (without an else part) was
statically determined to be FALSE. The condition is not
considered and the if statement (including all of its enclosed
statements) is effectively removed from processing.
Note that the case for if statements that are ALWAYS TRUE is
not explicitly announced. The condition of the if statement is not
considered during processing and the statements enclosed by the
if are always performed.
Else part will always be performed (I)
The condition of an if statement (with an else part) was
statically determined to be FALSE. The condition is not
considered during processing and the statements enclosed by the
else part are always performed.
R2003.12.1
185
Landmark
186
R2003.12.1
User Programming
Expression
The table beginning on the following page lists the syntax rules that
you must adhere to when you generate a MathPack algorithm.
For example, the first rule states that
An algorithm is represented as an optional
declaration_list followed by a statement_list.
R2003.12.1
187
Landmark
Left Side
Meta
Symbol
Right Side
algorithm
::=
{declaration_list}
statement_list
declaration_list
::=
declaration
{declaration_list}
declaration
::=
VARIABLE id;
statement_list
::=
statement
statement_list |
EMPTY
statement
::=
assignment_statement|
if_statement
loop_statement|
assignment_statement
::=
CURVE_ID = expression;
if_statement
::=
if (condition) then
statement
statement_list
[else
statement;
statement_list]
end if;
condition
::=
expression
expression
::=
relation
relation and relation
relation or relation
relation
::=
simple_expression
simple_expression =
simple_expression!=
simple_expression <
simple_expression<=
simple_expression >
simple_expression>=
simple_expression
::=
term
term + simple_expression
term - simple_expression
term
::=
factor
factor * term
factor / term
188
|
|
|
simple_expression|
simple_expression|
simple_expression|
simple_expression|
simple_expression|
simple_expression
|
|
|
|
R2003.12.1
User Programming
Meta
Symbol
Left Side
Right Side
factor
::=
primary |
primary ^ primary
primary
::=
ID
CURVE_ID
REAL_LITERAL
INTEGER_LITERAL
BOOLEAN_LITERAL
NULL_LITERAL
function_call
(expression)
function_call
::=
abs
aco
asin
atan
cos
exp
cot
log
ln
mod
neg
random
sin
sqrt
tan
|
|
|
|
|
|
|
(simple_expression)|
(simple_expression)|
(simple_expression)|
(simple_expression)|
(simple_expression)|
(simple_expression)
(simple_expression |
(simple_expression)|
(simple_expression |
(simple_expression,
simple expression)|
(simple_expression) |
(min_value, max_value)
(simple_expression) |
(simple_expression) |
(simple_expression)
Non-terminals
Non-terminals do not end an expression by themselves; they refer to
other grammar rules. Notice that this process may lead to recursive,
self-reference and allows the grammar to represent arbitrarily nested
constructs.
Meta-symbols
Meta-symbols have no meaning except to help define the grammar
itself. As such, meta symbols do not become a part of the algorithm
specification.The following meta-symbols are used in the grammar
rules:
R2003.12.1
Colon, Colon, Equal Sign (::=) is placed between the left and the
right hand side of a rule, and stands for is represented by.
Building Algorithms with MathPack: Appendices
189
Landmark
Terminals
Terminals are not defined in terms of further grammar rules and
therefore cannot be reduced further. Each terminal is composed of
unique patterns of characters that help distinguish it from another
terminal. The patterns for each terminal are shown in the following
table. The ellipsis (...) is used to indicate a range of possible values.
Terminals
190
Representation
I
D
alphanum{alphanum | otherchar}
C
U
R
V
E
_I
D
alphanum{otherchar}
I
N
T
E
G
E
R
_
L
I
T
E
R
A
L
digit{digit}
R2003.12.1
User Programming
Terminals
R2003.12.1
Representation
R
E
A
L
_
L
I
T
E
R
A
L
{digit}.digit{digit}
B
O
O
L
E
A
N
_
L
I
T
E
R
A
L
true | false
N
U
L
L
_
L
I
T
E
R
A
L
null
191
Landmark
Terminals
192
Representation
al
p
h
a
n
u
m
di
gi
t
0 ... 9
ot
h
er
c
h
ar
V
A
R
I
A
B
L
E
symbol name
E
M
P
T
Y
<nothing>
R2003.12.1
User Programming
Literals
Literals stand for themselves, that is, are to be interpreted literally, and
are, in fact, terminals. Some literals are special markers and are
reserved.
Following is a list of reserved literals:
if
then
else
or
true
false
null
end
loop
variable
R2003.12.1
193