Anda di halaman 1dari 172

OOMF 2004.

1
OOMF Script Language Reference
Manual
Who Should Read this Guide

This manual is intended for users of the stand-alone OOMF core component or
users of the equation-oriented capabilities of products, such as Aspen Plus,
that embed OOMF. Typically users write scripts to manipulate the simulation
data. Note that such scripts are not necessary for normal operations of
products that embed OOMF. However, these scripts may be used to extend
the capabilities of these products or to analyze the current simulation.

OOMF is embedded within several AspenTech products such as Aspen Plus,


Aspen RefSYS, Aspen Advisor, Aspen PIMS, Aspen Water, Aspen HySYS to
host models exported from Aspen Custom Modeler, Aspen MBO etc. Some of
these products have extended the capabilities of the OOMF scripting
language. These product specific extensions may be found in separate
sections at the end of this document.

Who Should Read this Guide 2


Contents
INTRODUCING OOMF SCRIPT LANGUAGE...................................................... 10
Introduction .......................................................................................................... 10
Using the Interactive Prompt ................................................................................... 11
Defining and Executing Scripts ................................................................................. 12
Defining Scripts ................................................................................................ 12
Executing Scripts .............................................................................................. 12
Input Language Rules ............................................................................................. 12
General ........................................................................................................... 12

1 SCRIPT COMMANDS .................................................................................. 14


Command Summary............................................................................................... 14

2 OOMF SCRIPT LANGUAGE BASICS ............................................................. 23


Redirecting Output and Journaling ............................................................................ 24
Redirecting the Output of a Command.................................................................. 24
Changing the Report Device................................................................................ 25
Changing the History Device ............................................................................... 25
Flushing the Devices.......................................................................................... 25
Journaling ........................................................................................................ 26
Examining the Output Devices ............................................................................ 27
Examples of Redirecting Output .......................................................................... 27
Script Parameters .................................................................................................. 27
Global Script Parameters .................................................................................... 28
Local Script Parameters ..................................................................................... 28
Built-In Script Parameters .................................................................................. 29
Setting Script Parameter Values .......................................................................... 31
Unsetting Script Parameters ............................................................................... 31
Accessing Parameter Values ............................................................................... 31
Examples of Script Parameters............................................................................ 32
Invoke Commands ................................................................................................. 34
Invoking an External File.................................................................................... 34
Invoking a Block Script ...................................................................................... 34
Invoking Scripts Within a Scope .......................................................................... 35
Script Arguments .............................................................................................. 35
Examples of Invoke Commands........................................................................... 35

Contents 3
Program Flow Control ............................................................................................. 36
IF-THEN-ELSE Command.................................................................................... 36
FOR-DO Command ............................................................................................ 37
WHILE-DO Command ........................................................................................ 38
Examples of Program Flow Control....................................................................... 38
Expressions and Conditionals ................................................................................... 40
Examples of Math Functions................................................................................ 43
Examples of String Functions .............................................................................. 43
Examples of Relational and Logical Functions ........................................................ 45
Examples of File Functions.................................................................................. 46
Examples of List Functions.................................................................................. 46
Examples of Query Functions .............................................................................. 47
Examples of Miscellaneous Functions ................................................................... 47
Examples of Effects of Units of Measure................................................................ 48
Examples Using String Functions to Create Variable Names ..................................... 49
Wildcards.............................................................................................................. 50
Glob-Style Wildcards ......................................................................................... 50
Regular Expression Matching .............................................................................. 50
Examples of Wildcards ....................................................................................... 51
General Commands ................................................................................................ 53
Getting Help ..................................................................................................... 53
Exiting the System ............................................................................................ 53
Executing System Commands ............................................................................. 53
Timer .............................................................................................................. 54
OOMF Model Adapters............................................................................................. 54

3 HIERARCHIES, BLOCKS, VARIABLES, AND EQUATIONS ............................. 55


Hierarchies............................................................................................................ 56
What are Hierarchies?........................................................................................ 56
How are Hierarchies Created? ............................................................................. 56
Hierarchy Input ................................................................................................ 57
What is the Scope?............................................................................................ 58
How Hierarchies are Built ................................................................................... 59
Defining the Scope ............................................................................................ 59
Printing the Block Hierarchy................................................................................ 60
Finding a Block ................................................................................................. 60
Solving at a Scope ............................................................................................ 60
Examples of Hierarchy ....................................................................................... 61
Block Commands ................................................................................................... 63
Listing Blocks ................................................................................................... 63
Excluding Blocks ............................................................................................... 63

Contents 4
Including Blocks................................................................................................ 63
Listing Block Scripts .......................................................................................... 64
Printing Block Convergence ................................................................................ 64
Printing Block Statistics...................................................................................... 64
Changing Block Attributes .................................................................................. 65
Printing Block Attributes..................................................................................... 65
Example of Block Commands .............................................................................. 66
Variable Commands ............................................................................................... 68
Variable Attributes ............................................................................................ 68
Changing Variable Attributes............................................................................... 69
Printing Variables .............................................................................................. 70
Printing Variables Fixed in the Current Mode ......................................................... 70
Printing Variables Fixed in Other Modes ................................................................ 71
Printing Variables with Active Bounds................................................................... 71
Printing Largest Variable Shadow Prices ............................................................... 72
Printing Variables Using a Query.......................................................................... 73
Examples of Variable Commands ......................................................................... 74
Alias Commands .................................................................................................... 75
Printing Aliases ................................................................................................. 75
Printing Alias Values .......................................................................................... 75
Printing Alias Variables....................................................................................... 76
Equation Commands............................................................................................... 76
Excluding Equations .......................................................................................... 76
Including Equations ........................................................................................... 76
Evaluating Equations ......................................................................................... 77
Printing Equations ............................................................................................. 77
Printing Largest Residuals .................................................................................. 77
Printing Largest Residual Shadow Prices ............................................................... 78

4 SPECIFICATION GROUPS AND CONNECTIONS........................................... 79


Specification Group Commands ................................................................................ 80
Removing Specification Groups ........................................................................... 80
Disabling Specification Groups ............................................................................ 80
Enabling Specification Groups ............................................................................. 81
Printing Specification Groups .............................................................................. 81
Printing Inactive Specification Groups .................................................................. 81
Printing Specification Group Variables .................................................................. 81
Examples of Specification Group Commands ......................................................... 82
Stream Commands................................................................................................. 83
Printing Block Ports ........................................................................................... 83
Printing Stream Values ...................................................................................... 83

Contents 5
Changing Stream Attributes................................................................................ 84
Connection Commands ........................................................................................... 85
Removing Connections....................................................................................... 85
Disabling Connections........................................................................................ 86
Enabling Connections......................................................................................... 86
Checking Connections ........................................................................................ 87
Printing Connections.......................................................................................... 87
Printing Inactive Connections .............................................................................. 87
Printing Incomplete Connections ......................................................................... 88
Printing Connection Variables.............................................................................. 88
Examples of Connection Commands..................................................................... 89

5 MEASUREMENTS........................................................................................ 90
Measurement Commands ........................................................................................ 91
Checking Measurements..................................................................................... 91
Disabling Measurements .................................................................................... 91
Enabling Measurements ..................................................................................... 92
Printing Measurements ...................................................................................... 92
Printing Measurement Variables .......................................................................... 92
Examples of Measurement Commands ................................................................. 93
Measurement Qualities ........................................................................................... 98
Disabling Simple Measured-Parameterized Pairs .................................................... 98
Disabling Measured-Parameterized Pairs in Specification Groups .............................. 99
Enabling Specification Groups ............................................................................. 99
Executing the Variable Quality Capability .............................................................100
Examples of Measurement Qualities ....................................................................100

6 SAVING AND RESTORING .........................................................................102


File Commands .....................................................................................................103
Saving Variables To a Binary File ........................................................................103
Restoring Variables From a Binary File ................................................................103
Restoring Free Variables From a Binary File .........................................................104
Updating Variables In a Binary File .....................................................................105
Saving Variables To an ASCII File .......................................................................105
Restoring Variables From an ASCII File................................................................106
Comparing Variables With an ASCII File ..............................................................106
Examples of File Commands ..............................................................................107

7 OBJECTIVE FUNCTIONS............................................................................108
Objective Function Commands ................................................................................109
Changing Objective Function Attributes ...............................................................109

Contents 6
Evaluating the Objective Function.......................................................................109
Evaluating the Objective Functions Derivatives ....................................................109
Evaluating the Objective Functions Hessian .........................................................110
Printing the Objective Function...........................................................................110
Jacobian and Derivative Commands .........................................................................110
Analyzing the Jacobian......................................................................................110
Analyzing the Jacobian Sparsity .........................................................................111
Evaluating the Jacobian.....................................................................................111
Printing the Jacobian ........................................................................................111
Printing Jacobian Variables ................................................................................111
Printing Jacobian Equations ...............................................................................112
Printing Block Derivative Methods.......................................................................112
Examples Of Derivative Commands ....................................................................112

8 ANALYSIS.................................................................................................114
Analysis Commands ..............................................................................................115
Checking Degrees of Freedom............................................................................115
Sensitivity Analysis...........................................................................................115
Analyzing Variables ..........................................................................................115
Analyzing Equations .........................................................................................116
Examples of Analysis Commands........................................................................117
Solver Commands .................................................................................................119
Setting the Solver ............................................................................................119
Viewing Solver Settings ....................................................................................119
Entering DMO Parameters .................................................................................119
Entering LSSQP Parameters ...............................................................................121
Entering NSOLVE Parameters.............................................................................126
Solving the Problem .........................................................................................127
Examples of Solver Commands ..........................................................................127
Recovery Commands .............................................................................................127
Resetting Variables to Initial Values ....................................................................127

9 PRINTING AND REPORTS .........................................................................128


Printing Problem Information ..................................................................................129
Printing the Problem Summary...........................................................................129
Printing Problem Convergence............................................................................129
Examples of Printing Problem Information ...........................................................129
Formatted Printing ................................................................................................130
Print Formatted Command.................................................................................130
Examples of Formatted Printing..........................................................................132
Miscellaneous Printing Commands ...........................................................................133

Contents 7
The Echo Command..........................................................................................133
Examples of the Miscellaneous Printing Commands ...............................................134
Report Commands ................................................................................................134
Reporting Blocks ..............................................................................................134
Reporting the Objective Function ........................................................................134

10 UNITS OF MEASURE AND PHYSICAL TYPES ............................................135


Units of Measure Commands...................................................................................136
Changing a Variable's Units of Measure ...............................................................136
Printing Units of Measure ..................................................................................136
Dealing with Untyped Variables ..........................................................................136
Example Units of Measure Commands .................................................................137
Units of Measure ...................................................................................................138
Physical Types ......................................................................................................145

11 ASPEN PLUS EXTENSIONS ......................................................................148


Using the Interactive Prompt ..................................................................................148
Defining and Executing Scripts ................................................................................148
Defining Scripts ...............................................................................................148
Executing Scripts .............................................................................................149
Command Summary..............................................................................................150
Invoke Commands ................................................................................................150
Invoking a Local Script......................................................................................150
Invoking a Global Script ....................................................................................151
Miscellaneous Commands Specific to Aspen Plus........................................................151
Updating Crude Blends......................................................................................151
Updating the PDF .............................................................................................151
Hierarchies...........................................................................................................152
How are Hierarchies Created? ............................................................................152
Hierarchy Input ...............................................................................................152
Stream Commands................................................................................................152
Adding and Removing Stream Connections ..........................................................152
Disabling Stream Connections............................................................................153
Enabling Stream Connections.............................................................................153
Examples of Stream Commands .........................................................................153
HXFlux Commands ................................................................................................153
Controlling HXFlux Connections ..........................................................................153
Disabling HXFlux Connections ............................................................................154
Enabling HXFlux Connections .............................................................................154
Recovery Commands .............................................................................................155

Contents 8
Recovery ........................................................................................................155
Report Commands ................................................................................................155
Reporting Everything ........................................................................................155
Reporting the Flowsheet....................................................................................155
Reporting Streams ...........................................................................................155

12 ASPEN CUSTOM MODELER MODELS RELATED EXTENSIONS ....................157


Using the Interactive Prompt ..................................................................................157
Adding an ACM Model to OOMF ...............................................................................157

13 ASPEN REFSYS EXTENSIONS ...................................................................159


Using the Interactive Prompt ..................................................................................159
Command Summary..............................................................................................159

GENERAL INFORMATION..............................................................................160
Copyright.............................................................................................................160
Related Documentation..........................................................................................161

TECHNICAL SUPPORT...................................................................................162
Online Technical Support Center.........................................................................162
Phone and E-mail .............................................................................................163

INDEX ..........................................................................................................164

Contents 9
Introducing OOMF Script
Language

Introduction
This document describes the script language used by the OOMF kernel the
engine behind the EO strategy in products such as Aspen Plus. These script
commands may be typed at the command line or entered into script files or input
forms.
The script language is very effective for tasks such as:
Debugging an equation-oriented run.
Defining sets of process values.
Setting the inclusion status of blocks, measurements, etc.
Creating custom reports.
The script language has many features of an advanced programming language,
such as mathematical and string functions, if-then-else logic, and for-do loops.

Introducing OOMF Script Language 10


Using the Interactive Prompt
You can enter script commands interactively into the OOMF kernel.
Launch a command window by clicking on Start, Run, and typing in cmd
and pressing the OK button.
Add the path to the folder (C:\Program Files\AspenTech\OOMF\***\Xeq)
that contains oomf.exe to the current path environment variable.
set path= C:\Program Files\AspenTech\OOMF\2004\Xeq;%path%
Start oomf.exe.
You can now type commands at the OOMF prompt.
See Also
Aspen Plus Extensions - Using the Interactive Prompt
Aspen Custom Modeler Extensions Using the Interactive Prompt
Aspen RefSYS Extensions - Using the Interactive Prompt

The command line has a variety of features to assist in editing your commands.
These are summarized in the following table:
Key Strokes Description
HOME Move cursor to beginning of line.
END Move cursor to end of line.
BACKSPACE Delete the character left of the cursor.
DEL Delete the character right of the cursor.
RETURN Return the current line.
LEFT ARROW Move cursor left (back) 1 column.
RIGHT ARROW Move cursor right (forward) 1 column.
UP ARROW Fetches previous line from the history list.
DOWN ARROW Fetches next line from the history list.

Introducing OOMF Script Language 11


Defining and Executing Scripts
In addition to entering script commands at the OOMF prompt, you may also enter
them into a script file. This is nothing more than a series of script commands that
are executed in sequence, not unlike a subroutine.
See Product Specific Features:
Aspen Plus Extensions - Defining and Executing Scripts

Defining Scripts
Scripts may be defined in the following ways:
An external file that may be created with a standard text editor. The extension
of the file should be EBS.
Products using OOMF may define additional ways to create scripts.

Executing Scripts
Scripts may be executed in a number of ways:
By manually executing the script from the command line or from another
script. This may be done with the INVOKE command.
By associating the script with a block or the flowsheet. This is done by
assigning the script as a method attached to the block. A method is a function
that is called at specific times during the execution sequence of OOMF. The
following methods are available:
INIT This method is executed when the block is created and is available for all
blocks except hierarchies.
PRESOLVE This method is executed before a solve is started. It can be very useful for
defining run-specific information, such as process data.
POSTSOLVE This method is executed after a solve is completed. This is useful for checking
the results of the run and writing customized reports.
The script that is assigned as the block method may be an external file.
You may also manually execute a blocks script method with the INVOKE
command.
More on invoking scripts may be found in Invoke Commands.

Input Language Rules


General
Input in EBS files or the command line may start in any column and go to
column 256.
The input is, in general, not case sensitive. (One exception is the format string
for formatted printing.)

Introducing OOMF Script Language 12


Lines may be continued by using the backslash character (\) as the last
character of the line.
Single line comments are denoted by a double slash (//). When script
commands are entered in the INP file a semicolon (;) may be used.
Multi-line comments begin with slash asterisk (/*) and end with asterisk slash
(*/).
Percent signs (%) are used to delimit regular expressions (a powerful form of
wildcarding).
Some commands support single character (also known as glob style)
wildcarding. This is done with an asterisk (*) and question mark (?).
Use double quotation marks (") to enclose strings containing spaces and to
preserve upper and lower case.
Spaces must be used between all operators.
Many of these commands may have their output redirected by using TO device at
the end of the command. To redirect output to a file, use TO OPENFILE("file"),
where file is the name of the file.

Introducing OOMF Script Language 13


1 Script Commands

Command Summary
Below is a list of the script commands. This list may be displayed from the kernel
with the HELP command.

EO Commands
Command Purpose
ADD ALIASES Add variable aliases
ADD BLOCKS Add blocks to the current scope
ADD CONDITIONAL Add conditional equations
EQUATION
ADD CONNECTIONS Add variable and port connections
ADD MEASUREMENTS Create a measurement instrument and connection
ADD PORT Add variables to a new or existing port
ADD SPECIFICATION Add specification connections
CONNECTIONS
ALIAS Define or show variable aliases
ANALYZE DOF Report the current degrees of freedom
ANALYZE EQUATIONS Perform equation analysis
ANALYZE JACOBIAN Compare numerical and analytic Jacobian
ANALYZE SPARSITY Compares the numerical and analytical sparsity patterns.
ANALYZE VARIABLES Perform variable analysis
BLOCK SCRIPTS Show all scripts associated with a list of blocks
BLOCKS Show or set the list of blocks in the current scope
CHANGE FLUSHING Change the flushing level of an output device
CHANGE SCOPE Clear the scope stack and change scope as indicated
CHECK CONNECTIONS Analyze all connections and connection groups. Report status and any
inconsistencies.
CHECK MEASUREMENT Print a report showing measurements that have not activated correctly.
COMPARE VARFILE Compare database with current values
CONDITIONAL EQUATION Define conditional equations
CONNECTION Define or show variable and port connections
DELETE BLOCKS Delete blocks from the current scope
DELETE PORTS Delete ports from the current scope
DERIVATIVE Show the derivative method for all blocks in the current scope
continued

1 Script Commands 14
Command Purpose
DISABLE CONNECTION Disable any connection whose name matches a list of name expressions.
DISABLE MEASUREMENT Disable any measurement whose name matches a list of name expressions.
DISABLE SPECIFICATION Disable any specification group whose name matches a list of name expressions.
GROUPS
ECHO Print a value
ENABLE CONNECTION Enable any connection whose name matches a list of name expressions.
ENABLE MEASUREMENT Enable any measurement whose name matches a list of name expressions.
ENABLE SPECIFICATION Enable any specification group whose name matches a list of name expressions.
GROUPS
EVALUATE EQUATIONS Evaluate the equations
EVALUATE JACOBIAN Evaluate the Jacobian
EVALUATE OBJECTIVE Display the diagonal of the Hessian
HESSIAN
EVALUATE OBJECTIVE Evaluate and display the value
EVALUATE OBJECTIVE Evaluate and display the derivative
DERIVATIVE
EVALUATE RESIDUALS Evaluate the equations
EXCLUDE BLOCKS Exclude a block
EXPOSE PORT Expose a port contained within the current scope to the block which
FIND BLOCK Search the block hierarchy for a block
FIX STREAMS Fix the named streams
FLUSH Flush all the indicated devices
FREE STREAMS Free the named streams
HOMOTOPY PARAMETERS Show or Set the list of variables, the appropriate target values,
and, if necessary, the appropriate initial values that should be used
as parameters, parameter targets, and parameter initial values by the
homotopy solver.
IDENTIFY LIBRARY Ask a loaded library to give its version
INCLUDE BLOCKS Reactivate an excluded block
INITIALIZE BLOCKS Invoke the closed form initialization on the block(s)
INITIALIZE PORT Initialize a port from another port
INVOKE Execute commands in a file or a script attached to a block
LINEAR OBJECTIVE Define an objective function
LOAD LIBRARY Dynamically load a shared library
MEASUREMENTS Show or define the set of measured variables
OPENSOLVER LOAD Dynamically load an Open Solver DLL
OPENSOLVER UNLOAD Unload a previously loaded Open Solver DLL
POP SCOPE Return the scope stack to the previous scope
PRINT ACTIVE_BOUNDS Print a report for variables showing shadow prices and active bounds
PRINT ACTIVE_BOUNDS SSI Print a report for variables showing SSI shadow prices and active bounds
PRINT ALIAS VARIABLES Print the alias names referencing the specified variables
PRINT ALIASES Report variable attributes for all aliases
PRINT BLOCK ATTRIBUTES Print the list of attributes for a specified block
continued

1 Script Commands 15
Command Purpose
PRINT BLOCK Print convergence summary by block
CONVERGENCE
PRINT BLOCK HIERARCHY Show all blocks in the block hierarchy
PRINT BLOCK PORTS Print detailed port information for a specified list of blocks
DETAILED
PRINT BLOCK PORTS Print the list of ports for a specified block
PRINT BLOCK STATISTICS Print block statistics (with indices) for all or listed blocks
FULL
PRINT BLOCK STATISTICS Print block statistics for all or listed blocks
PRINT CONNECTION Print the connection group or groups associated with specified blocks or
GROUPS variables.
PRINT CONNECTION Print the connection name that references the specified variables
VARIABLES
PRINT CONNECTIONS Print a detailed report for each connection named in the supplied list.
DETAILED
PRINT CONNECTIONS Print any connection whose name matches a list of name expressions.
PRINT CONVERGENCE Summarize the convergence
SUMMARY
PRINT EQUATIONS Print a report for equations
PRINT FIXED Print a report for fixed variables
PRINT FLUSHING Show the flushing level of an output device
PRINT FORMATTED Write formatted information to the report device
PRINT INACTIVE Print any inactive connection whose name matches a list of name expressions.
CONNECTIONS
PRINT INACTIVE Print any inactive specification group whose name matches a list of name
SPECIFICATION GROUPS expressions.
PRINT INCOMPLETE Print the list of connections that are incomplete. Incomplete connections
CONNECTIONS
PRINT JACOBIAN Print the Jacobian (matrix for first derivatives)
PRINT JACOBIAN Print the Jacobian for certain equations
EQUATIONS
PRINT JACOBIAN Print the Jacobian for certain variables
VARIABLES
PRINT LARGEST EQUATION Show the largest equation shadow prices
SCALED_SHADOW_PRICES
PRINT LARGEST EQUATION Show the largest equation shadow prices
SHADOW_PRICES
PRINT LARGEST EQUATIONS Show the largest residuals
PRINT LARGEST RESIDUAL Show the largest residual shadow prices
SCALED_SHADOW_PRICES
PRINT LARGEST RESIDUAL Show the largest residual shadow prices
SHADOW_PRICES
PRINT LARGEST RESIDUALS Show the largest residuals
PRINT LARGEST VARIABLE Show the largest variable shadow prices in scaled SI
SHADOW_PRICES SSI
PRINT LARGEST VARIABLE Show the largest variable shadow prices in user units
SHADOW_PRICES
PRINT MEASUREMENTS Report on all or specified variable measurements.
PRINT MEASUREMENTS Report the measurements that reference the specified variables
VARIABLES
continued

1 Script Commands 16
Command Purpose
PRINT OBJECTIVE Display an objective function
PRINT QUERY Print the attributes of variables that satisfy a query string.
PRINT RESIDUALS Print a report for equations
PRINT SCOPE Output the scope stack
PRINT SOLVERS List the currently loaded solvers
PRINT SPECIFICATION Print any specification group whose name matches a list of name expressions.
GROUP
PRINT SPECIFICATION Print the specification group name that references the specified variables
GROUP VARIABLES
PRINT SPECIFICATIONS List variables that have a spec type other than Calc
PRINT SUMMARY Summarize the state of the kernel
PRINT TIMER Print the timer
PRINT VARIABLES Print a report for variable connections
CONNECTIONS
PRINT VARIABLES SSI Print a report for variables in scaled SI
PRINT VARIABLES Print a report for variables
PROCESS VARIABLE Process spec flipping logic to the &BAD_STATUS_LIST
QUALITY
PUSH SCOPE Change the scripting scope to that of the named block
READ VARFILE Read a database of variable information
READ VARFILE EXCEPT Read a database of variable information
REMOVE CONNECTIONS Remove any connection whose name matches a list of name expressions.
REMOVE SPECIFICATION Remove any specification group whose name matches a list of name expressions.
GROUPS
REPORT BLOCKS Print block reports
REPORT OBJECTIVE Display an objective function
RESET SCOPE Remove all of the pushed scopes
RESET VARIABLES Reset the variable values to their state before the solve command was issued
RESTART TIMER Restart the timer
RESTORE FREE VARIABLES Restore attributes for free variables in current MODE from a binary file
EXCEPT
RESTORE FREE VARIABLES Restore attributes for free variables in current MODE from a binary file
RESTORE VARIABLES Restore variable attributes from a binary file
EXCEPT
RESTORE VARIABLES Restore variable attributes from a binary file
SAVE VARIABLES Store variable attributes in a binary file
SCOPE INVOKE Execute a block method for a block hierarchy
SENSITIVITY Performs a sensitivity analysis
SHOW DECOMPOSITION Show the details of the groups in the current decomposition of the Non-Linear
Algebraic Equation System. This is applicable only if you are using a solver that
decomposes the current problem into smaller groups before the solve.
SOLVE Solve the current problem
SOLVER SETTINGS Set or show the current solver settings
SOLVER Set or show the current solver
continued

1 Script Commands 17
Command Purpose
START TIMER Start the timer
STOP TIMER Stop the timer
SUM SQUARES OBJECTIVE Define an objective function
SYMBOLIC OBJECTIVE Define an objective function
SYSTEM Have the operating system execute a command
TOGGLE SOLVE SCOPE Changes the status of any connections and spec groups that cross the current
scope boundary
UNLOAD LIBRARY Unload a previously loaded library
UNPROCESS VARIABLE Undo the effect of &BAD_STATUS_LIST and measurement
QUALITY
UNSET Undefine a set of parameters
UPDATE VARIABLES Update binary variable file from the current variable vector
WRITE VARFILE Write a database of variable information
WRITE VARFILE EXCEPT Write a database of variable information

See Also
Aspen Plus Extensions - Command Summary
Aspen Custom Modeler Extensions - Adding an ACM Model to OOMF
Aspen RefSYS Extensions - Command Summary
For these commands, arguments should be separated by commas. Many of these
commands support output redirection by adding TO followed by an output device
specification. Additional help may be available for these commands by typing help
followed by the commands full name.
Commands above that support regular expressions can understand GLOB or
REGEXP style regular expressions. Commands listed below (except assignment)
do not support GLOB.

Additional Commands
ADD UOM {uom1} = (multiplier * ){uom2} ([+ | -] offset)
BREAK
CONTINUE
EXIT
IF, FOR, and WHILE blocks
HELP [command name]
PRINT uom(s) [ list_of_uom_specs | for list_of_physical_types]
QUIT
SET paramname = expression
LOCAL paramname [= expression] [, paramname ...]
RETURN [expression]

Assignments
variableId[.lower | .upper | .step | .scale | .bound | .spec | .sbweight] = expression
variableId(.uom) = { uom }
variableId(.spec) = const | calc | meas | param | optim | recon | indep(endent) | fixed | free
variableId(.bound) = hard | relaxed | soft
blockId(.deriv_method) = analytic | numeric | update_numeric | update_analytic
blockId(.nlratiodev) = real

1 Script Commands 18
blockId(.zerotol) = real
blockId(.move) = TRUE | FALSE
blockId(.moveamount) = real
blockId(.pert) = real
blockId(.included) = expression
blockId.streamId.str.spec = const | calc | meas | param | optim | recon | indep(endent) | fixed | free
blockId.streamId.str.phase = unknown | liquid | vapor | vl | vlf
objId.direction = MAXIMIZE | MINIMIZE
objId.scale = expression
objId.uom = { uom }
equationId(.included) = TRUE | FALSE | boolean expression
regexp = expression

Syntax for Command Descriptions Above


[] Indicates that the command within is optional.
<> Indicates that you must choose one of the keywords within. For example,
list_of_<aliasId variableId> indicates you must enter a list of alias names or
variable names.
| Used to separate command options. For example, str(ea)m(s) all | none
indicates that you may type streams all or streams none.
variableId Name of a variable.
aliasId Name of a alias.
equationId Name of an equation.
uom Units of measure. When you enter the units of measure for a variable, you must
place it within braces, { }.
list_of_ Indicates a list of names. The names are separated by blanks.
regex Indicates the use of regular expression matching. This is a form of wildcarding
which is discussed in the section titled Regular Expression Matching.
expression An expression. This is discussed further in the section titled Expressions and
Conditionals.
condition A TRUE/FALSE condition. This is discussed further in the section titled
Expressions and Conditionals.

Notes
expression may be any of:
number
"a quoted string"
regexp
TRUE, FALSE, ON, or OFF
identifier
&identifier
variable_attribute
expression + expression
expression expression
expression * expression
expression / expression
expression ^ expression
expression OR expression
expression AND expression

1 Script Commands 19
expression . expression
expression relop expression
( expression )
op ( expression )
expression
NOT expression
number is any of the following:
integer
real
integer { uom }
real { uom }
integer { $ / uom }
real { $ / uom }
real {si}
real {ssi}
real {*}
where uom is a valid unit (see section on Unit of Measure and Physical Types)
num_or_param is one of:
number
&identifier
relop is any of these relational operators: < > = <> <= >=
vmaskElem is any of:
name physical_type lower value
upper scale units spec
step sbweight shadow active
vmask is [ list_of_vmaskElem ]
op is any of:
abs loge log10
cos sin tan
exp defined head
tail string2id id2string
OpenFile OpenBinary DeviceInfo
OpenTee ToLower ToUpper
BlockVars QueryVars Int
Val TypeOf AliasesByVar
ConnectionsByVar MeasurementsByVar SpecGroupsByVar
ActiveConn InActiveConn ActiveSpecGroup
InActiveSpecGroup ActiveMeas InActiveMeas

1 Script Commands 20
regexp is % regular_expression %
You can use echo to examine the value of block attributes, equation residuals and
attributes, and variable values and attributes. For example:
echo blkname.deriv_method
echo variable_name.spec

Syntax of If, For, and While blocks


IF ( expression ) THEN
list_of_command
[ ELSEIF ( expression ) THEN
list_of_command ]...
[ ELSE
list_of_command ]
ENDIF

FOR <indexvar> IN <list expression> DO


list_commands
ENDFOR

WHILE <expression> DO
list_commands
ENDWHILE

Read-Only Block Attributes


blkname.model
blkname.sparsity_file
blkname.sparsity_type
blkname.sparsity_gen

Predefined Script Parameters


Parameter Description
BLOCKS List of blocks in the current scope (read-only)
BUILD_DATE Build date of the software (read-only)
BUILD_NUMBER Build number of the software (read-only)
CONVERGED If true, the last solve converged (read-only)
CHECK_UOM If true, do not allow assignment of untyped numbers to variables
DATE The date and time of day as a string (read-only)
DEFAULT_FLUSHING Control the flushing level of new files
DIAG_LEVEL Diagnostic level controls debug printing
FLANGE_PHASE Default phase when linking PML and AspenPlus streams
continued

1 Script Commands 21
Parameter Description
HISTORY_DEVICE Where to send status messages and errors
JOURNAL_DEVICE Where to journal commands
JOURNAL_LEVEL How many levels of invoke commands are expanded
MAJOR_VERSION Major version of the software (read-only)
MINOR_VERSION Minor version of the software (read-only)
MODE Calculation mode
(Legal values are: SIM, PAR, REC, OPT; default: SIM)
NAME_WIDTH Number of characters used to display variable/equation names
NUMBER_WIDTH Number of characters used to display real (floating point) values
UOM_WIDTH Number of characters used to display the UOM
OBJECTIVE The current objective function using by SOLVE
ONLINE True/false; indicates the program is running on/off-line (read-only)
P_AMB Ambient pressure for converting to/from gauge pressure
PAGE_WIDTH Number of characters per line
PROBID Current problem as identifier (read-only)
PROBNAME Current problem as string (read-only)
PROMPT Command line prompt
RELAX_TOL Relaxed-bound tolerance
REPORT_DEVICE Where to direct output from commands
SOFT_BOUND True/false; indicates soft-bounds are active/inactive
STEP_BOUND True/false; indicates step-bounds are active/inactive
MEAS_CAPACITY Initial capacity (number of measurements) for measurement blocks
MEAS_TAG_WIDTH Number of characters used to display the measurement tagname
MEAS_DESC_WIDTH Number of characters used to display the measurement description
MEAS_UOM_WIDTH Number of characters used to display the measurement UOM
MEAS_NUMBER_WIDTH Number of characters used to display the measurement values
PRINT_VAR_MASK List of variable attributes to be displayed in a print variable command
WRITE_VARFILE_MASK List of variable attributes to be written in a write varfile command
READ_VARFILE_MASK List of variable attributes to be read in a read varfile command

User Definable Script Parameter


SCRIPT_PATH Semicolon-separated list of directories which are searched left to
right if a specified script cannot be found

The following chapters describe the script commands in detail, grouped by


functionality.

1 Script Commands 22
2 OOMF Script Language
Basics

This chapter describes language elements and general commands of the OOMF
Script language.

2 OOMF Script Language Basics 23


Redirecting Output and
Journaling
These commands allow you to redirect the output from any command to an
external file, determine where reports and history information is sent, and allows
you to journal all your script commands.

Redirecting the Output of a Command


Many commands can have their output redirected to another device by placing TO
at the end of the command followed by the desired device. This is similar to the
DOS and VMS use of the greater than sign (>).

Input Language
command TO device

Input Language Description


device Device to which output is to be directed:

device defaults to TERMINAL but may be any of the following:


TERMINAL Redirects output to the console.
NOWHERE Redirects output to nowhere (nothing is printed).
"file" Name of a file enclosed in double quotation marks.
OPENFILE Redirects output to the specified ASCII file. To simply open the file, enter:
OPENFILE( "file" )
The name of the file is enclosed in double quotation marks. To open the file
with an option, enter:
OPENFILE( [ "file", option ] )
Note the use of the brackets. option is one of the following:
READ Open file for reading only.
WRITE Open file for writing only.
APPEND Open file for writing. Any data written will be appended to
the end of the file.
OPENBINARY Redirects output to the specified binary file. To simply open the file, enter:
OPENBINARY( "file" )
The name of the file is enclosed in double quotation marks. To open the file
with an option, enter:
OPENBINARY( [ "file", option ] )
Note the use of the brackets. option is one of the following:
BINARY_READ Open file for binary reading only.
BINARY_WRITE Open file for binary writing only.
BINARY_APPEND Open file for binary writing. Any data written will
be appended to the end of the file.
OPENTEE Redirects output to a series of destinations:
OPENTEE( [ list ] )
list is a comma-separated list of destinations enclosed in brackets. It may
include TERMINAL and OPENFILE.

2 OOMF Script Language Basics 24


Changing the Report Device
The output device for most commands (except ANALYZE VARIABLES, ANALYZE
EQUATIONS and SENSITIVITY) can be changed by changing the system
parameter REPORT_DEVICE using the SET command.

Input Language
SET REPORT_DEVICE = device

Input Language Description


device Device to which output is to be directed:

device may be any of the following:


TERMINAL NOWHERE OPENFILE OPENTEE

See the section Redirecting the Output of a Command for details on these options.

Changing the History Device


The output device for the ANALYZE VARIABLES, ANALYZE EQUATIONS and
SENSITIVITY commands can be changed by changing the system parameter
HISTORY_DEVICE using the SET command.

Input Language
SET HISTORY_DEVICE = device

Input Language Description


device Device to which output is to be directed:

device may be any of the following:


TERMINAL NOWHERE OPENFILE OPENTEE

See the section Redirecting the Output of a Command for details on these options.

Flushing the Devices


The flushing level determines how frequently the program will force any buffered
data to be written to the output device. For normal batch operation, you do not
need to worry about flushing. When a device is opened, the
DEFAULT_FLUSHING script parameter is used to set the flushing.

Input Language
FLUSH
PRINT FLUSHING device
CHANGE FLUSHING device, level

2 OOMF Script Language Basics 25


Input Language Description
device Device to flush.
level Flushing level. This determines how frequently the program will force any buffered
data to be written to the output device. The default is set to script parameter
DEFAULT_FLUSHING.
NEVER Never flush
PER_LINE Flush after each line
PER_WRITE Flush after each write command

Journaling
A parameter is available to create a journal of all the commands you type at the
console or are invoked in script files. This parameter is called JOURNAL_DEVICE
and may be displayed with the ECHO command and changed with the SET
command. This output can be directed to a file and/or the terminal. You turn it off
by directing it NOWHERE.
A parameter is available to control the level of invoke commands that will be
journaled. This parameter is called JOURNAL_LEVEL and may be displayed with
the ECHO command and changed with the SET command. A value of 0 will
journal only the topmost level of commands. A value of 1 will journal the top two
levels of commands. A value of 99999 will journal all levels.
The journal file starts with a comment (using //) indicating the build number and
build date of the executable being run followed by the current date, time and
journal status. Each command executed is added to the journal file followed by a
time-stamp comment. The journal file is designed so that it may be run like any
other script file, i.e. with the INVOKE command.

Input Language
SET JOURNAL_DEVICE = device
SET JOURNAL_LEVEL = level

Input Language Description


device Device to which output is to be directed:
level Journaling level. This controls the level of invoke commands that will be journaled. A
value of 0 will journal only the topmost level of commands. A value of 1 will journal
the top two levels of commands. A value of 99999 will journal all levels.

device defaults to NOWHERE but may be any of the following:


TERMINAL NOWHERE OPENFILE OPENTEE

See the section Redirecting the Output of a Command for details on these options.

2 OOMF Script Language Basics 26


Examining the Output Devices
The value of the report, history and journal devices can be examined using the
ECHO command.

Input Language
ECHO &REPORT_DEVICE
ECHO &HISTORY_DEVICE
ECHO &JOURNAL_DEVICE

Examples of Redirecting Output


To change the report device to file COLUMN.REP enter:
SET REPORT_DEVICE = OPENFILE( "COLUMN.REP" )
To have the report sent to both the terminal and file COLUMN.REP enter:
SET REPORT_DEVICE = OPENTEE( [ TERMINAL, OPENFILE( "COLUMN.REP" ) ] )
To change the report device to file COLUMN.REP and open it with the appending
option enter:
SET REPORT_DEVICE = OPENFILE( [ "COLUMN.REP", APPEND ] )

Script Parameters
Script parameters are quantities that are local to the scripting language. You may
define your own script parameters to perform a variety of tasks:
Define a character string.
Define a format for formatted printing.
Control the behavior of OOMF through pre-defined script parameters.
Script parameters have the following naming convention:
Names are limited to 128 characters.
Names must start with a letter (A-Z) and only contain letters, numbers, and
underscores (A-Z 0-9 _ ).
Script parameters may be strings, numeric quantities or identifiers. Like variables,
numeric values are always stored in SI units and have units attributes. The values
of script parameters may be set with the SET (for global script parameters) or
LOCAL (for local script parameters) commands and viewed with the ECHO
command.

2 OOMF Script Language Basics 27


The commands for working with script parameters can also be used with variables
defined by models. Names of these variables may contain other characters, which
may need to be quoted, as specified below:
All names must begin with a letter (A-Z), digit (0-9) or a dollar sign ($).
The following characters can appear in a name without any special treatment:
A-Z 0-9 $ : + - _ .
The following characters can appear in a name, but when they do, the whole
name must be delimited by single quotation marks:
(blank) ; / = * , () [] {} <>
The ampersand (&), percent sign (%) and the pound sign (#) are not valid
characters.

Global Script Parameters


Script parameters defined with the SET command are global by default. A global
script parameter is available anywhere regardless of where it is defined. All built-
in script parameters are global. Global script parameters are defined with the SET
command. See Setting Script Parameter Values.

Local Script Parameters


A local script parameter is available only within the script file or block script
method where it is defined. Its value is not available outside of the defining script.
This also means that it is not available to a script invoked by the defining script.
If a local script parameter has the same name as a global script parameter, then
the global script parameter value is re-defined.
Local script parameters are defined with the LOCAL command. See Setting Script
Parameter Values.

2 OOMF Script Language Basics 28


Built-In Script Parameters
OOMF uses pre-defined script parameters that provide information on OOMF and
control operation:
Script Parameter Description
BLOCKS List of blocks in the current scope (read only).
BUILD_DATE Build date of the OOMF software. (read only) The format is
DAY MON DATE HRS:MIN:SEC YEAR
BUILD_NUMBER Build number of the OOMF software (read only)
CONVERGED Indicates if the last solve converged (read only)
CHECK_UOM Indicates if the user is required to enter the units of measure for every value entered
(default = FALSE)
DATE The date and time of day as a string. (read only) The format is
DAY, MON DATE, YEAR, HRS:MIN.
DEFAULT_FLUSHING Default flushing level for new files. NEVER is recommended for VMS systems.
NEVER Never flush
PER_LINE Flush after each line (default)
PER_WRITE Flush after each write command
DIAG_LEVEL Diagnostic level to control debug printing (default = 4).
FLANGE_PHASE Used as a default phase for a stream connection from a mole flow stream to a mole
fraction stream. This determines the type of flash to be performed:
VL Mixed vapor and liquid phases (flash required)
VLF Mixed vapor, liquid and free water phases (flash with free water
required)
UNKNOWN Unknown phase (default).
HISTORY_DEVICE Destination where history information is to be output. Use ECHO
&HISTORY_DEVICE to examine the current value.
device defaults to TERMINAL but may be any of the following:
TERMINAL NOWHERE OPENFILE OPENTEE
See the section Redirecting the Output of a Command for details on these options.
JOURNAL_DEVICE Destination where journaling output is to be directed. Use ECHO
&JOURNAL_DEVICE to examine the current value.
device defaults to TERMINAL but may be any of the following:
TERMINAL NOWHERE OPENFILE OPENTEE
See the section Redirecting the Output of a Command for details on these options.
JOURNAL_LEVEL How many levels of invoke commands are journaled. A value of 0 will journal only
the topmost level of commands. A value of 1 will journal the top two levels of
commands. A value of 99999 will journal all levels.
MAJOR_VERSION Major version of the OOMF software (read only)
MEAS_CAPACITY Initial capacity for measurement blocks (default = 50)
MINOR_VERSION Minor version of the OOMF software (read only)
MODE Operating mode (default = INI)
NAME_WIDTH Width of the name field in the PRINT commands, such as PRINT VARIABLES,
PRINT ALIAS, PRINT FIXED, PRINT MEASUREMENTS, PRINT EQUATIONS,
PRINT LARGEST EQUATIONS, and PRINT JACOBIAN
(default = 40)
continued

2 OOMF Script Language Basics 29


Script Parameter Description
NUMBER_WIDTH Width of the number field in some output commands, such as WRITE VARFILE, and
WRITE VARFILE EXCEPT (default = 12)
OBJECTIVE The name of the objective function to be used during the solution (default = NONE)
ONLINE Indicates if the program is running on-line or off-line (read only)
P_AMB Ambient pressure for converting to/from gauge pressure. In online situations, this
can be set to the actual ambient pressure (default = 1 {atm})
PAGE_WIDTH Width of the page for some output commands, such as WRITE VARFILE, and
WRITE VARFILE EXCEPT (default = 131)
PRINT_VAR_MASK Default variable mask used for the PRINT VARIABLES, PRINT FIXED, PRINT
QUERY, PRINT ALIAS, and PRINT ACTIVE_BOUNDS commands
(default = [NAME, LOWER, VALUE, UPPER, UNITS, SPEC]).
PROBID Current problem name as identifier (read-only)
PROBNAME Current problem name as string (read-only)
PROMPT Command line prompt (default = )
READ_VARFILE_MASK Default variable mask used for the READ VARFILE command
(default = [NAME, UNITS, VALUE, INIT, CHANGE, LOWER, UPPER, STEP,
BOUND, SPEC, SSPEC, SCALE, SBWEIGHT, RLOWER, RUPPER]).
RELAX_TOL Relaxed-bound tolerance (default = 0)
REPORT_DEVICE Destination where output from the PRINT and REPORT commands are to be
directed. Use ECHO &REPORT_DEVICE to examine the current value.
device defaults to TERMINAL but may be any of the following:
TERMINAL NOWHERE OPENFILE OPENTEE
See the section Redirecting the Output of a Command for details on these options.
SCRIPT_PATH Semicolon separated list of directories that are searched left to right if a specified
script cannot be found. (default = undefined).
SOFT_BOUND Flag for soft bounds (default = TRUE).
STEP_BOUND Flag for step bounds (default = TRUE).
UOM_WIDTH Width of the name field in the PRINT commands, such as PRINT VARIABLES,
PRINT ALIAS, PRINT FIXED and WRITE VARFILE (default = 8).
WRITE_VARFILE_MASK Default variable mask used for the WRITE VARFILE command (default = [NAME,
UNITS, VALUE, INIT, CHANGE, LOWER, UPPER, STEP, BOUND, SPEC, SSPEC,
SCALE, SBWEIGHT, RLOWER, RUPPER])

2 OOMF Script Language Basics 30


Setting Script Parameter Values
The value of any global script parameter may be defined with the SET command.
The value of any local script parameter may be defined with the LOCAL
command.

Input Language
SET parameter = expression
LOCAL parameter = expression

Input Language Description


parameter Name of the parameter. The name may be constructed by string concatenation
and use the STRING2ID function. If no parameter is entered, SET and LOCAL
return a list of all defined parameters.
expression An expression to define the parameter value. This may be a string in double
quotes or a mathematical expression. A mathematical expression may include the
operators:
+, -, *, /, ^, .
and the relational operators:
<, >, =, <>, <=, >=
as well as the functions:
ABS, LOGE, LOG10, COS, SIN, TAN, EXP, SQRT, INT, STRING2ID,
ID2STRING, TOUPPER, TOLOWER, LENGTH, SUBSTR, INDEX,
INSERTSTR, REMOVESTR, OPENFILE, OPENBINARY, DEVICEINFO,
OPENTEE, VAL, TYPEOF, DEFINED, HEAD, TAIL, BLOCKVARS,
QUERYVARS, ALIASESBYVAR, CONNECTIONSBYVAR,
MEASUREMENTSBYVAR, SPECGROUPSBYVAR
Expressions are discussed further in the section titled Expressions and
Conditionals.

Unsetting Script Parameters


The value of any script parameter may be set to undefined with the UNSET
command.

Input Language
UNSET parameter

Input Language Description


parameter Name of the parameter. The name may be constructed by string
concatenation and use the STRING2ID function.

Accessing Parameter Values


The value of any script parameter may be accessed using the & character. See
the following examples.

2 OOMF Script Language Basics 31


Examples of Script Parameters
To print the value of the CONVERGED parameter to the report device we enter:
ECHO &CONVERGED
We could use this parameter value in an IF-THEN-ELSE construct to control
whether we save our variable values at the completion of the problem:
IF (&CONVERGED) THEN
SAVE VARIABLES [VALUE] TO "COLUMN_SIM.X"
ENDIF
To set the mode to SIM we enter:
SET MODE = SIM
To define a numeric parameter called TEMP the value of 30 C, enter:
SET TEMP = 30.{C}
To define a string parameter called FILENAME the value of COLUMN.VBL we enter:
SET FILENAME = "COLUMN.VBL"
We can then use this file name as the report device:
SET REPORT_DEVICE = OPENFILE(&FILENAME)
We can use string concatenation to define the name of the parameter we wish to
set:
EO> SET STRING2ID("P" . "1") = 10
EO> ECHO &P1
10
Note the use of the STRING2ID function. This converts the resultant string P1
into an identifier, which is required for the SET command.
We can build up this name from two script parameters:
EO> SET NAME = "P"
EO> SET NUM = "1"
EO> SET STRING2ID( &NAME . &NUM ) = 10.
EO> ECHO &P1
10 {*}
However, the scripting language will automatically perform the STRING2ID
function is some cases. So here, we can also write:
EO> SET NAME = "P"
EO> SET NUM = "1"
EO> SET &NAME&NUM = 10.
EO> ECHO &P1

2 OOMF Script Language Basics 32


10 {*}
Note that we do not put any blanks between the two parameter references.
We can also build the name from a parameter and another string:
EO> SET NAME = "P"
EO> SET &<NAME>1 = 10.
EO> ECHO &P1
10 {*}
Note that we place NAME in angled brackets (<>) to avoid ambiguity.
You can set a script parameter to a variable with this command:
EO> SET VAR = C2S.D.STR.C2H6
EO> ECHO &VAR
0.0001 {UNITLES}
However, when you do this, it is the variable ID that is transferred to the script
parameter, not the value. So when you change the variable value, the script
parameter also changes. You can verify this with the TYPEOF function:
EO> C2S.D.STR.C2H6 = 0.0002
EO> ECHO &VAR
0.0002 {UNITLES}

EO> ECHO TYPEOF(&VAR)


VARIABLE
If this is not the desired effect, use the VAL function. This ensures that only the
value of the variable, not the ID, is transferred to the script parameter:
EO> SET VAR = VAL(C2S.D.STR.C2H6)
EO> ECHO &VAR
0.0001 {UNITLES}

EO> C2S.D.STR.C2H6 = 0.0002


EO> ECHO &VAR
0.0001 {UNITLES}

EO> ECHO TYPEOF(&VAR)


REAL

2 OOMF Script Language Basics 33


Invoke Commands
These commands allow you to call, or invoke, other scripts. These may be scripts
that have been entered in external files.

Invoking an External File


An external script file may be invoked with this command.
You may pass arguments to the invoked script file and get a returned value.

Input Language
INVOKE file, arg1, arg2,

Input Language Description


file Name of an external script file to execute. The default extension is EBS.
arg1, Optional list of arguments passed to the script file. This may be referenced in the
arg2 invoked script as &ARG1, &ARG2 etc. These are local script parameters and thus
only available within the invoked script. The total number of arguments passed to the
script file is available as &ARGC. The value returned to the invoking script is available
as &RET_VALUE.

Invoking a Block Script


Any method in a block script can be invoked with this command. When the
INVOKE is executed, the scope is implicitly changed to the blocks level.
You may pass arguments to the invoked script and get a returned value.

Input Language
INVOKE blockid, method, arg1, arg2,

Input Language Description


blockid Name of the block script to execute.
method Name of the script method to execute.
arg1, arg2 Optional list of arguments passed to the script. This may be referenced in the
invoked script as &ARG1, &ARG2 etc. These are local script parameters and thus
only available within the invoked script. The total number of arguments passed to the
script file is available as &ARGC. The value returned to the invoking script is
available as &RET_VALUE.

2 OOMF Script Language Basics 34


Invoking Scripts Within a Scope
A group of block scripts within a scope can be executed with the SCOPE INVOKE
command. This command executes the block scripts in a predetermined order.
When hierarchies are present, the SCOPE INVOKE command executes all the
blocks in the hierarchies first, then the hierarchy scripts. It effectively works its
way up the directory tree of the flowsheet. As each INVOKE is executed, the
scope is implicitly changed to the blocks level.

Input Language
SCOPE INVOKE blockid, method

Input Language Description


blockid Name of the scope to execute. SELF refers to the name of the current scope.
method Name of the script method to execute.

See Also
Aspen Plus Extensions - Invoke Commands

Script Arguments
Scripts may have arguments passed to them and may return a single argument.
The arguments are passed with the INVOKE command:
INVOKE file, arg1, arg2,
These may be referenced in the invoked script as &ARG1, &ARG2 etc. These are
local script parameters and thus only available within the invoked script. The total
number of arguments passed to the script file is available as &ARGC.
The script file may define a return value using the RETURN command:
RETURN value
This command terminates execution of the script.
The invoking script may reference the returned value as &RET_VALUE. This is a
local script parameter.

Examples of Invoke Commands


To invoke a script file called SETINDEP.EBS, enter:
INVOKE SETINDEP
The file extension is not necessary.
To invoke a method INIT in block C2S, enter:
INVOKE C2S, INIT

2 OOMF Script Language Basics 35


Consider the flowsheet structure as shown below:

PLANT

S1 S2

B1 B2 B3 S3 B6

B4 B5

To invoke all the PRESOLVE methods in scope S2, enter:


SCOPE INVOKE S2, PRESOLVE
The scripts would be executed in this order: B4, B5, S3, B6, S2.

Program Flow Control


These commands allow you to perform advanced programming functions such as
IF-THEN-ELSE, FOR-DO and WHILE-DO.

IF-THEN-ELSE Command
This command can be used to define conditionals to control program execution.

Input Language
IF ( condition ) THEN

ELSEIF ( condition ) THEN

ELSE

ENDIF

2 OOMF Script Language Basics 36


Input Language Description
condition A TRUE/FALSE condition. This may include the operators:
+, -, *, /, ^, .
and the relational operators:
<, >, =, <>, <=, >=
as well as the functions:
ABS, LOGE, LOG10, COS, SIN, TAN, EXP, SQRT, INT,
STRING2ID, ID2STRING, TOUPPER, TOLOWER, LENGTH,
SUBSTR, INDEX, INSERTSTR, REMOVESTR, OPENFILE,
OPENBINARY, DEVICEINFO, OPENTEE, VAL, TYPEOF, DEFINED,
HEAD, TAIL, BLOCKVARS, QUERYVARS, ALIASESBYVAR,
CONNECTIONSBYVAR, MEASUREMENTSBYVAR,
SPECGROUPSBYVAR
Logical operators are also allowed:
OR, AND, NOT
Conditions are discussed further in the section titled Error! Reference source
not found..

FOR-DO Command
This command can be used to define an execution loop.

Input Language
FOR index IN list DO

BREAK

CONTINUE

ENDFOR

Input Language Description


index Index in the defined list. If the index is defined before the FOR-DO loop
executes, its original value will be restored after the loop terminates. If the
index is undefined before the loop executes, it will be undefined after the loop
terminates.
list List of quantities that define the FOR-DO loop. The list is separated by commas
and enclosed in brackets.
BREAK Used to break out of the FOR-DO loop.
CONTINUE Used to skip to the next index in the FOR-DO loop.

2 OOMF Script Language Basics 37


WHILE-DO Command
This command can be used to define an execution loop.

Input Language
WHILE ( condition ) DO

BREAK

CONTINUE

ENDWHILE

Input Language Description


condition A TRUE/FALSE condition. This may include the operators:
+, -, *, /, ^, .
and the relational operators:
<, >, =, <>, <=, >=
as well as the functions:
ABS, LOGE, LOG10, COS, SIN, TAN, EXP, SQRT, INT, STRING2ID,
ID2STRING, TOUPPER, TOLOWER, LENGTH, SUBSTR, INDEX,
INSERTSTR, REMOVESTR, OPENFILE, OPENBINARY, DEVICEINFO,
OPENTEE, VAL, TYPEOF, DEFINED, HEAD, TAIL, BLOCKVARS,
QUERYVARS, ALIASESBYVAR, CONNECTIONSBYVAR,
MEASUREMENTSBYVAR, SPECGROUPSBYVAR
Logical operators are also allowed:
OR, AND, NOT
Conditions are discussed further in the section titled Expressions and
Conditionals.
BREAK Used to break out of the WHILE-DO loop.
CONTINUE Used to skip to the next index in the WHILE -DO loop.

Examples of Program Flow Control


This is an example of using the IF-THEN-ELSE block to check the convergence of a
problem and save the variable values to a binary file if converged:
IF (&CONVERGED) THEN
ECHO "The problem was successful."
SAVE VARIABLES [VALUE] TO "COLUMN.XSM"
ELSE
ECHO "The problem failed."
ENDIF

2 OOMF Script Language Basics 38


We can also use the IF-THEN-ELSE to check the values of variables:
IF (B1.BLK.TEMP > 50 {F}) THEN
ECHO "TEMP TOO HIGH"
ELSE
ECHO "TEMP OK"
ENDIF
This is an example of a FOR-DO loop:
FOR I IN [1, 2, 4] DO
ECHO &I
ENDFOR
This will cause the following lines to be output to the report device:
1
2
4
A more pertinent example would be to define a script parameter that holds certain
blocks in a problem and then use the list in a FOR-DO loop:
SET BLOCKLIST = [ F, \
C2S, \
CIN, \
CDEF, \
CVAP, \
CONDUA ]
FOR I IN &BLOCKLIST DO
REPORT BLOCK &I
ENDFOR
This will cause each block to be reported in the ordered set in the script
parameter.
A more complex example would be to create a list of script parameters and to
refer to them in a FOR-DO loop:
SET TEST1 = 100
SET TEST2 = 200
SET VARNAME = [ TEST1, TEST2 ]
FOR I IN &VARNAME DO
ECHO &&I
ENDFOR

2 OOMF Script Language Basics 39


Note the use of &&I to indicate a double parameter reference. This will result in
the following output:
100
200

Expressions and Conditionals


The scripting language has an ability to evaluate complex expressions.
Expressions can be used to set variable attributes, define an objective function,
set script parameters, etc.

Input Language
expression
(expression) # {uom}

Input Language Description


If you wish to assign units to an expression, enclose the expression in parenthesis
and use the pound sign # and the standard braces {} to enter the units.
The following is a list of the available functions that can be used in expressions:

Mathematical Functions:
+ Addition
- Subtraction
* Multiplication
/ Division
^ Power
ABS Absolute value
LOGE Natural logarithm
LOG10 Logarithm
COS Cosine
SIN Sine
TAN Tangent
EXP Exponentiation
SQRT Square root
INT Nearest integer

2 OOMF Script Language Basics 40


String Functions:
. String concatenation
STRING2ID Converts string to an ID
ID2STRING Converts ID to a string
TOUPPER Converts string to uppercase
TOLOWER Converts string to lowercase
LENGTH Length of string
SUBSTR Returns a substring from a given string. It may be used as
SUBSTR( string, position, length )
Or
SUBSTR( string, position )
string Source string.
position Starting position of returned substring. A position of 1 is the
first character. A negative value indicates a backwards count
from the end.
length Optional length. If omitted, the indicated position to the end
of the string is returned.
INDEX Returns the index of a substring within another string. A return value of zero
indicates that the substring was not found. It may be used as
INDEX( string, substring, position )
Or
INDEX( string, substring ).
string Source string.
substring Substring to search the string for.
position Optional starting location to begin search. If omitted, the
search begins at position 1. This must be positive.
INSERTSTR Inserts a substring into a string at the specified position.
INSERTSTR( string, substring, position )
string Source string.
substring Substring to insert.
position Position to insert substring. A position of 1 is the first
character. A negative value indicates a backwards count from
the end.
REMOVESTR Removes a substring of specified length from a string at a specified position.
REMOVESTR( string, position, length )
string Source string.
position Position to remove substring. A position of 1 is the first
character. A negative value indicates a backwards count from
the end.
length Length of substring to remove.

2 OOMF Script Language Basics 41


Relational Functions:
< Less than
<= Less than or equal to
= Equal to
<> Not equal to
> Greater than
>= Greater than or equal to

Logical Functions:
AND Logical AND
OR Logical OR
NOT Logical NOT

File Functions:
OPENFILE Redirects output to the specified ASCII file. To simply open the file, enter:
OPENFILE( "file" )
The name of the file is enclosed in double quotation marks. To open the file
with an option, enter:
OPENFILE( [ "file", option ] )
Note the use of the brackets. option is one of the following:
READ Open file for reading only.
WRITE Open file for writing only.
APPEND Open file for writing. Any data written will be appended to
the end of the file.
OPENBINARY Redirects output to the specified binary file. To simply open the file, enter:
OPENBINARY( "file" )
The name of the file is enclosed in double quotation marks. To open the file
with an option, enter:
OPENBINARY( [ "file", option ] )
Note the use of the brackets. option is one of the following:
BINARY_READ Open file for binary reading only.
BINARY_WRITE Open file for binary writing only.
BINARY_APPEND Open file for binary writing. Any data written will
be appended to the end of the file.
OPENTEE Redirects output to a series of destinations:
OPENTEE( [ list ] )
list is a comma-separated list of destinations enclosed in brackets. It may
include TERMINAL and OPENFILE.
DEVICEINFO Returns information about the specified device. This function should be used
in PRINT FORMATTED and IF-THEN-ELSE commands.

List Functions:
. Concatenate two lists
ELEM A specific element in a list.
Usage set Parameter_name = ELEM(&List_name, Location)
HEAD First element in a list
NUM Number of elements in a list.
REPLELEM Replace a specific element in a list
set New_List_name = REPLELEM(&List_name, Location, Value)
TAIL List with the first element removed

2 OOMF Script Language Basics 42


Query Functions:
BLOCKVARS Returns list of variables in the specified block
QUERYVARS Returns list of variables using the specified query string
ALIASBYVAR Returns list of aliases matching the specified variable. Wildcards
may be used for the variable name.
CONNECTIONSBYVAR Returns list of connections matching the specified variable.
Wildcards may be used for the variable name.
MEASUREMENTSBYVAR Returns list of measurement names (as
blockid.tagid_description) matching the specified variable.
Wildcards may be used for the variable name.
SPECGROUPSBYVAR Returns list of Specification Groups matching the specified
variable. Wildcards may be used for the variable name.

Miscellaneous Functions:
VAL Returns the value of the quantity, rather than a reference to the ID.
TYPEOF Returns the argument type.
DEFINED Logical function indicating if the parameter argument has been given value.

Examples of Math Functions


Lets set a parameter, called FLOW, to the value of a variable:
SET FLOW = C2S.BLK.DISTILLATE_MASS
We can use a simple mathematical expression in this statement:
SET FLOW = C2S.BLK.DISTILLATE_MASS + 5000. {KG/HR}
We can do likewise with variables:
C2S.BLK.DISTILLATE_MASS = C2S.BLK.DISTILLATE_MASS + 5000. {KG/HR}
Or even apply your own version of step bounds:
C2S.BLK.DISTILLATE_MASS.LOWER = C2S.BLK.DISTILLATE_MASS - 5000. {KG/HR}
C2S.BLK.DISTILLATE_MASS.UPPER = C2S.BLK.DISTILLATE_MASS + 5000. {KG/HR}

Examples of String Functions


Heres a common use of string concatenation to create a file name:
SET FILENAME = &PROBID . "_" . &MODE . "VBL"
SET REPORT_DEVICE = OPENFILE(&FILENAME)
PRINT VARIABLES
SET REPORT_DEVICE = TERMINAL
We could also do this with the TO option:
PRINT VARIABLES TO &PROBID . "_" . &MODE . "VBL"
If the problem ID is COLUMN and the mode is SIM, this will write all the variables
to file COLUMN_SIM.VBL. We can force the file name to lower case with:
PRINT VARIABLES TO TOLOWER( &PROBID . "_" . &MODE . "VBL" )

2 OOMF Script Language Basics 43


To construct an identifier from a string, we use the STRING2ID function. In the
following example, we make a parameter by concatenating two strings.
EO> STRING2ID("P" . "1") = 10
EO> ECHO &P1
10
We can build up this name from two script parameters:
EO> SET NAME = "P"
EO> SET NUM = "1"
EO> SET STRING2ID( &NAME . &NUM ) = 10.
EO> ECHO &P1
10 {*}
However, the scripting language will automatically perform the STRING2ID
function is some cases. So here, we can also write:
EO> SET NAME = "P"
EO> SET NUM = "1"
EO> SET &NAME&NUM = 10.
EO> ECHO &P1
10 {*}
Note that we do not put any blanks between the two parameter references.
We can also build the name from a parameter and another string:
EO> SET NAME = "P"
EO> SET &<NAME>1 = 10.
EO> ECHO &P1
10 {*}
Note that we place NAME in angled brackets (<>) to avoid ambiguity.
Here are some examples of the SUBSTR, INDEX and LENGTH functions.
EO> SET STR = "12345"
EO> SET STR1 = SUBSTR(&STR,2,2)
EO> ECHO &STR1
23
EO> SET STR2 = SUBSTR(&STR,-2,2)
EO> ECHO &STR2
45
EO> ECHO INDEX(&STR,&STR1)
2

2 OOMF Script Language Basics 44


EO> ECHO LENGTH(&STR)
5
Here is an example of INSERTSTR and REMOVESTR.
EO> SET STR1 = "12345"
EO> SET STR2 = "ABC"
EO> SET STR = INSERTSTR(&STR1,&STR2,2)
EO> ECHO &STR
1ABC2345
EO> SET STR = REMOVESTR(&STR,2,3)
EO> ECHO &STR
12345

Examples of Relational and Logical


Functions
Heres an example of a conditional in an IF-THEN-ELSE construct using the
relational operator for less than:
IF (C2S.BLK.TEMP_1 > 50 {F}) THEN
ECHO "TEMP TOO HIGH"
ELSE
ECHO "TEMP OK"
ENDIF
Note that it is necessary to enter the units of measure for the test temperature.
An example of the AND logical follows:
IF ( C2S.BLK.TEMP_1 < 0 {C} AND C2S.BLK.TEMP_1 > -50 {C} ) THEN
ECHO "TEMP OK"
ENDIF

2 OOMF Script Language Basics 45


Examples of File Functions
To change the report device to file COLUMN.REP we need to change the script
parameter REPORT_DEVICE and use the OPENFILE function:
SET REPORT_DEVICE = OPENFILE( "COLUMN.REP" )
To have the report sent to both the terminal and file COLUMN.REP we use the
OPENTEE function:
SET REPORT_DEVICE = OPENTEE( [ TERMINAL, OPENFILE( "COLUMN.REP" ) ] )
Note the use of the additional brackets.
To change the report device to file COLUMN.REP and open it with the appending
option enter:
SET REPORT_DEVICE = OPENFILE( [ "COLUMN.REP", APPEND ] )

Examples of List Functions


Script parameters can be set to lists of objects, such as blocks. Here is an
example of an interactive session and the use of the HEAD, TAIL and list
concatenation functions:
EO> SET LIST = [A, B, C]
EO> ECHO &LIST
[ A , B , C ]

EO> ECHO HEAD(&LIST)


A

EO> ECHO TAIL(&LIST)


[ B , C ]

EO> SET LIST = &LIST . [D]


EO> ECHO &LIST
[ A , B , C , D ]

2 OOMF Script Language Basics 46


Examples of Query Functions
These query functions can be used to return lists of variables or other objects. For
example, to get a list of variables in block C2S, enter:
SET VARLIST = BLOCKVARS( C2S )
You may use the QUERYVARS function to enter a query. For example, to get a
list of variables whose names begin with CVAP and whose values are less than
zero, you may enter:
SET VARLIST = QUERYVARS("NAME=CIN* AND VALUE<0")
The other query functions return lists of objects given the name of a variable. For
example, to get the measurements in block C2S enter:
SET VARLIST = MEASUREMENTSBYVAR( C2S.* )
Note that a wildcard may be used.

Examples of Miscellaneous Functions


You can set a script parameter to a variable with this command:
EO> SET VAR = C2S.D.STR.C2H6
EO> ECHO &VAR
0.0001 {UNITLES}
However, when you do this, it is the variable ID that is transferred to the script
parameter, not the value. So when you change the variable value, the script
parameter also changes. You can verify this with the TYPEOF function:
EO> C2S.D.STR.C2H6 = 0.0002
EO> ECHO &VAR
0.0002 {UNITLES}

EO> ECHO TYPEOF(&VAR)


VARIABLE
If this is not the desired effect, use the VAL function. This ensures that only the
value of the variable, not the ID, is transferred to the script parameter:
EO> SET VAR = VAL(C2S.D.STR.C2H6)
EO> ECHO &VAR
0.0001 {UNITLES}

2 OOMF Script Language Basics 47


EO> C2S.D.STR.C2H6 = 0.0002
EO> ECHO &VAR
0.0001 {UNITLES}

EO> ECHO TYPEOF(&VAR)


REAL

Examples of Effects of Units of Measure


Some care must be taken when computing expressions for values that have units
of measure. Consider this simple example below where we wish to compute the
sum of two flows, each in Kg/hr:
EO> SET FLOW = 30. + 15.
EO> ECHO &FLOW
45. {*}
In this case, parameter FLOW is unitless since we did not declare its units. So we
enter:
EO> SET FLOW = (30. + 15.) # {KG/HR}
EO> ECHO &FLOW
162000 {KG/HR}
In this case, the constants 30. and 15. were interpreted in SI units, Kg/sec. To
clarify, we enter:
EO> SET FLOW = 30.{KG/HR} + 15.{KG/HR}
EO> ECHO &FLOW
45. {KG/HR}
Here, the kernel assigned the units of Kg/hr. We can force a change in units with:
EO> SET FLOW = (30.{KG/HR} + 15.{KG/HR}) # {KG/SEC}
EO> ECHO &FLOW
0.0125 {KG/SEC}
This operation is a little more complex with temperatures and pressures because
of the presence of an offset in their units. In this case, it is not possible to add two
values in units of C. One must be in units of Delta-C:
EO> SET TEMP = 30.{C} + 15.{DELTA-C)
EO> ECHO &TEMP
45. {C}
Subtracting temperatures is allowed, the resulting value having units of Delta-C.
We can use this to compute an average of two temperatures:
EO> SET TEMP = 30.{C} + (30.{C} -15.{C)) / 2

2 OOMF Script Language Basics 48


EO> ECHO &TEMP
22.5 {C}
Units of measure can be removed if necessary by dividing by one unit as follows:
EO> SET TEMP = SQRT( C2S.BLK.TEMP_1 / 1.0 {K} )
EO> ECHO &TEMP
15.6191 {UNITLES}
Without the removal of the units of measure, the SQRT function would not work.

Examples Using String Functions to


Create Variable Names
A common use of script parameters is to use them in conjunction with the string
functions to create variable names so that many variable attributes can be
changed easily.
In this example, we use a FOR-DO loop to define a list of variable names. We
then use a PRINT FORMATTED command to write a table of these variable
attributes:
SET NAME = C2S.BLK.TEMP_
SET LIST = []
FOR I IN [ 1, 2, 60, 61, 99, 100 ] DO
SET LIST = &LIST . [ &NAME&I ]
ENDFOR

PRINT FORMATTED "\n"


PRINT FORMATTED " TRAY TEMPERATURES \n"
PRINT FORMATTED " ----------------- \n"
PRINT FORMATTED "Name Low Value Upper \n"
PRINT FORMATTED "---- --- ----- ----- \n"
SET FMT = "%-20s %-12.7g %-12.7g %-12.7g \n"
FOR VAR IN &LIST DO
PRINT FORMATTED &FMT , ID2STRING(&VAR), \
&VAR.LOWER, \
&VAR, \
&VAR.UPPER
ENDFOR

2 OOMF Script Language Basics 49


This script will give use the following output:
TRAY TEMPERATURES
---- ------------
Name Low Value Upper
---- --- ----- -----
C2S.BLK.TEMP_1 -1e+20 -29.19481 1e+20
C2S.BLK.TEMP_2 -150.7233 -28.29885 94.13006
C2S.BLK.TEMP_60 -148.3372 -23.87614 101.2884
C2S.BLK.TEMP_61 -148.3081 -23.85514 101.3758
C2S.BLK.TEMP_99 -139.0004 -5.433002 129.2988
C2S.BLK.TEMP_100 -1e+20 -5.228761 1e+20

Wildcards
There are two wildcard capabilities in OOMF: glob-style and regular expression
matching. The former is the simplest and meets most user needs. The latter is
more complex but is more powerful.

Glob-Style Wildcards
Glob-style wildcards are a simple way to refer to a group of objects so you can
access them in one statement, rather than having to repeat a similar command
again. Not all commands in the script language support glob wildcards.

Input Language Description


Glob wildcards use these special characters to provide the matching functions:
* Matches one or more characters
? Matches a single character

Regular Expression Matching


Regular expression matching is a powerful form of wildcards. It is mostly used to
refer to a group of variables so you can access their attributes in one statement,
rather than having to repeat a similar command again.
Although powerful, regular expression matching is rather complex.

2 OOMF Script Language Basics 50


Input Language Description
Regular expression matching uses special characters to provide the matching
functions. The string to be matched is enclosed in percent signs (%). Regular
expression matching processes the string enclosed in percent signs, searching for
these special characters:
. Matches any single character other than a new line.
* Matches zero or more of the character- or parenthesis-delimited group appearing
immediately to the left of the *.
+ Matches one or more of the character- or parenthesis-delimited group appearing
immediately to the left of the +. x+ is equivalent to xx*.
? This makes the character- or parenthesis-delimited group appearing immediately to
the left of the ? optional.
^ Matches the beginning of the string exactly as typed.
$ Matches the end of the string exactly as typed.
| Matches what appears to the left of the bar or the right of the bar. This operator has
the lowest preference.
() Used to indicate grouping and to override the normal precedence of operators.
Parentheses match no character themselves.
\ Used to take away the special treatment of a special character. \. Matches a period;
\| matches a bar character; \\ matches a backslash.
[] Used to define a set of characters. This will match a single character in the brackets.
The range [ab] will match a single a or b. The range [^ab] will match any character
other than a or b. You can indicate a group of characters using the hyphen. [a-z] will
match any character in the alphabet.

There is an implied wildcard at the beginning and end of the string in percent
signs. The ^ and $ special characters allow you to override this implied wildcard.
When using regular expression to match variable names, you must include the
entire variable name within the percent signs. That is, some parts of the variable
name cannot lie outside the percent signs. The attribute you are changing may lie
outside the percent signs.

Examples of Wildcards
To enter a lower limit of zero for all flows in the flowsheet with glob style
wildcards enter:
*.FLOW.LOWER = 0.0 {KMOL/HR}
To enter a lower limit of zero for all the flows in block C2S:
C2S.*.FLOW.LOWER = 0.0 {KMOL/HR}
Consider the following regular expression:
%FLOW\.LOWER% = 0.0
In simple wildcard jargon, this is equivalent to
*FLOW.LOWER* = 0.0
This is because of the implied wildcard of the percent signs. This would place
lower bounds on all variables that have FLOW in them, i.e., both mass and molar
flows. Note the use of the \ to treat the . as a literal. We do not enter the units of
measure so that we apply the zero as Kmol/Hr for mole flows and Kg/Hr for mass
flows.

2 OOMF Script Language Basics 51


If we write
%\.FLOW\.LOWER% = 0.0 {KMOL/HR}
This is equivalent to
*.FLOW.LOWER* = 0.0 {KMOL/HR}
In this case the \ makes the . a literal character. Thus, we only change mole flows
and we can enter the units if we want to. Entering
%.FLOW\.LOWER% = 0.0 {KMOL/HR}
is equivalent to
%FLOW\.LOWER% = 0.0 {KMOL/HR}
because the . is a single-character wildcard and the beginning of the string is a
multicharacter wildcard.
If we wanted to access only stream component molar flows, we enter:
%STR\..*\.FLOW\.LOWER% = 0.0 {KMOL/HR}
This is equivalent to:
*STR.*.FLOW.LOWER* = 0.0 {KMOL/HR}
If we wish to change the lower bounds on all the molar flows in unit C2S, we
enter:
%^C2S\..*\.FLOW\.LOWER% = 0.0 {KMOL/HR}
Note that we must put the unit name inside the percent signs. We must use the ^
to remove the implied wildcard at the beginning of the string. We use the \. three
times to treat the . as a literal. Finally, the .* acts as a multicharacter wildcard. So
this is equivalent to:
C2S.*.FLOW.LOWER* = 0.0 {KMOL/HR}
We can use the $ character to suppress the implied wildcard at the end of the
string. Consider:
%^C2S\..*\.FLOW\.LOWER$% = 0.0 {KMOL/HR}
This is equivalent to
C2S.*.FLOW.LOWER = 0.0 {KMOL/HR}
Lets look at an example of using the [] characters:
%^C2S[BD]DEF\..*\.FLOW.LOWER$% = 0.0 {KMOL/HR}
This is equivalent to:
C2SBDEF.*.FLOW.LOWER = 0.0 {KMOL/HR}
C2SDDEF.*.FLOW.LOWER = 0.0 {KMOL/HR}
The [BD] acts as an OR function on the characters B and D.
Finally, here is an even more complex example:
%^C2S([BD]DEF)?\..*\.FLOW.LOWER$% = 0.0 {KMOL/HR}
The ()? Indicates that everything in the parenthesis is optional. So this is
equivalent to:

2 OOMF Script Language Basics 52


C2S.*.FLOW.LOWER = 0.0 {KMOL/HR}
C2SBDEF.*.FLOW.LOWER = 0.0 {KMOL/HR}
C2SDDEF.*.FLOW.LOWER = 0.0 {KMOL/HR}

General Commands
These general commands include a powerful help facility, a timer for tracking
execution times and other useful functions.

Getting Help
This command provides on-line help.

Input Language
HELP command

Input Language Description


command Name of command to get help on. If a keyword is entered, a list of all
commands containing that keyword is printed. If no command is entered,
then a summary of all the commands is printed as shown at the beginning of
this chapter.

Exiting the System


These commands are used to leave the EO strategy in an IAP session and return
to the A+ prompt. They have no effect while in the Aspen Plus user interface.

Input Language
QUIT
EXIT

Executing System Commands


This command allows you to enter an operating system command when you are in
OOMF. Note that the command is enclosed in double quotation marks.

Input Language
SYSTEM " command "

2 OOMF Script Language Basics 53


Timer
A timer that tracks CPU usage is available.

Input Language
START TIMER
STOP TIMER
RESTART TIMER
PRINT TIMER

Input Language Description


START TIMER Starts the timer at zero.
STOP TIMER Stops the timer.
RESTART TIMER Restarts the timer at the current value.
PRINT TIMER Prints the timer to the report device.

OOMF Model Adapters


OOMF loadable models are compiled and placed into a DLL library. Various types
of models may be loaded into OOMF by writing model adapters. For example,
Models exported from Aspen Custom Modeler may be loaded into OOMF using
the OOMF loadable DLL named acmexp.
Aspen Plus equation oriented models may be loaded into OOMF using the
OOMF loadable DLLs named rtoblk and pmlbridge.
Aspen RefSYS reactor models may be loaded into OOMF using OOMF loadable
DLLs named usrdmo and refpmlbridge.
The example model called pltcon that is delivered with OOMF may be loaded
into OOMF using the OOMF loadable DLL named pltcon.
Custom user models written in C++ or other programming languages may be
loaded into OOMF using the OOMF loadable DLL named CMF. Aspen PIMS and
Aspen Advisor models are loaded into OOMF via CMF.
The appropriate library is loaded to instantiate these models in OOMF. The
following commands are used to load, unload, and inquire about these libraries.

Input Language
IDENTIFY LIBRARY dll_name
LOAD LIBRARY dll_name
UNLOAD LIBRARY dll_name

Input Language Description


IDENTIFY LIBRARY Returns the version number of the specified DLL
LOAD LIBRARY Loads the specified DLL
UNLOAD LIBRARY Unloads a previously loaded DLL

2 OOMF Script Language Basics 54


3 Hierarchies, Blocks,
Variables, and Equations

This chapter describes the OOMF Script commands used to manipulate


hierarchies, blocks, variables, and equations.

3 Hierarchies, Blocks, Variables, and Equations 55


Hierarchies
Hierarchies are blocks that are used to contain parts of a flowsheet. This allows
you to organize your flowsheet into manageable sections that may be solved
separately.
See Also
Aspen Plus Extensions - Hierarchies

What are Hierarchies?


Hierarchies are convenient ways of organizing very large flowsheets or creating
large flowsheets from a collection of smaller flowsheets.
A hierarchy is a collection of blocks that are treated as a single block. The names
of all the variables and equations within the hierarchy have their names prefixed
with the hierarchy name. For example, if you have a variable named
C2S.BLK.TEMP_1 and this block is placed in a hierarchy called T1, then the new
name will be T1.C2S.BLK.TEMP_1.
The hierarchy becomes a simple way of grouping blocks together. This makes it
easy to exclude a group of blocks from a flowsheet with a single command.
Hierarchies may contain other hierarchies.

How are Hierarchies Created?


Hierarchies are usually created through the product such as Aspen Pluss user
interface or input language by placing a hierarchy block onto the flowsheet.
See Also
Aspen Plus Extensions - Hierarchies
If you are using standalone OOMF, then a hierarchy may be created by invoking
the following set of commands in a script file:
load lib "pltcon"
set num_blocks_in_hierachy = 2
DEFINE SUPERPLANT small_hierarchy
METHOD setup BEGIN
BLOCKS NONE
SET small_group_iter = 1
WHILE (&small_group_iter <= &num_blocks_in_hierachy) DO
echo "add block pltcon"
ADD BLOCK b&small_group_iter AS pltcon
SET small_group_iter = &small_group_iter + 1
ENDWHILE

3 Hierarchies, Blocks, Variables, and Equations 56


END setup

METHOD alias BEGIN


ALIAS [ key_var, b1.blk.var_150 ]
END alias

METHOD connect BEGIN


CONNECTIONS NONE
SET small_group_iter = 1
WHILE (&small_group_iter < &num_blocks_in_hierachy) DO
SET small_group_iter_next = &small_group_iter + 1
echo "add conn"
ADD CONNECTION [ b&small_group_iter.blk.var_1 , \
b&small_group_iter_next.blk.var_1 ]
SET small_group_iter = &small_group_iter_next
ENDWHILE
END connect

METHOD measurement BEGIN


MEASURE key_var
END measurement

METHOD setvar BEGIN


key_var.sbweight = 1.5e5 {*}
key_var.step = 150.0 {*}
END setvar
END small_hierarchy
add block C2HIER as small_hierarchy

Hierarchy Input
Hierarchies have sets of input that are similar to what can be defined for an entire
flowsheet.
In standalone OOMF the inputs include:
Streams.
Blocks.
Convergence options, such as solver parameters.

3 Hierarchies, Blocks, Variables, and Equations 57


Flowsheeting Options, such as measurement blocks.
Objective functions, Spec Groups, and Connections.
The type of input that may be entered for an EO configuration item is limited by
the scope.
See Also
Aspen Plus Extensions - Hierarchies

What is the Scope?


When a flowsheet contains a collection of hierarchies, a tree structure similar to a
conventional directory structure is used to organize the hierarchies. The scope
determines what parts of the tree are visible at any given time. You may use the
scope combo box on the Control Panel or the SCOPE commands to move around
this tree. For example, what you see when you execute PRINT BLOCK
STATISTICS will depend upon the current scope. See also Defining the Scope,
Printing the Block Hierarchy, and Finding a Block
At the top of the tree, when the scope is the CONTROLLING KERNEL, the entire
problem is visible to the kernel. At this level, hierarchies appear as single blocks.
When you move down the tree into a hierarchy by pushing the scope, the scope
becomes the name of the hierarchy. At this scope, all the blocks within the
hierarchy, the user connections and the measurements become visible.
Understanding how the scope works is very important. Consider the example
shown below:

Flowsheet Level

S1 S2

B1 B2 B3 S3 B6

B4 B5

The flowsheet consists of two hierarchies S1 and S2. Hierarchy S1 is made up of


blocks B1, B2 and B3. Hierarchy S2 is made up of block B6 and hierarchy S3,
which is in turn made up of blocks B4 and B5.

3 Hierarchies, Blocks, Variables, and Equations 58


When the scope is at the controlling kernel, we can only see hierarchies S1 and
S2. If you push the scope into S1, you can see blocks B1, B2 and B3.
EO input attached to any block or hierarchy is limited to the scope of the block to
which it is attached. For example, to make a user connection between block B6
and B3, you must do it in hierarchy PLANT. You cannot define the connection in
hierarchy S1, since block B6 is outside its scope. Nor can you define it in hierarchy
S2, since block B1 is outside of its scope. If you wish to connect blocks B2 and B3,
you can do so in hierarchy S1 or at the flowsheet level.

How Hierarchies are Built


The lowest level hierarchy blocks are completely constructed first, followed by the
next higher level. In other words, the tree structure is built up from the bottom to
the top.
Each hierarchy is built in this order:
Blocks are instantiated. As each block is instantiated, the following is
executed:
INIT scripts are invoked.
EO Input form is executed.
The flowsheet level EO Input is executed.
Measurements are instantiated.
Spec Groups are processed.
Product specific stream connections are built.
User connections are built.
Measurement connections are built.
Only after each hierarchy is completely built is execution passed to the next
hierarchy.

Defining the Scope


The scope determines what blocks are visible. The problem may be thought of as
a tree structure, not unlike a directory. By moving up and down the tree, that is,
by changing the scope, different parts of the problem become visible. At the top of
the tree, when the scope is the CONTROLLING KERNEL, the entire problem is
visible to the kernel. At this level, hierarchies appear as single blocks. When you
move down the tree into a hierarchy, the scope becomes the name of the
hierarchy and all the blocks within the hierarchy become visible. You can view the
layout of all the blocks in the flowsheet with the PRINT BLOCK HIERARCHY
command.
A note of caution: if you use these scope commands from within products that
embed OOMF, you may get into situations where OOMF is out of sync with that
products user interface. Therefore, care should be exercised when using these
commands in the products user interface.

Input Language
PUSH SCOPE blockid
CHANGE SCOPE blockid

3 Hierarchies, Blocks, Variables, and Equations 59


POP SCOPE
RESET SCOPE
PRINT SCOPE

Input Language Description


PUSH SCOPE Pushes the scope down the tree into the specified hierarchy.
CHANGE Resets the scope and then pushes the scope down the tree into the specified
SCOPE hierarchy.
POP SCOPE Pops the scope up the tree one level.
RESET SCOPE Pops the scope up to the top of the tree.
PRINT SCOPE Prints the current scope.

Printing the Block Hierarchy


This command is used to print the complete block hierarchy for the flowsheet from
the current scope on downward. This is useful to locate the position of a block in a
complex flowsheet structure.

Input Language
PRINT BLOCK HIERARCHY

Finding a Block
This command is used to find a block within a flowsheet. It searches within the
current scope and, if the block is not found, continues the search from the global
scope.

Input Language
FIND BLOCK blockid

Input Language Description


blockid Name of block to find.

Solving at a Scope
A scope may be solved separately from the rest of the flowsheet. This may be
done by changing the scope to the desired level, which may be done through the
products user interface or with the PUSH SCOPE command. The scope may then
be solved either through the products user interface or with the SOLVE
command.
A complication arises when connections and specification groups cross the scope
boundary. When this occurs, the scope may be non-square. (You may use the
ANALYZE DOF command to check.) Specification Management automatically
inactivates these objects when the SOLVE is executed. This keeps the problem
well defined at any scope level. It is therefore very straightforward to solve your
problem at any scope.
The inactivation of these objects occurs at the instant the SOLVE command is
issued and reactivated immediately afterwards. Therefore, when you examine

3 Hierarchies, Blocks, Variables, and Equations 60


your reduced scope problem, what you see is not what the solver is seeing. You
may use the TOGGLE SOLVE SCOPE command to inactivate any connections and
specification groups that cross the scope boundary. If you issue the command
again, the connections and specification groups are re-activated.

Input Language
TOGGLE SOLVE SCOPE

Examples of Hierarchy
The following interactive session shows a flowsheet with two hierarchies called
C2HIER and C3HIER and a normal block. First, the block statistics are printed and
the hierarchies appear as any other block. When the scope is pushed into one of
the hierarchies, the blocks within the hierarchy appear. Within the hierarchy the
problem is non-square due to streams, connections and specification groups that
cross the hierarchy boundary. When the TOGGLE SOLVE SCOPE command is
issued the problem becomes square. The SOLVE command solves the reduced
scope problem.
EO> PRINT BLOCK STATISTICS
---Block-- -Nvar- -Neqn- -Nfix- Nexcld -Ndof- NfreeI --Nnz- --Nz%-
C2HIER 1369 1324 24 0 0 7 6808 0.38
C3HIER 79 64 7 0 0 1 183 4
CONDUA 12 5 3 0 0 0 15 33
---------- ------ ------ ------ ------ ------ ------ ------ ------
Total 1460 1393 34 0 0 8 7006
EO> PUSH SCOPE C3HIER
EO> PRINT BLOCK STATISTICS
---Block-- -Nvar- -Neqn- -Nfix- Nexcld -Ndof- NfreeI --Nnz- --Nz%-
CVAP 41 33 3 0 0 1 96 7.7
CIN 35 30 3 0 0 0 85 8.9
C3MEAS 3 1 1 0 0 0 2 1e+002
---------- ------ ------ ------ ------ ------ ------ ------ ------
Total 79 64 7 0 0 1 183
EO> ANALYZE DOF
Problem has 1 degrees of freedom
EO> TOGGLE SOLVE SCOPE
EO> ANALYZE DOF
Problem is square
EO> SOLVE

3 Hierarchies, Blocks, Variables, and Equations 61


Residual Objective Objective Overall Model
Convergence Convergence Function Nonlinearity Nonlinearity Worst
Iteration Function Function Value Ratio Ratio Model
--------- ----------- ----------- ---------- ------------ ------------ --------
0 2.834D-01 0.000D+00 0.000D+00 1.000D+00 1.000D+00 CVAP
1 4.147D-06 0.000D+00 0.000D+00 1.000D+00 1.000D+00 CVAP
2 0.000D+00 0.000D+00 0.000D+00

Successful solution.

Optimization Timing Statistics Time Percent


================================ ======== =======

MODEL computations 0.02 secs 12.50 %


DMO computations 0.00 secs 0.00 %
Miscellaneous 0.14 secs 87.50 %
-------------------------------- --------- -------
Total Optimization Time 0.16 secs 100.00 %

Problem converged
EO> ANALYZE DOF
Problem is square
EO> TOGGLE SOLVE SCOPE
EO> ANALYZE DOF
Problem has 1 degrees of freedom
EO> RESET SCOPE
EO> ANALYZE DOF
Problem is square
EO>

3 Hierarchies, Blocks, Variables, and Equations 62


Block Commands
The block commands are used to control the blocks that are to be included in the
OOMF solution.

Listing Blocks
This command is used to show the list of instantiated blocks in the current scope.

Input Language
BLOCKS

Excluding Blocks
These commands can be used to exclude blocks from the problem. Excluding a
block removes all its equations and variables from the flowsheet.
When a block is excluded, Spec Management automatically reprocesses all the
Connections and Spec Groups to ensure that the problem remains square.
Connections and Spec Groups that contain references to the excluded block
become Inactive. (The Status on the GUI is not updated until an Incremental Build
or Solve is performed.) Variables that are connected from an excluded block
return to their pre-connected specifications, usually Constant.
When a block is excluded, it still appears in the list of blocks. If you display the
block with PRINT BLOCK STATISTICS, the block name will appear in
parentheses. Equation residuals and Jacobian values are not calculated for
excluded blocks.

Input Language
EXCLUDE BLOCKS block_list

Input Language Description


block_list Comma-separated list of the blocks to exclude.

Including Blocks
This command can be used to include blocks that have been previously excluded.
This procedure works in a similar manner to the EXCLUDE BLOCKS command
(see previous section).

Input Language
INCLUDE BLOCKS block_list

Input Language Description


block_list Comma-separated list of the blocks to include.

3 Hierarchies, Blocks, Variables, and Equations 63


Listing Block Scripts
This command can be used to create a tree-structured list of all the script
methods that are attached to the specified blocks.

Input Language
BLOCK SCRIPTS block_list

Input Language Description


block_list Comma-separated list of the blocks whose script methods are to be
printed to the report device. If no list is entered, then the list is
produced for all the blocks.

Printing Block Convergence


This command is used to print the norm of the residuals for the specified blocks.

Input Language
PRINT BLOCK CONVERGENCE block_list

Input Language Description


block_list Comma-separated list of blocks to print. If not entered, all blocks
are printed.

Printing Block Statistics


Prints summary information for the indicated blocks. These include the number of
variables, the number of equations, the number of fixed variables, the number of
excluded equations, the number of degrees of freedom, the number of
independent variables, the number of nonzero Jacobian elements and the Jacobian
matrix density.

Input Language
PRINT BLOCK STATISTICS block_list
PRINT BLOCK STATISTICS FULL block_list

Input Language Description


block_list Comma-separated list of blocks to print. If not entered, all
blocks are printed.

PRINT BLOCK STATISTICS FULL also includes the starting indices of the
variables, equations and non-zeroes for each block. A description of each column
heading follows:
Column Description
Block Name of block. Excluded blocks appear in parenthesis.
Nvar Number of variables. Excluded blocks have zero variables.
Neqn Number of equations.
Nfix Number of fixed variables in the current mode.
Nexcld Number of excluded equations.

3 Hierarchies, Blocks, Variables, and Equations 64


Column Description
Ndof Number of degrees of freedom. If positive, the block is underspecified; if negative,
the block is overspecified. This includes declared degrees of freedom variables with
specifications of OPTIM, RECON and INDEP.
NfreeI Number of variables that were freed as a result of stream connection equations.
Nnz Number of non-zeroes. Excluded blocks have no non-zeroes.
Nnz% Density of non-zeroes in the Jacobian.

Changing Block Attributes


Block attributes may be changed with this command. Block attributes may be
viewed either with the PRINT BLOCK ATTRIBUTES command or the ECHO
command.

Input Language
blockid.attribute = value

Input Language Description


blockid Name of the block.
attribute Attribute to be changed.
value Value of the attribute.

Block Attributes
INCLUDED Flag indicting if the block is in the included state.
NLRATIODEV Allowable deviation of the blocks non-linearity ratio when using Schubert
updating. If the non-linearity ratio is greater than this value, the blocks
Jacobian is re-computed. (default = 0.01)
DERIV_METHOD Derivative method.
ANALYTIC Derivatives are set by the model subroutine.
NUMERIC Derivatives are computed numerically. The perturbation size
may be specified with the PERT block attribute.
PERT Perturbation size to use for the computation of numerical derivatives for the
specified block. (default = 1.0E-6).
ZEROTOL Zero tolerance for numeric sparsity detection. (default = 1.0D-12)
MOVE Flag indicating if variables with zero value should be moved during numeric
sparsity detection. (default = TRUE)
MOVEAMOUNT Amount to move variables with zero value during numeric sparsity detection.
(default = 0.01)

Printing Block Attributes


Prints a list of all the block attributes.

Input Language
PRINT BLOCK ATTRIBUTES block_list

Input Language Description


block_list Comma-separated list of blocks to print. If not entered, the
attributes of all blocks are printed.

3 Hierarchies, Blocks, Variables, and Equations 65


Example of Block Commands
In the following example, we print the list of blocks, then exclude a block and
print the list again. In this example, there is a Spec Group, C3RVFRAC, which has
a spec change between the excluded block, CVAP, and another block, C2MEAS.
When the block is excluded, the size of the problem is reduced. Also, the excluded
block caused the Spec Group C3RVFRAC to become inactive, leaving the problem
square.
EO> PRINT BLOCK STAT
---Block-- -Nvar- -Neqn- -Nfix- Nexcld -Ndof- NfreeI --Nnz- --Nz%-
C2S 1256 1244 5 0 0 7 6560 0.42
DDEF 45 36 2 0 0 0 131 8.5
CVAP 41 33 2 0 -1 1 97 7.5
CONDUA 12 5 2 0 0 0 16 32
CIN 35 30 4 0 0 0 72 7.7
F 41 35 4 0 0 0 104 8
C2MEAS 24 8 12 0 1 0 12 13
---------- ------ ------ ------ ------ ------ ------ ------ ------
Total 1454 1391 31 0 0 8 6992

EO> PRINT SPEC GROUP C3RVFRAC


<< Specification group C3RVFRAC, enabled, and active >>
[CVAP.BLK.COUT_VAPOR_FRACTION,Const]
[C2MEAS.BLK.C3R_PLANT,Meas]
[C2MEAS.BLK.C3R_OFFSET,Param]
1 specification group found.

3 Hierarchies, Blocks, Variables, and Equations 66


EO> EXCLUDE BLOCK CVAP

EO> PRINT BLOCK STAT


---Block-- -Nvar- -Neqn- -Nfix- Nexcld -Ndof- NfreeI --Nnz- --Nz%-
C2S 1256 1244 5 0 0 7 6560 0.42
DDEF 45 36 2 0 0 0 131 8.5
(CVAP ) 0 33 0 33 0 0 0 0
CONDUA 12 5 4 0 0 0 12 30
CIN 35 30 4 0 0 0 72 7.7
F 41 35 4 0 0 0 104 8
C2MEAS 24 8 13 0 0 0 11 13
---------- ------ ------ ------ ------ ------ ------ ------ ------
Total 1413 1391 32 33 0 7 6890

EO> PRINT SPEC GROUP C3RVFRAC


<< Specification group C3RVFRAC, enabled, and inactive >>
[CVAP.BLK.COUT_VAPOR_FRACTION,Const]
[C2MEAS.BLK.C3R_PLANT,Meas]
[C2MEAS.BLK.C3R_OFFSET,Param]
1 specification group found.

3 Hierarchies, Blocks, Variables, and Equations 67


Variable Commands
These commands may be used to change and print variable attributes.

Variable Attributes
The following table shows the variable attributes along with allowable values.
Attribute Description
NAME Name.
VALUE Value. (also VAL, VALUES)
INITIAL Initial value.
CHANGE Change in value. If a value is entered for this attribute, the INIT
attribute is also changed automatically.
LOWER Lower bound. (also LB)
UPPER Upper bound. (also UB)
STEP Step bound (also SB)
BOUND Bound type:
HARD Hard bound.
RELAXED Relaxed bound.
SOFT Soft bound. If the initial value of the variable is outside its
bounds, the appropriate variable bound is relaxed to this
initial value.
SOFT2 Special case of the soft bound that allows the variable
value to vary between -1e+35 and 1e+35. The UPPER and
LOWER attributes are ignored.
SBWEIGHT Soft bound weight.
SCALE Scale factor.
INTSCALE Internal scale factor.
RLOWER Resolved lower bound.
RUPPER Resolved upper bound.
PHYSICAL_TYPE Physical type. Changing the physical type is not recommended, but
when you do so, use a string such as PDROP.
In PRINT commands, this is an integer value corresponding to the
physical type. See the section 10 Units of Measure and Physical Types
for options and integer values.
UNITS Units of measure string.
SPEC The specification of the variable. (also SPECS) This is a string that sets
the specification in each mode. See table below.
During the run of any particular mode, only the specification for that
mode is known to the OOMF system.
SSPEC Specification in the current mode
SHADOW_PRICE Shadow price (also SP)
ACTIVE_BOUND Active bound (also AB)

3 Hierarchies, Blocks, Variables, and Equations 68


Attribute Description
QUALITY Quality of variable value:
GOOD The quality of the measured or parameterized
variable is good.
BAD The quality of the measured variable is bad.
OVERRIDE The quality of the parameterized variable is to be
overridden.
BADIGNORE The quality of the measured variable is bad but it
may be ignored.
BASEUOM Internal units of measure (string). Changing this attribute is not
recommended.

Specifications in Each Mode


SPEC SIM PAR REC OPT
CONST Fixed Fixed Fixed Fixed
CALC Free Free Free Free
MEAS Free Fixed Fixed Free
PARAM Fixed Free Free Fixed
OPTIM Fixed Fixed Fixed DOF
RECON Fixed Fixed DOF Fixed
INDEP Fixed Fixed DOF DOF

Changing Variable Attributes


These commands are used to change variable attributes such as the initial value,
the bounds and the specification.

Input Language
variableid.attribute = value
aliasid.attribute = value
...

Input Language Description


Variable attributes can be changed by referring to the variable by name or its alias
along with its attribute. If the attribute is omitted, the VALUE is changed. The
changeable attributes are:
VALUE INITIAL CHANGE LOWER
UPPER STEP BOUND SBWEIGHT
SPEC UNITS SCALE PHYSICAL_TYPE
QUALITY BASEUOM

When a value is entered, you may also enter the units of measure enclosed in
braces, {}. If no units of measure are entered, the value is assumed to be in the
units of measure of the variable. This functionality can be controlled by the script
parameter CHECK_UOM. When CHECK_UOM is FALSE (the default), the units of
measure may be omitted. When CHECK_UOM is TRUE, the units of measure
must be entered with every value.

3 Hierarchies, Blocks, Variables, and Equations 69


Printing Variables
Prints to the report device selected information about the listed variables.
The set of attributes to print for each variable is determined by the variable
masking, which is a list of variable attributes enclosed by parentheses.
For PRINT VARIABLES, values are given in the variables units of measure; for
PRINT VARIABLES SSI, values are given in scaled SI units.
The list of variables can be specified by variable index, variable name or a list of
block names.
The format of the output is affected by script parameter NAME_WIDTH.

Input Language
PRINT VARIABLES [ vmask ], list
PRINT VARIABLES SSI [ vmask ], list

Input Language Description


vmask Optional list of variable attributes to print, separated by commas. Note that this list is
enclosed in brackets.
If no list is given, then the script parameter PRINT_VAR_MASK is used as the list of
attributes to print. This default list includes the name, lower, value, upper, units and
specification.
list A comma separated list of block names, variable names, stream names or variable
indices. If omitted, all variables are printed. A range of indices may be printed by
using a colon with spaces on either side ( : ) between the indices.

These attributes can be printed:


VALUE INITIAL CHANGE LOWER
UPPER STEP BOUND SBWEIGHT
SPEC UNITS SCALE PHYSICAL_TYPE
QUALITY BASEUOM SHADOW_PRICE ACTIVE_BOUND
NAME

Printing Variables Fixed in the Current


Mode
This command prints the variables that are fixed in the current mode to the report
device.
The set of attributes to print for each variable is determined by the variable
masking, which is a list of variable attributes enclosed by parentheses.
Numerical values are given in the variables units of measure.
The list of variables can be specified by variable index, variable name or a list of
block names.
The format of the output is affected by script parameters NAME_WIDTH and
UOM_WIDTH.

Input Language
PRINT FIXED [ vmask ], list

3 Hierarchies, Blocks, Variables, and Equations 70


Input Language Description
vmask Optional list of variable attributes to print. This list is separated by spaces and
enclosed in brackets.
If no list is given, then the script parameter PRINT_VAR_MASK is used as the list of
attributes to print. This default list includes the name, lower, value, upper, units and
specification.
list A comma separated list of block names, variable names, stream names or variable
indices. If omitted, all variables are printed.

These attributes can be printed:


VALUE INITIAL CHANGE LOWER
UPPER STEP BOUND SBWEIGHT
SPEC UNITS SCALE PHYSICAL_TYPE
QUALITY BASEUOM SHADOW_PRICE ACTIVE_BOUND
NAME

Printing Variables Fixed in Other Modes


The PRINT SPECIFICATIONS command is used to search for variables whose
specifications are not CALC. The values for these variables are printed to the
report device.

Input Language
PRINT SPECIFICATIONS block_list

Input Language Description


block_list A comma separated list of block names. If omitted, all blocks are scanned.

Printing Variables with Active Bounds


Prints to the report device selected information about variables with active
bounds. This is particularly useful after an optimization solution to determine the
active bound set.
The set of attributes to print for each variable is determined by the variable
masking, which is a list of variable attributes enclosed by parentheses.
For PRINT ACTIVE_BOUNDS, values are given in the variables units of
measure; for PRINT ACTIVE_BOUNDS SSI, values are given in scaled SI units.
The list of variables can be specified by variable index, variable name or a list of
block names.
The format of the output is affected by script parameters NAME_WIDTH and
UOM_WIDTH.

Input Language
PRINT ACTIVE_BOUNDS [ vmask ], list
PRINT ACTIVE_BOUNDS SSI [ vmask ], list

3 Hierarchies, Blocks, Variables, and Equations 71


Input Language Description
vmask Optional list of variable attributes to print, separated by commas. Note that this list is
enclosed in brackets.
If no list is given, then the script parameter PRINT_VAR_MASK is used as the list of
attributes to print. This default list includes the name, lower, value, upper, units and
specification.
list A comma separated list of block names, variable names, stream names or variable
indices. If omitted, all variables are printed. A range of indices may be printed by
using a colon with spaces on either side ( : ) between the indices.

These attributes can be printed:


VALUE INITIAL CHANGE LOWER
UPPER STEP BOUND SBWEIGHT
SPEC UNITS SCALE PHYSICAL_TYPE
QUALITY BASEUOM SHADOW_PRICE ACTIVE_BOUND
NAME

Printing Largest Variable Shadow Prices


This command prints the largest variable shadow prices (in decreasing magnitude)
to the report device. These may be listed in user units or scaled SI units. Only
variables that are fixed or are at an active bound will have non-zero shadow
prices.
The variable shadow prices are not calculated by this command. This should be
done with a SOLVE command. (The EVALUATE RESIDUALS command will not
compute the shadow prices.)
The list of variables can be specified by variable index, variable name or a list of
block names.
The format of the output is affected by script parameters NAME_WIDTH and
UOM_WIDTH.

Input Language
PRINT LARGEST VARIABLE SHADOW_PRICES integer, list
PRINT LARGEST VARIABLE SHADOW_PRICES SSI integer, list

Input Language Description


integer Optional length of largest shadow price list (default = 10)
list A comma separated list of block names, variable names, stream names or variable
indices. If omitted, all variables are searched. A range of indices may be printed by
using a colon with spaces on either side ( : ) between the indices.

3 Hierarchies, Blocks, Variables, and Equations 72


Printing Variables Using a Query
Prints to the report device selected information about variables using a query
string.
The set of attributes to print for each variable is determined by the variable
masking, which is a list of variable attributes enclosed by parentheses.
The format of the output is affected by script parameters NAME_WIDTH and
UOM_WIDTH.

Input Language
PRINT QUERY [ vmask ], block_list, query

Input Language Description


vmask Optional list of variable attributes to print, separated by commas. Note that this list
is enclosed in brackets.
If no list is given, then the script parameter PRINT_VAR_MASK is used as the list
of attributes to print. This default list includes the name, lower, value, upper, units
and specification.
block_list A comma separated list of block names. If omitted, all blocks are queried.
query A string containing the query enclosed in double quotation marks. Usually of the
form: "attribute = value"

These attributes can be printed by PRINT QUERY:


VALUE INITIAL CHANGE LOWER
UPPER STEP BOUND SBWEIGHT
SPEC UNITS SCALE PHYSICAL_TYPE
QUALITY BASEUOM SHADOW_PRICE ACTIVE_BOUND
NAME

These attributes can be appear in the query of PRINT QUERY:


VALUE INITIAL CHANGE LOWER
UPPER STEP BOUND SBWEIGHT
SPEC UNITS SCALE PHYSICAL_TYPE
QUALITY BASEUOM SHADOW_PRICE ACTIVE_BOUND
NAME

The query can also use logical operands:


AND Logical and operator
OR Logical or operator
NOT Logical not operator

Other functions are also available:


INOBJECTIVE() Indicates whether the variable is in the specified objective function.
ISMODIFIED() Indicates whether the specified attribute has been modified. The
attribute may be one of VALUE, SPEC, LOWER, UPPER, STEP,
SCALE, SBWEIGHT and BOUND.

3 Hierarchies, Blocks, Variables, and Equations 73


Examples of Variable Commands
To set the lower bound of variable C2S.BLK.TEMP_10 to -50C:
C2S.BLK.TEMP_10.LOWER = -50. {C}
Note: The equal sign is surrounded by blanks.

To make variable C2S.D.STR.C2H6 an independent and provide an initial value


and bounds, enter:
C2SD.D.STR.C2H6 = 0.0001
C2SD.D.STR.C2H6.LOWER = 0.00001
C2SD.D.STR.C2H6.UPPER = 0.0002
C2SD.D.STR.C2H6.SPEC = INDEP
To print the variables in block C2S enter:
PRINT VARIABLES C2S
To print only the value and specification attributes, enter:
PRINT VARIABLES [VALUE, SPEC], C2S
To print the values of the fixed variables in this block, enter:
PRINT SPECIFICATIONS [VALUE], C2S
To print the variables in stream F in block C2S enter:
PRINT VARIABLES C2S.F.STR
To print the variables with indices 30 to 40 enter:
PRINT VARIABLES 30 : 40
Note: The colon is surrounded by blanks.

To print the variables with specification of Optimized enter:


PRINT QUERY "SPEC = OPTIM"
To print the variables with specification of Optimized or which are in objective
function PROFIT enter:
PRINT QUERY "SPEC = OPTIM OR INOBJECTIVE(PROFIT)"

3 Hierarchies, Blocks, Variables, and Equations 74


Alias Commands
Aliases are user-defined alternate names for variables. The alias may be used to
refer to a variable in other script language commands. This is useful to avoid
typing long variable names.

Printing Aliases
This command lists the alias definitions for the current scope.

Input Language
ALIAS

Printing Alias Values


Prints a list of alias values to the report device.
The set of attributes to print for each alias is determined by the variable masking,
which is a list of variable attributes enclosed by parentheses.
Numerical values are given in the variables units of measure.
The width of the name field in the report may be controlled with script parameter
NAME_WIDTH.

Input Language
PRINT ALIAS [ vmask ]

Input Language Description


vmask Optional list of variable attributes to print. This list is separated by
commas and enclosed in brackets.
If no list is given, then the script parameter PRINT_VAR_MASK is used
as the list of attributes to print. This default list includes the name,
lower, value, upper, units and specification.

These attributes can be used. (See the Variable Commands section for
descriptions.)
VALUE INITIAL CHANGE LOWER
UPPER STEP BOUND SBWEIGHT
SPEC UNITS SCALE PHYSICAL_TYPE
QUALITY BASEUOM SHADOW_PRICE ACTIVE_BOUND

3 Hierarchies, Blocks, Variables, and Equations 75


Printing Alias Variables
Prints a list of aliases corresponding to the specified variables to the report device.

Input Language
PRINT ALIAS VARIABLES var_list

Input Language Description


var_list Optional comma-separated list of variable names. If no list is given, then all
alias definitions for the current scope are printed.

Equation Commands
The equation commands are used to include or exclude equations from the OOMF
solution.

Excluding Equations
This command may be used to exclude, or remove, equations from the problem.
This may change the number of degrees of freedom, depending on the variable
specifications.

Input Language
equationid.INCLUDED = FALSE

Input Language Description


equationid Equation name.

Including Equations
This command may be used to include equations that have been previously
excluded.

Input Language
equationid.INCLUDED = TRUE

Input Language Description


equationid Equation name.

3 Hierarchies, Blocks, Variables, and Equations 76


Evaluating Equations
Equations may be evaluated with either of the following commands. Equations in
excluded blocks are not evaluated.

Input Language
EVALUATE EQUATIONS
EVALUATE RESIDUALS

Printing Equations
Prints the listed equation names and attributes to the report device.
The list can be generated by block, equation index or equation name. If no
argument is given, all the problem equations are printed.
The residual equations are not evaluated by this command. To evaluate the
equations use EVALUATE RESIDUALS or EVALUATE EQUATIONS.
The width of the name field in the report may be controlled with script parameter
NAME_WIDTH.

Input Language
PRINT EQUATIONS list
PRINT RESIDUALS list

Input Language Description


list A comma separated list of block names, equation names, and equation
indices. If omitted, all equations are printed.

Printing Largest Residuals


This command prints the largest residuals (in decreasing size) from the listed set
of blocks to the report device.
The residuals are not calculated by this command. To calculate residuals use
EVALUATE RESIDUALS.
The width of the name field in the report may be controlled with script parameter
NAME_WIDTH.

Input Language
PRINT LARGEST RESIDUALS integer, block_list
PRINT LARGEST EQUATIONS integer, block_list

Input Language Description


integer Optional length of largest residual list (default = 10)
block_list Optional comma separated list of blocks. The largest residuals in each block will be
printed. If omitted, the largest residuals in the problem are printed.

3 Hierarchies, Blocks, Variables, and Equations 77


Printing Largest Residual Shadow Prices
This command prints the largest residual shadow prices (in decreasing size) from
the listed set of blocks to the report device. These may be listed as scaled or
unscaled.
The residuals and their shadow prices are not calculated by this command. This
should be done with a SOLVE command. (The EVALUATE RESIDUALS command
will not compute the shadow prices.)
The width of the name field in the report may be controlled with script parameter
NAME_WIDTH.

Input Language
PRINT LARGEST RESIDUAL SHADOW_PRICES integer, block_list
PRINT LARGEST EQUATIONS SHADOW_PRICES integer, block_list

PRINT LARGEST RESIDUAL SCALED_SHADOW_PRICES integer, block_list


PRINT LARGEST EQUATION SCALED_SHADOW_PRICES integer, block_list

Input Language Description


integer Optional length of largest shadow price list (default = 10)
block_list Optional comma separated list of blocks. The largest residual shadow prices in each
block will be printed. If omitted, the largest residuals in the problem are printed.

3 Hierarchies, Blocks, Variables, and Equations 78


4 Specification Groups and
Connections

This chapter describes the OOMF Script commands used to manipulate


specification groups, streams, and connections.

4 Specification Groups and Connections 79


Specification Group Commands
These commands are used to control Specification Groups.

Removing Specification Groups


This command is used to remove Spec Groups, completely eliminating them from
the EO Strategy. The product specific user interface input, of course, is not
affected.
When a Spec Group is removed, Spec Management automatically reprocesses all
the Connections and Spec Groups to ensure that the problem remains square. The
removed Spec Group will not appear in any PRINT command, and will have an
Inactive status in the GUI, if defined there. (The Status on the GUI is not updated
until an Incremental Build or Solve is performed.)
Note that any Spec Groups defined in the product specific user interface that are
removed with this command are recreated if the EO Strategy is reinitialized either
from SM Results or from a complete rebuild.

Input Language
REMOVE SPECIFICATION GROUP spec_list

Input Language Description


spec_list A comma-separated list of names. If no name is entered, all Spec Groups
within the current scope are removed. Wildcards may be used in the
names.

Disabling Specification Groups


This command is used to disable a specific Spec Group.
When a Spec Group is disabled, Spec Management automatically reprocesses all
the Connections and Spec Groups to ensure that the problem remains square.
(The Status on the GUI is not updated until an Incremental Build or Solve is
performed.)

Input Language
DISABLE SPECIFICATION GROUP spec_list

Input Language Description


spec_list A comma-separated list of names. If no name is entered, all Spec Groups
within the current scope are disabled. Wildcards may be used in the
names.

4 Specification Groups and Connections 80


Enabling Specification Groups
This command is used to enable a specific Spec Group. It does the reverse of the
DISABLE SPECIFICATION GROUP command discussed in the previous section.

Input Language
ENABLE SPECIFICATION GROUP spec_list

Input Language Description


spec_list A comma-separated list of names. If no name is entered, all Spec Groups
within the current scope are enabled. Wildcards may be used in the
names.

Printing Specification Groups


This command prints the Specification Groups in the current scope.

Input Language
PRINT SPECIFICATION GROUP spec_list

Input Language Description


spec_list A comma-separated list of names. If no name is entered, all Spec Groups
within the current scope are printed. Wildcards may be used in the names.

Printing Inactive Specification Groups


This command is used to print inactive Specification Groups in the current scope.
These may become inactive because it was disabled or the group is non-square.

Input Language
PRINT INACTIVE SPECIFICATION GROUPS spec_list

Input Language Description


spec_list A comma-separated list of names. If no name is entered, all inactive Spec
Groups within the current scope are printed. Wildcards may be used in the
names.

Printing Specification Group Variables


This command is used to locate variable references in Specification Groups in the
current scope.

Input Language
PRINT SPECIFCATION GROUP VARIABLES var_list

Input Language Description


var_list A comma-separated list of variable names to search. If no name is entered,
all connections within the current scope are printed. Wildcards may be used
in the names.

4 Specification Groups and Connections 81


Examples of Specification Group
Commands
In the following example session, a Spec Group called DOG is disabled and then
enabled:

EO> PRINT SPEC GROUP DOG


<< Specification group DOG, enabled, and active >>
[CIN.BLK.C3H6_MOLE_FRAC,Calc]
[CIN.BLK.SUM_MOLE_FRAC,Const]
1 specification group found.

EO> DISABLE SPEC GROUP DOG


1 specification group disabled.

EO> PRINT SPEC GROUP DOG


<< Specification group DOG, disabled, and inactive >>
[CIN.BLK.C3H6_MOLE_FRAC,Calc]
[CIN.BLK.SUM_MOLE_FRAC,Const]
1 specification group found.

EO> ENABLE SPEC GROUP DOG


1 specification group enabled.

EO> PRINT SPEC GROUP DOG


<< Specification group DOG, enabled, and active >>
[CIN.BLK.C3H6_MOLE_FRAC,Calc]
[CIN.BLK.SUM_MOLE_FRAC,Const]
1 specification group found.

4 Specification Groups and Connections 82


Stream Commands
These commands are used to change stream or port attributes such as the
specification and the phase.

Printing Block Ports


The ports associated with a block may be printed with these commands.
PRINT BLOCK PORTS will list the following:
Name.
Type.
Direction.
Phase.
Attached stream.
PRINT BLOCK PORTS DETAILED will list the above along with:
Number of variables.
Number of components.
Variable indices and names.
Components (for material ports).

Input Language
PRINT BLOCK PORTS block_list
PRINT BLOCK PORTS DETAILED block_list

Input Language Description


block_list A comma-separated list of names. If no name is entered, all ports at the
current scope level only are printed. Wildcards may be used in the names.

Printing Stream Values


The variables in a stream may be viewed with the PRINT VARIABLES command.
More on this command may be found in the section titled Printing Variables.

Input Language
PRINT VARIABLES blockid.streamid.STR

Input Language Description


blockid Name of the block the stream is associated with. Note that a stream connected
between two blocks will have variables associated with it in both blocks. A
connection equation ensures that at the solution, these values will be the same.
streamid Name of the stream.

4 Specification Groups and Connections 83


Changing Stream Attributes
This command allows various attributes of the stream to be changed, such as the
phase, type and the specifications of all the variables within the stream. The
stream attributes may be viewed with the ECHO command.

Input Language
blockid.streamid.STR.attribute = value

Input Language Description


Stream attributes can be changed by referring to the stream by name along with
its attribute. If the attribute is left out, the value is changed. The allowed
attributes are:
SPEC The specification of the stream. This is a string that sets the specification in each
mode. (See table below.)
During the run of any particular mode, only the specification for that mode is known
to the OOMF system.
PHASE Phase of the stream. This is used for connection processing when connecting a mole-
based stream to a mole fraction-based stream to determine if a flash is necessary.
VAPOR Vapor phase
LIQUID Liquid phase
VL Mixed vapor and liquid phases (flash required)
VLF Mixed vapor, liquid and free water phases (flash with free water
required)
UNKNOWN Unknown phase (flash or flash with free water required; you may set
the script parameter FLANGE_PHASE to VL or VLF to control the
type of flash).
TYPE The type of stream. This is used for connection processing to determine if there is a
stream type change.
MATERIAL_MOLE_FLOW A material stream using the mole flow structure
MATERIAL_MOLE_FRAC A material stream using the mole fraction structure
INFORMATION An information stream
UNDEFINED The stream type has not been defined

Stream Specifications
SPEC SIM PAR REC OPT
CONST Fixed Fixed Fixed Fixed
CALC Free Free Free Free
MEAS Free Fixed Fixed Free
PARAM Fixed Free Free Fixed
OPTIM Fixed Fixed Fixed DOF
RECON Fixed Fixed DOF Fixed
INDEP Fixed Fixed DOF DOF

See Also
Aspen Plus Extensions - Stream Commands

4 Specification Groups and Connections 84


Connection Commands
These commands are used to control connections between variables. Connections
create an equation equivalencing two variables. When connections are processed,
OOMF checks the specification of each variable in the current mode.
The rules for connection processing specification changes are simple. If only one
variable in the connection is specified in all four modes (type CONST, OPTIM, RECON
or INDEP), then this variable will become free (type CALC) by the connection
processing. If both variables are a specified type, then the variable listed first, the
destination variable, will become free.
The following table shows the connection rules for the seven specification types.
The rows are the destination variables (the variable listed first in the connection);
the columns are the source variables (the variable listed second in the
connection).
CONST CALC MEAS PARAM OPTIM RECON INDEP

CONST= CALC=CONST CALC=CALC CALC=MEAS CALC=PARAM CALC=OPTIM CALC=RECON CALC=INDEP

CALC = CALC=CALC N/A N/A N/A CALC=CALC CALC=CALC CALC=CALC

MEAS = MEAS=CALC N/A N/A CALC=CALC MEAS=CALC MEAS=CALC MEAS=CALC

PARAM= PARAM=CALC N/A CALC=CALC N/A PARAM=CALC PARAM=CALC PARAM=CALC

OPTIM= CALC=CONST CALC=CALC CALC=MEAS CALC=PARAM CALC=OPTIM CALC=RECON CALC=INDEP

RECON= CALC=CONST CALC=CALC CALC=MEAS CALC=PARAM CALC=OPTIM CALC=RECON CALC=INDEP

INDEP= CALC=CONST CALC=CALC CALC=MEAS CALC=PARAM CALC=OPTIM CALC=RECON CALC=INDEP

For example, if the connection CONST=PARAM is made, we get CALC=PARAM for


the result. So the first variable goes from a CONST type to a CALC type.
Connections will change the number of equations in the problem but not change
the number of degrees of freedom since a specification is always lost.

Removing Connections
This command is used to remove Connections and Spec Groups, completely
eliminating them from the EO Strategy. The product specific user interface input,
of course, is not affected.
When a Connection is removed, Spec Management automatically reprocesses all
the Connections and Spec Groups to ensure that the problem remains square. The
removed Connections and Spec Groups will not appear in any PRINT command,
and will have an Inactive status in the GUI, if defined there. (The Status on the
GUI is not updated until an Incremental Build or Solve is performed.)
If you use these commands from within products that embed OOMF, note that any
Connections defined in the products user interface that are removed with this
command are recreated if the EO Strategy is reinitialized either from SM Results
or from a complete rebuild.

4 Specification Groups and Connections 85


This command will not remove product specific connections such as
Aspen Plus stream connections (Use STREAMS NONE instead).
Aspen Plus HXFlux connections (use DISABLE HXFLUX instead).

Input Language
REMOVE CONNECTION cxn_list

Input Language Description


cxn_list A comma-separated list of names. If no name is entered, all Connections
and Spec Groups within the current scope are removed. Wildcards may
be used in the names.

Disabling Connections
This command is used to disable a specific Connection or Spec Group. For a
Connection, this excludes the connection equation from the problem. For a Spec
Group, this disables the group.
When a connection is disabled, Spec Management automatically reprocesses all
the Connections and Spec Groups to ensure that the problem remains square.
(The Status on the GUI is not updated until an Incremental Build or Solve is
performed.)

Input Language
DISABLE CONNECTION cxn_list

Input Language Description


cxn_list A comma-separated list of names. If no name is entered, all Connections
and Spec Groups within the current scope are disabled. Wildcards may
be used in the names.

Enabling Connections
This command is used to enable a specific Connection or Spec Group. It does the
reverse of the DISABLE CONNECTION command discussed in the previous
section.

Input Language
ENABLE CONNECTION cxn_list

Input Language Description


cxn_list A comma-separated list of names. If no name is entered, all Connections
and Spec Groups within the current scope are enabled. Wildcards may be
used in the names.

4 Specification Groups and Connections 86


Checking Connections
This command is used to check the integrity of all flowsheet connections.

Input Language
CHECK CONNECTIONS

Printing Connections
The CONNECTIONS command prints from the current scope level only:
Spec Groups.
User connections.
The PRINT CONNECTIONS and PRINT CONNECTIONS DETAILED commands
print from the current scope:
Spec Groups.
User connections.
Product specific connections such as
Aspen Plus stream connections.
Aspen Plus HXFlux connections.
PRINT CONNECTIONS DETAILED will show a detailed report for all connections.
The PRINT VARIABLES CONNECTIONS command prints for the current scope
all the User connections. This will show the source and destination variables as
well as their indices, and the connection multiplier and offset.

Input Language
CONNECTIONS
PRINT CONNECTIONS cxn_list
PRINT CONNECTIONS DETAILED cxn_list
PRINT VARIABLES CONNECTIONS

Input Language Description


cxn_list A comma-separated list of names. If no name is entered, all connections
within the current scope are printed. Wildcards may be used in the
names.

Printing Inactive Connections


This command is used to print the following items that are inactive:
User connections.
Product specific connections such as
Aspen Plus stream connections.
Aspen Plus HXFlux connections.
These may become inactive because the connection was disabled through the
products user interface or because a block involved in the connection has been
excluded.

4 Specification Groups and Connections 87


Input Language
PRINT INACTIVE CONNECTIONS cxn_list

Input Language Description


cxn_list A comma-separated list of names. If no name is entered, all inactive
connections within the current scope are printed. Wildcards may be used
in the names.

Printing Incomplete Connections


This command is used to print the following items that are incomplete:
Spec Groups.
User connections.
Product specific connections such as
Aspen Plus stream connections.
Aspen Plus HXFlux connections.
These may be incomplete due to an input error, such as a bad variable name or
an improper specification.

Input Language
PRINT INCOMPLETE CONNECTIONS cxn_list

Input Language Description


cxn_list A comma-separated list of names. If no name is entered, all incomplete
connections within the current scope are printed. Wildcards may be used
in the names.

Printing Connection Variables


This command is used to locate variable references in the following:
Spec Groups.
User connections.
Product specific connections such as
Aspen Plus stream connections.
Aspen Plus HXFlux connections.

Input Language
PRINT CONNECTION VARIABLES var_list

Input Language Description


var_list A comma-separated list of variable names to search. If no name is
entered, all connections within the current scope are printed. Wildcards
may be used in the names.

See Also
Aspen Plus Extensions - Stream Commands
Aspen Plus Extensions - HXFlux Commands

4 Specification Groups and Connections 88


Examples of Connection Commands
In the following example session, a connection called THIN is disabled and then
enabled. When the connection is disabled, the destination variable specifications
becomes Constant, reverting back to Calculated when the connection is enabled
again.
EO> PRINT VAR CONDUA.BLK.H_IN_TEMP
-index- ------variable------ -----lower---- ---value---- ----upper----- -----uom ------ -spec-
1430 CONDUA.BLK.H_IN_TEMP -1e+020 -20 1e+020 C Calc

EO> DISABLE CONNECTION THIN


1 connection disabled.

EO> PRINT CONNECTION THIN


<< Variable Connection THIN, disabled and inactive >>
CONDUA.BLK.H_IN_TEMP = C2HIER.C2S.BLK.TEMP_2
1 connection found.

EO> PRINT VAR CONDUA.BLK.H_IN_TEMP


-index- ------variable------ -----lower---- ---value---- ----upper----- -----uom ------ -spec-
1430 CONDUA.BLK.H_IN_TEMP -1e+020 -20 1e+020 C Const

EO> ENABLE CONNECTION THIN


1 connection enabled.

EO> PRINT CONNECTION THIN


<< Variable Connection THIN, enabled and active >>
CONDUA.BLK.H_IN_TEMP = C2HIER.C2S.BLK.TEMP_2
1 connection found.

EO> PRINT VAR CONDUA.BLK.H_IN_TEMP


-index- ------variable------ -----lower---- ---value---- ----upper----- -----uom ------ -spec-
1430 CONDUA.BLK.H_IN_TEMP -1e+020 -20 1e+020 C Calc

4 Specification Groups and Connections 89


5 Measurements

This chapter describes the OOMF Script commands used to manipulate


measurements and measurement qualities.

5 Measurements 90
Measurement Commands
Measurements are used to associate model variables with actual plant
measurements. Measurements are typically configured through the products user
interface. If you are using standalone OOMF, measurements may be added using
the add measurements command. Do not use the add measurements
command from within the Aspen Plus user interface. These commands allow you
to control the status of your measurements.

Checking Measurements
This command is used to verify that the measurements for the problem are
properly defined. This will check for the following
Source variables that are not calculated.
Model variables that are not calculated.
Inactive measurement connections.
This command is automatically issued at the end of the Synchronization step.
If all the connections are properly defined, this command will return the message
All measurements are correctly specified. Otherwise, this command will return a
table of improperly specified measurements. This output is sent to the Report
Device.

Input Language
CHECK MEASUREMENTS

Disabling Measurements
This command is used to disable a specific measurement. This excludes the
measurement from the problem: the measurement connection is broken, the
variables are removed, and the offset equation is excluded.
When a measurement is disabled, Spec Management automatically reprocesses all
the Connections and Spec Groups to ensure that the problem remains square.
Connections and Spec Groups that contain references to the disabled
measurement become Inactive. (The Status on the GUI is not updated until an
Incremental Build or Solve is performed.)

Input Language
DISABLE MEASUREMENT meas_list

Input Language Description


meas_list A comma-separated list of names. If no name is entered, all
measurements within the current scope are disabled. The names are
written in the format blockid.tagid_descr, where blockid is the name of
the measurement block, tagid is the name of tag, and descr is the
measurement description. Wildcards may be used in the names.

5 Measurements 91
Enabling Measurements
This command is used to enable a specific measurement. It does the reverse of
the DISABLE MEASUREMENT command discussed in the previous section.

Input Language
ENABLE MEASUREMENT meas_list

Input Language Description


meas_list A comma-separated list of names. If no name is entered, all
measurements within the current scope are enabled. The names are
written in the format blockid.tagid_descr, where blockid is the name of
the measurement block, tagid is the name of tag, and descr is the
measurement description. Wildcards may be used in the names.

Printing Measurements
Prints a list of measurements to the report device.

Input Language
PRINT MEASUREMENTS meas_list

Input Language Description


meas_list Optional comma-separated list of measurement names. The
measurement names are written in the format blockid.tagid_descr,
where blockid is the name of the measurement block, tagid is the name
of tag, and descr is the measurement description. Wildcards are not
allowed. If no list is given, then all measurements for the current scope
are printed.

Printing Measurement Variables


Prints a list of measurements associated with the specified variables to the report
device.

Input Language
PRINT MEASUREMENTS VARIABLES var_list

Input Language Description


var_list Optional comma-separated list of variable names. If no list is given, then
all measurements for the current scope are printed.

5 Measurements 92
Examples of Measurement Commands
To check measurements enter:
EO> CHECK MEASUREMENTS
The specifications for these measurements are not as expected:
Measurement -Connected?- -Model- -Source-
C2MEAS.XB Yes Calc Optim
C2MEAS.XD Yes Calc Optim
C2MEAS.XF Yes Calc Const
C2MEAS.F Yes Calc Const
The table shows the list of bad measurements. The column labeled Connected?
shows the status of the measurement connections. All entries in this column
should be Yes. The last two columns, labeled Model and Source, show the
specifications of the Model and Source variables, respectively. All entries in these
two columns should be Calc.
In the following example, measurement C2MEAS.C3R is disabled. Since the
measurement does not appear in any Spec Groups, no Spec Groups become
Inactive as a result of this change:
EO> PRINT BLOCK STAT
---Block-- -Nvar- -Neqn- -Nfix- Nexcld -Ndof- NfreeI --Nnz- --Nz%-
C2S 1256 1244 5 0 2 7 6560 0.42
DDEF 45 36 2 0 0 0 131 8.5
CVAP 41 33 2 0 -1 1 97 7.5
CONDUA 12 5 2 0 0 0 16 32
CIN 35 30 4 0 1 0 72 7.7
F 41 35 4 0 2 0 103 8
C2MEAS 24 8 12 0 -4 0 12 13
---------- ------ ------ ------ ------ ------ ------ ------ ------
Total 1454 1391 31 0 0 8 6991

EO> PRINT MEASUREMENTS


Current scope
Msmt ID Tagname Description Inc UOM Plant Model Offset Pspec Ospec
-------- -------- ---------------- --- -------- --------- --------- --------- ----- -----
C2MEAS F F.BLK.MASS Y KG/HR 49000.000 50000.000 0.0 Const Const
C2MEAS XF F.BLK.C2H6_MOLE| Y UNITLESS 0.200 0.200 0.0 Const Const
C2MEAS D C2S.BLK.DISTILL| Y KG/HR 41000.000 39000.493 0.0 Meas Param
C2MEAS B C2S.BLK.BOTTOMS| Y KG/HR 12000.000 11000.000 0.0 Meas Param
C2MEAS RR C2S.BLK.REFL_RA| Y UNITLESS 4.300 4.000 0.0 Meas Param

5 Measurements 93
C2MEAS XD C2S.D.STR.C2H6 Y FRACTION 1.0000e-4 2.1613e-4 0.0 Optim Const
C2MEAS XB C2S.B.STR.C2H4 Y FRACTION 1.5000e-2 4.2976e-2 0.0 Optim Const
C2MEAS C3R CIN.BLK.MASS Y KG/HR 140000. 150000. 0.0 Meas Param

EO> CHECK MEASUREMENTS


All measurements are correctly specified.

EO> DISABLE MEASUREMENT C2MEAS.C3R


1 measurement disabled.

EO> PRINT BLOCK STAT


---Block-- -Nvar- -Neqn- -Nfix- Nexcld -Ndof- NfreeI --Nnz- --Nz%-
C2S 1256 1244 5 0 2 7 6560 0.42
DDEF 45 36 2 0 0 0 131 8.5
CVAP 41 33 2 0 -1 1 97 7.5
CONDUA 12 5 2 0 0 0 16 32
CIN 35 30 4 0 1 0 72 7.7
F 41 35 4 0 2 0 103 8
C2MEAS 21 8 11 1 -4 0 10 14
---------- ------ ------ ------ ------ ------ ------ ------ ------
Total 1451 1391 30 1 0 8 6989

EO> PRINT MEASUREMENTS


Current scope
Msmt ID Tagname Description Inc UOM Plant Model Offset Pspec Ospec
-------- -------- ---------------- --- -------- --------- --------- --------- ----- -----
C2MEAS F F.BLK.MASS Y KG/HR 49000.000 50000.000 0.0 Const Const
C2MEAS XF F.BLK.C2H6_MOLE| Y UNITLESS 0.200 0.200 0.0 Const Const
C2MEAS D C2S.BLK.DISTILL| Y KG/HR 41000.000 39000.493 0.0 Meas Param
C2MEAS B C2S.BLK.BOTTOMS| Y KG/HR 12000.000 11000.000 0.0 Meas Param
C2MEAS RR C2S.BLK.REFL_RA| Y UNITLESS 4.300 4.000 0.0 Meas Param
C2MEAS XD C2S.D.STR.C2H6 Y FRACTION 1.0000e-4 2.1613e-4 0.0 Optim Const
C2MEAS XB C2S.B.STR.C2H4 Y FRACTION 1.5000e-2 4.2976e-2 0.0 Optim Const
C2MEAS C3R CIN.BLK.MASS N KG/HR 140000. 150000. 0.0 Meas Param

EO> CHECK MEASUREMENTS


All measurements are correctly specified.

EO> PRINT INACTIVE SPEC GROUPS


0 inactive specification groups found.

5 Measurements 94
Note the reduction in size of the measurement block, C2MEAS, and that it now
contains an excluded equation.
In this next example, we repeat the above except that measurement C2MEAS.XD
is disabled. This measurement appears in Spec Group C2MEAS, causing it to
become Inactive. Since this Spec Group is used to ensure proper configuration of
all the measurements, once it becomes Inactive, a number of bad measurements
appear when the CHECK MEASUREMENTS command is issued:
EO> DISABLE MEASUREMENT C2MEAS.XD
1 measurement disabled.

EO> PRINT BLOCK STAT


---Block-- -Nvar- -Neqn- -Nfix- Nexcld -Ndof- NfreeI --Nnz- --Nz%-
C2S 1256 1244 7 0 0 7 6558 0.42
DDEF 45 36 2 0 0 0 131 8.5
CVAP 41 33 2 0 -1 1 97 7.5
CONDUA 12 5 2 0 0 0 16 32
CIN 35 30 4 0 1 0 72 7.7
F 41 35 6 0 0 0 100 8.2
C2MEAS 21 8 7 1 0 0 14 14
---------- ------ ------ ------ ------ ------ ------ ------ ------
Total 1451 1391 30 1 0 8 6988

EO> PRINT MEASUREMENTS


Current scope
Msmt ID Tagname Description Inc UOM Plant Model Offset Pspec Ospec
-------- -------- ---------------- --- -------- --------- --------- --------- ----- -----
C2MEAS F F.BLK.MASS Y KG/HR 49000.000 50000.000 0.0 Const Calc
C2MEAS XF F.BLK.C2H6_MOLE| Y UNITLESS 0.200 0.200 0.0 Const Calc
C2MEAS D C2S.BLK.DISTILL| Y KG/HR 41000.000 39000.493 0.0 Const Calc
C2MEAS B C2S.BLK.BOTTOMS| Y KG/HR 12000.000 11000.000 0.0 Const Calc
C2MEAS RR C2S.BLK.REFL_RA| Y UNITLESS 4.300 4.000 0.0 Const Calc
C2MEAS XD C2S.D.STR.C2H6 N FRACTION 1.0000e-4 2.1613e-4 0.0 Const Calc
C2MEAS XB C2S.B.STR.C2H4 Y FRACTION 1.5000e-2 4.2976e-2 0.0 Const Calc
C2MEAS C3R CIN.BLK.MASS Y KG/HR 140000. 150000. 0.0 Const Calc

EO> CHECK MEASUREMENTS


The specifications for these measurements are not as expected:
Measurement -Connected?- -Model- -Source-
C2MEAS.XB Yes Calc Optim
C2MEAS.XF Yes Calc Const
C2MEAS.F Yes Calc Const

5 Measurements 95
EO> PRINT INACTIVE SPEC GROUPS
<< Specification group C2MEAS, enabled, and inactive >>
[C2MEAS.BLK.F_PLANT,Const]
[C2MEAS.BLK.F_OFFSET,Const]
[C2MEAS.BLK.XF_PLANT,Const]
[C2MEAS.BLK.XF_OFFSET,Const]
[C2MEAS.BLK.D_PLANT,Meas]
[C2MEAS.BLK.D_OFFSET,Param]
[C2MEAS.BLK.B_PLANT,Meas]
[C2MEAS.BLK.B_OFFSET,Param]
[C2MEAS.BLK.RR_PLANT,Meas]
[C2MEAS.BLK.RR_OFFSET,Param]
[C2MEAS.BLK.XD_PLANT,Optim]
[C2MEAS.BLK.XD_OFFSET,Const]
[C2MEAS.BLK.XB_PLANT,Optim]
[C2MEAS.BLK.XB_OFFSET,Const]
[C2MEAS.BLK.C3R_PLANT,Meas]
[C2MEAS.BLK.C3R_OFFSET,Param]
[C2S.D.STR.C2H6,Calc]
[C2S.B.STR.C2H4,Calc]
[C2S.BLK.DISTILLATE_MASS,Calc]
[C2S.BLK.REFL_RATIO_MASS,Calc]
[F.BLK.MASS,Calc]
[F.BLK.C2H6_MOLE_FRAC,Calc]
[CIN.BLK.MASS,Calc]
1 inactive specification group found.

5 Measurements 96
At this point, we enable measurement C2MEAS.XD. This brings us back to the
original state of the system:
EO> ENABLE MEASUREMENT C2MEAS.XD
1 measurement enabled.

EO> PRINT BLOCK STAT


---Block-- -Nvar- -Neqn- -Nfix- Nexcld -Ndof- NfreeI --Nnz- --Nz%-
C2S 1256 1244 5 0 2 7 6560 0.42
DDEF 45 36 2 0 0 0 131 8.5
CVAP 41 33 2 0 -1 1 97 7.5
CONDUA 12 5 2 0 0 0 16 32
CIN 35 30 4 0 1 0 72 7.7
F 41 35 4 0 2 0 103 8
C2MEAS 24 8 12 0 -4 0 12 13
---------- ------ ------ ------ ------ ------ ------ ------ ------
Total 1454 1391 31 0 0 8 6991

EO> PRINT MEASUREMENTS


Current scope
Msmt ID Tagname Description Inc UOM Plant Model Offset Pspec Ospec
-------- -------- ---------------- --- -------- --------- --------- --------- ----- -----
C2MEAS F F.BLK.MASS Y KG/HR 49000.000 50000.000 0.0 Const Const
C2MEAS XF F.BLK.C2H6_MOLE| Y UNITLESS 0.200 0.200 0.0 Const Const
C2MEAS D C2S.BLK.DISTILL| Y KG/HR 41000.000 39000.493 0.0 Meas Param
C2MEAS B C2S.BLK.BOTTOMS| Y KG/HR 12000.000 11000.000 0.0 Meas Param
C2MEAS RR C2S.BLK.REFL_RA| Y UNITLESS 4.300 4.000 0.0 Meas Param
C2MEAS XD C2S.D.STR.C2H6 Y FRACTION 1.0000e-4 2.1613e-4 0.0 Optim Const
C2MEAS XB C2S.B.STR.C2H4 Y FRACTION 1.5000e-2 4.2976e-2 0.0 Optim Const
C2MEAS C3R CIN.BLK.MASS Y KG/HR 140000. 150000. 0.0 Meas Param

EO> CHECK MEASUREMENTS


All measurements are correctly specified.

EO> PRINT INACTIVE SPEC GROUPS


0 inactive specification groups found.

5 Measurements 97
Measurement Qualities
The quality of a variable may be used to change problem specifications. The
Variable Quality capability allows you to:
Disable a Measured-Parameterized pair between a measurement block Plant
and Offset variable.
Disable all Measured-Parameterized pairs within a defined list of Specification
Groups.
Enable a disabled Specification Group.
Each of these capabilities will be discussed in turn.
There are two tools you must use for the Variable Quality capability:
The QUALITY variable attribute.
The script parameter BAD_STATUS_LIST.
Every variable has a QUALITY attribute. The quality may be set with the following
script command:
variableid.QUALITY = status
Where status is one of the following:
GOOD The quality of the measured or parameterized variable is good.
BAD The quality of the measured variable is bad.
OVERRIDE The quality of the parameterized variable is to be overridden.

Normally, only Measured variables are given a quality of BAD; only Parameterized
variables are given a status of OVERRIDE.
The BAD_STATUS_LIST contains a list of Specification Groups and Variable-
Specification Group pairs used by the Variable Quality capability. This script
parameter may be defined with the SET script command:
SET BAD_STATUS_LIST = [ specid1, specid2, ... \
[ variableid1, specid1 ], \
[ variableid2, specid2 ], ... ]
The following sections discuss the use of the Variable Quality capability.

Disabling Simple Measured-


Parameterized Pairs
The simplest type of Measured-Parameterized pairing occurs between the Plant
and Offset variables within a Measurement block. In this case, during a tuning
mode, such as Parameter Estimation, the value of the Plant variable is used to
update its corresponding Offset variable, thus provided an indication of plant-
model mismatch.
However, if the quality of the Plant variable becomes bad, then it is not desirable
to keep these specifications, but rather to set the Plant variable to Calculated and
the Offset to Constant.

5 Measurements 98
The PROCESS VARIABLE QUALITY command automatically handles this
situation: If a Plant variable with a Measured specification is BAD, and its
corresponding Offset variable is Parameterized, then the specifications are
changed to Calculated and Constant, respectively. This allows simple Measured-
Parameterized pairs to be disabled with minimal user input.

Disabling Measured-Parameterized Pairs


in Specification Groups
It is often the case that a particular Plant variable is paired with a parameter other
than its corresponding Offset. For example, in a distillation column the reflux ratio
may be used to as a measurement to update the Murphree efficiency. In this case,
the reflux ratio variable has a specification of Measured and the efficiency a
specification of Parameterized. If the quality of the reflux ratio becomes bad, then
it is not desirable to keep these specifications, but rather to set the reflux ratio to
Calculated and the efficiency to Constant.
To accomplish this, BAD_STATUS_LIST is set to a list of Specification Groups to be
processed. This may be done with the SET script command:
SET BAD_STATUS_LIST = [ specid1, specid2 ], ...
If a variable has a Measured specification with a BAD quality or a Parameterized
specification with an OVERRIDE quality, then all Specification Groups listed in
BAD_STATUS_LIST are searched for the variable. If found, then all Measured
variables within the Specification Group are changed to Calculated and all
Parameterized variables are changed to Constant.
This effectively breaks all the Measured-Parameterized pairs involving the bad
variable. For this to work correctly, the Specification Groups should have an equal
number of Measured and Parameterized variables, otherwise they would become
non-square and inactive.

Enabling Specification Groups


Often, the above logic is inadequate in more complicated situations. Sometimes
when a variable is no longer good, a number of specification changes must be
made. To assist in this, it is possible to associate a variable with a Specification
Group. When the variable quality is BAD, then the Specification Group is changed
from Disabled to Enabled. In this way, you can enter the desired specification
changes in a Specification Group whose default status is Disabled. The
Specification Group would only be processed when a key variable quality is no
longer good.
To do this, you need only add a Variable-Specification Group pair to the script
parameter BAD_STATUS_LIST. This may be done with the SET script command:
SET BAD_STATUS_LIST = [ [ variableid1, specid1 ], \
[ variableid2, specid2 ], ...]

5 Measurements 99
Executing the Variable Quality Capability
The variable qualities may be processed with the PROCESS VARIABLE QUALITY
command. This can be undone with the UNPROCESS VARIABLE QUALITY
command.

Input Language
PROCESS VARIABLE QUALITY
UNPROCESS VARIABLE QUALITY

Examples of Measurement Qualities


In the following example, a reflux ratio measurement in a tower is given a bad
quality. A Specification Group associated with the variable, PARMODE, is entered
in the script parameter BAD_STATUS_LIST. When the variable qualities are
processed, a new Specification Group is automatically created to change all the
Measured specifications to Calculated and all the Parameterized specifications to
Constant.
EO> C2HIER.C2MEAS.BLK.RR_PLANT.QUALITY = BAD
EO> SET BAD_STATUS_LIST = [PARMODE]
EO> PROCESS VARIABLE QUALITY
Creating bad spec group AS__PARMODE:
C2MEAS.BLK.F_OFFSET (Param -> Const)
C2MEAS.BLK.XF_OFFSET (Param -> Const)
C2HIER.C2MEAS.BLK.D_PLANT (Meas -> Calc)
C2HIER.C2MEAS.BLK.B_PLANT (Meas -> Calc)
C2HIER.C2MEAS.BLK.RR_PLANT (Meas -> Calc)
C2HIER.C2S.BLK.EFF_1 (Param -> Const)
EO>
If we reset the quality to GOOD and process again, the new Specification Group is
removed:
EO> C2HIER.C2MEAS.BLK.RR_PLANT.QUALITY = GOOD
EO> PROCESS VARIABLE QUALITY
Remove bad spec group AS__PARMODE
EO>
In this example, we first disable Specification Group PARMODE and associate it
with the reflux ratio variable. When the variables quality goes BAD, Specification
Group PARMODE is enabled.
EO> DISABLE SPEC GROUP PARMODE
1 specification group disabled.

5 Measurements 100
EO> SET BAD_STATUS_LIST =
[[C2HIER.C2MEAS.BLK.RR_PLANT,PARMODE]]
EO> C2HIER.C2MEAS.BLK.RR_PLANT.QUALITY = BAD
EO> PROCESS VARIABLE QUALITY
Enable spec group PARMODE
EO>

5 Measurements 101
6 Saving and Restoring

This chapter describes the OOMF Script commands used for saving and restoring
data.

6 Saving and Restoring 102


File Commands
Variable attributes may be saved to binary and ASCII files so that they may be
read to initialize future runs.

Saving Variables To a Binary File


This command is used to save variable attributes to a binary file.

Input Language
SAVE VARIABLES [ vmask ], list TO "file"

Input Language Description


vmask Optional list of variable attributes to save, separated by commas. If omitted, value,
lower, upper, scale, units, physical type and specification are saved. Note that this list
is enclosed in brackets and followed by a comma. Variable names are always saved.
list Optional list of block names, variable names, stream names, or port names. The list is
separated by commas. If no list is given, then all variables in the current scope are
saved.
file Name of file. The name must be in double quotation marks.

These attributes can be used. (See the Variable Commands section for
descriptions.)
VALUE INITIAL LOWER UPPER
STEP BOUND SBWEIGHT SPEC
UNITS SCALE QUALITY PHYSICAL_TYPE
BASEUOM

Restoring Variables From a Binary File


This command is used to restore variable attributes from a binary file.
Normally, only variable values are restored. Particular care should be exercised
when restoring variable specifications, as this could corrupt Specification
Management and lead to non-square problems.

Input Language
RESTORE VARIABLES [ vmask ], list FROM "file"
RESTORE VARIABLES EXCEPT [ vmask ], list FROM "file"

Input Language Description


vmask Optional list of variable attributes to restore, separated by commas. If omitted, all the
variable attributes in the file are restored. Note that this list is enclosed in brackets
and followed by a comma. Variable names are never restored.
list Optional list of block names, variable names, stream names, or port names. The list is
separated by commas. For RESTORE VARIABLES, list is the list of objects to restore.
For RESTORE VARIABLES EXCEPT, list is the list of objects not to restore. In either
case, if no list is given, then all variables in the current scope are restored.
file Name of file. The name must be in double quotation marks.

6 Saving and Restoring 103


These attributes can be used. (See the Variable Commands section for
descriptions.)
VALUE INITIAL LOWER UPPER
STEP BOUND SBWEIGHT SPEC
UNITS SCALE QUALITY PHYSICAL_TYPE
BASEUOM

Restoring Free Variables From a Binary


File
This command is used to restore variable attributes from a binary file. Unlike
RESTORE VARIABLES, this command only restores variables that are free in the
current mode. This is useful for loading solutions at similar operating conditions
without changing the values of fixed variables.
Normally, only variable values are restored. Particular care should be exercised
when restoring variable specifications, as this could corrupt Specification
Management and lead to non-square problems.

Input Language
RESTORE FREE VARIABLES [ vmask ], list FROM "file"
RESTORE FREE VARIABLES EXCEPT [ vmask ], list FROM "file"

Input Language Description


vmask Optional list of variable attributes to restore, separated by commas. If omitted, the
values and units of measure are restored. Note that this list is enclosed in brackets
and followed by a comma. Variable names are never restored.
list Optional list of block names, variable names, stream names, or port names. The list is
separated by commas. For RESTORE FREE VARIABLES, list is the list of objects to
restore. For RESTORE FREE VARIABLES EXCEPT, list is the list of objects not to
restore. In either case, if no list is given, then all variables in the current scope are
restored.
file Name of file. The name must be in double quotation marks.

These attributes can be used. (See the Variable Commands section for
descriptions.)
VALUE INITIAL LOWER UPPER
STEP BOUND SBWEIGHT SPEC
UNITS SCALE QUALITY PHYSICAL_TYPE
BASEUOM

6 Saving and Restoring 104


Updating Variables In a Binary File
This command is used to update variables that have already been saved to a
binary file.

Input Language
UPDATE VARIABLES [ vmask ] TO "file"

Input Language Description


vmask Optional list of variable attributes to save, separated by commas. If omitted, value,
lower, upper, scale, units, physical type and specification are saved. Note that this list
is enclosed in brackets and followed by a comma. Variable names are always saved.
file Name of file. The name must be in double quotation marks.

These attributes can be used. (See the Variable Commands section for
descriptions.)
VALUE STEP SCALE SPEC
LOWER SBWEIGHT UNITS PHYSICAL_TYPE
UPPER

Saving Variables To an ASCII File


These commands are used to write variable attributes to an ASCII file. The format
of this file is affected by script parameters NAME_WIDTH, PAGE_WIDTH and
NUMBER_WIDTH.

Input Language
WRITE VARFILE [ vmask ], list TO "file"
WRITE VARFILE EXCEPT [ vmask ], list TO "file"

Input Language Description


vmask Optional list of variable attributes to save, separated by commas. Note that this list is
enclosed in brackets and followed by a comma. Variable names are always saved. If
no list is given, then the script parameter WRITE_VARFILE_MASK is used as the list
of attributes to print. This default list includes all the available attributes.
list Optional list of block names, variable names, variable indices, stream names, or port
names. The list is separated by commas. For WRITE VARFILE, list is the list of
objects to write. For WRITE VARFILE EXCEPT, list is the list of objects not to write.
In either case, if no list is given, then all variables in the current scope are written.
(The name of the current hierarchy, if any, is not added to the variable name prefix.)
file Name of file. The name must be in double quotation marks.

These attributes can be used. (See the Variable Commands section for
descriptions.)
VALUE INITIAL CHANGE LOWER
UPPER STEP BOUND SBWEIGHT
SPEC UNITS SCALE PHYSICAL_TYPE
QUALITY BASEUOM SHADOW_PRICE ACTIVE_BOUND
NAME SSPEC RLOWER RUPPER

6 Saving and Restoring 105


Restoring Variables From an ASCII File
This command is used to read variable attributes from an ASCII file. The format of
this file is affected by script parameters NAME_WIDTH, PAGE_WIDTH,
UOM_WIDTH and NUMBER_WIDTH.
Normally, only variable values are restored. Particular care should be exercised
when restoring variable specifications, as this could corrupt Specification
Management and lead to non-square problems.

Input Language
READ VARFILE [ vmask ], list FROM "file"
READ VARFILE EXCEPT [ vmask ], list FROM "file"

Input Language Description


vmask Optional list of variable attributes to restore, separated by commas. Note that this list
is enclosed in brackets and followed by a comma. Variable names are never restored.
If no list is given, then the script parameter READ_VARFILE_MASK is used as the
list of attributes to print. This default list includes all the above attributes.
list Optional list of block names, variable names, variable indices, stream names, or port
names. The list is separated by commas. For READ VARFILE, the list is the list of
objects to read. For READ VARFILE EXCEPT, the list is the list of objects not to read.
In either case, if no list is given, then all variables within the current scope are read.
file Name of file. The name must be in double quotation marks.

These attributes can be used. (See the Variable Commands section for
descriptions.)
VALUE INITIAL CHANGE LOWER
UPPER STEP BOUND SBWEIGHT
SPEC UNITS SCALE PHYSICAL_TYPE
QUALITY BASEUOM

Comparing Variables With an ASCII File


This command is used to compare variable attributes in OOMF with an ASCII file.
The comparison for values is done in user units of measure.

Input Language
COMPARE VARFILE [ vmask ], list FROM "file"

Input Language Description


vmask Optional list of variable attributes to compare, separated by commas. If omitted, all
the variable attributes in the file are compared. Note that this list is enclosed in
brackets and followed by a comma. Variable names are never compared.
list Optional list of block names, variable names, variable indices, stream names, or port
names. The list is separated by commas. If no list is given, then all variables within
the current scope are compared.
file Name of file. The name must be in double quotation marks.

6 Saving and Restoring 106


These attributes can be used. (See the Variable Commands section for
descriptions.)
UNITS LOWER BOUND SCALE
VALUE UPPER SPEC SBWEIGHT
INITIAL STEP

Examples of File Commands


To save all the variables in the problem to binary file COLUMN.X enter:
SAVE VARIABLES TO "COLUMN.X"
To restore the variable values, upper and lower bounds from this file enter:
RESTORE VARIABLES [VALUE, UPPER, LOWER], FROM "COLUMN.X"
To save just the variable values in blocks C2S, C2SDDEF and C2SBDEF to this file
enter:
SAVE VARIABLES [VALUE], C2S, C2SDDEF, C2SBDEF FROM "COLUMN.X"

6 Saving and Restoring 107


7 Objective Functions

This chapter describes the OOMF Script commands for manipulating objective
functions, Jacobians, and derivatives.
There are three types of objective functions available: linear, sum of squares and
symbolic. The coefficient of a term in a linear objective function may have a
constant numeric value with units or another variables name. In the latter case
the objective term is either bi-linear or quadratic. You can define as many
objective functions as you want. In this way, you can keep track of all your
objective function values during any particular run. The objective function you
wish to solve is determined by the setting of script parameter OBJECTIVE.

7 Objective Functions 108


Objective Function Commands
Changing Objective Function Attributes
This command allows various attributes of the objective function to be changed,
such as the scale and the direction.
The objective function attributes may be viewed with the ECHO command.

Input Language
objid.attribute = value

Input Language Description


Objective function attributes can be changed by referring to the objective function
by name along with its attribute. The allowed attributes are:
VALUE Value of the objective function. If you do not enter the units of measure, SI
units are assumed.
DIRECTION Direction for the optimization.
MAXIMIZE Maximize value
MINIMIZE Minimize value
SCALE Scale factor. This is a multiplicative factor.
UOM Units of measure.

Evaluating the Objective Function


This command evaluates the objective function value and prints it to the report
device.

Input Language
EVALUATE OBJECTIVE objid

Input Language Description


objid Name of the objective function

Evaluating the Objective Functions


Derivatives
This command evaluates the objective function derivatives with respect to all the
variables in the objective function and prints them to the report device.

Input Language
EVALUATE OBJECTIVE DERIVATIVE objid

Input Language Description


objid Name of the objective function

7 Objective Functions 109


Evaluating the Objective Functions
Hessian
This command evaluates the objective function Hessian (second derivatives) with
respect to all the variables in the objective function and prints them to the report
device.

Input Language
EVALUATE OBJECTIVE HESSIAN objid

Input Language Description


objid Name of the objective function

Printing the Objective Function


This command prints all terms in the objective function.

Input Language
PRINT OBJECTIVE objid

Input Language Description


objid Name of the objective function to print.

Jacobian and Derivative


Commands
These commands allow you to analyze the Jacobian and change the manner in
which numerical derivatives are computed.

Analyzing the Jacobian


This command compares the analytical Jacobian values against the values
computed numerically. You may specify the blocks for which the analysis is to be
done.

Input Language
ANALYZE JACOBIAN reltol, pertsize, block_list

Input Language Description


reltol Relative error tolerance. If the relative error is greater than this value, the
analytical and numerical derivatives are reported for each term in error.
pertsize Optional value of the perturbation size for the numerical derivative evaluation.
(default = 1.0E-6).
block_list Optional list of blocks in which to analyze the Jacobian. The list entries are
separated by commas. All the blocks in the list must be within the current scope.

7 Objective Functions 110


Analyzing the Jacobian Sparsity
This command compares the analytical and numerical Jacobian sparsity patterns.
You may specify the blocks for which the analysis is to be done.

Input Language
ANALYZE SPARSITY zerotol, pertsize, block_list

Input Language Description


zerotol Zero tolerance. If the numerical value of the Jacobian element is less than this
tolerance, then the element is considered zero. (default = 1.0E-12)
pertsize Optional value of the perturbation size for the numerical derivative evaluation.
(default = 1.0E-6)
block_list Optional list of blocks in which to analyze the Jacobian. The list entries are
separated by commas. All the blocks in the list must be within the current scope.

Evaluating the Jacobian


This command evaluates the Jacobian. The Jacobian for excluded blocks are not
evaluated.

Input Language
EVALUATE JACOBIAN

Printing the Jacobian


Prints the scaled Jacobian values for the selected blocks or Jacobian element index
to the report device.
The Jacobian is not calculated by this command. To calculate the Jacobian, use
EVALUATE JACOBIAN.
The width of the variable and equation name fields in the report may be set with
script parameter NAME_WIDTH.

Input Language
PRINT JACOBIAN list

Input Language Description


list Optional list of block names or nonzero element indices. If omitted, the
entire Jacobian is printed.

Printing Jacobian Variables


Print to the report device all Jacobian entries corresponding to the selected list of
variables, which can be specified using variable names or regular expression
matching. Each variable is associated with a column in the Jacobian matrix.
The Jacobian is not calculated by this command. To calculate the Jacobian, use
EVALUATE JACOBIAN.

7 Objective Functions 111


The width of the variable and equation name fields in the report may be set with
script parameter NAME_WIDTH.

Input Language
PRINT JACOBIAN VARIABLES list

Input Language Description


list List of variable names of indices that appear in the Jacobian.

Printing Jacobian Equations


Prints to the report device all Jacobian entries corresponding to the selected list of
equations, which can be specified using equation name or regular expression
matching. Each equation is associated with a row in the Jacobian matrix.
The Jacobian is not calculated by this command. To calculate the Jacobian, use
EVALUATE JACOBIAN.
The width of the variable and equation name fields in the report may be set with
script parameter NAME_WIDTH.

Input Language
PRINT JACOBIAN EQUATIONS list

Input Language Description


list List of equation names or indices that appear in the Jacobian.

Printing Block Derivative Methods


This command prints a table of block names in the current scope level only with
their derivative methods, perturbation sizes (if computed numerically), and other
block information.
Block attributes associated with the derivative method may be changed. See
Changing Block Attributes.

Input Language
DERIVATIVE

Examples Of Derivative Commands


To print the Jacobian for equation FDEF.STREQN.COMPBAL_C2H4 enter:
PRINT JACOBIAN EQUATION FDEF.STREQN.COMPBAL_C2H4
To print the Jacobian for entire block FDEF enter:
PRINT JACOBIAN FDEF
To print the Jacobian for nonzero number 30 enter:
PRINT JACOBIAN 30

7 Objective Functions 112


To print the Jacobian for nonzero number 30 to 40 enter:
PRINT JACOBIAN 30 : 40
Note that the colon is surrounded by blanks.
Lets interactively query the derivatives for a small flowsheet and then change one
of the blocks to use numerical derivatives with a perturbation size of 1.0E-7.
EO> DERIVATIVE
--block- --deriv- --pert size- --when update fails- --nonlinearity r. deviation
DDEF analytic
C2S analytic
F analytic
C2MEAS analytic
EO> DDEF.DERIV_METHOD = NUMERIC
EO> DDEF.PERT = 1.0D-7
EO> DERIVATIVE
--block- --deriv- --pert size- --when update fails- --nonlinearity r. deviation
DDEF numeric 1e-007
C2S analytic
F analytic
C2MEAS analytic

Lets interactively analyze the Jacobian for block C2S and report errors for any
derivatives with relative errors greater than 0.1 using a perturbation size of 1.0E-
6.
EO> ANALYZE JACOBIAN 1.0, 1.0D-6, C2S
Analyzing C2S
Found 5 significant differences out of 6858 non-zeros
---i--- ----------equation---------- ----------variable---------- --analytic-- ---numeric--
148 C2S.BLKEQN_PHSEQBL_1_C2H4 C2S.BLK.CVAP_1.C2H6 -0.4405 -447.5
254 C2S.BLKEQN_PHSEQBL_3_C2H4 C2S.BLK.CVAP_3.C2H6 -1.969e-006 4.254e-007
3392 C2S.BLKEQN_PHSEQBL_59_C2H4 C2S.F.STR.MOLES 0.002919 -0.001528
3393 C2S.BLKEQN_PHSEQBL_59_C2H4 C2S.BLK.F.C2H4.FL_VMFRC 0.001769 0.0233
3403 C2S.BLKEQN_PHSEQBL_59_C2H4 C2S.BLK.EFF_1 -0.09316 0.01107

7 Objective Functions 113


8 Analysis

This chapter describes the OOMF Script commands used for analysis and
controlling the solver.

8 Analysis 114
Analysis Commands
These commands help you analyze your problem and can assist in debugging.

Checking Degrees of Freedom


This command prints the degrees of freedom for the problem. If no degrees of
freedom exist, then it will report that the problem is square. If there are too many
fixed variables, the problem is structurally singular and an equation name is listed.
If the listed equation were to be dropped, then the problem would become square.
If not enough fixed variables are assigned, then this command will report the
number of required specifications to completely determine the problem. If
variables are specified as independent, ANALYZE DOF will not count them as
fixed variables and will report the number of required specifications, including any
independent variables.

Input Language
ANALYZE DOF

Sensitivity Analysis
This command computes the sensitivity between a set of independent and
dependent variables. The sensitivity is the derivative or gain between the
variables. This can be very useful for analyzing flowsheet behavior or in control
system design. This output is sent to the HISTORY_DEVICE.

Input Language
SENSITIVITY obj [ depend ], [ indep ]

Input Language Description


obj Name of the objective function to compute sensitivity for. If omitted, the current
objective function is used.
depend Comma separated list of dependent variables. These variables must be calculated in
the current mode.
indep Comma separated list of independent variables. These variables must be fixed or
independent in the current mode.

Analyzing Variables
This command analyzes the structure of the problem and divides the variables into
a set of observable and unobservable variables and redundant and nonredundant
measurements. A variable is defined as observable or determinable if there are
sufficient measurements or fixed variables that will allow it to be determined
through the model. A measurement is defined as redundant if the variable
associated with it can be determined or estimated even in the absence of this
measurement.
A problem is well determined if there are no unobservable variables.

8 Analysis 115
Consider the following simple system:
X1 = X2 + X3
X3 = 1
X3 is determined from the second equation. However X1 and X2 cannot be
determined from the first equation. Therefore both are unobservable. If we fix X1
or X2 , then all the variables are observable.
If we attach measurement X2m to variable X2, then X2 can be estimated from its
measurement:
X2 = X2m
Then X1 can be computed from X2 and X3. Thus X2 becomes observable. However
this would not be possible without this measurement. Therefore measurement X2m
is nonredundant.
This report is written to the history device.

Input Language
ANALYZE VARIABLES obj, [ list ]

Input Language Description


obj Name of the objective function.
list Comma separated list of variables. If provided, the command will pick from the list the
minimum number of variables to fix to make the problem solvable.

Analyzing Equations
Equation analysis is a numerical tool that helps to troubleshoot problems with
singular jacobians by isolating the groups of equations which are linearly
dependent. These groups are unique and do not depend on any options for the LU
factorization. An equation is linearly dependent with other equations if it can be
reproduced by adding the other equations multiplied by appropriate factors.
A problem with linearly dependent equations can arise from:
An improperly written model.
A flowsheet with multiple solutions.
Combinations of free/fixed variables that cause two or more equations to
become similar. Either the specifications do not make sense, or the model has
design or coding flaws, or both.
Note that because this algorithm factorizes the Jacobian, you should evaluate the
jacobian before invoking this command. Also note that active bounds are not yet
considered.
This command reports groups of dependent equations. Each group defines a
cluster of equations that are dependent among themselves. The equations from
one group are not dependent with respect to the other groups. Generally
speaking, the more groups you have the more broken your problem is.
This report is written to the history device.

8 Analysis 116
Input Language
ANALYZE EQUATIONS

Examples of Analysis Commands


In this example, we take a simple feed block that is square and make a
specification change to show the output from the analysis commands. First, lets
look at the output when the problem is square:
EO> ANALYZE DOF
Problem is square

EO> EVALUATE JACOBIAN

EO> ANALYZE VARS


Number of observables (determined) : 1489
unobservables (undetermined): 0
Number of redundants : 3
nonredundants : 0
You have a well defined problem.

EO> ANALYZE EQNS


--------------------------------
REMINDER
Have you evaluated the Jacobian?
--------------------------------
Number of incident variables: 1492
Number of incident equations: 1492
Numerical rank : 1492
Structural rank : 1492
No linearly dependent equations were found.

8 Analysis 117
Now lets make a bad specification change by fixing an extra variable in a block.
This will create an overspecified problem:
EO> CVAP.BLK.COUT_PRES.SPEC = CONST>

EO> ANALYZE DOF


Problem is structurally singular. 1 too many specifications.
The following equations are unassigned:
STR.CVAP.BLK.CIN_PRES

EO> ANALYZE VARIABLES


Error. Problem is overspecified. Too many equations or too many fixed variables.
Number of included equations : 1492
Number of free variables : 1491

EO> ANALYZE EQUATIONS


Error. Problem is overspecified. Too many equations or too many fixed variables.
Number of included equations : 1492
Number of free variables : 1491

The DOF analysis indicates that the equation on the pressure drop has a problem,
which helps clue us in to our error.
An example of sensitivity analysis follows. This example is for a C2 Splitter tower
operating with fixed distillate and bottoms compositions. This analysis will tell us
the gain relationships between the compositions and the distillate flow and reflux
ratio. It also will tell us the gain with respect to the objective function (in this case
the profit of the tower).
SENSITIVITY [ C2S.BLK.DISTILLATE_MASS, \
C2S.BLK.REFL_RATIO_MASS ], \
[ C2S.D.STR.C2H6, \
C2S.B.STR.C2H4 ]
This will result in the following to be output to the current history device:
Sensitivity of ... with respect to: C2S.D.STR.C2H6
... C2S.BLK.DISTILLATE_MASS :0.43028D+05
... C2S.BLK.REFL_RATIO_MASS :-.16265D+04
... Objective function :0.64775D+03

Sensitivity of ... with respect to: C2S.B.STR.C2H4


... C2S.BLK.DISTILLATE_MASS :-.94086D+04
... C2S.BLK.REFL_RATIO_MASS :-.82312D+00
... Objective function :0.14463D-02

8 Analysis 118
Solver Commands
These commands are used to specify the solver and its parameters.

Setting the Solver


This command is used to select the solver to be used on the problem.

Input Language
SOLVER solver

Input Language Description


solver Name of the solver to use. A blank will print the current solver.
DMO DMO (default)
LSSQP LSSQP
NSOLVE NSOLVE
SPARSE SPARSE
The following solvers can be used to solve square problems:
DECOMP DMO DMO with group decomposition
DECOMP LSSQP LSSQP with group decomposition
DECOMP SPARSE SPARSE with group decomposition

Viewing Solver Settings


This command is used to view and change the settings of the solver.

Input Language
SOLVER SETTINGS parameter = value, parameter = value,

Input Language Description


parameter Name of the parameter to change. If no parameter is entered, this command will
list the current values of all the solver settings.
value Value for the entered parameter.

Entering DMO Parameters


This command enters values for DMO parameters. Current settings may be viewed
or changed with the SOLVER SETTINGS command.

Input Language
DMO.parameter = value

Input Language Description


parameter Name of the parameter to change.
value Value for the entered parameter.

8 Analysis 119
DMO Parameters
DMO Parameter Description
MAXITER Maximum number of SQP iterations allowed (default = 50).
MINITER Minimum number of SQP iterations allowed (default = 0).
CREEPFLAG Flag for the creep mode. This mode is very effective for making the optimizer moves more
conservative. It is very helpful when the problem diverges.
0 No (default)
1 Yes
CREEPITER Number of iterations to perform creep mode (default = 10).
CREEPSIZE Creep mode step size. This is the fraction of the full step to be taken when in creep mode
(default = 0.1).
SEARCHMODE Hessian initialization mode:
0 Aggressive mode. The Hessian is initialized with small values. This mode moves
the problem to its bounds faster than the normal mode and is the preferred mode
for highly constrained optimization problems with few degrees of freedom at the
solution.
1 Normal mode. The Hessian is initialized with the identity matrix (default).
2 Advanced mode. The Hessian is initialized with second order information. This
mode is recommended for problems with many degrees of freedom at the solution.
It is ideal for reconciliation problems.
3 Scaled mode. A combination of the Aggressive and Advanced modes.
Recommended for highly constrained optimization problems with few degrees of
freedom at the solution and a nonlinear objective function.
LINESEARCH Line search algorithm.
0 Exact penalty
1 Modified exact penalty method
2 Penalty with different weight update scheme
3 Penalty with modification for square cases (default)
4 Same as 3 modified to enforce bounds in square cases
FACTORSPEED LU factorization method.
1 Normal method. Optimizes pivot at every iteration (default).
2 Fast method. Uses original pivot sequence if possible. This can be faster. In some
cases (i.e. extreme phase changes) may cause additional factorization.
USEDROPTOL Flag to indicate the use of the nonzero drop tolerance.
0 Do not drop small nonzeroes (default)
1 Drop small nonzeroes
DROPTOL Nonzero drop tolerance used to remove small Jacobian values. A larger tolerance will
reduce the number of nonzeroes and decrease factorization time. If the value is too large,
then the accuracy of the Jacobian will be reduced. This may lead to an increase in the
number of iterations and/or singularities. (default = 1.0D-20)
SAVEJDFFILE Flag to save binary form of the Jacobian in the JDF file. This file is read by the solution
analysis, DMOSAT.
0 Do not save JDF file (default)
1 Save the JDF file
SCREENFORM Flag to modify the output format for the iteration log.
0 Format designed for direction into a file
1 Format designed for interactive screen observation (default)
HESSIANUPDATES Number of Hessian updates kept before resetting. (default = 10)
RIGORUPDATES Number of constraint updates before a rigorous analysis phase. (default = 25)
continued

8 Analysis 120
DMO Parameter Description
FACTORSPACE Parameter related to the workspace allocated for the solution of the linear system of
equations. Problems with excessive fill-in may require a higher number. (default = 6)
ACTIVESPACE Parameter related to the workspace allocated for part of the active set strategy. (default =
2)
PIVOTSEARCH Parameter related to the pivoting strategy. (default = 10)
VARSCALE Flag to indicate the use of variable scaling.
0 Do not scale variables
1 Scale variables (default)
PRINTFREQ Flag to indicate diagnostic printing level for variables and residuals.
-1 Minimum diagnostics (default)
1 Maximum diagnostics (including all variable and residual values at every iteration)
LUSTATS Flag to indicate diagnostic printing level for linear system.
0 No diagnostics (default)
1 Full diagnostics
QPSTATS Flag to indicate diagnostic printing level for the QP subproblem.
0 No diagnostics (default)
1 Full diagnostics
IWORKF Integer workspace parameter (default = 1.0)
RWORKF Real workspace parameter (default = 1.0)
RESCVG Residual convergence tolerance (default = 1.0D-6)
OBJCVG Objective function convergence tolerance (default = 1.0D-6)
ANALYSISTHRES Threshold parameter for a forced re-analysis of the problem structure. This number should
be higher in cases of a natural high fill-in such as highly heat integrated units. (default =
2.0)

Entering LSSQP Parameters


This command enters values for LSSQP parameters. Current settings may be
viewed or changed with the SOLVER SETTINGS command.

Input Language
LSSQP.parameter = value

Input Language Description


parameter Name of the parameter to change.
value Value for the entered parameter.

8 Analysis 121
LSSQP Parameters
LSSQP Description
Parameter
KPTLEV History print level.
4 Summary information at each iteration (default)
5 Independent and constrained variables, inactive equations, top scaled/unscaled variable
changes, top scaled/unscaled constraint residuals, top block RMS residuals, and top worst
merit function contributors when line search is required
6 Top worst merit function contributors
7 Full variable vector (potentially large amount of output)
8 Full constraint vector
KPFREQ Control the frequency of printing full variable/constraint vectors. The first and last vectors are
always printed when requested by KPLLEV (default=1).
KPNTOP Control the number of top entries to print in top entry outputs (default=10).
MAXITR Maximum number of SQP iterations allowed (default=30).
MINITR Minimum number of SQP iterations allowed (default=2).
RELEPS Relative optimization convergence tolerance as indicated in step 6 of the algorithm description
given above (default = 1.0D-4).
NFINFB Maximum number of feasibility corrections allowed to try to reduce constraint violations below
RFINFB after the optimization calculation is terminated (default = 5). If the constraint violations
are still greater than RFINFB after NFINFB corrections, the REZ file will state Problem converged
but residuals still too large, and the CONVERGED script parameter will be false. However, the
Kuhn-Tucker error is still satisfied.
RFINFB Tolerance on final constraint violations (default = 1.0D-6). See above.
NFEASB Maximum number of feasibility corrections allowed at each SQP iteration to try to keep constraint
violations below RFEASB (default = 2). The more feasibility corrections allowed, the more the
solution will become like a feasible-path optimization.
RFEASB Tolerance on iteration constraint violations (default = RFINFB for simulation, 1.0D-2 for other
modes). See above.
ITRBND Number of initial iterations when CHGBND instead of CHGMAX is used to limit search steps
(default = 3). This parameter, along with CHGBND, can be used to reduce the step size during the
initial iterations, thus keeping the optimization moves more conservative.
CHGBND Initial limit on the optimization step size. See above. The step size is limited such that k|dk|
CHGBND * max(1,|xk|). This is a relative step size limit. A negative value for CHGBND implies an
absolute step size limit (default=0.25).
CHGMAX Step size limit after the first ITRBND iterations. The step size is limited such that k|dk|
CHGMAX *max(1,|xk|) (default=0.5).
ALFALS Minimum step cutback ratio per line search iteration (default=0.25).
MAXLSC Maximum number of line search cutbacks allowed per SQP iteration. When this limit is reached, the
SQP iteration continues with the final step size (default=1 for simulation, 10 for other modes).
MAXLSF Maximum number of consecutive SQP iterations with line search failure before terminating LSSQP
(default=10 for simulation, 3 for other modes).
MAXQPF Maximum number of consecutive SQP iterations with QP failure before terminating LSSQP
(default=10).
GNPMAX An artificial weighting factor to drive the QP problem to the feasible region. In rare occasions, it
has to be increased to avoid a small feasibility index (default=1.0D6).
continued

8 Analysis 122
LSSQP Description
Parameter
MDHESS Hessian approximation option. Generally, this should only be changed for the DRPE case. The
options follow:
0 Use general BFGS update to approximate the Hessian.
2 Always calculate Gauss-Newton-type Hessian approximation.
3 Use Gauss-Newton-type Hessian approximation for initialization but update it with BFGS
update.
4 Selectively choose between BFGS update or Gauss-Newton-type Hessian approximation.
(default=2 for DRPE, 0 for all other modes).
LEWBAS Type of basis for range-space representation. Allowed options follow:
0 Orthogonal basis (potentially more stable) (default)
1 Coordinate basis (less overhead especially for problems with large degree of freedoms)
LSCOPT Line search options. Allowed options follow:
1 Same as option 3 for the first ITRBND iterations. Perform only step bounding with
CHGMAX thereafter.
2 Same as option 4 for the first ITRBND iterations. Perform only step bounding with
CHGMAX thereafter.
3 Exact penalty function.
4 Exact penalty function with Powells Watchdog relaxation (default).
5 Exact penalty function with second-order correction.
6 Exact penalty function with trust region control.
7 Exact penalty function with trust region control and second order correction.
IXSCS LSSQP internal variable and constraint scaling options. Allowed options follow:
0 No internal variable or equation scaling (in addition to the scaling performed by models
and/or executive)
3 Derive variable scaling from initial x0; derive constraint scaling from Jacobian
4 No variable scaling; derive constraint scaling from Jacobian (default)
5 Derive variable and constraint scaling simultaneously from Jacobian
For some problems, IXSCS=3 can provide an improvement in performance.
BNDAPP Approach to bounds allowed in one iteration (default=0.99).
QPINFE QP infeasible parameter. If QPINFE is positive and greater than the QP feasibility index, then a
new search direction is determined by minimizing the sum of absolute violations. This can be
helpful when trying to find a feasible solution to an initially infeasible optimization problem
(default=0.0).
KMUDEC Options for adjusting penalty parameters:
0 Do not allow penalty parameter to be decreased.
1 Allow penalty parameter to be decrease gradually (default).
2 Use Lagrange multiplier as penalty parameter. This may work better for some problems.
TOLBAS Threshold pivot tolerance when selecting a basis (default=0.1).
TOLANA Threshold pivot tolerance for the rare case of reanalyzing a matrix (default=0.1).
SPDROP Matrix elements with absolute value smaller than SPDROP are dropped by the sparse linear solver
(default=1.D-15).
SINGT1 Matrix elements with absolute value less than SINGT1 are not allowed to become pivot elements
when selecting a basis (default=1.D-8).
SINGT2 Matrix elements with absolute value less than SINGT2 are not allowed to become pivot elements
during numerical factorization (default=1.D-10).
NNDCMP Number of equality constraints that should not be used to eliminate variables (default=0).
DELTLS Actual to predicted merit function reduction ratio below which a line search step will be rejected
(default=0.1).
continued

8 Analysis 123
LSSQP Description
Parameter
BIGBND Big number to identify fake bounds (-BIGBND, BIGBND) (default=1.D20).
BNDADJ Adjustment to bounds to create a feasible region when a QP subproblem is infeasible (default=1.D-
5).
BSMALL Smallest diagonal in Choleskey decomposition of the projected Hessian (default=1.D-8).
SMLSCL Small number to limit scaling (default=1.D-8).
BIGSCL Big number to limit scaling (default=1.D10).
LCHBAS Allow basis changing. See below:
0 No
1 Yes (default)
BASFLP Growth of the largest sensitivity matrix element to trigger a new basis selection (default=100.).
Parameter LCHBAS must be 1. Set this number to a larger value to prevent LSSQP from
reselecting the basis.
TAUHYB Parameter for deciding whether to use Gauss-Newton-type Hessian approximation for MDHESS=4
(default=0.1).
LSIZEB Hessian sizing option. This is represented as a two-digit decimal number; each digit sets a
parameter:
0 Dont resize Hessian after first iteration; use identity matrix for initial Hessian.
1 Dont resize Hessian after first iteration; use FSCALF to scale initial Hessian.
10 Resize Hessian after first iteration; use identity matrix for initial Hessian.
11 Resize Hessian after first iteration; use FSCALF to scale initial Hessian (default).
FSCALF Initial Hessian scaling factor. If FSCALF is positive, the initial Hessian is set to FSCALF*I.
Otherwise, the initial Hessian is set to |FSCALF|*FSCALV*I where FSCALV is an estimate of the
magnitude of the objective function. If FSCALF is zero, a value of -0.1 is used (default=0.01).
RRLOW Low limit of yTs/sTBs to limit the BFGS update (default=0.2).
RRHIGH High limit of yTs/sTBs to limit the BFGS update (default=100.).
ETASKP Range-space to full step ratio above which BFGS update will be skipped (default=0.95).
VMUINI Initial line search penalty parameter (default=1.D-3).
VMUMIN Minimum line search penalty parameter (default=1.D-8).
VMUFAC Penalty parameter multiplier factor from Lagrange multiplier (default=2.).
MSFREQ Matrix scaling frequency.
0 No matrix scaling.
1 Scale matrix before a basis selection (default).
2 Scale matrix before an analyze call.
3 Scale matrix before both basis selection and analysis calls.
MSMETH Matrix scaling method.
0 Scale with MC19AD.
1 Scale with row and then column equilibration (default).
2 Scale with column and then row equilibration.
KOWARM Warm start the optimization, not supported. (default=0).
LUBNDS Bounds present flag:
0 No
1 Yes (default)
LINCST Linear constraint flag:
0 No (default)
1 Yes
continued

8 Analysis 124
LSSQP Description
Parameter
IFDTYP Finite-difference Hessian approximation type. The frequency of this calculation is determined by
IFDITR. This option allows the computation of the Hessian via perturbation of the independent
variables rather than through an updating method. However, it can be time consuming.
1 Projected Hessian, nonmultiplier version (default)
2 Same as 1 but drop bound contribution
3 Projected Hessian, multiplier version
4 Diagonal approximation, nonmultiplier version
5 Same as 4 but drop bound contribution
6 Diagonal approximation, multiplier version
IFDITR A single-integer parameter used to set to separate parameters: the finite difference frequency and
the first finite difference iteration number. This value is the finite difference frequency * 1000 +
first finite difference iteration number. For example, if IFDITR=5010, the first finite difference will
occur at iteration 10 and then every five iterations (default=0; no projected Hessian calculation).
ZPERTF Perturbation factor for projected Hessian calculation (default=1.0D-4).
NICHK Iteration count to check if the problem should be reinitialized. LSSQP checks the problem status at
the current iteration, INICHK iterations ago and 2*INICHK iterations ago. If the problem is not
making adequate progress, it is reinitialized. This causes the Hessian to be reset, the problem to
be rescaled, and a new basis to be selected (default=20).
KFOWDG Accumulated line search counts to force a watchdog step. This relaxes the line search criteria and
allows the merit function to decrease. LSSQP will search along this path for KBKOUT iterations. If
the merit function has not improved by then, LSSQP will backtrack to the iteration where the
watchdog took place and perform a line search. The watchdog relaxation technique can often help
converge the problem (default=10).
KBKOUT Number of iterations to wait for merit function to improve before backing out of a forced watchdog
relaxation (default=20).
NBDBAS Number of bound violations for insensitive dependent variables before basis switching
(default=10).
IFDTYP Numerical derivative option. Users should use the numerical derivative options provided by the
executive. Potential nonzeros in the gradient that are actual zeros should be set to small values for
options 2 and 4:
0 No numerical derivative calculation (default).
1 Use numerical derivative for Jacobian.
2 Use numerical derivative for Jacobian and gradient.
3 Verify Jacobian at the initial point.
4 Verify Jacobian and gradient at the initial point.
Numerical derivatives are computed using the following step size:
DPERTF max(|X|,XPMIN)
When using this option to verify the Jacobian, derivatives are reported with errors greater than:
DERDIF max( | analytic value |,| numerical value |, DERMIN )
DPERTF Relative perturbation size for numerical derivative calculation. See above (default=1.D-6).
XPMIN Absolute perturbation size for numerical derivative. See above (default=0.01).
DERDIF Relative tolerance for reporting derivative errors. See above (default=0.001).
DERMIN Absolute tolerance for reporting derivative errors. See above (default=0.01).

8 Analysis 125
Entering NSOLVE Parameters
This command enters values for NSOLVE parameters. Current settings may be
viewed or changed with the SOLVER SETTINGS command.

Input Language
NSOLVE.parameter = value

Input Language Description


parameter Name of the parameter to change.
value Value for the entered parameter.

NSOLVE Parameters
NSOLVE Parameter Description
Maximum_iterations Maximum number of allowed iterations (default=100).
Bound_iterations Maximum number of allowed consecutive iterations at which some of the variables
hit upper or lower bounds (default=20).
Divergent_steps Maximum number of allowed iterations at which the residual function vector
diverges (default=20).
Stable_iterations Number of initial iterations where the variable step sizes are controlled by
stabilization strategies such as Powells Dogleg or One Dimensional Line-Search
(default=4). Stabilization techniques are enforced on subsequent iterations only if
the steps are grossly divergent.
Stabilization Stabilization technique used for controlling the variable step sizes: 0= Powells
Dogleg and 1=One Dimensional Line-Search (default=1).
Check_steps Flag that indicates whether the 2-norm of the variable step vector needs to be
within the specified tolerance: 0=do not check for step sizes, 1=check for step sizes
(default = 1).
Print_level Iteration history printing level. Values higher than 4 print a detailed iteration history
in the solver report file (default = 4).
Function_tolerance Allowed tolerance on 2-norm of the residual function vector (default = 1.0D-6).
Maximum_function_error Maximum error allowed based on the 2-norm of the residual function vector (default
=1.0D30).
Variable_tolerance Allowed tolerance on variable step sizes based on the 2-norm of the variable step
vector (default = 0.01). This is used only if the parameter Check_steps=1.
Trust_radius Radius of the initial trust region measured as a ratio of the 2-norm of the variable
vector (default=0.1). This is used only with Powells Dogleg strategy (when
parameter Stabilization=0). The radius is automatically adjusted after each iteration
using Powells formula.

8 Analysis 126
Solving the Problem
This command begins the solution process.

Input Language
SOLVE objid

Input Language Description


objid Name of the objective function to solve.

Examples of Solver Commands


To declare LSSQP as the solver and set the maximum iterations to 20, enter:
SOLVER LSSQP
LSSQP.MAXITR = 20

Recovery Commands
These commands are used to restore the problem state after a failed solution.

Resetting Variables to Initial Values


This command sets every variable's Value attribute to the value in its Initial
attribute. Effectively, this resets the variable values to their state before the solve
command was issued.

Input Language
RESET VARIABLES
RESET VARS
RESET VAR

See Also
Aspen Plus Extensions - Recovery Commands

8 Analysis 127
9 Printing and Reports

This chapter describes the OOMF Script commands that let you print information
and create reports.

9 Printing and Reports 128


Printing Problem Information
These commands allow you to print general information about the problem.

Printing the Problem Summary


Prints a summary of the problem size to the report device. It also reports on the
degrees of freedom in the problem.

Input Language
PRINT SUMMARY

Printing Problem Convergence


Prints a summary of the convergence criteria. This includes the final convergence
status, the number of iterations, the objective and residual convergence functions,
the number of iterations and the initial and final values of the objective function.

Input Language
PRINT CONVERGENCE SUMMARY

Examples of Printing Problem


Information
This example of an interactive session shows the output from the PRINT
SUMMARY command.
EO> PRINT SUMMARY
Number of variables: 1526
Number of incident variables: 1523
Number of fixed variables: 32
Number of free variables: 1491
Number of equations: 1492
Number of included equations: 1492
Block equations: 1443
Connection equations: 49
Number of excluded equations: 0
Number of non-zeros: 7640
Number of incident non-zeros: 7261
Number of inactive connections: 0
Number of incomplete connections: 0

9 Printing and Reports 129


Problem is square
This example shows the output form the PRINT CONVERGENCE SUMMARY
command.
EO> PRINT CONVERGENCE SUMMARY
Convergence summary
-------------------
Status: Converged
Iterations: 7
Residual convergence: 3.861e-008
Objective convergence: 1.566e-007
Initial objective: 2.556
Final objective: 2.647

Formatted Printing
Formatted print is a powerful tool to allow you to create your own custom reports.

Print Formatted Command


This command allows the use of formatted printing to create custom reports.

Input Language
PRINT FORMATTED expression1 , expression2 , \ expression3 ,

Input Language Description


expression1 The format for the print. This must evaluate to a string data type. The format
may refer to a previously defined script parameter, in which case the & should
proceed the name in the PRINT command. The script parameter may be
defined with the SET command.
expression2 The data to print. The type of this data should match the corresponding data
type in the format string.

Note that in the above, the expressions are separated by commas and that the
commas must be surrounded by blanks. Expressions are discussed further in the
section titled Expressions and Conditionals.

9 Printing and Reports 130


The format string is based on the ANSI C library function PRINTF. The format
may contain literal characters as well as control characters. The control characters
are case sensitive and are as follows:
Control Description
Character
\n Indicates a carriage return, line feed. Format statements are not assumed to end
with a carriage return and line feed so you must use the \n at the end of the
format if you wish to move to a new line.
\t Horizontal tab (ASCII character HT).
\v Vertical tab (ASCII character VT).
\b Backspace (ASCII character BS).
\r Carriage return without linefeed (ASCII character CR).
\f Form feed (ASCII character FF).
\a Audible bell (ASCII character BEL).
\\ Backslash character (\).
%n.mf Indicates a field to print a real number in fixed format. n is the minimum field
width, and m specifies the number of digits to the right of the decimal. If m is
zero, no decimal point is printed. The default value for m is 6. If the magnitude
of the value youre printing is large enough, the minimum field width n may be
exceeded.
%n.me Indicates a field to print a real number in exponential format. n is the minimum
field width. The case of the e indicates the case of the exponential in the output.
m is the number of places to the right of the decimal. If m is zero, no decimal
point is printed. The default value for m is 6. The total number of spaces taken
by this format is MAX(n,m+6) (two spaces are allocated for the power term).
%n.mg Indicates a field to print a real number in general format. n is the minimum field
width. The case of the g indicates the case of the exponential in the output, if
any. m is the number of significant digits. Exponential (e) format is used if the
exponent is less than -4 or greater than or equal to m; otherwise, fixed (f)
format is used. Trailing zeros and a trailing decimal point are not printed. The
exponential format uses 5 spaces. Thus, to ensure a fixed space usage, set
n=m+5.
%nd Print an integer value. n is the minimum field width.
%no Print an integer value in octal.
%nx Print an integer value in hexadecimal. The case of the x indicates the case of the
hexadecimal letters.
%c Print an integer value as its equivalent ASCII character code.
%ns Indicates a field to print a string. n is the minimum field width. If the length of
the string is less than n, then the string is right justified.
%% Print a percent sign (%).

9 Printing and Reports 131


In the above formats, a flag may be placed between the percent sign (%) and the
format which indicates the following:
Flag Description
Left justify the value in the field.
+ Always print the value with its sign.
space If the first character is not a sign, a space will be prefixed.
0 Specifies padding of numeric values with leading zeros.
# Specifies an alternate output form. For o, the first digit will be zero. For x, 0x will be
prefixed to a non-zero result. For e, f, and g, the output will always have a decimal
point. For g, trailing zeros will not be removed.

Examples of Formatted Printing


In the following example, we print the values of two compositions. The format
used is placed directly in the PRINT command and surrounded by quotation
marks.
PRINT FORMATTED "Top Comp = %1.7f Btm Comp = %1.7f \n" ,\
C2SD.D.STR.C2H6 ,\
C2SB.B.STR.C2H4
This command creates the output:
Top Comp = 0.0001000 Btm Comp = 0.0050000
Note the use of the \n in the format to create the carriage return and line feed.
We can create a more complex output using a parameter for the format:
PRINT FORMATTED "Name Low Value Upper \n"
PRINT FORMATTED "---- --- ----- ----- \n"
SET FMT = "%-15s %-12.7g %-12.7g %-12.7g \n"
PRINT FORMATTED &FMT , "Top Comp" , \
MSMT.BLK.XD_PLANT.LOWER, \
MSMT.BLK.XD_PLANT, \
MSMT.BLK.XD_PLANT.UPPER

PRINT FORMATTED &FMT , "Btm Comp" , \


MSMT.BLK.XB_PLANT.LOWER, \
MSMT.BLK.XB_PLANT, \
MSMT.BLK.XB_PLANT.UPPER

9 Printing and Reports 132


This input creates a table of values:
Name Low Value Upper
---- --- ----- -----
Top Comp 1e-05 0.0001 0.0002
Btm Comp 0.001 0.015 0.05
Here, we use the s format for the string output and we use the g format for the
numbers. For the g format, we force the output to take up 12 spaces to keep the
table aligned regardless of the magnitude of the numbers. We use the - flag in
the format to left justify the output.

Miscellaneous Printing
Commands
This section includes a general purpose printing command.

The Echo Command


This command prints a string to the report device.

Input Language
ECHO expression

Input Language Description


expression An expression to echo. This may be a string in double quotes, a variable
attribute, a block attribute, an equation attribute, a parameter (preceded
by a & sign) or a mathematical expression.

A mathematical expression may include the operators:


+, -, *, /, ^, .
and the relational operators:
<, >, =, <>, <=, >=
as well as the functions:
ABS, LOGE, LOG10, COS, SIN, TAN, EXP, SQRT, INT, STRING2ID,
ID2STRING, TOUPPER, TOLOWER, LENGTH, SUBSTR, INDEX, INSERTSTR,
REMOVESTR, OPENFILE, OPENBINARY, DEVICEINFO, OPENTEE, VAL,
TYPEOF, DEFINED, HEAD, TAIL, BLOCKVARS, QUERYVARS,
ALIASESBYVAR, CONNECTIONSBYVAR, MEASUREMENTSBYVAR,
SPECGROUPSBYVAR
Expressions are discussed further in the section entitled Expressions and
Conditionals.

9 Printing and Reports 133


Examples of the Miscellaneous Printing
Commands
Echo a string to the terminal:
ECHO "THE PROBLEM IS SOLVED!"
Add two variables and print the value:
ECHO FDEF.STR.C2H4.FLOW + FDEF.STR.C2H6.FLOW

Report Commands
These commands are used to generate reports. Products that embed OOMF may
have additional commands.
See Also
Aspen Plus Extensions - Report Commands

Reporting Blocks
This command prints a report of the specified blocks to the report device.

Input Language
REPORT BLOCKS block_list

Input Language Description


block_list Optional comma-separated list of blocks to report. ALL will report all the
blocks. If omitted, all blocks in the current scope will be reported.

Reporting the Objective Function


This command writes a report for the objective function.

Input Language
REPORT OBJECTIVE objid

Input Language Description


objid Name of the objective function to report.

9 Printing and Reports 134


10 Units of Measure and
Physical Types

This chapter describes the OOMF script commands used to manipulate units of
measure, and lists the available units of measure and physical types.

10 Units of Measure and Physical Types 135


Units of Measure Commands
These commands allow you to change a variables units of measure.

Changing a Variable's Units of Measure


A variables units of measure may be changed by its UOM attribute. Note that this
only allows you to change the units of measure and not the physical type. Any
changes made at the OOMF prompt will be lost upon a subsequent EO
Reinitialization.

Input Language
variableid.UOM = {uom}

Input Language Description


variableid Variable name.
uom Units of measure. These units must be of the same physical type as the variable.

Printing Units of Measure


This command prints the specified units of measure. The type and conversion
coefficients from the internal (SI) units are shown.

Input Language
PRINT UOM {uom}
PRINT UOM FOR type

Input Language Description


uom String of the units of measure enclosed in braces.
type String of the physical type, which includes:
TEMPERATURE Temperature
DELTA-T Temperature change
PRESSURE Pressure
MOLE-FLOW Mole flow
MASS-FLOW Mass flow
ENTHALPY Specific enthalpy

Dealing with Untyped Variables


Some variables and script parameters may be untyped meaning that the units of
measure are {*}. This may make it difficult to perform calculations between
untyped variables and typed variables. The ## operator may be used to assign a
unit of measure to a variable that is untyped or to de-assign a unit of measure to
a variable that is typed. See the following section for examples.

10 Units of Measure and Physical Types 136


Input Language
variableid ## {uom}

Input Language Description


variableid Variable name.
uom Units of measure.

Example Units of Measure Commands


Below we change the units of measure of a temperature to degrees Fahrenheit:
C2S.BLK.TEMP_1.UOM = {F}
To print the available units of measure for temperature, enter:
PRINT UOM FOR TEMPERATURE
Let us assume that we wish to compare the untyped variable
MSMT.BLK.T1_PLANT, whose actual value is really in degrees Fahrenheit, to the
typed variable C2S.BLK.TEMP_1. We can do this with the ## operator:
IF ( MSMT.BLK.T1_PLANT ## {F} > C2S.BLK.TEMP_1 ) THEN
ECHO "TEMPERATURE IS TOO HIGH!"
ENDIF
The ## operator treats the untyped variable as a temperature variable in degrees
Fahrenheit. This could also have been done in the reverse manner:
IF ( MSMT.BLK.T1_PLANT > C2S.BLK.TEMP_1 ## {*} ) THEN
ECHO "TEMPERATURE IS TOO HIGH!"
ENDIF
Here are some more examples of the result of applying the ##:
EO> ECHO 10 {*} ## {F}
10 {F}

EO> ECHO 20 {*} ## {R}


20 {R}

EO> ECHO 10 {F} ## {*}


10 {*}

EO> ECHO 20 {R} ## {*}


20 {*}

10 Units of Measure and Physical Types 137


Units of Measure
The units available include the English engineering set (ENG), the International
System set (SI) and the metric engineering set (MET), as well as other common
units. The following table contains the set of available units.
Type of Units Code SI Set ENG Set MET Set Other Units Options
ANGLE 32 RAD DEG DEG
AREA 1 SQM SQFT SQM SQCM, SQIN, SQMILE, SQMM
AREA-PRICE 54 $/SQM $/SQFT $/SQM $/SQCM, $/SQIN, $/SQMILE,
$/SQMM
AREA-USAGE 62 SQM/SEC SQFT/HR SQM/HR SQM/DAY, SQM/YEAR
BOND-WORK-IN 34 J/KG KWHR/TON KWHR/TON KJ/KG
CHROM-VEL 69 M/SEC FT/SEC CM/HR
COMPOSITION 2 MOL-FR MOL-FR MOL-FR MASS-FR
CONTENTS 85 FRACTION PERCENT FRACTION PPM
COST-RATE 119 $/SEC $/HR $/HR $/MIN, $/DAY, $/YEAR, K$/HR,
K$/DAY, K$/YEAR, MM$/DAY,
MM$/YEAR
CURRENT 114 AMP AMP AMP MAMP
DELTA-T 31 K F K C, R, DELTA-K, DELTA-F,
DELTA-C, DELTA-R
DENSITY 3 KG/CUM LB/CUFT GM/CC LB/GAL, GM/CUM, GM/ML,
LB/BBL
DIFFUSIVITY 4 SQM/SEC SQFT/HR SQCM/SEC CS
DIMENSIONLES 44 UNITLESS UNITLESS UNITLESS UNTLESS, UNITLES
DIPOLEMOMENT 45 (J*CUM)**.5 (BTU*CUFT)**.5 DEBYE (KJ*CUM)**.5
ELEC-POWER 47 WATT KW KW
ELEC-PRICE 48 $/J $/KWHR $/KWHR
ENERGY 5 J BTU CAL KCAL, KWHR, FT-LBF, GJ, KJ,
N-M, MJ, MCAL, GCAL, MBTU,
MMBTU, HP-HR
ENERGY-PRICE 30 $/J $/BTU $/CAL $/KCAL, $/KWHR, $/FT-LBF,
$/GCAL, $/MMBTU, $/HP-HR,
$/MBTU, $/KJ, $/MJ, $/GJ,
$/N-M, $/MCAL
ENERGY-VOL 117 CUM/J BBL/BTU CUM/J BBL/MMBTU
ENTHALPY 6 J/KMOL BTU/LBMOL CAL/MOL J/KG, BTU/LB, CAL/GM,
MBTU/LBMOL
ENTHALPY-CYC 105 WATT/CYCLE BTU/CYCLE CAL/CYCLE J/CYCLE, GJ/CYCLE,
KCAL/CYCLE, MMKCAL/CYCLE,
MMBTU/CYCLE,
MMKCAL/CYCLE,
MMBTU/CYCLE, PCU/CYCLE,
MMPCU/CYCLE, KJ/CYCLE,
KW/CYCLE, GCAL/CYCLE
ENTHALPY-FLO 13 WATT BTU/HR CAL/SEC J/SEC, GJ/HR, KCAL/HR,
MMKCAL/HR, MMBTU/HR,
MMKCAL/DAY, MMBTU/DAY,
PCU/HR, MMPCU/HR, KJ/SEC,
KW, MW, GW, MJ/HR,
GCAL/HR, MBTU/HR,
GCAL/DAY

10 Units of Measure and Physical Types 138


Type of Units Code SI Set ENG Set MET Set Other Units Options
ENTHALPY-OPR 109 WATT/CYCLE BTU/OP-HR CAL/OP-SEC J/OP-SEC, GJ/OP-HR,
KCAL/OP-HR, MMKCAL/OP-HR,
MMBTU/OP-HR, MMKCAL/OP-
DAY, MMBTU/OP-DAY,
PCU/OP-HR, MMPCU/OP-HR,
KJ/OP-SEC, KW/CYCLE,
GCAL/OP-HR, GCAL/OP-DAY
ENTROPY 7 J/KMOL-K BTU/LBMOL-R CAL/MOL-K J/KG-K, BTU/LB-R, CAL/GM-K,
MJ/KMOL-K, KCAL/KMOL-K,
GCAL/KMOL-K, MBTU/LBMOL-
R
F-FACTOR 101 (KG-CUM)**.5/SEC (LB-CUFT)**.5/HR (GM-L)**.5/MIN (LB-GAL)**.5/MIN
FILTER-RESIS 35 1/METER 1/FT 1/METER 1/CM, 1/IN
FISCAL 8 $ $ $
FLOW 9 KG/SEC LB/HR KG/HR LB/SEC, MLB/HR, TONS/DAY,
MCFH, TONNE/HR, LB/DAY,
KG/DAY, TONS/HR, KG/MIN,
KG/YEAR, GM/MIN, GM/HR,
GM/DAY, MGM/HR, GGM/HR,
MGM/DAY, GGM/DAY, LB/MIN,
MMLB/HR, MLB/DAY,
MMLB/DAY, LB/YEAR,
MLB/YEAR, MMLB/YEAR,
TONS/MIN, MTONS/YEAR,
MMTONS/YEAR, L-TONS/MIN,
L-TONS/HR, L-TONS/DAY, ML-
TONS/YEAR, MML-TONS/YEAR,
KTONNE/YEAR
FLUX 61 CUM/SQM-SEC CUFT/SQFT-SEC L/SQM-SEC L/SQM-HR, GAL/SQFT-MIN
FLUX-HEAT-AR 120 WATT/SQM BTU/HR-SQFT CAL/SEC-SQM J/SEC-SQM, MMBTU/HR-SQFT,
KW/SQM
FLUX-MOLE 121 KMOL/SQM-S LBMOL/SQFT-HR KMOL/SQM-HR LBMOL/SQFT-S, MOL/SQCM-S
FORCE 14 NEWTON LBF DYNE
FREQUENCY 28 HZ RPM RPM RAD/SEC, RPS, KRPM,
MMRPM, RPH
HEAD 33 J/KG FT-LBF/LB M-KGF/KG SQM/SQSEC, INCH, FT,
METER, KJ/KG, KM-KGF/KG,
MFT, MJ/KG, MFT-LBF/LB, FT-
HEAD, METER-HEAD, INCH-
HEAD
HEAT 53 J BTU CAL KCAL, MMKCAL, MMBTU, PCU,
MMPCU, KJ, GJ, N-M, MJ,
MCAL, GCAL, MBTU, KW-HR
HEAT-FLUX 80 WATT/M BTU/HR-FT CAL/SEC-M J/SEC-M, MMBTU/HR-FT
HEAT-RATE-V 122 WATT/CUM BTU/HR-CUFT CAL/SEC-CUM J/SEC-CUM, MMBTU/HR-CUFT,
GJ/HR-CUM
HEAT-TRANS-C 16 WATT/SQM-K BTU/HR-SQFT-R CAL/SEC-SQCM-K KCAL/SEC-SQM-K, KCAL/HR-
SQM-K, PCU/HR-SQFT-K,
KW/SQM-K, J/SEC-SQM-K,
KJ/SEC-SQM-K, MMBTU/HR-
SQFT-R, KJ/SEC-SQM-C,
MJ/SEC-SQM-K, MJ/SEC-SQM-
C, GJ/HR-SQM-K, GJ/HR-SQM-
C, KCAL/HR-SQM-C, BTU/HR-
SQFT-F
INVERSE-AREA 78 1/SQM 1/SQFT 1/SQM

10 Units of Measure and Physical Types 139


Type of Units Code SI Set ENG Set MET Set Other Units Options
INVERSE-HT-C 87 SQM-K/WATT HR-SQFT-R/BTU SEC-SQCM-K/CAL SEC-SQM-K/KCAL, HR-SQM-
K/KCAL, HR-SQFT-K/PCU,
SQM-K/KW, SEC-SQM-K/J,
SEC-SQM-K/KJ
INVERSE-LENG 68 1/M 1/FT 1/CM 1/IN, 1/MM
INVERSE-PRES 82 SQM/N 1/PSI 1/ATM SQFT/LBF, 1/BAR, 1/TORR,
1/IN-WATER, SQCM/KG,
1/MMHG, 1/KPA, 1/MM-WATER
INVERSE-TEMP 81 1/K 1/R 1/K
INVERSE-TIME 59 1/SEC 1/HR 1/HR 1/MIN, 1/DAY, 1/YEAR
ITEM-PRICE 56 $/ITEM $/ITEM $/ITEM
LENGTH 17 METER FT METER CM, IN, MU, MM, MILE, KM,
ANGSTROM, MFT
LN-INV-TIME 60 LN(1/SEC) LN(1/HR) LN(1/HR) LN(1/MIN)
MASS 18 KG LB KG GM, TON, MLB, TONNE, L-
TON, MMLB
MASS-CONC 58 KG/CUM LB/CUFT GM/L GM/CC, MG/L, MG/CC
MASS-CYCL 102 KG/CYCLE LB/CYCLE KG/CYCLE LB/CYCLE, MLB/CYCLE,
TONS/CYCLE, GM/CYCLE,
TONNE/CYCLE, LB/CYCLE,
KG/CYCLE, TONS/CYCLE,
TONS/CYCLE
MASS-DENSITY 38 KG/CUM LB/CUFT GM/CC LB/GAL, GM/CUM, GM/ML
MASS-ENTHALP 40 J/KG BTU/LB CAL/GM KCAL/KG, MMKCAL/KG,
MMBTU/LB, PCU/LB,
MMPCU/LB, KJ/KG, MJ/KG,
GCAL/KG, MBTU/LB
MASS-ENTROPY 42 J/KG-K BTU/LB-R CAL/GM-K KCAL/KG-K, KJ/KG-K, MJ/KG-
K, GCAL/KG-K, MBTU/LB-R
MASS-FLOW 10 KG/SEC LB/HR KG/HR LB/SEC, MLB/HR, TONS/DAY,
GM/SEC, TONNE/HR, LB/DAY,
KG/DAY, TONS/YEAR,
TONS/HR, TONNE/DAY,
TONNE/YEAR, KG/MIN,
KG/YEAR, GM/MIN, GM/HR,
GM/DAY, MGM/HR, GGM/HR,
MGM/DAY, GGM/DAY, LB/MIN,
MMLB/HR, MLB/DAY,
MMLB/DAY, LB/YEAR,
MLB/YEAR, MMLB/YEAR,
TONS/MIN, MTONS/YEAR,
MMTONS/YEAR, L-TONS/MIN,
L-TONS/HR, L-TONS/DAY, ML-
TONS/YEAR, MML-TONS/YEAR,
KTONNE/YEAR
MASS-FLUX 70 KG/SQM-S LB/SQFT-HR KG/SQM-HR LB/SQFT-S, GM/SQCM-S,
KG/SQCM-S, MLB/SQFT-HR,
TONS/SQFT-HR, L-
TONS/SQFT-HR, TONNE/SQFT-
HR
MASS-HEAT-CA 49 J/KG-K BTU/LB-R CAL/GM-K KCAL/GM-K, PCU/LB-K, KJ/KG-
K
MASS-OPER 106 KG/OP-SEC LB/OP-HR KG/OP-HR LB/OP-SEC, MLB/OP-HR,
TONS/OP-DAY, GM/OP-SEC,
TONNE/OP-HR, LB/OP-DAY,
KG/OP-DAY, TONS/OP-YEAR,
TONS/OP-HR

10 Units of Measure and Physical Types 140


Type of Units Code SI Set ENG Set MET Set Other Units Options
MASS-PER-LEN 116 KG/M LB/FT KG/M
MASS-TRANS-C 66 KG/S-SQM-KG/CUM LB/HR-SQF-LB/CUF GM/S-SQCM-GM/CC
MASS-VOLUME 115 CUM/KG CUFT/LB CC/G BPD/MLBPH, CC/KG
MOL-FLOW-LEN 89 KMOL/SEC-M LBMOL/HR-FT KMOL/HR-M MOL/SEC-M, LBMOL/SEC-FT,
LBMOL/DAY-FT, KMOL/DAY-M,
MOL/MIN-M
MOLE-CONC 64 KMOL/CUM LBMOL/CUFT MOL/CC MOL/L, MMOL/CC, MMOL/L
MOLE-CYCL 103 KMOL/CYCLE LBMOL/CYCLE KMOL/CYCLE MMSCFH/CYCLE,
MMSCMH/CYCLE, MOL/CYCLE,
LBMOL/CYCLE, SCMH/CYCLE,
LBMOL/CYCLE, KMOL/CYCLE,
MMSCFD/CYCLE, SCFM/CYCLE
MOLE-DENSITY 37 KMOL/CUM LBMOL/CUFT MOL/CC LBMOL/GAL, MOL/L
MOLE-ENTHALP 39 J/KMOL BTU/LBMOL CAL/MOL KCAL/MOL, TCAL/MOL,
MMKCAL/MOL, MMBTU/LBMOL,
PCU/LBMOL, MMPCU/LBMOL,
KJ/KMOL, GJ/KMOL, MJ/KMOL,
KCAL/KMOL, GCAL/KMOL,
MBTU/LBMOL, BTU/SCF,
GCAL/MOL
MOLE-ENTROPY 41 J/KMOL-K BTU/LBMOL-R CAL/MOL-K KCAL/MOL-K, KJ/KMOL-K,
TCAL/MOL-K, MJ/KMOL-K,
KCAL/KMOL-K, GCAL/KMOL-K,
MBTU/LBMOL-R
MOLE-FLOW 11 KMOL/SEC LBMOL/HR KMOL/HR MMSCFH, MMSCMH, MOL/SEC,
LBMOL/SEC, SCMH,
LBMOL/DAY, KMOL/DAY,
MMSCFD, MSCFD, SCFM,
MOL/MIN, KMOL/KHR,
KMOL/MHR, MOL/HR,
MMOL/HR, MLBMOL/HR,
LBMOL/MHR, LBMOL/MMHR,
MSCFM, SCFH, MSCFH, SCFD,
NCMH, NCMD
MOLE-HEAT-CA 15 J/KMOL-K BTU/LBMOL-R CAL/MOL-K KCAL/MOL-K, TCAL/MOL-K,
PCU/LBMOL-K, KJ/KMOL-K
MOLE-OPER 107 KMOL/OP-SEC LBMOL/OP-HR KMOL/OP-HR MMSCF/CYCLE-HR,
MMSCM/CYCLE-HR, MOL/OP-
SEC, LBMOL/OP-SEC,
SCM/CYCLE-HR, LBMOL/OP-
DAY, KMOL/OP-DAY,
MMSCF/CYCLE-DAY,
SCF/CYCLE-MIN
MOLE-RXN-RATE 123 KMOL/CUM-S LBMOL/CUFT-HR KMOL/CUM-HR MOL/CC-S
MOLE-VOLUME 43 CUM/KMOL CUFT/LBMOL CC/MOL ML/MOL, BBL/MSCF
MOLES 51 KMOL LBMOL KMOL SCM, MMSCF, MSCF, MMSCM,
MOL, SCF
MOM-INERTIA 112 KG-SQM LB-SQFT KG-SQM GM-SQCM, LB-SQIN
NUM-CON-RATE 77 NO/CUM-SEC NO/CUFT-SEC NO/L-SEC NO/CC-SEC, NO/CUM-SEC,
NO/CUM-MIN, NO/CUFT-MIN,
NO/L-MIN, NO/CC-MIN,
NO/CUM-HR, NO/CUFT-HR,
NO/L-HR, NO/CC-HR
NUM-CONC 57 NO/CUM NO/CUFT NO/L NO/CC, 1E6/CC
PACK-FACTOR 76 1/M 1/FT 1/M

10 Units of Measure and Physical Types 141


Type of Units Code SI Set ENG Set MET Set Other Units Options
PDROP 75 N/SQM PSI ATM LBF/SQFT, BAR, TORR, IN-
WATER, KG/SQCM, MMHG,
KPA, MM-WATER, MBAR, IN-
WATER-60F, IN-HG, LB/FT-
SQSEC, KG/M-SQSEC, PA,
MPA, PSIA
PDROP-PER-HT 74 N/CUM IN-WATER/FT MM-WATER/M MBAR/M, MMHG/FT
POP-DENSITY 86 NO/M/CUM NO/FT/CUFT NO/M/L NO/MM/L, NO/MU/CC,
NO/IN/CUIN
POWER 19 WATT HP KW BTU/HR, CAL/SEC, FT-
LBF/SEC, MW, GW, MJ/HR,
KCAL/HR, GCAL/HR,
MMBTU/HR, MBTU/HR, MHP
POWER-VOLUME 65 WATT/CUM HP/CUFT KW/L KW/CUM
PRESSURE 20 N/SQM PSI ATM LBF/SQFT, BAR, TORR, IN-
WATER, KG/SQCM, MMHG,
KPA, MM-WATER, MBAR, PSIG,
ATMG, BARG, KG/SQCMG,
LB/FT-SQSEC, KG/M-SQSEC,
PA, MPA, PAG, KPAG, MPAG,
MBARG, IN-HG, MMHG-VAC,
IN-HG-VAC, IN-WATER-60F,
IN-WATER-VAC, IN-WATER-
60F-VAC, IN-WATER-G, IN-
WATER-60F-G, MM-WATER-G,
MM-WATER-60F-G, PSIA
RHO-VSQRD 110 KG/M-SQSEC LB/FT-SQSEC KG/M-SQSEC
SIEMENS-M 118 SIEMENS/M SIEMENS/FT SIEMENS/M SIEMENS/CM
SOLUPARAM 46 (J/CUM)**.5 (BTU/CUFT)**.5 (CAL/CC)**.5 (KCAL/CUM)**.5,
(KJ/CUM)**.5, (CAL/ML)**0.5
SOLUTE-PERM 72 SQM/M-S SQFT/FT-HR SQM/M-HR SQCM/CM-S, SQFT/FT-S
SOLVENT-PERM 71 KG/SQM-S-PA LB/SQFT-HR-ATM KG/SQM-HR-ATM GM/SQCM-S-ATM, GM/SQCM-
S-PA
SOUND-LEVEL 111 DECIBELS DECIBELS DECIBELS
SPEC-FLT-RES 36 METER/KG FT/LB METER/KG CM/GM
SPECIFICAREA 67 SQM/CUM SQFT/CUFT SQCM/CC
SURFACE-TENS 21 N/M DYNE/CM DYNE/CM LBF/FT, MN/M
TEMP-VOLUME 83 CUM-K/KMOL CUFT-R/LBMOL CC-K/MOL
TEMPERATURE 22 K F K C, R
THERMAL-COND 23 WATT/M-K BTU-FT/HR-SQFT-R KCAL-M/HR-SQM-K BTU-IN/HR-SQFT-R, C-
CM/SEC-SQCM-K, CAL-
CM/SEC-SQCM-K, BTU/HR-FT-
R, KCAL/HR-M-K, J/SEC-M-K,
KW/M-K
TIME 24 SEC HR HR DAY, MIN, YEAR, MONTH,
WEEK, NSEC
UA 50 J/SEC-K BTU/HR-R CAL/SEC-K KJ/SEC-K, KCAL/SEC-K,
KCAL/HR-K
UNIT-PRICE 29 $/KG $/LB $/KG $/TON, $/MLB, $/GM, $/L-
TON, $/TONNE, $/MMLB
USR-DUMMY0 90
USR-DUMMY1 91
USR-DUMMY2 92
USR-DUMMY3 93
USR-DUMMY4 94

10 Units of Measure and Physical Types 142


Type of Units Code SI Set ENG Set MET Set Other Units Options
USR-DUMMY5 95
USR-DUMMY6 96
USR-DUMMY7 97
USR-DUMMY8 98
USR-DUMMY9 99
VELOCITY 25 M/SEC FT/SEC M/SEC MILE/HR, KM/HR, FT/MIN,
MM/DAY, MM/HR, MM/DAY30,
IN/DAY
VFLOW-LENGTH 84 SQM/SEC GPM/FT SQCM/SEC SQM/HR, SQFT/MIN
VFLOW-RPM 100 CUM/SEC/RPM CUFT/HR/RPM L/MIN/RPM GAL/MIN/RPM, GAL/HR/RPM,
BBL/DAY/RPM, CUM/HR/RPM,
CUFT/MIN/RPM, BBL/HR/RPM,
CUFT/SEC/RPM,
CUM/DAY/RPM,
CUM/YEAR/RPM, L/HR/RPM,
KBBL/DAY/RPM,
MMCUFT/HR/RPM,
MMCUFT/DAY/RPM,
MCUFT/DAY/RPM, L/SEC/RPM,
L/DAY/RPM, CUM/MIN/RPM
VISCOSITY 26 N-SEC/SQM CP CP LB/FT-HR, MN-SEC/SQM, P,
GM/SEC-CM, DYN-SEC/SQCM,
PA-SEC
VOL-ENTHALPY 88 J/CUM BTU/CUFT CAL/CC KCAL/CUM, KJ/CUM,
MMBTU/BBL
VOL-HEAT-CAP 79 J/CUM-K BTU/CUFT-R CAL/CC-K KCAL/CUM-K, KJ/CUM-K
VOLTAGE 113 VOLT VOLT VOLT KVOLT
VOLUME 27 CUM CUFT L CUIN, GAL, BBL, CC, KCUM,
MCUM, MCUFT, MMCUFT, ML,
KL, MML, MGAL, MMGAL,
UKGAL, MUKGAL, MMUKGAL,
MBBL, MMBBL, KBBL, CUYD
VOLUME-CYCL 104 CUM/CYCLE CUFT/CYCLE L/CYCLE GAL/CYCLE, GAL/CYCLE,
BBL/CYCLE, CUM/CYCLE,
CUFT/CYCLE, BBL/CYCLE,
CUFT/CYCLE, CUM/CYCLE,
CUM/CYCLE, L/CYCLE,
KBBL/CYCLE, MMCUFT/CYCLE
VOLUME-FLOW 12 CUM/SEC CUFT/HR L/MIN GAL/MIN, GAL/HR, BBL/DAY,
CUM/HR, CUFT/MIN, BBL/HR,
CUFT/SEC, CUM/DAY,
CUM/YEAR, L/HR, KBBL/DAY,
MMCUFT/HR, MMCUFT/DAY,
MCUFT/DAY, L/SEC, L/DAY,
CUM/MIN, KCUM/SEC,
KCUM/HR, KCUM/DAY,
MCUM/SEC, MCUM/HR,
MCUM/DAY, ACFM, CUFT/DAY,
MCUFT/MIN, MCUFT/HR,
MMCUFT/HR, MGAL/MIN,
MMGAL/MIN, MGAL/HR,
MMGAL/HR, MBBL/HR,
MMBBL/HR, MBBL/DAY,
MMBBL/DAY

10 Units of Measure and Physical Types 143


Type of Units Code SI Set ENG Set MET Set Other Units Options
VOLUME-OPER 108 CUM/OP-SEC CUFT/OP-HR L/OP-MIN GAL/OP-MIN, GAL/OP-HR,
BBL/OP-DAY, CUM/OP-HR,
CUFT/OP-MIN, BBL/OP-HR,
CUFT/OP-SEC, CUM/OP-DAY,
CUM/OP-YEAR, L/OP-HR,
KBBL/OP-DAY, MMCUFT/OP-
HR
VOLUME-PRICE 55 $/CUM $/CUFT $/L $/CC, $/BBL, $/CUYD, $/KL,
$/CUIN, $/ML, $/MML, $/GAL,
$/MGAL, $/MMGAL, $/UKGAL,
$/MUKGAL, $/MMUKGAL,
$/KBBL, $/MCUFT, $/MMCUFT,
$/KCUM, $/MCUM, $/MBBL,
$/MMBBL
VOLUME-USAGE 63 CUM/SEC CUFT/HR L/HR L/DAY, L/YEAR, CUM/HR,
CUM/DAY, CUM/YEAR
WATER-RATE 73 KG/J LB/HP-HR KG/KW-HR
WORK 52 J HP-HR KW-HR FT-LBF, KJ, N-M, MJ, MBTU,
MMBTU, MCAL, GCAL

Most of the above units are self-explanatory. Units and unit parts that may require
explanation follow:
Units Description
MM Used as a prefix meaning million before many units, such as MMBTU =
million BTU.
M Used as a prefix meaning thousand with English units, such as Mlb
(thousand pounds) and Mscf (thousand standard cubic feet). With
metric/SI units, the M prefix represents Mega except with millimeters
and millinewtons.
SQ Used as a prefix meaning squared, as in SQFT (square feet).
CU Used as a prefix meaning cubed, as in CUM (cubic meters). The common
abbreviation CC is used for cubic centimeters.
G Used as a suffix on pressure units such as ATMG, BARG, PSIG,
KG/SQCMG, and IN-WATER-G. The G indicates gauge pressure (pressure
above standard atmospheric pressure).
VAC Used as a suffix on pressure units such as IN-WATER-VAC, indicating
vacuum pressure (pressure below standard atmospheric pressure).
Vacuum units are thus exactly negative of the corresponding gauge
pressure units.
IN-WATER, These units represent pressure in inches of water. IN-WATER is based on
IN-WATER-60F the density of water of 1 g/cc. IN-WATER-60F is based on the density of
water at 60 F.
MMKCAL Million kcal (same as GCAL)
MN MilliNewtons
MLB Thousand lbs
NCM Normal cubic meters (same as standard cubic meters).
NCMH Normal cubic meters per hour
NCMD Normal cubic meters per day
PCU Pound centrigrade unit
PSIA Absolute pounds per square inch. PSI is a synonym for PSIA.
SCF Standard cubic feet. Standard conditions for all standard cubic feet are
ideal gas at 14.696 psi and 60 degrees F.
SCFH Standard cubic feet per hour
SCFD Standard cubic feet per day

10 Units of Measure and Physical Types 144


Units Description
SCM Standard cubic meters. Standard conditions for all standard cubic meters
are ideal gas at 1 atm and 0 degrees C.
SCMH Standard cubic meters per hour
TONNE Metric ton (1000 kg)

Physical Types
Every model variable has a physical dimensionality (physical type) that is assigned
by the model developer. Each physical type has a corresponding integer code.
Type Code Physical Type
0 UNTYPED
1 AREA (SQM)
2 COMPOSITION
3 MASS-DENSITY (KG/CUM)
4 DIFFUSIVITY (SQM/SEC)
5 ENERGY (J)
6 ENTHALPY (J/KMOL)
7 ENTROPY (J/KMOL-K)
8 FISCAL ($)
9 FLOW (KG/SEC)
10 MASS-FLOW (KG/SEC)
11 MOLE-FLOW (KMOL/SEC)
12 VOLUME-FLOW (CUM/SEC)
13 ENTHALPY-FLO (WATT)
14 FORCE (N)
15 MOLE-HEAT-CA (J/KMOL-K)
16 HEAT-TRANS-C (WATT/SQM-K)
17 LENGTH (M)
18 MASS (KG)
19 POWER (WATT)
20 PRESSURE (N/SQM)
21 SURFACE-TENS (N/M)
22 TEMPERATURE (K)
23 THERMAL-COND (WATT/M-K)
24 TIME (SEC)
25 VELOCITY (M/SEC)
26 VISCOSITY (N-SEC/SQM)
27 VOLUME (CUM)
28 FREQUENCY (HZ)
29 UNIT-PRICE ($/KG)
30 ENERGY-PRICE ($/J)
31 DELTA-T (DELTA-K)
32 ANGLE (RAD)
33 HEAD (J/KG)
34 BOND-WORK-IN (J/KG)
35 FILTER-RESIS (1/M)

10 Units of Measure and Physical Types 145


Type Code Physical Type
36 SPEC-FLT-RES (M/KG)
37 MOLE-DENSITY (KMOL/CUM)
38 MASS-DENSITY (KG/CUM)
39 MOLE-ENTHALPY (J/KMOL)
40 MASS-ENTHALPY (J/kg))
41 MOLE-ENTROPY (J/KMOL/K)
42 MASS-ENTROPY (J/KG-K)
43 MOLE-VOLUME (CUM/KMOL)
44 DIMENSIONLESS
45 DIPOLEMOMENT (J*CUM)**0.5
46 SOLUPARAM (J/CUM)**0.5
47 ELEC-POWER (WATT)
48 ELEC-PRICE ($/J)
49 MASS-HEAT-CA (J/KG-/K)
50 UA (J/SEC-K)
51 MOLES (KMOL)
52 WORK (J)
53 HEAT (J)
54 AREA-PRICE ($/SQM)
55 VOLUME-PRICE ($/CUM)
56 ITEM-PRICE ($/ITEM)
57 NUM-CONC (NO/CUM)
58 MASS-CONC (KG/CUM)
59 INVERSE-TIME (1/SEC)
60 LN-INV-TIME (LN(1/SEC))
61 FLUX (CUM/SQM-SEC)
62 AREA-USAGE (SQM/SEC)
63 VOLUME-USAGE (CUM/SEC)
64 MOLE-CONC (KMOL/CUM)
65 POWER-VOLUME (WATT/CUM)
66 MASS-TRANS-C (KG/S-SQM-KG/CUM)
67 SPECIFICAREA (SQM/CUM)
68 INVERSE-LENG (1/M)
69 CHROM-VELOCITY (M/SEC)
70 MASS-FLUX (KG/SQM-SEC)
71 SOLVENT-PERM (KG/SQM-S-PA)
72 SOLUTE-PERM (SQM/M-S)
73 WATER-RATE (KG/J)
74 PDROP-PER-HT (N/CUM)
75 PDROP (N/SQM)
76 PACK-FACTOR (1/M)
77 NUM-CON-RATE (NO/CUM-SEC)
78 INVERSE-AREA (1/SQM)
79 VOL-HEAT-CAP (J/CUM-K)
80 HEAT-FLUX (WATT/M)
81 INVERSE-TEMP (1/K)
82 INVERSE-PRES (SQM/N)

10 Units of Measure and Physical Types 146


Type Code Physical Type
83 TEMP-VOLUME (CUM-K/KMOL)
84 VFLOW-LENGTH (SQM/SEC)
85 CONTENTS (FRACTION)
86 POP-DENSITY (NO/M/CUM)
87 INVERSE-HT-C (SQM-K/WATT)
88 VOL-ENTHALPY (J/CUM)
89 MOLE-FLOW-LEN (KMOL/SEC-M)
90 USR-DUMMY0
91 USR-DUMMY1
92 USR-DUMMY2
93 USR-DUMMY3
94 USR-DUMMY4
95 USR-DUMMY5
96 USR-DUMMY6
97 USR-DUMMY7
98 USR-DUMMY8
99 USR-DUMMY9
100 VFLOW-RPM (CUM/SEC/RPM)
101 F-FACTOR (KG-CUM)**0.5/SEC
102 MASS-CYCL (KG/CYCLE)
103 MOLE-CYCL (MOL/CYCLE)
104 VOLUME-CYCL (L/CYCLE)
105 ENTHALPY-CYC (J/CYCLE)
106 MASS-OPER (KG/OP-SEC)
107 MOLE-OPER (MOL/OP-SEC)
108 VOLUME-OPER (L/OP-MIN)
109 ENTHALPY-OPR (J/OP-SEC)
110 RHO-VSQRD (KG/M-SQSEC)
111 SOUND-LEVEL (DECIBELS)
112 MOM-INERTIA
113 VOLTAGE (VOLT)
114 CURRENT (AMP)
115 MASS-VOLUME (CUM/KG)
116 MASS-PER-LEN
117 ENERGY-VOL
118 SIEMENS-M
119 COST-RATE
120 FLUX-HEAT-AR
121 FLUX-MOLE
122 HEAT-RATE-V
123 MOLE-RXN-RATE

10 Units of Measure and Physical Types 147


11 Aspen Plus Extensions

Aspen Plus embeds OOMF and extends its equation oriented capabilities. The
following sections explain how to use OOMF and these extensions from within the
Aspen Plus user interface or the engine.

Using the Interactive Prompt


You can enter script commands interactively into the OOMF kernel. This is done in
two ways:
From the Aspen Plus user interface
From the Control Panel, set the strategy to Sequential Modular and solve
the problem. Then switch the strategy to Equation Oriented. This will
synchronize the EO strategy. Commands may be typed at the Command
Line near the bottom of the Control Panel.
From IAP
Add the SIMULATE INTERACTIVE = YES command to the INP file. From
the Simulation Engine window, enter ASPEN filename. When the A+
prompt appears enter GO to solve the Sequential Modular strategy. When
complete, enter SYNCEO to synchronize the Equation Oriented strategy.
Then enter the TOEO command to switch to the EO strategy. The EO
prompt appears. At this point, the EO plant is built and all blocks,
connections, specification groups, etc. are instantiated.
See Also
Standard OOMF - Using the Interactive Prompt

Defining and Executing Scripts


Defining Scripts
Scripts may be defined in the following ways:
An external file that may be created with a standard text editor. The extension
of the file should be EBS.
Scripts may be defined within the Aspen Plus user interface as a LOCAL script
or a GLOBAL script. In the Aspen Plus user interface there is an object
manager for each of these at the flowsheet level and at each hierarchy level.
When you define a script in this manner, you type your script commands into a

11 Aspen Plus Extensions 148


text box in the Aspen Plus user interface. Input in the Aspen Plus user
interface may go to column 118. Commands beyond this point are wrapped in
the text box. The scripts are saved with the rest of the flowsheet input. Local
scripts are available only within the scope where they are defined. Global
scripts are available everywhere, regardless of scope. More information on
hierarchies and scope may be found in chapter 3 Hierarchies, Blocks,
Variables, and Equations.
Scripts may be defined in the INP (input language) file. Input in the INP file
must skip column one and may go to column 80. The script follows a line with
a GLOBALSCRIPT or LOCALSCRIPT keyword and the script name; this line
begins in column one. Use the following format:
GLOBALSCRIPT scriptname
SCRIPT 'first script line' / 'second script line' / &
'third script line' / &
'fourth script line' / 'fifth script line'
For more information on using scripts in the INP file, see Chapter 48 of the
Aspen Plus Input Language Guide.

Executing Scripts
Scripts may be executed in a number of ways:
By manually executing the script from the command line or from another
script. This may be done with the INVOKE, INVOKELOCAL and
INVOKEGLOBAL commands.
By associating the script with a block or the flowsheet. This is done by
assigning the script as a method attached to the block. A method is a function
that is called at specific times during the execution sequence of OOMF. The
following methods are available:
INIT This method is executed when the block is created and is available for all
blocks except hierarchies.
PRESOLVE This method is executed before a solve is started. It can be very useful for
defining run-specific information, such as process data.
POSTSOLVE This method is executed after a solve is completed. This is useful for checking
the results of the run and writing customized reports.
MIXSOLVE This method is executed before solving the EO hierarchy block it is attached to
within a Mixed Mode run. Only available for hierarchies within Aspen Plus.
The script that is assigned as the block method may be an external file, a local
script or a global script.
You may also manually execute a blocks script method with the INVOKE
command.
More on invoking scripts may be found in Invoke Commands.

See Also
Standard OOMF - Defining and Executing Scripts

11 Aspen Plus Extensions 149


Command Summary
In addition to the generic OOMF commands mentioned in previous sections, the
following commands are available within the Aspen Plus environment.

EO Commands
Command Purpose
APPLY SOLVER SETTINGS Apply the solver settings from the input file to the current mode.
DISABLE HXFLUX Disable all Hxflux connections in the local scope.
DISABLE STREAM Disable all streams in the local scope.
ENABLE HXFLUX Enable all Hxflux connections in the local scope.
ENABLE STREAM Enable all streams in the local scope.
HXFLUX Turn on/off Aspen Plus Hxflux connections
INVOKEGLOBAL Execute commands in a GLOBALSCRIPT
INVOKELOCAL Execute commands in a LOCALSCRIPT from block script
PRINT COMPONENT LIST Print the list of components in a component group.
RECOVER Recover from a bad EO solution by calling every block's pre and post-solve steps
REPORT ALL Print a report for blocks and streams
REPORT APBLK Report on overall work requirements for blocks and thermo
REPORT FLOWSHEET Make an Aspen Plus flowsheet report
REPORT FULL Print a full Aspen Plus report for the current set of blocks and streams
REPORT STREAMS Print an Aspen Plus stream report
SETCOMPLIST Set the list of components in a component group to a variable.
STREAMS Turn on/off AspenPlus stream connections
SYNCHRONIZE Synchronize an Aspen Plus block with its block bead
UPDATE BLEND Update the crude assays
UPDATE PDF Update the AspenPlus PDF

See Also
Standard OOMF - Command Summary

Invoke Commands
These commands allow you to call, or invoke, other scripts. These may be scripts
that have been entered in the Aspen Plus user interface or external files.

Invoking a Local Script


A local script may be invoked with this command. Local scripts are available only
within the scope where they are defined.
You may pass arguments to the invoked script and get a returned value.

Input Language
INVOKELOCAL scriptid, arg1, arg2,

11 Aspen Plus Extensions 150


Input Language Description
scriptid Name of a local script to execute.
arg1, Optional list of arguments passed to the script. This may be referenced in the invoked
arg2 script as &ARG1, &ARG2 etc. These are local script parameters and thus only
available within the invoked script. The total number of arguments passed to the
script file is available as &ARGC. The value returned to the invoking script is
available as &RET_VALUE.

Invoking a Global Script


A global script may be invoked with this command. Global scripts are available
everywhere, regardless of the scope where they are defined.
You may pass arguments to the invoked script and get a returned value.

Input Language
INVOKEGLOBAL scriptid, arg1, arg2,

Input Language Description


scriptid Name of a global script to execute.
arg1, Optional list of arguments passed to the script. This may be referenced in the invoked
arg2 script as &ARG1, &ARG2 etc. These are local script parameters and thus only
available within the invoked script. The total number of arguments passed to the
script file is available as &ARGC. The value returned to the invoking script is available
as &RET_VALUE.

See Also
Standard OOMF - Invoke Commands

Miscellaneous Commands
Specific to Aspen Plus
Updating Crude Blends
This command is used to update the crude assays.

Input Language
UPDATE BLEND

Updating the PDF


The PDF is a binary file that contains all the problem information. This file is
written by Aspen Plus with a filename extension of APPDF. You can update this file
with this command.

Input Language
UPDATE PDF

11 Aspen Plus Extensions 151


Hierarchies
Aspen Plus has the following extensions that make it easier for a user to create
hierarchies.
See Also
Standard OOMF - Hierarchies

How are Hierarchies Created?


Hierarchies are created through the Aspen Plus user interface or input language by
placing a hierarchy block onto the flowsheet. When you double click on the
hierarchy, a flowsheet diagram of the hierarchy appears. Blocks may be placed
into the hierarchy in the same manner as at the flowsheet level.

Hierarchy Input
Hierarchies have sets of input that are similar to what can be defined for an entire
flowsheet. These include:
Property methods.
Streams.
Blocks.
Convergence options, such as EO solver parameters.
Flowsheeting Options, such as measurement blocks.
EO Configuration, such as EO input, Objective functions, Spec Groups, and
Connections.
The type of input that may be entered for an EO configuration item is limited by
the scope.

Stream Commands
Adding and Removing Stream
Connections
This command controls all the Aspen Plus stream connections within the current
scope.

Input Language
STREAMS status

Input Language Description


status Stream connection status. ALL indicates that all stream connections in the current
scope are to be added to the problem. NONE indicates that all the stream
connections in the current scope are to be removed from the problem (they will not
appear on the Inactive connection list). With no argument, all the active stream
connections in the current scope are printed to the current report device.

11 Aspen Plus Extensions 152


Disabling Stream Connections
This command is used to disable all Aspen Plus stream connections in the current
scope.
When the stream connections are disabled, Spec Management automatically
reprocesses all the Connections and Spec Groups to ensure that the problem
remains square. (The Status on the GUI is not updated until an Incremental Build
or Solve is performed.)

Input Language
DISABLE STREAMS

Enabling Stream Connections


This command is used to enable all Aspen Plus stream connections in the current
scope. It does the reverse of the DISABLE STREAMS command discussed in the
previous section.

Input Language
ENABLE STREAMS

Examples of Stream Commands


To fix stream C2SD in block C2S:
C2S.C2SD.STR.SPEC = CONST
See Also
Standard OOMF - Stream Commands

HXFlux Commands
These commands are used to control the connections configured for HXFlux
blocks. These commands only affect the HXFlux connections defined through the
blocks input form and not connections defined through EO Configuration |
Connection forms.

Controlling HXFlux Connections


This command is used to view, remove and restore previously removed HXFlux
temperature connections within the current scope.
When the status of an HXFlux connection is changed, Spec Management
automatically reprocesses all the Connections and Spec Groups to ensure that the
problem remains square. (The Status on the GUI is not updated until an
Incremental Build or Solve is performed.)

Input Language
HXFLUX status

11 Aspen Plus Extensions 153


Input Language Description
status HXFlux connection status. ALL indicates that all HXFlux temperature
connections in the current scope are to be added to the problem. NONE
indicates that all the HXFlux temperature connections in the current
scope are to be removed from the problem (they will not appear on the
Inactive connection list). With no argument, all the active HXFlux
temperature connections in the current scope are printed to the current
report device. (Note that this list does include connections defined
through the EO Configuration | Connection forms, though these are
not disabled by the HXFLUX NONE command.)

Disabling HXFlux Connections


This command is used to disable HXFlux temperature and duty connections within
the current scope. The disabled connections will appear in the Inactive connection
list.
When the status of an HXFlux connection is changed, Spec Management
automatically reprocesses all the Connections and Spec Groups to ensure that the
problem remains square. (The Status on the GUI is not updated until an
Incremental Build or Solve is performed.)

Input Language
DISABLE HXFLUX
This command disables both the temperature and duty connections for all HXFlux
blocks in the current scope. A PRINT INACTIVE CONNECTIONS command will
show the disabled connections. This command no effect on connections defined
through the EO Configuration | Connection forms.

Enabling HXFlux Connections


This command is used to enable previously disabled HXFlux temperature and duty
connections within the current scope.
When the status of an HXFlux connection is changed, Spec Management
automatically reprocesses all the Connections and Spec Groups to ensure that the
problem remains square. (The Status on the GUI is not updated until an
Incremental Build or Solve is performed.)

Input Language
ENABLE HXFLUX

Input Language Description


This command enables both the temperature and duty connections for all HXFlux
blocks in the current scope that have been previously disabled. This command no
effect on connections defined through the EO Configuration | Connection
forms.
See Also
Standard OOMF - Connection Commands

11 Aspen Plus Extensions 154


Recovery Commands
These commands are used to restore the problem state after a failed solution.

Recovery
This command calls every block's pre and post-solve methods. This command was
introduced because Aspen Plus blocks use their post-solve method to update SM
block values after an EO solution. If the EO solution does not converge, the EO
variable values are bad and the SM data is corrupted with bad values. In order to
recover the state of the flowsheet, you must use the RESET VARIABLES command
to restore the EO variable values, followed by this command.

Input Language
RECOVER
RECOVERFROMBADSOLUTION
See Also
Standard OOMF - Recovery Commands

Report Commands
These commands are used to generate an Aspen Plus report.

Reporting Everything
These commands print Aspen Plus report files. REPORT ALL prints information on
the current scope level only (not into any hierarchies). REPORT FULL prints
information on the complete flowsheet, regardless of the current scope.

Input Language
REPORT ALL
REPORT FULL

Reporting the Flowsheet


This command prints a report of the flowsheet to the report device. This includes
the flowsheet connectivity by streams and blocks.

Input Language
REPORT FLOWSHEET

Reporting Streams
This command prints a report of the specified streams to the report device.

11 Aspen Plus Extensions 155


Input Language
REPORT STREAMS stream_list

Input Language Description


stream_list Optional comma separated list of streams to report. ALL will report all
the streams. If omitted, all streams at the current scope level will be
reported.

See Also
Standard OOMF - Report Commands

11 Aspen Plus Extensions 156


12 Aspen Custom Modeler
Models Related Extensions

Models exported from Aspen Custom Modeler may be instantiated in standalone


OOMF or in products that embed OOMF. In order to use these extensions, you
must ensure that the AMSystem core component is installed on your PC. This
happens automatically when you install Aspen Plus, Aspen Custom Modeler, or
products related to ACM. The following sections explain how to instantiate a model
exported from ACM in OOMF.

Using the Interactive Prompt


You can enter script commands interactively into the OOMF kernel.
1 Click Start | Run, type cmd and click OK to open a command window.
2 Add the path to the folder that contains oomf.exe (typically C:\Program
Files\AspenTech\OOMF\version\Xeq) and the path to the folder that contains
acmexp.dll (typically C:\Program Files\AspenTech\AMSystem version\Bin) to
the current path environment variable. For example:
set path= C:\Program Files\AspenTech\OOMF\2004\Xeq;C:\Program
Files\AspenTech\AMSystem 2004\Bin;%path%
3 Type oomf.exe and press enter.
You can now type commands at the OOMF prompt.

See Also
Standard OOMF - Using the Interactive Prompt

Adding an ACM Model to OOMF


You can instantiate models exported from ACM in OOMF by using acmexp.dll. The
acmexp.dll is an OOMF compatible model adapter DLL that will enable you to load
ACM models into OOMF.
1 Export the model from ACM and install it on your PC by following the
instructions given in the ACM user guide.

12 Aspen Custom Modeler Models Related Extensions 157


The examples which follow assume that the name of the model that you exported
is MyModel, it does not require physical property evaluations, and the model DLL
was installed in the folder
C:\Program Files\AspenTech\AMModels\13.1\MyModel\

The italic sections in these examples should be updated to match your situation.
2 Start an interactive OOMF session as per the instructions in the previous
section.
3 Load the acmexp library into OOMF by issuing the command:
load library "acmexp"
4 Instantiate the model in OOMF by issuing either of the following commands:
add block b1 as acmexp("model=mymodel,library=mymodel,path=C:\Program
Files\AspenTech\AMModels\13.1\MyModel")
or
add block b1 as acmexp("model=C:\Program
Files\AspenTech\AMModels\13.1\MyModel\MyModel")
5 Pick a solver to solve the model by issuing the command:
solver sparse
6 Solve the current simulation by issuing the command
solve
7 Quit the OOMF session by issuing the command
quit

If the exported ACM model requires Aspen Properties to evaluate physical


properties of components, then review the example applications listed in the
document titled A Programmers Guide to OOMF that illustrate the steps needed to
load the components listed in an Aspen Properties file, implement a host
component list manager, and analyze the simulation.

12 Aspen Custom Modeler Models Related Extensions 158


13 Aspen RefSYS Extensions

Aspen RefSYS embeds OOMF and extends its equation oriented capabilities. In
Aspen RefSYS, OOMF is used for the equation-oriented simulation of the refinery
reactor models. The following sections explain how to use OOMF and these
extensions from within the Aspen RefSYS user interface.

Using the Interactive Prompt


A live OOMF kernel can be accessed from the Aspen RefSYS user interface via the
Solver Console page of the Reactor Section tab in the main workbook, or
Operation tab in the subflowsheet workbook. Commands may be typed at the
Script Command Line text box near the bottom of either page.
See Also
Standard OOMF - Using the Interactive Prompt

Command Summary
In addition to the generic OOMF commands mentioned in previous sections, the
following commands are available within the Aspen RefSYS environment. These
commands are implemented in the OOMF loadable DLL called refcmds.

EO Commands
Command Purpose
CONNECTIONSTATUS Set the status of a connection to a parameter.
Usage: connectionstatus [connection_name,parameter_name]
Use echo &parameter_name to view the contents of the parameter.
Note that a specgroup, meas, var, and stream connection name may be used..
INITAPROP Initialize Aspen Properties and load an aprpdf file.
Usage: initaprop "name of the aprpdf or appdf".
SWAPPROP Swap the Aspen Properties property method and option set.
Usage: swapprop "FCC" or "CATREF" or "HCR"
VARSINSPECGROUP Set the variable names and specs of variables in a specgroup to a parameter.
Usage: varsinspecgroup [specgroup_name, parameter_name].
Use echo &parameter_name to view the contents of the parameter.

See Also
Standard OOMF - Command Summary

13 Aspen RefSYS Extensions 159


General Information

This section provides Copyright details and lists any other documentation related
to this release.

Copyright
Version Number: 2004.1

April 2005
Copyright 1981 2005 Aspen Technology, Inc. All rights reserved.
Aspen Accounting.21, Aspen ACOL, Aspen Adsim, Aspen Advisor, Aspen Aerotran, Aspen Alarm & Event, Aspen APLE, Aspen Apollo,
Aspen AssetBuilder Optimizer, Aspen AssetBuilder Planner, Aspen AssetBuilder Site Optimizer, Aspen AssetBuilder, Aspen Batch Plus,
Aspen Batch.21, Aspen Batch.21CBT, Aspen BatchCAD, Aspen BatchSep, Aspen Blend Model Library, Aspen Blend, Aspen Calc CBT,
Aspen Capable-to-Promise, Aspen CatRef, Aspen Chromatography, Aspen Cim-IO Interfaces, Aspen Cim-IO Monitor, Aspen Cim-IO for
@AGlance, Aspen Cim-IO for ABB 1190, Aspen Cim-IO for Bailey SemAPI, Aspen Cim-IO for DDE, Aspen Cim-IO for Eurotherm Gauge via
CDP, Aspen Cim-IO for Fisher-Rosemount Chip, Aspen Cim-IO for Fisher-Rosemount RNI, Aspen Cim-IO for Foxboro FOXAPI, Aspen Cim-IO
for G2, Aspen Cim-IO for GE FANUC via HCT, Aspen Cim-IO for Hitachi Ex Series, Aspen Cim-IO for Honeywell TDC 3000 via HTL/access,
Aspen Cim-IO for Intellution Fix, Aspen Cim-IO for Measurex MCN, Aspen Cim-IO for Measurex ODX, Aspen Cim-IO for Moore Apacs via Nim
(RNI), Aspen Cim-IO for PI, Aspen Cim-IO for RSLinx, Aspen Cim-IO for SetCim/InfoPlus-X/InfoPlus.21, Aspen Cim-IO for Toshiba Tosdic,
Aspen Cim-IO for ULMA 3D, Aspen Cim-IO for Westinghouse, Aspen Cim-IO for WonderWare InTouch, Aspen Cim-IO for Yokogawa
ACG10S, Aspen Cim-IO for Yokogawa EW3, Aspen Collaborative Forecasting, Aspen Compliance.21, Aspen COMThermo TRC Database,
Aspen COMThermo, Aspen Crude Trading & Marketing, Aspen Custom Modeler, Aspen Decision Analyzer, Aspen Demand Manager, Aspen
DISTIL, Aspen Distribution Scheduler, Aspen DMCplus, Aspen DMCplus CBT, Aspen DMCplus Composite, Aspen DPO, Aspen Dynamics,
Aspen eBRS, Aspen ERP Connect, Aspen FCC, Aspen FIHR, Aspen FLARENET, Aspen Fleet Operations Management, Aspen FRAN, Aspen
Fuel Gas Optimizer, Aspen Grade-IT, Aspen Harwell Subroutine Library, Aspen Hetran, Aspen HTFS Research Network, Aspen HX-Net
Operations, Aspen HX-Net, Aspen Hydrocracker, Aspen Hydrotreater, Aspen HYSYS Amines, Aspen HYSYS Crude, Aspen HYSYS Data
Rec, Aspen HYSYS Dynamics, Aspen HYSYS Johnson Matthey Reactor Models, Aspen HYSYS OLGAS 3-Phase, Aspen HYSYS OLGAS, Aspen
HYSYS OLI Interface, Aspen HYSYS Optimizer, Aspen HYSYS Tacite, Aspen HYSYS Upstream Dynamics, Aspen HYSYS Upstream, Aspen
HYSYS, Aspen Icarus Process Evaluator, Aspen Icarus Project Manager, Aspen InfoPlus.21, Aspen Inventory Management & Operations
Scheduling, Aspen Inventory Planner, Aspen IQmodel Powertools, Aspen IQ, Aspen Kbase, Aspen Lab.21, Aspen MBO, Aspen MPIMS,
Aspen Multivariate Server, Aspen MUSE, Aspen OnLine, Aspen Operations Manager - Event Management, Aspen Operations Manager -
Integration Infrastructure, Aspen Operations Manager - Integration Infrastructure Aspen Advisor, Aspen Operations Manager - Integration
Infrastructure Aspen Orion, Aspen Operations Manager - Integration Infrastructure Aspen PIMS, Aspen Operations Manager - Integration
Infrastructure Aspen Utilities, Aspen Operations Manager - Integration Infrastructure Base, Aspen Operations Manager - Integration
Infrastructure COM, Aspen Operations Manager - Integration Infrastructure Files, Aspen Operations Manager - Integration Infrastructure
IP.21, Aspen Operations Manager - Integration Infrastructure IP.21/SAP-PPPI, Aspen Operations Manager - Integration Infrastructure OPC,
Aspen Operations Manager - Integration Infrastructure Relational Databases, Aspen Operations Manager - Integration Infrastructure SAP R3,
Aspen Operations Manager - Integration Infrastructure System Monitoring, Aspen Operations Manager - Performance Scorecarding, Aspen
Operations Manager - Role Based Visualization MS SharePoint, Aspen Operations Manager - Role Based Visualization TIBCO, Aspen Operations
Tracking, Aspen Order Credit Management, Aspen Orion Planning, Aspen Orion XT, Aspen PEP Process Library, Aspen PIMS Distributed
Processing, Aspen PIMS Enterprise Edition, Aspen PIMS Global Optimization, Aspen PIMS Mixed Integer Programming, Aspen PIMS Simulator
Interface, Aspen PIMS Solution Ranging, Aspen PIMS Submodel Calculator, Aspen PIMS XNLP Optimizer, Aspen PIMS, Aspen PIPE, Aspen
Plant Planner & Scheduler, Aspen Plant Scheduler Lite, Aspen Plant Scheduler, Aspen Polymers Plus, Aspen Plus OLI Interface, Aspen Plus
Optimizer, Aspen Plus, Aspen Plus CBT, Aspen PPIMS, Aspen Process Explorer CBT, Aspen Process Manual Applied Rheology, Aspen
Process Manual Bulk Solids Handling, Aspen Process Manual Crystallization, Aspen Process Manual Drying, Aspen Process Manual Gas
Cleaning, Aspen Process Manual Internet Mode, Aspen Process Manual Intranet Mode, Aspen Process Manual Mini-Manuals, Aspen Process
Manual Slurry Handling, Aspen Process Manual Solid Liquid Separation, Aspen Process Manual Solvent Extraction, Aspen Process Manual
Waste Water Treatment, Aspen Process Order, Aspen Process Recipe, Aspen Process Tools, Aspen Production Control Web Server, Aspen
ProFES 2P Wax, Aspen ProFES Tranflo, Aspen Profile.21, Aspen Properties, Aspen Pumper Log, Aspen Q Server, Aspen Quality
Management, Aspen RefSYS CatCracker, Aspen RefSYS, Aspen Report Writer, Aspen Retail Automated Stock Replenishment, Aspen Retail
Resource Scheduling Optimization, Aspen Richardson Rbooks, Aspen Richardson WinRace Database, Aspen RTO Watch, Aspen SCM, Aspen
SmartStep Advanced, Aspen SmartStep, Aspen Specialty Products Automated Stock Replenishment, Aspen Specialty Products Resource
Scheduling Optimization, Aspen Split, Aspen SULSIM, Aspen Supply Chain Analytics, Aspen Supply Chain Connect, Aspen Supply

General Information 160


Planner, Aspen Tank Management, Aspen TASC, Aspen Teams, Aspen TICP, Aspen Transition Manager, Aspen Utilities, Aspen Voice
Fulfillment Management, Aspen Watch, Aspen Water, Aspen Web Fulfillment Management, Aspen XPIMS, Aspen Zyqad Development,
Aspen Zyqad, SLM, SLM Commute, SLM Config Wizard, the Aspen leaf logo, and Plantelligence are trademarks or registered trademarks of
Aspen Technology, Inc., Cambridge, MA.

All other brand and product names are trademarks or registered trademarks of
their respective companies.
This document is intended as a guide to using AspenTech's software. This
documentation contains AspenTech proprietary and confidential information and
may not be disclosed, used, or copied without the prior consent of AspenTech or
as set forth in the applicable license agreement. Users are solely responsible for
the proper use of the software and the application of the results obtained.
Although AspenTech has tested the software and reviewed the documentation, the
sole warranty for the software may be found in the applicable license agreement
between AspenTech and the user. ASPENTECH MAKES NO WARRANTY OR
REPRESENTATION, EITHER EXPRESSED OR IMPLIED, WITH RESPECT TO THIS
DOCUMENTATION, ITS QUALITY, PERFORMANCE, MERCHANTABILITY, OR
FITNESS FOR A PARTICULAR PURPOSE.

Corporate
Aspen Technology, Inc.
Ten Canal Park
Cambridge, MA 02141-2201
USA
Phone: (1) (617) 949-1000
Toll Free: (1) (888) 996-7001
Fax: (1) (617) 949-1030
URL: http://www.aspentech.com/

Related Documentation
Title Content
Aspen Engineering Suite Installation Manual Instructions for installing Aspen Plus
and other Aspen Engineering Suite
products
Aspen Plus User Guide Procedures for using Aspen Plus
Aspen Plus User Models Reference Manual Instructions for creating custom
models for use in Aspen Plus and the
specifications for those models
Aspen Plus Input Language Guide Commands for Aspen Plus input files

General Information 161


Technical Support

Online Technical Support Center


AspenTech customers with a valid license and software maintenance agreement
can register to access the Online Technical Support Center at:
http://support.aspentech.com
You use the Online Technical Support Center to:
Access current product documentation.
Search for technical tips, solutions, and frequently asked questions (FAQs).
Search for and download application examples.
Search for and download service packs and product updates.
Submit and track technical issues.
Search for and review known limitations.
Send suggestions.
Registered users can also subscribe to our Technical Support
e-Bulletins. These e-Bulletins proactively alert you to important technical support
information such as:
Technical advisories.
Product updates.
Service Pack announcements.
Product release announcements.

Technical Support 162


Phone and E-mail
Customer support is also available by phone, fax, and e-mail for customers who
have a current support contract for their product(s). Toll-free charges are listed
where available; otherwise local and international rates apply.
For the most up-to-date phone listings, please see the Online Technical Support
Center at:
http://support.aspentech.com

Support Centers Operating Hours


North America 8:00 20:00 Eastern time
South America 9:00 17:00 Local time
Europe 8:30 18:00 Central European time
Asia and Pacific Region 9:00 17:30 Local time

Technical Support 163


Index

Printing alias definitions, 75


# Printing alias values, 75
## script function, 136 Printing alias variables, 76
ALIAS script command, 75
. ALIASBYVAR script function, 43

. script function, 41 Analysis Commands


Analyzing Equations, 116
^ Analyzing Variables, 115

^ script function, 40 Checking degrees of freedom, 115


Sensitivity Analysis, 115
< ANALYSISTHRES DMO parameter, 121
ANALYZE DOF script command, 115
< script function, 42
ANALYZE EQUATIONS script command, 116
<= script function, 42
ANALYZE JACOBIAN script command, 110
<> script function, 42
ANALYZE SPARSITY script command, 111
= ANALYZE VARIABLES script command, 115
AND script function, 42
= script function, 42
available, 163
>
B
> script function, 42
BAD_STATUS_LIST script parameter, 98
>= script function, 42
BASFLP LSSQP parameter, 124
A BIGBND LSSQP parameter, 124
BIGSCL LSSQP parameter, 124
ABS script function, 40
Block Commands
ACM models
Attributes
adding to OOMF, 157
Changing, 65
ACTIVESPACE DMO parameter, 121
Printing, 65
adding ACM models to OOMF, 157
Derivative method. See Block Commands:
ALFALS LSSQP parameter, 122 Attributes
Alias Commands

Index 164
Printing, 112 Checking connections, 87
Excluding blocks, 63 Disabling connections, 86
Finding in a hierarchy, 60 Enabling connections, 86
Including blocks, 63 Printing connection variables, 88
Listing block scripts, 64 Printing connections, 87
Listing blocks, 63 Printing inactive connections, 87
Printing block convergence, 64 Printing incomplete connections, 88
Printing block statistics, 64 Removing Connections, 85
BLOCK SCRIPTS script command, 64 Connections
BLOCKS script command, 63 And variable specifications, 85
BLOCKS script parameter, 29 CONNECTIONS script command, 87
BLOCKVARS script function, 43 CONNECTIONSBYVAR script function, 43
BNDADJ LSSQP parameter, 124 Controlling kernel
BNDAPP LSSQP parameter, 123 Defined, 58
BOUND variable attribute, 68 CONVERGED script parameter, 29
Bound_iterations NSOLVE parameter, 126 COS script function, 40
BSMALL LSSQP parameter, 124 CREEPFLAG DMO parameter, 120
BUILD_DATE script parameter, 29 CREEPITER DMO parameter, 120
BUILD_NUMBER script parameter, 29 CREEPSIZE DMO parameter, 120
Built-In script parameters, 29 Crude blends
Update script command, 151
C
D
CHANGE FLUSHING script command, 25
CHANGE SCOPE script command, 59 DATE script parameter, 29
CHANGE variable attribute, 68 DEFAULT_FLUSHING script parameter, 25, 29
CHECK CONNECTIONS script command, 87 DEFINED script function, 43
CHECK MEASUREMENT script command, 91 Degrees of freedom, checking, 115
Check_steps NSOLVE parameter, 126 DELTLS LSSQP parameter, 123
CHECK_UOM script parameter, 29 DERDIF LSSQP parameter, 125
CHGBND LSSQP parameter, 122 DERIV_METHOD block attribute, 65
CHGMAX LSSQP parameter, 122 Derivative Commands. See Jacobian and
Derivative Commands
Command Line Prompt, Using, 11
DERIVATIVE script command, 112
Command Line Prompt, Using in Aspen Plus,
148 DERMIN LSSQP parameter, 125
Command Line Prompt, Using in RefSYS, 159 DEVICEINFO script function, 42
Command Line Prompt, Using with ACM DIAG_LEVEL script parameter, 29
Models, 157
DIRECTION Objective function attribute, 109
COMPARE VARFILE script command, 106
DISABLE CONNECTION script command, 86
Connection Commands
DISABLE HXFLUX script command, 154

Index 165
DISABLE MEASUREMENT script command, 91 Comparing variables with an ASCII file, 106
DISABLE SPECIFICATION GROUPS script Restoring free variables from a binary file,
command, 80 104
DISABLE STREAMS script command, 153 Restoring variables from a binary file, 103
Divergent_steps NSOLVE parameter, 126 Restoring variables from an ASCII file, 106
DMO script command, 119 Saving variables to a binary file, 103
DPERTF LSSQP parameter, 125 Saving variables to an ASCII file, 105
DROPTOL DMO parameter, 120 Updating variables in a binary file, 105
File script functions, 42
E FIND BLOCK script command, 60
ECHO script command, 133 FLANGE_PHASE script parameter, 29
ENABLE CONNECTION script command, 86 FLUSH script command, 25
ENABLE HXFLUX script command, 154 FOR-DO script command, 37
ENABLE MEASUREMENT script command, 92 Formatted printing, 130
ENABLE SPECIFICATION GROUP script FSCALF LSSQP parameter, 124
command, 81
Function_tolerance NSOLVE parameter, 126
ENABLE STREAMS script command, 153
Equal to (=) script function, 42 G
Equation Commands
Global script parameters, 28
Evaluating, 77
Global Scripts
Excluding, 76
Defining, 12, 148
Including, 76
Invoking, 151
Printing, 77
GNPMAX LSSQP parameter, 122
Printing largest, 77
Greater than (>) script function, 42
Printing largest residual prices, 78
Greater than or equal to (>=) script function,
ETASKP LSSQP parameter, 124 42
EVALUATE JACOBIAN script command, 111
EVALUATE OBJECTIVE DERIVATIVE script
H
command, 109
HEAD script function, 42
EVALUATE OBJECTIVE HESSIAN script
command, 110 HELP script command, 53

EVALUATE OBJECTIVE script command, 109 HESSIANUPDATES DMO parameter, 120

EXCLUDE BLOCKS script command, 63 Hierarchies

EXIT script command, 53 Defining the scope, 59

EXP script function, 40 Finding a block, 60


Printing the hierarchy, 60
F Solving a hierarchy, 60
HISTORY_DEVICE script parameter, 25, 29
FACTORSPACE DMO parameter, 121
HXFlux Commands
FACTORSPREED DMO parameter, 120
Controlling HXFlux Connections, 153
File Commands

Index 166
Disabling HXFlux Connections, 154 Evaluating the Jacobian, 111
Enabling HXFlux Connections, 154 Printing block derivative methods, 112
HXFLUX script command, 153 Printing the Jacobian, 111
Printing the Jacobian equations, 112
I Printing the Jacobian variables, 111
ID2STRING script function, 41 JOURNAL_DEVICE script parameter, 26, 29
IFDITR LSSQP parameter, 125 JOURNAL_LEVEL script parameter, 26, 29
IFDTYP LSSQP parameter, 125 Journaling. See Redirecting Output and
Journaling
IF-THEN-ELSE script command, 36
INCLUDE BLOCKS script command, 63 K
INCLUDED block attribute, 65
KBKOUT LSSQP parameter, 125
INCLUDED Equation attribute, 76
KFOWDG LSSQP parameter, 125
INDEX script function, 41
KMUDEC LSSQP parameter, 123
INITIAL variable attribute, 68
KOWARM LSSQP parameter, 124
Input Language Rules, 12
KPFREQ LSSQP parameter, 122
INSERTSTR script function, 41
KPNTOP LSSQP parameter, 122
INT script function, 40
KPTLEV
Interactive Prompt, Using, 11
IXSCS Parameter, 123
Interactive Prompt, Using in Aspen Plus, 148
KPTLEV LSSQP Parameter, 122
Interactive Prompt, Using in RefSYS, 159
Interactive Prompt, Using with ACM Models,
157
L

INVOKE command, 34 LCHBAS LSSQP parameter, 124


Invoke Commands LENGTH script function, 41
Invoking a block script, 34 Less than (<) script function, 42
Invoking a global script, 151 Less than or equal to (<=) script function, 42
Invoking a local script, 150 LEWBAS LSSQP parameter, 123
Invoking an external file, 34 LINCST LSSQP parameter, 124
Invoking scripts within a scope, 35 LINESEARCH DMO parameter, 120
Using script arguments, 35 list concatenation script function, 42
INVOKEGLOBAL command, 151 List script functions, 42
INVOKELOCAL command, 150 LOCAL script command, 31
ITRBND LSSQP parameter, 122 Local script parameters, 28
IWORKF DMO parameter, 121 Local Scripts
Defining, 12, 148
J
Invoking, 150
Jacobian and Derivative Commands LOG10 script function, 40
Analyzing the Jacobian, 110 LOGE script function, 40
Analyzing the Jacobian Sparsity, 111 Logical script functions, 42

Index 167
LOWER variable attribute, 68 MSMETH LSSQP parameter, 124
LSCOPT LSSQP parameter, 123
LSIZEB LSSQP parameter, 124
N

LSSQP script command, 121 NAME_WIDTH script parameter, 29


LUBNDS LSSQP parameter, 124 NBDBAS LSSQP parameter, 125
LUSTATS DMO parameter, 121 NFEASB LSSQP parameter, 122
NFINFB LSSQP parameter, 122
M
NICHK LSSQP parameter, 125
MAJOR_VERSION script parameter, 29 NLRATIODEV block attribute, 65
Mathematical script functions, 40 NNDCMP LSSQP parameter, 123
Maximum_function_error NSOLVE parameter, Not equal to (<>) script function, 42
126
NOT script function, 42
Maximum_iterations NSOLVE Parameter, 126
NSOLVE script command, 126
MAXITER DMO parameter, 120
NUMBER_WIDTH script parameter, 30
MAXITR LSSQP parameter, 122
MAXLSC LSSQP parameter, 122 O
MAXQPF LSSQP parameter, 122
OBJCVG DMO parameter, 121
MAXSLF LSSQP parameter, 122
Objective Function Commands
MDHESS LSSQP parameter, 123
Attributes, 109
MEAS_CAPACITY script parameter, 29
Evaluating the objective function, 109
Measurement Commands
Evaluating the objective functions
Checking measurements, 91 derivatives, 109
Disabling measurements, 91 Evaluating the objective functions Hessian,
110
Enabling measurements, 92
Printing the objective function, 110
Measurement Qualities, 98
OBJECTIVE script parameter, 30
Printing measurements, 92
ONLINE script parameter, 30
Printing measurements variables, 92
OPENBINARY script function, 42
MEASUREMENTSBYVAR script function, 43
OPENFILE script function, 42
Methods
OPENTEE script function, 42
Defined, 12, 149
OR script function, 42
MINITER DMO parameter, 120
MINITR LSSQP parameter, 122
P
MINOR_VERSION script parameter, 29
MODE script parameter, 29 P_AMB script parameter, 30

Modes PERT block attribute, 65

script parameter for, 29 PHASE Stream attribute, 84

MOVE block attribute, 65 Physical Type, 145

MOVEAMOUNT block attribute, 65 PIVOTSEARCH DMO parameter, 121

MSFREQ LSSQP parameter, 124 POP SCOPE script command, 59

Index 168
Port Commands. See Stream Commands PRINT LARGEST EQUATION
SCALED_SHADOW_PRICES script
Power (^) script function, 40
command, 78
PRINT ACTIVE_BOUNDS script command, 71
PRINT LARGEST EQUATION SHADOW_PRICES
PRINT ACTIVE_BOUNDS SSI script command, script command, 78
71
PRINT LARGEST RESIDUAL
PRINT ALIAS script command, 75 SCALED_SHADOW_PRICES script
command, 78
PRINT ALIAS VARIABLES script command, 76
PRINT LARGEST RESIDUAL SHADOW_PRICES
PRINT BLOCK ATTRIBUTES script command, 65
script command, 78
PRINT BLOCK CONVERGENCE script command,
PRINT LARGEST RESIDUALS script command,
64
77
PRINT BLOCK HIERARCHY script command, 60
PRINT LARGEST VARIABLE SHADOW PRICES
PRINT BLOCK PORTS DETAILED script script command, 72
command, 83
PRINT LARGEST VARIABLE SHADOW PRICES
PRINT BLOCK PORTS script command, 83 SSI script command, 72
PRINT BLOCK STATISTICS FULL script PRINT MEASUREMENTS script command, 92
command, 64
PRINT MEASUREMENTS VARIABLES script
PRINT BLOCK STATISTICS script command, 64 command, 92
Print Commands PRINT OBJECTIVE script command, 110
Formatted printing, 130 PRINT QUERY script command, 73
Miscellaneous print commands, 133 PRINT RESIDUALS script command, 77
Printing problem convergence, 129 PRINT SCOPE script command, 59
Printing the problem summary, 129 PRINT SPECIFICATION GROUP VARIABLES
script command, 81
PRINT CONNECTION VARIABLES script
command, 88 PRINT SPECIFICATION GROUPS script
command, 81
PRINT CONVERGENCE SUMMARY script
command, 129 PRINT SPECIFICATIONS script command, 71
PRINT EQUATIONS script command, 77 PRINT SUMMARY script command, 129
PRINT FIXED script command, 70 PRINT TIMER script command, 54
PRINT FLUSHING script command, 25 PRINT UOM script command, 136
PRINT FORMATTED script command, 130 PRINT VARIABLES script command, 70
PRINT INACTIVE CONNECTIONS script PRINT VARIABLES SSI script command, 70
command, 87
Print_level NSOLVE parameter, 126
PRINT INACTIVE SPECIFICATION GROUPS
PRINT_VAR_MASK script parameter, 30
Script command, 81
PRINTFREQ DMO parameter, 121
PRINT INCOMPLETE CONNECTIONS script
command, 88 PROBID script parameter, 30
PRINT JACOBIAN EQUATIONS script command, PROBNAME script parameter, 30
112
PROCESS VARIABLE QUALITY script command,
PRINT JACOBIAN script command, 111 98
PRINT JACOBIAN VARIABLES script command, Program flow control
111
FOR-DO constructs, 37
IF-THEN-ELSE constructs, 36

Index 169
WHILE-DO constructs, 38 Reporting everything, 155
PROMPT script parameter, 30 Reporting streams, 155
PUSH SCOPE script command, 59 Reporting the flowsheet, 155
Reporting the objective function, 134
Q REPORT FLOWSHEET script command, 155
QPINFE LSSQP parameter, 123 REPORT OBJECTIVE script command, 134
QPSTATS DMO parameter, 121 REPORT STREAMS script command, 155
Query REPORT_DEVICE script parameter, 25, 30
Printing variables with, 73 RESCVG DMO parameter, 121
Query script functions, 43 RESET SCOPE script command, 59
QUERYVARS script function, 43 RESET VARIABLES script command, 127
QUIT script command, 53 Residual Commands. See Equation Commands
RESTART TIMER script command, 54
R RESTORE FREE VARIABLES EXCEPT script
command, 104
READ VARFILE EXCEPT script command, 106
RESTORE FREE VARIABLES script command,
READ VARFILE script command, 106 104
READ_VARFILE_MASK script parameter, 30 RESTORE VARIABLES script command, 103
RECOVER script command, 155 RETURN command, 35
Recovery commands RFEASB LSSQP parameter, 122
Recovery, 155 RFINFB LSSQP parameter, 122
Resetting variables, 127 RIGORUPDATES DMO parameter, 120
Redirecting output and Journaling RRHIGH LSSQP parameter, 124
Examining the output devices, 27 RRLOW LSSQP parameter, 124
Flushing, 25 RWORKF DMO parameter, 121
Journaling, 26
Redirecting the output of a command, 24 S
the history device, 25 SAVE VARIABLES script command, 103
the report device, 25 SAVEJDFFILE DMO parameter, 120
Relational script functions, 42 SBWEIGHT variable attribute, 68
RELAX_TOL script parameter, 30 SCALE Objective function attribute, 109
RELEPS LSSQP parameter, 122 SCALE variable attribute, 68
REMOVE CONNECTIONS script command, 85 Scope
REMOVE SPECIFICATION GROUPS script Defined, 58
command, 80
SCOPE INVOKE command, 35
REMOVESTR script function, 41
SCREENFORM DMO parameter, 120
REPORT ALL script command, 155
Script Functions, 40
REPORT BLOCKS script command, 134
Script parameters
Report Commands
Accessing, 31
Reporting blocks, 134

Index 170
Built-in script parameters, 29 Removing Specification Groups, 80
Global script parameters, 28 Specification variable attribute, 68
Local script parameters, 28 SQRT script function, 40
Setting, 31 Stabilization NSOLVE parameter, 126
Unsetting, 31 Stable_iterations NSOLVE parameter, 126
SCRIPT_PATH script parameter, 30 START TIMER script command, 54
Scripts STEP variable attribute, 68
Defining, 12, 148 STEP_BOUND script parameter, 30
Executing, 12, 149 STOP TIMER script command, 54
Global, defined, 12, 148 Stream Commands
Local, defined, 12, 148 Adding and removing stream connections,
152
SEARCHMODE DMO parameter, 120
Attributes, 84
SENSITIVITY script command, 115
Disabling Stream connections, 153
SET script command, 31
Enabling Stream connections, 153
SIN script function, 40
Printing block ports, 83
SINGT1 LSSQP parameter, 123
Printing connections, 87
SINGT2 LSSQP parameter, 123
Printing stream values, 83
SMLSCL LSSQP parameter, 124
STREAMS script command, 152
SOFT_BOUND script parameter, 30
string concatenation script function, 41
SOLVE script command, 127
String script functions, 41
Solver commands
STRING2ID script function, 41
Entering DMO parameters, 119
SUBSTR script function, 41
Entering LSSQP parameters, 121
System commands, executing, 53
Entering NSOLVE parameters, 126
SYSTEM script command, 53
Setting the solver, 119
Solving the problem, 127
T
Viewing solver settings, 119
TAIL script function, 42
SOLVER script command, 119
TAN script function, 40
SOLVER SETTINGS script command, 119
TAUHYB LSSQP parameter, 124
SPDROP LSSQP parameter, 123
TIMER script commands, 54
SPEC Stream attribute, 84
TO script command, 24
SPEC variable attribute, 68
TOGGLE SOLVE SCOPE script command, 60
SPECGROUPSBYVAR script function, 43
TOLANA LSSQP parameter, 123
Specification Group Commands
TOLBAS LSSQP parameter, 123
Disabling Specification Groups, 80
TOLOWER script function, 41
Enabling Specification Groups, 81
TOUPPER script function, 41
Printing inactive specification groups, 81
Trust_radius NSOLVE parameter, 126
Printing Specification Group variables, 81
TYPE Stream attribute, 84
Printing specification groups, 81

Index 171
TYPEOF script function, 43 Printing variables, 70
Printing variables fixed in other modes, 71
U Printing variables fixed in the current mode,
70
Units of measure, 138
Printing variables using a query, 73
Units of measure commands
Printing variables with active bounds, 71
Dealing with Untyped Variables, 136
Variable_tolerance NSOLVE parameter, 126
Printing units of measure, 136
VARSCALE DMO parameter, 121
Variable Units of Measure, 136
VMUINI LSSQP parameter, 124
UNITS variable attribute, 68
VMUMIN LSSQP parameter, 124
UNSET script command, 31
UOM Objective function attribute, 109 W
UOM_WIDTH script parameter, 30
WHILE-DO script command, 38
UPDATE BLEND script command, 151
Wildcards
UPDATE PDF script command, 151
Glob-style, 50
UPDATE VARIABLES script command, 105
Regular expression matching, 50
UPPER variable attribute, 68
WRITE VARFILE EXCEPT script command, 105
USERDROPTOL DMO parameter, 120
WRITE VARFILE script command, 105
V WRITE_VARFILE_MASK script parameter, 30

VAL script function, 43 X


VALUE Objective function attribute, 109
XPMIN LSSQP parameter, 125
VALUE variable attribute, 68
Variable Commands
Z
Changing variable attributes, 69
ZEROTOL block attribute, 65
Printing connections, 87
ZPERTF LSSQP parameter, 125
Printing largest variable shadow prices, 72

Index 172

Anda mungkin juga menyukai