Beruflich Dokumente
Kultur Dokumente
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.
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
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
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
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
Contents 7
The Echo Command..........................................................................................133
Examples of the Miscellaneous Printing Commands ...............................................134
Report Commands ................................................................................................134
Reporting Blocks ..............................................................................................134
Reporting the Objective Function ........................................................................134
Contents 8
Recovery ........................................................................................................155
Report Commands ................................................................................................155
Reporting Everything ........................................................................................155
Reporting the Flowsheet....................................................................................155
Reporting Streams ...........................................................................................155
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.
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.
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.
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
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
WHILE <expression> DO
list_commands
ENDWHILE
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
1 Script Commands 22
2 OOMF Script Language
Basics
This chapter describes language elements and general commands of the OOMF
Script language.
Input Language
command TO device
Input Language
SET REPORT_DEVICE = device
See the section Redirecting the Output of a Command for details on these options.
Input Language
SET HISTORY_DEVICE = device
See the section Redirecting the Output of a Command for details on these options.
Input Language
FLUSH
PRINT FLUSHING device
CHANGE FLUSHING device, level
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
See the section Redirecting the Output of a Command for details on these options.
Input Language
ECHO &REPORT_DEVICE
ECHO &HISTORY_DEVICE
ECHO &JOURNAL_DEVICE
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.
Input Language
SET parameter = expression
LOCAL parameter = expression
Input Language
UNSET parameter
Input Language
INVOKE file, arg1, arg2,
Input Language
INVOKE blockid, method, arg1, arg2,
Input Language
SCOPE INVOKE blockid, method
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.
PLANT
S1 S2
B1 B2 B3 S3 B6
B4 B5
IF-THEN-ELSE Command
This command can be used to define conditionals to control program execution.
Input Language
IF ( condition ) THEN
ELSE
ENDIF
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
WHILE ( condition ) DO
BREAK
CONTINUE
ENDWHILE
Input Language
expression
(expression) # {uom}
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
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
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.
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.
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.
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
QUIT
EXIT
Input Language
SYSTEM " command "
Input Language
START TIMER
STOP TIMER
RESTART TIMER
PRINT TIMER
Input Language
IDENTIFY LIBRARY dll_name
LOAD LIBRARY dll_name
UNLOAD LIBRARY dll_name
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.
Flowsheet Level
S1 S2
B1 B2 B3 S3 B6
B4 B5
Input Language
PUSH SCOPE blockid
CHANGE SCOPE blockid
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
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
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
Successful solution.
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>
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
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
BLOCK SCRIPTS block_list
Input Language
PRINT BLOCK CONVERGENCE block_list
Input Language
PRINT BLOCK STATISTICS block_list
PRINT BLOCK STATISTICS FULL block_list
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.
Input Language
blockid.attribute = value
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)
Input Language
PRINT BLOCK ATTRIBUTES block_list
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)
Input Language
variableid.attribute = value
aliasid.attribute = value
...
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.
Input Language
PRINT VARIABLES [ vmask ], list
PRINT VARIABLES SSI [ vmask ], list
Input Language
PRINT FIXED [ vmask ], list
Input Language
PRINT SPECIFICATIONS block_list
Input Language
PRINT ACTIVE_BOUNDS [ vmask ], list
PRINT ACTIVE_BOUNDS SSI [ vmask ], list
Input Language
PRINT LARGEST VARIABLE SHADOW_PRICES integer, list
PRINT LARGEST VARIABLE SHADOW_PRICES SSI integer, list
Input Language
PRINT QUERY [ vmask ], block_list, query
Printing Aliases
This command lists the alias definitions for the current scope.
Input Language
ALIAS
Input Language
PRINT ALIAS [ vmask ]
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
Input Language
PRINT ALIAS VARIABLES var_list
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
Including Equations
This command may be used to include equations that have been previously
excluded.
Input Language
equationid.INCLUDED = TRUE
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
PRINT LARGEST RESIDUALS integer, block_list
PRINT LARGEST EQUATIONS integer, block_list
Input Language
PRINT LARGEST RESIDUAL SHADOW_PRICES integer, block_list
PRINT LARGEST EQUATIONS SHADOW_PRICES integer, block_list
Input Language
REMOVE SPECIFICATION GROUP spec_list
Input Language
DISABLE SPECIFICATION GROUP spec_list
Input Language
ENABLE SPECIFICATION GROUP spec_list
Input Language
PRINT SPECIFICATION GROUP spec_list
Input Language
PRINT INACTIVE SPECIFICATION GROUPS spec_list
Input Language
PRINT SPECIFCATION GROUP VARIABLES var_list
Input Language
PRINT BLOCK PORTS block_list
PRINT BLOCK PORTS DETAILED block_list
Input Language
PRINT VARIABLES blockid.streamid.STR
Input Language
blockid.streamid.STR.attribute = value
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
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.
Input Language
REMOVE CONNECTION cxn_list
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
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
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
PRINT INCOMPLETE CONNECTIONS cxn_list
Input Language
PRINT CONNECTION VARIABLES var_list
See Also
Aspen Plus Extensions - Stream Commands
Aspen Plus Extensions - HXFlux Commands
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
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
Printing Measurements
Prints a list of measurements to the report device.
Input Language
PRINT MEASUREMENTS meas_list
Input Language
PRINT MEASUREMENTS VARIABLES var_list
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
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
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.
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.
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.
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.
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
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.
Input Language
SAVE VARIABLES [ vmask ], list TO "file"
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
Input Language
RESTORE VARIABLES [ vmask ], list FROM "file"
RESTORE VARIABLES EXCEPT [ vmask ], list FROM "file"
Input Language
RESTORE FREE VARIABLES [ vmask ], list FROM "file"
RESTORE FREE VARIABLES EXCEPT [ vmask ], list FROM "file"
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
Input Language
UPDATE VARIABLES [ vmask ] TO "file"
These attributes can be used. (See the Variable Commands section for
descriptions.)
VALUE STEP SCALE SPEC
LOWER SBWEIGHT UNITS PHYSICAL_TYPE
UPPER
Input Language
WRITE VARFILE [ vmask ], list TO "file"
WRITE VARFILE EXCEPT [ vmask ], list TO "file"
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
Input Language
READ VARFILE [ vmask ], list FROM "file"
READ VARFILE EXCEPT [ vmask ], list FROM "file"
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
Input Language
COMPARE VARFILE [ vmask ], list FROM "file"
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.
Input Language
objid.attribute = value
Input Language
EVALUATE OBJECTIVE objid
Input Language
EVALUATE OBJECTIVE DERIVATIVE objid
Input Language
EVALUATE OBJECTIVE HESSIAN objid
Input Language
PRINT OBJECTIVE objid
Input Language
ANALYZE JACOBIAN reltol, pertsize, block_list
Input Language
ANALYZE SPARSITY zerotol, pertsize, block_list
Input Language
EVALUATE JACOBIAN
Input Language
PRINT JACOBIAN list
Input Language
PRINT JACOBIAN VARIABLES list
Input Language
PRINT JACOBIAN EQUATIONS list
Input Language
DERIVATIVE
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
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.
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 ]
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 ]
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
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>
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
8 Analysis 118
Solver Commands
These commands are used to specify the solver and its parameters.
Input Language
SOLVER solver
Input Language
SOLVER SETTINGS parameter = value, parameter = value,
Input Language
DMO.parameter = value
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)
Input Language
LSSQP.parameter = value
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
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
Recovery Commands
These commands are used to restore the problem state after a failed solution.
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.
Input Language
PRINT SUMMARY
Input Language
PRINT CONVERGENCE SUMMARY
Formatted Printing
Formatted print is a powerful tool to allow you to create your own custom reports.
Input Language
PRINT FORMATTED expression1 , expression2 , \ expression3 ,
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.
Miscellaneous Printing
Commands
This section includes a general purpose printing command.
Input Language
ECHO expression
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
REPORT OBJECTIVE objid
This chapter describes the OOMF script commands used to manipulate units of
measure, and lists the available units of measure and physical types.
Input Language
variableid.UOM = {uom}
Input Language
PRINT UOM {uom}
PRINT UOM FOR type
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
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)
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.
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
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.
Input Language
INVOKELOCAL scriptid, arg1, arg2,
Input Language
INVOKEGLOBAL scriptid, arg1, arg2,
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
Input Language
UPDATE PDF
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
DISABLE STREAMS
Input Language
ENABLE STREAMS
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.
Input Language
HXFLUX status
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.
Input Language
ENABLE HXFLUX
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
Input Language
REPORT FLOWSHEET
Reporting Streams
This command prints a report of the specified streams to the report device.
See Also
Standard OOMF - Report Commands
See Also
Standard OOMF - Using the Interactive Prompt
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
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.
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 ¶meter_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 ¶meter_name to view the contents of the parameter.
See Also
Standard OOMF - Command Summary
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
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
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
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
Index 167
LOWER variable attribute, 68 MSMETH LSSQP parameter, 124
LSCOPT LSSQP parameter, 123
LSIZEB LSSQP parameter, 124
N
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
Index 172