12.12.2012 Views

gPROMS ModelBuilder version 2.3.1

gPROMS ModelBuilder version 2.3.1

gPROMS ModelBuilder version 2.3.1

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>gPROMS</strong> <strong>ModelBuilder</strong><br />

<strong>version</strong> <strong>2.3.1</strong><br />

Process Systems Enterprise Ltd<br />

13 May 2004<br />

Process Systems Enterprise Limited<br />

Bridge Studios 107a Hammersmith Bridge Road<br />

London W6 9DA<br />

t: +44 (0)20 8563 0888 f: +44 (0)20 8563 0999<br />

e: info@psenterprise.com w: www.psenterprise.com<br />

The model company<br />

This document is the property of Process Systems Enterprise Ltd.<br />

No part of the material contained herein may be copied, distributed, published, retransmitted or<br />

modified, in any way without the prior written consent of Process Systems Enterprise Ltd.


Contents<br />

Chapter 1 - Introduction............................................................................................................................ 1<br />

1.1 <strong>gPROMS</strong> <strong>ModelBuilder</strong>..................................................................................................................... 2<br />

Chapter 2 - Projects and Entities ............................................................................................................... 3<br />

2.1 <strong>gPROMS</strong> <strong>ModelBuilder</strong> environment.................................................................................................. 4<br />

2.1.1 The <strong>gPROMS</strong> <strong>ModelBuilder</strong> Project tree ........................................................................................ 4<br />

2.1.2 Projects ..................................................................................................................................... 4<br />

2.1.3 Entity creation and deletion ......................................................................................................... 5<br />

2.1.4 Opening and closing an entity editor............................................................................................. 6<br />

2.2 Entity editors .................................................................................................................................. 7<br />

2.2.1 The entity properties tab ............................................................................................................. 7<br />

2.2.2 The <strong>gPROMS</strong> language tab .......................................................................................................... 8<br />

2.3 Project organisation ...................................................................................................................... 11<br />

<strong>2.3.1</strong> Project properties..................................................................................................................... 11<br />

2.3.2 Entity cross-referencing and hierarchical libraries ........................................................................ 11<br />

2.3.3 Automatic loading of Projects .................................................................................................... 14<br />

2.3.4 Read-only Projects .................................................................................................................... 14<br />

2.3.5 Display of empty groups in Project tree ...................................................................................... 14<br />

2.4 Library projects ............................................................................................................................ 16<br />

2.4.1 Creation of libraries .................................................................................................................. 16<br />

2.4.2 Display of libraries in the project tree ......................................................................................... 16<br />

2.5 Model palette ............................................................................................................................... 17<br />

2.5.1 Displaying the Model palette ...................................................................................................... 17<br />

Chapter 3 - Variable and Connection Type Entities .................................................................................... 19<br />

3.1 Variable Types editor .................................................................................................................... 20<br />

3.2 Connection Types editor................................................................................................................ 21<br />

3.2.1 Introduction.............................................................................................................................. 21


Contents<br />

3.2.2 “Parameters & variables” editor tab ........................................................................................... 21<br />

3.2.3 “Graphical representation” tab ................................................................................................... 22<br />

3.2.4 Port categories tab................................................................................................................... 24<br />

Chapter 4 - Model Entities ...................................................................................................................... 25<br />

4.1 Introduction .................................................................................................................................. 26<br />

4.2 Interface tab................................................................................................................................. 27<br />

4.2.1 Icon definition........................................................................................................................... 27<br />

4.2.2 Port definition........................................................................................................................... 28<br />

4.3 Topology tab ................................................................................................................................ 31<br />

4.3.1 Instances of component models (Units) ...................................................................................... 31<br />

4.3.2 Defining the connectivity of a composite model........................................................................... 33<br />

4.3.3 Hierarchical model construction................................................................................................. 35<br />

4.3.4 Arrays of Units.......................................................................................................................... 36<br />

4.3.5 The Topology editor tool bar...................................................................................................... 37<br />

Chapter 5 - Optimisation Entities ............................................................................................................. 41<br />

5.1 Introduction .................................................................................................................................. 42<br />

5.2 Specifying General information for an optimisation activity ............................................................... 43<br />

5.3 Specifying control variables for an optimisation activity.................................................................... 44<br />

5.3.1 Time-invariant controls .............................................................................................................. 44<br />

5.3.2 Piecewise-constant controls....................................................................................................... 46<br />

5.3.3 Piecewise-linear controls ........................................................................................................... 47<br />

5.4 Specifying Constraints for an optimisation activity ........................................................................... 49<br />

Chapter 6 - Performed Experiment Entities .............................................................................................. 51<br />

6.1 Introduction .................................................................................................................................. 52<br />

6.2 Specifying steady state or dynamic experiments and initial conditions............................................... 53<br />

6.3 Specifying experiment control actions ............................................................................................ 54<br />

6.4 Specifying measured data ............................................................................................................. 55<br />

Chapter 7 - Activity execution.................................................................................................................. 57


Contents<br />

7.1 Cross-reference check .................................................................................................................. 58<br />

7.2 Cases .......................................................................................................................................... 59<br />

7.2.1 The Case configuration and execution control dialog ................................................................... 59<br />

7.2.2 Management of Cases .............................................................................................................. 60<br />

7.2.3 Default Case configuration and activity execution Preferences...................................................... 61<br />

7.3 Interacting with executing Model-based activities ............................................................................. 63<br />

7.3.1 Execution output....................................................................................................................... 63<br />

7.3.2 Diagnostics console.................................................................................................................. 64<br />

7.4 Activity Results ............................................................................................................................. 65<br />

7.4.1 Simulation activities .................................................................................................................. 65<br />

7.4.2 Optimisation activities ............................................................................................................... 66<br />

7.4.3 Parameter Estimation activities.................................................................................................. 68<br />

Chapter 8 - Modelling Support Tools........................................................................................................ 71<br />

8.1 Introduction .................................................................................................................................. 72<br />

8.2 Global “Search-and-replace” ........................................................................................................... 73<br />

8.3 Project and entity “Compare”......................................................................................................... 75<br />

8.3.1 Entity comparison..................................................................................................................... 75<br />

8.3.2 Project comparison................................................................................................................... 75<br />

8.3.3 Entity group comparison ........................................................................................................... 77<br />

8.4 “Import files” ................................................................................................................................ 78<br />

8.5 “Create links to external files” ........................................................................................................ 79<br />

8.6 “Export” ....................................................................................................................................... 81<br />

8.6.1 Export Entity with dependencies................................................................................................. 81<br />

8.6.2 Encryption................................................................................................................................ 81<br />

8.7 “Export to <strong>ModelBuilder</strong> v2.2 Project”............................................................................................. 83<br />

8.8 “Export to Simulink” ...................................................................................................................... 84<br />

8.9 “Browse variables”........................................................................................................................ 86<br />

Chapter 9 - Utilities ................................................................................................................................ 87


Contents<br />

9.1 Introduction .................................................................................................................................. 88<br />

9.2 <strong>ModelBuilder</strong> Preferences.............................................................................................................. 89<br />

9.3 Text editor short-cut keys .............................................................................................................. 91<br />

9.3.1 Navigation Shortcuts................................................................................................................. 91<br />

9.3.2 Edit shortcuts........................................................................................................................... 94<br />

9.4 Miscellaneous Utilities ................................................................................................................... 96<br />

9.4.1 Editing of Saved Variable Sets using external editor software....................................................... 96<br />

9.4.2 Printing .................................................................................................................................... 96<br />

9.4.3 Multiple selection ...................................................................................................................... 96<br />

9.4.4 Desktop view............................................................................................................................ 96<br />

9.4.5 “Collapse project tree” action .................................................................................................... 98


Chapter 1 - Introduction


Introduction<br />

1.1 <strong>gPROMS</strong> <strong>ModelBuilder</strong><br />

The <strong>gPROMS</strong> <strong>ModelBuilder</strong> is at the centre of:<br />

all model development and maintenance activities;<br />

the archiving of models and results<br />

the execution of all model-based activities.<br />

This guide gives a description of the features and functionality of <strong>gPROMS</strong> <strong>ModelBuilder</strong> - including some of the<br />

advanced tools that are available:<br />

Chapter 2 introduces the <strong>ModelBuilder</strong> environment – looking at Projects and the general properties of all<br />

Entity editors.<br />

In Chapter 3, the Variable and Connection type Entity editors are explained.<br />

The Model Entity editor is described in Chapter 4.<br />

The Optimisation Entity editor is described in Chapter 5.<br />

The Performed Experiment Entity editor is described in Chapter 6<br />

Activity execution is discussed in Chapter 7.<br />

Chapters 8 and 9 describe the tools and utilities available in the <strong>ModelBuilder</strong> environment.<br />

Throughout this guide, it is assumed that the user is already familiar with the basic features of the <strong>gPROMS</strong> model<br />

and task language.<br />

2


Chapter 2 - Projects and Entities


Projects and Entities<br />

2.1 <strong>gPROMS</strong> <strong>ModelBuilder</strong> environment<br />

2.1.1 The <strong>gPROMS</strong> <strong>ModelBuilder</strong> Project tree<br />

The project tree (see Figure 2.1) allows the user to navigate all the (Library) Projects and Cases that have been<br />

respectively opened and created during a <strong>ModelBuilder</strong> session. They are distinguished by their colours: yellow<br />

(Projects); green (Library projects); and blue (Cases) and their ordering: Library projects, Projects and Cases.<br />

Projects of the same type are then ordered alphabetically.<br />

2.1.2 Projects<br />

4<br />

Libraries<br />

Project<br />

Case<br />

Figure 2.1 <strong>gPROMS</strong> <strong>ModelBuilder</strong> project tree<br />

To create a new <strong>gPROMS</strong> “Project'' select New from the Project menu. This will bring up a tree in the left-hand pane<br />

containing a number of folders (as shown in Figure 2.2):<br />

Variable Types<br />

Stream Types<br />

Connection Types<br />

Models<br />

Tasks<br />

Processes<br />

Optimisations<br />

Estimations<br />

Experiments<br />

o for parameter estimation


o for experiment design<br />

Saved Variable Sets<br />

Miscellaneous Files<br />

Figure 2.2: New project tree entries<br />

5<br />

New project tree<br />

entries<br />

<strong>gPROMS</strong> <strong>ModelBuilder</strong> environment<br />

Each of these entries represents a group of <strong>gPROMS</strong> Entities. Each entity type represents a fundamental <strong>gPROMS</strong><br />

concept., and <strong>ModelBuilder</strong> provides a customised “entity editor” for working with each entity type, as described in<br />

the next section.<br />

The Project can be renamed from its default of <strong>gPROMS</strong>_Project_1 by:<br />

Selecting Save As from the Project menu<br />

Entering a new “File Name”<br />

Clicking “Save”<br />

2.1.3 Entity creation and deletion<br />

To create a new entity 1 :<br />

place the pointer on the desired folder<br />

1 Alternatively, select the desired project, select “New entity” from the Entity menu.


Projects and Entities<br />

click the right mouse button<br />

select “New entity” from the shortcut menu<br />

give a name to the new entity<br />

select the type of entity in the drop-down menu,<br />

fill in a description of the entity if desired and click “OK”<br />

To delete an entity 2<br />

:<br />

select the entity<br />

click the right mouse button<br />

select delete from the shortcut menu<br />

confirm the delete by selecting Yes (alternatively the delete can be cancelled)<br />

Note: select several entities simultaneously with the shift and/or control key to delete all.<br />

To rename an existing entity 3 :<br />

place the pointer on the desired entity<br />

click the right mouse button<br />

select “Rename” from the shortcut menu<br />

fill in the desired name in the dialog window and click OK<br />

2.1.4 Opening and closing an entity editor<br />

To open an entity editor 4 :<br />

place the pointer on the desired entity<br />

click on the right mouse button<br />

select “Open” on the shortcut menu<br />

<strong>ModelBuilder</strong> supports both multiple and single editor modes: selected from the Window menu – refer to Section<br />

9.4.4 for further details. When working in multiple editor mode, an entity editor can be closed by clicking on the<br />

cross in the top right corner.<br />

2<br />

Alternatively, select the entity press “Delete” in the keyboard.<br />

3 Alternatively, select the desired entity; select “Rename” from the Entity menu.<br />

4 Alternatively, double clicking on an entity will open its editor.<br />

6


2.2 Entity editors<br />

7<br />

Entity editors<br />

As mentioned previously, <strong>ModelBuilder</strong> provides customised editors for each type of entity. Each editor provides a<br />

number of tabs, allowing the user to view or alter the different aspects of the entity’s behaviour.<br />

This section will cover the two tabs which are present on most of <strong>ModelBuilder</strong>’s entity editors – the “<strong>gPROMS</strong><br />

language” and “properties” tabs. Tabs specific to individual entities will be described in subsequent chapters.<br />

2.2.1 The entity properties tab<br />

All Entity editors in <strong>gPROMS</strong> <strong>ModelBuilder</strong> have an Entity Properties tab (see Figure 2.3) that includes the following<br />

information:<br />

description of the Entity; this is an arbitrary text provided by the Entity developer(s) for future reference.<br />

Entity creation and last modification information, including the user who performed these actions, and their<br />

times and dates; this information is read-only as it is constructed and maintained automatically by<br />

<strong>ModelBuilder</strong>.<br />

a list of all other Entities on which this Entity depends; again this is read-only information that is constructed<br />

and maintained automatically by <strong>ModelBuilder</strong>. 5<br />

Cross-referenced<br />

Entities<br />

Figure 2.3: Entity properties<br />

Entity description<br />

Projects from<br />

which crossreferenced<br />

are<br />

obtained<br />

Creation<br />

information<br />

Last<br />

modification<br />

information<br />

5 The appearance of a referenced Entity in this list simply indicates that it is required for the correct operation of the<br />

current Entity; it does not necessarily imply that the referenced Entity actually exists and/or can be located at this<br />

point in the <strong>ModelBuilder</strong> session.


Projects and Entities<br />

2.2.2 The <strong>gPROMS</strong> language tab<br />

Almost all Entity editors in <strong>gPROMS</strong> <strong>ModelBuilder</strong> have a tab that displays and allows the editing of the<br />

representation of the Entity in the <strong>gPROMS</strong> language (see Figure 2.4).<br />

“Cross” indicates<br />

Entity has errors<br />

2.2.2.1 Syntax highlighting<br />

8<br />

Syntax-sensitive<br />

editor<br />

Figure 2.4: The <strong>gPROMS</strong> language tab in an Entity Editor<br />

List of syntactic or<br />

semantic errors<br />

<strong>gPROMS</strong> <strong>ModelBuilder</strong> automatically employs syntax-sensitive highlighting of the <strong>gPROMS</strong> language to support the<br />

creation and modification of each Entity.<br />

A default set of colours is assigned for different types of <strong>gPROMS</strong> constructs. The user can overwrite these default<br />

settings, or indeed switch syntax highlighting off, by going to the <strong>ModelBuilder</strong> Preferences dialog (see Section 9.2)<br />

and highlighting the “Entity editor” category.<br />

2.2.2.2 Syntax checking<br />

<strong>gPROMS</strong> <strong>ModelBuilder</strong> will automatically check the syntax in any of the Entities that have been written. In addition, a<br />

wide range of semantic checks are performed, e.g. flagging the use of unidentified local variables. 6<br />

Syntax and semantic checking is invoked by a number of different methods:<br />

When the user saves the Project.<br />

6<br />

The semantic checking performed is currently local within the current Entity. <strong>ModelBuilder</strong> does not attempt to<br />

validate any cross-referenced Entities.


By clicking on the check syntax button just under Tools on the top toolbar.<br />

By selecting Check Syntax from the Entity menu.<br />

Right clicking on the Entity and selecting Check syntax.<br />

By using the keyboard short-cut (F4).<br />

9<br />

Entity editors<br />

If <strong>ModelBuilder</strong> finds an error, as shown in Figure 2.4, a small pane appears just underneath the text editor reporting<br />

the error. Double-click the error message in the error pane and the cursor will automatically go to the<br />

corresponding line number to show where the syntax error is.<br />

You will also see that the error is highlighted in the text editor window and that a red cross appears through the icon<br />

for the Entity in the Project tree. Correcting this error will then cause this cross and the error pane to disappear.<br />

2.2.2.3 Assisted pathname completion<br />

Most <strong>gPROMS</strong> language entity editors support pathname completion. The pathname completion applies to all the<br />

Units, Variables, Parameters, Selector names and values and Distribution Domains declared in a specific Model and<br />

all its sub-models, as well as cross-referenced entities. Note that pathname completion only works on entities that<br />

have been validated by a syntax check (F4) - see Section 2.2.2.2) and its suggestions are limited to variable names<br />

etc. which were defined at that time.<br />

Auto-completion is invoked manually by pressing Ctrl + Space or automatically following a small delay after typing<br />

the name of a Unit followed by dot. When invoked, a list box shows all the possible Units and Variable names for<br />

completion (see Figure 2.5). Typing additional characters will narrow down the selection as the partially typed word<br />

matches the appropriate Unit or Variable name. However, once a unique Unit or Variable name exists, the pathname<br />

will be automatically completed. The user may also use the cursor key to navigate around the list box. Pressing the<br />

“Space” or “Enter” key at any time will select the Unit or Variable name to replace the partially entered name. On the<br />

other hand, pressing the “Escape” key will close the list box without completion.<br />

The user also has the option to disable or delay the pop-up list box by changing the default setting in the Entity<br />

Editor category in the <strong>ModelBuilder</strong> Preferences menu (see section 9.2). Once this option has been disabled, the<br />

user can only manually invoke the list box by using the Ctrl + Space short-cut keys.<br />

2.2.2.4 Word Match<br />

This is similar to automatic pathname completion in that it completes the current word being typed. However, it<br />

does not require a valid syntax check to be used and applies to any word that may have previously been typed (not<br />

just Units, Variables, Parameters, Selector names and values and Distribution Domains). For example, it can be used<br />

to auto-complete <strong>gPROMS</strong> language key words, such as WITHIN, SWITCH, END, etc.<br />

Word match is invoked manually by pressing:<br />

Ctrl + K to find the previous word that begins like the current word and complete it so that they match.<br />

Ctrl + L to find the next word that begins like the current word and complete it so that they match.<br />

As well as completing the word, word match will also match the case. This is particularly useful for <strong>gPROMS</strong><br />

language keywords where it is usually preferred to have the whole word in upper case.


Projects and Entities<br />

Figure 2.5: Automatic pathname completion<br />

10


2.3 Project organisation<br />

<strong>2.3.1</strong> Project properties<br />

11<br />

Project organisation<br />

Each Project records information relating to the user(s) who created and last modified it, as well as the dates and<br />

times of creation and last modification. This information is read-only and is recorded and maintained automatically<br />

by <strong>ModelBuilder</strong> under the Project's Properties.<br />

Project Properties can be viewed by right-clicking on the Project's name in <strong>ModelBuilder</strong>'s navigation tree and<br />

selecting “Properties” in the context-sensitive menu that appears (see Figure 2.6).<br />

The Properties dialog has a second tab that controls the list of Projects that can be cross-referenced - this is<br />

discussed below.<br />

Right-click on<br />

project name to<br />

see this menu<br />

Enable/disable<br />

display of empty<br />

Entity groups<br />

Cross-references<br />

tab<br />

Figure 2.6 Project properties dialog<br />

2.3.2 Entity cross-referencing and hierarchical libraries<br />

Enable/disable<br />

Library project in<br />

the project tree<br />

In <strong>gPROMS</strong> <strong>ModelBuilder</strong>, the Entities in one Project may make references to Entities that belong to another Project.<br />

For example,<br />

a Model Entity in Project A may refer to Variable Types in a Project B in declaring its Variables;<br />

a Model Entity in Project A may refer to Models in a Project B in declaring its Unit sub-models;<br />

a Task or Process Entity in Project A may refer to Models and/or Tasks in Project B;


Projects and Entities<br />

and so on. This provides a convenient way of building libraries of Variable and Connection types, Models and Tasks -<br />

or indeed any type of Entity - within <strong>gPROMS</strong>. Please note that only Projects currently loaded within <strong>ModelBuilder</strong><br />

can be searched for Entities.<br />

Cross-reference<br />

tab in project<br />

properties dialog<br />

Projects already in<br />

cross-reference list<br />

Check-box for temporary<br />

disabling of cross-referencing<br />

12<br />

Buttons for changing<br />

search order<br />

Projects that may be<br />

added to crossreference<br />

list<br />

Figure 2.7 Specifying cross-referenced Projects<br />

2.3.2.1 Specifying a Project's list of cross-referenced Projects<br />

A Project may refer to Entities residing in any number of other Projects. As shown in Figure 2.7 the latter can be<br />

specified explicitly via the “Cross-references” tab of the Project's Properties dialog (see section <strong>2.3.1</strong>). Note that<br />

only Projects that are currently open within the <strong>ModelBuilder</strong> session can be selected in this manner. 7<br />

The ordering of a Project's list of cross-referenced Projects is important in that it determines the order in which the<br />

various Projects in the list will be searched (discussed below). Each new Project added is inserted immediately<br />

below the Project in the list that is currently highlighted. However, the position of any Project in the list may be<br />

modified at any time via the “Raise” and “Lower” buttons provided.<br />

2.3.2.2 Search rules for cross-referenced Projects<br />

In technical terms, <strong>ModelBuilder</strong> supports multiple libraries organised in hierarchies of arbitrary depth which are<br />

searched in a depth-first manner. This sophisticated capability is best explained via an example. Suppose a Model<br />

Entity M1 in a certain Project A contains a Unit sub-model that is of type Model M2. <strong>ModelBuilder</strong> starts by looking<br />

for M2 within A itself. If this search is not successful, then it starts looking for M2 within the Projects that can be<br />

cross-referenced by A in the order in which these have been specified (see section 2.3.2.1). If one of these other<br />

Projects, say B, has its own list of cross-referenced Projects, then these will also be searched - and this will be done<br />

7<br />

This is consistent with the fact that only Projects that are currently open are actually searchable.


13<br />

Project organisation<br />

before moving on to the next Project in A's list 8 . The search for a particular Entity ends when M2 is either found or<br />

there are no more Projects to be searched.<br />

Assuming that MODEL M2 has been found, it is entirely possible that it, in turn, refers to lower-level Entities such as<br />

other MODELs, or variable or stream types. The search for these Entities will follow exactly the same rules as that<br />

for M2 itself. It is worth noting that the search will always commence from the current Project A and not from the<br />

Project in which M2 was found. This is designed to allow, for example, a user's Project to make use of a standard<br />

library MODEL (e.g. “Reactor”) while overriding the library definition of a variable type (e.g. “Temperature”) or indeed<br />

of a sub-model (e.g. “KineticMechanism”) by providing its own Entity of the same name.<br />

2.3.2.3 Temporary suspension of Project cross-referencing<br />

At any point during a <strong>ModelBuilder</strong> session, the user may instruct <strong>ModelBuilder</strong> not to search other Projects for any<br />

missing Entities until further notice. This can be done by checking the “Disable cross-references” check-box in the<br />

cross-references tab of the Project's Properties dialog (see Figure 2.6).<br />

2.3.2.4 Creating a self-contained Project<br />

It is sometimes desirable to create a completely self-contained Project that contains physical copies of all necessary<br />

Entities, including any that may reside in cross-referenced Projects.<br />

The creation of a self-contained Project may be performed automatically using the “Copy X-referenced Entities into<br />

Project” utility under the <strong>ModelBuilder</strong>'s Tools menu. This operation cannot be reversed automatically.<br />

Project to be made<br />

self-contained<br />

Initiating the automatic entity<br />

copying operation<br />

Projects from which<br />

cross-referenced<br />

entities will be copied<br />

Figure 2.8 Creating a self-contained Project<br />

8<br />

<strong>gPROMS</strong> <strong>ModelBuilder</strong> will automatically detect and deal with any circular references. In particular, no Project is<br />

searched more than once while searching for a particular Entity


Projects and Entities<br />

2.3.3 Automatic loading of Projects<br />

The list of Projects to be automatically loaded whenever <strong>ModelBuilder</strong> is started can be specified as part of the<br />

user's <strong>ModelBuilder</strong> Preferences. This feature is particularly useful for library Projects.<br />

The <strong>ModelBuilder</strong> Preferences dialog can be accessed from the Edit menu. Simply highlight the “Projects” category;<br />

and add or delete Projects in the “start-up Projects” list using the corresponding buttons. The file navigation dialog<br />

that appears when the “Add” button is pressed permits the selection of any Project (.gPJ) file that is currently visible<br />

to the user -including those that reside on shared file systems.<br />

2.3.4 Read-only Projects<br />

In order to protect against inadvertent modifications being made to a particular Project or Library project, it is<br />

recommended that the corresponding gPJ file be declared as “read-only” using standard operating system facilities<br />

prior to loading the project into <strong>ModelBuilder</strong>. In such cases, a “lock” symbol will be displayed against both the<br />

Project and any Entity that it contains in the <strong>ModelBuilder</strong>'s navigation tree. Any operation that may result in a<br />

modification of this Project is automatically disabled.<br />

2.3.5 Display of empty groups in Project tree<br />

The Properties dialog can also be used to control the appearance of the Project in <strong>ModelBuilder</strong>'s navigation tree. In<br />

particular, the display of empty folder groups (e.g. the TASK group in a Project that does not actually contain any<br />

TASK Entities) can be enabled or disabled by ticking the relevant check-box (see Figure 2.9). The same effect can<br />

be achieved by ticking the “Display empty groups” entry in the Project's context-sensitive menu.<br />

14


Figure 2.9 Display of empty groups in Project tree<br />

15<br />

Project organisation


Projects and Entities<br />

2.4 Library projects<br />

Project libraries are projects marked by the user as such to indicate that they contain potentially re-usable<br />

components. Project libraries are marked in green and always appear at the top of the Project tree. Their purpose<br />

is to enhance the management, usability and operability of generic Models and Tasks. They can contain all entity<br />

types and can cross-reference other libraries/projects. The <strong>gPROMS</strong> Process Model Library (PML) makes extensive<br />

use of this new concept.<br />

Entities in a library project can be used by another project opened in <strong>ModelBuilder</strong> if:<br />

the library is open in <strong>ModelBuilder</strong>, and<br />

the library is cross-referenced by the project<br />

2.4.1 Creation of libraries<br />

Any project can be converted into a library and vice versa. To create a library from a project:<br />

Open the “Properties” tab of the project:,<br />

Check the “library project” checkbox to convert to project into a library (Figure 2.6).<br />

Similarly, a library can be converted into a project by following step 1 and un-checking the “library project”<br />

checkbox.<br />

2.4.2 Display of libraries in the project tree<br />

Libraries can be displayed or hidden in the project tree in two alternative manners:<br />

click on “View” on the <strong>ModelBuilder</strong> top bar menu and select “display libraries” in the scroll-down menu (a<br />

check next to the option marks if it is on or off)<br />

Ctrl+D to toggle between displayed and hidden libraries<br />

Note: the selection is permanently saved for the next time you open <strong>ModelBuilder</strong>.<br />

16


2.5 Model palette<br />

17<br />

Model palette<br />

The Model palette (Figure 2.10) graphically displays the Model Entities contained in open Projects (and Library<br />

projects) and provides an alternative view to the Project tree. All Models that have an icon defined (see Section<br />

4.2.1) are shown on the Model palette 9 . The Models are grouped by the Projects to which they belong. The Model<br />

palette provides a graphical view of models that can be used to build flowsheets.<br />

Tabs to switch between<br />

Project tree view and<br />

Model palette view<br />

2.5.1 Displaying the Model palette<br />

To display the Model palette (see Figure 2.10):<br />

Model palette<br />

Figure 2.10 Model palette<br />

click on “View” in the <strong>ModelBuilder</strong> top bar menu<br />

select “Model palette” in the scroll-down menu (a check next to the option marks if it is on or off)<br />

The model palette window will appear on the left hand side. If the Project tree is also open, a tab at the bottom of<br />

the window will allow the user to toggle between the Project tree and the Model palette.<br />

The arrow to the left of the Project name allows the palette for each Project to be collapsed and expanded.<br />

Selecting a Model on the Palette displays the description of the Model Entity (refer to Section 2.2.1).<br />

9 Models will only appear on the palette if the “Show in palette” option is checked on their Properties tabs.


Projects and Entities<br />

18


Chapter 3 - Variable and Connection Type Entities


Variable and Connection Type Entities<br />

3.1 Variable Types editor<br />

Variable Types are displayed and edited in a tabular format. A new Variable Type can be added either by defining a<br />

New Entity from the Entity menu or by completing the entries in the blank row that always appears at the bottom of<br />

the Variable Types table (see Figure 3.1). When this happens, a corresponding new Variable Type is created and a<br />

new blank row is automatically appended to the table.<br />

To help the user navigate the various Variable Types, when a particular Variable Type is selected in the Project tree,<br />

the corresponding row is automatically highlighted in the Variable Types table.<br />

Figure 3.1: Variable Types Editor<br />

20


3.2 Connection Types editor<br />

3.2.1 Introduction<br />

21<br />

Connection Types editor<br />

Component models are connected on a composite model’s topology via their Ports (refer to Section 4.3). Each Port<br />

is declared as an instance of a Connection Type.<br />

Connection Types include<br />

Variables: these can be referred to in component models;<br />

Parameters and Distribution domains: these can be used to provide the dimensions of any Parameters and<br />

Variables defined for the Connection Type;<br />

A graphical representation;<br />

Port categories: these can be used to disallow certain connections.<br />

It should be noted that a Model’s Port declaration, in effect, declares the Variables, Parameters and Distribution<br />

domains associated to the Connection Type used for the port declaration.<br />

In addition to the Properties tab (see Section 2.2.1), three tabs are used to define a Connection Type<br />

“Parameters & Variables”<br />

“Graphical representation”<br />

“Port categories”<br />

Each of these tabs is now considered.<br />

3.2.2 “Parameters & variables” editor tab<br />

The Parameters, Distribution domains and Variables are defined on the “Parameters & Variables” editor tab (see<br />

Figure 3.2).<br />

For each Parameter the user should specify:<br />

o a type (Real, Integer, or Foreign Object 10<br />

)<br />

o and (optionally) a default value,<br />

For each Distribution domain the user should specify<br />

o lower and upper bounds<br />

For each Variable the user should specify<br />

o a Variable Type (see Section 3.1)<br />

o Variable dimensions (or if a scalar variable). Both the size and number of dimensions are<br />

declared in the Dimensions field: any size and number of dimensions are permitted.<br />

The lower and upper bounds for Distribution domains and the size of array Variables can be given either directly as<br />

a literal constant (e.g. 2) or using any of the Parameters also defined for the Connection Type 11 .<br />

10 If a parameter of type Foreign Object is specified then a Foreign Object Class can also be specified.<br />

11 Only Parameters of type integer can be use to size Array Variables


Variable and Connection Type Entities<br />

Figure 3.2: The Parameters and Variables tab<br />

3.2.2.1 Adding a new Parameter, Distribution domain or Variable<br />

To add a new Parameter, Distribution domain or Variable<br />

select the cell in the corresponding cell matrix,<br />

type the new entity name,<br />

use the keyboard right arrow, TAB, or the mouse, to move to the next cell and enter the required<br />

information<br />

press “Enter” when finished<br />

The contents of a cell can be modified by double clicking on it or by selecting the cell and pressing F2. To delete an<br />

entry, select the whole row and press the delete key.<br />

3.2.3 “Graphical representation” tab<br />

The appearance of the Unit Ports and the connections between them on a component Model’s topology tab are<br />

determined by the Port’s Connection Type.<br />

22


23<br />

Connection Types editor<br />

The graphical view of the Connection Type is defined using the “Graphical representation” tab (Figure 3.3). A<br />

preview of a connection based on this Connection Type is shown on the tab.<br />

3.<strong>2.3.1</strong> Changing the colour specification<br />

To change the colour of the Port or the connection, simply click the arrow next to the colour for the Port or<br />

connection colour, and select a suitable colour from the drop-down list (Figure 3.3). The drop-down list includes a<br />

selection of standard colours, but a new colour can be created from the Advanced option if desired. To do this:<br />

Click on the button next to colour<br />

Select the suitable options in the tabs:<br />

o “Swatches”: allows the user to select the suitable colour<br />

o “HSB”: Hue, Saturation, Brightness<br />

o “RGB”: Red-Green-Blue tone<br />

click OK<br />

The user-defined colour will appear at the bottom of the colour drop-down list with the name of “Custom”.<br />

3.2.3.2 To change the connection line thickness<br />

Similarly, to change the thickness of the connection line, simply click the arrow next to the “Connection thickness”<br />

label, and select a suitable thickness from the drop-down list.<br />

Line thickness<br />

Figure 3.3 Graphical representation tab<br />

Advanced colour options<br />

Colour options


Variable and Connection Type Entities<br />

3.2.4 Port categories tab<br />

Connections are only permitted between Ports of the same Connection Type (see Section 4.3.2). In addition, Port<br />

categories allow the user to define permitted connections between Ports of the same Connection type (Figure 3.4).<br />

Rules on permitted connections are given later in Section 4.3.2.<br />

To create a new Port category:<br />

A Node Port is allowed to connect only with a Connector Port<br />

type the name in the “New Port Category” field,<br />

click on the “add” button<br />

A Connector Port is allowed to connect with another<br />

Connector Port or a Node Port<br />

Figure 3.4 Port categories tab<br />

The new Port category will be then added to the “Allowable connections” table at the end of the first row and at the<br />

bottom of the first column. A checked box denotes that connections between the corresponding Port categories are<br />

permitted.<br />

When a Port is declared in a Model’s definition the category of the Port is selected from those defined for the<br />

Connection Type.<br />

24


Chapter 4 - Model Entities


Model Entities<br />

4.1 Introduction<br />

<strong>gPROMS</strong> <strong>ModelBuilder</strong> allows users to build composite models graphically. This functionality is designed to enable<br />

you to quickly construct process flowsheet models that are suitable for use in any model based activity (e.g. steadystate<br />

and dynamic simulation, parameter estimation and optimisation studies). To this end, in addition to the<br />

standard <strong>gPROMS</strong> language and Properties tabs (Section 2.2), Model Entities have two additional tabs: interface<br />

and topology. These are described in this Chapter.<br />

26


4.2 Interface tab<br />

27<br />

Interface tab<br />

The Interface tab (Figure 4.1) allows a user to define a public view of the Model: in particular it determines how the<br />

Model appears when used on the Topology tab of a composite model. Primarily, the interface is used to determine<br />

two characteristics: the Model icon and the Model Ports.<br />

4.2.1 Icon definition<br />

Position of the Ports in<br />

the icon<br />

Figure 4.1 The Model Interface tab<br />

Icon<br />

Ports<br />

An icon should first be created in an external graphical package and then imported into <strong>gPROMS</strong> 12 . To do this:<br />

click on the “Select icon” button,<br />

browse to the location of the icon file using popup dialog window, and<br />

select the file containing the icon<br />

The current icon is always displayed in the “Interface” window. The user can also select the size of the icon, to do<br />

this:<br />

click on the field next to the label “Icon size when added to the topology diagrams”,<br />

select the suitable option in the drop-down list<br />

12 Note: the icon files must be GIF, JPEG or PNG formats


Model Entities<br />

The icon sizes are defined as follows:<br />

“Default”: corresponds to the actual size of the icon in pixels as imported<br />

“Tiny” shows the icon extrapolated to a size of 16 x 16 pixels<br />

“Small” shows the icon extrapolated to a size of 32 x 32 pixels<br />

“Medium” shows the icon extrapolated to a size of 64 x 64 pixels<br />

“Large” shows the icon extrapolated to a size of 128 x 128 pixels, and<br />

“Huge” shows the icon extrapolated to a size of 256 x 256 pixels<br />

Note: To ensure that the Model appears on the Model palette the user should confirm that “Show in palette” option<br />

is checked on the Model Properties tab (see Section 2.5 for further details).<br />

4.2.2 Port definition<br />

The table displayed underneath the icon shows the Ports defined for the Model. Ports are instances of Connection<br />

type entities (see Section 3.2 for further details) and can be used to define the connectivity of composite models<br />

(see Section 4.3).<br />

To define a new Port click on the “Add” button this will open a dialog box (Figure 4.2) where the user will be asked<br />

to enter the following information:<br />

Port name: a user defined name for the specific Port.<br />

Connection type: a drop-down list allows the user to select from the Connection types defined in the<br />

working project or in a cross-referenced project or library project.<br />

Port category: the drop-down list shows the Port categories defined for the selected Connection type.<br />

Direction: defines the directionality of the Port (inlet, outlet, bi-directional).<br />

Dimensionality:<br />

o Select scalar to define a simple Port.<br />

o To define a fixed array Port, select Fixed sizes(s). Both the size and number of dimensions are<br />

declared in the Size of dimension(s) field 13<br />

: any size and number of dimensions are permitted.<br />

o To define a dynamic array Port, select Dynamic size. The size of the dynamic array is declared in<br />

the Bound size parameter field 14<br />

and can be made equal to any integer parameter declared in the<br />

model (this field is automatically populated with the possible parameters). When the model is<br />

added to a topology this parameter is automatically set, based on the number of connections to<br />

the dynamic port.<br />

The Port position on the icon must also be specified. To do this 15<br />

:<br />

place the pointer on the Port shown in the icon in the “Interface” tab,<br />

click on the Port and drag it to a suitable position,<br />

release the mouse button to finalise the Port position<br />

Note that a Port definition is also reflected on the <strong>gPROMS</strong> language tab (see Figure 4.3).<br />

13 only highlighted if Fixed size(s) is selected in the dimensionality field.<br />

14<br />

only highlighted if Dynamic size is selected in the dimensionality field.<br />

15 Alternatively, the Port position can be set by typing the rectangular coordinates in the appropriate fields (Figure<br />

9).<br />

28


Edited Port<br />

Figure 4.2 Defining a Port<br />

4.2.2.1 Using Port Variables and Parameters in the <strong>gPROMS</strong> language<br />

29<br />

Interface tab<br />

By implication, defining a Port declares all the Variables and Parameters defined for that Port’s Connection type.<br />

These are referred to via the standard “pathname” construction used widely in <strong>gPROMS</strong>:<br />

PortName.VariableName or PortName.ParameterName<br />

A simple example from the <strong>gPROMS</strong> Process Model Library is shown in Figure 4.3. This illustrates the use of Port<br />

Parameters and Variables in the <strong>gPROMS</strong> language definition of a Model.


Model Entities<br />

Figure 4.3 The <strong>gPROMS</strong> language tab for a simple Model with a Port declaration<br />

30


4.3 Topology tab<br />

31<br />

Topology tab<br />

Composite models can be constructed by dragging (with the mouse) component models from the Project tree, or<br />

Model palette, and dropping them onto a graphical topology editor. The connectivity of the composite model can<br />

also be specified by connecting the Ports of the component models.<br />

Figure 4.4 shows the Topology editor for a blank Model along with the Project tree displaying the Process Model<br />

Library.<br />

4.3.1 Instances of component models (Units)<br />

To add a Model instance (a Unit) to the topology editor:<br />

Figure 4.4 Model topology<br />

select the Model in the Project tree or from Model palette,<br />

drag it to the desired position on the Topology editor and drop it by releasing the mouse button<br />

The new Unit is automatically named as ModelName001. If a second Model of the same type is dragged onto the<br />

Topology, the new Unit will be automatically named as ModelName002, and so on.<br />

4.3.1.1 The Unit shortcut menu<br />

<strong>ModelBuilder</strong> tool bar<br />

Topology editor tool bar<br />

Any model from the palette can be<br />

dragged on to the topology editor<br />

Once positioned on the topology tab, changes can be made to a Unit using its shortcut menu. To display the<br />

shortcut menu right-click on the Unit - Figure 4.5.


Model Entities<br />

Figure 4.5 Unit shortcut menu<br />

As well as standard editing tools (cut, copy and paste) the Unit shortcut menu gives the following options:<br />

To Delete 16<br />

a Unit (if the selected Unit is connected to other Units, these connections will be also deleted).<br />

To Rename 17<br />

a Unit.<br />

Make Unit into an array – see Section 4.3.4.<br />

Set Unit size (choose from Default, Tiny, Small, Medium. Large, Huge – see Section 4.2.1)<br />

Open Model: this allows the user to open the Model editor for the component model that the selected Unit<br />

is an instance of.<br />

Note that it is possible to undo/redo any command or action using the and commands on the<br />

<strong>ModelBuilder</strong> tool bar menu.<br />

16 A Unit can also be deleted by selecting the Unit on the topology and pressing delete.<br />

17 A Unit name also can be changed by selecting the Unit name; double clicking the selected unit name.<br />

32


4.3.2 Defining the connectivity of a composite model<br />

33<br />

Topology tab<br />

Once more than one Unit has been added to a composite model, the connectivity of the system can be defined by<br />

connecting the Ports of each Unit. This can be done in the following manner:<br />

select the button on the Topology editor tool menu: this will switch the pointer to connection mode<br />

select the starting Port<br />

move the pointer to the destination Port<br />

select the destination Port<br />

If the line becomes solid then the connection has been verified. If the connection is invalid, <strong>ModelBuilder</strong> will issue a<br />

pop-up message giving an explanation (Figure 4.6).<br />

Figure 4.6 An invalid connection<br />

<strong>ModelBuilder</strong> applies the following rules to determine the validity of a connection:<br />

Both Ports must be instances of the same Connection Type.<br />

The Port categories of the two Ports must permit the connection, as defined for the Ports’ Connection Type<br />

(see Section 3.2.4 for further details).<br />

The directionality of the two Ports must be consistent:<br />

o An inlet Port can be connected to an outlet or a bi-directional Port;<br />

o An outlet Port can be connected to an inlet or a bi-directional Port;<br />

o A bi-directional Port can be connected to an inlet, outlet or another bi-directional Port.<br />

To delete a connection: select the connection and press “Delete”.<br />

4.3.2.1 Arrays of Ports<br />

As discussed in Section 4.2.2, <strong>gPROMS</strong> supports Arrays of Ports. This functionality allows multiple streams to be<br />

connected to a single Port (as shown in Figure 4.7). An Array Port is indicated by a hollow Port icon.


Model Entities<br />

When connecting to (or from) an Array Port a Connection details dialog box prompts the user to confirm to which<br />

Port index the connection should be made (Figure 4.7). In most cases the user can simply “OK” this box.<br />

4.3.2.2 Additional information display<br />

Figure 4.7 Array of Ports<br />

The Topology editor provides additional information via a pop-up message approach. To access this information:<br />

Connection information: placing the mouse pointer over a connection displays the corresponding <strong>gPROMS</strong><br />

language for the connection equation (Figure 4.8).<br />

Port information: placing the mouse pointer over a Port displays the Port name, type and direction (Figure<br />

4.8).<br />

34


Figure 4.8 Additional information display<br />

4.3.2.3 Topology connections and the <strong>gPROMS</strong> language<br />

35<br />

Topology tab<br />

Each Unit on the Topology corresponds to a declaration of a Model instance. The Unit declarations are shown (and<br />

can be edited) on the <strong>gPROMS</strong> language tab in the UNIT section<br />

Each connection on the Topology corresponds to an equation that equates the two Ports 18 . Like the Unit<br />

declarations, the equations are shown (and can be edited) on the <strong>gPROMS</strong> language tab in the TOPOLOGY section.<br />

4.3.3 Hierarchical model construction<br />

Most of the models in the <strong>gPROMS</strong> Process Model Library (PML) are primitive models – i.e. non-composite models.<br />

However, in <strong>gPROMS</strong> there is no limitation with respect to the number of levels in the hierarchical model<br />

decomposition: composite models with a defined topology can themselves be used to build even more complex<br />

composite models (see for example the PML distillation column).<br />

To use a composite model on the Topology tab of a higher level model the user must simply define the Interface for<br />

the composite model (i.e. introduce an icon and add Ports) as described earlier in Section 4.2. The Ports of a<br />

composite model appear on this Model’s own Topology tab: these can be connected to any other valid Port on the<br />

topology as shown in Figure 4.9.<br />

18 More explicitly <strong>gPROMS</strong> expands the Port definition to equate all the variables in the two Ports.


Model Entities<br />

4.3.4 Arrays of Units<br />

Ports to be connected at<br />

the higher level model<br />

4.3.4.1 Making a Unit into an Array<br />

Figure 4.9 Hierarchical model construction<br />

The Topology editor also supports Arrays of Units. Making a Unit into an array is easily done from the Unit shortcut<br />

menu (Section 4.3.1.1):<br />

select “Make Unit into an array” in the popup menu,<br />

fill in the size of the array in the different dimensions separated by commas, and click OK<br />

Arrays of Units are distinguished on the topology editor by a coloured rectangle as shown in Figure 4.10. This gives<br />

the following information<br />

the Model icon,<br />

the size and dimensions (in the bottom right corner)<br />

an expansion node to expand the display of the array (top left corner)<br />

36


Node to expand the<br />

array view<br />

Unit name<br />

37<br />

Array elements<br />

connected<br />

Figure 4.10 Array of Units<br />

4.3.4.2 Interior connections within an Arrays of Units<br />

To specify connections between the component Units of an array:<br />

expand the array by clicking on the expansion node,<br />

click on the “Creating Port connection” button,<br />

create the connections using the procedure described in Section 4.3.2.<br />

4.3.4.3 Connecting to an Array of Units<br />

Number of units in<br />

the array<br />

Topology tab<br />

Connections to an array of Units are handled in the same way as connections to an array of Ports (see Section<br />

4.3.2.1): a Connection details dialog box prompts the user to confirm to which Unit index the connection should be<br />

made.<br />

4.3.5 The Topology editor tool bar<br />

The Topology editor provides many tools that enable the user to manipulate the look of the system model. These<br />

tools can be accessed from the Topology editor tool bar which is shown in Figure 4.11.


Model Entities<br />

Select<br />

Create port<br />

connection<br />

Pan<br />

Drag a rectangle<br />

to zoom<br />

Zoom in<br />

Zoom to<br />

100%<br />

Zoom out<br />

Fit to current<br />

window<br />

4.3.5.1 Display of Unit and Model names<br />

Flip horizontal<br />

Snap to grid<br />

38<br />

Flip vertical<br />

Show unit<br />

names<br />

Show overview<br />

panel<br />

Figure 4.11 The Topology editor toolbar<br />

Show model<br />

names<br />

Rotate left<br />

Rotate right<br />

To toggle the display of the names of the Units in the flowsheet click on the button on the Topology<br />

editor tool bar, this will display or hide the names of the Units in the flowsheet<br />

To toggle the display of the names of the generic Models underneath each Unit in the flowsheet click on the<br />

button on the Topology editor tool bar, this will display or hide the names of the models underneath<br />

the Units in the flowsheet<br />

The font size of the Units and Model names is determined by the <strong>ModelBuilder</strong> preferences (accessed from the Edit<br />

menu - see Section 9.2).<br />

4.3.5.2 Zoom controls<br />

To pan the Model: click the button from the Topology editor tool bar. Select the Model and move the<br />

mouse to pan.<br />

To zoom in on a specific area of the flowsheet click the button from the Topology editor tool bar.<br />

Draw a rectangle covering the area of interest, to do this: click, hold and drag a rectangle and then release<br />

the mouse button.<br />

To zoom in and out the flowsheet with respect to the centre of the Topology editor window: click the<br />

or buttons from the Topology editor tool 19<br />

.<br />

19 Alternatively, to zoom in and out the flowsheet with respect to the centre of the Topology editor rotate the mouse<br />

wheel.


To return the flowsheet to its original size click the button from the Topology editor tool bar.<br />

39<br />

Topology tab<br />

To fit the Model to the current topology editor view size, click the button from the topology editor tool<br />

bar.<br />

4.3.5.3 Moving and rotating Units<br />

To move a Unit, or a set of Units: first select the Unit, or the set of Units, then, drag the selection with<br />

the mouse to a new location.<br />

To rotate a Unit, or a set of Units: select the Unit, or the set of Units, then click on the or buttons<br />

on the Topology editor tool bar.<br />

To flip a Unit, or a set of Units: select the Unit, or the set of Units, then click on the or buttons on<br />

the Topology editor tool bar to flip.<br />

4.3.5.4 The Topology overview panel<br />

A view of the whole flowsheet can be seen by opening a Topology overview panel (Figure 4.12). This can be<br />

activated from the view menu, or by selecting the button from the Topology editor tool bar. The whole<br />

flowsheet will appear in a detached small window along with a rectangle representing the area currently shown on<br />

the Topology editor view.<br />

The overview panel can be used to move the area shown on the topology editor, to do this: click and drag the<br />

rectangle on the overview window to the desired location.<br />

Figure 4.12 The overview panel


Chapter 5 - Optimisation Entities


Optimisation Entities<br />

5.1 Introduction<br />

This chapter describes the functionality and use of the intelligent editor for the formulation of an optimisation<br />

problem. Some basic familiarity with the <strong>gPROMS</strong> language and concepts is assumed. Details of how <strong>gPROMS</strong> can<br />

be used to perform (dynamic) optimisation calculations can be found in the <strong>gPROMS</strong> Advanced User Guide.<br />

Apart from the usual <strong>gPROMS</strong> language and properties tabs, there are three additional tabs for an Optimisation<br />

Entity:<br />

General<br />

Controls<br />

Constraints<br />

Please note that any changes in the intelligent editor will affect the text based editor and vice versa.<br />

42


43<br />

Specifying General information for an optimisation activity<br />

5.2 Specifying General information for an optimisation activity<br />

The user can define the name of the Process which the optimisation refers to, the objective function, whether this<br />

function is to be maximised or minimised and the type of optimisation (point or dynamic) to be performed in the<br />

General tab (see Figure 5.1)<br />

When dynamic optimisation is selected, the user needs to provide values for the guess, lower and upper bounds of<br />

the Time horizon. A default entry for the Control interval also appears in the cell matrix at the bottom window. The<br />

user needs to specify the values of the duration, lower and upper bounds for this Control interval before proceeding<br />

to another Control interval by clicking the Duplicate button. If the Fixed check box is selected, the bounds will be<br />

fixed according to the specified duration. For point or steady state optimisation, the Time horizon and the Control<br />

interval fields are disabled.<br />

Process name<br />

Variable full pathname<br />

Figure 5.1: General tab of Optimisation Entity<br />

Editor tabs


Optimisation Entities<br />

5.3 Specifying control variables for an optimisation activity<br />

The user can specify the name of the Control Variables, Control type (Time-invariant, Piecewise-constant or<br />

Piecewise-linear) and Allowable values (Continuous, Binary, Enumerated, Integer or Special Ordered Set 1) in the<br />

Control tab (see Figure 5.2).<br />

Depending on the Control type selected, the user will have different options for the Allowable values. Details of how<br />

to specify these will be presented in the following sections.<br />

Selected variable<br />

(yellow frame)<br />

Time profile shown in the<br />

bottom cell matrix<br />

Drag to<br />

internally<br />

resize the<br />

workbook<br />

Figure 5.2: Control tab of Optimisation Entity<br />

44<br />

Selected in the middle group<br />

of radio buttons<br />

Button to delete variables<br />

5.3.1 Time-invariant controls<br />

The user needs to specify the Initial guess, Lower bound and Upper bound for both the Continuous and Integer<br />

control variables, as shown in Figure 5.3 and Figure 5.4.


Figure 5.3: Time-invariant continuous control variables<br />

Figure 5.4: Time-invariant integer control variables<br />

45<br />

Specifying control variables for an optimisation activity<br />

When Binary Allowable values is selected, the user needs to select an appropriate initial guess for the Time-invariant<br />

control variable from the drop-down list, i.e. 0 is False and 1 is True (see Figure 5.5).<br />

Click on the arrow to display<br />

drop-down list<br />

Figure 5.5: Time-invariant binary control variables<br />

For Time-invariant Enumerated control variables, the user can enter the possible guesses in the blank field and then<br />

use the Add and Delete buttons to compile the list. The initial guess can be selected either by clicking the arrows to<br />

scroll to the desired value of the list of possible values or choosing the value directly in the list (see Figure 5.6).


Optimisation Entities<br />

46<br />

Arrows to scroll the possible guesses<br />

list to select the initial guess<br />

Text field to add new possible<br />

guesses<br />

Figure 5.6: Time-invariant enumerated control variables<br />

When Special Ordered Set 1 is selected for Allowable values, the user needs to provide the initial guess of the nonzero<br />

element as in Figure 5.7:<br />

Figure 5.7: Time-invariant control variables of type Special Ordered Set 1<br />

5.3.2 Piecewise-constant controls<br />

For Piecewise-constant control variables, the user needs to specify the values of the initial guess, lower and upper<br />

bounds for both the Continuous or Integer Allowable values as for the Time-invariant Control type. However, in this<br />

particular case, the same procedure is repeated for each Interval (see Figure 5.8):<br />

Value of the variable fixed in<br />

the interval


Figure 5.8: Piecewise-constant continuous control variables<br />

47<br />

Specifying control variables for an optimisation activity<br />

The user needs to activate/inactive the True check box for each Interval when defining the Piecewise-constant<br />

Binary option as in Figure 5.9:<br />

Check boxes to toggle<br />

between true and false<br />

Figure 5.9: Piecewise-constant binary control variables<br />

For Piecewise-constant and Enumerated option, the user needs to specify the initial guesses and possible values for<br />

each Interval (see Figure 5.10). Please note that the possible values of a Variable must be typed in the same cell<br />

only separated by commas.<br />

Possible values of the variable separated by<br />

commas<br />

Figure 5.10: Piecewise-constant enumerated control variables<br />

5.3.3 Piecewise-linear controls<br />

These are set in the same manner as Piecewise-constant continuous control variable, but different initial guesses<br />

and bounds must be set for both bounds of each interval (see Figure 5.11). The values at each Interval bound can<br />

also be fixed by checking the corresponding box.


Optimisation Entities<br />

Figure 5.11: Piecewise-linear control variables<br />

48<br />

Value of the variable fixed in<br />

this interval bound


5.4 Specifying Constraints for an optimisation activity<br />

49<br />

Specifying Constraints for an optimisation activity<br />

There are three types of Constraints that can be specified using the intelligent editor (see Figure 5.12):<br />

Equality end-point constraints<br />

Inequality end-point constraints<br />

Interior-point constraints<br />

Figure 5.12: Equality endpoint constraints, inequality endpoint constraints and interior-point constraints


Chapter 6 - Performed Experiment Entities


Performed Experiment Entities<br />

6.1 Introduction<br />

This chapter describes the functionality and use of the intelligent editor for the representation of information<br />

contained in performed experiments to be used for parameter estimation and experiment design purposes. Some<br />

basic familiarity with the <strong>gPROMS</strong> language and concepts is assumed. Details of how <strong>gPROMS</strong> can be used to<br />

perform parameter estimation and experiment design calculations can be found in the <strong>gPROMS</strong> Advanced User<br />

Guide. The user can find the Performed experiment Entity in the “… for parameter estimation” and in the “…for<br />

experiment design” Entities.<br />

Apart from the usual <strong>gPROMS</strong> language and properties tabs, there are three tabs for a Performed Experiment<br />

Entity:<br />

Initial conditions<br />

Controls<br />

Measured data<br />

Please note that any changes in the intelligent editor will affect the text based editor and vice versa.<br />

52


Specifying steady state or dynamic experiments and initial conditions<br />

6.2 Specifying steady state or dynamic experiments and initial<br />

conditions<br />

The user can specify the initial conditions for the Performed experiment Entity in the Initial condition tab (see Figure<br />

6.1). The selection of Steady state radio button will automatically disable the Initial condition cell matrix.<br />

When the Dynamic radio button is selected, the Initial condition cell matrix is activated. The user can enter a new<br />

Initial condition by double clicking on the new cell in the Variable name column and specify the corresponding Initial<br />

value for the defined Variable name.<br />

Figure 6.1: Initial conditions tabs of Performed Experiment Entity<br />

53


Performed Experiment Entities<br />

6.3 Specifying experiment control actions<br />

The specification of Time-invariant and Piecewise-constant control actions can be done in the Control tab as shown<br />

in Figure 6.2.<br />

The name and the value of the Time-invariant control can be specified using the same approach as with the<br />

specification of the Initial Conditions in section 6.2.<br />

For Piecewise-constant control, the user need to specify the Interval duration for each Interval first, and then fill in<br />

the corresponding values of the defined Piecewise-constant Variable at the appropriate column.<br />

Cell to introduce new<br />

piecewise-constant control<br />

variables<br />

Cell to introduce the duration of new<br />

intervals<br />

Figure 6.2: Controls tab of Performed Experiment Entity<br />

54


6.4 Specifying measured data<br />

55<br />

Specifying measured data<br />

All the measured experimental data can be recorded in the Measured data tab (see Figure 6.3). Double clicking on<br />

the New cell in the first row allows user to define new Variable name that will appear on the head row. The user can<br />

then enter the corresponding Time and value for the measured Variable.<br />

The user also has the option to choose the desired variance model for the measured variable by double clicking on<br />

the Variance model row. After selecting the desired Variance model in the drop-down list, the user needs to fill in the<br />

statistical variance model parameters (initial guesses and bounds or fixed values). 20 Please note that the measured<br />

values of different variables do not need to be synchronised, empty cells will become green.<br />

Statistical<br />

variance model<br />

Statistical variance model set in<br />

the Estimation entity<br />

Complete variable pathname<br />

Cell to introduce new measured<br />

variables<br />

Figure 6.3: Measured data tab of Performed Experiment Entity<br />

20 Refer to our Advanced User Guide for the definition of the statistical variance model.


Chapter 7 - Activity execution


Activity execution<br />

7.1 Cross-reference check<br />

Before attempting to execute an activity <strong>gPROMS</strong> checks that all Entities referenced from other Entities are either<br />

present in the current Project or from a cross referenced Project (see Section 2.3.2). <strong>gPROMS</strong> will notify you if you<br />

have made a mistake and a referenced Entity cannot be located, for example, by referring to a Model that does not<br />

exist within a Process. An example of this is shown in Figure 7.1.<br />

Figure 7.1 Automatic cross-reference checking using <strong>gPROMS</strong><br />

58


7.2 Cases<br />

59<br />

Cases<br />

A Case is a combined record of all the input information that defines a Model-based activity and the results<br />

generated by the execution of this activity, as well as any diagnostic messages that may have been issued during its<br />

execution. The intention is that a Case may serve as a permanent record of a particular Model-based activity that<br />

can be archived for future reference, thus providing auditability and traceability of Model-based decisions.<br />

7.2.1 The Case configuration and execution control dialog<br />

A Case is created automatically by <strong>ModelBuilder</strong> at the start of the execution of any Model-based activity. An<br />

execution control dialog (see Figure 7.2) is presented to allow the user to configure various aspects of the Case<br />

including the following:<br />

The name of the Case<br />

Figure 7.2 The execution control dialog<br />

Default name for<br />

Case<br />

<strong>ModelBuilder</strong> creates a default name for the Case. This comprises the name of the Process Entity that is<br />

involved in this Model-based activity followed by the date and the time, the three parts being separated by<br />

underscore characters. The user may overwrite this name by editing the corresponding field in the Case dialog.


Activity execution<br />

The contents of the Case<br />

o a copy of each and every Entity that has been used for defining this Model-based activity, including<br />

any Entities that reside in cross-referenced Projects (e.g. libraries, see Section 2.3.2)<br />

o a complete definition of the activity in the <strong>gPROMS</strong> language; this contains the above Entities in the<br />

correct reference order; the first line of each Entity is annotated with a comment naming the<br />

Project from which the Entity was obtained;<br />

o the results generated by the execution of the activity (see Section 7.4)<br />

The user may specify that one or more of the items above may be omitted from the Case by un-checking the<br />

corresponding check boxes.<br />

In addition to supporting the configuration of a Case, the Case dialog provides the user with some control over the<br />

execution of the Model-based activity, including:<br />

the amount of output information to be generated during execution 21<br />

.<br />

whether the licence required by the Model-based activity should be retained at the end of the execution<br />

(Release model after execution) 22 ;<br />

whether any Entities that are used by the activity and which are modified by its execution should<br />

automatically be updated at the end of the execution 23 .<br />

Finally, the execution control dialog provides a Cancel button that allows the user not to go ahead with the execution<br />

of the Model-based activity. On the other hand, pressing the OK button instructs the <strong>ModelBuilder</strong> to proceed with<br />

the execution.<br />

7.2.2 Management of Cases<br />

Once the user presses the OK button in the execution control dialog, <strong>ModelBuilder</strong> creates the Case. Just like a<br />

Project, a Case appears as a sub-tree of <strong>ModelBuilder</strong>'s navigation tree (see Figure 7.3). However, unlike most<br />

Projects (also see Section 2.3.4), all entries in a Case are read-only, and this is indicated by a lock symbol<br />

annotating each entry in the Case sub-tree.<br />

Cases may be saved to disk using standard Save and “Save as…” mechanisms from <strong>ModelBuilder</strong>'s Project menu.<br />

The files used for their permanent storage have the .gCS suffix and are marked as read only. Cases may also be<br />

closed (with or without saving) at any time, and also be opened at a later stage using standard Project-management<br />

mechanisms.<br />

21<br />

This output does not include any output generated by the <strong>gPROMS</strong> numerical solvers. This can be controlled<br />

separately using the PROCESS Entity's SOLUTIONPARAMETERs.<br />

22<br />

Retaining the licence allows some interaction with the Model at the end of the execution, see section 7.3. The<br />

licence can always be released manually at any time.<br />

23 This is particularly useful for <strong>gPROMS</strong> saved variable sets that may be used to provide initial guesses for the<br />

initialisation of the activity, and which are subsequently over-written by values obtained as a result of the execution<br />

of the activity.<br />

60


“Ribbon” symbol<br />

indicates that<br />

license is<br />

currently in use<br />

Case sub-tree<br />

“Lock” symbol<br />

indicates read-only<br />

Entities in Case<br />

Execution<br />

diagnostics<br />

output<br />

Figure 7.3 Cases and activity execution<br />

7.2.3 Default Case configuration and activity execution Preferences<br />

61<br />

Menu for<br />

interacting with<br />

executing activity<br />

Cases<br />

The default choices for the entries in the execution control dialog (see section 7.2.1) can be specified as part of the<br />

user's <strong>ModelBuilder</strong> Preferences.<br />

Highlighting the Activity execution entry in the Preferences dialog shows the window illustrated in Figure 7.4. An<br />

important aspect of this window is the check-box marked “Delete previous Case(s) from same Process”: during<br />

Model development, one typically executes the same Model-based activity (based on the same Process Entity) time<br />

and time again. In such situations, it is usually both unnecessary and undesirable for <strong>ModelBuilder</strong> to keep the Case<br />

corresponding to each and every execution. By enabling this check-box, the user instructs <strong>ModelBuilder</strong> to retain<br />

only one Case arising from any particular Process Entity.<br />

Further configuration options can be accessed by highlighting the “Case content defaults” entry in the <strong>ModelBuilder</strong><br />

Preferences dialog.


Activity execution<br />

Option to delete previous Cases<br />

from same Process entity<br />

Figure 7.4 <strong>ModelBuilder</strong> preference dialogs relating to Case management and activity execution<br />

62


7.3 Interacting with executing Model-based activities<br />

63<br />

Interacting with executing Model-based activities<br />

The execution of an activity is initiated by the user pressing the “OK” button on the execution control dialog. At this<br />

point, as has already been mentioned in section 7.2.2, the <strong>ModelBuilder</strong> creates the Case. It also requests and<br />

obtains the licence necessary for execution; this licence is associated with the Case until it is released either<br />

automatically at the end of the execution or manually at a later stage if the user has disabled this automatic licence<br />

release mechanism (see section 7.2.1). The fact that the Case is holding (“tying down”) a licence is indicated by a<br />

“ribbon” symbol attached to the Case's name in the <strong>ModelBuilder</strong>'s navigation tree (see Figure 7.3). The symbol<br />

automatically disappears as soon as the licence is released.<br />

7.3.1 Execution output<br />

Once the necessary licence is obtained, <strong>ModelBuilder</strong> also creates an execution output window which displays all<br />

the messages relating to the solution of the Model-based activity. During this execution, the user can interact with<br />

the executing activity by right clicking on this window, which causes the execution interaction menu to appear; this<br />

is also shown in Figure 7.3. While the execution is actually proceeding, the menu has two main options that are<br />

enabled:<br />

The “stop execution, release model” option stops the execution at the earliest convenient stage and<br />

releases the licence. No further interaction with this Model-based activity is possible.<br />

The “stop execution, keep model” option also stops the execution at the earliest convenient stage.<br />

However, the licence is retained, and this allows the user to interact further with the executing activity via<br />

additional options in the execution interaction menu that become enabled at this stage, including:<br />

o “Release licence” releases the licence and essentially aborts the activity execution; no further<br />

interaction is possible with it.<br />

o “Query variable” allows the examination of the information available on a particular variable<br />

specified by its number as this is reported during the numerical solution;<br />

o “Query equation” allows the examination of the information available on a particular equation<br />

specified by its number as this is reported during the numerical solution;<br />

o “Query block” allows the examination of the information available on a particular block specified by<br />

its number as this is reported during the numerical solution. This option is only available when<br />

BDNLSOL is used as the non-linear solver and the block reported corresponds to the block in last<br />

initialisation/re-initialisation of the activity before it is stopped;<br />

o “Query unit” allows the examination of the information available on a particular UNIT specified by its<br />

complete pathname;<br />

o “Create Model report” creates a report on all parameters, variables and equations in the Model and<br />

incorporates this under the “Results” category of the current Case for later inspection or archiving;<br />

o “Create saved variable set” creates a <strong>gPROMS</strong> saved variable set using the current values of all<br />

variables; it then incorporates this under the “Results” category of the current Case.<br />

All the options listed above available after “stop execution, keep model” can also be performed once the activity has<br />

stopped automatically (whether it has failed or completed successfully) if the “Release model after execution” option<br />

was not selected in the case configuration dialog at the start of the activity.<br />

It is worth noting that (when in multiple windows mode) closing the execution output window by clicking on the X<br />

button at its top right corner does not cause the activity execution to be aborted or interrupted. In fact, the activity<br />

proceeds as before and all messages issued by it continue to be recorded within the Case. The execution output<br />

window can be made to re-appear at any time simply by double-clicking on the “Execution Output” entry in the Case<br />

sub-tree.


Activity execution<br />

7.3.2 Diagnostics console<br />

The diagnostics console provides an alternative window for interacting with the model, see Figure 7.5. It displays<br />

the same information as the execution output during the simulation and can be interacted with in the same way by<br />

right clicking on the window. The diagnostics console provides a convenient way of interacting with the model whilst<br />

still being able to view the execution output in a separate window. It also provides a number of shortcuts for<br />

performing the various interactions with the models.<br />

As well right clicking on the window interactions can be performed using:<br />

buttons at the bottom of the diagnostics console. The buttons available for interaction are:<br />

o “qv” – query variable;<br />

o “qe” – query equation;<br />

o “qb” – query block;<br />

o “qu” – query unit;<br />

o “wr” – create model report;<br />

o “sa” – create saved variable set.<br />

commands in the command line at the bottom of the diagnostics console. The commands available are:<br />

o help []<br />

o write [-v|--verbose] [-e|--edit] []<br />

o save [-i] [-a] [-s] [-e|--edit] []<br />

o qv <br />

o qe <br />

o qb [-b|--brief] <br />

o qu <br />

o release – to release the licence.<br />

Diagnostics buttons<br />

Figure 7.5 Diagnostics console<br />

64<br />

Execution output<br />

Diagnostics console<br />

Diagnostics<br />

command line


7.4 Activity Results<br />

65<br />

Activity Results<br />

All the results and any files (e.g. Saved Variable Sets) created during an activity run in the <strong>gPROMS</strong> environment are<br />

stored in the Case.<br />

7.4.1 Simulation activities<br />

<strong>gPROMS</strong> <strong>ModelBuilder</strong> stores the results of a simulation activity in the Case 24 . The results can be viewed in a tabular<br />

form on a single Variable basis (Figure 7.6). To access the results for a particular Variable:<br />

Expand the “Results” entity group<br />

Expand the “Simulation trajectory” entity group<br />

Expand the desired Unit tree, and<br />

Open the desired Variable by double-clicking it.<br />

Simulation results<br />

included in the Case<br />

Figure 7.6 Simulation results<br />

Note that this capability is complementary to the other <strong>gPROMS</strong> output channels. These include gRMS (<strong>gPROMS</strong><br />

Result Manager System) 25 and the <strong>gPROMS</strong> Excel Output Channel which provide additional ways of viewing the<br />

results of a Simulation activity.<br />

24 If enabled from the Execution Control dialog (Section 7.2.1)<br />

25<br />

Sending results to gRMS can also be configured from the Execution Control dialog (Section 7.2.1).


Activity execution<br />

7.4.1.1 Exporting the results<br />

The data for a single Variable can be exported as single Variable to a .cvs file - which can be opened for example by<br />

Microsoft Excel and Microsoft Word. To do this, right-click on the results table for a Variable to activate the<br />

Results shortcut menu and select “Export table”. Alternatively, the table data can be copied to the “clipboard” to be<br />

pasted into another application: to do this, select “Copy table to clipboard” from the Results shortcut menu.<br />

The complete results set for a simulation can be exported to a .gRMS file to be read by gRMS. To do this select the<br />

Simulation Trajectory entity group and select “Export”.<br />

7.4.2 Optimisation activities<br />

The execution of an optimisation run will generate four files in the Results folder of the Case:<br />

PPP<br />

PPP.out<br />

PPP.SCHEDULE<br />

PPP.point<br />

where PPP is the name of the optimisation entity that has been executed to produce these results.<br />

7.4.2.1 The comprehensive optimisation report file<br />

Double-clicking on the report entry, PPP, in the Case tree causes a report window to appear in the main window,<br />

see Figure 7.7. The report, presented in HTML format, includes:<br />

a table of contents that allows quick access to the information listed below via “hyperlinks”;<br />

general information such as the date and time of the execution of the activity, its final status and the value<br />

of the objective function;<br />

information on the various optimisation decision variables (time horizon, control interval durations, and timeinvariant<br />

and time-varying controls), including the values of:<br />

o the initial guess used,<br />

o the final value obtained,<br />

o the lower and upper bounds,<br />

o the Lagrange multipliers corresponding to the above bounds.<br />

All active bounds are automatically highlighted.<br />

66


Optimisation report in Case<br />

7.4.2.2 The optimisation report file<br />

Optimisation entity executed<br />

Figure 7.7 Comprehensive optimisation report<br />

The PPP.out file contains a summary report on the optimisation run in a simple text format, including:<br />

67<br />

Activity Results<br />

the outcome of the optimisation run;<br />

the final value of the objective function;<br />

the final value of the time horizon and the lengths of the time intervals;<br />

the final values of the time-invariant parameters, and the control-variable profiles; the latter are specified in<br />

terms of a single value per interval for piecewise-constant controls, and a pair of values for piecewise-linear<br />

controls (as usual, corresponding to the value of the control at the start and end of each interval); and<br />

the values of variables on which end-point and/or interior-point constraints where specified, at the<br />

corresponding final and/or interior points.<br />

The file also contains computational statistics on the performance of the numerical method.<br />

7.4.2.3 The Schedule file<br />

The PPP.SCHEDULE presents the most recent optimisation solution point in the form of a <strong>gPROMS</strong> Schedule.<br />

The Schedule file can be used to reproduce the detailed results of the optimisation by carrying out a Simulation<br />

activity within <strong>gPROMS</strong>. This provides you access to the full facilities of the <strong>gPROMS</strong> Results Management System<br />

(gRMS). In order to do this:


Activity execution<br />

Paste the contents of the Schedule file except for the final END statement into the relevant Process entity<br />

of your <strong>gPROMS</strong> project.<br />

Also, paste the lines that appear inside the first RESET statement in the SCHEDULE into the ASSIGN section<br />

of the Process entity.<br />

Note: the contents of the Schedule file do not necessarily represent an optimal or even a feasible solution to the<br />

problem: if the optimisation run is interrupted by the user, or ends without finding a satisfactory solution, the file will<br />

simply show the point last considered by <strong>gPROMS</strong>. Only if a comment at the top of the file states the following:<br />

Final Optimisation Status : Optimal Solution Found<br />

should the results be relied upon as a (locally) optimal solution.<br />

7.4.2.4 The point file<br />

The PPP.point file is generated at every iteration of the optimisation calculation. It contains the same information as<br />

the Schedule file, but in the format of an Optimisation entity (except that constraints are not reproduced). This is<br />

useful if there is a need to restart an optimisation after a system crash or other catastrophic event, or, following a<br />

successful solution, to provide a good `initial guess' for a slightly altered optimisation problem.<br />

7.4.3 Parameter Estimation activities<br />

The execution of a parameter estimation run will generate four files in the Results sub-directory of the Case:<br />

PPP<br />

PPP.out<br />

PPP.stat<br />

PPP.stat-mr<br />

where PPP is the name of the parameter estimation entity that has been executed to produce these results above.<br />

7.4.3.1 The comprehensive estimation report file<br />

Double-clicking on the comprehensive report entry in the Case tree, PPP, causes a report window to appear. The<br />

comprehensive report, presented in HTML format, includes:<br />

a table of contents that allows quick access to the information listed below via “hyperlinks”;<br />

general information such as the date and time of the execution of the activity, and its final status;<br />

a detailed breakdown of the value of the likelihood function in terms of the constant, variance and residual<br />

terms of each measured variable in each experiment;<br />

the initial guesses and final (optimal) values of all Model parameters being estimated, together with the<br />

corresponding lower and upper bounds, the 90%, 95% and 99% confidence intervals, the 95% t-value and<br />

the standard deviation;<br />

the same information as above for any parameters describing the variance behaviour of the various<br />

sensors used for the measurements; these parameters will also have been estimated;<br />

a detailed analysis of each experiment, including the experimental controls and initial conditions, and the<br />

measured and estimated values of each measured point, as well as the corresponding difference<br />

(“residual”);<br />

the variance/covariance matrix;<br />

the correlation matrix;<br />

a goodness-of-fit analysis based on the 95% 2 criterion.<br />

Figure 7.8 shows an example of a comprehensive report.<br />

68


Parameter estimation<br />

report in Case<br />

7.4.3.2 The estimation report file<br />

Parameter estimation<br />

entity entity entity entity executed<br />

Figure 7.8 Parameter estimation comprehensive report<br />

The PPP.out file contains a summary report on the optimisation run, including:<br />

the outcome of the estimation run;<br />

the final value of the objective function; and<br />

the final values of the estimated parameters.<br />

The file also contains computational statistics on the performance of the numerical method.<br />

7.4.3.3 The estimation statistics file<br />

The PPP.stat file contains a report on the statistical validity of, and other indicators on the final results of the<br />

parameter estimation. Specifically, it contains the following information:<br />

69<br />

Activity Results


Activity execution<br />

The variance Model used for each estimated parameter (measured variable) in each experiment, and<br />

information on the parameters of the variance Model. If these variance Model parameters were determined<br />

by the optimisation, PPP.stat lists the final values, initial guess, lower and upper bounds. Otherwise, the<br />

fixed values specified by the user are listed.<br />

Tables comparing each measurement from each experiment with the predicted values from the Process<br />

Model, together with:<br />

o the absolute deviation,<br />

o the relative deviation,<br />

o the standard deviation,<br />

o the scaled residual,<br />

The total contribution of each measured variable in each experiment to the objective function. This can help<br />

the user to identify experiments and/or measurements that give large contributions to the objective<br />

function and so are potentially inaccurate.<br />

A breakdown of the contributions to the objective function of:<br />

the variance terms,<br />

the residual terms,<br />

7.4.3.4 The machine-readable estimation statistics file<br />

The PPP.stat-mr file contains all the information that appears in the PPP.stat file but in machine-readable form. This<br />

is designed to be used with the advanced statistical analysis tool (see the <strong>gPROMS</strong> Advanced User Guide for further<br />

details). Note that to use the file with the statistical analysis tool you first need to export it from <strong>ModelBuilder</strong> as<br />

described in Section 8.6.<br />

70


Chapter 8 - Modelling Support Tools


Modelling Support Tools<br />

8.1 Introduction<br />

<strong>gPROMS</strong> <strong>ModelBuilder</strong> provides a set of powerful tools to support the user in developing and maintaining complex<br />

models. These are accessed from the “Tools” menu. These include productivity tools that allow the user to perform<br />

search and replace operations on the whole project tree and a comparison tool. The variable browser provides a<br />

convenient view of the different variables in a particular Process. Files can be imported into or linked too<br />

<strong>ModelBuilder</strong> and various export operations from <strong>ModelBuilder</strong> can be performed.<br />

This chapter describes the different tools available in more detail.<br />

72


8.2 Global “Search-and-replace”<br />

73<br />

Global “Search-and-replace”<br />

The search-and-replace tool can be used to search for a text string within selected Entities or Projects, and<br />

optionally to replace it with another string. The tool can be accessed via <strong>ModelBuilder</strong>'s Tools menu and appears as<br />

a separate window, normally located at the bottom of the main <strong>ModelBuilder</strong> window (see Figure 8.1). The user has<br />

to specify a string to be searched for, and optionally a replacement string. The search can take place over all<br />

Projects that are currently open in <strong>ModelBuilder</strong>, or be limited to one or more Entities selected by left-clicking 26<br />

on<br />

their names in <strong>ModelBuilder</strong>'s navigation tree. Various other aspects of the scope of the search 27 can be specified<br />

by enabling or disabling the check-boxes provided.<br />

Navigation<br />

buttons<br />

String<br />

occurrence tree<br />

Entity editor pops up automatically by<br />

clicking on entry in occurrence tree<br />

Replacement<br />

string<br />

Search-and-replace<br />

window<br />

Figure 8.1 The search and replace tool<br />

Scope of search<br />

to be performed<br />

Original string<br />

to search for<br />

Clicking on the “Search” button causes the search results to appear in the form of an occurrence tree, organised by<br />

Project, Entity group and Entity, in the left part of the search-and-replace window.<br />

Clicking on the “Search and Replace” button has a similar result, with the additional effect that all occurrences of the<br />

search string are changed to the specified replacement string. A replacement may be applied selectively by<br />

selecting one or more entries in the occurrence tree and clicking on the “Replace in selected occurrences” button.<br />

In this case, the selection moves on automatically to the next occurrence. This allows the replacement to be applied<br />

one-at-a-time in a controlled fashion.<br />

The navigation buttons situated on the left-hand side (Figure 8.1) help the user to manage the search results. These<br />

include:<br />

26 Standard Shift-left Click and Ctrl-left Click mechanisms can be used to select multiple Entities.<br />

27 e.g. whether the string should be an entire word or a sub-string within another word.


Modelling Support Tools<br />

Expand all nodes in the search tree<br />

Collapse the search tree<br />

Select the next match<br />

Select the previous match<br />

Delete selected nodes from the search tree<br />

Select all visible replaceable matches in the search tree<br />

Double-clicking on any Entity name in the occurrence tree will cause the corresponding Entity editor to be displayed<br />

in the main <strong>ModelBuilder</strong> window. Double-clicking on a particular occurrence will have a similar effect, with the<br />

cursor located at the precise position within the Entity editor.<br />

The effects of any “replace” actions affected by <strong>ModelBuilder</strong> on a particular Entity can be reversed by opening the<br />

relevant Entity and pressing “undo" (Ctrl + Z) a sufficient number of times.<br />

74


8.3 Project and entity “Compare”<br />

75<br />

Project and entity “Compare”<br />

<strong>gPROMS</strong> <strong>ModelBuilder</strong> provides a comparison tool that can be used to compare any two selected Entities or<br />

Projects. The tool can be accessed via <strong>ModelBuilder</strong>'s Tools menu, provided two comparable entries (e.g. Entities<br />

or Projects or Entity groups) have been selected in <strong>ModelBuilder</strong>'s main navigation tree (see Figure 8.2).<br />

8.3.1 Entity comparison<br />

When two Entities are compared, a comparison window will pop-up highlighting the differences between them (e.g.<br />

any lines that are different in the two Entities, or which have been added or deleted); this is also illustrated in Figure<br />

8.2. The colours used for the highlighting can be configured as part of the user's <strong>ModelBuilder</strong> Preferences by<br />

highlighting the “Text comparison” entry in the Preferences dialog (see section 9.2).<br />

8.3.2 Project comparison<br />

The comparison tool may also be applied to two entire Projects. In this case, the results of the comparison will<br />

appear in a separate window, normally located at the bottom of the main <strong>ModelBuilder</strong> window (see Figure 8.3). In<br />

general, all Entities which occur in one of the two Projects but not in the other, or which occur in both Projects but<br />

in different <strong>version</strong>s, are presented in a comparison tree form in the left part of the comparison window.<br />

Different colours are used to denote various types of difference (e.g. addition, deletion, modification) in the<br />

comparison tree. These colours can be configured as part of the user's <strong>ModelBuilder</strong> Preferences by highlighting<br />

the “Group comparison” entry in the Preferences dialog (see section 9.2) 28<br />

.<br />

28 The content of the comparison tree can be controlled via the check-boxes provided in the right part of the<br />

comparison window.


Modelling Support Tools<br />

Lines<br />

modified<br />

Projects Entities to to be<br />

be<br />

compared<br />

compared<br />

Clicking on added or<br />

deleted<br />

Entity entity entry entry launches<br />

launches<br />

Entity entity editor<br />

editor<br />

Entities to be<br />

compared<br />

76<br />

Entity<br />

comparison<br />

Lines added<br />

or deleted<br />

Figure 8.2 Comparison of two Entities<br />

Clicking Clicking on on modified modified Entity Entity entry<br />

entry<br />

launches launches Entity Entity comparison comparison window<br />

window<br />

Comparison<br />

window<br />

Figure 8.3 Comparison of two Projects<br />

Click here to repeat<br />

comparison


77<br />

Project and entity “Compare”<br />

Double clicking on an entry in the comparison tree corresponding to a deleted or added Entity will cause the<br />

corresponding Entity editor to pop up in the main <strong>ModelBuilder</strong> window. Double clicking on an entry corresponding<br />

to a modified Entity causes the Entity comparison window to appear (see section 8.3.1).<br />

The comparison tool may also be used to compare two Cases or a Case and a Project. This is particularly useful<br />

when attempting to compare a current model with one that was used in the past to produce certain archived<br />

results.<br />

8.3.3 Entity group comparison<br />

The comparison tool may also be used to compare corresponding groups of Entities (e.g. all Model Entities)<br />

residing in two different Projects. The behaviour of the comparison tool in group comparison mode is identical to<br />

that in the Project comparison mode described above.


Modelling Support Tools<br />

8.4 “Import files”<br />

In addition to text files containing <strong>gPROMS</strong> language descriptions of various Entities 29 as well as other plain text<br />

files, <strong>ModelBuilder</strong> allows the importation into a Project of non-text (binary) files. These are held within the current<br />

Project under the “Miscellaneous files” category.<br />

This useful capability allows any type of file that is necessary for the correct operation of a Project (e.g. a MS Excel<br />

spreadsheet used in conjunction with <strong>gPROMS</strong>’ Excel Foreign Object/Foreign Process 30<br />

) to be incorporated within<br />

the Project, thus making the latter completely self-contained in this respect.<br />

Double-clicking on a binary miscellaneous file brings up a Properties dialog similar to the Properties tab of the<br />

standard Entity editors (see Section 2.2.1). A useful feature of this dialog is the “Export filename” property. This<br />

allows the user to specify the export filename as well as the sub-directory of the <strong>gPROMS</strong> execution into which this<br />

external binary file should be copied during execution of any <strong>gPROMS</strong> model-based activity. For example, consider a<br />

<strong>gPROMS</strong> model making use of a MS Excel Foreign Object described by the MS Excel file crystalliser.xls. Suppose,<br />

further, that the PROCESS Entity describing a simulation activity SETs the value of this Foreign Object as<br />

“ExcelForeignObjects\crystalliser.xls”. In this case, the export filename for this binary file should be set to<br />

“ExcelForeignObjects\crystalliser.xls” (see Figure 8.4).<br />

29 i.e. .<strong>gPROMS</strong>, .gOPT, .gEST, .RUN and .gSTORE files compatible with <strong>gPROMS</strong> v1.x.<br />

30 see the <strong>gPROMS</strong> Advanced User Guide.<br />

78


8.5 “Create links to external files”<br />

79<br />

“Create links to external files”<br />

It may sometimes be impractical and/or undesirable to import all files needed for the execution of a Project's<br />

model-based activities within the Project (see section 8.4). This is likely to be the case, for example, when such files<br />

are very large or when they are shared files that may need to be updated centrally from time to time. On the other<br />

hand, it may still be desirable to inform the Project explicitly of the association with these files and the need for<br />

copies of them to be present in certain sub-directories during execution.<br />

The above requirements can be addressed by establishing a link to the external file without physically importing it<br />

into the Project. <strong>ModelBuilder</strong> supports this activity via the “Create links to external files” tool provided under the<br />

Tools menu. The links established using this tool are displayed under the Project's Miscellaneous Files category (see<br />

Figure 8.5).<br />

Binary file imported<br />

into Project<br />

Filename and sub-directory to receive<br />

binary file during activity execution<br />

Figure 8.4 Binary files imported in Project


Modelling Support Tools<br />

Link to<br />

external file<br />

Figure 8.5 Link to external files<br />

80


8.6 “Export”<br />

81<br />

“Export”<br />

<strong>ModelBuilder</strong> allows the contents of a Project or an Entity to be exported as a plain text file containing the<br />

corresponding <strong>gPROMS</strong> language description. This type of operation, which is useful for exporting models for use<br />

with <strong>gPROMS</strong>-based applications (e.g. gO:Matlab), can be performed using the “Export” tool provided under the<br />

Tools menu (see Figure 8.6).<br />

Entity to be<br />

exported<br />

Exported file to<br />

be encrypted<br />

8.6.1 Export Entity with dependencies<br />

Figure 8.6 The export tool<br />

Include crossreferenced<br />

Entities<br />

Password needed<br />

to run model<br />

Password needed<br />

to decode model<br />

When exporting an individual Entity, the user may request that all other Entities on which it depends (via crossreferencing)<br />

should be exported with it.<br />

This is achieved automatically by <strong>ModelBuilder</strong> irrespective of whether these Entities reside in the same Project as<br />

the Entity being exported, or in other Projects being cross-referenced by the current Project (see Section 2.3.2).<br />

The <strong>gPROMS</strong> language representation of each Entity in the export file is annotated with a comment stating the<br />

Project from which this Entity was extracted.<br />

8.6.2 Encryption<br />

The user can also request that the exported text file is encrypted. The encryption is performed using standard<br />

<strong>gPROMS</strong> file encryption facilities and makes use of a pair of passwords supplied by the user. The first password<br />

must be supplied for the use of the exported file within any <strong>gPROMS</strong>-based application. The second password is<br />

needed to decode the file and have access to its contents 31 .If this password is given then the encrypted file can be<br />

31 Leaving the second password blank in the export dialog will ensure that the exported file cannot be decoded.


Modelling Support Tools<br />

opened in <strong>ModelBuilder</strong>. To open an encrypted file, use the normal open file methods (File>Open, the open tool bar<br />

button, etc) and change the Files of type field in the open dialog to “Encrypted <strong>gPROMS</strong> input files (*.gENCRYPT)”.<br />

Browse for and select the encrypted file to be opened and select open. A dialog then appears asking for the<br />

encryption and decryption passwords to be specified, Figure 8.7.<br />

Figure 8.7 Open encrypted file dialog<br />

82


8.7 “Export to <strong>ModelBuilder</strong> v2.2 Project”<br />

83<br />

“Export to <strong>ModelBuilder</strong> v2.2 Project”<br />

<strong>ModelBuilder</strong> v2.3 uses a different file format for storing its projects to that used by previous <strong>version</strong>s of<br />

<strong>ModelBuilder</strong>. In the interests of forward compatibility, <strong>ModelBuilder</strong> v2.3 projects may be exported in v2.2 format<br />

using the “Export to <strong>ModelBuilder</strong> v2.2 Project” tool in the Tools menu. Note that, not all <strong>gPROMS</strong> v2.3 concepts<br />

are recognised by earlier <strong>version</strong>s of <strong>gPROMS</strong> <strong>ModelBuilder</strong> (for example icons, ports).


Modelling Support Tools<br />

8.8 “Export to Simulink”<br />

<strong>ModelBuilder</strong> can export <strong>gPROMS</strong> models to be used as Simulink ®32 blocks, see gOSimulink User Guide for<br />

information on how to use the exported model.<br />

To export a <strong>gPROMS</strong> model as a gOSimulink block, a working Process that uses a flowsheet containing the model<br />

must first be created in <strong>ModelBuilder</strong>. The model that is to become a gOSimulink block (“open loop” model) must<br />

contain ports, and these become the inputs and outputs of the block in Simulink ®<br />

(see Figure 8.8).<br />

„open loop“ model<br />

to be exported<br />

input ports<br />

Other blocks<br />

Figure 8.8 <strong>gPROMS</strong> Model with Ports<br />

84<br />

output ports<br />

A gSTORE file is needed to provide good initial guesses for the model and must be present in the project. Once the<br />

desired working Process is created the following steps should be followed to export it to gOSimulink:<br />

Highlight the Process,<br />

Select “Tools” from the menu bar,<br />

Select “Export to Simulink…”.<br />

This will pop-up a dialog box with various options to configure the exported files (Figure 8.9).<br />

32 Simulink is provided by Mathworks Inc.


Figure 8.9 Export to Simulink dialog<br />

The fields in this dialog box are described in more detail in Table 1<br />

Export Directory The directory in which the files exported will be located in<br />

85<br />

“Export to Simulink”<br />

Dictionary directory The directory in which dictionary files are located for models in <strong>gPROMS</strong> that<br />

can be replaced by standard Simulink ®<br />

models<br />

Simulink model (mdl) file The name of the Simulink ® file to be created<br />

<strong>gPROMS</strong> based Simulink block The unit in the Process that is to be the gOSimulink block<br />

Use assignments from saved<br />

variable set<br />

This selects the gSTORE file from which the values for the input and output<br />

ports are taken from to allow the open model to be run<br />

Overwrite Simulink model (mdl) file The export will write over the existing mdl file of the same name if it already<br />

exists<br />

Include generated open loop process<br />

and model in the current project<br />

A model and corresponding process to run it will be created in the project<br />

file that consists of just the <strong>gPROMS</strong> unit that was exported as the<br />

gOSimulink block (open model)<br />

Encryption password <strong>ModelBuilder</strong> creates an encrypted file during the export which is then used<br />

by gOSimulink. The encrypted file needs a password to allow it to be run<br />

Decryption password The encrypted file can be decrypted so that it can be viewed<br />

Table 1 Fields in Export to Simulink Dialog


Modelling Support Tools<br />

8.9 “Browse variables”<br />

Although all the information of the Variables can be obtained from various Entities within a Project, the Variable<br />

browser tool can display the preset values of State and Algebraic variables 33 , the actual value for Assigned variables<br />

and other information on the Process Variables in a dialog window (see Figure 8.10). This tool can be accessed via<br />

<strong>ModelBuilder</strong>’s Tool menu, provided the Process whose Variables the user wants to browse has been selected in<br />

<strong>ModelBuilder</strong>’s main navigation tree.<br />

Figure 8.10 Variable browse<br />

33<br />

The Preset value for any state or algebraic variable corresponds to the value taken by <strong>gPROMS</strong> as the initial<br />

guess for the specific variable during the initialisation calculation.<br />

86


Chapter 9 - Utilities


Utilities<br />

9.1 Introduction<br />

A range of other features increase the functionality of <strong>gPROMS</strong> <strong>ModelBuilder</strong>. These features include standard<br />

utilities such as printing capabilities and window layouts. Also, <strong>ModelBuilder</strong> has a number of shortcut keys, many of<br />

which are the same as standard shortcut keys plus some <strong>ModelBuilder</strong> specific ones.<br />

This chapter describes the important features that haven’t been mentioned so far.<br />

88


9.2 <strong>ModelBuilder</strong> Preferences<br />

89<br />

<strong>ModelBuilder</strong> Preferences<br />

Many of <strong>ModelBuilder</strong>’s features can be customised by the user. The <strong>ModelBuilder</strong> preferences dialog (see Figure<br />

9.1) is opened from the Edit menu. There are seven preference categories, the main options for each are<br />

highlighted in Table 2.<br />

Figure 9.1 <strong>ModelBuilder</strong> Preference dialog


Utilities<br />

Categories Option<br />

Project Specify the number of recently opened projects to appear at the bottom of the<br />

Project menu;<br />

Specify any projects to be opened on start-up;<br />

Choose whether to make backup projects when saving or not;<br />

Entity editor Specify the general text editor settings, such as font properties, tab size;<br />

Customise the syntax highlighting attributes;<br />

Customise the settings for auto-completion in <strong>gPROMS</strong> language;<br />

View Choose the default setting for the editor mode (single or multiple editors);<br />

Specify the look and feel of <strong>gPROMS</strong> <strong>ModelBuilder</strong>. Three options are available:<br />

Metal, Windows and Motif;<br />

Specify the text size to be displayed in the Project tree;<br />

Comparison Specify the colours used for text and group comparison;<br />

File locations Specify the location for the temporary directory used by <strong>ModelBuilder</strong>. This is the<br />

temporary execution directory used to run model based activities;<br />

Specify the default starting location for the file dialog used for opening and saving<br />

projects;<br />

Specify a search path for any software components used by <strong>gPROMS</strong>, e.g. foreign<br />

objects, foreign processes etc.<br />

Activity execution Specify whether to delete previous Cases from the same processes when<br />

executing an activity;<br />

Configure the look of the execution output window;<br />

Configure the default settings for the contents of a Case;<br />

Flowsheeting Specify the font size to be displayed in the flowsheeting tab;<br />

Table 2: <strong>ModelBuilder</strong> preferences<br />

90


9.3 Text editor short-cut keys<br />

91<br />

Text editor short-cut keys<br />

A number of useful text editor short-cut keys have been defined in <strong>gPROMS</strong> <strong>ModelBuilder</strong>. Most commonly used<br />

short-cuts include: F4 to check syntax and F5 to simulate a PROCESS. This section lists the short-cut keys available<br />

in <strong>ModelBuilder</strong> and the associated action.<br />

'Current line' refers to the line that the cursor/caret is on.<br />

A '+' sign means hold the two keys either side of it down simultaneously. A ',' separates key presses, e.g. Alt +<br />

U, U means press the alt and U keys together, and then press the U key on its own.<br />

9.3.1 Navigation Shortcuts<br />

9.3.1.1 Shortcuts with standard navigation keys<br />

Keyboard shortcut With no selected text With selected text<br />

RIGHT<br />

LEFT<br />

Move the insertion point one character to<br />

the right.<br />

Move the insertion point one character to<br />

the left.<br />

DOWN Move the insertion point to the next line.<br />

UP<br />

SHIFT+RIGHT<br />

SHIFT+LEFT<br />

SHIFT+DOWN<br />

SHIFT+UP<br />

CTRL+RIGHT<br />

CTRL+LEFT<br />

CTRL+SHIFT+RIGHT<br />

CTRL+SHIFT+LEFT<br />

Move the insertion point to the previous<br />

line.<br />

Select the character to the right of the<br />

insertion point.<br />

Select the character to the left of the<br />

insertion point.<br />

Create a text selection and extend it to<br />

the next line.<br />

Create a text selection and extend it to<br />

the previous line.<br />

Move the insertion point one word to the<br />

right.<br />

Move the insertion point one word to the<br />

left.<br />

Create a text selection and extend it one<br />

word to the right.<br />

Create a text selection and extend it one<br />

word to the left.<br />

Deselect the text and move the insertion point<br />

one character to the right.<br />

Deselect the text and move the insertion point<br />

one character to the left.<br />

Deselect the text and move the insertion point<br />

to the next line.<br />

Deselect the text and move the insertion point<br />

to the previous line.<br />

Extend the selection one character to the right.<br />

Extend the selection one character to the left.<br />

Extend the selection to the next line.<br />

Extend the selection to the previous line.<br />

Deselect the text and move the insertion point<br />

one word to the right.<br />

Deselect the text and move the insertion point<br />

one word to the left.<br />

Extend the selection one word to the right.<br />

Extend the selection one word to the left.


Utilities<br />

PgDown Move the insertion point one page down.<br />

PgUp Move the insertion point one page up.<br />

SHIFT+ PgDown<br />

SHIFT+PgUp<br />

HOME<br />

END<br />

SHIFT+HOME<br />

SHIFT+END<br />

CTRL+HOME<br />

CTRL+END<br />

CTRL+SHIFT+HOME<br />

CTRL+SHIFT+END<br />

ALT+u , e<br />

Create a text selection and extend it one<br />

page down.<br />

Create a text selection and extend it one<br />

page up.<br />

Move the insertion point to the beginning<br />

of the line.<br />

Move the insertion point to the end of the<br />

line.<br />

Create a text selection and extend it to<br />

the beginning of the line.<br />

Create a text selection and extend it to<br />

the end of the line.<br />

Move the insertion point to the beginning<br />

of the document.<br />

Move the insertion point to the end of the<br />

document.<br />

Create a text selection and extend it to<br />

the beginning of the document.<br />

Create a text selection and extend it to<br />

the end of the document.<br />

Move the insertion point to the end of the<br />

current word.<br />

Table 3<br />

92<br />

Deselect the text and move the insertion point<br />

one page down.<br />

Deselect the text and move the insertion point<br />

one page up.<br />

Extend the selection one page down.<br />

Extend the selection one page up.<br />

Deselect the text and move the insertion point<br />

to the beginning of the line.<br />

Deselect the text and move the insertion point<br />

to the end of the line.<br />

Extend the selection to the beginning of the<br />

line.<br />

Extend the selection to the end of the line.<br />

Deselect the text and move the insertion point<br />

to the beginning of the document.<br />

Deselect the text and move the insertion point<br />

to the end of the document.<br />

Extend the selection to the beginning of the<br />

document.<br />

Extend the selection to the end of the<br />

document.<br />

Move the insertion point to the end of the last<br />

word in the selection.


9.3.1.2 Insertion point/screen position shortcuts<br />

Keyboard<br />

shortcut<br />

93<br />

Action<br />

CTRL+UP Scroll the text one line up while holding the insertion point in the same position.<br />

CTRL+DOWN Scroll the text one line down while holding the insertion point in the same position.<br />

ALT+u , t<br />

ALT+u , m<br />

ALT+u , b<br />

Text editor short-cut keys<br />

Scroll the text up so that the insertion point moves to the top of the window while remaining at<br />

the same point in the text.<br />

Scroll the text so that the insertion point moves to the middle of the window while remaining at<br />

the same point in the text.<br />

Scroll the text down so that the insertion point moves to the bottom of the window while<br />

remaining at the same point in the text.<br />

SHIFT+ALT+t Move the insertion point to the top of the window.<br />

SHIFT+ALT+m Move the insertion point to the middle of the window.<br />

SHIFT+ALT+b Move the insertion point to the bottom of the window.<br />

9.3.1.3 Jump list shortcuts<br />

Keyboard shortcut Action<br />

Table 4<br />

ALT+k Go to previous entry in the jump list.<br />

ALT+l Go to next entry in the jump list.<br />

SHIFT+ALT+k Go to the previous jump list entry not in the same file.<br />

SHIFT+ALT+l Go to the next jump list entry not in the same file.<br />

9.3.1.4 Miscellaneous navigation shortcuts<br />

Keyboard shortcut Action<br />

F2 Go to next bookmark.<br />

CTRL+F2 Toggle bookmark.<br />

CTRL+[ Find matching bracket.<br />

Table 5<br />

CTRL+SHIFT+[ Select block between current bracket and matching one.<br />

Table 6


Utilities<br />

9.3.1.5 Find shortcuts<br />

Keyboard<br />

shortcut<br />

CTRL+f Show Find dialog.<br />

F3 Search for the next occurrence.<br />

SHIFT+F3 Search for the previous occurrence.<br />

CTRL+F3<br />

With no selected text With selected text<br />

Search for the next occurrence of the word that<br />

the insertion point is on.<br />

ALT+SHIFT+h Switch highlight search on or off.<br />

CTRL+g Show Goto Line dialog.<br />

9.3.2 Edit shortcuts<br />

9.3.2.1 Edit shortcuts<br />

Keyboard<br />

shortcut<br />

Table 7<br />

94<br />

Action<br />

INSERT Switch between insert mode and overwrite mode.<br />

CTRL+a Select all.<br />

CTRL+z Undo the previous command.<br />

CTRL+y Redo the undone command.<br />

CTRL+x Delete the selected text from the file and copy it the clipboard.<br />

SHIFT+DELETE Delete the selected text from the file and copy it the clipboard.<br />

CTRL+c Copy the selected text to the clipboard.<br />

CTRL+INSERT Copy the selected text to the clipboard.<br />

CTRL+v Insert the clipboard text into the file.<br />

SHIFT+INSERT Insert the clipboard text into the file.<br />

CTRL+e Remove the current line.<br />

CTRL+u<br />

Show Find dialog and show selected text<br />

as the text to find.<br />

Search for the next occurrence of the<br />

selected text.<br />

Delete text in the following cycle (when using the shortcut successive times): first the text<br />

preceding the insertion point on the same line, then the indentation on the line, then the line<br />

break, then the text on the previous line, and so on.


CTRL+w Remove the current word or the word preceding the insertion point<br />

CTRL+k<br />

CTRL+l<br />

95<br />

Text editor short-cut keys<br />

Word Match - find the previous word that begins like the current word and complete the current<br />

word so that they match<br />

Word Match - find the next word that begins like the current word and complete the current<br />

word so that they match<br />

DELETE Remove character after the insertion point<br />

SHIFT+SPACE Insert space without expanding abbreviation<br />

ALT+j Select the word the insertion point is on or deselect any selected text<br />

9.3.2.2 Indentation shortcuts<br />

Table 8<br />

Keyboard shortcut With no selected text With selected text<br />

TAB Insert tab Shift selection right<br />

SHIFT+TAB Shift selection left<br />

CTRL+t Shift line right Shift selection right<br />

CTRL+d Shift line left Shift selection left<br />

9.3.2.3 Capitalization shortcuts<br />

Keyboard<br />

shortcut<br />

Table 9<br />

With no selected text With selected text<br />

ALT+u , u Make the character after the insertion point uppercase Make the selection uppercase<br />

ALT+u , l Make the character after the insertion point lowercase Make the selection lowercase<br />

ALT+u , r<br />

Reverse the case of the character after the insertion<br />

point<br />

Table 10<br />

Reverse the case of the selected<br />

text


Utilities<br />

9.4 Miscellaneous Utilities<br />

9.4.1 Editing of Saved Variable Sets using external editor software<br />

Right clicking on the selected Saved Variable Sets file and subsequently selecting “Edit using external program…”<br />

will bring up an application chooser window for the user to select the .exe file of the desired editor. The file can then<br />

be modified in the chosen editor and saved again to be used by <strong>gPROMS</strong> (Please note that the user needs to close<br />

the editor application in order to return to <strong>ModelBuilder</strong>.).<br />

9.4.2 Printing<br />

Whole Projects or individual Entities can be printed by choosing the “Print…” option from the Project menu. If a PDF<br />

writer is installed, this facility can also be used to create a .pdf (Portable Document Format) file by choosing the<br />

PDF writer as the printer.<br />

9.4.3 Multiple selection<br />

Many “standard” editing features, e.g. cut, copy, paste, delete etc. all found under the Edit menu are available within<br />

the <strong>gPROMS</strong> <strong>ModelBuilder</strong> environment. Most of these (and other) actions can be applied to multiple Entities and<br />

Projects. Multiple selections are made using Ctrl + Left-click and Shift + Left-click mechanisms applied to the<br />

Project and Entity names in the <strong>ModelBuilder</strong>'s navigation tree.<br />

Similarly, the “Open” action in the Project menu can be applied simultaneously to multiple Projects in the file<br />

selection dialog.<br />

9.4.4 Desktop view<br />

The Window menu gives the user the option of having multiple editors open simultaneously (see Figure 9.2) or only<br />

having a single editor open at a time (see Figure 9.3). In multiple editor mode, the Window menu contains standard<br />

“Cascade”, “Tile Horizontally”, ”Tile Vertically” and “Close All” options.<br />

The default setting for this option can be adjusted in the “<strong>ModelBuilder</strong> Preferences” dialog (see section 9.2) for<br />

details.<br />

96


Figure 9.2 Multiple editor mode<br />

Figure 9.3 Single editor mode<br />

97<br />

Miscellaneous Utilities


Utilities<br />

9.4.5 “Collapse project tree” action<br />

The “Collapse project tree” action (Ctrl + T) is found on <strong>ModelBuilder</strong>'s View menu, allowing the Project tree to be<br />

collapsed to a view showing only the names of the open (Library) Projects and Cases.<br />

98

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!