ACM Examples Guide
ACM Examples Guide
ACM Examples Guide
Modeler 2004.1
Examples Guide
Who Should Read this Guide
Contents 3
Opening and Saving Simulations .............................................................................. 31
Open a Library.................................................................................................. 31
Open the Polymers Plus Library ........................................................................... 31
Open a Simulation............................................................................................. 31
Import a Flowsheet ........................................................................................... 32
Printing Flowsheets ........................................................................................... 33
Import Types into a Simulation ........................................................................... 33
Save a Simulation ............................................................................................. 33
Export Parts of a Simulation ............................................................................... 34
Building Flowsheets ................................................................................................ 34
Use the Flowsheet Toolbar.................................................................................. 34
Use a Flowsheet as Wallpaper ............................................................................. 34
Create a Flowsheet............................................................................................ 35
Move Blocks and Streams................................................................................... 36
Hierarchies....................................................................................................... 37
Change Stream Connectivity............................................................................... 40
Reroute a Stream.............................................................................................. 40
Arrange Blocks on a Flowsheet............................................................................ 41
View a Flowsheet .............................................................................................. 42
Work with Icons................................................................................................ 43
Name Blocks and Streams .................................................................................. 44
Delete a Block or Stream.................................................................................... 45
Update References to a Link ............................................................................... 45
Work with Flowsheet Tasks................................................................................. 45
Work with Flowsheet Scripts ............................................................................... 46
Work with Flowsheet Constraints Sections ............................................................ 49
Specify Settings for a Simulation ......................................................................... 50
Work with Inserted Objects ................................................................................ 50
Cut, Copy and Paste of Flowsheet Items ............................................................... 51
Updating the Model used by a Block on a Flowsheet ............................................... 51
Switching to Local Model .................................................................................... 52
Running Simulations............................................................................................... 52
Running Simulations.......................................................................................... 52
Run an Initialization Simulation ........................................................................... 52
Run a Steady-State Simulation ........................................................................... 53
Run a Dynamic Simulation.................................................................................. 54
Rewind a Simulation .......................................................................................... 57
Run an Estimation Simulation ............................................................................. 57
Statistical Results from Estimation Simulations ...................................................... 61
Run an Optimization Simulation .......................................................................... 64
Initialize a Dynamic Simulation Globally ............................................................... 67
Use Properties Plus............................................................................................ 67
Contents 4
Change Data in a Table for a Block or a Stream ..................................................... 68
Units of Measurement ........................................................................................ 69
Reset Specifications from the Status Window ........................................................ 73
Activate a Task ................................................................................................. 73
Run a Script ..................................................................................................... 74
Check the Status of a Simulation ......................................................................... 76
Check for Structural Singularities in a Simulation ................................................... 76
Work with Specification Analysis Information ........................................................ 77
Generate a DLL File for Procedures ...................................................................... 79
Work with Snapshots and Results ........................................................................ 86
Display Simulation Messages .............................................................................. 93
Use Homotopy .................................................................................................. 94
Change Updating of the User Interface ................................................................. 95
Reviewing Results .................................................................................................. 96
Forms for Reviewing Results ............................................................................... 96
Work with Plots................................................................................................. 98
Work with Tables .............................................................................................104
Add a Control Form to a Model ...........................................................................108
Make a Form the Default Form for a Model...........................................................109
Define Patterns ................................................................................................109
Work with Variable Find ....................................................................................109
View Results for a Block or a Stream...................................................................111
View Results for Flowsheet Variables...................................................................111
View Results for an Optimization Run ..................................................................111
Results Displayed for Failed or Interrupted Runs ...................................................112
Access Decomposition Information .....................................................................113
Access Global Parameters..................................................................................114
View Degrees of Freedom Information.................................................................114
Print...............................................................................................................115
Work with External Applications .........................................................................115
Modeling..............................................................................................................119
Creating Types ................................................................................................119
Editing Types...................................................................................................127
Edit a Model Script ...........................................................................................128
Structures............................................................................................................134
How to Use Structures ......................................................................................134
Define a Structure Type ....................................................................................134
Create an Instance of a Structure Type ...............................................................135
Reference a Structure Type from a Model ............................................................135
Creating a Block or Stream with a Structure Reference ..........................................135
Choosing Solver Options ........................................................................................136
Access Solver Options.......................................................................................136
Contents 5
Change Tolerances for Non-Linear Solvers ...........................................................136
Define Tolerances for a Simulation......................................................................136
Specify an Integrator for a Simulation .................................................................137
Specify a Linear Solver .....................................................................................137
Specify a Non-Linear Solver...............................................................................137
Specify Procedure Tearing Options......................................................................137
Troubleshoot Non-Linear Equations.....................................................................137
Specify an Optimizer ........................................................................................138
Specify Homotopy Options.................................................................................138
Specify an Open Non-Linear Solver .....................................................................138
Using Remote Servers ...........................................................................................139
Accessing Server Configurations.........................................................................139
Defining a Remote Server..................................................................................140
Contents 6
Running the Reactor Dynamic Estimation Example .....................................................158
EUROKIN Test Problems.........................................................................................161
EUROKIN Test Problem 1 ..................................................................................161
EUROKIN Test Problem 2 ..................................................................................162
EUROKIN Test Problem 3 ..................................................................................163
EUROKIN Test Problem 4 ..................................................................................164
Contents 7
13 VINYL ACETATE MONOMER REACTOR (PDE) EXAMPLE ...........................191
Running the Vinyl Acetate Monomer Reactor Example ................................................191
Using the Vinyl Acetate Monomer Reactor in Aspen Plus .............................................192
Contents 8
Using the Exported Model in an Aspen Plus Flowsheet ................................................219
25 GLOSSARY..............................................................................................225
Glossary Definitions...............................................................................................225
GENERAL INFORMATION..............................................................................231
Copyright.............................................................................................................231
Related Documentation..........................................................................................233
TECHNICAL SUPPORT...................................................................................234
Online Technical Support Center .............................................................................234
Phone and E-mail..................................................................................................235
INDEX ..........................................................................................................236
Contents 9
Introducing Aspen Custom
Modeler
Flowsheet
toolbar
Flowsheet
window
All Items pane
Simulation
Messages
Contents pane window
Configuration
Status bar Specification
Indicator
Indicator
1 Application Overview 11
Simulation Explorer
1 Application Overview 12
Component Lists Folder
Flowsheet Folder
The Flowsheet folder contains information for the blocks, streams and
structure instances in the current flowsheet. Blocks and streams can contain
scripts, tasks, and forms, structure instances can contain scripts and forms.
1 Application Overview 13
From the Flowsheet folder, you can:
• View all the blocks and streams used in the current flowsheet
• View all instances of structure types in the simulation
• Define equations that contain variables from different blocks on your
flowsheet by double-clicking the Flowsheet equals icon in the Contents
pane.
• Display all the local variables for the flowsheet by clicking the
LocalVariables table icon.
• Display the scripts, tasks, and forms for the whole flowsheet
• Create your own flowsheet tasks, scripts, and forms, by clicking the Add
Task, Add Script, and Add Form icons.
Globals Folder
The Globals Folder allows you to access forms displaying global variables as
well as adding forms.
1 Application Overview 14
Custom Modeling Library
The Custom Modeling library consists of folders that contain Add icons to
enable you to develop the components for your simulation. The Stream Types
folder also contains built-in stream types.
1 Application Overview 15
From the Custom Modeling Library you can:
• Add blocks and streams to your simulation by dragging and dropping icons
from the Simulation Explorer onto the flowsheet. Blocks and streams can
also be defined in the modeling language.
• Add your own folders to the Custom Modeling library by double-clicking
the Add Model Folder icon in the Contents pane:
Folder Contents
Models All the models in the current simulation,
including their associated icons, scripts,
forms, and tasks, plus an Add Model icon.
Libraries Folder
The Libraries Folder allows you to access any ACM libraries that are attached
to your simulation. In ACM 2 libraries are attached by default.
1 Application Overview 16
System Library
The SystemLibrary library contains built-in types for parameters, ports,
procedures, streams, tasks, and variables.
You do not need to access this library directly. It is used by item in other
libraries and when you compile your own models.
Modeler Library
The Modeler library contains predefined control models, variable types, port
types, string parameters and physical properties procedure calls. It also
contains models and structures used in the Aspen Reactions Toolkit.
You can use the items in this library in your own simulations.
1 Application Overview 17
Simulation Options Folder
The Simulation Options folder allows you to access facilities that enable you to
control your simulations.
These are:
• Homotopy which can be used to aid convergence
• Run Option where you can change run mode and dynamics simulation
settings
• Snapshots where you can load results from previous simulations
• Solver Options where you can alter solver settings
1 Application Overview 18
Analysis Tools Folder
The Analysis Tools folder allows you to access facilities that enable you to
control some special run modes.
These are:
• Estimation
• Optimization
1 Application Overview 19
UOM Sets Folder
The UOM Sets folder allows you to view the UOM sets defined for the
simulation and to change which is the set currently being used.
Interfacing Folder
The Interfacing folder allows you to access facilities to interface external
systems to ACM. These are:-
• On Line Links allows you to interface with an OPC server
• Simulation Access Extensions allows a programming interface
1 Application Overview 20
Diagnostics Folder
If an equation group is torn, the icon has a blue tear in it, and if the group is
not converged, the icon has a red cross through it:
1 Application Overview 21
You can choose to show lists of variables in groups eliminating the display of
equations using the "Show variables in groups" item on the Diagnostics node
context menu.
Variables which have an indeterminate value are labeled with a "?" overlaying
the variable icon.
Tips:
1 Application Overview 22
Variables in an Equation
In this example, the variables in an equation are displayed. This gives
detailed information about the variables, including where the value was
calculated. For example, the last variable was calculated in group 253 sub
group 1:
Double-clicking on this variable, or using the Find Group context menu item,
displays another Explorer window for that group so you can look at the other
variables and equations in that group.
Variables as an Equivalence
An equivalenced variable is illustrated by the 3 lines on the icon and the
equivalence name in brackets. An equivalence is where the system has
decided that several variables are equivalent and can be eliminated from the
simulation:
1 Application Overview 23
Using the Find Equivalence option on the context menu for the variable will
open another Explorer window showing a list of all variables in that
equivalence. You can access all equivalences from the Equivalences node
under Diagnostics.
1 Application Overview 24
To change pane orientation so that the All Items pane is next to the Contents
pane:
1 Make sure that the Simulation Explorer window is active by clicking in it.
2 From the View menu, point to Pane Orientation and then click Side by
Side.
To Do this
Sort by name Click the Name heading.
Text Editor
The text editor appears when you create or edit a task or script, or edit
Flowsheet or Model text. To edit one of these types, you double-click the
equals sign for the type in the Contents pane of the Simulation Explorer:
The Aspen Custom Modeler Text Editor provides color highlighting to make
the text easier to understand:
• Commented out text is green.
• Keywords are blue.
• String text is magenta.
Keyboard Shortcuts
You can use keyboard shortcuts in the Text Editor to speed up your work.
1 Application Overview 25
Use Text Editor Shortcut Keys to Move
Around in a Document
To move about a document in the Text Editor, use these shortcut keys:
To move Press
The mouse cursor Left mouse button
Up a page PAGE UP
To Press
Change write mode INSERT
1 Application Overview 26
Paste the selection CTRL+V
Find CTRL+F
Replace CTRL+H
Duplicate SHIFT+CTRL+INSERT
Clear CTRL+DELETE
Undo CTRL+BACKSPACE
Search Next F3
If you know the shortcut keys to move the insertion point, you can select text
using the same key combination while holding down SHIFT. For example, the
END key moves the insertion point to the end of the line, and SHIFT+END
selects the text from the insertion point to the end of the line.
Flowsheet Window
You build flowsheets by dragging icons from the Simulation Explorer and
dropping them onto the Flowsheet window.
You can use either the default icon, called System, which is provided with
ports, or your own customized model icons.
Blue arrows appear on the blocks where ports are available and you can drag
ports around the icon to suit your particular flowsheet.
You connect blocks using the following stream types:
• In-built Connection stream type.
• Your own created stream types.
• In-built ControlSignal stream (for connecting control variables).
1 Application Overview 27
Note: You can make multiple connections to one connection
point on a block.
Icon Editor
The Icon Editor is used to create your own icons for a model and appears
when you click Add Icon in the Contents pane of the Simulation Explorer:
You can also choose whether icons can appear as two- or three-dimensional
shapes.
To add ports, you drag and drop model ports to the desired position on the
icon perimeter.
If you cannot see Add Icon, look at the All Items pane of the Simulation
Explorer, make sure the Custom Modeling folder or your required library is
expanded, expand Models, and then click the required model. Add Icon will
then appear in the Contents pane.
Status Bar
The Status bar provides a quick means of checking the status of your
simulation. Several types of indicator enable you to check different aspects of
a simulation.
Specification
indicator
1 Application Overview 28
Configuration
indicator
If you are running simulations on the local machine, the indicator shows Local
as the current configuration. If you are running simulations on a remote
server, the indicator shows the name of the configuration that it is currently
using.
Status Window
To display the Status window, double-click the specification indicator on the
Status bar. From the Status window, you can:
• Launch the Variable Find with predefined options.
• Check for structural singularities.
• Create a flowsheet script of all the specification changes from the base
case.
• Initialize all the state variables or all the derivatives to zero (steady state
conditions).
• Launch Specification Analysis to obtain a detailed analysis of the
specification status of variables in your simulation, and recommendations
on which variables to change to solve the simulation.
Specification Analysis
The Specification Analysis dialog box gives you a detailed analysis of the
variables in your simulation, and recommendations on which variables to
change to solve the simulation. For example, if your simulation is
underspecified by 10 variables (which means that you need to change the
specification status: Fixed, Free, or Initial, of 10 variables), Specification
Analysis recommends 10 suitable variables and enables you to fix them.
Under some circumstances, the simulation cannot be solved because the
specification status of the wrong variables has been set to Fixed. In this case,
Specification Analysis recommends which variables should be changed to
Free.
Also, if some model equations are causing solution difficulties, these will be
presented in the Details dialog box.
To display the Specification Analysis dialog box:
• From the View menu, select Specification Analysis.
– or –
• From the Status window, click Analyze.
To perform a specification analysis on the current run, in the Specification
Analysis dialog box click Analyze Now.
You can obtain further information, as well as details of any equations which
may be causing problems, by clicking the Details button.
1 Application Overview 29
Variable Find
Variable Find is used to:
• Find and list the variables within a simulation.
• Provide an easy way of generating scripts and customized tables.
You can access Variable Find in several ways, including the following:
• Double-click the specification indicator on the Status bar, and then click
one of the buttons, All, Fixed, Initial, or Free.
• From the Tools menu, click Variable Find.
Note: When you change the working folder, any open simulation
closes. To avoid this, set the working folder before you open a
simulation.
1 Application Overview 30
Opening and Saving
Simulations
Open a Library
To open a library:
1 From the File menu, click Open Library.
2 In the Open dialog box, type or select the name of the library file that you
want to use for your simulation.
3 Click Open to load the library.
The file appears as a library node in the Simulation Explorer.
Notes:
Open a Simulation
To open an existing simulation:
1 Application Overview 31
1 From the File menu, click Open.
The Open dialog box appears, showing the current working folder.
2 Move to the folder that contains the required .acmf or .acmd file.
3 To open the file, double-click the file name.
Import a Flowsheet
You can use the Import Flowsheet command to import a flowsheet that is
stored in an external language file (for example, to load a control scheme
developed for a previous problem) into the current simulation.
Notes:
To Click
Remove an object from the file that is Delete
being imported
1 Application Overview 32
current simulation with those of the
same name in the file that is being
imported
4 When you have resolved all the name conflicts, click OK to accept your
changes.
Printing Flowsheets
The File | Page Setup menu option available on any flowsheet window
allows you to ask for multi-page printing of flowsheets.
Use the Page Setup dialog to specify:
• How many sheets to use for the height and width of the flowsheet.
• Paper size.
• Orientation.
• Margin size.
Note: When you insert the .acmf file, make sure the file contains
only information relevant to the Custom Modeling library. This
information includes definitions for models, stream types,
parameter types, variable types, port types, procedures, and
tasks. Flowsheet, Properties, and Options sections in the
imported file are ignored.
Save a Simulation
To save a simulation:
• From the File menu, do one of the following:
To Click
Save the simulation in the format in which it was Save
opened
1 Application Overview 33
Note: Linked and embedded objects are not saved when you
save a simulation in modeling language format (.acmf file.)
Note: Linked and embedded objects are not saved when you
export a simulation in modeling language format (.acmf file).
Building Flowsheets
Use the Flowsheet Toolbar
Use the Flowsheet toolbar to manipulate objects in the flowsheet window.
Specify the Rotate selected
interval between object one
grid points quarter turn to Change
the left between
Display the grid in
the Flowsheet selecting and
window inserting objects
Display a scale at
the top and left of Flip selected
the Flowsheet object about
window its X axis
Align objects to the
grid when they are Rotate selected Flip selected
placed, moved, or object one quarter object about its
resized turn to the right Y axis
If you can't see the Flowsheet toolbar, click the View menu, and then click
Toolbars, and check the box next to Process Flowsheet.
1 Application Overview 34
1 Make the flowsheet window active by clicking in it.
2 From the Window menu, click Flowsheet as Wallpaper. The flowsheet is
now the background simulation.
Create a Flowsheet
To create a flowsheet:
1 In the All Items pane of the Simulation Explorer, make sure the Custom
Modeling folder or your required library is expanded, and then click
Models.
A list of existing models and the Add Model icon appear in the Contents
pane.
2 Drag and drop the required model icon onto the flowsheet, using the
mouse buttons as follows:
To Use
Insert one block only Left mouse
button
5 In the Contents pane, drag and drop the required stream onto the
flowsheet window.
Blue arrows appear on the blocks where ports are available.
6 To use the Universal ports provided, click a blue arrow and drag the
selected port to the desired position on the icon perimeter. If the port has
1 Application Overview 35
more than one model port attached, choose the port name from the dialog
box that appears.
7 Click the ports on the blocks to connect them.
8 To stop making connections, click the Select Mode button on the
Flowsheet toolbar.
Move a Block
To move a block:
1 In the flowsheet window, press and hold down the mouse button on the
block (but not on the block ID) that you want to move.
The outline of the block is highlighted, the mouse pointer changes to the
move shape, and a text box appears, showing name of the block.
2 Drag the block to the location you want and release the mouse button.
To make minor adjustments to the position of a block, you can select the
block and then use the arrow keys.
To make minor adjustments to the position of a block name, you can select
the name and then use the arrow keys.
To do this:
1 In the flowsheet window, press and hold down the mouse button on the
stream name, until the mouse pointer changes to the move shape.
2 Drag the name to the location you want and release the mouse button.
1 Application Overview 36
Move Multiple Blocks and Streams
To move a group of blocks and streams:
1 In the flowsheet window, select the group of blocks and streams you want
to move.
2 Hold down the mouse button on any block or stream within the region you
have selected.
The mouse pointer changes to the move shape.
3 Drag the group to the location you want, and release the mouse button.
You can also select the group then use the arrow keys to move it to the new
location.
Hierarchies
Hierarchies
A hierarchy is a block which can contain a flowsheet. A hierarchy can be
created on the main flowsheet or on another hierarchy by dragging the
Hierarchy model node from the Explorer onto the destination flowsheet.
The Hierarchy model node is located in the Models folder of all libraries and
under the Custom Modeling node. Hierarchy blocks have a single icon, e.g.,
Hierarchy Connections
When you try to connect a stream to the inlet or outlet ports on the hierarchy
block a dialog appears:
1 Application Overview 37
This dialog allows you to either:
• Create a new stream in the hierarchy (by selecting IN(IN) for inlets,
OUT(OUT) for outlets);
• or connect to an existing stream, in this case stream S1.
The dialog lists all streams in the hierarchy which currently start from source
blocks for a connection to an inlet port and from sink blocks for a connection
to an outlet port.
If no streams terminate at sinks (or sources), a new stream is created in the
hierarchy flowsheet without the dialog being presented.
This example illustrates the hierarchy flowsheet if the IN(IN) entry had been
selected:
A new stream IS5 has been created which terminates at a sink block. The
new stream in the hierarchy has been given the same name as the stream in
the parent flowsheet but they are different streams. The full name of the new
stream is B1.IS5. This stream starts at a connector symbol which contains the
name of the connected stream in the main flowsheet.
1 Application Overview 38
Note: You cannot connect control streams in this way.
Accessing Hierarchies
To access the flowsheet for a hierarchy:
1 Double-click on the hierarchy block in its parent flowsheet or use the
Expand menu item, located on the context menu for a hierarchy block.
2 A new Process Flowsheet window appears. You can edit this in the same
way you can edit the main flowsheet, although hierarchy blocks cannot be
made to be wallpaper.
You can also access a hierarchy from the Explorer. This allows you to edit the
non-graphical contents of the hierarchy.
The hierarchy, in this case B1, appears in a Blocks folder, but has the same
icon and contents as the Flowsheet:
You can access constraints, forms, scripts and tasks. Note that as these are
contained within the hierarchy you can only access variables, etc., which are
in blocks or streams in this hierarchy or beneath. You cannot, for example,
add variables contained in a block in the parent flowsheet to a plot owned by
a hierarchy.
1 Application Overview 39
flowsheet.
To Click
Disconnect the source end of the stream Reconnect Source
Blue arrows appear on the blocks where ports are available. For example,
for a feed stream, the outlet ports are highlighted.
3 Continue as you would for a new stream. Click the port to which you want
to connect the stream end, or click a blank part of the flowsheet to place a
feed or product.
Reroute a Stream
To reroute a stream automatically:
1 In the flowsheet window, click the stream you want to reroute.
2 Click the right mouse button on the stream.
3 Click Reroute Stream.
1 Application Overview 40
Tip: You can also select one or more streams and then press
CTRL+J to reroute them.
Tip: You can also select one or more blocks and streams and
press CTRL+B.
1 Application Overview 41
Position the Next Block Automatically
If you have selected a group of blocks, the blocks can be automatically
positioned on the flowsheet in a logical order. To do this:
1 Select a group of blocks and then click the right mouse button on one of
the blocks.
Tip: To select a group of blocks, hold down the SHIFT key and
click each block.
As you place blocks, the streams that connect them also appear. You can
move stream segments or corners to achieve the desired routing.
As you place blocks, the streams that connect them also appear. You can
move stream segments or corners to achieve the desired routing.
View a Flowsheet
You can change the way the flowsheet is displayed by:
• Using Pan to select a view of a flowsheet.
• Changing the Zoom level of a flowsheet.
1 Application Overview 42
2 Move the rectangle to the area that you wish to zoom in on and click the
left mouse button.
3 To cancel Pan, click the right mouse button.
Replace an Icon
To replace an icon with a different icon:
1 In the flowsheet window, click the block whose icon you wish to change,
and then click the block with the right mouse button.
2 Click Exchange Icon.
The icons for the block changes to the next icon in the list for the model.
You can also change the icon by clicking the block, then pressing the letter n
to change to the next icon available for the block, or p to change to the
previous available icon.
Resize an Icon
To resize an icon:
1 In the flowsheet window, click the block whose icon you wish to resize,
and then click the block with the right mouse button.
2 Point to Resize Icon, then Shrink or Enlarge to shrink or enlarge the icon
by a built-in factor.
– or –
Position the mouse pointer over one of the corners of the block icon until
the Resize mode pointer appears:
1 Application Overview 43
Drag the mouse pointer until the icon is the desired size.
Rotate an Icon
To rotate an icon in a flowsheet:
1 In the flowsheet window, click the block whose icon you want to rotate
and then click the block with the right mouse button.
2 Click Rotate Icon.
A submenu appears, enabling you to rotate the icon to the right
(clockwise) or left, or flip the icon around either axis (for example, to
reverse flow direction).
You can also use the buttons on the Flowsheet toolbar to rotate and flip an
icon.
To Do this
Supply prefixes for Type a prefix in the text box for Auto
automatic naming Block and/or Auto Stream name prefix.
A sequential number is added to the
prefix.
Use your own names for Clear the appropriate check boxes for
each block and/or stream Automatic Block and Automatic Stream
name generation.
You will be prompted for a name for
each block or stream as you place it on
the flowsheet.
1 Application Overview 44
Rename a Block or Stream
To rename a block or stream:
1 In the flowsheet window, click the block or stream you want to rename
and then click with the right mouse button.
2 From the menu, click Rename Block or Rename Stream.
3 In the Input dialog box, type the new name and click OK.
1 Application Overview 45
From the Simulation Explorer, you can:
• Create a new task.
• Edit an existing task.
1 Application Overview 46
Using your AspenTech product you can:
• Create a script
• Edit a script
For more information on using scripts, see the Automation Reference.
To Do this
Run the script Click the right mouse button in the Edit window,
point to Build, and then click Invoke Script. The
script is saved then run. After running, the
Scripting dialog box appears. Click OK to dismiss
this box.
Save the script From the File menu, click Save Text. When you
close the Text Editor, you will be prompted to
save any further changes.
1 Application Overview 47
3 In the Specification Script Creation dialog box, type a name for the script
and then click OK.
A new script icon appears in the Contents pane for Flowsheet.
The script shows the value and spec attributes for each selected variable. You
can run the script to restore these values to what they were when the script
was created.
Further information: Scripts are a simple method for automating activities,
such as changing parameter and variable properties. The scripting language is
Microsoft Visual Basic Scripting Edition (VBScript). This is supplied
automatically with your installation.
If you want to use the more powerful features of VBScript, you can obtain full
documentation on the VBScript language from the Microsoft web site.
To Do this
Run the script Click the right mouse button in the Edit window,
point to Build, and then click Invoke Script. The
script is saved and then run. After running, the
Scripting dialog box appears. Click OK to dismiss this
box.
Save the From the File menu, click Save Text. When you close
script the Text Editor, you will be prompted to save any
further changes.
1 Application Overview 48
language uses Microsoft Visual Basic Scripting Edition (VBScript). This is
supplied automatically with your installation.
If you want to use the more powerful features of VBScript, you can obtain
help from the Microsoft web site as a free download.
Tip: You can use the Constraints section to write equations that
contain variables from different blocks on your flowsheet.
1 Application Overview 49
Tip: You can use the Constraints section to write equations that
contain variables from different blocks on your flowsheet.
1 Application Overview 50
1 From the Edit menu, click Insert Objects.
2 In the Insert Object dialog box, click the required options and then OK to
close this dialog box.
The Microsoft Windows application is now part of the flowsheet.
1 Application Overview 51
match those in the existing model, the connection or assignment is not
reapplied and a warning is given.
Running Simulations
Running Simulations
Your Aspen Modeler product can run five different types of simulation:
• Initialization Specifying the initial conditions for a subsequent dynamic
run. You may initialize state variables or variables related to state
variables, time derivatives, or a combination of both.
• Steady-state Running a simulation where the time derivatives of a
dynamic simulation are equal to zero.
• Dynamic Running a simulation where the variables change over time.
• Estimation May be one of:
• Parameter Estimation Fitting model parameters to experimental data.
• Data Reconciliation Comparing the steady-state plant performance with
that predicted by a model.
• Optimization Optimizing steady-state or dynamic solutions using an
objective function and supplied constraints.
1 Application Overview 52
3 On the Run Control toolbar, click the Run button to run the current
simulation.
Reset a Simulation
To reset a simulation:
1 From the Run menu, click Reset.
The Reset dialog box appears, warning you that this will reset all user-
assigned variable values to their default values. The spec and bounds
properties of the variables as well as all parameter values are unaffected.
The values and derivatives which are affected are dependent on the run
mode, as shown in this table:
Mode box
1 Application Overview 53
2 On the Run Control toolbar, click the Run button to run the current
simulation:
Run button
Mode box
3 On the Run Control toolbar, click the Run button to run the current
simulation:
Run button
Step a Simulation
To step through a dynamic simulation one time interval at a time:
• On the Run Control toolbar, click the Step button:
Step button
1 Application Overview 54
Pause a Dynamic Simulation
You can pause a dynamic simulation in two ways:
• By clicking the Pause button.
• At a previously specified time.
Pause a Simulation
To pause a running simulation:
• On the Run Control toolbar, click the Pause button:
Pause button
To Do this
Pause at a specific time Check the Pause At box and enter
the time for suspending your
dynamic run.
To Click
Keep the dialog box Apply
open
Restart a Simulation
To restart a dynamic simulation:
1 From the Run menu, click Restart.
– or –
On the Run Control toolbar, click the Restart button:
Restart button
The first snapshot (taking the most recent run first) labeled with a
simulation time of 0 is loaded.
1 Application Overview 55
Note: If you want to load a specific snapshot, use Rewind and
choose the required snapshot.
2 On the Run Control toolbar, click the Run button to start the solution of
the next dynamic run from its initial conditions at time zero:
Run button
To Click
Keep the dialog box Apply
open
To Click
Keep the dialog box Apply
open
1 Application Overview 56
Close the dialog box OK
Rewind a Simulation
To rewind a dynamic simulation:
1 From the Run menu, click Rewind.
– or –
On the Run Control toolbar, click the Rewind button:
Rewind button
Run button
1 Application Overview 57
You can perform the following action on an estimation run:
• Reset the simulation, which removes the current solution point and
returns all variables to their default values.
For more general information on Estimation, see Improving Your Simulations.
Note: You can also remove Estimated variables and change their
current value and lower and upper limits from this tab.
After a successful Estimation run, the standard error for each estimated
variable is displayed here.
1 Application Overview 58
Change the weight, value and units for each experiment variable by
selecting them on a table. Measured variables are shown as reconciled.
Change the experiment weight and activity.
Note:
1 Application Overview 59
Note: You can paste columns of values from other applications
such as MS Excel, using standard cut-and-paste or drag-and-
drop methods, or alternatively you may use Paste Special:
Tip: If you are pasting from Excel, you can use the CTRL key to
select multiple non-adjacent columns, but ensure the Time
column is on the left and the values and weights (optional) are
on the right of the selection. You can also select Paste Special
from the context menu available over the dynamic data grid. This
brings up a dialog allowing you to select which rows of data are
to be used and to adjust the experiment data times.
1 Application Overview 60
Note:
1 Application Overview 61
This topic gives definitions of the statistical measures used in Aspen Custom
Modeler. It is in two parts:
• Statistical results available through the Maximum Log Likelihood dialog
box.
• Other statistical measures.
You should look at both parts for a complete overview of the statistical
measures in Aspen Custom Modeler.
Covariance
Covariance is a measure of how sensitive the values of the converged
estimated variables are to small perturbations in the measurements. It
answers the question: How good is our solution to the estimated variables?
For a strict mathematical definition of covariance and how to approximate it,
see Nonlinear Parameter Estimation by Yonathon Bard (1974, Academic
Press). To approximate covariance, Aspen Custom Modeler uses the formula:
2 × Sum of Squares
Covariance = × ( J T J ) −1
max (1,m - p)
Where:
m = Total number of measurements.
p = Number of estimated variables.
J = m by p Jacobian matrix of partial derivatives of
1 Application Overview 62
the measurements with respect to each
estimated variable.
The sum of squares is the weighted absolute squared error between the
observed and predicted values.
This covariance approximation is valid provided you have a good fit; if the
sum of squares is large, the covariances may be inaccurate. The
approximation can also be suspect if the solution of the estimated variables is
on the bounds.
Correlation
Correlation is directly computed from the covariance matrix. It gives a
standardized measure of the relationship between the estimated variables.
The correlation value lies between -1 and +1. The larger the absolute value,
the stronger the relationship or dependence between the estimated variables.
Standard Error
The standard error (also known as standard deviation) is the square root of
the variance. It is a measure of the quality of the converged or fitted value of
the estimated variable. The smaller the standard error, the more confident
you can be in the accuracy of the estimated value.
RMS Error
RMS (root mean square) error is the square root of the weighted absolute
squared error between the observed and predicted values of the
measurements, divided by the number of measurements. Use the RMS error
to compare how good the fit of the measured variables is for different sets of
measured data.
F-Value
You can use the F-value to assess the relative quality of different models, that
is, how well each model fits the measured data you have provided for an
estimation simulation. This is done by comparing the computed F-values from
the estimation simulation, using the same set of data but using different
models.
The F-value is:
1 Application Overview 63
Standardized Residuals
The Standardized Residual of a measured variable is the residual (difference
between the Observed and Predicted values) divided by the standard error of
the measured variable. It is a scaling of the Absolute Residual which enables
comparison of residuals for different variables in a unit-less fashion.
Run button
1 Application Overview 64
Dynamic Optimization
To perform a dynamic optimization, you must specify:
• At least one objective variable.
• Whether the final time is Fixed or Free.
• At least one variable that is either a decision, initial, or control variable.
You can also optionally specify:
• Additional equality and inequality final time constraints as language in the
flowsheet constraints section.
• Final time constraints on variables directly in the Optimization Tool dialog.
• Path constraints on variables.
• Upper and lower bounds of the control variables on each element.
• Upper and lower bounds on the element sizes.
• A maximum move value for control variables.
For an example of dynamic optimization, see the Dynamic Optimization
Example.
Tips:
• You are not forced to specify any additional constraints.
• If you do not specify an objective variable, a normal dynamic simulation is
performed.
• You can use only the Gear or Variable Step Implicit Euler (VSIE)
integrators for dynamic optimization. Note that the VSIE integrator is in
general less accurate than the Gear integrator. Hence, you may need to
tighten the VSIE tolerances and/or increase the optimization tolerance
when using it for dynamic optimization.
• You must ensure that the accuracy used for the dynamic runs is smaller
than the optimization tolerance.
• Dynamic optimization is suitable for use with small to medium-sized
flowsheets. This is because a dynamic optimization simulation may need
to perform many dynamic runs to find the optimum solution. Each
dynamic run within the optimization will be slower than a single normal
dynamic run due to the additional cost of computing the sensitivities.
• Before starting a dynamic optimization, perform manual dynamic runs to
assess the behavior and to help pose feasible constraints.
• The cost of the inner dynamic runs increases with the number of decision,
initial, and control variables. It also increases with the number of
elements used to discretize the control variables. You are therefore
advised to keep the number of elements small initially, and increase them
in a series of optimization simulations, using the final converged values of
the control variables as initial values for the subsequent simulation.
• To ensure faster performance, when you specify the communication time
intervals for the run, enter a large value (for example, you could specify
the final time), unless you are interested in the intermediate values of the
variables for the run.
• Only a specific types of tasks and model conditional (IF) equations work
with dynamic optimization. Tasks and IF equations inside models will work
if:
1 Application Overview 65
− They purely depend on a fixed time value.
− The element sizes are not moving.
− The final time is fixed.
or if:
− The element sizes are moving but the IF or task always activates or
switches at a fixed scaled location within the same element.
− In all other cases, IF equations and tasks introduce a discontinuity to
the optimization, which is likely to cause a convergence failure. In
some cases, for example, if the optimum is far enough away from the
discontinuity, you may obtain convergence but this could be to a sub-
optimal solution.
− If you are using an optimizer which requires gradients, sensitivities
(partial derivatives of the objective and constraints with respect to the
decision, initial, control variables and element sizes) are computed
during the inner dynamic simulations. They are computed directly from
the derivatives of your model equations. Therefore, it is essential that
derivatives returned by your procedures are accurate, especially as
normal dynamic simulations may not show errors. If you have
procedures which return derivatives, is it recommended to use the
ACM check procedure derivatives option to confirm that all your
derivatives are correct before starting a dynamic optimization
simulation.
1 Application Overview 66
8 On the Run Control toolbar, click the Run button to run the simulation.
To Click
Initialize all time derivatives to zero Steady State
1 Application Overview 67
Properties File to load an existing Aspen Properties input file (extension
.aprbkp or .aprinp) You can then use Edit Using Aspen Properties button to
edit the properties once you have done the import if you require. When you
next save the simulation file the Properties Plus input will be included in the
file. Then whenever you load the simulation input file ACM will check if an
intermediate file needs to be generated.
If you want to use the Aspen Properties intermediate file directly click on the
Use Properties definition file button and either type in or browse for the
required file.
To generate the intermediate file you can use either Aspen Plus or Properties
Plus. In either product you can specify, property methods (for example PENG-
ROB and UNIFAC), components and property data to be used in your
simulations. Refer to the Aspen Plus or Properties plus help for more
information.
To use an existing input file using Aspen Plus:
1 Start Aspen Plus.
2 Select Open an Existing Simulation / More Files...
3 Locate the folder where the required input file (.bkp or .inp) is located.
4 Open the file.
5 Run the simulation and then save it in the Aspen Plus document format
(*.apw). A file runid.appdf is created, with the *.apw file.
6 Exit Aspen Plus.
Select New instead of Open when you want to create an input file from
scratch.
1 Application Overview 68
Tip: The AllVariables table shows all the variables in the block.
To change Do this
A variable's value Click the appropriate cell in the Value
column and type the new value.
Units of Measurement
Click one of the following to display information on:
• Changing units of measurement for displaying data.
• Defining physical quantities, units of measurement, and conversions.
• Units of measurement for your models.
• Time units of measurements in simulation models and the graphical user
interface.
Set Description
ENG English engineering units
SI SI units
METCBAR A variation on the MET unit set that uses Celsius for
temperature and bar for pressure
US US units
Note: ENG, MET, SI, METCBAR and SI-CBAR are all identical to
the Aspen Plus units of measurement sets of the same name.
You can change the units of measurement either globally or for individual
variables:
1 Application Overview 69
Globally From the Tools menu, point to Units of
Measurement and then click the required set.
Angle "rad"
AngularVelocity "rad/s"
AngularVelocityRPM "rpm"
Area "m2"
Diffusivity "cm2/s"
ElectricPower "kW"
Energy "GJ"
Head "kJ/kg"
HeatFlow "GJ/hr"
HeatFlux "kW/m2"
HeatFluxLinear "W/m"
HeatOfReaction "GJ/m3/hr"
HeatTransferCoeff "kW/m2/K"
HookesConstant "N/m"
HTCoeffArea "kW/K"
Length "m"
LengthShort "mm"
Mass "kg"
MassDensity "kg/m3"
MassEnthalpy "MJ/kg"
MassFlow "kg/hr"
1 Application Overview 70
MassFlux "kg/s/m2"
MassFraction "kg/kg"
MassHeatCapacity "kJ/kg/K"
MassReactionRate "kg/hr/m3"
MassSecondMoment "kmol/kg"
MassSpecificFlow "kg/hr/m2"
MassSpecificVolume "m3/kg"
MassThirdMoment "Mmol/kg"
MolarDensity "kmol/m3"
MolarEnthalpy "GJ/kmol"
MolarEntropy "kJ/kmol/K"
MolarFlux "kmol/s/m2"
MolarGibbs "kJ/kmol"
MolarHeatCapacity "kJ/kmol/K"
MolarReactionRate "kmol/hr/m3"
MolarVolume "m3/kmol"
MolarWeight "kg/kmol"
MoleFlow "kmol/hr"
MoleFraction "kmol/kmol"
Moles "kmol"
MolesPerMass "mol/kg"
Percent "%"
Power "kW"
Pressure "bar"
PressureDifference "bar"
PressureDiffSmall "N/m2"
SurfaceTension "N/m"
Temperature "C"
TemperatureDifference "C"
ThermalConductivity "W/m/K"
Time "hr"
TimeMin "min"
TimeSec "s"
Velocity "m/s"
Viscosity "cP"
1 Application Overview 71
VolFlowPerRPM "m3/hr/rpm"
Volume "m3"
VolumetricFlow "m3/hr"
VolumetricFlux "m3/s/m2"
1 Application Overview 72
Reset Specifications from the Status
Window
To reset specifications changed from default settings defined in models:
1 From the View menu, click Status Window.
2 Do one of the following:
To Do This
Reset all fixed and free Click Fixed Changes Tab and click Reset.
settings
Reset all Initial and Click Initial Changes Tab and click Reset.
unInitial settings
Activate a Task
A task is a set of instructions that you can create in your AspenTech product.
A task defines a sequence of actions that take place during a dynamic
simulation, such as changing feed flow rate.
After you have created a task, you must activate it, so that it is used in the
current simulation.
A check mark appears in front of the Activate command and the task icon
1 Application Overview 73
changes to display a blue check mark, which indicates that the task will be
used in the simulation:
A check mark appears in front of the Activate command and the task icon
changes to display a blue check mark, which indicates that the task will be
used in the simulation:
Run a Script
A script is a set of instructions, written in Microsoft Visual Basic, to automate
the setup of a simulation.
You can run scripts for:
• A flowsheet, where the script applies to the entire flowsheet A library
script also applies to the flowsheet.
• A block or stream, where the script applies to the selected item
If errors occur when you run a script, and if a suitable debugger has been
installed on your machine, you can debug the application.
The Modeler.acml library delivered with ACM contains some standard scripts
you can call.
1 Application Overview 74
Run a Flowsheet Script
To run an existing flowsheet script:
1 In the All Items pane of the Simulation Explorer, click Flowsheet.
2 In the Contents pane, click the appropriate script icon with the right
mouse button.
3 Click Invoke.
The script is run. After completion, the Scripting dialog box appears. Click
OK to close this dialog box.
ListLargeDerivatives
This script will list out in the simulation messages window the variables with
large derivative values in the current simulation. The tolerance used on the
derivative value is by default 0.01 of the value of the variable but this can be
specified as an argument to the script.
e.g. InvokeLibraryScript
"modeler.acml","listlargederivatives",4
will use a tolerance of 0.0001.
1 Application Overview 75
Handle Scripting Errors
When you run a script, errors may occur, for example, if you try to access a
variable that does not exist, the system raises an error. If a suitable debugger
has been installed on your machine, a dialog box will prompt you to debug
the application.
Remember: When you have finished your debug session, on the Debug
menu, select Detach All Processes. If you do not do this, closing the debugger
will shut down your Aspen Modeler application.
1 Application Overview 76
No structural singularities.
1 Application Overview 77
To Do this
Accept the recommended Click the variable name(s) and then click
changes Accept.
To Do this
Add variables In the Add text box at the bottom of the Do Not
Change Spec list, type a variable name and then
click Add.
Note: You can also use wildcards
– or –
Drag and drop variable names from Variable Find
and from tables directly into the list.
Rename variables Click the variable name, click Edit, and type a new
name.
1 Application Overview 78
To convert the variable to Click
an expression that gives
All variables in the owning block or Block/Stream
stream
Option Result
Set the specification status of all The specification process is
state variables to Initial completed.
1 Application Overview 79
1 Make sure that you obey the external procedure calling conventions for
the language you are using.
2 Generate the DLL by:
− Using existing external code.
− Creating new external code.
Important
• If your routines make calls to other routines in a library, or in other
Fortran files, see Generate a DLL for Procedures that call other External
Routines.
• If you need to change the procedure code contained in a DLL, you can
unload the DLL. The unloaded DLL will then be re-loaded when the next
run that requires it is performed.
The Generate Procedure Code dialog box appears with Wrappers in the
Generate Files area selected by default.
2 In the Makefile area, select Generate and Execute.
3 If necessary, change the path to your working directory and click OK.
The makefile, MakeUserCode (and also wrapper routine if you are using
Fortran), and DLL are generated.
4 If you did not select Execute in step 2, you can do this after you have
edited the makefile by entering the following command from the MS-DOS
prompt :
-f MakeUserCode
For future runs, you need to supply only the DLL file with the input.
Fortran Users The argument list for your external routines must contain the
parameter IFlag. If you are using your routines for properties calculations,
then your argument list must also contain the parameter IType.
1 Application Overview 80
If IFlag or IType is missing, add them to avoid the error "unsatisfied external
symbols" when you generate the dynamic link library.
The Generate Procedure Code dialog box appears with Wrappers in the
Generate Files area selected by default.
2 Select Templates, to create a template into which you can insert your
code.
Write or insert your code in the template.
3 When you have finished adding your code to the template, select
Generate and Execute in the Makefile area.
4 If necessary, change the path to your working directory, and then click
OK.
The template and the makefile, MakeUserCode (and also the wrapper
routine, if you are using Fortran), and DLL are generated.
5 If you did not select Execute in step 3, you can do this after you have
edited the makefile by entering the following command from the MS-DOS
prompt :
nmake -f MakeUserCode
For future runs, you need to supply only the DLL file with the input.
1 Application Overview 81
3 Find the section headed Problem specific part.
4 To add an object library to the link, add a definition for USERLIBS naming
the library, and a definition for USERLIBPATHS, specifying the path to the
library, prefixed by $(LIB_PATH).
For example:
USERLIBS = My_Objects$(OLB)
USERLIBPATHS = $(LIB_PATH)“C:\Development\Lib”
5 To add extra objects to the dll, add a definition for USERTARGETS naming
the objects to be added.
For example:
My_First$(OBJ): My_First.f
$(ECHO) Compiling My_First.f
$(FORTRAN) $(FDEBUG) $(F_OPTC) My_First.f
#
My_Second$(OBJ): My_Second.f
$(ECHO) Compiling My_Second.f
$(FORTRAN) $(FDEBUG) $(F_OPTC) My_Second.f
1 Application Overview 82
#>>> The dll to be created: specified in the LIBRARY: part
of the
#>>> procedure definition
Libraries = Example$(DLL)
#
#>>> This object list is modified from that generated by
the
#>>> procedure code export
#>>> The sources Range and Average are in UserCode.f,
#>>> so Range$(OBJ) and Average$(OBJ) have been replaced by
#>>> UserCode$(OBJ).
#>>> The two wrapper functions remain so that ACM can
#>>> call these subroutines.
Library1_Objects = MedianI$(OBJ) Median$(OBJ) \
AverageI$(OBJ) RangeI$(OBJ) UserCode$(OBJ)
#
#>>>---- start of definitions added by the user
#
#>>> List of objects which need to be compiled separately,
#>>> and added to the dll that are NOT called directly by
ACM.
#>>> This has been added by the user.
USERTARGETS = My_First$(OBJ) My_Second$(OBJ)
#
#
#>>> Location(s) of libraries specified in USERLIBS, added
by the
#>>> user.
#>>> The first is the usual location of gpp.dll and gpp.lib
#>>> The second is the location of the 'stats.lib'
#>>> Note the use of double quotes (redundant in the second
case)
USERLIBPATHS = $(LIB_PATH)"C:\Program
Files\AspenTech\AMSystem 12.1\bin" \
$(LIB_PATH)"C:\Development\TestLibrary"
#
#
1 Application Overview 83
#>>> Additional object libraries that contain subroutines
called by
#>>> the code in the dll
#>>> gpp.lib is supplied by AspenTech and permits linking
into
#>>> gpp.dll
#>>> stats.lib is an ordinary object library. Added by the
user.
USERLIBS = gpp.lib stats.lib
#
#>>>--- end of definitions added by the user
#
build: $(Libraries)
#
Example$(DLL): $(Library1_Objects) $(USERTARGETS)
$(ECHO) Building Dynamic Link Library Example$(DLL)
$(C_LINK) $(LINKDEBUG) $(C_OPTL) $(DLLOPT)
$(Library1_Objects)\
"$(ATUTCFORPATH)libatdll$(OLB)" \
$(ALT_EXECUTABLE)"Example$(DLL)" $(USERLIBPATHS)
$(USERLIBS) \
$(SYSLIBS)
$(ECHO) Dynamic Link Library built
#
MedianI$(OBJ): MedianI.f
$(ECHO) Compiling MedianI.f
$(FORTRAN) $(FDEBUG) $(F_OPTC) MedianI.f
#
Median$(OBJ): Median.f
$(ECHO) Compiling Median.f
$(FORTRAN) $(FDEBUG) $(F_OPTC) Median.f
#
AverageI$(OBJ): AverageI.f
$(ECHO) Compiling AverageI.f
$(FORTRAN) $(FDEBUG) $(F_OPTC) AverageI.f
#
RangeI$(OBJ): RangeI.f
1 Application Overview 84
$(ECHO) Compiling RangeI.f
$(FORTRAN) $(FDEBUG) $(F_OPTC) RangeI.f
#
#>>>------ Start of rules changed or added by the user
#
#>>> User has replaced rule for Average$(OBJ) here with one
for
#>>> UserCode$(OBJ), and removed the rule for Range$(OBJ)
UserCodeI$(OBJ): UserCodeI.f
$(ECHO) Compiling UserCodeI.f
$(FORTRAN) $(FDEBUG) $(F_OPTC) UserCodeI.f
#
#>>> User has added extra rules to compile the fortran for
the two
#>>> routines called by his procedures that are not in
either
#>>> stats.lib or gpp.lib
My_First$(OBJ): My_First.f
$(ECHO) Compiling My_First.f
$(FORTRAN) $(FDEBUG) $(F_OPTC) My_First.f
#
My_Second$(OBJ): My_Second.f
$(ECHO) Compiling My_Second.f
$(FORTRAN) $(FDEBUG) $(F_OPTC) My_Second.f
#
The unloaded DLLs are re-loaded the next time you run the simulation that
requires them.
1 Application Overview 85
Work with Snapshots and Results
A snapshot is a saved set of values and specifications, for all variables in a
simulation. You can use them to rewind simulations or to copy selected values
to your simulation. Snapshots are taken automatically by the system, but can
also be requested.
When you change the structure of a simulation, for example, by adding a
controller, all snapshots become results. You can no longer use them for
Rewind, but you can copy values from them.
Icon Meaning
Kept snapshot
Snapshot
Result
Kept result
1 Application Overview 86
• Results from the simulation input file, kept results.
The different types of snapshot and result are distinguished in the list using
icons.
From this dialog box you can:
• Rewind using any snapshot. Once you close the dialog the simulation time
will be set to the time in the snapshot. You cannot rewind using results.
• Copy values from any snapshot or result. This copies the values of all
variables in the snapshot to variables that match by name in the current
simulation. The simulation time is not changed.
• Rename or delete any snapshot or result.
• Flag as kept any snapshot or result which isn't already flagged as kept.
When a snapshot is marked as kept it indicates that when the snapshot is
archived it will be saved as a kept result.
From this dialog you can also access an advanced copy dialog box, which
allows you to carry out more complex copy operations.
1 Application Overview 87
• Control how often snapshots are generated during a dynamic run.
• Limit the number of automatically generated snapshots.
When a limit has been set, old automatically generated snapshots are deleted
before new ones are created to ensure the maximum number specified is not
exceeded.
1 Application Overview 88
saved. If you have the Always Mark Named Snapshot as Kept check box
set on the snapshot page of the Settings dialog box, your named snapshot
will be automatically marked as Kept.
Use a Snapshot
You can use a snapshot to:
• Copy variable values from the snapshot into a simulation, based on a
search/pattern-matching of variables.
• Rewind a simulation in any run mode. This restores the state stored in the
snapshot.
• Rewind a dynamic simulation (using Timed Snapshots only) to a previous
time in the current results sequence. The current simulation time for the
run is set to the time in the snapshot.
• Restart a dynamic run. The Restart command automatically rewinds to the
first snapshot that can be found in the dynamic run.
For detailed information and examples of using a snapshot to set the values
for a simulation, see Copy Values from a Snapshot or Result.
Use a Result
You can use a result when copying values to the current simulation.
For detailed information about using a result to set the values for a
simulation, see Copy Values from a Snapshot or Result.
1 Application Overview 89
If you simply want to copy all matching variables between the snapshot or
result and the simulation, use the Copy To button. If you want to perform
a more complex Copy, click the Advanced Copy button. In the Advanced
Copy dialog box, use the Copy From and Copy To boxes to control how
data from a snapshot is copied into the simulation.
6 Click Copy.
A dialog box appears telling you there are 10 matches:
7 Click OK.
1 Application Overview 90
8 To see which variables matched, click View Changes:
9 In the Advanced Copy dialog box, click Cancel to lose your changes.
Explanation
In the Copy From box, variables in tank1.flowin were selected. There is only
one variable in tank1.flowin, that is, tank1.Flowin.Flow.
The path for this variable relative to tank1.Flowin is Flow. So the variables
that will be copied to are those whose complete path matches ~.Flow.
Tip: If you enter this string in the Variable box of Variable Find,
you will get the same list you obtain in the Advanced Copy dialog
box.
1 Application Overview 91
4 In the Copy To text box type ~.Flowin.Flow and ensure the Fixed check
box is selected, as well as Initial and Free.
5 Click Copy.
A dialog box appears telling you there are 5 matches.
6 Click OK, then click View Changes:
Note: If you did not cancel the Advanced Copy dialog box in the
first example and restart, your list will contain these matches
appended to the original list, because the changes have
accumulated in the Advanced Copy dialog box.
Explanation
An explicit variable path was given in the Copy From box. The path of the
variable relative to itself is an empty string. Therefore, nothing is prefixed to
the Copy To pattern and it is used unmodified to match destination variables.
1 Application Overview 92
If you copy from tank1.flowin to the inlet flows of the other tanks using
tank1.Flowin in the Copy From box, and ~.Flowin.Flow in the Copy To box,
the result will be no matches.
The Copy From variable is tank1.flowin.flow with a relative path of flow. This
results in a complete Copy To pattern of ~.Flowin.Flow.Flow, which does
not match any variables.
Alternatively, if in trying to perform the same task you enter
tank1.Flowin.Flow in the Copy From box and ~ in the Copy To box, 35
matches will be found and View Changes will list all the active variables.
This is because an explicit variable path gives an empty relative path, so the
Copy To string is used unmodified. The ~ in the Copy To box therefore
matches all the active variables in the simulation.
1 Application Overview 93
Use Homotopy
To use homotopy for a steady-state or an initialization run, you must define
which fixed variables to use and their current and target values, specify the
options for homotopy, and enable homotopy.
To use homotopy:
1 From the Tools menu, click Homotopy.
2 In the Homotopy dialog box, add the fixed or initial variables to be used to
the Homotopy list box. You can either:
• Type the name of a fixed variable in the Variable text box.
• – or –
• Click Find and drag and drop fixed variables from Variable Find onto the
Homotopy list. You can also drag and drop fixed variables from tables.
3 To change the values and set targets of variables in the Homotopy list,
double-click a variable name and enter the new value and the target value
in the Change Values dialog box.
4 To specify the options for homotopy steps, click Options.
5 Type the values for the options you want to change, and then click OK.
6 Select the Enable Homotopy check box. The next run will have homotopy
enabled, and will use the fixed variables and options you have specified.
Notes:
Homotopy
Homotopy provides a way of moving from one converged solution to another
solution with different values for one or more of the homotopy variables. It is
1 Application Overview 94
a useful technique where it is difficult to obtain convergence for a particular
specification, but where you already have a converged solution for a different
specification.
Homotopy works by moving along a path to the new solution, and solving a
number of interim points along the way.
Let HOM1 be the vector of values for the homotopy variables at the point you
have already solved, and HOM2 is the vector of values for the point to which
you want to move. In a homotopy simulation, your AspenTech product
attempts to solve a number of points at values for the homotopy variables of:
Homotopy = HOM1 + theta * (HOM2 – HOM1)
Where:
Theta = Homotopy parameter. This is a number that is
moved from 0 to 1 at the successive solutions.
When theta is 1, this corresponds to the
specification HOM2. You can control the way theta
changes between successive solutions.
For Select
Normal behavior Full
Note: You can also use Automation to change the user interface
update frequency, using the SyncSteps property.
1 Application Overview 95
Reviewing Results
Forms for Reviewing Results
You can view results using the following forms:
• Plots, which display results graphically
• Tables, which display results in a grid
• ActiveX Control Forms, (ocx forms) which are forms you can create using
reusable software components such as text boxes, check boxes, list
boxes, and command buttons that have been developed by software
vendors
Note: You can make any of these forms the default for viewing
the results of a model.
Customizations
Customizations can include the form size, variables displayed in it and other
elements. It is also possible to copy a model which contains a customized
table form from a library to Aspen Custom Modeling without loosing
customizations.
For example, an instance of a form [e.g. B1.ResultsPlot] might have an
entirely different definition to that of the original form in the model type. To
reset it to the original, right-click the form and select Reset Definition. This
applies to inherited forms, forms in libraries, etc.
Customizations are stored, so next time you open a form for a particular
block, the customizations are still present. They are also stored in the input
file when the file is saved.
The following conditions apply to input files:
• Aspen Custom Modeler 12.1 reads 10.2 input files correctly but 10.2
looses any form definitions in an 12.1 input file.
• Aspen Custom Modeler 12.1 will not load 10.2 binary input files or
libraries.
1 Application Overview 96
2 Create library
3 Load library
4 Then in the library you would see a custom form definition <MyFormDef>
5 If you attempted to open this form you would get a disabled instance of
<MyFormDef>
6 To open an instance of this form you would first have to add an instance
of it either to the flowsheet or to a model definition
It was possible but uncommon to implement forms such that they are
intended to be instantiated by double-clicking them in the library without
placing them either on the flowsheet or in a model, and not be disabled as
described in step 5.
This is no longer possible. The workarounds are
1 Place the instances of your forms in a model in the library. You could
potentially gather them all together under a model created for the purpose
2 Place instances of your forms in the flowsheet of any input file
1 Application Overview 97
Work with Plots
Plots are used to display a graphical representation of results. Your
AspenTech product enables you to:
• Create new plots
• Change the properties of plots
Create a Plot
You can create three types of plots:
• Run-time plot: a plot of a set of variables against time
• Profile plot: a plot of a series of variables, for example, temperature
profile, against an index (the number of trays within a column or the
number of points used to discretize a partial differential equation - an
equation that contains both spatial and time derivative terms, see below)
or against another series of variables, for example, the length of a reactor
bed:
∂T k ∂ 2T
=
∂t C p ρ ∂x 2
• Phase Plot: a plot of a set of variables against another variable on the X
axis. The data plotted is time based but time is not shown on the plot.
To Do this
Plot a set of variables from different Create a flowsheet plot
blocks
1 Application Overview 98
c) In the Add Form Instance dialog box, enter a name for the form and select
ProfilePlot from Available Form Definitions.
d) A plot appears, and a new icon appears in the Contents pane, showing a
new plot template.
Adding Variables
The procedure for adding variables to the plots is very similar in both cases,
with the following difference:
• In flowsheet-level plots, you need to prepend the block name to the
variable names, e.g. B1.X.
• In model-level plots, you just need to give the variable name within the
model, e.g. X.
Phase plots have a time range facility which allows you to select the time
range of the data that will be plotted.
To access this:
1 Select Time Range... from the phase plot context menu. This displays a
dialog that allows you to select a start and end time for the plot.
2 Check the Use current simulation time check box, the plot is updated
when new data is generated.
1 Application Overview 99
• 3d Surface Plots
2d Plots
The x-axis represents an index of the variables in the y-axis profile, or you
can optionally define an x-axis profile. It is useful to define an x-axis variable
when the y-axis profile variables are distributed over distance, and items are
not equally spaced.
It would be possible to have this spacing vary with time. You may plot more
than one profile on the y-axis.
• To create this type of plot select the 2d plot button on the profile editor.
3d Time Plots
These are very like 2d plots; the profile variables are plotted on the z-axis,
the x-axis behaves as in the 2d plots described above and the y-axis
represents time; the plot surface is extended as time progresses. However,
you may plot only one profile on the z-axis.
• To create this type of plot select the 3d plot button on the profile editor
and in the Y - axis profile box, select the Time button.
To see an example of a 3d time plot, see the FiveTanks example.
3d Surface Plots
3d surface plots depict two dimensional arrays against two indices, the x- and
y- axes. Profiles can be assigned to both of these axes, for example In a
heated slab of material you could plot temperature against the x and y
distances across the slab. You may plot only a single surface at a time.
• To create this type of plot select the 3d plot button on the profile editor
and in the Y - axis profile box, select the Specify profile button.
You can optionally supply different time settings for the plot, or specify a time
interval, so that profiles are added at this interval during a dynamic run. If
you pre-define the profile intervals, the plot refreshes as the data becomes
available.
• To see an example of a 3d surface plot, see the Heated Slab example.
• See also Interacting with 3D Profile Plots.
2 In the Profile Variables list, click the button or press Insert, then type
the name of the variable you wish to place in this profile.
3 Repeat until you have added all the variables you wish to this profile. You
can change the order of these variables by dragging them up and down
the list, or by pressing Alt and the Up or Down arrow keys.
3 To remove a profile from this list highlight it and then click the button
or press Delete.
Using Wildcards
The following table details wildcard options:
To Enter this
Plot the contents of the array T in the block R1 in a R1.T
flowsheet plot
Plot the heights of liquid in the fivetank example, create a Tank*.h (or) ~.h
profile with one variable
or
create a profile with five variables Tank1.h, Tank2.h, Tank3.h,
Tank4.h, Tank5.h
Chart Interactions
Rotation
1 Hold down both mouse buttons (or the middle button on a 3-button
mouse), and:
• to rotate freely, move the mouse in the desired direction, or,
• to constrain rotation along an axis, press the "x", "y", "z", or "e" key and
move the mouse perpendicular to that axis.
Translation
1 Press Shift, hold down both mouse buttons (or the middle button on a 3-
button mouse), and move the mouse to change the positioning of the
chart inside the plot window.
Scaling
1 Press Ctrl, hold down both mouse buttons (or the middle button on a 3-
button mouse), and move the mouse down to increase chart size, or up to
decrease chart size.
Zooming
1 Press Ctrl, hold down the left mouse button, and drag mouse to select
zoom area and release mouse button.
Additional Options
Additional options are provided by right-clicking on the chart. These are:
Create a Table
You can create either:
• A flowsheet table: a table of a set of variables from different blocks.
• A Hierarchy table:a table of a set of variables in a hierarchy.
• A model table: a table of all the blocks that use the same model
• A Time History table: a table of an existing plot, showing a set of values
for a variable, recorded over a period of time, at communication intervals
set in the Run Options dialog box.
• A Profile Table: A table of the historical data used to generate a profile
plot, showing a set of values for a profile, recorded over a period of time.
Note: You cannot drag and drop a stream variable marked with
the < or > character.
Tip: Instead of using drag and drop, you can type the variables
names. To do this, click the right mouse button on the table,
then click Properties. Click the Variable tab, and then type the
required variable names in the Variable Name box.
Note: Both the table template and AllVariables table are gray.
4 By default the table will only show the value and spec attributes of a
variable. To display additional attributes, change the properties of the
table by clicking the right mouse button, and then click Properties.
5 To quit the table template, click the Close button.
3 In the Variable Find dialog box, type a name for the table and then click
OK.
The newly generated table appears and a new icon appears in the
Contents pane for Flowsheet, showing the new table.
– or –
− Double click the relevant attribute. The attribute is automatically
transferred to the Selected Attributes area.
3 Click OK to apply the changes and close the dialog box.
Define Patterns
You can use patterns, which may contain wildcards, in a string text, to
produce a match for an Advanced Copy operation:
Symbol Meaning
* Finds zero or more characters for the current name field
In the Advanced Copy dialog box, you can also use results from an existing
block to provide starting values for a new block.
Tip: You can use the Find or Find More buttons as follows:
To Click
Append a new list of variables matching a Search Find More
criterion to a list of variables from a previous
Find operation
3 When you have completed your search, click the Close button to quit
Variable Find.
2 To display Lagrange multipliers, click the table with the right mouse
button, and then click Properties.
3 Select the ULagrange and Llagrange attributes from the Available
Attributes list and click the right arrow to transfer them to the Selected
Attributes list.
4 Click OK to apply the changes and close the dialog box.
The table now includes columns for Lagrange multipliers.
Note: If the run fails to converge, it will fail in one of the groups
in the decomposition. Some variables will satisfy your equations
(those appearing in groups before the failed group). The
variables in the unconverged group will be the unconverged
values at the last iteration of the solver. Variables in the
subsequent groups have the values from the start of the run.
Print
To print an item on the screen:
1 Click the item that you wish to print and from File menu, click Print.
2 Click OK to send the item to the printer.
Tip: If you want to see how the printed document will look
before you print it, click the File menu and then click Print
Preview.
To Click
Copy the value to a cell and ignore Paste
any changes to the original data
4 Repeat steps 2 and 3, until you have copied all the relevant data from the
other application.
To Click
Keep the dialog box open Apply
Tip: The AllVariables table shows all the variables in the block.
Note: When a plot is displayed all the variables on the plot are
automatically switched to record on if they are not already, and
they remain on after the plot is closed.
Tip: You can also view a time history or profile table by opening
the associated plot and then clicking the right mouse button on
the plot and clicking Show as History or Profile Table.
To Click
Copy the whole table or selected Copy
rows to the clipboard
Modeling
Creating Types
Create a Component List
A component list contains two types of information:
• A list of component names.
• A list of options associated with these components. Typically this is used
to store options for calculating physical properties for mixtures of these
components.
A component set is a simplified version of a component list that does not
include a list of physical property options.
Tip: You can convert a component set into a component list and
vice versa. To do this, select the required component list or set in
the Contents pane for Component Lists, click the right mouse
button and click Convert. The Convert dialog box appears asking
whether you want to convert the selected set to a list or vice
versa. Click Yes to carry out the conversion.
Tip: To select all the components, click the right double arrow
button in the Build Component List dialog box.
6 When you have selected all the required components, click OK.
Create an Icon
To create an icon:
1 In the All Items pane of the Simulation Explorer, make sure the Custom
Modeling library is expanded and, if necessary, expand Models, and then
click the required model.
2 In the Contents pane, double-click Add Icon.
3 In the Create Icon dialog box, enter a name for the icon. The Icon Editor
window and the Icon Draw toolbar appear.
4 In the draw pane of the Icon Editor window, use the Icon Draw toolbar to
draw the icon. To make an icon appear as a 3D shape, click the icon and
then click the right mouse button to access the pop-up menu:
Icon 3D Options
Box Cylinder (upright)
Cylinder (sideways)
Ellipse Sphere
You can also import a bitmap by using the Import DXF item on the File
menu. This creates a DXF tab from which the bitmap can be dragged and
dropped onto your icon as many times as you want. Note that the bitmap
can be resized once placed.
5 From the Port tree view, click the port you want to add. Hold down the
mouse button and drag the selected port to the desired position on the
icon perimeter. The port's position determines where it appears when it is
placed on a flowsheet.
6 From the File menu, click Save.
7 To quit the icon editor, click the Close button.
Note: To achieve minimum library file size you should use the
Create Library command with an empty flowsheet.
When the Create Library command is used any libraries which
are attached to the current simulation are also attached to the
new library. When the new library is used these attached libraries
must be available and be the same version as was used when the
new library was created otherwise the library will fail to load. Any
libraries which are not needed should therefore be removed from
the simulation before you create the library. You can do this by
removing them from the Libraries statement which appears at
the top of the simulation input file or from the Libraries tab on
the Settings dialog. If you want to remove the default libraries
set for the application e.g. Modeler.acml you can use the
command line option /Nodefaultlibraries. Care should be taken
not to remove libraries which are being used otherwise you will
get errors on reloading the simulation.
Create a Model
To create a model:
1 In the All Items pane of the Simulation Explorer, make sure the Custom
Modeling library is expanded, and then click Models.
2 In the Contents pane, double-click Add Model.
3 In the Create Model dialog box, enter a name for the new model.
4 In the Text Editor window, enter the information for the new model.
Tip: For a syntax reminder, click the right mouse button in the
Text Editor window, then point to Insert and click the required
reminder option to insert the boilerplate text.
Notes
• You can add new models and copy existing models to the
folders you have created.
Tip: For a syntax reminder, click the right mouse button in the
Text Editor window, then point to Insert and click the required
reminder option to insert the boilerplate text.
Create a Procedure
To create a procedure:
1 In the All Items pane of the Simulation Explorer, make sure the Custom
Modeling library is expanded, and then click Procedures.
2 In the Contents pane, double-click Add Procedure.
3 In the Create Procedure dialog box, enter a name for the new procedure.
4 In the Text Editor window, enter the information for the new procedure.
5 From the Build menu click Compile.
The syntax is checked for errors and messages about the compilation are
displayed in the Simulation Messages window. Changes are saved
automatically after a successful compilation.
6 To quit the editor, click the Close button.
Create a Simulation
To create a simulation:
• From the File menu, click New.
If you are running a simulation, a dialog box may appear prompting you
to save changes or stop the current simulation. Click the appropriate
response.
The Simulation Explorer and flowsheet windows revert to their original
state.
You can now create a new simulation.
Important note: Before the task you have created can be used
in a simulation, you will need to activate the task. To activate a
model task, you must first click a block (model instance).
Tip: For a syntax reminder, click the right mouse button in the
Text Editor window, then point to Insert and click the required
reminder option to insert the boilerplate text.
To Do this
Run the script Click the right mouse button in the Edit window,
point to Build, and then click Invoke Script. The
script is run and saved. After compilation, the
Scripting dialog box appears. Click OK to dismiss
this box.
Save the script From the File menu, click Save Text, and then
close the Text Editor.
Important: To run a model script, you must first click a block (model
instance).
To Do this
Save the script From the File menu, click Save Text. When you
close the Text Editor, you will be prompted to save
any further changes.
When you have created the scripts, you will need to create a library to contain
them. You can then invoke the scripts but you cannot change them.
Further information: Scripts are a simple method for automating activities,
such as changing parameter and variable properties. The scripting language is
Microsoft® Visual Basic® Scripting Edition (VBScript). This is supplied
automatically with your installation.
If you want to use the more powerful features of VBScript, you can obtain full
documentation on the VBScript language from the Microsoft web site.
Editing Types
Edit an Icon
To edit an icon:
1 In the All Items pane of the Simulation Explorer, make sure the Custom
Modeling library is expanded, and if necessary, expand the Models folder.
A list of all models in the current simulation appears.
2 Click the model whose icon you want to edit.
3 In the Contents pane, double-click the icon you want to edit.
4 Make the necessary changes in the Icon Editor. You can add, delete, or
modify the graphical primitives; add or remove bitmaps from the icon;
and place ports on the icon. Bitmaps can be added using the Import DXF
item on the file menu or existing DXF tabs in the icon editor. You can drag
and drop the required bitmap from its tab once it has been imported.
5 From the File menu, click Save.
6 To quit the editor, click the Close button.
Edit a Model
If the model you want to edit is not in the Custom Modeling library, first copy
the model to Custom Modeling.
Tip: For a syntax reminder, click the right mouse button in the
Text Editor window, then point to Insert and click the required
reminder option to insert the boilerplate text.
To Do this
Run the script Click the right mouse button in the Edit window,
point to Build, and then click Invoke Script. The
script is saved then run. After running, the Scripting
dialog box appears. Click OK to dismiss this box.
Save the From the File menu, click Save Text. When you close
script the Text Editor, you will be prompted to save any
further changes.
When you have edited the scripts, you will need to create a library to contain
them. You can then invoke the scripts but you cannot change them.
Further information: Scripts are a simple method for automating activities,
such as changing parameter and variable properties. The scripting language is
Microsoft® Visual Basic® Scripting Edition (VBScript). This is supplied
automatically with your installation.
If you want to use the more powerful features of VBScript, you can obtain full
documentation on the VBScript language from the Microsoft web site.
Tip: For a syntax reminder, click the right mouse button in the
Text Editor window, then point to Insert and click the required
reminder option to insert the boilerplate text.
Tip: For a syntax reminder, click the right mouse button in the
Text Editor window, then point to Insert and click the required
reminder option to insert the boilerplate text.
Tip: For a syntax reminder, click the right mouse button in the
Text Editor window, then point to Insert and click the required
reminder option to insert the boilerplate text. Edit a Stream Type
Tip: For a syntax reminder, from the Insert menu, click the
required reminder option to insert the boilerplate text.
Rename a Type
To rename a type:
1 In the All Items pane of the Simulation Explorer, click the type you want
to rename, then click the right mouse button and click Rename.
2 Type the new name and then press ENTER.
Important
• The name can contain up to 27 characters, but it cannot contain spaces,
or non-alphanumeric characters (for example, -\ /:*?"<>|).
• Do not create a type which has the same name as a built-in type. This can
have undesirable results.
• You cannot rename a type that is being used. For example, you cannot
rename a sub-model, if a model using this sub-model is currently part of
the flowsheet.
Delete a Type
To delete a type:
1 In the All Items pane of the Simulation Explorer, click the type you want
to delete, then click the right mouse button, and click Delete.
2 When prompted, click Yes to confirm the deletion.
In Do this
All Items pane of the Simulation Click Custom Modeling with the right
Explorer mouse button, and then click Rebuild.
Text Editor window Click with the right mouse button, point
to Build and then click Rebuild.
Structures
How to Use Structures
To define and use a structure, carry out the steps detailed in the following
topics:
• Define a structure type
• Create an Instance of a Structure Type
• Reference a Structure Type from a Model
• Creating a Block or Stream with a Structure Reference
Note: You cannot drag and drop them onto the flowsheet
window.
The system prompts you for a name. Instances of structure types are placed
in folders under the flowsheet node in the Explorer. If the structure type used
is in the Structure Types folder, the instances are placed in a Structures
folder. If the Structure Type is in a user defined folder the instance is placed
in a folder with the same name but under the flowsheet.
You can access forms and scripts by navigating to the structure folder under
the flowsheet and highlighting the required structure instance in the Explorer
tree view.
Tip: You can also access solver options by clicking Solver Options
from the Run menu.
Specify an Optimizer
To choose an optimizer and specify the related solver options:
1 In the All Items pane of the Simulation Explorer, click Simulation.
2 In the Contents pane, double-click Solver Options.
3 In the Solver Properties dialog box, click the Optimizer tab.
4 Type or select the options you want to change, and then click OK.
Note: We recommend that the open solver DLL file is placed in the \bin
directory. An example of the parameters and default settings
corresponding to a selected DLL is shown below:
Note: You can specify an open solver and change the parameters
through automation. If the open solver or parameters change
through automation then those changes will be automatically
reflected in this dialog box.
Note: Take care with the accuracy of both case and spelling of
the name. The name is used to resolve the network address of
the computer, and must be in a form recognizable to your
Domain Name Server. If you do not understand the term Domain
Name Server, seek advice from your system administrator.
5 In the User Name box, type the user name of the user under whom the
simulation engine will run on the remote computer. You must supply a
value for this field.
6 In the Password box, type the password for the user and click OK.
7 In the Servers dialog box, select the name of the host you just added in
the Host Computer list:
8 In the Working Folder text box, type the path of the root folder on the
remote machine where run time data (that is, simulation snapshots and
plot data) will be stored, for example, C:\Program
Files\AspenTech\Working Folder\Aspen Custom Modeler
121\UserName.
9 In the Executable Folder text box, type the path of the folder where the
simulator executables have been installed on the remote machine, for
example C:\Program Files\AspenTech\AMSystem 121\bin.
10 Select any or none of the optional check boxes, as appropriate:
If Select
You want the system to prompt Prompt For Password
for the remote password rather
than use the stored one which has
been associated with the host
11 Click OK to accept your changes and close the Servers dialog box.
12 In the Server Configurations dialog box, click OK.
This example models five open tanks in series. The key assumptions are:
• Flow out of each tank is proportional to the square root of the level of fluid
in the tank
• Fluid at constant density
• Tank geometry is a regular sided vertical cylinder
• No overflow condition
You can run the simulation dynamically and change the feed flow rate to the
first tank using an AllVariables table. To do this:
• In the Flowsheet window, double-click the stream FeedStream that enters
Tank1. Enter a new value for the variable displayed as Flow.
You can see the simulation respond to your step change by displaying a plot.
To do this:
1 In the All Items pane of the Simulation Explorer, click Flowsheet.
2 In the Contents pane, double-click the plot TankVolumes to display it.
Tasks
You can run a task that is supplied with the example. This task covers the
main task features available in Aspen Custom Modeler.
To do this, you need to activate the task:
1 At the start of a dynamic run, in the All Items pane of the Simulation
Explorer, click Flowsheet.
2 In the Contents pane, double-click the task named TestTask to activate
it.
Now when you run a dynamic simulation, the instructions in the task are
carried out. These instructions show a number of different disturbances you
can make to a dynamic run.
You can look at the results of the simulation through predefined plots.
To display the TankVolumes plot :
1 In the All Items pane of the Simulation Explorer, click Flowsheet.
2 In the Contents pane, double-click the plot TankVolumes to display it.
This example is for users of Aspen Custom Modeler with Properties Plus. You
therefore have to have Aspen Plus installed to use this example.
tray_hydraulics Calculate the holdup and flow rates for the vapor and
liquid phases for each tray
The tray model is the heart of the simulation, and includes material and
energy balance equations for an equilibrium stage model. The equations are
written so that they are self-normalized by the flows in the column. This helps
speed the solution of the problem. The column model organizes each of the
models into the absorber simulation.
Note the structure of each of the models. For example, the tray model and
column model include IF structures around logical ISCONNECTED for each of
the ports. This illustrates how the model can convert its equations to new
equations depending upon the flowsheet connectivity, and is an example of
model polymorphism. In addition, a parameter called proptype is used to
switch the models between rigorous and simple property models, and is
another example of polymorphism.
Note: This is a properties only input file, so you will not see a
flowsheet in Aspen Plus.
3 From the File menu, click Save As and save the simulation as an Aspen
Plus document (.apw file), then exit Aspen Plus.
Now you can run the example.
Connect from To
B1.p(1) PID variable PV
Connect from To
B1.Stage(6).Sieve.Liquid_Height PID variable PV
5 When you have added the controllers, run the simulation in steady-state
mode.
6 Change the run mode to Dynamic and start the run.
7 View changes in the column temperature profile using the Flowsheet plot
TempProfile.
Note: After you have edited a task, you must compile and then
activate it. To do this, click the task with the right mouse button
and then click Compile. After compiling a task, activate it by
clicking it with the right mouse button and then clicking Activate.
4 In Aspen Custom Modeler, click Run to start the dynamic run then in
Excel, watch the plots change as the surface temperatures increase. You
may need to pause the simulation to allow Excel time to update the
surface plot.
You can also click it with the right mouse button and then click Activate.
8 Start the dynamic run and watch the Excel surface plot change as the
temperatures change on two opposite edges of the slab. You may need to
pause the simulation to allow Excel time to update the surface plot.
This example models a simple reactor. There are three components in the
system and two main reactions.
The components are represented by A, Q, and S.
The reactions are:
K3
A→S (1)
K1 K2
A →Q →S (2)
Where both reactions are rate-based.
The estimation simulation calculated estimated values of K1, K2, and K3 from
experimental measurements of the concentrations of A and Q.
6 On the Results sheet, click the button Run Estimation on the spreadsheet.
7 After the simulation completes, the results are put into the Excel
spreadsheet.
k-1
A B k C
k1 2
k3
D
All reactions occur only on the catalyst surface. The reaction A ! B is a
reversible reaction, reactions B ! C and A ! D are irreversible reactions.
The kinetics of the catalytic reactions can be described using the following
Langmuir-Hinshelwood Hougen-Watson type equations.
[ B] k 2 K B [ B] k 3 K A [ A]
k1 K A [ A] − r2 = r3 =
K eq1 1 + K A [ A] + K B [ B] 1 + K A [ A] + K B [ B ]
,
r1 =
1 + K A [ A] + K B [ B]
The temperature dependency of k1, k2 and k3 are described using the
Arrhenius equation:
− E1 − E2 − E3
k1 = k10 exp k1 = k 20 exp k1 = k 30 exp
RT RT RT
KA, KB and Keq1 are defined functions of temperature. k1, k2, k3, E1, E2, and E3
are the reaction parameters to be estimated.
Concentration versus time data is available from 4 isothermal batch reaction
experiments. Also outlet concentration data is available for 10 stirred tank
reactor experiments.
Reaction Equation
Reaction of A with
B to C k1 K1m K 2 m [ A] s [ B] s
R1 =
(1+ )3
K1m [ A] s + K 2 m [ B ] s + K 3m [C ]
Reaction of A with
C to D k 2 K1m K 3m [ A] s [C ]
R2 =
(1+ K1m [ A] s + K 2 m [ B] s + K 3m [C ] )3
The subscripts s for [A] and [B] denote concentrations at the surface of the
catalyst. Mass transfer limitations in the liquid to solid film are an important
factor in the overall process rate, so the surface concentrations will differ from
those in the bulk of the liquid.
Other equations describing the reactions and the reactor are:
Mass Equation
Balance/Transfer
∂θ ∂θ 1 ∂ 2θ
1
(γ ⋅(1− )
= − φv ⋅ + ⋅ − U * ⋅ Da r ⋅ (θ − θ w ) + ∆θ adr ⋅ Da r ⋅ e θ
⋅ ΓB
∂σ ∂z Pehr dz 2
Energy balance for the reactor vessel, neglecting heat transport through the
tube wall by conduction in the axial direction and heat losses to the
surroundings:
∂θ w
= Da r ⋅ U * ⋅ ω h ⋅ (θ − θ w )
∂σ
Initial Conditions:
σ = 0 ; ΓB ( z , σ ) = ΓB ( z ,0) = 0
θ ( z, σ ) = θ ( z,0)
θ w ( z, σ ) = θ w ( z,0) = θ ( z,0)
Boundary conditions:
∂ 2 ΓB ∂ 2θ
σ ≥ 0 and z = 1 ; = = 0
∂z 2 ∂z 2
Where the following dimensionless quantities are:
σ = dimensionless time
Note: This example is very CPU intensive, and may take several
hours to complete the run.
Component Represents
A H2O
B CH4
A2B CH3OH
Seven experiments are run, varying the feed flow rates to a reactor. The
measured values are the outlet concentrations of the components A and B.
The results of these experiments are coded in three ways for this example:
• Using the Estimation dialog box
• Visual Basic Script at the flowsheet level in the simulation
• Excel spreadsheet (Excel 7.0 or later)
Ts = Solid temperature
t = Time
v = Steam velocity
ε = Bed voidage
To run this example from Aspen Custom Modeler, complete these steps:
1 From the File menu, click Open.
2 Open the Regen folder. If you copied the files to the example working
folder, these files are located in:
C:\Program Files\AspenTech\Working Folders\Aspen
Custom Modeler 121\Regen
3 Double-click the file Regen.acmf.
4 Start a dynamic run.
5 View the effect of the change in feed temperature in the plot
SolidTempPlot in the block Bed1 To view this plot, click the block Bed1
with the right mouse button then point to Forms and click SolidTempPlot.
6 You can run a predefined task to simulate changes in the temperature of
the steam entering the bed:
7 In the Simulation Explorer, under Flowsheet, double-click the
RegenerateCatalyst task icon to activate the task. This task simulates one
cycle of catalyst regeneration.
You can also run the simulation from Visual Basic.
The Visual Basic source code is included in the files RegenDemo.vbp and
RegenDemo.frm. These files are compatible with Visual Basic 5 and Visual
Basic 6.
B2 MAKEUP
B3 REACTOR
B4 SEPARATOR
B5 SPLITTER
When you have placed the blocks, the flowsheet should look like this:
User Notes
You can add your own comments to blocks, streams, structures, component
lists and snapshots. They can be accessed from the Properties dialog for any
of these items. The Properties dialog can be accessed from the context menu
for the item in the Explorer except snapshots that do not appear in the
Explorer. These must be accessed from the snapshot management dialog. For
blocks and streams that appear on the flowsheet the Properties dialog can be
accessed from the flowsheet item context menu as well.
You can also set up a default value for all instances of a model using the
following language statement in a model
Tip: To change which columns are shown, click the right mouse
button on the table and then click Properties. Value and Spec are
usually the most useful columns.
From this table, you can alter the TOTAL flow out of the feeder block. Values
to run the simulation successfully are already defined. Close the AllVariables
table.
Viewing Changes
To view the changes you have made, edit the Feeder model. To do this:
1 In the Simulation Explorer, expand Custom Modeling and expand the
Models folder.
2 In the Contents pane, click FEEDER with the right mouse button and then
click Edit.
The text equations for the model appear in a Text Editor window. Towards
the end of the model description, the specification value for some
variables are set to Free or Fixed. These are the default specifications for
the model.
3 To view the changes from the default specification, double-click the
specification indicator to open the specification Status window, if it is not
already displayed.
If you are running the Use this Visual Basic form from the
file SSMeth folder
ssmeth.acmf MethanolLoop.vbp
ssmethdemo.acmf MethanolLoopDemo.vbp
Homotopy
You can run a Homotopy example using the input file SSMeth.acmf.
What is Homotopy?
Homotopy enables you to move from one steady state solution to another
steady state solution in small increments. In some circumstances, the
simulation may not converge for the target steady-state solution from the
current steady-state solution. Homotopy allows you to approach the target
steady-state solution in stages, thereby improving the chances that the target
steady-state solution is reached.
This example uses a Visual Basic Script to initialize a solution towards a set of
target values for fixed variables.
The simulation solution is moved from the current solution point to the
solution at the target values of three fixed variables:
1 Feed Flowrate
2 Reactor Temperature
3 Reactor Pressure
The script steps from the current solution to the target solution.
You can reset the simulation to the original values of the fixed variables by
double-clicking the script called RestartHomotopy.
This example is for users of Aspen Custom Modeler with Properties Plus. You
therefore have to have Aspen Plus installed to use this example.
This example models a high temperature shift reactor, which is important for
many industrial plants, including ammonia plants. The high temperature shift
reactor example illustrates:
• Complex reaction kinetics
• Generalized solution of partial differential equations
• A flowsheet initialization strategy which includes generalized calls to
initialization scripts, and homotopy scripts of each model
• A dynamic operability study of the reactor
Reactor Kinetics
The reactor uses a solid catalyst to complete the gas phase water shift
reaction:
CO + H 2O ←
→ CO 2 + H 2
The reaction is exothermic, with the heat effects determined from enthalpies
which include heats of formation. The reactor is considered adiabatic because
the throughputs are high and the area (which is insulated) available for heat
loss is small.
Numerous kinetic relationships have been developed for the water gas shift
reaction over iron based catalysts used in high temperature shift reactors.
Langmuir-Hinshelwood models have been shown to be superior to power law-
based models for this reaction. Consequently, Langmuir-Hinshelwood kinetics
are used a sub-model.
The specific form of the rate expression used is:
Where:
DEN = 1 + KCO * pCO + KH 2 * pH 2 + KCO 2 * pCO 2 + KH 2O * pH 2O
The reaction rate constant, k, is a function of temperature, activation energy,
and frequency factor, in the classic Arrhenius form:
− E / RT
k = A*e
Literature data indicate the activation energy in the absence of diffusion
effects as 121.8 kJ/kmol. The frequency factor was determined from literature
and plant data.
Similarly, the adsorption equilibrium constants are functions of temperature,
heats of adsorption, and a frequency factor:
∆Hi / RT
Ki = A i * e
i = CO , H 2, CO 2, H 2O
Diffusional Effects
The reactor kinetics discussed are intrinsic kinetics that are valid in the
absence of diffusional or heat transfer resistances. Bulk phase concentrations
(partial pressures) and temperatures are not present at the active sites within
the catalyst pellets, since the pore structure can offer significant resistance to
diffusion, and mild resistance to heat transfer exists between the bulk phase
and the pellet surface. Little resistance to heat transfer exists within the
pellets.
The diffusional effects are accounted for using the classic effectiveness factor.
actual rate throughout pellet with resistances
η=
rate evaluated without resistances
Evaluating the numerator of this expression requires simultaneous integration
of the rate and diffusion relationships. Simplification of the effectiveness
factor calculation can be applied for conditions which cause the diffusional
resistance to be large. The simplification is:
3 K(De)
η=
rp k(K + 1)ρp
Modeling Strategy
Although the reactor can be treated as a simple equilibrium reactor, a kinetic
model is necessary to reproduce dynamic behavior. The main reactor model
uses the Aspen Custom Modeler domain and distribution models, thus
allowing the partial differential equations for the reactor and the solid catalyst
to be solved easily. Several methods can be selected for the solution of the
reactor equations, such as orthogonal collocation of finite elements and finite
differences.
Representation includes a partial differential equation for the convective
reaction equation, convective gas energy equation, and conductive solid
energy equation.
Initialization Strategy
The equations of the reactor are highly non-linear, and will require a
comprehensive strategy to converge in steady state. Fortunately, Visual Basic
scripts in Aspen Custom Modeler will allow easy convergence of the
simulation. Several features of the reactor which are modeled are:
• The chosen state variable is concentration for the convective equation
• The reactor is adiabatic
• Axial conduction is considered down the length of the reactor in the solid
catalyst
The most difficult of these features is that the reactor is adiabatic. The
temperature profile of the reactor is not known and must be calculated.
Unfortunately, the reaction equations are highly dependent on the
Steady-State Design
The reactor operates at over 380°C and 35 bar, and uses an iron
oxide/chromium oxide catalyst. The reaction is exothermic, but the reactor is
not cooled. The feed composition to the reactor is mostly water and hydrogen
(35% each), 15% nitrogen, 8% carbon monoxide, and 5% carbon dioxide.
The reactor product is enriched with hydrogen, and much of the carbon
monoxide is consumed. Thermal stress is a significant degrading factor for the
catalyst. The reactor has a 3.5-meter bed of cylindrical pellets, and the
average velocity is about 0.5 m/s. There is a temperature profile and
composition from an operating reactor, and the estimation capabilities of
Aspen Custom Modeler have been used to adjust the kinetics to plant data.
Note: This is a properties only input file, so you will not see a
flowsheet in Aspen Plus.
5 From the File menu, click Save As and save the simulation as an Aspen
Plus document (.apw file), then exit Aspen Plus.
Now you can run the example.
This example simulates a catalytic tubular reactor for the production of vinyl
acetate monomer from ethylene and acetic acid.
It includes a general purpose dynamic catalytic tubular reactor model which
models temperature and composition variations in the radial and axial
directions. It models heat transfer between gas and catalyst, and heat
conduction and dispersion in both radial and axial directions. Heat transfer
from gas and catalyst through the reactor wall is also modeled.
The reactor model uses sub-models for reaction and physical property
calculations. You can modify the reaction sub-model for simulation of other
reaction systems. You can also export the model for use in Aspen Plus.
Notes: The .msi file is provided with this example, so you can
skip steps 1-5 and instead install the .msi file directly by double
clicking it.
This example uses Aspen Plus, so you must have Aspen Plus
installed to run it
This example contains a model of a batch fed reactor with five state variables
and two fixed variables FeedRate and CoolingRate.
There are two reactions present:
A+B→C (desired product formulation)
B+C→D (competitive reaction)
Product, represented by variable Holdup_C in the simulation, is the quantity
that we want to maximize at the end of the process, at final time 30 hours by
varying the feed rate.
Constraints on the optimization are a final temperature at 30 hours of
between 295 and 300 °C and a path constraint on the temperature
throughout the whole process to confine it to less than 520 °C. To achieve
these constraints the cooling rate will also be varied.
This example models a pH control system. An acid effluent is fed into a stirred
tank and neutralized using alkali. The flow of alkali is controlled by a PID
controller that measures the pH of the tank contents. A step change in the
acid flow from 0.025 to 0.03 is introduced at time 5.0 to test the controller
response.
This example includes a simple example of using the Simulation Access
eXtensions (SAX) interface. The interface code is supplied and can be used as
a starting point in the development of your own SAX interface.
Using SAX
You can run this example using SAX to introduce a disturbance in the acid
feed flow rate at 5 hours. To do this:
1 Modify the makefile and create the dll as described in Modifying the
Makefile and Building the DLL.
2 If you have already run the simulation restart it and ensure that the task
AcidFlowStep is not active.
3 From the Tools menu, click Simulation Access eXtensions. The Simulation
Access Extensions dialog box is displayed.
4 Make sure the Output Variables tab is on top by clicking it. Note that the
variable CST.Acid.flow has been added to this list of variables for
transmission to the SAX function.
Tip: An easy way to add variables to this list is to drag and drop
them from a table.
5 Click the Procedure tab and note that the following data has been entered:
Function SAXFunction
name:
Library C:\Program Files\AspenTech\Working
name: Folders\Aspen Custom Modeler
121\SAX\phconsax.dll
(or location of your installation:
change the library name if necessary)
6 Ensure that the After Dynamic Step check box is selected, so that the
function is called after each step. Also select the Enable Simulation Access
eXtensions check box to enable SAX and then close the SAX window.
7 In the Explorer, click Flowsheet and then double-click AcidFlowPlot to open
it.
8 Run the simulation. You will see a step change in the acid flow rate at 5
hours, and the resulting change in pH in the tank with time.
This example shows how to write and use a DLL containing an open Nonlinear
Algebraic solver. The example implements an open solver called NLEQ1S
available in:
http://www.zib.de/SciSoft/CodeLib/frame_nonlin.en.html
Note: The example is given under the assumption that you have
MS-Developer's Studio installed on your machine.
This example shows how to write and use a DLL containing an open NLP
solver. The example implements an open solver called SRQP.
SRQP is a Successive Reduced Quadratic Programming method and is one of
the built-in full space solvers supplied with Aspen Custom Modeler.
From now, whenever ACM needs to solve an NLP system, it will use the NLP
solver provided in the DLL.
Note: The first time this file is specified, you will be asked if you
want to create one, since the file does not yet exist.
4 In the Inputs Table box, select ReactorInputs from the list. This is the
form that defines the variables that Aspen Plus will display as inputs.
5 In the Results Table box, select ReactorResults from the list. This is the
form that defines the variables that Aspen Plus will display as results.
6 To generate the DLL and the .apm (Aspen Plus user model library ) file,
click OK.
7 Check the Simulation Messages window to see if the Aspen Plus model
library flowsheet export and the dll generation process succeeded. The dll
and the apm extension files should have been created in the specified
export and library directories.
8 Exit Aspen Custom Modeler.
For more information about Application Object events, see the Automation
Reference.
3 From the File menu, click Save As and save the simulation as an Aspen
Plus document (.apw file), then exit Aspen Plus.
Glossary Definitions
.acmf file
An ASCII language file of a saved Aspen Custom Modeler simulation.
.acmd file
A binary file of a saved Aspen Custom Modeler simulation.
.ada File
An ASCII language file of a saved Aspen ADSIMsimulation.
.adb File
A binary file of a saved Aspen ADSIM simulation.
.cra File
An ASCII language file of a saved Aspen Chromatography simulation
.crb File
A binary file of a saved Aspen Chromatography simulation.
Active variable
An active variable is a variable that occurs in an equation in the current
simulation.
ActiveX control
A control, for example, a check box , a list box, or a command button, that is
created with the Microsoft ActiveX Control Toolbox. Controls can offer options
to users or run macros to automate tasks.
25 Glossary 225
Click to define scripts for automating specification and initialization.
Automation
Enables applications to provide objects to other applications.
Block
A block is an instance of a model on a flowsheet.
Blocks folder
A list of all the blocks present in the current flowsheet.
Communication interval
The time interval at which data is available for plots and snapshots during a
simulation.
Decomposition
The process of gathering the equations in a simulation into minimum size
groups which are solved sequentially.
Degrees of freedom
The number of equations in relation to the number of unknown variables.
Diagnostics folder
The Diagnostics folder gives access to available decomposition information,
that is, groups of equations with their associated variables.
Form
Table, plot, or Microsoft ActiveX control form, used to display results.
Global parameters
Global parameters are parameters that are defined in the modeling language,
outside of type definitions.
Group
A collection of equations which can come from different parts of a simulation.
Homotopy
25 Glossary 226
Enables you to step a steady-state solution through to another steady-state
solution by defining fixed variables.
Indeterminate variables
An indeterminate variable is one that has no unique value, that is, any value
will satisfy your equations.
IntegerSet
An IntegerSet is a set whose members are integers, for example, 1:10.
Model
A model is a set of equations that mathematically represent a process. On a
flowsheet a model is represented by an icon.
Parameter
Parameters are used to define values that are fixed for the whole simulation,
such as acceleration due to gravity, or the gas constant, or the number of
trays in a column.
∂T k ∂ 2T
=
∂t C p ρ ∂x 2
Pause
Suspends a dynamic simulation at any time.
Phase Plot
A plot of a set of variables against another variable on the X axis. The data
plotted is time based but time is not shown on the plot.
Port Type
A port type is similar to a flange on a vessel or a pipe. It defines the
connectivity for models and streams. In other words, a port type defines what
process variable information is passed between models and streams.
25 Glossary 227
Procedure
Procedures are definitions of external routines used in models to calculate
variables instead of equations.
Profile plot
A plot of a series of variables, for example, temperature profile, against an
index (the number of trays within a column or the number of points used to
discretize a partial differential equation) or against another series of
variables, for example, the length of a reactor bed.
Recorded history
Also known as Time History. A set of values for a variable, recorded over a
period of time, at communication intervals set in the Run Options dialog box.
Reset
The current solution point is removed and all variables are returned to their
default values.
Restart
The next dynamic run starts from its initial conditions at time = 0.
Results
A result is a set of data which contains value and specification data for a set
of variables. The set of variables need not correspond to the variables present
in any simulation and they do not contain delay or workspace information.
You can use results to initialize the values of variables in a simulation but it
cannot be guaranteed that a solution will be possible when using a results file
as it could be that not all variables in the simulation exist in the result.
Rewind
For a dynamic run, Rewind takes the simulation back to a previous time point
specified by a snapshot, if snapshots are available. If there are no snapshots,
or if the simulation is not dynamic, Rewind returns the simulation to time = 0.
Run-time plot
A plot of a set of variables against time.
Script
A script is a set of instructions, written in Microsoft Visual Basic, to automate
the setup of a simulation. A simple script is a list of assignments for
parameters and variables such as default value, specification, lower and
upper bounds. Scripts can also be used to control sequences of simulation
runs.
Snapshot
A snapshot is a set of data whose structure corresponds exactly to the current
simulation structure, that is, there is a value and spec available for every
variable in the simulation, in addition to any delay information and procedure
25 Glossary 228
workspace data. You can use a snapshot to replicate the state of a simulation.
Snapshots are generated automatically as the simulation solves, and also on
request. Snapshots are stored in a file snapshot.snp in the simulation working
directory, which is on the server machine. When the simulation is edited, for
example, a new block is added to the flowsheet or a structural parameter is
changed, snapshots are archived and they become results. A new results file
is generated.
State variable
A state variable is a variable differentiated with respect to time.
Step
Steps through a dynamic simulation one time interval at a time.
Stream
A stream is an instance of a stream type on a flowsheet.
Stream type
A stream type is similar to a pipe and is a special type of model in Aspen
Custom Modeler. On a flowsheet, it is represented by a line.
Streams folder
A list of all the streams present in the current flowsheet.
StringSet
A StringSet is a set whose members are strings, for example, component
names.
Task
A task is a set of instructions that you can create in Aspen Custom Modeler. A
task defines a sequence of actions that take place during a dynamic
simulation, such as changing feed flow rate.
Time history
Also known as Recorded History. A set of values for a variable, recorded over
a period of time, at communication intervals set in the Run Options dialog
box.
Type
Types are the main components of a simulation, such as models, parameters,
ports, procedures, streams, tasks, and variables. Types can be either defined
in the modeling language or built graphically.
25 Glossary 229
Variable
A variable is a component of an equation.
Variable type
A variable type is used to define an initial guess and range for variables being
solved in a simulation.
25 Glossary 230
General Information
Copyright
Version Number: 2004.1
April 2005
Copyright © 1982-2005 Aspen Technology, Inc, and its applicable
subsidiaries, affiliates, and suppliers. All rights reserved. This Software is a
proprietary product of Aspen Technology, Inc., its applicable subsidiaries,
affiliates and suppliers and may be used only under agreement with
AspenTech.
Aspen ACOL™, Aspen Adsim®, Aspen Advisor™, Aspen Aerotran®, Aspen
Alarm & Event™, Aspen APLE™, Aspen Apollo Desktop™, Aspen Apollo
Online™, Aspen AssetBuilder™, Aspen ATOMS™, Aspen Automated Stock
Replenishment™, Aspen Batch Plus®, Aspen Batch.21™, Aspen BatchCAD™,
Aspen BatchSep™, Aspen Calc™, Aspen Capable-to-Promise®, Aspen
CatRef®, Aspen Chromatography®, Aspen Cim-IO for ACS™, Aspen Cim-IO
for Csi VXL™, Aspen Cim-IO for Dow MIF™, Aspen Cim-IO for G2™, Aspen
Cim-IO for GSE D/3™, Aspen Cim-IO for Hewlett-Packard RTAP™, Aspen Cim-
IO for Hitachi PLC (H04E)™, Aspen Cim-IO for Intellution Fix™, Aspen Cim-IO
for Melsec™, Aspen Cim-IO for WonderWare InTouch™, Aspen Cim-IO for
Yokogawa Centum CS™, Aspen Cim-IO for Yokogawa Centum XL™, Aspen
Cim-IO for Yokogawa EW3™, Aspen Cim-IO Interfaces™, Aspen Cim-IO
Monitor™, Aspen Cim-IO™, Aspen Collaborative Demand Management™,
Aspen Collaborative Forecasting™, Aspen Compliance.21™, Aspen
COMThermo TRC Database™, Aspen COMThermo®, Aspen Cost Factor
Manual™, Aspen Crude Manager™, Aspen Crude Margin Evaluation™, Aspen
Custom Modeler®, Aspen Data Source Architecture™, Aspen Decision
Analyzer™, Aspen Demand Manager™, Aspen DISTIL™, Aspen Distribution
Scheduler™, Aspen DMCplus® Composite, Aspen DMCplus® Desktop, Aspen
DMCplus® Online, Aspen DPO™, Aspen Dynamics®, Aspen eBRS™, Aspen
Enterprise Model™, Aspen ERP Connect™, Aspen FCC®, Aspen FIHR™, Aspen
FLARENET™, Aspen Fleet Operations Management™, Aspen Framework™,
Aspen FRAN™, Aspen Fuel Gas Optimizer Desktop™, Aspen Fuel Gas
Optimizer Online™, Aspen General Construction Standards™, Aspen Hetran®,
Aspen HX-Net®, Aspen Hydrocracker®, Aspen Hydrotreater™, Aspen HYSYS
Amines™, Aspen HYSYS Crude™, Aspen HYSYS Dynamics™, Aspen HYSYS
OLGAS 3-Phase™, Aspen HYSYS OLGAS™, Aspen HYSYS OLI Interface™,
Aspen HYSYS Tacite™, Aspen HYSYS Upstream Dynamics™, Aspen HYSYS
Upstream™, Aspen HYSYS®, Aspen Icarus Process Evaluator®, Aspen Icarus
Corporate
Aspen Technology, Inc. Phone: (1) (617) 949-1000
Ten Canal Park Toll Free: (1) (888) 996-7001
Cambridge, MA 02141-2201 Fax: (1) (617) 949-1030
USA URL: http://www.aspentech.com
Title Content
Aspen Custom Modeler 2004.1 Getting Contains basic hands-on tutorials to help you
Started Guide become familiar with Aspen Custom Modeler.
Aspen Custom Modeler 2004.1 Modeling Contains detailed reference information about
Language Reference the modeling language, including syntax details
and examples.
Aspen Custom Modeler 2004.1 Aspen Contains information on using automation, solver
Modeler Reference options, physical properties, the Control Design
Interface (CDI)), Simulation Access eXtensions,
online links, and using external nonlinear
algebraic solvers.
Aspen Custom Modeler 2004.1 Polymer Polymers Plus is a layered product of Aspen
Simulations with Polymers Plus Custom Modeler. It provides additional
functionality to the properties package,
Properties Plus, enabling polymers to be fully
characterized in Aspen Custom Modeler models.
parameter types 32
/ solved type 33
/ used as comment symbol 171
C
A C language
ALWAYSCALL keyword 76 modeling language for external procedures
73
Arithmetic operators 90
CHANGESINPUTS keyword 76
Arrays
Comments in modeling language 171
distinguished from sets 20
Comparison operators 93
in equations 92
Compatibility with SPEEDUP 5.5 75
modeling language for 23
Component lists
values assigned to elements 16
multiple 30
with many elements or dimensions 97
ComponentList property Error! Not a valid
Assignments bookmark in entry on page 30, Error!
array elements 16 Not a valid bookmark in entry on page
31, 85
lists 17
Conditional equations
modeling language for 14
modeling language for 93
statements for 11
sets in 96
values to variables in tasks 51
CONNECT keyword 103
WITHIN and ENDWITH 17
Connection built-in stream type 103
available 178
Connection port type, built-in 33
B Connections
modeling language for streams 72
Base types 32
ConnectionSet property 88–89, 108
BLOCK keyword 19
ControlSignal built-in stream type 103
Blocks
Conventions
passing values between 71
documentation 172
Built-in types
modeling language 171
connection stream type 103
Converting
control signal stream type 103
strings and integers 24
modeling language for 32
Index 236
units of measurement 35 FOR loops
CONVERTTO operator 24 modeling language for 97
Crystallizer (PDE) Example Description 169 ForEach loops
modeling language for 99
D Fortran
Declaration statements 13 modeling language for external procedures
73
Definitions, modeling language for re-using 25
Free specification, defined 113
DERIVATIVES keyword 76
Functions
DIFFERENCE operator 21, 99
in sets 21
Discontinuities
modeling language for 73
modeling language for 45
Disturbances G
modeling language for 45
GLOBAL qualifier 80
documentation 175
Duplicate names, BLOCK and STREAM 19
H
E HIDDEN qualifier 80
ENDPARALLEL keyword 56
I
ENDWITH keyword 17
Equations IF keyword
defining conditionals in tasks 52
calling procedures 101
in conditional equations 93
conditional 93
Indexed assignments 16
logical operators 94
Inheritance
mathematical operators 90
defined 25
modeling language for 90
related types 27
referring to port variables 102
Initial specification, defined 113
switching between 122
INPUT qualifier 80
with array variables 92
IntegerParameter built-in parameter type 32
External procedures
Integers, converting to strings 24
modeling language for 73
IntegerSet 21
External programs
INTERSECTION operator 21, 99
identifying objects from 18
IS keyword 119, 122
EXTERNAL qualifier 117
IsConnected property 85
F IsMatched attribute 86
Index 237
L modeling language for 63
OUTPUT qualifier 80
LINK keyword 106
Logical operators 90, 93 P
LogicalParameter built-in parameter type 32
PARALLEL keyword 56
M Parameters
built-in types 32
Matching port variables 86
defined 20
Mathematical operators 90
modeling language for 70
MAX operator 90, 99
relating to variables 90
Method of Lines 162
Path names, assignment lists for 17
MIN operator 90, 99
Pausing a simulation 58
Mixer-Reactor-Absorber (PDE) Example
Description 166 PDAE models 146
variables in 80 collections of 87
MOL for PDEs 162 modeling language for 71, 84, 103, 106
Index 238
for ports 85 Snapshots
modeling language for 13 modeling language for 55
naming conventions 18 Specifications
writing sub-models 117 in models 113
PROPERTIES keyword 76 SPEEDUP
COMPATIBILITY statement 75
Q SRAMP keyword 53
Qualifiers for variables 80 Statements
repeating 97, 99
R syntax for 11
Running the Crystallizer (PDE) Example 169 Sub-models 115, 117, 120
S SystemLibrary library 32
Sets T
arithmetic for 21
Task statements
defined 20, 23
assigning values to variables 51
in conditional expressions 96
IF construct 52
SIZE function 113
modeling language for creating snapshots 55
SIGMA
overview 51
for multidimensional arrays 111
parallel 56
ForEach operator 99
pausing a simulation 58
syntax for 110
printing to Simulation Messages window 57
Simulation Messages window
ramping value of variables 53
task messages in 57
suspending 54
Simulations
Tasks
optimization 63
callable 48
SIZE function 113
modeling language for 45
Index 239
opening simulations 51 Vary specification, defined 113
task statements 51
Testing
W
Values
array elements 16
fixed 20
VARIABLE keyword 68
Variables
adding properties to 32, 69, 73
in models 80
modeling language for 68
relating to parameters 90
solved for 33
Index 240