Library Documentation

This section explains the structure of the library reference manuals and the online help files that typically are available together with the standard model library that you use. It explains the basic of the syntax that is used in the model equations. Throughout this section, these two documents are referred to as library reference documentation.

This section does not provide a complete reference of component model descriptions. It only provides sufficient information, so that you can interpret the information in your library reference documentation. More details about the material presented in this section can be obtained in the IPSEpro-MDK Documentation, and in the documentation of the model library that you use.

General Information

Most model libraries include a library reference manual and an online help file. These two documents are automatically created from the library description. In this way, the library reference documentation is always consistent with all models that are available in a library and the equations that are actually used in the models.

You can access the online help file of the library you work with directly from PSE.

To access the online help file:

help

  1. Select Help  Index
    or
    Click on the Help Index icon from the function bar.

  2. IPSE opens the Windows Help with the index and description of the currently used model library.

The library developer has the option to hide some of the equations from the library user. Typically, this is done in order to remove confusing details from a library documentation. Also, sensible details of the library can be hidden from the users.

Documentation Structure

A library reference contains three major blocks of model classes:

  • units

  • connections

  • globals

Inside each block, the available model classes appear in alphabetical order. Unit model classes can contain different description models.

The Syntax of the Models

The library models are created using a special language, called Model Description Language, or MDL for short. MDL is a comprehensive language, designed for IPSEpro, to describe the mathematical behavior of the models. In this section, we summarize some basic syntactic details of the models’ parameters and equations. This way, it will be easier to understand the models described in the library reference documentation that you have available.

Refer to the IPSEpro-MDK user manual for more details about the model description language MDL. There you will also learn how to use MDL in order to create and modify models of a library.

Notation of Items

All model items appear in the documentation under their names, for example:

mass, power, etc.

Frequently, variables of referenced objects are used in expressions. For instance, consider a model for a pipe which allows to attach two connections: a feed stream at its inlet, and a drain stream at its outlet. For the mass flow of the feed stream of the pipe, in traditional notation you would possibly write:

\(mass_{feed}\)

In MDL notation, the same unit item is called:

feed.mass

The term feed is the local name of the reference and it comes in the first position of the item name.

Comments

Whenever the number character (#) appears in a line, the text following the character up to the end of the line is interpreted as comment:

# This is a comment without influence on the results.

Equations

Simple equations are written in MDL, in the same way as they are written in standard mathematics. However, in MDL a label proceeds each equation. This label is used in messages to identify the equation. The mass balance equation for the pipe looks like this:

 fMassBalance: feed.mass = drain.mass;

In this case fMassBalance is the name of the label for the mass balance line. Each label has to be unique for an individual MDL document.

Conditions in Equations

Equations can also contain conditions. The equation

\(b = \left| a \right|\)

can also be written as:

f1: if (a>=0.0) then
    b = a;
else
    b = -a;
endifl

Conditions can be connected by a logical operator, in the following way:

f1: if (x<y && a>=0.0) then
…
endifl

The following table lists the operators that are used in conditional statements:

Comparison operators (Relational operators)

<

First operand less than second operand

>

First operand greater than second operand

<=

First operand less than or equal to second operand

>=

First operand greater than or equal to second operand

==

First operand equal to second operand

!=

First operand not equal to second operand

Logical operators

&&

Logical-AND operator. Returns 0 (FALSE) if either of the expressions left and right of the operator ore both are FALSE. Otherwise the result is 1 (TRUE).

||

Logical-OR operator. The result is 0 if both operands have 0 (FALSE) values. If either operand has a nonzero value, the result is TRUE.

Test Conditions

Test conditions are evaluated right after the numerical solution of a process model. If a test condition is not satisfied, IPSE issues a message.

Like equations, test conditions start with a label that is used to identify the test condition in the message.

tPositiveResult: test(x>=0.0) error "x is negative";

If the test condition is not satisfied, IPSE writes the error message x is negative to the protocol.

You will often see test conditions such as test(0!=0) error "Error message …​" with a false condition. The purpose of this statement is to raise an error as the error message always requires a test condition before.

Conditional Usage of Equations and Test Conditions

Depending on the current configuration of your process scheme, some equations and test conditions might not be evaluated. For instance, if you mix two streams, you may have the option to omit one of the streams. See the example below.

ifl ref(feed2)
    f1a: feed1.mass+feed2.mass=drain.mass;
    t1: test (feed2.mass >= 0);
else
    f1b: feed1.mass = drain.mass;
endifl

If a connection is attached to terminal feed2, equation f1a is used and t1 is evaluated. If no connection is attached to feed2, equation f1b is used and no test condition is evaluated.