Home
The ProMoT Manual - Max Planck Institute Magdeburg
Contents
1. Je n J n t gt to Jn Aay2 t gt to n to no 1 3 2 Model formulation of tank in Mdl 7 The following MDL command defines the model of a liquid tank with one phase as module tank 1 10 15 20 25 30 35 40 super classes m documentation Pu properties agg spatial_resolution one of distributed concentrated terminals in out variables n define module class tank odule re substance tank regate_state one of liquid gas value liquid value concentrated is a terminal variables jn is eq to parent jen is a terminal variables jn is eq to parent jan 18 8 variable system theoretic state value 100 0d0 minimum 0 0d0 maximum 200 0d0 unit kmol report all documentation molar holdup jen jan a is a variable system theoretic input value 10 0d0 unit kmol h documentation molarer inflow is a variable system theoretic output value 10 0d0 unit kmol h report all documentation molarer outflow is a variable system theoretic real parameter value 1 0d0 unit m73 documentation cross section of tank aa c is a variable system theoretic real parameter value 0 1d0 unit m 3 documentation cross section of outlet is a variable system theoretic real parameter
2. define equation define equation class class name super classes list of class names documentation quoted string properties property slot indices index definition relation math relation variables variable slot 68 A MDL COMMAND REFERENCE property slot slot name value quoted string one of list of quoted strings module slot slot name is a class name documentation quoted string properties property slot indices index definition terminals weak slot variables weak slot terminal slot slot name is a class name documentation quoted string properties property slot indices index definition variables weak slot weak slot variable slot slot name is a class name documentation quoted string properties property slot indices index definition system theoretic state input output help structure parameter real parameter integer parameter index positive vector direction in out value math expression array of math expressions minimum math expression maximum math expression absolute error math expression unit math unit expression report all lumped distributed variables weak slot equation slot
3. define module define terminal define variable define equation file command include cd define module define module class class name super classes list of class names documentation quoted string properties property slot modules module slot terminals terminal slot equations equation slot variables variable slot links link slot define terminal define terminal class class name super classes list of class names documentation quoted string geometry side top bottom left right geometry position property slot link color color name properties property slot variables variable slot define variable define variable class class name super classes list of class names documentation quoted string properties property slot indices index definition system theoretic state input output help structure parameter real parameter integer parameter index positive vector direction in out value math expression array of math expressions minimum math expression maximum math expression relative error math expression absolute error math expression unit math unit expression report lumped distributed all none variables variable slot
4. 45 50 55 12 1 INTRODUCTION value 55 0d0 unit kmol m 3 documentation molar concentration of water g is a variable system theoretic real parameter value 9 81d0 unit m s 2 documentation gravity constant equations bal n is a equation relation diff lt t gt n jen jan documentation total material balance fd out is a equation relation 0 0d0 jan jan aa aa 2 0d0 g c n a documentation torricellis law for the outlet 1 4 Overview for the following chapters Section 2 gives a short introduction to the basic principles of object oriented modeling and the basic modeling entities that are available in PROMOT In Section B the model definition language MDL is described The following sections 4 and 5 explain the properties of the structural and behavioral modeling entities in detail and illustrate how to define these with MDL Section 6 discusses the aggregation and inheritance relations between the different modeling entities Sec tion 7 introduces the different parts of the PROMOT GUI and their function It also explains how the user can model with the PROMOT VISUAL EDITOR and the PROMOT VISUAL EXPLORER A full command reference for MDL can be found in Appendix A For syntax descriptions in the whole manual EBNF is used which is introduced shortly in Appendix B and Appendix C presents instructions how to install and start PROMOT successfully 13 2 Obj
5. slot name is a class name documentation quoted string properties property slot indices index definition relation math relation variables weak slot link slot slot name terminal1 slot path terminal2 slot path indices index definition weak slot slot name is eq to slot path index dehnen index slot name lower math expression upper math expression eee include file unix file name cd cd dir unix directory name A 5 Commands 69 unix file name and unix directory name are not further specified here Please use a unix documentation 70 B INTRODUCTION TO EBNF B Introduction to EBNF For syntax descriptions in this documentation the following grammar notation Extended Backus Naur Form is used e Symbols in angles nonterminal describe non terminals that have to be replaced accord ing to the rules of the grammar e Symbols in bold face terminal identify terminals in the sense of the grammar that must be used literally e A production rule in the grammar nonterminal right hand side describes in which way a non terminal may be replaced On the right hand side of follows a list of terminals or non terminals that can be inserted instead of the non terminal For instance describes the grammar A a ees A a B B cb among others the following strings a
6. J ANSA structural modeling entity module io interna reactions Ba l Sup Ia modeling entity internal Figure 14 Superclass view for the class trans2a mm_1 All different superclasses are shown with their different branches are always on the left The selected subclass or the leaf node classes are shown at the right of the window Leaf node classes like trans2a mm_1 in Figure 14 can be identified by their dark gray box The PROMOT internal classes that are not defined by the user are marked with internal The heritage view is updated if the inheritance structure changes For every class in the heritage view the same pop up menu as in the PROMOT BROWSER see Section 7 1 3 can be activated with the right mouse button 7 3 Aggregation View The aggregation view shows also a DAG and looks somehow similar to the heritage view But it presents all the parts of the current modeling entity As Figure 15 shows the top level container is presented on the left and all the parts follow in the graph to the right It shows all parts including the direct parts defined by this modeling entity itself and the inherited parts defined in all of its superclasses The graph of the strong parts forms a straight tree where all the parts on one level of the aggregation hierarchy are ordered in one column The weak parts form somehow cross links in this hierarchy and are highlighted with green arrows With the options
7. e f R nis the number of equations 1 3 Introductory examples 9 e g 72 The matrix B may be singular The calculation of help variables is done via explicit directed assignments This algebraic calculations of help variables may therefore not contain a dependency on the variable itself i e they may not contain an algebraic loop If this case arises one of the help variables has to be transformed into a state variable and the assignment must be used as an algebraic equation For successful calculation of the model in DIVA the following conditions have to be fulfilled e The number of equations equals the number of states n ng e The DAE in may have a differential index of at most one Additionally the model in DIVA may contain time or state dependent event descriptions and switching schedules which represent discrete parts of the system This topic will be expanded later 1 3 Introductory examples As introduction into the modeling language MDL the following examples are considered e asingle phase liquid tank containing one pure substance tank e acascade of two tanks two tanks e asingle phase multicomponent mixture tank mc tank In this section the mathematical model and the formulation in MDL of the tank is presented The following sections of this manual describes the language elements that are used in this example Furthermore it will be shown how two instances of the tank are aggregated to form two t
8. unit math unit expression report lumped distributed all none variables variable slot system theoretic state input output help optional structure parameter real parameter a t a t Definition of the syster theoretic type e to the table in Section 5 1 1 For every variable this type has to be defined either locally or in a superclass It is possible from PROMOT version 0 6 3 to override the type locally positive vector direction in out dptio al Definition of the vectorial type of an interface variable according to the Section Without this attribute the variable is a potential variable i e has no vectorial direction With in it becomes a positive inwards vectorial variable and with out it is a positive outwards vectorial variable value math expression array of math expressions optional Definition of the possibly initial value of the variable The value is given as a mathematical expression or as an array of mathematical expressions The syntax of the mathematical expressions in MDL is similar to the syntax of the CODE GENERATOR input language For input output or state variables the value speci fies the initial value of the variable The definition of a value as array of math expressions is not allowed for structure parameters and help variables The value of an indexed help variable should be a math expression that depends on the valu
9. Heritage Viewer which shows all superclasses of the current class Subclasses Launches a Heritage Viewer which shows all subclasses of the current class Visual Explorer Launches the PROMOT VISUAL EXPLORER for the current class This works for module classes only Browse Diva Model Launches the model browser which shows all parts terminals variables and equations and also weak parts references of the selected module including inherited parts Add Subclass Asks for the name of a new subclass and then adds this class as an empty subclass of the current class This is meant for creating a new modeling entity Copy Class Creates a copy of the selected class Afterwards rename the new class 7 2 Heritage Views 57 Edit Source Launches a text editor for editing the source code of the current modeling class The editor can be the JAVA text editor or an editing window of the EMAcs if the regarding option in the Options menu is active see above Visual Edit Launches the PROMOT VISUAL EDITOR for the current class This works for module classes only Delete Deletes only the current class from the running PROMOT system Change Icon Shows a file browser where a new icon file for the selected class can be choosen 7 2 Heritage Views Heritage Views show a directed acyclic graph DAG with all subclasses or superclasses of one modeling entity see Figure 14 respectively The top level superclasses or the selected superclass nma
10. PROMOT realizes this behavior by creating internal part classes The modeler has no direct access to these internal classes But the understanding of these internal structures may be helpful to use all features of the modeling system The internal part classes shall be discussed gt strong aggregation lt o weak aggregation is subclass of terminal two tanks part tank in part tank out part two tanks tl part two tanks t2 Figure 9 Aggregation relations and internal part classes in the construction of two tanks out of tank shortly with the example two tanks from the Section While defining the strong slot t1 in the two tanks PROMOT works as follows 1 It creates an internal part class part two tanks t1 as direct subclass of tank This class inherits all the attributes of tank and can be further specialized e g with additional parts in the instantiation 2 It creates the slot t1 and assigns it an instance of the part class Also in the definition of tank in Section internal classes are created for the inflow and out flow part tank in and part tank out Figure 9 shows the internal classes and the different aggregation and inheritance relations 48 6 RELATIONS BETWEEN MODELING ENTITIES 6 2 Coupling relations Couplings are horizontal part whole relations AFGP96 that are created by PROMOT when couplings of terminals are created with the option
11. This shows you the name of your shell program Depending on this you have to select in which way you can change your paths If the output of this command ends with sh or bash or ksh then you have to change your profile which is described from point Otherwise if the program ends with csh or tcsh then you should change your cshrc instead which is described from point Open profile Open the file profile in the Emacs by using the menu Files Open file The EMACS expects the input of the filename in the so called minibuffer the bot tommost line of the window Type in profile return there The contents of a file is shown in the editor window or an empty window if the file has not been already there Change profile Move the cursor to the end of the file and add the following lines PATH PATH usr local diana bin export PATH There should be a empty line at the end of the file Save the file by the menu Files gt Save Buffer You can close the file in EMACS by the menu Files Kill Current Buffer Continue with 21 Open cshrc Open the file cshrc in the Emacs by using the menu Files Open file The EMACS expects the input of the filename in the so called minibuffer the bottommost line of the window Type in profile return there The contents of a file is shown in the editor window or an empty window if the file has not been already there Change cshrc Move the cursor to the end of the file and add th
12. cb aacb aacbacb Starting with A or B the terminal strings a or c b can be derived If rule 2 is used possibly recursive the string starting with aacb can expand in both directions with a and acb respectively Note that a production with these rules is only finished if all no terminals have been replaced with terminals e Different rules of the same non terminal can be compacted by combining the right hand sides of the rules with The example grammar above can be written with the following completely equivalent rules A a A a B B cb e If a sequence of terminals and non terminals can appear optionally they are written in brackets e If a sequence of terminals and non terminals is written in braces with a following plus C V or star this means that this sequence can appear in this position repeatedly The plus means that the enclosed symbols must appear at least one time and with the star the symbols can also appear zero times this means an empty sequence of symbols Attention please denotes a terminal in the grammar that is used literally in MDL whereas is the just described metasymbol e Additionally to the rules of the grammar a special non terminal starting symbol must be defined which is the starting point for every derivation of symbols If this is not defined explicitly than the first non terminal of the first rule of the grammar is assumed implicitly
13. class tank 4 super classes module documentation Pure substance tank properties aggregate_state one of liquid gas value liquid spatial_resolution one of distributed concentrated value concentrated terminals in is a terminal variables jn is eq to parent jen out is a terminal variables jn is eq to parent jan variables n is a variable system theoretic state value 100 040 minimum 0 080 maximum 200 040 unit kmol report all documentation molar holdup jen is a variable system theoretic input value 10 040 unit kmol h documentation molar inflow jan is a variable system theoretic output value 10 040 unit kmol h documentation molar outflow a is a variable system theoretic real parameter value 1 000 unit m 3 documentation cross section of tank aa is a variable system theoretic real parameter value 0 1d0 a unit m 3 documentation cross section of outlet c is a variable system theoretic real parameter value 55 0d0 unit kmol m 3 documentation molar concentration of water g is a variable system theoretic real parameter 40 5 BEHAVIORAL MODELING ENTITIES value 9 81d0 unit m s 2 documentation gravity constant 50 rhs_bal_n is a variable system theoretic help value jen jan documentation Right hand
14. graphical user interface Excerpt from example in Section 4The order of all command and attribute options inside MDL commands is arbitrary 5The syntax of the MDL commands and options is given in the Extended Backus Naur Form EBNF Notation Appendix B introduces EBNF The complete definition of all MDL commands is given in Appendix A 17 3 documentation 4 Pure substance tank 5 properties property slot optional Definition of a list of property attributes that describe the physical or chemical phenom ena and modeling assumptions formally Excerpt from example in Section properties aggregate_state one of liquid gas value liquid spatial_resolution one of distributed concentrated value concentrated properties slot means that a list of property attributes must contain at least one element see Appendix B Generally a definition of a property attribute looks like this property slot slot name value quoted string one of list of quoted strings indices index definition optional Definition of a list of indices If this option is specified an indexed array modeling entity is created It is possible to define multiple indices therefore every index dimension corresponds to one entry in the list of indices index definition In general an index definition looks like index definition index slot name lower math expression u
15. ni x xe 5 BEHAVIORAL MODELING ENTITIES x 18 60 50 parent x is a variable system theoretic structure parameter value 3 documentation number of components is a variable System theoretic index documentation index for components is a variable system theoretic state indices index j lower 1 upper nc value 20 0 30 0 50 0 documentation partial molar holdups is a variable system theoretic output indices index j lower 1 upper nc value 0 2 0 3 0 5 report all documentation molar fractions in the tank is a variable system theoretic input indices index j lower 1 upper nc value 0 2 0 3 0 5 documentation molar fractions of the inlet equations bal_ni is a equation indices index j lower 1 upper nc 1 relation diff lt t gt 1 jen xe j jan x j documentation component mass balances x def is a equation indices index j lower 1 upper nc relation ni j n x j documentation definition of molar fractions sch bed is a equation relation n sum lt j 1 nc gt ni jl documentation summation condition for partial molar holdups The variables ni x und xe are specified as indexed variables The option value assigns an array of values to each of these variables The component mass balances bal
16. ta i ta i out is connected with the terminal in of the next tank ta i 1 The outer terminals 01 the array of tanks are defined as the input of the first tank ta 1 in and the output of the last one ta nt out 4 1 4 Diva specific definitions PROMOT acts currently as a modeling tool for Drva When a module is transferred from PROMOT to Diva a number of files are written The names for these files can be specified 28 4 STRUCTURAL MODELING ENTITIES using mdl2diva or the model output dialog see Section 7 7 For the sake of convenience these options can be stored with the module in MDL The model output dialog sets these attributes automatically and uses them together with md12diva as default values The different options get explained here diva generation directory Specifies the directory where the model with all the following files should be written to The default is the current directory of PROMOT diva cg file name Defines the name of the CODEGENERATOR input file that is written by PROMOT It is located in the generation directory diva fortran files subname specifies the identifying part of the names of the FORTRAN files for DIVA The default is ab01 This part of the name may be 4 characters long and is used for the FORTRAN subroutine files If the name part was ab01 the FORTRAN files are called dabO1i f dabO1f f dabO1a f and dab01p f This files are written by the CODEGENERATOR diva data file name Into t
17. that are included after this point without fully specified path are taken from this directory This directory is also the default directory for all writing actions All other commands define new modeling entities and are therefore named definition commands The modeling entities are integrated into the specialization hierarchy as subclasses of the basic modeling entities shown in Figure The syntax of these commands follows the rules of LISP every syntactic group is enclosed in parenthesis and all options of a command start with a colon e g class followed by a value With one definition command exactly one modeling entity is created All definition commands have the following common options class class name non optional The unique name for this modeling entity This name identifies the modeling entity If a definition command defines a modeling entity with an already existing name the old definition is overwritten Excerpt from example in Section 1 define module class tank super classes list of class names non optional Definition of the superclasses of a modeling entity The new modeling entity has an inheritance relationship with these classes see Sec tion 6 3 Excerpt from example in Section 1 3 2 2 super classes module documentation quoted string optional Textual informal description of the modeling entity This is used as documentation in the generated output files or as information in the
18. to discard their changes here If the command gets evaluated and errors occur these errors get presented in a new EMACS buffer for correcting the source code All syntax errors are presented with the line number of the wrong statement By hitting the lt return gt key on the error message the EMACS jumps to the respective line in the source code see Figure 18 7 7 Model Output Dialog for Diva od 1 P Generation Directory ects Promot promot kb practical bio CG File Name cycli cg v Diva Source Subname daa01 v Diva Datafile Name cycli dat v LaTeX File Name cycli tex v Plant Description File Name an cycli anl Diva Options Check For Consistency Output Log Generate Model Close Figure 19 The Model Output Dialog for writing a model to DIVA With the model output dialog shown in Figure 19 a module is written as a DIVA model Hereby the module is instantiated and checked for completeness and consistency e g if all values for the variables are defined and all internal terminals are connected If a model is written for the first time it is very likely to get some error messages at this point of the development process Then the equation system may be optimized if the user selects this option Before handing over the model to the CODEGENERATOR the consistency of the equation system is checked i e if th
19. 6 in more detail 4 1 Modules variables 21 variables weak slot optional Assignment of variables to this terminal This definition looks like the following weak slot slot name is eq to slot path slot name is the name that this variable gets inside the terminal This is important for the connection of terminals with links because the variables are linked according to their names inside the terminal and regardless to their original names inside the module The general form of the part option for the definition of weak part is is eq to slot path non optional q slot p p Definition of a so called slot path that is referred by the just defined part This slot path leads to another part in the model It is a composed hierar chical name where the single parts are separated by a dot Every name refers to a part in the model The name parent is a special implicit name which refers to the one strong container of the part The reference is created to the last part of the path see also Section 6 1 In this example 8 in is a terminal 9 variables jn is eq to parent jen 10 jn denotes a reference to the part jen of the strong container parent of the terminal in This is the module tank which possesses jen The slot path must refer to a variable out of the following system theoretic types see Sec tion 5 1 state input output structure parameter index If the
20. SOTJOUTY IOP IO ISIY 9 QISIDA9I YIM Y V I jay ezsuen ope oe zV lt VPI gp Iq e s egy ou Cezy ozsue ly SOTJOULT MET OFLY 9 qISI9A9JIJI YIM Y Vc J egy ozsueJl qp _ P pup yp gp rq e s Ty ou TIy ezsue2 SOTJOUTY IO9P IO ISIY O QISIOAOLI YIM Y V 1 y ezsuen uowda42s2 qT uoJ SISSDJILI N 390198 y IULDU SSDI 87 SISOYJU S uro3o1d oArqnj3rjsuoo Y 10g 92uvjsur 10 P S 1 9104 UOI32 91 xnp 2104 39 9urered erods d ou ou 9je1 jue3suoo 9304 4 toyed o STBUIULIO xN YAM oyey Juelsuog g H a xn f eje jue1suoo ATBIQT UOI32 91 2UO2 oY Jo UOISIOA JX9U ur poAouroI 9Q IM 90 erods d ou ou oje1 juejsuoo um SEI juejsuoo suor vai ogr eds Sururequoo ssep oredng UOI329 01 sak uorjeor Teroods TP TP TP TP To Dou Hey gy po qe s pa u pij epsuei VP VP ap OP P po qes 74 9 P Py epsue ry SOTJOUTY JOp1O JsIY o qrs10401 YIM q 0 q V p ru eysuel a aw 1 6 IT cV DE VPI gb I q ec s ez ou IR ZI OZSue 1 SOTJOULY MET 9Y8Y qISI A91 YIM Y Vc J egay OZsuen uo d119s9 uo 985DJ9LIdNS 390198 yY IULDU SSDID E THE BASIC ELEMENTS OF THE LIBRARY FOR DYNAMIC MODELING 88 ey Ty TY iSioyourered emdur gy zandur gy Tandur 13 mamo suoriestyu ouoo e jo WING eubis e un 0 yeusts z uins ou Teusis g ums oY TY s ogourered gindu gy yndur Ty
21. Section 6 2 vectorially undirected variables are potentials in the physical sense that do not have a vectorial direction Examples for physical quantities of this kind are temperature pressure molar fraction and electrical potential For the description of the tank in Section 1 3 2 only vectorially undirected variables were used An alternative description is the following where the molar fluxes J n and J n are specified as positive inwards directed variables Therefore the model equations of the tank have to be changed as follows Je n Jaln t gt to 12 0 A n 42 2 97 t gt to A 5 1 Variables 37 The output flow J n now appears with a positive sign in the mass balance and the calculation of the outlet flow The result of this are the following changes to the lines 20 29 of the MDL description of tank 19 20 jen is a variable 21 system theoretic input 22 positive vector direction in 23 value 10 0d0 24 unit kmol h 25 documentation molar inflow 26 jan is a variable 27 system theoretic output 28 positive vector direction in 29 value 10 0d0 30 unit kmol h 31 documentation molar outflow 32 33 The new equations are in lines 50 57 49 ps 50 equations bal n is a equation 51 relation diff lt t gt n jen jan 52 documentation mass balance 53 fd_out is a equation 54 relation 0 0d0 jan jan 55 aa aa 2 0d
22. aa is a variable indices index i lower 1 upper na system theoretic real parameter value 0 05d0 0 1d0 0 2d0 unit m 3 documentation Querschnittsflaechen der Ablaeufe c is a variable system theoretic real parameter value 55 0d0 unit kmol m 3 documentation molare Konzentration von Wasser g is a variable 32 4 STRUCTURAL MODELING ENTITIES system theoretic real parameter value 9 81d0 70 unit m s 2 documentation Erdbeschleunigung equations bal n is a equation relation diff lt t gt n sum lt i 1 ne gt in i jn sum lt i i na gt out i jn 75 documentation Molmengenbilanz fd out is a equation indices index i lower 1 upper na relation 0 0d0 out i jn out i jn aa il aa i 2 0d0 g c n a 80 documentation fluiddynamische Beziehung fuer die Ablaufstroeme Toricelli In this case the terminals are also the strong containers of the variables i e the variables are not directly contained by the module Inside the equations the variables are referenced via a hierarchical indexed slot path in i jn and out i jn 33 5 Behavioral modeling entities The class behavioral modeling entity is the superclass of all variables equations tran sitions and places For discrete modeling the transition and place are subsumed under discrete modeling entity whereas the variable and equation are subclasses of continuous
23. as the starting symbol 13 Attention The brackets in BNF have also a meaning as a terminal symbol in the slot paths of MDL P is the terminal to start the subscript of an indexed modeling entity e g a i and marks the given meta symbol in EBNF 71 e Examples The following short grammar describes all character strings that contain at least one a at the beginning and may contain at most one b at the end 8 A A b A a A a The following two rules describe the same set of character strings S a a b S a b 72 C GETTING STARTED C Getting Started PROMOT can be used in two flavors as interactive modeling environment promot or as command line compiler md12diva for finished models The interactive environment is usually started from the text editor EMAcs Please follow the instructions to launch PROMOT for the first time Prerequisite to these instructions is that you already have an account on a UNIX computer where PROMOT is installed and you are logged in 1 Starting Emacs Open a shell window like xterm or the konsole On the command prompt in this window type emacs amp lt return gt The result is that an editor window pops up which has a title bar that usually states something like emacs lt hostname gt where lt hostname gt is the name of your computer 2 Extending the paths a b Find out your shell Type echo SHELL into the shell window
24. contains the flow jan Obviously a modeling entity can occur as part of different containers In the tank jan is a strong part of tank and a weak part of the terminal out More details about aggregation and coupling relations containers strong and weak parts are to be found in Section 6 lThis is the ideal modeling paradigm By using slot paths see Section it is possible to break the encapsulation This is sometimes helpful to express some special model structure 14 2 OBJECT ORIENTED MODELING 2 2 Inheritance In PROMOT aspecialization hierarchy or ontology exists which expresses the inheritance relations between the modeling entities A modeling entity can be defined as subclass of one or several other modeling entities super classes Between sub and superclasses exist inheritance rela tions Therefore a subclass inherits all parts and attributes of its superclasses A subclass can add new parts or attributes or it can override or specialize inherited attributes A subclass may not omit some inherited part 2 3 Goal driven Modeling While aggregating a simulation model in an object oriented fashion a good design of the modules is important The modeling is based on balance equations and goal driven and shall produce a model that matches the requirements of the modeling task Therefore the granularity of the modules and model equations have to be chosen accordingly The choice of the module s border is arbitrary but i
25. context of the terminal These names are necessary for the generation of coupling equations since the variables with the same name across all linked terminals are coupled with these equations Considering a pair of terminals a and b which both have the variables j and k the coupling equations a k b k and a j b j are established based on the names of the variables 30 4 STRUCTURAL MODELING ENTITIES 4 2 2 Indexed Terminals While using indexed terminals it becomes possible to parameterize the number of terminals of a module In the following a liquid tank with ne inlets and n4 outlets should be investigated Figure 6 All inlets are located at the top of the tank and all outlets are at the bottom but Ja n Je n Je2 n mimo tank Ja nj Ja2 n Figure 6 The flowchart of a tank with n inlets and n outlets called mimo tank may have individual cross sections Aai The mathematical model 7 is changed as follows dn lt lt 7 Y J n X Jai n 11 gt to he ae gcn 11 0 Jaln Au 2 T t gt to i l Na n to mo Both of the indexed terminals vector of inlets vector of outlets and the module mi mo tank can be described in MDL like 1 define terminal class vector of inlets super classes terminal documentation Vektor von Zulaeufen indices index i lower 1 upper nt 5 variables nt is a variable syste
26. d11989 uoJ 985DJ9LIdNS 390198 Y IWDU SSDI D THE BASIC ELEMENTS OF THE LIBRARY FOR LOGICAL MODELING 78 yu uoduroo o31nos Y 0 p q99uuoo IQ ue WYJ 09 OLE o1 Suryrqrqur 10 Suryear3oe Iod ou oAeq yey spunoduroo IV punoduroo e oy yndur ue 6110901001 e91nos sse au x Arepunoq ou 991Jnos punoduioo e jo 3nd3no oq squoso1do1 UTeIp sse ou T EH Arepunoq ou ureip UreJp 601nos PUR ureIp 10 sse o1odns 94 st 9 ayes sod Arepunoq spunoduioo 90113 Jo uorpunfuoo uorjoeuuoo eor8o OY smoje pue sse U T dh 6 0108 pue ou pue pa pue a 7 7 9ye3 pue ou z z pue spunoduioo om Jo uorjounfuoo uorjoeuuoo eor8o 94 smoje z pue sse u 1 oyes pue sof c pue 8 z pue j mq oq OSTe ue 90108 193 18 19A9mMOy soroods 3ndur 9 03 dn Ao e ey soye3 pue Ing oaey om 9783 pue ue jo ordo ewou Surq3ou 10 Je y Aol oj pue 19139303 spunod W09 IO OM JO uorjoouuoo OY SAO e 9168 pue aug ayes SoK pue papnjpur A reuorrppe oq pnoys you e 9atye3ou SI Joo oY JI 9783 Furyearpe Alpe UL VIA peur st 19yyo ug uo ouo JO ou ngur oY Surjouop Ie o SUIS V 1 ayes sof ATOL synd U OM YM sojes 10 soryladoid pemyon13s Surugop sse ayes sod z oye3 sioyetodo pue 91307 ue ooq uoururo2 uo poseq ore pue SUOTJIVOI UTEI199 quos p 9Y JOUURUT eorso ur YIOMJoU y JO SJUQUOdUIO qua1oprp joouuoo sojer A1e1Q1 99
27. dialog see right part of Figure that pops up for the menu View gt Options the parts to show can be selected E g to hide all the variables the user would deselect the check box for Variables and press Apply Since the aggregation graph can easily exceed the limits of the screen for larger models it is intended only for the use with small modules where the aggregation and inheritance of the behavioral parts is of interest 58 7 THE GRAPHICAL USER INTERFACE ES Aggregation for PromotGuildl ModuleProxyStub module Constant total concentration with stat terminals terminal cs Not documented Defined in storage intra s Defined in storage intra s variable cs cbound Not documented system theoretic input model name auto cs cbound dataflow relative IN value 1 0d 5 unit 1 n Defined in term storage stat variable c Total constant concentration system theoretic output model name auto c dataflow relative NIL value 1 0d 4 unit not set Defined in storage intra s variable 0 Total constant concentration system theoretic real parameter model name auto c0 Aggregation view optio s Select the slot types you want to see dataflow relative INTERNAL value not set unit not set Defined in storage intra s Iv Variables v Equations v Terminals Y Weak parts equation bal Not documented relation 0 0d0 c c0 cs cbound Defined in storage
28. for context menu Click right button on edge for context menu Hold down left button Ctrl Drag Mode Scenario Interaction Distance Show Int Dist Show Int Dist multi Show Int Dist path Click left button on entity Click left button on entity Shift Click left button on two entities Ctrl or th 1 Move entity inside bounds of parent Scale entity including children and label Resize only bounds of entity keep size of children and label Move pan the entire canvas Move edge handle Add edge handle Remove edge handle Remove all edge handles Move pan the entire canvas Show Interaction Distance for focused entity Show Interaction Distance for previous and focused entity Show Interaction Distance for all entities on the shortest path Table 1 Shortcuts and modifiers used in the Visual Explorer REFERENCES 93 References AFGP96 Gil97 GJSBO00 HKK 00 KBM 06 K600 Mar96 Tr 98 tSd02 A Artale E Franconi N Guarino and L Pazzi Part Whole Relations in Object Centered Systems An Overview Data and Knowledge Engineering DKE Journal 20 347 383 1996 6 1 5 2 E D Gilles Netzwerktheorie verfahrenstechnischer Prozesse Chemie Ingenieur Technik 69 1053 1065 1997 James Gosling Bill Joy Guy Steele and Gilad Bracha The Java Language Specification Sun Microsystems Inc second edition 2000 http java sun com docs books jls second_edition
29. html j title doc html M Hafele A Kienle E Klein A Kremling C Majer M Mangold A Spieker E Stein R Waschler and K P Zeyer User Manual DIVA 3 9 MPI Magdeburg ISR Uni Stuttgart Magdeburg Germany 2000 file usr local diva std doc usermanual ps M Krasnyk K Bondareva O Milokhov K Teplinskiy M Ginkel and A Kienle The promot diana simulation environment 2006 Reto Kohler Beschreibung Code Generator Version 2 0 zur Erzeugung von DIVA Grundelementen Institut f r Systemdynamik und Regelungstechnik Universit t Stuttgart Stuttgart Germany 2000 file usr local diva std doc cg2 0manual ps W Marquardt Modellbildung und Simulation verfahrenstechnischer Prozesse Vor lesungsmanuskript Lehrstuhl f r Prozestechnik RW TH Aachen July 1996 F Tr nkle Frame Definition Language FDL Programmer s Guide Internal report Institut fiir Systemdynamik und Regelungstechnik Universit t Stuttgart 1998 JavaTM technology Software division JavaTM 2 SDK Standard Edition Documentation Sun Microsystems Inc 2002 http java sun com j2se 1 4 docs index html Index CODEGENERATOR 6 absolute error aggregation hierarchy strong 45 weak array behavioral modeling entity BNF browser ca class class object CLOS 6 container strong weak coupling define equation define module define terminal I6 29 67 define variable 16 87
30. itself unchanged It is still possible to write out a device model of a single tank to Diva The submodules get names ti t2 inside the context of the whole composed module The molar holdup of the submodule t1 is parametrized with an initial value 200 The command options modules and links of the command define module are defined as follows modules module slot optional Definition of the submodules of a composed module 41 Modules 25 fex na two tanks Jaz na Vaalnz Figure 5 Flowchart of a cascade with two tanks This cascade consists of two modules of the type tank The outlet of the upper tank is coupled with the inlet of the lower one The inlet of the cascade is the inlet of the upper tank and the outlet is the outlet of the lower tank module slot slot name is a class name documentation quoted string properties property slot indices index definition terminals weak slot variables slot links link slot optional Definition of the coupling relations between the terminals of the different submodules of a composed module link slot slot name terminals slot path indices index definition The compatibility of coupled terminals and the generation of coupling equations is dis cussed in Section Mathematical Model A comp
31. links A link is a 1 n relation between terminals There are some compatibility conditions that must be fulfilled for all terminals of a link e The terminals that are connected in this link must not appear in other links e Every terminal must contain the same set of variables The variables inside the terminal are identified by name not by the position in the terminal e For each pair of connected variables the following compatibility conditions are checked The vectorial types must be compatible potential variables must not be mixed with fluxes in couplings i e it is not allowed to couple a potential t1 p with a flux t2 p in another terminal although it is allowed to couple a potential t1 p with another potential t2 p and in the same link a flux t1 f with another flux t2 f all variables in one coupling must be scalar or the array dimensions must match For indexed variables PROMOT creates indexed coupling equations automatically that run across the whole range of the indices When these conditions are fulfilled PROMOT creates coupling equations for the link This equa tions are created for sets of vectorial variables fluxes and for non vectorial variables potentials in different ways Fluxes fluxes with the same name in a link sum up to zero if the vectorial direction is con sidered For the terminals t 1 lt i lt nt with the flux variable f the following equation is created 0 77 tti f Potentials pote
32. mdyno USIS 9atye3ou e qna qmq euSrs c ums r seuss c UdoMJoq PWIA jeubis Z sal yeusts z uins ou ZY TY S193ourered gindu gy yndur Ty yndyno Suoryedjuoouoo g JO WNG euBis z wins wns ou Teusis z ums poada q TY siojourered gindu qandu poudy gindu gy Tandur 1y dyno u3oq jo yonpoid 10 pue wey jo ouo JO 9990 3894 3 9 10 suorje1juoouoo SAdIANTI pue sumg E euBis z wnspoid wns ou euss umspold TY 193eurezed gindu qandu Ty yndyno Suorjerzjuoouoo 6 JO PNPOIJ jeubis poid eu31s pold ou Teusis poid Ty 1990ure red gandur T4 T tindur 79999 eArjesou V SULART JUO pue yoyo 0111506 e Zume ouo YAM sTeUsIs c Jo jonpodq yndjno E eubis Z p TeuSrs c poad ou USIS C AIp Ty 103oureded gindu yndur Ty yndjno Suorye1juoouoo Z Jo PNPOLI E jeubis z pod wns ou yTeusis z poid gzu Tzu 3o1_zu 39 speusis ZurAjdrypnu 10 Surppe 10 popoou ale sosse o s u T djey sok wns S 8UTULIO SurjI19AUOO IO STRUSIS UO suore 19do orseq SUINBUI 1OJ SOLIOSSIDIB Sururejuoo sseposedng sod day 10005 sasspjaL1adng 39D 198Q y IUWDU Ss 89 xn q Oe Joydepe ucdp ou xnp 199depe xny Jajdepe eustg eustg 19Jdepe uAp ou ouoo 1o
33. ni and the defi nition equations for the molar fractions x def are defined as indexed equations In contrast the summation condition is a scalar equation 45 6 Relations between modeling entities In PROMOT three different relations between modeling entities exists e aggregations containment e coupling relations e inheritance Aggregations and couplings are established while constructing larger modules bottom up out of smaller ones Inheritance relations exist between sub and superclasses The different relations shall be presented here in depth using the example with the cascade of two tanks module two tanks in Section 4 1 2 6 1 Aggregations Aggregations are vertical part whole relationships AFGP96 which form a composed entity out of a number of other modeling entities The composed modeling entity is called a container the aggregated entities are the parts Every part has an aggregation relation to the container Composed modeling entities may themselves further be aggregated to more complex modeling entities The parts are stored as named attributes of their containers which allow to identify them These attributes are called slots Aggregation relations are allowed between the following pairs of containers and parts container part module module module terminal module variable module equation module place module transition terminal variable equation variable 6 1 1 Strong and weak aggregations PR
34. or the class equation itself documentation properties imdices and relation are described in Section 5 2 and are equivalent to the options of the command define equation Mathematical Model As described above an elementary module is aggregated from termi nals variables and equations The system border of the module is described by its terminals and it exchanges through the terminals matter momentum energy and information with other mod ules Every terminal contains a set of variables that occur in the x u p h or y of the complete systems model see Equation In contrast to the directed couplings without retroactivity in Diva the coupling of modules within PROMOT may be direction free and retroactive PROMOT generates a mathematical model out of the MDL description of the module that has a similar form as the apparatus model 1 DA System B x h u p t x f x h u p t t gt to help variable assignments h g x h u p t t gt to initial conditions x to Xo output assignments mapping out of x y C x jt to 8 A coupled module is usually composed out of ig modules The mathematical model of the module contains the following vectors of variables 24 4 STRUCTURAL MODELING ENTITIES state variables x 70 input variables u 76 output variables y R help variables intermediate variables h R e model parameters that are constant in time p R The following rules ap
35. part is called a weak slot A weak aggregation is a n m relation since a part may have an arbitrary number of weak containers as well as a container may have many weak parts In the example the terminals in and out are weak parts of the two tanks while they are strong parts of t1 or t2 respectively In many cases interface variables like jen are strong parts of a module tank while they are weak parts of a terminal e g in in the tank A strong slot is defined by the option is a the argument to this option is the name of a modeling entity This is called a instantiation of a modeling class The strong slot contains the instance of the class If no is a option is given and the part is not already defined in a superclass then as default the base class of the slot list is assumed as class for the slot For instance in the definition of the tank the mass balance can also created by this equivalent definition equations bal_n relation diff lt t gt n jen jan documentation mass balance wa Since in the section equations only equations can be defined and bal_n is not inherited from a superclass this is called a direct part it becomes an instance of the class equation implicitly Weak slots are defined by the option is eq to that has a slot path as argument This definition does not create a new instance or a copy of the original part this slot refers to It only establishes a reference to the part named by the slot pat
36. side of material balance equations bal n is a equation 55 relation diff lt t gt n rhs bal n documentation total material balance fd out is a equation relation 0 0d0 jan jan aa aa 2 0d0 g c n a 60 documentation torricellis law for the outlet minimum math expression optional Definition of a minimal value that this variable may encounter during simulation The default value is 100 0 maximum math expression optional Definition of a maximal value The minimum and maximum can be used together with the absolute error for the error estimation and step width control of the numerical routines absolute error math expression optional Definition of the maximum absolute error tolerance for this variable The default value is 1 0d 6 DIVA calculates the allowed error limit as ere max x max abs Erel 18 the globally defined relative error of the numerical algorithm max is the max imum value defined for this variable x is the actual value of the state variable and eaps is the absolute error given for this state variable A good modeling practice is to define the attributes minimum maximum and absolute error for classes of variables that represent similar physical quantities and therefore have similar values and error limits unit math unit expression optional Definition of a physical unit of a variable The value is a mathematical expression consisti
37. simulation model The function of the mathematical model is not changed in this process but the resulting model can be calculated more efficiently However if a modeler does not want these optimizations for certain variables they can be marked as dont optimize yes This situation applies for instance if a state variable is used in parameter fitting but PROMOT transforms it into a help variable Since DIVA accepts only state variables as inputs for the standard objective function in parameter estimation this variable has to remain as a state 42 5 BEHAVIORAL MODELING ENTITIES 5 2 Equations The modeling entity equation is the superclass of all equations For the definition of a separate equation the command define equation is used Equations can be scalar or indexed as the variables 5 2 1 Mdl description A subclass of the modeling entity equation is defined by the MDL command define equation The options class super classes documentation properties and indices can be specified in this command as explained in Section 3 Further the modeler can specify the options relation and variables These options have been partially described before in Section 4 1 1 The general form of define equation is given by the following EBNF Rule define equation define equation class class name super classes list of class names documentation quoted string properties property slot indices index definitio
38. then construct several special entities that inherit all the aspects from the general one Modeling entities in PROMOT are formulated in the object oriented modeling language Model Definition Language This manual describes the object oriented methodology the semantics of the modeling entities in PROMOT and the language elements of MDL It will be explained with simple example models of tanks for pure and mixed liquids how the mathematical model of an apparatus is described by structural and behavioral modeling entities 1 1 ProMoT Architecture PROMOT is like the CODEGENERATOR implemented in Common Lisp using the features of the Common Lisp Object System As shown in Figure 1 PROMOT writes the simulation modules for Diva by using the which generates the FORTRAN source code from a non structured symbolic model representation The PROMOT Gur Graphical User Interface is implemented in Java GJSB00 with the Java and runs as a separate process The PROMOT GUI commu nicates with the PROMOT kernel via the CORBA middle ware PROMOT can be started without the GUI as a command line compiler which is called mdl2diva This is meant for fast generation of a DIVA model within shell scripts Within the kernel modeling entities are represented in an internal data structure of specialized CLOS class objects called FDL This classes can be created and manipulated using the MDL interpreter or the visual editor of the Gur Since both methods work dir
39. u and y that are combined in this example to vectors u u ug ua ua and y yi y ya Figure D Within DIVA this variables are coupled with directed uni directional in the sense of data flow connections For more information about this see HKK 00 A model generated by PROMOT contains the following vectors of variables e state variables x R z e input variables u e e output variables y 76 e help variables h R e parameters that are constant in time p R The model is described by the following mathematical relations DAE B x h u p t x f x h u p t t gt to help variable assignment h g x h u p i t gt to 1 initial condition x to Xo output selection y C x st gt to The first line describes a system of differential and algebraic equations in a linear implicit form In the second line intermediate values are calculated by direct assignment the so called help variables that can be used in the function f and in the matrix B Initial conditions for the DAE are given in the third line For a DAE these conditions have to fulfill the system consistently The last line defines the vector of outputs of the system as a part of the state vector Every line of the matrix C 0 1 contains n 1 08 and only one 1 as elements 01 00 0 Ua 000 0 1 For the left hand side matrix B the right hand side vector function f and the vector of help functions g applies Bem
40. with their respective icons Their position is fixed and depends on the definition of the class of this module instance The names of this inner terminals can be displayed optionally Because this leads sometimes to a cluttered display the user can disable this in the options menu of the PROMOT VISUAL EDITOR 60 7 THE GRAPHICAL USER INTERFACE Options gt Show Terminal Names The external terminals have a position defined relative to one edge of the module The respective edge is stored in MDL with the geometry side which can be one of top bottom left and right The position geometry position is defined as the relative distance from the top on vertical edge or left on horizontal edge corner of the module in a float value in 0 0 1 0 The default values are left 0 5 Also external terminals can be positioned dragging them with the mouse along the edges of the module If the module is resized they keep their relative positions This positions are also used to draw the terminals when the module is used as a submodule Links are lines between terminals of the submodules They can be drawn by pressing the left mouse button on a free terminal holding the button and dragging the appearing rubber band line to another terminal The link appears if the terminals to connect are compatible see Section 6 2 The link lines may have specified colors This colors can be defined for the link or one of the connected terminals by link co
41. 0 c n a 56 documentation Torricelli Equation 57 When two tanks of this type are coupled to a cascade the following coupling equation is estab lished between J n and Jealn 0 Jan J 2 n 13 The values of the outflows J 1 n and Jaa n are always negative 5 1 3 Variable descriptions in Mdl A subclass of the modeling entity variable is defined by the command define variable This command has the attributes class super classes documentation properties model name and indices as explained in Section Additionally the options value minimum maximum absolute error relative error unit system theoretic positive vector direction and report can be specified Some of these options have been explained in Section 4 1 1 The general form of define variable is described by the following EBNF Rule define variable define variable class class name super classes list of class names documentation quoted string properties property slot indices index definition 38 5 BEHAVIORAL MODELING ENTITIES system theoretic state input output help structure parameter real parameter integer parameter index positive vector direction in out value math expression array of math expressions minimum math expression maximum math expression relative error math expression absolute error math expression
42. 24 uo2 d142s2 T uo T Sassp 24adng 120419Qy IWDU 55019 E THE BASIC ELEMENTS OF THE LIBRARY FOR DYNAMIC MODELING 84 sand jno OMY pue syndur om UM 9 M39N1IS uorjoeor Y 1 o1n3onajs sox po qe s 0 815 10 ATI diy n jno ouo pue syndur om u3r4 o1njonijs Y 1 o1n3oni3s sox 2 qe s en 6 JO JUSTO OLTTIOTIOTUSIOTS fot ndyno ouo pue syndur 043 31A 9 M99N 198 UOLIIBOL Y SUYO 91M99N 1IS sox 9Z q8 S Dot Ga VOL ft Y ndut ouo pue sjndjno 99149 YAM ounjonijs uorjoeor Y sourjpo T o1n3onajs sox poq e s q otgc vioq totga v nd ut ouo pue sind3no OM YAM o1njonijs uoroeo V 1 o1n3onajs sox oq e s ndyno ouo pue 3ndur ouo yy m omgonns uoroeoi e sougoq o1njondjs sox q e s 10 q Y ndyno ouo pue ndur ouo qu om3onajs uorpeoi e souro q 9 390 198 sob qz e s d dur ouo yy m om m S Won orar u ad nd3no ou pue 3ndut PR m TH n PA sob R S g v JO JUDIOS orr urorqoro1s Y UM qndut ouo pue s3nd3no oA 31A 9 M99N 19S UOLJIBOI Y 1 o1njonijs sox 8 g IO g z eii qndut ouo pue 3nd3no ouo qu om3onajs uoroeoi e souyod 9 390 198 sob q ec s d d UO QA om ous S EE a ndur ou pue 3nd3no 9 pue mag yu pn n pqa om3onijs sok q s g 0 UL e sppy urKzu ue JO euru 3ndur ue 501 9MI9N 1IS sox yop zuo So1njonijs uorjoeor o qrssod fe Sururequoo sse o1ie
43. 3depe ouor 1ejdepe Sjuouio e 1930 03 po3oouuoo Apea pe seuru Suryesedoid 103 oouejsur 10j njos sio3depe Sururejuoo sse oiedng KreqI SoK Joydepe uAp ruaa punoqo 1939urered usnib punoq9 1ojourered oY 0 Uuxe4 so JO o qeLreA Auen m pour ooggo punoqo oy Surjjos pue uie4 o2 Y 0 UI193 S2 Y S IOATOD rn jeusig Ig u uan b punog 1ojourered uaa1B punoqo 1ojourered oy 0j Uuxe4 so Jo o qeLreA Oe AUO9 ULI9 ou poul Jozso punoqo oy Surjjos pue WIEI FD Y 0 U193 S2 Y S IOATIOD we J Je nn Y H9AUO AUOO ULIO ou 9789 xmn q 7819 Qe 1 HG Jozso pe gsur 09772 os sse 5 poyedoideq oozjo ou SIA 09ZJ0 SI 0929 U19 1 09 v 0 WIOT FI Y SHOMO gt e AUO02 UL193 ou 09779 feusig xn 4q 0929 sod Ay euru 19 Surj1oAuoo 10 squouro o Sururequoo sse oz1 dn dy SoK AUO9 ULI9 paut pano gagno gramo mamo y29s ums o yejs p ums 7 03ur eururi93 3e4s 6 6 o wns jndui yndjno 710000 Tyndyno s m OUT eururi93 3e4s 6 6 7 7 7 Jes 6 uns De ums ou ye s ums OFT eururr93 ye3s 6 6 Z wns TY eq SY TY stojourered pindur py eyndur ey gindu gy yndur 31 dyno yeusts uns ou feusis F ums Suorye1juoouoo p JO WING jeubis wns 1000 q wooy sasspjaLadng 100 5 Y IUDU SSDID E THE BASIC ELEMENTS OF THE LIBRARY FOR DYNAMIC MODELING 90 mo U0T VIJUIOUOD yeys 3e3s u
44. 67 definition command dialog model output search class diva anl file name diva cg file name diva data file name diva fortran files subname diva cg file name diva latex file name documentation dont optimize EBNF editor source 1 visual EMACS equation equations FDL 18 flux coupling geometry height geometry position geometry side geometry width geometry X geometry y GUI heritage view icon include 16 index index indices 27 inheritance internal part classes is a 61 link link color links lower maximum MDL mimo tank 30 minimum model closed open 7 model output dialog model name modeling goal driven modeling entity structural module composed elementary indexed modules network theory 94 INDEX palette part strong part class parts place places positive vector direction 38 potential coupling PROMOT 6 architecture promot promot ui properties property attributes relation report scalar slot weak slot path source view specialization hierarchy subclass superclasses system theoretic system theoretic tank 9 terminal elementary indexed terminals transition transitions 19 two tanks Bam unit upper value variable classes variables vectorial direction vecto
45. IS ULIOY ou 39N 19S ULI9Y euru sox qONIYS ULIO4 Ay yus Zurfppout e113onj3s SoK JOUIULLI popeo st A3rp euorgoung poziperoods odo S opour 89130 10 1ox reur se 50198 Y amp reqqr 3on13s oq JO sjuouro e OY SUISN YOM so npour pu s opouir 80 Ife 10 sse o1odns e se posn oq Pfnoys Tepou 99n198 SSU OL o npour sox JAPOU JINAYS SSUIPUNOLINS y 03 9423 90168 32ouuoo o pasn oq pmoys s7e3 199depe 939n198 JL 19Idepe 39N 198 ou 19Idepe 30n 138 eje 1eidepe nys e npour 193no y 09 euru punoduiroo e punoduroo J99UUO9 o3 pasn oq prhoys punoduoo2 1e3depe 32n44s 97 T M 19Idepe 39N 198 ou 19Idepe 30n138 punodwoo Jajdepe 1onuls e qe reA sodA3qns 1o3depe 3uod9grp om 016 9191 HOS jt pour e ogur paye1393ut oq JOU p nous 1a3depe 99n198 4 dopo SSID u T TEUTULISI Y 0 pou Y YOOUUOD 0 Ao re s1o3depy Arerqy jon 14s sox JINATS 100 q uor SISSDJILI N 120449Q0y IWDU SSDID 81 E THE BASIC ELEMENTS OF THE LIBRARY FOR DYNAMIC MODELING 82 E The basic elements of the library for dynamic modeling roydepe ue um 9ISUO0D BAJUT A e1OIS Aq pooe doi oq ued y osneo oq ATeIgIf 94 JO UOISIOA XOU UI poAOUlol oq T IM sse o pejeoeide s peuruuioj xnp YM uonuru ouo5 juejsuo 9381038 d oq ou 90INOS 33 10 S 8 uoryexquoouoo YURYSTOD e30 03 1o3oure red jndur ue se uoAIS SULIO IOUJO SM JO uorje1juoouoo ay pue 09 1ojourered se
46. MOT BROWSER 55 Delete All Deletes all modeling entities loaded into the server Changes are lost Select It is possible to select classes in the browsers tree by direct interaction with the mouse A single click with the left button selects one class When holding the lt Shift gt key pressed on the keyboard while clicking all visible class rows between the existing selection and the newly clicked class become selected Another possibility is to use the lt Control gt key while selecting classes Clicking on a unselected class while holding lt Control gt adds this class to the set of selected classes whereas clicking on a selected class with lt Control gt removes this class from the selection There are some automatic selection methods Select All Selects all classes currently present in the PROMOT system Select Subclasses Selects all subclasses of the latest selection in the tree The tree is expanded as well to show all appearances of these classes Select Superclasses Selects all superclasses of the latest selection in the tree The tree is expanded as well to show all appearances of these classes Select All Dependencies Select all dependencies of the currently selected class Search Search for a class using a small dialog It expects the input of a full class name or a substring When pressing the search button all appearances of the class are selected and are highlighted in the tree Parametrize from Diva Parametrizes a copy of the sele
47. N 198 sof 9306 uoyduIs q uooy sasspDjo4adng 39D198Q Y IULDU SSDI 79 oyes moyauos 10 pue Io sATID8 ue o10Joq T 08 SuryeArj e Aue 010790 ooe d ur pasn oq 3snur 3 punoduroo e uo p p ATOJIQIYUL ue quesaida o posn st YOU sse oy A A181Q1 99N 198 sox jou jou MOY O auos 8 ou Z MOY9UIOS moyaulos sorge yma qg duroour opour o3 smo e 4 1ea o A ogo duroo you SI uorjoeuuoo oY DISYM 9783 Y se joe Moqeuos sse MY ayes sod MOYOULOS spunoduroo om jo 9ye3 10 uoTouN stp oArsn our C Z oyes 10 ou 6 10 9783 10 ue Aq ojeS pue ue verdor 0 6 9 9 pow ay 3a jr 9383 ouo 09 5972008 e1oAos JO uorjoouuoo oy mofe 04 pasn oq ULI ojeS ro UR T oAryeuloj e Ar32e Sursn pojuouro dur oq rseo ueo uorjoouuoo 1o 2130 V oye sof 10 spunoduiroo 9 JO UOT DUUOD LITO 10 9807 ayes sod 9 994823 spunoduro G Jo uorjoeuuoo BOTSOT 10 980 ayes SoK G oye3 spunoduroo Jo uorjoouuoo LITO 10 sse JoRrysqe ayes SoK p oyes spunoduroo e JO uorjoouuoo LITO 10 sse JoRrysqe ayes SoK ojes wooy sasspnjo4adng 39D198Q Y IULDU SSDI D THE BASIC ELEMENTS OF THE LIBRARY FOR LOGICAL MODELING 80 9783 id mo indino jonas Wa 390 195 ULI99 ou 390 195 ULIOY E ayes qndut indui jonas wer 39N 19S ULI9Y ou jonijs urlo4 e ayes 3911 19S ULIO9 sox jonijs urlo4 punodutos punoduoo jonas Wer RF YONI
48. OMOT distinguishes two types of aggregations e strong aggregations and e weak aggregations In a strong aggregation the part is dependent on the container If the container is removed from the model the part is necessarily also removed with it e The container is called strong Container or parent of the part e The part is called a strong part of the container e The named attribute or slot that contains the part inside the container is called a strong slot 49 50 51 52 53 54 46 6 RELATIONS BETWEEN MODELING ENTITIES A strong aggregation is a 1 n relation because a part has exactly one strong container and the container may have an arbitrary number of strong parts For example the module two tanks is the strong container of two modules of the type tank This modules are contained in the strong slots t1 and t2 One important issue with strong aggregation is that recursive aggregation of a module class in itself is not possible Considering the example in Figure 10 it is an error to define the class tank with a strong part t1 that is itself a tank This would lead to a endless recursive loop and is not allowed In contrast in a weak aggregation the part is not dependent on the container The container may be removed from the model without affecting the part e The container is called a weak container of this part e The part is a weak part of the container e The named attribute or slot that contains the
49. Output Dialog for writing a model to DIVA 6 1 INTRODUCTION 1 Introduction PROMOT ProcessModeling Tool is a knowledge based tool for the equation based object oriented modeling of chemical and biochemical processes The process models constructed with PROMOT can be analyzed simulated and optimized numerically in the simulation environment DIVA after passing the CODEGENERATOR K600 Beginning in 2006 PROMOT is also capable to use the simulation environment Diana The object oriented knowledge base of PROMOT contains process engineering knowledge repre sented by structural and behavioral modeling entities Starting with these predefined modeling entities new models can be constructed by object oriented modeling and then they can be added to the knowledge base Models in PROMOT are based on rigorous modeling with balance equations Modules are the structural modeling entities that represent control volumes or signal transformers and therefore subsystems in the model The model of the whole plant or apparatus that should be analyzed numerically is also represented as a module PROMOT provides two mechanisms to derive new modeling entities from existing ones e Aggregation e Multiple Inheritance Using aggregation on multiple levels the modeler can build new models by aggregating and con necting structural and behavioral modeling entities With inheritance one can describe general aspects of a model in one modeling entity and
50. The PROMOT Manual Martin Ginkel MAX PLANCK INSTITUT DYNAMIK KOMPLEXER TECHNISCHER SYSTEME MAGDEBURG Max Planck Institute for dynamics of complex technical systems Sandtorstr 1 D 39106 Magdeburg Germany http www mpi magdeburg mpg de projects promot E mail promot mpi magdeburg mpg de 19th August 2011 Abstract PRoMo Process Modeling Tool is a modeling tool for the object oriented and equation based modeling of chemical biochemical and intracellular processes for the simulation environ ments DIVA and Diana MDL Model Definition Language is the object oriented modeling language of PROMOT The process unit models created with PROMOT contain algebraic and ordinary differential equations as well as specifications of process variables in MDL notation These models are written as CODEGENERATOR input files and can be numerically analyzed simulated and optimized in the simulation environment DIVA after calling the CODEGENER ATOR In PROMOT a process unit model is represented as a structural modeling entity that itself can be composed of structural and behavioral modeling entities Structural modeling en tities represent control volumes and signal transformers of a process unit model as well as their terminals Behavioral modeling entities represent model equations and variables that may be attached to structural modeling entities The modeling entities including the process unit mod els are formulated in MDL MDL sup
51. ained in the following They are located above the tree view see Figure 2 File allows to load and save MDL files to import and export files to run scripts and to terminate Edit PROMOT Open Shows a file browser that allows to select MDL files with suffix md1 This files are loaded into the PROMOT kernel after selection In this way modeling libraries and predefined modeling entities can be included into the current modeling session For modeling libraries it is possible to write loader files which control the input of all the other necessary files with the commands cd and include see Section 3 so that only one file has to be selected for the library If there are syntactical errors in these files the wrong definitions and only them are not loaded and an error message is displayed Open Recent Loads recently opened MDL files Save All Classes Shows a File Browser to select a File or a new file name to save the complete library of modeling entities that is currently present in the kernel The MDL source code of all these classes is then saved to one file sorted in an order that a class appears in the file after all other classes it depends on as super classes or by using them as parts with is a Save Selected Classes Does the same as Save All Classes but saves only the classes that are currently selected in the tree You can manipulate the selection manually or by using the different functions of the menu Select see bel
52. ance relationship with each other Also the inheritance graph must form a directed acyclic graph i e the graph must not contain cycles A class may not be a direct or indirect superclass of itself For discussion the example in Figure 10 is introduced terminal module gt lt P d device n rho n di ice RE tank acetic acid device rho 3 rho 4 Dn 10 273 x A 1 I 4 1 2 Pr x ge 0 acetic acid tank er rho lb op Figure 10 Examples for multiple inheritance and inheritance priorization The classes tank and acetic acid device are direct subclasses of device Both inherit the variables n and rho from their superclass The class acetic acid tank has both tank and acetic acid device as direct superclasses It may not have device as direct superclass right crossed out arrow since tank is already a specialization of a device Also tank may not have acetic acid tank as a direct or indirect superclass because this would form a cycle in the inheritance graph which is not allowed The sets of inherited attributes of the superclasses are unified so acetic acid tank has n rho as well as 50 Normally multiple superclasses should complement each other so there should not be different definitions of the same attributes In this example tank and acetic acid device both define the value of rho but differe
53. anks a cascade of two tanks Section 5 will present an alternative model formulation for the tank In this version is a separate modeling entity for every equation or variable defined and the model is extended to have an arbitrary number of inputs and outputs The advantage of this kind of formulation is that the predefined variables and equations can be used in other models too This is a first step towards building a standard knowledge base But there is a tradeoff because a compact definition of a modeling entity is replaced by a number of independent definitions that make the orientation in the model more difficult Later on in Section 5 3 a model for a tank containing a mixture of liquid substances mc tank is derived from the simple tank Therefore mc tank is defined as a subclass of tank The definition of tank is kept unchanged The modeling entity mc tank inherits all variables and equations of tank 1 3 1 Mathematical model of the pure substance tank The modeling task is to describe an ideally mixed tank with an inlet and an outlet by a mathe matical model Figure B The tank contains one substance that makes up exactly one thermo dynamical phase State variables of the system are e the molar holdup n of the liquid in the tank dynamic state 10 1 INTRODUCTION Jaln Figure 3 Single phase liquid tank with inlet and outlet On the left hand side the process engineering flow sheet on right hand side t
54. ations state variables inputs outputs parameters intermediate variables and indices With the association of BME to a module and its terminals a mathematic model is formed that is similar to 1 A set of modules can be aggregated to a more complex module Therefore the terminals of the sub modules are connected or propagated as terminals of the complex module This aggregation step can be repeated to built up a hierarchy of modules up to the module of the complete system The mathematical model of an aggregated module is formed by its submodules and coupling equations for all connected terminals e Aggregation e Multiple Inheritance 2 1 Aggregation By aggregating a model from structural and behavioral modeling entities an aggregation hierarchy is built In this hierarchy modeling entities are related by aggregation and coupling A modeling entity can consist of other modeling entities The compound modeling entity is called a container and the aggregated entities are called parts Encapsulation of modules is an important quality of object oriented modeling Without terminals a module is completely separated from its en vironment From the outside its state and behavior are invisible Only through the terminals a selected subset of its variables can be accessed In the example Section all terminals equations and variables are parts of the container tank The terminal in has as part the flow jen of the tank the terminal out
55. cted class with data coming from DIva View The contents and relationships of a model in PROMOT can be explored by different views Most of the views can be called from this menu View Source Starts a text viewer for the source code of the selected classes Visual Explorer Launches the PROMOT VISUAL EXPLORER for the currently selected class The hierarchical structure of the model is shown to an arbitrary depth recursive view Subclasses Launches a Heritage Viewer which shows all subclasses of the current class Superclasses Launches a Heritage Viewer which shows all superclasses of the current class Browse Diva Model Launches a model browser which shows all parts terminals vari ables and equations and also weak parts references of the selected module including inherited parts Show Quick View If this is selected the browser shows in its right part a small window with the source code of the currently selected class Options This menu shows user preferences and optional features of the GUI Mdl Options Provides options for the managing of MDL code Diva Options Defining options for the DIVA code Customize Undo Redo Provide options for undo and redo functionality Use Emacs as Editor When this check box is available not grayed out and selected the EMACS is used as the text editor for editing source code of classes Otherwise the very simple JAVA editor is used instead Help This menu gives options to further help
56. d from all three palette panes with the context menu of the right mouse button If an existing non empty module is opened into the PROMOT VISUAL EDITOR the palette contains all the modeling entities that are already used as part of the module The right work pane contains a window work window where parts from the palette can be dropped on Submodules are usually drawn as rectangles anywhere in the window and external terminals are rectangles that stick to the border of the window Links are represented in the drawing as lines connecting the terminals of submodules If an external terminal is connected to a terminal of a submodule than this means a weak aggregation of the terminal of the submodule as terminal of the currently edited module In Figure 16 e g t_eiia on top is a terminal that 7 4 PROMOT VISUAL EDITOR 59 7 Visual Editor for glycerin FH Model Options gt glycerin inhibitor storage const_p storage intra con sum 2 flux intl storage intra_x f Apsil_aktor Expressor exp gly ktor FACS az az nz Figure 16 Visual editor for a cellular transporter module is eq to a terminal of the submodule r_gly and gly is a module A basic feature of this work pane is to select one or more of the shown parts This is done by clicking with the left mouse button on the part Multiple parts can also be selected e g for positioning by specifying a selection rectangle with the left mouse bu
57. dng UOI32 91 sox 94n32n418 uod ISI q uoo sasspja adng 390198 Y IWDU SSDID 85 uoryepe19 p urojo1d 10 poss SOTJOULT IAOPIO ISIZ 9 QISJOAO LII YIM 7 m Tue ezsuen 4P t Euge T e s Ty ou T Ig ersueag SOTJOULY I9PIO ISIY 9 QIS19A9 LII YNM J V LU ersuen V IS3 Tp Tp G va yp IPI D qc e s wu ou p urur qzsue1dj SOLJOULY uoquo A st o YOT 9 QISI9A9 LII YIM JZ a 6 6 2 ww 005061 peojsur r uo ecsuer os sse pogeooudo q I urur ecsuelj ou IO ecsueij J O ezsuen V IS3 Tp Tp r Vp gp I q e s WU ou urur ecsued Sorpun uojuo A si o qot A 9 QISI9A9 LII UM Y BE J ww ezsuen iaa o VP OP aP 1700 6 8 Tue ou I Tue q esue ry SOTJOUTY JOPIO JSIY 9 ISIDADIM YIM O V q at at jue qgsuen V de DS P m VP IP I q e s Tuo ou I uo ezsue ly 10009 q wooy sasspjaLadng JODIISQV IUDU SSDI E THE BASIC ELEMENTS OF THE LIBRARY FOR DYNAMIC MODELING 86 Tp 7p Tp DATE VD gp VP OP 2 1702 66 68 gI ou I ZIy egsue sy SOTJQUTA I9P IO ISIY 9 qrs19A9J YIM 0 q V gay eesuen z VP IPI 2 8 8 qy ou TIY qzsuen SOTJOULT MET 9Y8H qISI A91 YIM q Y oe Lay qesuea peoj3sur J qzsue1 osn ssepo poyeooideq TQz e s X T I ou IX T1 XZSUe ly e E 7p J jay xzsued 6 0 V VP ap rq e s Ty ou ITg egsuel
58. e following lines setenv PATH PATH usr local diana bin There should be a empty line at the end of the file Save the file by the menu Files gt Save Buffer You can close the file in EMACS by the menu Files Kill Current Buffer Continue with 2f 14The syntax lt gt is used for single keys on your keyboard In this case the enter or return key is meant For the following commands the return key will not be mentioned explicitly If the instruction in this document is Type xyz to abc then you should switch the input focus to the window abc type xyz there and hit the lt return gt key 73 f Testing the paths Log out from the computer and log in again Open the shell window and the EMACS as described in Type which mdl2diva into your shell window If it writes out usr local diana bin mdl2diva then everything is OK and you can continue with 3 Otherwise double check if you did the steps correctly and perhaps ask you local guru 3 Installation of ssh keys Now we install some keys for the ssh that should allow an easy remote access to other computers in the local area network without typing passwords every time PROMOT uses this feature sometimes so we should ensure that this works a Check for old keys Type 1s ssh into your shell window If the files authorized_keys2 id_dsa id_dsa pub id_rsa id_rsa pub are already present then it is most likely that everything already works for you Tes
59. e number of state variables matches the number of equations matches in the model The model names of all the variables are then generated according to the rules DIVA imposes for the different system theoretic types Here the model name see page 17 is used if it was specified for a modeling entity in the model Then a CODEGENERATOR input file is written and the CODEGENERATOR is called to translate the model to DIVA code The CODEGENERATOR may write out some messages during this process The model output dialog for DIVA has text fields to specify all the different file names for this process If the MDL code of the module already contains this information see Section 13 that values are used here as defaults The Generation Directory is used to write all the different output files in this process and is typically the directory that is used for all the simulation data in a model The CG File name is the name of the generated input file of the CODEGENERATOR This file is useful to look for the generated model names It contains the shortened form as well as 7 7 Model Output Dialog for Diva 65 the full hierarchical name in the meaning attributes of the CODEGENERATOR definitions The following four text fields specify the generated files for the diva simulation They are explained in Section 4 1 4 If one of these file names is deselected with the check box it will be not generated If one of the files is already present it gets overwritten wi
60. e of the index variables It may contain cond statements Indices should not have a specified value The dimen sion of a array of math expressions must match the dimensions that are specified in the option indices of the variable Values may be defined depending on the values of other variables the value may contain a calculation based on other variables The following dependencies are allowed for the different system theoretic types integer parameter may depend on structure parameters and other integer parameters real parameters and system variables input output and state may contain structure parameters integer parameters and other real parameters help variables can depend on every system theoretic type Since help variables may depend on each other they are ordered automatically according to their dependencies Since they are calculated during simulation via a direct assignment 5 1 Variables 39 there must not be a circular dependency of help variables If PROMOT reports an error for a help variable you should transform this help variable into a state and the value into an algebraic equation In the example tank only simple numbers are used as values for the variables The following example defines the parameter aa as one tenth of the parameter a Further a help variable rhs_bal_n is introduced for the right hand side of the mass balance ba1 n 1 10 15 20 25 30 35 40 45 define module
61. e of the module 62 7 THE GRAPHICAL USER INTERFACE aj y UE Em oren ror ent mode Model Edit View Mode Options il Scenario Visual Editor Mode Hierarchy Zoom Figure 17 Recursive view of the module of the EGF signal transduction model Different layers provide additional information e g overview and navigation layer on the bottom right 7 6 Text Editor 63 Fisheye Zoom By clicking the focused module is enlarged whereas all other modules are shrinked but are not hidden nor zoomed out of the window In this way the context of the focused module is preserved Interactive Zoom This navigation mode is comparable to the Pan amp Zoom functionality pro vided in other tools Pan means moving the network in two dimensions Zoom changes the scale at which the network is viewed enlarge modules of interest or shrink them Focus Zoom The focused module is positioned fully into the view but with minimal pan of the network Hence the user is not confused by too many Pan amp Zoom steps The PROMOT VISUAL EXPLORER is not only used for exploring of the model but also for creating and manipulating different graphical representations of a model Furthermore the visual explorer is appealing for publication exportation and printing For an overview of navigation pattern shortcuts and modifiers see appendix F 7 6 Text Editor mem nos pans cam cix 6 ginkeHto TX Promot Buffers Files Tools Edit S
62. e submodules are disjunct it is possible to introduce shared variables This makes sense if for instance the temperature of a composed module is calculated by a global balance but applies to each of the submodules This can be defined in the way that that the temperature variable is a strong part of composed module and every submodule uses this variable as a weak part by is eq to Another example may be that the same set of parameters is used in different submodules but is subject of parameter estimation In this case one needs only one instance of the parameter set in the simulation environment and should also define the parameters as strong parts globally and propagate them to the submodules as weak parts Only strong parts appear directly in the variable vectors Weak parts that are used in equations or links are internally substituted by the strong parts they refer to 1 10 15 4 1 Modules 27 In the example model Figure 5 the resulting variable set is the following is the union of the variables of the submodules t1 and t2 x m Jal Jen ma Jal Ja in y Jam 10 h p 91 Az Aa 92 A2 Ao A variable that is defined as input in the submodule k becomes a state in the composed module if it is not contained in outer terminals of the composed module 9 This means that this variable is only contained in terminals that are internally connected to other terminals and a coupling equation exi
63. eal parameter integer parameter output structure parameter Figure 7 Specialization hierarchy of system theoretic types In a fully specified model every variable must have a system theoretic type The available system theoretic types of PROMOT are the same as in the CODEGENERATOR and in Diva The system theoretic type determines the meaning of the variable for the simulation and optimization algorithms It used to determine to which variable vector of x u y h and p the variable belongs to What is the meaning of these types State input and output variables or system variables represent the state of the module that may change during simulation Input variables are deter mined outside of a module and must be connected to another model output variables are state variables that are definitely calculated by the equations of a module and may be used in the terminals State variables represent the inner state of a module They can also be used in the terminals but in this case it is not specified whether they are determined by the equations of this module or they are a degree of freedom The final determination is established through the connection of the terminals Parameters are values that do not change during simulation Real parameters act usually as constant physical quantities in the model They may be calculated in parameter estimation and optimization tasks Integer parameters can be us
64. earch Mule ACLFile AC diva cg file name J diva data file name diva fortran files subname 20 diva latex file name documentation askad geometry height geometry width links CER 1 terminals modules geometry x ACL Idle ginkel t 0 mdl Common Lisp ginkel t0 mdl 15 The option geometry x must be a string containing a positive integer In Evaluation of Command is a In Evaluation of Slotlist modules In Evaluation of Command define module In File ginkel t0 mdl home ginkel tmp ginkel t0 mdl errors Figure 18 EMACS for editing MDL source code with error message For changes of the source code of a modeling entity a text editor is employed Depending on the settings in the Options menu see page 55 either a JAVA editor or an EMACS window pops up The JAVA editor is very simple after changing the text the window can be closed and the text gets interpreted as a new class definition If there are errors in the text a window with the error messages pops up For more sophisticated editing the use of EMACS is recommended EMACS 64 7 THE GRAPHICAL USER INTERFACE shows the source code with syntax highlighting and also displays the matching parenthesis in the code After finishing the changes the buffer should be saved and then be killed by the Menu Files gt Kill Current Buffer EMACS will ask if the command should be evaluated in PROMOT users can choose no
65. ect oriented Modeling Models in the form of 1 can be built within PROMOT using object oriented modeling Therefore the considered system has to be isolated from its environment The model of the system itself will then be aggregated from structural and behavioral modeling entities Structural modeling entities SME describe a segmentation of the system under consideration In process engineering the spatial structure is often used as the basis of the structure For a good structural design of the model in PROMOT it is recommended to use the network theory Gil97 There are two different types of SME modules and terminals Modules can be storage containing components or storage free connection elements see for details Most Models can be structured into components and connection elements Mod ules are separatable material parts Mar96 page 46 of the system under consideration eg control volumes phases phase borders walls control surfaces phase border surfaces signal transformers controllers storages substances in a phase and transformers reactions in a phase The border of a module is described by its terminals With the terminals the module can exchange material momentum energy and information The model of the complete system is also a module The mathematical model of a module consists of associated behavioral modeling entities BME BME are scalar or indexed ordinary differential equations algebraic equ
66. ectly on the same data the modeler can switch between this two ways of modeling The resulting models can be written from this internal representation into MDL The modeling language is therfore also used as storage format for the modeling libraries The GUI incorporates the text editor EMACS for 1 2 PROMOT models 7 modeling entities i I Lisp Java ProMoT Kernel Promot GUI Internal Be Base Mdl Int t Mdl Writ Class Browser Visual Editor nterpreter riter i 77 Aggregationview Mad y ORBLINK Ji Visual Explorer nstantiator CORBA Frames Structure view modeling entities Cg Writer KH Inheritance View Cg Input File process unit model Code Generator CG x Simulation Module Fortran Simulation Environment DIVA Fortran Figure 1 Architecture of PROMoT changing the source code of the modeling entities For installation instructions to use PROMOT see Appendix C You can also try out the step by step tutorial found at http www mpi magdeburg mpg de projects promot under Documentation PROMOT makes it possible to use modeling knowledge bases In the directory usr local promot promot kb and its subdirectories some common knowledge bases for different modeling domains are sto
67. ed like real parameters with an integer value They are also often used as switches in conditional expressions Real and integer parameters may be changed on the DIVA command prompt with commands like changeblo Structure parameters are a special kind of parameters that act as special numbers for indices They are used to determine the run length of different indices in equations and arrays consistently They may not be changed in DIVA 36 5 BEHAVIORAL MODELING ENTITIES attribute system theoretic system theoretic type variable vektor state state x input input state u X output output state y x structure parameter structure parameter p integer parameter integer parameter p real parameter real parameter p help help h index index For input and output variables the system theoretic attribute in the model definitinon is not necessarily used during the simulation but it depends on the links the module is connected with If input or output variables only appear in terminals that are connected internally in the PROMOT model these variables become state variables during simulation Only if these variables are present in terminals of the top level module they become inputs and outputs and can be used to connect this module with other DIVA models during simulation see Section 4 1 2 The system theoretic types in PROMOT are realized by a class hierarchy like the modeling entities That is assigned a
68. electing an element with the left mouse button and pressing any alphanumeric or the lt backspace gt key Then the name becomes editable and can be changed The editing is finished with the lt return gt key Alternatively the name of a part can also be changed by the Edit Details dialog which can be reached by the context menu For the geometric layout of the model all parts can be moved by dragging them with the mouse Several parts can be selected and moved together Therefore a rectangular selection can be drawn by pressing the left mouse button on the free background of the work window holding it down and dragging a rectangle across all parts that should be selected Alternatively one can use the left mouse button together with the lt shift gt key to add or remove elements to the selection Another method for editing the layout is the so called broom When pressing the lt control gt key and the left mouse button at the same time and moving the mouse horizontally or vertically a thick line appears that pushes all parts to a certain line The length of the line can be extended by moving the mouse orthogonally to the brushing direction The broom is also available by a button on top of the work window By pressing the right mouse button on a part in the work window a context menu appears that allows several editing options for that part 7 5 PROMOT VISUAL EXPLORER 61 View Class Source The current part is a strong part of the edited
69. ematic Expressions The syntax of unquoted math expression in MDL is in most cases the same as arex in the CODEGENERATOR input language K 00 only variable ref is defined differently and the defi nition of diff expr and math relation is added variable ref slot path element unquoted slot path diff expr unquoted math expression diff lt t gt variable ref math relation side unquoted math expression diff expr unquoted math expression diff unquoted math relation math relation side math relation side math expression unquoted math expression math relation unquoted math relation array of math expressions math expression array of math expressions A 3 Slots und Slot Paths unquoted slot name alpha character alphanumeric character _ slot name unquoted slot name list of indices unquoted math expression unquoted math expression slot path element unquoted slot name unquoted slot name list of indices unquoted slot path slot path element parent slot path element slot path funquoted slot path list of slot path slot path A 4 Names for modeling entities class name quoted string list of class names C class name A 5 Commands 67 A 5 Commands command definition command file command definition command
70. en to DIVA for simulation Therefore the model output dialog is used It allows to specify the filenames for the DIVA model to generate and shows eventual error messages if the model fails in consistency checks of PROMOT or the CODEGENERATOR All these parts and the editing possibilities are introduced in more detail in the following sections Most of the interactions the user can start in the GUI are initiated with the mouse The left button selects modeling entities menu entries or other graphical objects the right button usually 52 7 THE GRAPHICAL USER INTERFACE presents a context menu for the current object In the PROMOT VISUAL EDITOR many actions are performed using Drag amp Drop functionality to draw structural flowcharts 7 1 ProMoT Browser L J 113 13 File Edit View Options Help modeling entity define module 3 behavioral modeling entity class EVE 3 structural modeling entity isuper classes module 9 F module gt e cyclic pred 9 eff library gt e help F psi 9 e reactions signal transformer o F storages ef mapk_modules o ef activation cycle LF mapke F raf ras_modu amp terminal Server IDLE Figure 11 The class browser of PROMOT showing example modeling entities for modeling in the field of Systems Biology The browser is the part of the GUI that is shown directly after the startup It contains a tree view of the modeling entities that are cu
71. er classes Section 3 must be subclasses of terminal or the class terminal itself The general form of define terminal is defined by the following EBNF Rule define terminal define terminal class class name super classes list of class names documentation quoted string geometry side top bottom left right geometry position property slot link color color name properties property slot variables variable slot In addition to the general options described in Section 3 the option variables may be used to describe variables that are contained in this terminal Internally in the PROMOT system a terminal is a container of variables variables variable slot optional Definition of the variables of a terminal There is a distinction between e elementary terminals and e indexed terminals 4 2 1 Elementary Terminals For the definition of the terminals in the example models tank Section and two tanks Section 4 1 2 the command define terminal is not used But the option terminals is used to define the elementary terminals of these modules In the option variables the variables for the molar input and output flux are assigned as weak parts of the respective terminals The important point in this assignment is the naming of the variables While assigning the variable jen and jan to the terminals the variables get a name that is valid for them in the
72. fine parts see Section 6 1 Parts are named attributes whose val ues are modeling entities itself If a modeling entity has parts it is called a container The names slot name of parts and attributes are alphanumerical character strings that must start with a letter and may contain the under bar _ as the only special character Every name of a part or attribute must be unique in the context of its container The name t is reserved for the simu lation time and can not be used for user defined parts In the following sections the commands define module define terminal define variable and define equation are discussed in detail When PROMOT reads this MDL commands it checks their syntax and translates them into FDL commands FDL Frame Definition Language Tr 98 provides the data structures for the internal storage of PROMOT based on a knowledge representation so called frames FDL is specialized in repre senting containers as aggregations of parts and specializations of superclasses By executing the FDL commands the modeling entities defined in MDL are translated into class objects that are the physical storage for a frame of FDL This class objects can be directly manipulated using the PROMOT VISUAL EDITOR see Section 7 They are also able to generate their own MDL command to store their definition in a file 19 4 Structural Modeling Entities The modeling entity structural modeling entity is the ancestor of all structura
73. g with these entities further modeling entities can be defined by inheritance and aggregation New 2This is necessary because other parts inherited from the superclass will become inconsistent if they rely on the omitted attribute dx 3Dynamic states x are those that appear in the derivative expression Tr in a differential equation 2 4 Modeling entities 15 modeling entities are in any case subclasses of the basic modeling entities module terminal variable equation place and transition PROMOT provides the feature of multiple in heritance but the subclasses of the basic modeling entities must form distinct class hierarchies i e no modeling entity may have two of the basic classes as direct or indirect superclass Basic modeling entities are present in PROMOT after the start of the program The user can also load his or her favorite standard classes from a knowledge base by adding some commands include lt filename gt into his or her HOME promotrc 16 3 THE MODEL DEFINITION LANGUAGE MDL 3 The model definition language Mdl Modeling entities can be created using the object oriented modeling language MDL In MDL the following commands can be used e include ecd e define module e define terminal e define variable e define equation The first two commands are used to work with structured source files and directories include loads a MDL source file and cd changes the current directory of the PROMOT system All files
74. h and stores this reference under the given name in the container Slot paths A slot path is a list of slot names indexed slot names or back pointers parent that are separated with a dot With slot paths in PROMOT it is possible to access parts across one level of the aggregation hierarchy Slot paths are mainly used to define weak aggregations and links But they may also be used in equations and help variable values to access variables in terminals or submodules directly see page 30 9It is also impossible indirectly so a module can never be a direct or indirect strong part of itself 8 10 11 12 13 6 1 Aggregations 47 6 1 2 Internal part classes A modeling entity can be instantiated many times as a strong part of other modeling entities For example the module tank is used twice as a part of the cascade two tanks But both of these parts are independent of each other And the tank can also be used alone In its definition with define module nothing is mentioned about its aggregation relations And the tank itself is not changed with the definition of instances inside two tanks For some strong slot definitions the instantiation is not that simple The terminal in of tank is an instance of terminal But it owns an additional slot jn that is not present in terminal terminals in is a terminal variables jn is eq to parent jen out is a terminal variables jn is eq to parent jan
75. he file with this name the CODEGENERATOR writes the parameter and initial values for the simulation model The name must end in dat and the prefix can be at most 5 characters long and may not start with c This file appears again in the anl file diva latex file name Into this file the CODEGENERATOR writes LaTeX code to document the complete model This documentation contains tables of all variables and equations of the model diva anl file name This file is generated by PROMOT for the sake of simplicity It contains a DIVA plant description for the case that a closed PROMOT model is written to DIVA In this file the FORTRAN subroutines named by the diva fortran files subname and the block data in the diva data file name get connected This file can be immediately used for closed models in the command inianl in Diva 4 2 Terminals 29 4 2 Terminals Terminals describe the system interface of modules A terminal defines a logical collection set of variables that should be connected as a unit in one step This set of variables is a subset of the variables of the modules itself When coupling a terminal to a terminal of another module coupling equations are established Through the terminals the inner state of a module is made accessible to the outside The modeling entity terminal is a direct subclass of the structural modeling entity A terminal type is defined by the MDL command define terminal The elements in the list of sup
76. he graphical representation as modeling entity tank in PROMOT with two terminals e the molar flow out of the outlet algebraic state depending on the holdup There is only one input value the molar flow J n in the inlet and one output in the outlet Ja n which is also a molar flow In general the set of outputs is a subset of the state variables Here the Vector of outputs is constructed with y C x 0 1 x Jaln 2 Model parameters are e the gravity constant of earth g 9 81m s e the molar concentration c of the liquid e the average cross section A of the tank e the cross section A of the outlet The model equations are formed in a balance view on the modeling task The flow sheet of the system in Figure 3 is a control volume that contains the molar holdup n of the liquid The change of n in time is equal to the sum of all flows across the system border dn de demi Jaln t gt to 2 The initial condition of the dynamic state n is the holdup no of the tank in time to n to no 3 The last equation calculates the algebraic state variable J n The kinetic energy of the liquid inside the tank should be neglected Therefore the flow out of the outlet is determined by Torricellis law Ja n cAay2gh combined with the liquid level 4 n hk A 5 int Age 6 A 1 3 Introductory examples 11 The whole equation system for the model consists of the differential equation and the algebraic equation 6
77. hem and to start any of the other parts of the GUI e Some views that visualize the inheritance and aggregation relations of some selected mod eling entities These are the heritage views subclass and superclass views that show the ascendents and descendents of a modeling entity as a graph instead of a tree as in the browser which is not well suited for multiple inheritance Further there is the aggregation view that presents the strong and weak aggregation parts see Section 6 1 of one modeling entity And finally there is a source view for showing the source code of the modeling entities and especially the variables and equations e The PROMOT VISUAL EDITOR allows to edit the structural aggregation of a single module The user can change superclasses submodules terminals and links as in a drawing program e The PROMOT VISUAL EXPLORER is a flexible view and shows the aggregation of the structural entities in a module i e submodules terminals and links across multiple levels of hierarchy as they where defined graphically in the visual editor e It is also possible to edit the source code of a modeling entity within the Gur Therefore a rather rudimentary JAVA text editor can be used or the fully featured editor EMACS is invoked Users are strongly encouraged to use EMACS because it helps with features like syntax highlighting and parenthesis checking to find or avoid many typical errors e Last but not least the model must be writt
78. information 56 7 THE GRAPHICAL USER INTERFACE About Shows a About dialog with information about curretn version of PROMOT and used external software packages and their licences Online Help Starts the default external web browser showing the homepage of PROMOT with further information 7 1 3 Pop up Menu For every modeling entity in the tree of the PROMOT BROWSER a context sensitive pop up menu can be shown with the right mouse button The menu works for the current modeling class which is the class where the mouse was over when the right mouse button was pressed In Figure 13 the class cyclic_prot_enl is the current class S ProMog User Interfac Ta File Edit View Options Help e cyclic_2_prot_en1 ja Cyclic prot Z ra Select Class In Tree e cyclic prot View Source F library Superclasses T help ubcl I psi Visual Explorer 9 reactions p e kinetics Browse Diva Model 9 e cata Add Subclass gt d copy Class Edit Source gt d Visual Edit o gf Delete Delete e Change Icon gt ef mmse ina lI Server RUN Figure 13 Pop up Menu of the browser for the class cyclic prot enl The item Subclasses is grayed because this class has no subclasses Select Class In Tree Select the class in the browser tree View Source Launches a separate window that shows the source code of the current class Superclasses Launches a
79. intra s Figure 15 Aggregation view for storage intra_s The module contains a terminal cs two variables and an equation The terminal is the strong container for another variable cbound and uses the variable c as a weak part 7 4 ProMoT Visual Editor For definition of modules based on aggregation and coupling of other modules the visual editor can be used It is launched by the pop up menu of the PROMOT BROWSER by double clicking on a specific class in the tree or by the Heritage Viewer The PROMOT VISUAL EDITOR works like a Drag amp Drop based drawing program for one module As Figure 16 shows the editor window consists of two parts the palette and the work pane In the palette the modules and terminals can be selected in order to aggregate them to the module Modeling entities in the palette are drawn in the palette with their name and their graphical representation which is also used in the work pane on the right hand side Under the tabs Terminals and Modules terminal and module classes can be found respectively It is possible to put new classes into the palette via Drag amp Drop from the PROMOoT BROWSER In the tab Superclasses the current superclasses of the module are shown It is also possible to change the superclasses by dragging other module classes into this pane But it is possible that a new superclass replaces an old one completely to fulfill the inheritance rules see Section 6 3 Classes can be delete
80. ion molar flow 20 define variable class area super classes variable unit m 3 documentation area 25 define variable class acceleration of gravity super classes variable system theoretic real parameter value 9 81d0 unit m s 2 30 documentation gravity constant define equation class material balance super classes equation relation diff lt t gt n jen jan 34 5 BEHAVIORAL MODELING ENTITIES 35 40 45 50 55 60 65 70 75 documentation material balance define equation class toricelli super classes equation relation 0 0d0 jan jan 88 88 2 000 c n a documentation torricellis law for the outlet define module class tank 3 super classes module documentation Pure substance tank terminals in is a terminal variables jn is eq to parent jen out is a terminal variables jn is eq to parent jan variables n is a molar holdup system theoretic state report all jen is a molar flux system theoretic input jan is a molar flux system theoretic output a is a area system theoretic real parameter value 1 080 documentation cross section of tank aa is a area system theoretic real parameter value 0 1d0 documentation cross section of outlet c is a molar concentration system theoretic real parameter value 55 0d0 d
81. ition of a maximal value that the variable may reach during simulation relative error math expression optional Definition of the numerical that is assumed for that variable unit math unit expression optional Definition of a physical unit for the variable In the actual version of PROMoT this is only used for documentation purposes report all optional This denotes that the variable n should be written as a simulation result from DIVA 41 Modules 23 equations equation slot optional Definition of the equations of a module 50 equations bal n is a equation 51 relation diff lt t gt n jen jan 52 documentation balance for the molar holdup 53 fd_out is a equation 54 relation 0 0d0 jan jan aa aa 2 0d0 g c n a 55 documentation torricellis law for the outlet 56 The general form for the definition of a single equation looks like equation slot slot name is a class name documentation quoted string properties property slot indices index definition relation math relation variables weak slot The following attribute may be used 18 8 class name optional Using a predefined equation class for this equation The given class must be a subclass of equation If this option is omitted the class of a possibly overridden inherited equation in a superclass with the same name will be used
82. l modeling entities and therefore of all modules and terminals see also Figure H This section is divided in two parts The first part describes the properties of modules and explains how modules with the command define module can be defined as subclasses of module Furthermore at the example of a tank cascade is shown how elementary modules can be aggregated to form compound modules The second part deals with the definition of terminals as subclasses of terminal 4 1 Modules Modules are separatable material parts Mar96 page 43 of the modeled system Examples are control volumes phases phase borders and walls areas surfaces of phases and signal trans formers controllers The systems border of a module is described by its terminals Through a terminal the module can exchange material momentum energy and information with adjacent modules Module is a direct subclass of the structural modeling entity A new module is defined by the command define module The elements of the list super classes Section B must be either direct or indirect subclasses of the class module or the class module itself Super classes of another basic type e g terminal are not allowed and cause an error In the simplest case see example in Section 1 3 2 a module is a direct subclass of module In addition to the universal command options of SectionB class super classes documentation define module has the options terminals variables eq
83. le tank are defined as in and out Both attributes get in this case internal subclasses of the class terminal which are automatically generated by ProMoT This internal classes contain some weak parts that are assigned with the command option variables The terminal in contains the part with the name jn which is a reference to the part jen of the module tank which is in this case the parent of in The terminal out gets the weak part jn respectively which refers to the part jan of the tank Therefore in contains the input variable jen of the module tank whereas out contains the output variable jan But in both cases the different variables are named jn inside the terminal in or out This assignment exports the variables as an interface to the module tank The example tank is a device model As described in Section L 2 the terminal variables of a device model are written as input or output variables to the regarding CODEGENERATOR input file In this case the variables are jen and jan terminal slot allows a list of terminal definitions which must contain at least one terminal see also Appendix B In general the definition of a terminal can use the following options terminal slot slot name is a class name documentation quoted string properties property slot indices index definition variables weak slot weak slot A terminal can not only be a strong slot with the command o
84. lor in the source code The value of this attribute can be a color name of black blue cyan gray green magenta orange pink red white or yellow If two or more terminals in a link specify different colors the color of the first terminal encountered in the link is used The link color is an attribute should be preferably specified for a predefined terminal class to show the kind of connection that is established by the link A strong terminal of the module can be created by dragging a terminal from the terminal palette into the work window Weak terminals can be established in two ways e By creating an arbitrary strong terminal and connecting it like drawing a link with a free terminal of a submodule The strong terminal is then automatically transformed into a weak terminal e Using the context menu of a submodule by clicking with the right mouse button on the submodule In the submenu Connect Terminals there is an entry for every terminal of the submodule to propagate it as an external terminal After selecting one of the menus entries a new external terminal appears that is a weak part referring to the named terminal All parts in the edited module are named When creating new parts they get a unique name based on their class name automatically The name is shown for submodules above their graphical representation and for terminals below or right of the graphical representation The name can be edited by s
85. m theoretic structure parameter i 18 8 variable system theoretic index jn is a variable 10 system theoretic input value 10 0d0 define terminal class vector of outlets super classes terminal 4 2 15 20 25 30 35 40 45 60 65 Terminals 31 documentation Vektor von Ablaeufen indices index i lower 1 upper nt variables nt is a variable system theoretic structure parameter i is a variable system theoretic index jn is a variable system theoretic output report all value 10 0d0 define module class mimo tank super classes module documentation Reinstoffbehaelter mit beliebig vielen Zu und Ablaeufen terminals in is a vector of inlets variables nt is eq to parent ne out is a vector of outlets variables nt is eq to parent na variables ne is a variable system theoretic structure parameter value 2 documentation Anzahl Zulaeufe na is a variable system theoretic structure parameter value 3 documentation Anzahl Ablaeufe i is a variable system theoretic index n is a variable system theoretic state value 100 0480 minimum 0 0d0 maximum 200 0d0 unit kmol report all documentation Molinhalt a is a variable system theoretic real parameter value 1 0d0 unit m73 documentation Grundflaeche
86. may lead to some pitfalls e Inherited parts can not be renamed If a submodule or terminal is originated in a superclass the name is given in that class and can only be changed when editing the superclass Therefore all renaming possibilities are deactivated in the visual editor e Inherited parts can t be deleted As explained in Section a subclass can only define additional or more specific parts All inherited parts are also present in the subclass and all deleting functions of the editor are therefore disabled 7 5 ProMoT Visual Explorer The ProMoT VISUAL EXPLORER shows the aggregation of the structural modeling entities with the geometrical diagram information and the icons similar to the visual editor But here the presentation is not limited to one single level of the hierarchical structure but can be extended as shown in Figure to an arbitrary depth The submodules and the links between them are shown for the current module and also for all submodules Since a complex model would not fit completely to the screen if all details are presented at once the user has to select the module of interest The PROMOT VISUAL EXPLORER offers several modi for exploration Hierarchy Zoom By clicking into a certain module with the left mouse button this module is zoomed to window size Internal details becomes visible but other parts of the model get zoomed out of the window For zooming out just click with the left mouse button somewhere outsid
87. mentary lerminals o Indexed Terminals 5 1 Variables ion ee eee Q Naa he eee ee wR Aw Re QQ sh 5 2 Equations 2 Bato SAW fd a gend 6 Relations between modeling entities 6 1 Aggregations 6 1 1 Strong and weak aggregation ee 6 1 2 Internal part classes 13 13 14 14 14 16 19 19 19 24 27 27 29 29 30 33 35 35 36 37 42 42 43 gt LIST OF FIGURES 6 2 Coupling relations s z e xcu 2 2a mn era aa es 48 6 3 Inheritance relations ls 48 7 The Graphical User Interface 51 7 1 PROMOT BROWSER s s sa a madi r e a Ea ela Css Ua W wO 52 711 Browser Tree 2 2 7 53 1 1 2 Pulldown Menus e 53 1 1 3 Popsup Menu i 5 34 2 2 RES EA dc wed 56 2 Heritage Viewsl 2 4 80 e ee Hea oe Pee ee Eee SEER 4e 9 bo oo Gs 97 1 3 Aggregation VIEW sse erem 44 A A RR 97 4 PROMOI VISUAL EDITOR ooo REY TA 58 7 9 PROMOT VISUAL EXPLORER wa a w a w n a a n 6 6 4 5 61 26 Text Editor o y pni aea ce hs PRS Se Bae ae ee oe wed 63 7 7 Model Output Dialog for DIVA Rh 64 A Mdl Command reference 66 A 1 Strings and Symbols gt sses sa aasam aaraa sss a s k ww w 2 R k w 66 A 2 Mathematic Expressions aooaa 66 A 3 Slots und Slot Paths e scs 2s 66 A 4 Names for modeling entities es 66 I CLTC 67 B Introduction to EBNF 70 C Get
88. model should be used as device model that is connected with other device models in a DIVA anl file then variables of the type state are not allowed variable slot optional Definition of the variables of the module Variables are all named numerical entities that can be used in mathematical expressions Like terminals the variables are defined as parts of a module Excerpt form Section 12 13 14 15 16 17 18 19 20 21 22 23 variables n is a variable system theoretic state value 100 0d0 minimum 0 0d0 maximum 200 0d0 unit kmol report all documentation molar holdup jen system theoretic input value 10 0d0 z Within variables all states inputs outputs intermediates help variables parameters and indices are defined that occur in the model of 8 In the example the variables n are defined as a state and jen as an input of the module tank respectively In general the definition of a single variable looks like this 22 4 STRUCTURAL MODELING ENTITIES variable slot slot name is a class name documentation quoted string properties property slot indices index definition system theoretic state input output help structure parameter real parameter integer parameter index positive vector direction in out value math expression array of math expressions minimum math expressio
89. modeling entity This section is divided into three parts in the first one is explained how scalar variables can be defined with the command define variable The second part deals with the definition of equations with define equation Finally in the third part it will be shown in an example how indexed variables and equations can be used For the definition of tank Section and two tanks Section the commands define variable and define equation have not been used Instead the variables and equations inside tank have been defined implicitly as instances of variable and equation with some local specializations Alternatively and in the same manner a modeler can predefine classes of variables and equations with common attributes Therefore the commands define equation and define variable are necessary With this method it is possible to define meaningful variable types for often used physical quantities and common equations and to store them in a modeling library A definition that is equivalent to tank looks like the following 1 define variable class molar holdup super classes variable value 100 0d0 minimum 0 0d0 5 maximum 200 0d0 unit kmol documentation molar holdup define variable class molar concentration 10 super classes variable unit kmol m 3 documentation molar concentration define variable class molar flux 15 super classes variable value 10 0d0 unit kmol h documentat
90. module and the source code of the is a class can be opened in a text viewer Select Class in Tree The class is selected and shown in the tree of the browser This is introduced because the browser allows all kinds of editing actions on classes and it does not make sense to include all of them in the menu of the visual editor Edit Details Opens a properties dialog that allows at the current state of implementation to change the name of the part and if it s a strong part to change the is a Slot Class class of the part The included list for the selection of the Slot Class contains all the matching classes from the palette but it is not only possible to select a class but alternatively the class name can also be typed into the text field Editing of variables is also provided By pressing the Set button in the dialog the edited attributes are changed in the PROMOT model Visual Edit Class Opens a new PROMOT VISUAL EDITOR window for the is a class of the current strong part Delete Removes the submodule or terminal from the current module This is only possible if the part is a direct part of the module and was therefore not inherited from a superclass Connect Terminals Allows to propagate one of the internal terminals of the current submod ule as a weak external terminal of the currently edited module Since modules in PROMOT are classes that may contain inherited parts some non obvious rules apply for the editing This
91. mponent tank mc tank is derived from the tank introduced in Section As the tank it has one inflow and one outflow But the mc tank contains a mixture of N components In its inflow the molar fractions te of the input flow must be specified in addition to the already known molar flow J n In the outlet also all molar fractions x of the mixture are present In addition to the total mass balance and the Torricelli equation of the model 7 component mass balances are necessary for the partial molar holdups ni a definition of the molar fractions x and since there is an algebraic constraint on the molar fractions a summation condition is used for the partial molar holdups This results in the following mathematical model for the mc tank d Je n Jaln t gt to 0 Jaln A2 2 5 gt to n to no dini T Jn tej nas 1 06 1 qt 14 n NX elus BA to Ne n Yin it gt to 1 nj to noj jj 1 Ne The mc tank is defined as direct subclass of tank Therefore mc tank inherits all terminals variables and equations of tank Only the new parts must be described and the terminals in and out have to be specialized 1 define module class mc tank super classes tank documentation Multi component tank terminals in variables nc is eq to parent nc 5 x is eq to parent xe out variables nc is eq to parent nc 44 10 15 20 25 30 35 40 variables nc j
92. n relation math relation variables variable slot relation math relation optional Definition of the mathematical expression of the equation In contrast to a value see page 88 a relation must contain a mathematical re lation 1 6 a mathematical expression that contains one equal sign For dif ferential equations the expression may contain sums of differential terms in the form unquoted math expression diff lt t gt variable ref where variable ref must refer to a state variable see Appendix A PROMOT trans forms expressions of this form into the linear implicit form that can be handled by DIvA see in Section 1 variables variable slot optional Assignment of variables as parts of the equation This makes sense if the equation has been specified outside the context of the module and the names of the used variables do not match to those used in the module In this case a mapping can be defined as a list of variables using the option is eq to see example in the code of tank 3 on page 33 5 3 Indexed variables and equations 43 5 3 Indexed variables and equations Je n mc tank NG Jaln x Jan 2 Figure 8 Flowchart of a single phased multi component tank with one inflow and one outflow In this section a multi component tank should be considered as an example for the use of indexed variables and equations The multi co
93. n maximum math expression relative error math expression unit math unit expression report all The following part options may be used is a class name optional This defines the class of the variable This option is optional and the rules mentioned above for the terminals apply here too The attribute options documentation properties indices system theoretic positive vector direction report value minimum maximum relative error und unit correspond to the command options of define variable that is described in more detail in Section In the case of n a very explicit description of a variable is practiced so nearly all applicable optional options are used Instead the definition of jen only specifies the essential and non optional things system theoretic state input output optional Assignment of a system theoretic type to the variable n is defined as a state of the module value math expression array of math expressions optional Definition of a value for the variable This value is a mathematical expression The syntax of the mathematical expressions is almost the same as in the CODEGEN ERATOR language K600 and is explained in Section For a state variable the value denotes the initial value minimum math expression optional Definition of a minimal value that the variable may reach during simulation maximum math expression optional Defin
94. ng of basic unit names e g m s or 1 s Up to the actual PROMOT version this information is mainly used for docu mentation purposes and is written as part of the meaning into the CODEGENERATOR input file and to the DIVA model code It is planned to check the units in the model but currently there is no such test implemented report all lumped distributed none optional Output of this variable as a DIVA process value during simulation report specifies if and how the DIVA simulator should write the value of this variable to the output file Iumped and all are synonymous for compatibility reasons If this is specified every variable will be written as a single value to the pvkey of its module If the report is given as distributed and the variable is indexed the variable can be plotted across its index value with the matlab plotting tool The report option can also be inherited from superclasses and writing variables to the output file can be locally switched off by specifying report none report also inhibits that a help variable is removed from the model by the model optimizer 5 1 Variables 41 dont optimize yes no optional Inhibit the optimization of this variable Before writing a model for the simulation environment PROMOT optimizes the result ing equation system During this process some system variables are changed into help variables and some latent help variables are removed from the
95. ntials with the same name in a link are equal For the terminals t 1 lt i lt nt with the potential variable p the following nt 1 equations e are created e t p ti 1 p 1 lt 1 gt nt 6 3 Inheritance relations Inheritance relations are established in the definition of modeling entities as subclasses of other modeling entities as well as in the creation of strong parts as explained in Section 6 1 2 A modeling entity inherits all e strong and weak parts e property attributes and e coupling relations of its direct superclasses The modeling entity may define additional direct attributes and couplings The set of all parts properties and couplings of a modeling entity is defined as the union of the inherited and direct parts properties and couplings respectively Inherited parts can be specialized locally For instance it is possible to define the value of a variable part in a module It is also possible to change the type of an inherited module to a subclass of its original 6 3 Inheritance relations 49 type It is not possible to forget or delete parts Subclasses are in every case more specialized and should have more parts and attributes They can not be more general than their superclasses and can not have less parts Multiple inheritance imposes some rules for the superclasses and the priorities of the inherited attributes A class may have multiple direct superclasses but these classes must not have an inherit
96. ntly This causes a conflict that is resolved by PROMOT using the order in the list of super classes The definition of acetic acid tank defines super classes tank acetic acid device so tank appears first in the superclass list and therefore its definition of rho is priorized That is why the rho in acetic acid tank has a value of 3 This priorization rules apply not only for variables but for all inherited attributes and parts For the crossed out relations in Figure PROMOT issues error messages Error messages are also issued if the definition of a modeling entity tries to merge two or more of the base classes supplied by PROMOT see Figure 4 e g 50 6 RELATIONS BETWEEN MODELING ENTITIES tries to define super classes module terminal The specialization hierarchies below each of the base classes must be disjunct It is possible to specialize inherited parts locally It is also possible to change the kind of aggregation for an inherited part The following pairs of inherited and local parts are allowed in PROMOT inherited part local part strong strong strong weak weak weak It is not allowed to override an inherited weak part with a local strong part see also Tr 98 In any case the local part must match the type of the inherited part A inherited part can only be replaced by an instance of the same class or a subclass of it Therefore it is not possible to replace the variable c that is a conce
97. ntration by a variable that is a molar flux 51 7 The Graphical User Interface The interactive modeling environment of PROMOT version v 0 8 4 comes with a Graphical User Interface GUI that is programmed using the Java Foundation Classes so called Swing It is started automatically when PROMOT is started from EMACS An alternative to EMACS is to start PROMOT on a normal command line by the command promot On the command line as well as in EMACS the two parts of the interactive modeling environment the PROMOT kernel and the PROMOT GUI are then launched as separate processes that interact with each other see Figure 1 The GUI presents graphical views on the modeling entities that are present in the kernel It is possible to stop and restart the GUI from the EMACS menu Promot gt Start Promot User Interface or with the command promot ui on the command line without loosing data since all the modeling data is contained in the kernel This may be useful if the GUI suddenly crashes On startup the kernel and the GUI start and connect to each other It is only possible for a user to have one PROMOT kernel running at the time because this program registers with a global name and the GUI connects to this kernel However the user can have multiple GUI communicating with a single PROMOT kernel The GUI consists of several parts namely e The PROMoOT BROWSER as the central unit to show the available modeling entities to manage and find t
98. ocumentation molar concentration of water g is a acceleration of gravity equations bal_n is a material balance variables n is eq to parent n jen is eq to parent jen jan is eq to parent jan fd out is a toricelli variables a is eq to parent a aa is eq to parent aa c is eq to parent c g is eq to parent g n is eq to parent n jan is eq to parent jan In this example the variables molar holdup molar concentration molar flux area and acceleration of gravity are defined as direct subclasses of variable and used as parts of the module tank 3 The equations material balance and torricelli are defined as subclasses of equation and also used via is a inside of tank 3 This variables and equations can also be used as parts of other modules 5 1 Variables 35 5 1 Variables Variables describe together with the equations the continuous mathematical model of a module For the definition of variable classes the MDL command define variable can be used With these class definitions a semantic hierarchy of variable classes like concentration molar holdup heat flux etc can be specified Besides this variables are classified by their system theoretic type and their vectorial direction It is possible to use variables as scalars or in an indexed form arrays 5 1 1 System theoretic type system variable help parameter index NS state input r
99. of the modeling classes in the tree 7 1 1 Browser Tree The browser tree shows the actual class library If new classes are created or classes are deleted it should reflect these changes The tree entries show a special icon on the left which indicates if they have subclasses e g class cyclic_pred in Figure 11 Clicking on this icon expands the view on the subclasses which has been done for mapk modules in Figure T1 For using structural modeling entities the user can drag entities from the tree to the PROMOT VISUAL EDITOR The tree shows also the documentation string for the classes under the mouse pointer in a tool tip bubble help if the mouse rests for some seconds on one specific entry Information about the class is loaded from the PROMOT kernel into the tree as needed 7 1 2 Pull down Menus 16 FIOMOIUSeranteriace File Edit View Options Help Open Ctrl O Open Recent gt Save All Classes elected Classes Run Script LJ Refresh F5 Import Export gt Exit UI Only 0 Exit UI amp Server Ctri Shift Q e auto mm 4 gt ed ent y Server IDLE Figure 12 Pull down menu of the browser The File menu was selected 11This means if a lot of classes have to be shown for the first time in the tree there may be a delay This applies especially if the Select menu is used 54 7 THE GRAPHICAL USER INTERFACE The different pull down menus of the browser are expl
100. orye13uoouoo IOJ euru yndu yes 0 5 960 ula ULI93 938 10IS ULIII yo UOTJBIJUIIU0I feuSis uorge1gus9u09 e Puw mdmo WIE Puw UulLloj gt ur 10 yes 9e3s uorye13uoouoo 10 euru mdmo yes w1 ULI93 UOTIIBII ULIOI ur UOTJBIJUIIU0I Teusis uorjerjuoouoo IOJ euru ynduf ur uonegueouoo WIE Puw ULIo3 Sompour squouio o Kyrquo Sutr opour j9ouuoo5 01 pesn s d puw e SUTUTeYUOD sse otodng 8 199 198 sod JDUIULLI 10005 q uoJ sasspjaL1adng 9D198Q Y IUDU SSDIO 91 xnpg og e1ojs Y ur XN Y 10 TVUTUTIAT xni obesos uu l 293810 S ULIO Arelqm xng xnj uorjoeod aq JO UOISIOA jXou ur P9AOWSI oq IM sse pojeoo1do xny uonoeej uuel UOT OVOI ULIO 4X9 ULI0 5 Y ur XN V 10 EUon xnij uonoee we euru 10 n uondioso q uoop sassD o4oadng 39D198Q y IWDU SSDID 92 F SHORTCUTS AND MODIFIERS OF THE PROMOT VISUAL EXPLORER F Shortcuts and modifiers of the ProMoT Visual Explorer Operation Menus Open node menu Open edge menu Shortcut Click right button on entity Click right button on entity Mode Interactive Zoom Zoom in Zoom out Pan Mode Hierarchy Zoom Zoom in Zoom out Fit network on screen Pan Mode FishEye Zoom Zoom in Zoom out Pan Mode Focus Zoom Zoom to Pan Hold down left button Drag right Hold d
101. osed module is described by a mathematical model that has a similar form as the model 8 In a composed module this model consists of the models of the 26 4 STRUCTURAL MODELING ENTITIES J submodules and the coupling equations connecting the different submodules Bo x u p t xo fo x h u p t Bi x h u p Xj f x h u p t DA System e eee we t gt to B x h u p t XJ f x h u p t 0 Xg K x K gt x nenn a 7 B x h u p t f x h u p t ho go x h u p Intermediate assignments Bi g Oc bom pt t to h 8J x h u p t h g x h u p t Initial Conditions x to Xo Output Assignments y C x t gt to The DAE of the modularized model 9 consists of J 2 partial systems e the direct system Bo x h u pP t UX fo x h u p t contains the equations that are directly contained in the top level of the composed module This equations may determine global quantities that apply to all of the submodules e the subsystems B x h u p t x f x h u p t pl L 2 u J are contained in the J submodules e the coupling system 0 K XU K contains the coupling equations that connect the interface variables in the connected ter minals of the J submodules The variable vectors x u y h and p are the union of all variable vectors of the submodules and the direct variables of the composed module Although in general the variable sets of th
102. ouuoo A y99 11p oq 3ou uw spunoduioo jeqj 930N seroeds urej1oo Jo suorjeogisse o Te noe our uoururoo ouios urejuoo sosse oqns oq x1oMjou Sur eusis Y ur sojejs 89130 opour OY posn ore spunoduon redqt 39n 138 sod punoduioo o npour sod 1010 5 KAy yuo Zumopout Temgan gs sod o npour uo11da49s cT uoJ sassD o4oadng qIDLISQV IULDU SSDI 77 punoduioo ou esegm urnmbiqn eseDi uninbign Ca punoduroo ou 10 98 SUue 1 Jopejsuen Sur opour 8 10 enom osje 998 uoryej rdi qur eorgo OIq Ie e jnoujrA4 Ay yuo eoryeuroqgeur e ATUO st stq3 mq sjood yyoq jo syno xpouy Ssno9uey nus SAO e SI Sood 7100 jo uomn wAr o ayy 1oj pa1mbgal st YOM papnqaut st ITOAIOSOL V oseo STY up pare pouw oq 04 UOrye n391 Jyu grp 10 99 Y ur uoryezt e5o yuslopip e Aypeotd Ay serjy1edoad yourystp Ypa n our Urey 199 JO sjosqns oA FI o durexo 10 tuorjenjrs uoururoo SI SI poroprsuoo 016 o noo our Jo s ood e1oAos uym pasn ale sse SITY Jo squougo 4 Sse o eroods V 1 3 punoduroo ou IIOAIOSOI JJOM S 1 8 punoduroo ou 1o3doooi Jo1deooJ ra punoduroo ou oseyeudsoud esejeudsoud punoduioo ou od Ajousyd O ed jouayd punoduroo Jo ssepoqns se amp reqqr oy ur poureguoo you JO umouy A eo1 jou st od 3 soroads ayy Jl oq p nous 10710 sse OL ra punodutos ou 19130 Jayjo punoduroo ou puesi puebi ra punoduroo ou seur seuy uo
103. ow Run Script Runs PERL scripts to generate MDL code Refresh Updates the class tree Import Imports different formats through several submenus Supported are SBML models up to Level 2 Version 1 and logical models CELLNETANALYZER Export Exports different formats through submenus Supported are SBML models up to Level 2 Version 1 and logical models CELLNETANALYZER PROMOT also writes optimized model code for Diva Diana and MATLAB Exit UI only Terminates the GUI but not the PROMOT kernel it is connected to All the data in the kernel stays intact Exit UI amp Server Terminates the whole PROMOT Changed and unsaved modeling en tities in the kernel are lost This menu provides Undo Redo functionality It also starts editing functions for multiple selected classes in the tree If there are no applicable classes selected the functions are grayed Some of the editing functions for the selected classes are also available in the pop up menu of the browser tree Add Subclass Adds a subclass to the selected class Copy Class Creates a copy of the selected class Afterwards rename the new class Edit Source Starts a text editor for the source code of the selected classes see the Edit Source 7 1 3 entry for the pop up menu below Visual Edit Class Launches the PROMOT VISUAL EDITOR for the selected class Delete Deletes all modeling entities selected in the tree All dependencies are also re moved Changes are lost 7 1 PRO
104. own left button Drag left Hold down left button Ctrl Drag Click left button on entity Click left button on entity Click left button Shift Hold down left button Ctrl Drag Click left button on entity Click left button on entity Shift Hold down left button Ctrl Drag Click left button on entity Hold down left button Ctrl Drag Mode Detail Overview Pan Zoom Mode Node Editing Move Resize all Resize bounds Pan Mode Edge Editing Move handle Add handle Delete handle Delete all handles Pan Click left button on gray box Drag Description Opens the context menu for nodes Opens the context menu for edges Zoom in the network Zoom out the network Move pan the entire canvas Zoom in to focused entity in hierarchical steps Zoom out to focused entity in hierarchical steps Zoom out the entire network to fit on screen Move pan the entire canvas Enlarge focused entity shrink all other entities Shrink focused entity enlarge all other entities Move pan the entire canvas Minimal zoom to focused entity Move pan the entire canvas Move pan the entire canvas Click left butt handle of gray bex D Click left button on entity Drag Click left button on handle Drag Click left button on handle Shift Drag Hold down left button Ctrl Drag Click left button on handle Drag Click right button on edge for context menu Click right button on edge
105. ply for the left hand side matrix B the right hand side function f and the vector of help variables e BER e f R n is the number of equations and state variables The intermediate variables are calculated by explicit assignments The user has to provide a model that does not contain algebraic cycles in the help variable assignments an example for such cycle isa 2b b c d d 3a b If unsure about the properties of the connected system one should use algebraic equations and state variables instead PROMOT optimizes the complete equation system and transforms algebraic equations to explicit assignments if possible 4 1 2 Composed Modules Description in Mdl Composed modules are defined like elementary modules with def ine module In this command two new options can be used modules and links As an example a cascade of two liquid tanks is described This cascade is defined by the following MDL command as the module two tanks 1 define module class two tanks super classes module documentation Kaskade zweier Reinstoffbehaelter modules t1 is a tank 5 variables n value 200 t2 is a tank links ti t2 terminals t out t2 in terminals in is eq to t1 in out is eq to t2 out Two instances t1 t2 of the elementary module tank are aggregated to the composed module two tanks The module tank is used in this command as a part of another module but remains
106. ports the definition of elementary modeling entities which can be aggregated to build composed modeling entities By multiple inheritance subclasses of elementary and composite modeling entities may be created where composite modeling entities inherit all parts of their superclasses By aggregation and inheritance knowledge bases may be designed whose modeling entities have standard interfaces as well as good documentations and may be reused and refined in a natural way This manual is an introductory guide to MDL and the modeling environment PROMOT for experienced DIVA and CODEGENERATOR users The object model and language elements of MDL are illustrated by considering simple modeling examples The graphical user interface and the use of the PROMOT tool are also described CONTENTS Contents 1 Introduction 11 PROMOT Architecture gt L2 PROMOOT models 4 zoom Rom OES DLA dA 4 eR ew ua Ld 293 b dead gee he dub 2424 2 dar 9 2 1 8 40 Mathematical model of the pure substance tank as ls d de gx GE DR e n ae 2 uad da d OE ek ure gogo ge d R A ded 2 Object oriented Modeling TT nda aa a ee oe fate SN ARA AA NA 3 The model definition language Mdl 41 Modules nta de Be a AS 4 1 3 Indexed Modules 4 1 4 DIVA specific definitions 222222 e nn 4 2 Terminalsl 4 2 1 4 2 2 Ele
107. pper math expression With the keyword index the run variable is given lower and upper specify the lower and upper border of the indexed interval There are multiple examples of indices in the following example model name quoted string optional The model name specifies a short name that should be used for this modeling entity and possible strong parts of it within DIVA Since names in DIVA are limited to relatively short fixed string lengths PROMOT can not write out a model with the full hierarchical names for all variables but it shortens these names to the allowed limits The automatically chosen alias names may lead to confusion during simulation To fix the names of important variables to meaningful values for the access during simulation one can specify a fixed alias name by model name This name should be unique in the whole model that is written to DIVA Otherwise PROMOT changes the names to unique names by appending numbers at the end Modules define the first part 2 4 characters of the name of all directly contained variables To this prefix usually the full variable name inside the module is appended if this is not too long If the name of the module is fixed by model name the names of all variables it strongly contains get changed in one step 18 3 THE MODEL DEFINITION LANGUAGE MDL Additionally to the above mentioned every definition command may have other options Amongst others there are options that de
108. ption is a or no is xxx option at all but it can also be a weak part of the module In this case it is a ref erence to a terminal of an internal submodule This can only appear in compound modules see below In this place only strong parts are considered The part options documentation properties and indices correspond to the command options of the command define terminal which is explained in more detail in Section 4 2 The part options is aand variables differ from the command options of define terminal 18 8 class name optional Definition of the class which should be instantiated for the defined terminal part The type class name must be an arbitrary subclass of terminal or terminal itself If is a is not given by the user then if defined the class of an equally named inherited part of a superclass is used or it defaults to the class terminal In this example the definition uses the class terminal in both cases for in this is specified explicitly in the case of out it defaults implicitly to that class As mentioned above PROMOT creates internal subclasses of terminal for each strong part that is created and uses an instance of this subclass as part of the defined module By the creation of these subclasses the defined terminal can have other and more local part options e g variables and documentation as the class referred to by is a see also Section 6 Parts and internal subclasses are described in Section
109. red Further every modeler will have his personal set of modeling entities that are used to form special models 1 2 ProMoT models This section describes the mathematical description of a DIvA model that can be built in PRO MoT PROMOT generates this model from the equation based and object oriented form that is stored in MDL Although such a model normally contains the description of a whole system closed model it can also be connected to other DIvA models open model A model is open if the module describing the system in PROMOT and given out to DIVA has terminals The vari ables within these terminals have to be directed inputs and outputs that can then be connected on one level within the DIVA plant description file anl File to arbitrary DIVA blocks Created with the CODEGENERATOR or directly in FORTRAN PROMOT models are elementary models within DIVA An example is given in Figure The system border of the model is described by the terminals that describe the exchange of material momentum energy and information with other models Every terminal contains a set of input and output variables that are represented in the vectors u and y respectively see also 8 1 INTRODUCTION uj Ya ua Uy B x h u P t x f x h u p h g x h u p t x to Xo y Cx Y3 Y U2 Figure 2 Open PROMOT model with three terminals Every terminal may have several input and output variables
110. rial type 95 vectorially directed inwards outwards undirected view aggregation heritage source 51 subclass super class visual editor visual explorer 51 work pane
111. rrently present in the kernel and has a normal drop down menu All other parts of the GUI can be started through interactions with the browser The tree of the browser presents as shown in Figure 11 the inheritance or specialization hierarchy of the modeling entities see Section 6 3 PROMOT permits the use of multiple inheritance but the browser is only capable to present a tree with one ascendent per entry which means that modeling entities that have more than one superclass appear multiple times in the browser below of every of their superclasses Since this may lead to confusion for difficult inheritance structures there are the heritage views which are able to illustrate multiple inheritance much nicer in a directed acyclic graph The basic modeling classes that are present after every startup of the browser are e modeling entity e behavioral modeling entity e continuous modeling entity e equation 10Pressing the left mouse button on one object holding the button and moving the regarding object to another place where the mouse button is released to put the object there 7 1 PROMOT BROWSER 53 e variable e discrete modeling entity e place e transition e structural modeling entity e module and e terminal All interactions with the browser are performed with the mouse by clicking on the tree the drop down menu on top of the browser window or the pop up menu that appears when clicking with the right button on one
112. s a delegate to the variables However modelers can not change or directly access these classes Different from the syntax in CODEGENERATOR input files index variables in MDL have to be declared explicitly in the list of variables 5 1 2 Vectorial type Variables that are contained in terminals can be defined either as vectorially undirected potential quantities or vectorially directed flux quantities vectorially directed variables A vectorially directed variable represents a physical quantity that is a vector for which a positive direction has to be defined in the model In general these variables are fluxes or gradients of potentials in the model The definition of the direction takes place with respect to a balanced element e g volume In PROMOT this balanced element is the module the variable belongs to Depending on the definition the variable is used with a positive or negative sign in the equations Examples for this kind of variables are molar flows forces torques and electric currents The modeler can define the variables as positive vector direction in or positive vector direction out This definitions allow to specify if a positive value of the flux is directed into the module in or out of the module out This changes nothing on the balance equations of the module But if this variables get connected to other variables the sign for the variables in the coupling equations is determined by this attribute see
113. sts that determines this input variable This is the case for the input flux J 2 n in the example of Figure 5 The input J n of t1 and the output Jaa n von t2 become an input and an output of the composed module respectively A special case that arises for indexed input variables is described below 4 1 3 Indexed Modules Description in Mdl Indexed modules are defined like the aggregated modules with define module and the option modules Additionally the option indices is used As an example the module tank shall be used in an indexed form to describe a cascade of tanks array of tanks with arbitrary finite size define module class array of tanks super classes module documentation Cascade of tanks variables nt is a variable system theoretic structure parameter value 3 documentation Number of tanks i is a variable system theoretic index modules ta is a tank indices index i lower 1 upper nt links tl indices index i lower 1 upper nt 1 terminals ta i out tali 1 in terminals in is eq to ta 1 in out is eq to ta nt out In this example the index i is defined which runs from the lower bound 1 to the upper bound nt The submodule ta represents the one dimensional array of nt single tanks In the links the nt indexed submodules are connected by nt 1 links The meaning is the following Every terminal out of a tank
114. t it with Bc If it doesn t work continue with the installation from b Generating ssh keys Type the following sequence of commands into your shell window mkdir ssh ssh keygen b 2048 f ssh id dsa t dsa N q cat ssh id_dsa pub gt gt ssh authorized_keys2 The first command mkdir may report mkdir cannot make directory ssh File exists This is not a problem c Testing ssh When everything went OK up to this point you should be able to log into every computer in the local area network without typing passwords Type ssh ssh into your shell window The program should not ask with Password for lt user gt ssh for your password If this works continue with 4 If something is wrong please double check if you did the steps correctly and perhaps ask you local administrator 4 Installation in Emacs For making PROMOT available in EMACS you have to edit your personal EMACS startup file a Open Emacs Open the file emacs in the EMACS by using the menu Files gt Open file b Add promot line Insert the line load usr local promot promot emacs promot as the first line of your emacs It will be executed every time you start EMACS and makes it possible to use PROMOT within EMACS Save the file using the menu Files gt Save Buffer You can close the file in EMACS by the menu Files Kill Current Buffer 74 C GETTING STARTED c Testing ProMoT in Emacs Quit EMACS with Files gt Exi
115. t Emacs and restart it as shown in 1 from the shell window It should show now a additional menu Promot on the left of the menu bar Select Promot gt Start Promot from the menu bar and see what happens After some seconds there should be a emacs window promot server in which a greeting message like This is Promot v 0 8 1 Copyright c 1997 2009 Martin Ginkel Frank Traenkle Volker Padur Sebastian Mirschel Katrin Kolczyk Michael Rempel Erik Aschenbrenner Michael Krasnyk Alexey MPI Magdeburg Image created on 2008 8 8 16 53 10 by rempel shows up On the other hand the PROMOT GUI should start up showing the PRO MoT BROWSER window 5 You are now ready to model 75 D THE BASIC ELEMENTS OF THE LIBRARY FOR LOGICAL MODELING 76 D The basic elements of the library for logical modeling punoduroo ou osedy3 esedib E punoduroo ou uro301d3 6 punoduroo ou jos ob ra punoduroo ou des deb snmuns 9 punoduroo ou eu1o3xo sn nuns eujejxe 80 ou oAeq mq su s eoryeur uyeur ur njosn s rurump 91039191 Opou e ur S RTOP out 85 0 ure4 199 J19SUT 09 posn oq ULI y sse Temods e sr C52 punoduroo ou Auwump Auwunp Ca punoduioo ou snip 6nup Fa punoduroo ou Joydepe Jajdepe 5 10M39U oY ur Sordads 10 1 ns spunoduroo omy Aue u mq q 0108 sse y Jo juouro o ouo 9sea ye poou no amp pue pogo
116. t should take the physical properties of the system and its spatial structure into account When different modules are coupled to a systems model the modeler has to take care that the DAE has a differential index less or equal than one Most numerical simulation algorithms integrators are only capable to handle systems that fulfill this condition An index greater than one occurs if dynamic state variables in a link between two modules are set equal A physical explanation for this is that the storages in the two models are set equal and are therefore not distinguishable The problem can be solved if the model structure is changed so that only one common storage is present in this system and is balanced for the whole system A better solution is a general design according to the network theory where components i e storages are never directly coupled but have connection elements between them 2 4 Modeling entities modeling entity en structural modeling entity behavioral modeling entity module terminal continuous modeling entity discrete modeling entity ON Zo X equation variable place transition Figure 4 Specialization hierarchy of the basic modeling entities in PROMOT The arrows denote inheritance relationships Since version 0 6 2 PROMOT provides the basic modeling entities depicted in Figure 4 Startin
117. thout warning Below the fields for setting up file names the Diva Options button appears It opens an addi tional dialog where options for the DIVA code can be defined The slider for the CG Verbosity can be used to adjust the amount of messages the CODEGENERATOR produces while running Usually it is set to 1 but for debugging it may be set to 3 to see at which element exactly the CODEGENERATOR encounters problems Into the Output Log field below some progress information and the messages of the CODEGENERATOR are written successively The button Generate Model starts the output process If this leads to no error messages and the last mes sage in the output log is All done then a new DIVA model was generated successfully and the user can continue compiling the model with dmake and the run simulations in drun See the Diva HKK 00 for further details about the simulation 66 A MDL COMMAND REFERENCE A Mdl Command reference A 1 Strings and Symbols alpha character A B C D E F G H I J K L M N O P Q R S T JU V W 2 5 4 1 2 5 6 4 6 numeric character 0 1 2 3 4 5 6 7 8 9 special character alphanumeric character alpha character numeric character character alphanumeric character special character string character quoted string string list of quoted strings C quoted string A 2 Math
118. ting Started 72 D The basic elements of the library for logical modeling 76 E The basic elements of the library for dynamic modeling 82 F Shortcuts and modifiers of the ProMoT Visual Explorer 92 List of Figures 1 Architecture of PROMOT e 2 Open ProMO T model with three terminals o 3 Single phase liquid tank with inlet and outlet 10 4 Specialization Hierarchy of the basic modeling entities 14 5 Cascade of two tanks two tanks o ee 25 6 The flowchart of a tank with n inlets and na outlets called mimo tank 30 7 Specialization hierarchy of system theoretic types o 35 8 Flowchart of a single phased multi component tank with one inflow and one outflow 43 LIST OF FIGURES 5 Aggregation relations and internal part classes in the construction of two tanks ee oe 47 2 ee Oa a 0 ORE e 49 Examples for multiple inheritance and inheritance priorization 10 The PROMOT BROWSER rh 52 11 Pulldown menu of the browser 2 on on nn 53 12 Pop up Menu 01 the browser s 56 15 sa P PRU P RE 57 58 Aggregation view for storage intra 15 Visual editor for a cellular transporter module 59 16 bottom right 18 Emacs for editing MDL source code with error message 63 19 The Model
119. tton or by clicking with the mouse while holding the lt shift gt key on the keyboard The parts in the work pane are drawn using icons if there are icons defined for the classes of the modeling entities icon Normal colored gif raster images can be used as icons but the user has to provide them by using external tools e g Gimp Xfig etc It is possible to paint modules and terminals in other shapes than rectangles as shown for the submodule gly in the drawing by defining transparent areas in the icons If an icon is specified the size of the raster image defines also the size of the submodule in the drawing Otherwise if a submodule has no icon the size is set to i of the size of this module scalefactor 0 2 in the PROMOT VISUAL EDITOR This can be changed by opening the module in the PROMOT VISUAL EDITOR and changing the size of the work window The size of a module in screen pixels is stored in MDL in the attributes geometry width and geometry height If no size is defined for a module the default size is 300 x 300 pixels Submodules in the work window can be positioned by selecting them with a click of the left mouse button and dragging them around The position of the center of a submodule in pixels is stored in the MDL attributes geometry x and geometry y If no position is given the default is 0 0 The terminals of a submodule inner terminals are presented as small squares along the edges of the shape of the submodule or
120. uations places transitions and modules which attach parts to this module Differently spoken the module is defined as composed modeling entity as a container that contains these parts Three types of modules can be distinguished elementary modules are modules that contain no other modules as parts of them They only contain variables and equations composed modules are composed out of other modules that they contain indexed modules are composed modules that form arrays of other modules Examples there fore are cascades distillation column sections and discretized distributed systems 4 1 1 Elementary Modules Encoding in Mdl Elementary modules contain only the command options terminals variables equations places and transitions All those options define lists of named parts A named part is identified by a unique name throughout the module and it contains an instance of the requested type e g terminal variable terminals terminal slot optional Definition of the terminals of a module Excerpt from the example in Section 8 terminals in is a terminal 9 variables jn is eq to parent jen 6One module defines one separated name space One name may be only used once to identify a part in the union of the sets of terminals equations and so forth 4 STRUCTURAL MODELING ENTITIES 10 out variables jn is eq to parent jan 11 The terminals of the modu
121. uomnwenu ouoo ezo s ro ds 9381048 ou STEIJUI 93BI0OIS 97 USAS UOIJRBIJUDIUOS Y sojnduro UYA UOIje1jU90U0D 9303 juejsuo S eui ebelo s uorye13uoouoo ju jsuo o 1ojourered 97j1suoo 8 ou IYUT 988 104S feusis uorenu ouoo YAM uomnenu ouoo guegzsuop CO 9 jsuoo eur eDeJojs uorye1quoouoo errur 03 103oure ded uoryenbo erquo og 103s ou e1jur og e103s I9pgrp Y surequo eururio3 xnp qy1M 0891048 re n ooe1ju eur apeos 3no uorqezqu Suoo u1 13 jndjno peusis e Sururejuo5 o npour oso p oj ooutejs ur JO pasn oq ueg eu3is uoryerjuoouoo JO yug O 9381035 day ou yurs 5uoo yuls Suoo 110M99U OY ur 50720068 10 sso o919dn sod ose104s Ssjuouro o AIVIQT fe 103 ssepoiedng o npour sox LOINO d ut s 9pour PVC 10 sseroodng mpour 80 opour orureu Ap peAourai IO pogrpour oq JOUULI pue OJNOJq 09 eu1ojur Ay yuo Zumopout SI Sse SI sosse paugap 1osn fe Sururequod sse oiedng Temgan gs sox mpour 10005 woot SISSDIILAANS 120449Q0y IWDU ssn 83 UOISIOA JX9U UI PAAQUIAL oq IM sse 5 poyedoideq py sof py eppouueyo yuegsuos umruqrmb a Ty 1ojyeurered gno sarads z E 9 QIS I9A91 SoK Py yno saiads a Zursawads qursarads y 4 oged SOIJOUTY 19PIO ISIY 9 ISI9A9A YAM q O IH 73 TY JdoloureIe jno sawads ZA UU SIAS TY 4 oyel O QISIDADI sof ega
122. z SOLIJOULY MET IPY o qrs1oAo1 YM J VZ 73 TY 19yourexed qno saiaads y Zur s21202ds ur sawads JY 4 ojei 9 qIS19A91 sof oly SOIJOUTY Jop1o 3s11 I GISIoANI YM O G V 73 TY 19yourexed Mo sawoeds ZA 0078919908 3 4 oge1 9 qIS19A91 sof qty SOIJOULY MET 98H o qrs1oAo1 YIM qc V peo3sut GT AJ osn sse poyeooideq 9 qIS19A91 sof X T TY T4 stoyourered ano sarads ZY ursaWads 3 4 oyel O QISIDADI sof TU SJOU Jop1o 3s1 9 qISI9A9I YIM Y Y SUOIPEII Y CISIOASI fe Sururequoo ssepoiodng Tewo sod O QISI9ADI Ty 1990ure red zursawads Ty 4 toyed 9 QISI9A9 LII sof ecu SOTJOUTY MET IPY O GISIOAOLI YAM Y V UOISIOA JX9U UT PAAQUIAIL oq IM sse 5 poyedoideq Ty sof Ty ezjouueyo Ty sIo9ourered 100 8912908 3 4 9yel OTQISIDADIIL sof IU SJOU 19PIO ISIY 9 qISI9A9 LII YIM Y Y SUOTJOVOL I QISISADIAM fe Sururequoo sseprodng Tewo sof O QISIDADIAL sod A 10199891 OY Surquosop ssepIodng SOTJOUTY sof Tewo DS s oyourered p20 Aen m cde ZUo 01 ATeyeo SoK wut QUI ZUO YPM sorgoup UoJUOP SIPeYPIA O GISIOAOLIT ps 1099urered 90 100 8012908 9U ZUI DS 4 oyei zuo oryApeyed sof uo SOIJOUTY IOPIO ISIY YHA uorjoeoi SOLJOUTY 2 0700 fe Sururequoo ssepoiodng SOTJOUTY sod ory ATeyeo SOLJOUTY fe Sururequoo sse oz1 dn UOI32 01 SoK SOTJ9UD suorjugop uorjoeor fe Sururequoo ssepoiodng sof 101120
Download Pdf Manuals
Related Search
Related Contents
E-6247 ジャイロック 取扱説明書 Manual Motores Diesel 292 v1.1 13 See the Manual - Futureshop.co.uk MANUEL D`INSTRUCTIONS - MRC Manual de Utilização FP0078-01E *FP0078-01E* Télécharger - Jeunesse & Santé Nady Systems MPM 4130 Musical Instrument User Manual Design and Transient Simulation of Vehicle Air Conditioning Systems User`s Manual Copyright © All rights reserved.
Failed to retrieve file