Home

Download

image

Contents

1. lt expression gt lt rhs_expression gt lt expression gt Example y 6 8 2 sin x 2 16 2 Procedure Call Operator The procedure call operator calls a procedure with specified arguments see Section 2 14 Syntax lt procedure_call_operator gt lt procedure_name gt lt argument_list gt lt argument_list gt lt argument gt lt argument gt lt argument gt lt expression gt The argument expressions are evaluated in the order of their appearance in the argument list from left to right Examples setup 4 3 true alpha 2 matrixtofile x myfile txt 2 16 3 The if Operator The if operator performs conditional execution of an operator sequence or a conditional choice between two or more operator sequences executing only one of them Syntax lt if_operator gt if lt conditional_expression gt then lt operator_sequence gt elsif lt conditional_expression gt then lt operator_sequence gt else 62 lt operator_sequence gt end if A lt conditional_expression gt is an expression that evaluates to boolean The if operator is executed by first evaluating the conditional expression following the if keyword If the result is true the operator sequence following the first then keyword is executed Otherwise the conditional expression following the elsif keyword if any is evaluated If the result is true the operator sequence following the corr
2. Simple automatic C RK23 Figure 239 The Differential equations tab The Differential equations tab Figure 239 contains the following elements e Automatic This option selects the automatic solver e Explicit methods This group of options allows the user to select one of the following explicit methods DOPRI5 DOPRI853 RK23 e Implicit methods This group of options allows the user to select one of the following implicit methods RADAU DDASSL e Debug methods This group of options allows the user to select one of the following debug methods Euler Simple automatic 212 4 2 15 2 3 The Algebraic differential equations Tab Numerical methods Differential equations Algebraic equations Optimization Modes Automatic Explicit methods Implicit methods C DOPRIS Newton C RADAU C DDASSL C DOPRI8S3 Newton Figure 240 The Algebraic differential equations tab The Algebraic differential equations tab see Figure 240 contains the following elements e Automatic This option selects the automatic solver e Explicit methods This group of options allows the user to select one of the following explicit methods DOPRI5 Newton DOPRI853 Newton e Implicit methods This group of options allows the user to select one of the following implicit methods RADAU DDASSL DDASPK this method is not a
3. function runUntilEx hModel TModelHandle C pChar TRetCode Runs the specified model instance until the specified conditional expression evaluates to true The hModel parameter identifies the model instance The c parameter specifies the conditional expression The function returns only after all necessary computations are completed and all variables are updated accordingly Upon return from this function the model instance is guaranteed to be in the stopped state The model has to interpret the C condition which may negatively affect the model performance The most efficient types of conditions that require no interpretation are Signal names Finalized Expressions of the form time lt value gt function RunUntil C pChar TRetCode Runs the default model instance until the specified conditional expression evaluates to true A call to this function is equivalent to runUntilEx 0 C function runUntilStopEx hModel TModelHandle TimeOut integer TRetCode Runs the specified model instance until all discrete actions of the model are completed or the specified timeout expires whatever happens first The hModel parameter identifies the model instance The TimeOut parameter specifies the timeout in milliseconds The function returns only after all necessary computations are completed and all variables are updated accordingly Upon return from this function the model instance is guaranteed to be in the stoppe
4. lt static_expression gt lt upper_bound gt lt static_expression gt lt loop_body gt loop lt operator_sequence gt end loop lt exit_operator gt exit when lt conditional_expression gt lt return_operator gt return lt expression gt lt send_operator gt send broadcast lt variable_name gt lt argument_list gt lt optimization_operator gt lt direction gt lt double_expression gt for lt variable_specification gt lt variable_specification gt constraints lt constraint gt lt constraint gt lt direction gt minimize maximize lt double_expression gt lt expression gt lt variable_specification gt lt variable_name gt in lt range gt lt constraint gt lt double_expression gt lt lt double_expression gt lt double_expression gt gt lt double_expression gt lt double_expression gt lt double_expression gt lt structure_diagram_definition gt lt object_definition gt lt link_definition gt lt object_definition gt static lt object_name gt lt class_name gt lt actual_initial_values gt lt object_name gt lt identifier gt lt link_definition gt link lt link_name gt from lt external_variable_reference gt to lt external_variable_reference gt link lt link_name gt lt external_variable_reference gt lt external_variable_reference gt lt l
5. ones n m returns an n by m matrix of ones putcolumn x j c returns the matrix x with the j th column replaced with the vector C3 putrow x i r returns the matrix x with i th row replaced with the row matrix 1 by m matrix r row x i returns the i th row of the matrix x scalar x y returns the scalar product of the vectors x and y size x returns the size of the vector x Returns 0 if x is a variable size vector that has not been assigned any value yet size x i returns the size of the i th dimension of the matrix x Returns 0 if xis a variable size matrix that has not been assigned any value yet submatrix x i j n m returns an n by m sub matrix of the matrix x starting from x i j as the top left element subvector x i n returns a sub vector of vector x Returns a vector of size n whose first element is equal to x i second element is equal to x i 1 and soon If size x is less than i n 1 every element of the resulting vector that does not correspond to an element in x is set to 0 Examples subvector 1 2 3 2 2 2 3 subvector 1 2 3 2 3 2 3 0 sum x returns the sum of all elements of x where x is either a vector or a matrix transp x returns the transpose of the matrix x variance x returns the variance of the vector x vectorfromfile fp cn vectorfromfile fp cj loads a vector from a text file fp specifies the path to the file If fp is a
6. Example case x of when 1 2 y i ine w Il v r DA X 7 when 5 gt Z i 7 when others gt y 0 end case 63 2 16 5 The loop Operator The loop operator repeatedly executes an operator sequence Syntax lt loop_operator gt lt loop_specification gt loop lt operator_sequence gt end loop lt loop_specification gt for lt loop_variable gt in lt range gt while lt conditional_expression gt lt loop_variable gt lt identifier gt lt range gt lt lower_bound gt lt upper_bound gt A lt conditional_expression gt is an expression that evaluates to boolean lt lower_bound gt and lt upper_bound gt are expressions that evaluate to integer A loop starting with the for keyword the for loop implicitly introduces a loop variable The name of the loop variables is the identifier specified after the for keyword the type of the loop variable is integer the scope of the loop variable is limited to the operator sequence enclosed in the loop The range of the loop variable is specified by two expressions each of which must evaluate to integer The for loop is executed by first evaluating the lower and upper bound expressions The loop variable is then assigned the value of the lower bound and the enclosed operator sequence is executed Then the loop variable is incremented and the enclosed operator sequence is executed again This is repeated for ev
7. To find the optimal parameters values click Start During the process of optimizing there are displayed the number of performed tests values of optimization parameters and the objective function value for the current test run By the end of the optimization process the optimum values of parameters and the objective function are displayed in the window or an error message appears on screen The optimization process can be stopped by pressing Stop button Track button can be used for viewing and saving the text representation of values of optimization parameters and the objective function for all tests 233 4 4 EMBEDDABLE EXECUTABLE MODEL The embeddable executable model is a Windows DLL that any application can link to in order to get programmatic access to the model To generate the embeddable executable model 1 Make sure the Embedded model Win32 DLL option is selected on the Model tab of the Project options dialog box see Section 3 8 3 2 Build the model To do so click Build model m on the main toolbar or Choose Model Build from the popup menu Rand Model Designer will build the model and display a success message box Click OK in the message box 3 Save the generated model with the desired name to the desired location To do so choose Model Save as from the main menu The Save model as dialog box will appear In the Save model as dialog box specify the name and location and click Save The
8. e Object displays the name of the object owning the equation e Equation displays the equation e Dec variable displays the name of the unknown variable associated with the equation if any The variable name may be followed by a colon and a range of indices of the corresponding scalar equations in the numerically solved system The range of indices if any is shown in square brackets Differential and algebraic equations have independent sets of indices Equations are shown divided into the following categories e Differential equations e Algebraic equations e Formulas e Equivalent variables To open the Aggregate System of Equations window 1 Choose Service Show current equation system from the main menu 198 To toggle automatic column resizing 1 Right click anywhere in the Aggregate System of Equations window and choose Auto resize columns from the popup menu The contents of the Aggregate System of Equations window can at any time be saved as a text file or printed To save the contents of the Aggregate System of Equations window as a text file 1 Right click anywhere in the Aggregate System of Equations window and choose Save from the popup menu The Save As dialog box will appear 2 Browse to the folder where you want to save the file 3 Type the file name in the File name field 4 Click Save To print the contents of the Aggregate System of Equations
9. 1 Click Calculator on the main toolbar or Choose Service Calculator from the main menu The Calculator window will appear If it has not been used before it will look as shown in Figure 224 Formula calculator Figure 224 An empty Calculator window To enter an expression for evaluation 1 Choose a row in the Calculator window 2 By default the Calculator window evaluates entered expressions in the context of the model object If you want to evaluate an expression in the context of some other object specify the object in the Object field To do so either drag the object from a Structure or Behavior Chart window and drop it onto the Object field of the selected row or right click the Object field choose Change current object from the popup menu and choose the object using the Choose object dialog box that will appear as shown in Figure 225 201 Choose object Cancel Figure 225 The Choose object dialog box 3 Click the Expression field of the selected row After a short while click the Expression field again An in place editing field will appear 4 Type the expression 5 Hit Enter or click anywhere outside the editing field The value of the expression will appear in the Result field as shown in Figure 226 Expression x objl x obj2 x Figure 226 Evaluation result ae To evaluate an already entered expression 1 Right click the corresponding row and choose C
10. 4 on the structure diagram editor toolbar The External variable dialog box will appear as shown in Figure 132 Identifier In 2 Cancel Type double Help Value 0 Comments iem Group ai Variable category input C Output C Contact C Flow C Connector Figure 132 The External variable dialog box 3 Use the External variable dialog box to define the external variable 4 Click OK The new external variable will appear on the border of the class as shown in Figure 133 In_1 Figure 133 New external variable To modify an external variable 1 Double click the external variable The External variable dialog box will appear as shown in Figure 132 2 Use the External variable dialog box to modify the variable 3 Click OK To rename an external variable in place 1 Double click the name of the variable or Right click the name of the variable and choose Rename from the popup menu An in place editing field will appear as shown in Figure 134 133 Figure 134 Renaming an external variable in place 2 Modify the variable name 3 Hit Enter or click anywhere in the editing area By default the structure diagram editor does not display local object variable names To toggle display of local object variable names 1 Click Show local object variable names on the structure diagram editor toolbar 3 4 15 5 Links Link can connect two or more external variables th
11. If Save results checkbox is checked at the end of the experiment the results of all tests values of random parameters and values of conditions are saved in the form of table to a text file for further processing by special programs Sometimes it is desirable to preserve also the values of some variables of the model To do this drag and drop the desired variable to Add Variable list 4 3 3 Calculation of math expectation and standard deviation of value To calculate a math expectation click Simulation gt Typical computing experiment gt Math expectation of variable value On the page Settings see Figure 242 you need to specify the list of random parameters and the list of variables Random parameters need not to be specified if their values are defined as random in the model directly To add a parameter use your mouse to drag the desired one from the window of variables and drop it down to Parameter table To remove a parameter right click Parameter table and use the appropriate command of pop up menu For each parameter you need to choose a distribution law normal uniform or beta and specify the parameters for normal expectation and standard deviation for uniform lower and higher bounds of the value interval for beta parameters p and q To select the distribution law click cell in Distribution law column and select item of drop down list to set the distribution parameters edit the values of cells in
12. To set the class icon 1 Right click the class editor tree and choose Add icon from the popup menu The Class icon dialog box will appear as shown in Figure 39 82 5 Class icon Cancel Help Figure 39 The Class icon dialog box no icon yet Click Load The Open dialog box will appear Select an icon ico file Click Open The selected icon will be displayed in the Class icon dialog box Click OK in the Class icon dialog box To modify the class icon 1 Double click the Class icon node in the class editor tree or Right click the Class icon node in the class editor tree and choose Edit from the popup menu The Class icon dialog box will appear as shown in Figure 40 Class icon Cancel Help Figure 40 The Class icon dialog box with icon Click Load The Open dialog box will appear Select an icon ico file Click Open The selected icon will be displayed in the Class icon dialog box Click OK in the Class icon dialog box 83 To clear the class icon 1 2 3 Double click the Class icon node in the class editor tree or Right click the Class icon node in the class editor tree and choose Edit from the popup menu The Class icon dialog box will appear as shown in Figure 40 Click Clear Click OK 3 4 2 Superclass The Superclass node appears in the class editor tree and displays the name of the base class if the current class
13. 219 model x Figure 246 The Assignment dialog box 2 In the Assignment dialog box type the value that the command should assign to the variable and click OK To add or insert a pause command 1 If you want to add a pause command to the end of the plan right click anywhere in the command list and choose Add Pause from the popup menu Otherwise if you want to insert a pause command before a specific command right click that command and choose Insert Pause from the popup menu The Pause dialog box will appear as shown in Figure 247 Figure 247 The Pause dialog box 2 Type the amount of model time the command should pause for and click OK To add or insert a message command 1 If you want to add a message command to the end of the plan right click anywhere in the command list and choose Add Message from the popup menu Otherwise if you want to insert a message command before a specific command right click that command and choose Insert Message from the popup menu The Message dialog box will appear as shown in Figure 248 Figure 248 The Message dialog box 2 Type the message text and click OK To add or insert a breakpoint command 1 If you want to add a breakpoint command to the end of the plan right click anywhere in the command list and choose Add Breakpoint from the popup menu Otherwise if you want to insert a breakpoint command before a specific com
14. 223 4 2 21 Using the Standalone Visual Executable Model Rand Model Designer Corporate and Rand Model Designer Educational allow the user to generate the visual executable model as a standalone executable that can be run separately from the integrated modeling environment To generate the standalone visual executable model 1 Make sure the Visual model Win32 Application option is selected on the Model tab of the Project options dialog box see Section 3 8 3 2 Build the standalone executable model To do so click Build model rid on the main toolbar or Choose Model Build from the popup menu Rand Model Designer will build the model and display a success message box Click OK in the message box 3 Save the generated model with the desired name to the desired location To do so choose Model Save as from the main menu The Save model as dialog box will appear In the Save model as dialog box specify the name and location and click Save Rand Model Designer will copy the executable model to the specified location along with the following files e _mathmvs dl11 the numerical methods library e User supplied DLLs implementing external functions and procedures if any e lt model_name gt _vm ini the default model settings file e The model specific help file if it is specified in the model settings Torun the standalone executable model 1 Run the generated executable Every standalone visual executable mode
15. 4 2 5 The Static Phase Diagram Window A static phase diagram is a special type of a phase diagram where the number of points is determined by the dimension of vectors displayed on the diagram Figure 193 Static phase diagram example Figure 193 shows a static phase diagram visualizing the results of the experiment whose goal was to determine how the horizontal distance of shooting depends on the angle of shooting in the presence of air resistance DTetas is a vector of size 8 which contains the shooting angles in degrees DTetas is associated with the x axis X is a vector of the same size containing the resulting distances that correspond to the respective angles in DTetas X is associated with the y axis The diagram consists of 8 points DTetas i X i i 1 8 Suppose the model also includes a vector H which contains the maximum trajectory heights for the respective angles in DTetas If the user drags and drops H onto the static phase diagram the diagram will display one more curve consisting of points DTetas i H i i 1 8 In the context of a single static phase diagram all vectors must be of the same size To open a new Static Phase Diagram window 1 Choose Window New static phase diagram from the main menu 174 The Static Phase Diagram window settings are analogous to the Diagram window settings 4 2 6 The Histogram Window The Histogram window is intended for displaying the contents of a vector v
16. Equation Blocks WiNdOW cccccceeseeeecceeeeeeeeeeeeneeeeeeeees 200 4 2 12 The Calculator Window cccccececeeeereeeeeeeeeeeeeeeeeeseeeeeeeeeaaees 201 4 2 13 Modell TIME nri nina denna ld dele tte ted 202 4 2 14 The Breakpoint conditions Dialog BOX 0 cceeeeereeeeeereeeeeee 203 472515 MOGGISOtINGS sresti aE AE xiaed ceevacds cgeaadenere wield acts 206 4 2 16 Executing the Model 0 ecccceceeeeeeeeeeeeeeeseeeeeeeeeeeeeeeseeaeeeeeeeaees 217 4 2 17 The Model run plan Dialog BOX 0 cccceceeeeeeeeeeteteeeeeenneeeeeeee 218 4 2 18 Saving and Restoring the Current Model State ees 221 4 2 19 Model TIMING iscriere aed eave cee naaie 222 4 2 20 Miscellaneous FUNCTIONS cceeeceeeeeeeeeeeeeeeeeeeeeeeeeeseeeeeeeeeaaees 223 4 2 21 Using the Standalone Visual Executable Model 0 eeeeee 224 4 3 Typical computing experiment cccceeeeecceeceeeeeeeseceeeeeeeeeeeseeeeestnaeeeeees 224 4 3 1 Obtaining a parametric dependence ecccceceeeeeeeeteeeeeeeees 225 4 3 2 Calculation of event probability eeeeeeeeeeeeeeeeteeeeeetteeeeeees 227 4 3 3 Calculation of math expectation and standard deviation of value 229 4 3 4 Global sensitivity ANAlYSES eceeeeceeeeeeeeeeeeeeeeeeeeeeseeeeeeeeeenaees 231 4 3 5 Optimization nai aie gine dents nee ede leaned teens 232 4 4 Embeddable Executable Model 0 ccccceeeeeeeeeceeeneeeeeeeneeeeeeeeeeeeenaeee
17. RO E AA 0 13263999 Z 2 oi ES o 0 19262711 es o Funly x2u evs Funax 0 iba o kisl Q QQ og E ea tau uxt for iin 1 2 tu sign 1 ux2 za liene 2 x2u ant scalar differential equations 9 formulas 24 temporary arrays 6 37 Kb Figure 2 Visual executable model example At any moment the user can close the visual executable model get back to the integrated modeling environment make changes to the project and run the model again Rand Model Designer models are built from components Within a particular project the user can utilize both the components defined in the project and the components found in available ibraries Libraries are collections of model components created by the same user or other users of Rand Model Designer The Rand Model Designer distribution includes one readily available library SysLib the standard class library Should the user have a need to integrate the executable model with other software on the user side the embeddable executable model can be created instead of the visual one The embeddable executable model is a Windows DLL that any software can link to in order to get programmatic access to the model 11 1 3 DOCUMENT OVERVIEW This document is organized as follows e Chapter 2 Modeling Language describes the modeling language of Rand Model Designer e Chapter 3 Integrated Modeling Environment describes the integrated modeling
18. Save project as dialog box 2 Browse to the folder where you want to save the project 3 Type the new project name in the File name field 4 Click Save To rename the currently open project 1 Choose Project Rename from the main menu The Enter the new project name dialog box will appear as shown in Figure 26 Cancel Figure 26 The Enter the new project name dialog box 2 Type the new project name 72 3 Click OK To verify the correctness of the currently open project 1 Click Validate project of on the main toolbar or Choose Project Check from the main menu 2 If the project has no problems a success message will be displayed Otherwise an error message describing the encountered problems will appear 3 Click OK To close the currently open project 1 Choose Project Close from the main menu 3 3 PROJECT MANAGER The Project Manager window displays a tree view of all components of the currently open project Project components are classes declared types constants functions procedures and imported packages see Section 2 1 The Project Manager window looks as shown in Figure 27 E Classes E Model E MyClass Types EJ type MyType is double EJ type MyTypez is a b c A Project constants A C1 double 0 A 2 double 0 Project procedures and Functions Gi function barfin X byte return integer E Function foofin x double return double
19. The Structure window allows the user to add any of the standard 2D components see Section 4 2 7 1 to the structure diagram and associate them with any of the available external variables This way external variable values can be visualized in the Structure window To add a standard 2D component and associate it with an external variable 1 Open the Standard 2D components panel see Section 4 2 7 1 2 Drag acomponent of your choice from the Standard 2D components panel and drop it onto the variable in the Structure window Alternatively drag the component from the panel and drop it anywhere in the Structure window then drag the variable and drop it onto the component In either case the component will appear in the Structure window as shown in Figure 178 and will become associated with the corresponding variable 164 A model structure Thermostat Heater Figure 178 A Structure window with a standard 2D component 3 Move the created component to the desired location and if necessary configure it via its context menu For more information see Section 4 2 7 1 4 2 4 The Diagram Window The Diagram window displays the time or phase diagram for a set of variables A Time diagram y Vy Figure 179 Typical time diagram A typical time diagram is shown in Figure 179 In a time diagram the x axis represents model time while the y axis represents variable values 165 A Phase diagram y Vy Figure
20. a seps eo E Total time of modelling Time spent for discrete modelling Time spent for continuous modelling this includes Bpema NpecbpasoBanHna H aHanh3a CHCTEMbI yPaBHEHHt continuous intervals integration time time of coordination of algebraic values in a time gap point of switching search time right parts of the equations calculation time number of calculations of the right parts of the equations Figure 251 Model timing results 4 2 20 Miscellaneous Functions In addition to all the functionality described in this chapter the visual executable model allows the user to e Cascade tile and minimize open windows e Open the Rand Model Designer help e Open the visual executable model help e Terminate the model ae To cascade open windows 1 Choose Window Cascade from the main menu x To tile open windows gt 1 Choose Window Tile from the main menu DO To minimize all open windows 1 Choose Window Minimize all from the main menu 7 Ww To open the Rand Model Designer help 1 Choose Help Help from the main menu Ww To open the visual executable model help 1 Choose Help Application help from the main menu DO To terminate the visual executable model 1 Choose Settings Exit from the main menu 2 Ifthe model contains unsaved changes a confirmation message box will appear If you want to save the changes click Yes Otherwise click No
21. e Determine consistent values at initial moment This checkbox determines whether the model attempts to find consistent variable values upon startup e Execute initial discrete actions before running This checkbox determines whether the model executes initial discrete actions upon startup e Keep modified model parameters This checkbox determines whether modified parameter values survive model restarts e Do not solve equations in interim states of a time gap If this checkbox is checked the model does not attempt to analyze and solve the aggregate system of equations in interim states of time gaps 4 2 15 1 2 The View Tab Model settings Run View Files Floating point Format C general precision 8 fixed exponent digits Show data on discrete events only Show data exchange over links Close Figure 236 The View tab The View tab see Figure 236 contains the following elements e Floating point format This group of options and fields defines the format used to display floating point numbers The general fixed and exponential options select the general fixed and exponential floating point formats respectively The precision field specifies the maximum number of digits in the textual representation of floating point numbers The digits field specifies the number of decimal places e Show data on discrete events only If this checkbox is checked Variables windows
22. e function getVarHandleEx hModel TModelHandle VarName pWideChar var hVar TVarHandle TRetCode Looks up a variable by name in the specified model instance The hModel parameter identifies the model instance The VarName parameter specifies the variable name The hVar parameter receives a handle to the variable with the specified name if it exists or vaVarNotFound otherwise e function GetVarHandle VarName pChar TVarHandle Looks up a variable by name in the default model instance The VarName parameter specifies the variable name The function returns a handle to the variable with the specified name if it exists or vhVarNotFound otherwise e function getVarTypeEx hModel TModelHandle hVar TVarHandle var VarType integer TRetCode Retrieves the type of the specified variable The hModel parameter identifies the model instance The hvar parameter identifies the variable On success the function stores the type code in the VarType parameter and returns rcOK Otherwise VarType is set to 0 and an appropriate error code is returned The possible type codes are the same as with the Get Variables function e function getVarValueEx hModel TModelHandle hVar TVarHandle var Y variant TRetCode Retrieves the current value of the specified variable of arbitrary type The hModel parameter identifies the model instance The hVar parameter identifies the variable The y parameter receives the current value of the specified variabl
23. function xlim x a double return double is external ExampleD1l1l dll procedure inc out x double is external ExampleD11 d1l function addmatrix in x matrix in y matrix ExampleD1l1 d1ll return matrix is external See the ExtFun demo example for how these external functions and procedures can be implemented in MS Visual C or Borland Delphi 2 15 EXPRESSIONS An expression is a formula for calculating a new value from one or more existing values An expression consists of operands operations and parentheses Operands can be literals literally expressed fixed values variables parameters constants function calls etc Actions performed on operands are called operations 2 15 1 Operations Rand Model Designer supports the following operations e addition of integer numbers floating point numbers matrices and vectors or concatenation of strings Examples 1 2 5 4 6 8 Pale Qe So E 578 291 abc def subtraction of integer numbers floating point numbers matrices and vectors Examples a ah 5 4 6 8 1 2 3 57879 59 60 multiplication of integer numbers floating point numbers and matrices or multiplication by a scalar for matrices and vectors Examples gt 2 Tel B38 AL2 475 6 BLT eri 2 1 2 3 2 division of floating point numbers Example IE ES S e div integer divisi
24. A signal type represents a collection of one or more parameters each of which has its own name and type The name of a parameter is an identifier see Section 6 2 unique across all parameters of the signal type The type of a parameter can be any available type except for signal and connector types An MVL example see Section 6 3 declaring a signal type type MySignal is signal Pl double P2 matrix P3 a v k A signal can be created and sent to a variable of the appropriate type using the send operator see Section 2 16 8 The parameter values of a signal can only be accessed by the actions of the transitions triggered by that signal In the actions of a transition triggered by a signal a particular parameter of the signal can be accessed as lt variable name gt lt parameter name gt where lt variable name gt is the name of the variable that received the signal and lt parameter name gt is the name of the parameter 2 13 6 Declared Types A declared type is a project component that acts as an alias or synonym of some existing type Once created a declared type can be used as any other type A project can contain an arbitrary number of declared types see Section 2 1 The definition of a declared type consists of the name of the type and the specification of the type The name of a declared type is an identifier see Section 6 2 unique across all declared types of the project The specification of a declared
25. Cl ZZ S X connect zz X ZzZ Y destroy zz If appropriate option is installed in the settings of the visual model the dynamic objects are depicted in the block diagram 2 8 PARAMETERS A class can have an arbitrary number of parameters Every parameter has the following properties e Name e Type e Default value The name of a parameter is an identifier see Section 6 2 unique across all parameters of the class The type of a parameter can be any available type except for signal and connector types see Section 2 13 The default value is specified by an expression see Section 2 15 that may reference other parameters of the class however such references are not allowed to form cycles A parameter definition within a class designates a formal parameter A formal parameter of a class receives its actual value in each instance of the class The actual value can be assigned to a parameter via the set of actual parameter values of the corresponding local object see Section 2 7 1 or activity object see Section 2 4 1 If the actual value of a parameter is not specified the default value specified in the parameter definition is used 35 Every parameter is assigned its actual value once upon creation of the corresponding instance of the class Once the value is assigned it cannot be changed 2 9 VARIABLES A class can have an arbitrary number of variables Variables store the data of the class and may be used
26. Drag the segment to the desired location Vertical segments can only be moved horizontally Horizontal segments can only be moved vertically To change link color 1 Select the link right click it and choose Color command of the pop up menu If link color is specified the colors of connected variables are ignored 3 4 16 The Model Class Extra Features Every project contains a special class called Model The Model class is special in that it is interpreted by Rand Model Designer as the complete definition of the model Rand Model Designer automatically creates an instance of the Model class the model object upon executable model startup and uses it to drive the model execution The Mode1 class exists in every project and cannot be deleted For more on the Model class see Section 2 1 The integrated modeling environment provides a set of functions specific to the Model class allowing the user to e Move the contents of the Model class into another class e Move the contents of another class into the Model class e Erase the contents of the Model class e Edit the actual parameter values and initial variables values of the model object These functions are available from within the Model class editor as well as through the main menu and toolbar of the integrated modeling environment To move the contents of the Model class into another class 1 Click Save model as class amp on the main toolbar or Choose Model Sa
27. Functions and procedures lt Comments Local classes Eh Hybrid Continuous Behavior chart Interface v 6 0 54 c 1997 2010 MVSTUDIUM Group Figure 1 Integrated modeling environment 10 To begin authoring a model the user creates a project in the integrated modeling environment A project is a model description consisting of model components The user populates the project with components as necessary with the goal of creating an adequate model of the system being modeled When the model description is ready the user runs the model by clicking the Run model P toolbar button or choosing the respective item from the main menu This automatically generates and starts the visual executable model The visual executable model is a Windows application that implements the model and allows the user to experiment with it An example of the visual executable model is shown in Figure 2 ine a model structure 2 0 B01 6 4436514E 8 0 ee 0 0 1 BA 0 10108506 0 ee 300 josc 0 5 0 49999994 0 0002538434 cor 0 0 0 a 0 62M 2 62 0 62 foa 0 0012119s ox P 0 5 Q 0 0013263355 0 00055303557 0 Formulas Q 0 055514377 0 042013971 0 075 Qd A 30 animation Vi K X1 0 5 8 ib Y1 RU Yin Y1 RU Y2 K X2 0 5 A Y2b Y2 RU Yan Y2 RU va vi Uiks 4 yo Uks Y4 Y3 RM Y1 Y2 va T 0420133 V 0 479441115 2601 1205 Y5 Y4 R q a
28. If this checkbox is checked Rand Model Designer includes the version information specified on this tab in the executable model generated from this project Otherwise the version information is not included in the executable model 3 8 5 The Equation blocks Tab On the Equation blocks tab Fig 145 there is a list of blocks of equations that are declared in the project Setting the flag on or off leads to including excluding a particular block from a whole model system of equations For example the settings shown in Fig 145 mean that blocks BX BZ participate in model system of equations and BY is not 148 E Project options xs General Folders Embedded model Version Equation blocks re Add imported block Delete imported block Change freezing step Figure 4 The Equation blocks tab 3 9 THE ENVIRONMENT OPTIONS DIALOG BOX The Environment options dialog box allows the user to customize the integrated modeling environment To open the Environment options dialog box 1 Choose Tools Environment options from the main menu The Environment options dialog box will appear as shown in Figure 156 E Environment options 23 General Colors View Fonts Undo limit Cie ox IV Keep previous version of project Figure 156 The Environment options dialog box the General tab 149 The Environment options dialo
29. Orthogonal time in the context menu 2 Use the appropriate object as an operand of submodel execution operator 2 16 10 and put it in some sequence of discrete actions in the model 21 2 5 SYSTEM OF EQUATIONS If a class is continuous see Section 2 3 it has the associated system of equations that defines the behavior of the class A system of equations consists of e One or more equations e Zero or more declarations of known and unknown variables e A set of the initial values of the first derivatives of those variables whose second derivatives participate in the equations Every equation has the following form lt expression 1 gt lt expression 2 gt where lt expression 1 gt and lt expression 2 gt are expressions see Section 2 15 that can contain the standard operations see Section 2 15 1 variables see Section 2 9 parameters see Section 2 8 constants see Section 2 10 and functions see Section 2 14 visible in the class as well as the first and second derivatives of the variables with respect to time In 2 equations the first derivative of x with respect to time is written as ae the second as 2 dt see Section 3 4 12 Examples of individual equations x y and z are variables k and p are parameters x 0 x y 0 x y x y z x y 2 x sin Time x y Sin p z2 sqrt x x function_1 y dx Sf Ss 3 dt dx Sah ES 3 y dt d d ax o ay dt dt dx dy i dz dt dt d
30. Save as type Model status mst v Cancel Figure 249 The Save model state dialog box 2 Browse to the folder where you want to save the file 3 Type the file name in the File name field 4 Click Save To restore the current model state from a file 1 Choose Simulation Load model state from the main menu The Load model state dialog box will appear as shown in Figure 250 221 Load model status Look in O mymodel v E Imports Tmp My Recent Documents Desktop Files of type Model status f mst x Cancel Figure 250 The Load model state dialog box My Network File name 2 Select the file you want to restore the model state from and click Open 4 2 19 Model Timing The Service Time estimation main menu command runs the model in a special mode that helps assess the model performance This capability is especially valuable for debugging models intended for use in external applications The command allows the user to specify the model time interval and step and executes the model for the specified period of time visualizing the model with the specified step with all debug checks disabled for maximum performance If the simulation plan is present and active it is carried out Visualization is not included in performance measurements The results are displayed in a special window as shown in Figure 251 and can be saved to a text file 222 Time estimation results
31. TetadD 0 261 0 319 1 1025 1 3475 0 036 0 044 Variable Point time of gauging r model termination Minimum number of tests Maximum number of tests J Number of tests 112 Global sensitivity indicators Indicator 0 66 1288869587311 0 124881214314761 0 112046298766 796 0 0832734540785629 0 0253432520438236 Figure 11 Global sensitivity analysis Window Figure 242 shows the settings for the analysis of global sensitivity of a missile flight distance values are measured at the end of model run to deviations of the initial velocity air density cross sectional area aerodynamic drag coefficient and the initial angle of the throw A series of tests starts with pressing Start button The obtained results are displayed in the bottom of the window the total number of tests and the global sensitivity index for each parameter Parameters are re arranged automatically by the value of this indicator The experiment can be terminated by clicking Stop button when the parameter ranking gets stabilized The experimental results in Figure 244 demonstrate that the flight range of the missile is strongly determined by the departure of the initial velocity lesser influenced by deviations of air density cross sectional area the drag coefficient and show even lesser degree of divergence of the initial angle of throwing 4 3 5 Optimization To find the optimal values of the model parameters click Simulation gt Ty
32. The numerical method settings are configured in the Numerical methods dialog box see Section 4 2 15 2 At any time the current visual model settings can be saved to or loaded from a file To save the current visual model settings to a file 1 Choose Settings Save to file from the main menu The Save settings dialog box will appear as shown in Figure 233 206 Save settings Save in O mymodel x Imports Ee tmp My Recent E mymodel_em ini Documents Desktop EJ My Documents g My Computer File name My Network Save as type MvS tudium options ini Places Figure 233 The Save settings dialog box 2 Browse to the folder where you want to save the current settings 3 Type the file name in the File name field 4 Click Save To load the visual model settings from a file 1 Choose Settings Load from file from the main menu The Load settings dialog box will appear as shown in Figure 234 Cancel 207 Load settings Look in mymodel oe ex EE A imports ie Tmp My Recent C mymodel_em ini Documents Desktop sy My Documents My Computer My Network Files of type MvStudium options ini x Cancel Places 7 Open as read only Figure 234 The Load settings dialog box 2 Select the file you want to open and click Open 4 2 15 1 The Model settings dialog box The Model settings dialog box allow
33. The position is relative to the upper left corner of the 2D Animation window 4 2 8 The 3D Animation Window The 3D Animation window is intended for three dimensional animation The 3D Animation window provides a three dimensional scene that can be populated with standard 3D objects such as spheres cylinders and cones Object properties can be associated with model variables so that when model variables change objects move and change their appearance accordingly thereby animating the model The user can open and populate as many 3D Animation windows as necessary An example of the 3D Animation window is shown in Figure 215 A 3D animation Figure 215 3D Animation window example To open a new 3D Animation window 1 Click New 3D animation on the main toolbar or Choose Window New 3D animation from the main menu A new 3D Animation window will appear as shown in Figure 216 189 A 3D animation Figure 216 New 3D Animation window The user populates and customizes the 3D Animation window using the 3D animation parameters dialog box 4 2 8 1 The 3D animation parameters Dialog Box To open the 3D animation parameters dialog box 1 Double click anywhere in the 3D Animation window or Right click anywhere in the 3D Animation window and choose Parameters from the popup menu The 3D animation parameters dialog box will appear as shown in Figure 217 3D animation parameters
34. West The operations defined for every enumeration are see also Section 2 15 1 e equality relation e inequality relation e gt greater than relation e gt greater than or equal to relation e lt less than relation e lt less than or equal to relation Two enumeration types are identical if their sets of literals are identical 2 13 2 Regular Types The regular types are fixed and variable size vectors and matrices 2 13 2 1 Vectors A vector N type represents a fixed size vector with N elements of type double The vector type represents a variable size vector with elements of type double Vector elements are numbered starting from 1 The current size of a vector can be obtained using the size function see Section 2 14 1 2 The operations defined for vectors are see also Section 2 15 1 e x multiplication by a scalar e addition e subtraction e equality relation e inequality relation Vector literals have the following syntax lt vector_literal gt lt double_literal gt lt double_literal gt 42 Examples Oe Oe 2 37 57677 IE2 2 13 2 2 Matrices A matrix N M type represents a fixed size matrix with N rows and M columns with elements of type double The matrix type represents a variable size matrix with elements of type double Row and columns are numbered starting from 1 Ev
35. cannot be associated with a variable e Visible determines whether the object is visible e Color specifies the color e x1 y1 z1 specify the coordinates of the center of the first base e x2 y2 z2 specify the coordinates of the center of the second base e Radius specifies the radius of the cylinder e Slices specifies the number of segments used to model the cylinder 194 Closed specifies whether the bases are capped Transparency specifies the object transparency must be between 0 fully opaque and 1 fully transparent 4 2 8 6 Cone This object has the following properties Type reflects the type of the object read only cannot be associated with a variable Name specifies the name of the object cannot be associated with a variable Visible determines whether the object is visible Color specifies the color x1 y1 z1 specify the coordinates of the center of the first base x2 y2 z2 specify the coordinates of the center of the second base Radius specifies the radius of the first base Radius2 specifies the radius of the second base Slices specifies the number of segments used to model the cone Closed specifies whether the bases are capped Transparency specifies the object transparency must be between 0 fully opaque and 1 fully transparent 4 2 8 7 Torus This object has the following properties Type reflects
36. e _ inserts comments e _reverts the last action 106 amp opens the Font dialog box to edit the font used by the Text Editor window allows the user to print the contents of the Text Editor window A_ allows the user to save the contents of the Text Editor window to a file as an image 3 4 12 2 Editing Area When the Text Editor window is used to edit raw text the editing area functions like a conventional text editor When editing equations and expressions the editing area displays user input in natural mathematical form When editing functions and procedures an option to use natural mathematical display is also available and can be turned on and off as necessary Some of the functions of the Text Editor window are available via the context menu which can be opened by right clicking anywhere in the editing area The context menu contains the following items e Mathematical style toggles natural mathematical display This item is only available when editing a function or procedure e Word wrap toggles word wrapping e Syntax highlighting toggles syntax highlighting e Font opens the Font dialog box to edit the font used by the Text Editor window e Print allows the user to print the contents of the Text Editor window e Save image to file allows the user to save the contents of the Text Editor window to a file as an image e Find opens the Find dialog box to search f
37. environment e Chapter 4 Executable Model discusses the categories and capabilities of executable models e Chapter 5 SysLib The Standard Class Library serves as a reference manual for the SysLib library e Chapter 6 Appendices contains appendices 12 CHAPTER 2 Modeling Language This chapter describes the modeling language of Rand Model Designer 2 1 PROJECT A project on one hand provides a complete definition of a model and on the other hand is a collection of components each of which may or may not be a part of the model definition A project corresponds to a package in UML notation A project can contain the following components e Classes e Declared types e Global constants e Global parameters e Global variables e Global functions and procedures e Imported packages Classes are the primary components of every project Classes are discussed in Section 2 2 of this document In addition to classes a project can contain any number of declared types constants global parameters global variables functions and procedures Declared types and constants are discussed in Section 2 13 6 and Section 2 10 respectively Functions and procedures are discussed in Section 2 14 2 Every project contains a special class called Model The Model class is special in the sense that it is interpreted as the complete definition of the model Rand Model Designer creates an instance of the Model class automatically upon
38. intermediate point e To remove an intermediate point from a transition 1 Select the transition and click Remove control point from transition at on the behavior chart editor toolbar 2 Click the intermediate point you want to remove To move an intermediate point 1 Select the transition and drag the intermediate point in the desired direction To toggle spline interpolation for a transition 1 Select the transition and click Spline curve on the behavior chart editor toolbar or Right click the transition and choose Spline curve from the popup menu A To edit the conditions trigger guard probability of a transition on the behavior chart editor 1 Select the transition and click Transition conditions toolbar or Right click the transition and choose Transition conditions from the popup menu The Transition conditions dialog box will appear If the transition exits an ordinary state the Transition conditions dialog box will look as shown in Figure 110 If the transition exits a switch point see Section 2 4 6 the Transition conditions dialog box will look as shown in Figure 111 If the transition exits a probabilistic switch point see Section 2 4 7 the Transition conditions dialog box will look as shown in Figure 112 121 Transition conditions Trigger event Some 99 Boolean expression i when Signal identifier le Real expression ate COO None Guard condi
39. private continuous class Model is pragma class Model rectangle Top 0 Left 0 Heic equations unknown F end Model static model Model end mymodel lt Invalid project definition Corect the text and try agam Figure 150 The Error window 3 7 WORKING WITH EXECUTABLE MODELS Whenever there is a project open in the integrated modeling environment the user can at any time run it by clicking the Run model P toolbar button or choosing the respective item from the main menu this automatically generates and starts the visual executable model The visual executable model is a separate Windows application that implements the model and allows the user to experiment with it The visual executable model can at any time be terminated 142 from either the integrated modeling environment or the visual executable model itself This functionality is available in all Rand Model Designer versions Additionally Rand Model Designer Corporate and Rand Model Designer Educational versions allow the user to build and save the executable model as a standalone executable that can be run separately from the integrated modeling environment Furthermore the project can be configured to produce the embeddable executable model instead of the visual one see Section 3 8 3 The embeddable executable model is a Windows DLL that any software can link to in order to get programmatic access to the model For more on executable models se
40. t x yj t y x 2 phittheta t phi theta 1 t theta v 2 0 t 2 2 Unknown variables t phi Initial values for derivatives 2 27 0 Equations Figure 88 Inherited system of equations 2 Double click the Continuous behavior node or any of its sub nodes or Right click the Continuous behavior node or any of its sub nodes and choose Edit from the popup menu The Text Editor window will appear as shown in Figure 89 is Equation editor Class_2 x zZ phi theta phistheta 1 thetaty 0 d2z Figure 89 Overriding inherited equations 3 Use the Text Editor window to modify the equations 4 When ready click OK A confirmation message box will be displayed 5 Click Yes 6 If necessary select the unknown variables in the Select unknown variables dialog box if it appears 7 The modified system of equations will appear in the equation system editor The overridden elements will be displayed with the sign as shown in Figure 90 111 Continuous behavior x y y x 2 phit theta 2 phittheta 1 thetat y 2 0 2 2 Unknown variables t phi theta x y 2 Initial values for derivatives 2 z 0 Equations Figure 90 Overridden system of equations At any moment the set of unknown variables can be modified via the Unknown variables node of the equation system editor To modify the set of unknown variables 1 Double click the Unkno
41. tabs are described in the subsections that follow The dialog box also contains two buttons Apply and Close The Apply button applies the current settings and closes the dialog box The Close button closes the dialog box without applying the current settings 4 2 15 2 1 The Tolerance Tab The Tolerance tab see Figure 238 contains the following elements e Phase variables This group of fields specifies the absolute and relative error tolerances for variable values for all numerical methods and switch point detection Absolute This field specifies the absolute error tolerance 211 Relative This field specifies the relative error tolerance e Time This group of elements specifies the time error tolerance for switch point detection Relative This option selects the relative error tolerance The tolerance value is specified in the field on the right Absolute This option selects the absolute error tolerance The tolerance value is specified in the field on the right e Fixed step This field specifies the fixed step for fixed step numerical methods e Restore defaults This button restores the default tolerance settings 4 2 15 2 2 The Differential equations Tab Numerical methods Algebraic differential equations Algebraic equations Optimization Tolerance Automatic Explicit methods Implicit methods Debug methods C DOPRIS C RADAU C Euler C DOPRI853 DDASSL
42. var str variant TRetCode Retrieves the textual description of the last error The hModel parameter identifies the model instance The str parameter receives the description If any of the embeddable model functions returns something other than rcOK this function can be called to obtain the textual description of the error e function GetLastHModError pChar Returns the textual description of the last error occurred in the default model instance If any of the embeddable model functions returns something other than rcox for the default model instance this function can be called to obtain the textual description of the error e function getMessages hModel TModelHandle var Messages variant TRetCode Retrieves the messages and warnings generated by the specified model instance since model start or the last call to this function The hModel parameter identifies the model instance The Messages parameter receives the list of messages and warnings 239 240 function getExpressionValueEx hModel TModelHandle pC pWideChar var Value variant TRetCode Evaluates the specified expression The hModel parameter identifies the model instance The pc string specifies the expression The Value parameter receives the evaluation result If the specified expression is incorrect the Value parameter is set to Unassigned function GetExpressionValue pC pChar variant Evaluates the specified expression in the context o
43. 163 A model EJ A Evari C1 gt 2 C2 gt 1 2 2 varl ci vari C2 1 2 Fvar2 C1 gt 10 C2 gt 0 Figure 163 Record and connector values The user can view the components of a record or connector by expanding the corresponding node or by opening the Components window To open the Components window for a record or connector 1 Double click the corresponding row in the Variables window or Right click the corresponding row in the Variables window and choose Edit from the popup menu The Components window will appear as shown in Figure 164 ADs ny fe model var2 Ci C2 Figure 164 The Components window The Variables window allows the user to modify any scalar vector or matrix value by editing it in place In addition to this vectors and matrices can by modified using the Elements dialog box whereas records and connectors can be modified using the Components window Variables can be modified at any time even while the model is running whereas parameters can only be modified when the model is stopped see Section 4 2 16 To modify a scalar value in place 1 Double click the corresponding row in the Variables window or Right click the corresponding row in the Variables window and choose Edit from the popup menu An in place editing field will appear as shown in Figure 165 156 Figure 165 Editing the value of a variable 2 Type the new value 3 Hit Enter or click anywhere ou
44. 180 Typical phase diagram A typical phase diagram is shown in Figure 180 In a phase diagram the x axis represents one variable while the y axis represents the other variables A Diagram window displaying the time diagram of all variables of the model object opens automatically upon executable model startup if the model object has any displayable variables Other Diagram windows can be opened and populated manually The user can open as many Diagram windows as necessary To open a new Diagram window 1 Click New diagram gt on the main toolbar or Choose Window New diagram from the main menu A new Diagram window will appear as shown in Figure 181 A Time diagram Figure 181 New Diagram window The Diagram window can display double integer short and byte variables individual elements of vectors and matrices enumeration variables and signal variables The user populates the Diagram window with variables by dragging and dropping them from other windows To add a variable to a Diagram window 1 Drag the variable from a Variables or Structure window and drop it onto the Diagram window 166 2 Ifthe variable is a double integer short byte enumeration or signal it will be added to the diagram immediately Otherwise if the variable is a vector the Select items dialog box will appear as shown in Figure 182 Or if the variable is a matrix the Select items dialog box will appear as sho
45. 2 14 1 1 Standard Math Functions e abs x returns the absolute value of x e arccos x returns the arccosine of x requires 1 lt x lt 1 e arch x returns the inverse hyperbolic cosine of x e arcsin x returns the arcsine of x requires 1 lt x lt 1 e arctg x returns the arctangent of x e arsh x returns the inverse hyperbolic sine of x e arth x returns the inverse hyperbolic tangent of x e ch x returns the hyperbolic cosine of x e cos x returns the cosine of x where x is specified in radians e ctg x returns the cotangent of x where x is specified in radians Requires So SE es Ns e deg x converts x from radians to degrees 48 exp x returns the exponential of x lg x returns the base 10 logarithm of x requiresx gt 0 1n x returns the natural logarithm of x requires x gt 0 max xl x2 xn returns the maximum among the arguments min xl x2 xn returns the minimum among the arguments rad x converts x from degrees to radians round x rounds x to the nearest integer sh x returns the hyperbolic sine of x sign x returns 1 if x gt 0 lif x lt 0 sin x returns the sine of x where x is specified in radians sqrt x returns the square root of x requiresx 0 tg x returns the tangent of x where x is specified in radians Requires T x t Tn 2 th x returns the hyperbolic tangent o
46. 3D objects Caption Viewport area Range Iv show axes IV show back plates F line smooth background color Light position xB zB show x vf Z Rotations degrees e a 2 Ia 4 Figure 217 The 3D animation parameters dialog box the General tab The 3D animation parameters dialog box consists of two tabs General and 3D objects 190 4 2 8 1 1 The General Tab The General tab see Figure 217 contains the following elements Caption This field specifies the title of the 3D Animation window Viewport area This groups of fields defines the viewport area show axes This checkbox shows hides the axes show back plates This checkbox shows hides the background surfaces line smooth This checkbox enables disables line smoothing Light position This group of elements defines the location of the light source The X Y and Z fields specify the coordinates of the light source The show checkbox shows hides the light source marker Rotations This group of elements specifies the angles of rotation of the animation around its axes When all angles are zeros the x axis points right the y axis points up and the z axis points out of the screen towards the viewer 4 2 8 1 2 The 3D objects Tab 3D animation parameters Oper TODO oO oOo 3 is 3 ig a Er 4 x Figure 218 The 3D objects tab The 3D obje
47. 70 9 pragma transition _Tran_10158082 footnote re pragma transition _Tran_10158082 style poly end model W5 s Bo Figure 147 Textual representation of a project To load a textual representation into the currently open project 1 Choose Project Load from text from the main menu The Import project as text from dialog box will appear as shown in Figure 148 Import project as text from Look in S mymodel on c Eg Imports D Om My Recent mymodel myl Documents Desktop My Documents My Computer My Network File name mymodelmv Places Files of type MYL modules mv v Figure 148 The Import project as text from dialog box 141 2 Select the file you want to load 3 Click Open Rand Model Designer will parse the selected file 4 lf there are no problems the success message will appear as shown in Figure 149 Click OK Rand Model Designer will re generate and re open the project MYL compiler C My Documents mymodel mym Project mymodel Current line 14 Total lines 26 Compilation successful Figure 149 Success message 5 If there is a problem a window describing the encountered error will appear as shown in Figure 150 In this window you can either try to correct the problem and retry the operation by clicking Retry or cancel the operation by clicking Close Error detected Current line 4 TER package mymodel is import SysLib
48. Click the second cell of the row and type the expression you want to evaluate In the expression you can use parameters variables and constants of the class specified on the previous step as well as any predefined functions If you want to find out the value of a parameter variable or constant simply type the name of the parameter variable or constant Hit Enter The result of the expression will appear in the third cell as shown in Figure 145 f Formula calculator a x Class 1 cos V_1 9 8 V4 28 797 Figure 145 Evaluation result 139 G e To evaluate an already entered expression K gt 1 Right click the corresponding row and choose Calculate row from the popup menu ae gt To evaluate all available expressions 1 Right click anywhere in the Calculator window and choose Calculate all from the popup menu e d To add a row K gt 1 Right click anywhere in the Calculator window and choose Add line from the popup menu G To remove a row te 1 Right click the row and choose Delete line from the popup menu 3 6 TEXTUAL PROJECT REPRESENTATION In Rand Model Designer every project has a textual representation in a language called MVL see Section 6 3 At any time the textual representation of the currently open project can be saved to or loaded from a text file This capability can be used for various purposes including advanced editing and integration with other software
49. Constant dialog box 1 Double click the constant in the class editor tree or Right click the constant in the class editor tree and choose Edit from the popup menu The Constant dialog box will appear as shown in Figure 57 2 Use the Constant dialog box to modify the constant When done click OK To modify a constant in place in the class editor tree 1 Click the constant in the class editor tree After a short while click the constant again An in place editing field will appear as shown in Figure 61 Constants c fConst_1 double 0 E Functions and procedures Figure 61 Editing a constant in place 2 Modify the constant definition in place 3 Hit Enter or click anywhere in the class editor To convert a constant into a parameter or a variable 1 Drag the constant to the Parameters External variables State variables or Variables node of the class editor tree 3 4 6 Functions and Procedures The Functions and procedures node of the class editor tree represents the functions and procedures of the class For more on class functions and procedures see Section 2 14 2 To create a new function or procedure 1 Right click the Functions and procedures node in the class editor tree and choose New function or procedure from the popup menu The Text Editor window will appear as shown in Figure 62 i Algorithmic procedure or function unction Fun_l in Z double return double is egin return 0 en
50. Creation and Destruction Functions function createModel var hModel TModelHandle TRetCode Creates a new model instance On success returns a handle to the created instance in the hModel parameter The returned handle is always greater than or equal to 0 The embeddable model will never assign the returned handle to any other model instance When a created model instance is no longer needed it should be destroyed using the destroyModel function function destroyModel hModel TModelHandle TRetCode Destroys the model instance specified by the hModel parameter 4 4 3 Functions to Save and Restore Model State function saveModel hModel TModelHandle var size integer pData pointer TRetCode Saves the current state of the specified model instance to the specified buffer in XML format The hMode1 parameter identifies the model instance The pData parameter points to the buffer The size parameter specifies the actual buffer size on entry and the minimum buffer size required to store all available data on exit This function is typically used as follows The function is first called with size set to 0 and pData setto nil to obtain the required buffer size A buffer of the required size is than allocated and the function is called again to retrieve all available data The function fills the supplied buffer with an XML document that can be viewed and edited by the user function loadModel hModel TModelHandle size integer
51. SER E Constants eo E Functions and procedures Comments Local classes Eh Hybrid Continuous Behavior chart Interface v 6 0 54 c 1997 2010 MVSTUDIUM Group Figure 22 Main window The main window consists of the main menu main toolbar Project Manager window and class editing area The main menu provides access to most of the functions of the integrated modeling environment The main toolbar provides shortcuts to some of the most commonly used items of the main menu The Project Manager window displays all components of the currently open project classes declared types constants functions procedures and imported packages in a tree view The class editing area serves as a container for class editor windows opened by the user 3 2 WORKING WITH PROJECTS The integrated modeling environment allows the user to create open save and rename projects At any moment there can be at most one project open For more on projects see Section 2 1 To create a new project 1 Click New Project 0 on the main toolbar or Choose Project New from the main menu The New project dialog box will appear as shown in Figure 23 70 New project Name pee Folder c My Documents Browse Model type S Continuous elementary object a Hybrid elementary object eg Block diagram Figure 23 The New project dialog box 2 Type the name of the project in
52. The Variables window displays the current values of parameters and variables of some object see Section 2 8 and Section 2 9 The Variables window looks as shown in Figure 161 Figure 161 The Variables window The Variables window displaying the parameters and variables of the model object opens automatically upon executable model startup if the model object has any parameters or variables The Variables windows of other objects can be opened manually from Behavior Chart see Section 4 2 2 and Structure see Section 4 2 3 windows The Variables window displays the values in a list one row per parameter or variable Parameter and variable names are shown on the left and their respective values are shown on the right Vector and matrix values are displayed as vector and matrix literals If a vector or matrix value does not fit in the available space the Variables window displays it partially and allows the user to view the full contents in a separate dialog box To view the full contents of a vector or matrix 1 Double click the corresponding row in the Variables window or Right click the corresponding row in the Variables window and choose Edit from the popup menu The Elements dialog box will appear as shown in Figure 162 155 DER OK cancel Figure 162 The Elements dialog box Record and connector values see Section 0 and Section 2 13 4 are displayed as expandable nodes as shown in Figure
53. an image or printed To save the contents of a Histogram window to a file as an image 1 2 3 4 Right click anywhere in the Histogram window and choose Save image from the popup menu The Save As dialog box will appear Browse to the folder where you want to save the image Type the file name in the File name field Click Save To print the contents of a Histogram window 1 180 Right click anywhere in the Histogram window and choose Print from the popup menu The standard Print dialog box will appear as shown in Figure 207 Printer Name Microsoft Office Document Image Writer Status Ready Type Microsoft Office Document Image Writer Driver Where Microsoft Document Imaging Writer Port Comment Print range p Copies All Number of copies Cancel Figure 207 The Print dialog box 2 Adjust printing properties if necessary and click OK 4 2 7 The 2D Animation Window As follows from its name the 2D Animation window is intended for two dimensional animation The 2D Animation window provides a two dimensional scene that can be populated with standard animation components such as indicators and sprites Components can be associated with model variables so that when model variables change components move and change their appearance accordingly thereby animating the model The user can open and populate as many 2D Animation windows as necessa
54. appear as shown in Figure 56 State variables 1 double 0 A Constants Figure 56 Editing a variable in place 2 Modify the variable definition in place 3 Hit Enter or click anywhere in the class editor If the initial value of a variable is specified by a static expression the variable can be converted into a parameter or a constant To convert a variable into a parameter or a constant 1 Drag the variable to the Parameters node or the Constants node of the class editor tree 3 4 5 Constants The Constants node of the class editor tree represents the constants of the class For more on class constants see Section 2 10 To create a new constant 1 Right click the Constants node in the class editor tree and choose New constant from the popup menu The Constant dialog box will appear as shown in Figure 57 Constant Identifier Cancel Type double Help Value 0 Comments E Group e Figure 57 The Constant dialog box 2 Type the name of the new constant in the Identifier field 3 To specify the type of the new constant click Type The Choose type dialog box will appear Use the Choose type dialog box see Section 3 4 10 to choose the type of the constant When done click OK in the Choose type dialog box 4 To specify the value of the new constant click Value If the type of the constant is an enumeration the Choose enumerated value dialog box will appe
55. as shown in Figure 126 To resize a local object 1 Select the local object 2 Drag any border of the local object in the desired direction To rotate a local object 1 Right click the local object and choose Rotate 90 clockwise Rotate 90 counterclockwise or Rotate 180 from the popup menu To create a new group of objects 1 Click Add group of objects on the structure diagram editor toolbar The Add a new group of objects dialog box will appear as shown in Figure 118 Specify name template for the group of objects amount of objects vertically and horizontally and interval between objects Click OK 2 Choose the class in the Class selection dialog Figure 117 objects of the group will be the instances of the selected class Click OK This adds a group of objects with the specified location and name pattern Fig 119 If the specified template gives Invalid object name the name is automatically generated 129 E a eae ce are Ao6basnenne rpynnbi O bEKTOB Wa6non umen Unpnna Beicora Konuyectso B CTpoKe 8 cron6ue VHTepsean B CTpoKe B cron6ue o Gene Kapra nogegenna Crpykrypa Figure 2 Add a new group of objects dialog box o aa y EMEN al A BA Tube_i Tube_2 Tube_3 Tube_4 Kapta nogegenna Crpykrypa Figure 3 New group of objects is created To rename a local object 1 Double click the name of the local object or Right click the local
56. atects sheds tebacetaeda taeda cei 150 39 2 The Colors Taburesi anA R R A RRA 150 3 9 3 The Display T b iener ea ee aaa era ia aaia at 151 3 9 4 The Fonts Tabpnc nepen a aa aad a ia daada 151 3 10 Miscellaneous FunctionS sssssesisssssrissssnneerirnassinnesnnnasdnnnnaaatinnaatannnana 152 4 1 Executable Model Categories 0 0 0 ccecececeeeeeeeeeeeeeneeeeeenaeeeseenaeeeeeeeneeeeeeaas 154 4 2 Visual Executable MOdel cc ceeecceeeeeeneeeeeeneeeeeseaeeeeesaaeeeeeenaeeeeetneeeeneaes 154 4 2 1 The Variables WindOW ccccecceeeeeeeeeeeeeeeeeeeeeeeseeeaeeeseeaeeeeeeenaees 155 4 2 2 The Behavior Chart WiNdOW cccceeeeeeeeeeeeteeeeeteteeeetenteeeene 158 4 2 3 The Structure WindOW 0 eccceceeeeeeeeeeeeeeeeeeeeeeeeteneeeeeseeaeeeseeenaees 161 4 2 4 The Diagram Window 00 eeccecceeeceeeeeeeeeeeeeeeeeeeseeeeeeeseeaeeeeeeenaees 165 4 2 5 The Static Phase Diagram WiNdOW ccceeeeeeeeeeteeeteeaees 174 4 2 6 The Histogram WiNdOW c cccceeceeeeeeeeeeeseeeeeeeseneeeeesenaeeeseeaaees 175 4 2 7 The 2D Animation WindoW c ccccecceeeeteeeeeeeieeeeeteieeeeetneeeeee 181 4 2 8 The 3D Animation WiNdOW ecccceeceeeeeeereeeeeeeeeeeeseeneteeeeeaeees 189 4 2 9 The Aggregate System of Equations Window cceeeeees 197 4 2 10 The Structure Matrix Window cccceeeeceeeeeeeeeeeseeneeeeeeeaeees 199 4 2 11 The
57. available type except for signal and connector types see Section 2 13 The value of a constant is specified by an expression see Section 2 15 The expression specifying the value of a class constant may reference other constants of the class and any constants of the project The expression specifying the value of a project constant may reference other constants of the project In either case such references are not allowed to form cycles If a constant is defined in a project it has visibility The visibility indicates that the project constant is either private or public A private constant can only be used in the project containing that constant A public constant can be used in any project For the detailed discussion of the visibility of project components see Section 2 1 Class constants differ from project constants in their scope see Section 2 17 Project constants are visible in the entire project Moreover public project constants are visible in all other 37 projects that import their containing project Class constants are only visible within their containing class 2 11 LOCAL CLASSES A hybrid class can contain an arbitrary number of local classes A local class is a class defined in a hybrid class Local classes can be used to associate activities with behavior chart states see Section 2 4 of their containing class All in all local classes have the same semantics as ordinary classes see Section 2 2 except for
58. be less than the number of equations in the aggregate system Rand Model Designer adjusts the aggregate system by arbitrarily selecting the required number of unknown variables from the set of free variables and declaring the remaining free variables known The resulting system is considered formally resolvable and is solved in its adjusted form 2 7 STRUCTURE DIAGRAM If a class is compound and or open see Section 2 3 it has the associated structure diagram If a class is compound its structure diagram specifies the internal structure of the class If a class is open its structure diagram defines the interface of the class If a class is compound and open at the same time its structure diagram serves both functions A structure diagram can contain e Local objects e Links e The class boundary Local objects define the internal structure of a compound class Local objects are the elements from which a compound class is built Links define how local objects interact with each other and the class itself Links are connections between variables The class boundary defines the interface of an open class 2 7 1 Local Object If a class is compound its structure diagram may contain and usually does contain one or more local objects A local object is shown on a structure diagram as a rectangle see Figure 12 27 lt object name gt Figure 12 Local object A local object has the following properties e Name e Class e Act
59. be optimized they can also be defined as the relations between these parameters equations and inequalities 4 3 1 Obtaining a parametric dependence To obtain one or more parametric dependencies click Simulation gt Typical computing experiment gt Parametric dependence On the page Settings see Figure 239 you need to specify a list of variable parameters and a list of dependent variables To add a parameter use your mouse to drag the desired one from the window of variables and drop it down to Parameter table To remove parameter or change parameter order right click Parameter table and use the appropriate command of pop up menu For each parameter you need to specify the start end and increment values To add a dependent variable use your mouse to drag the desired variable from the window of variables and drop it down to Dependent variable table To remove variable or change variable order right click Dependent variable table and use the appropriate command of pop up menu For each dependent variable you need to specify the point of measuring a specific time T or model termination event To do this enter the time value into Point time of gauging column or leave it empty for model termination event Figure 239a shows the settings for obtaining dependencies of the maximum flight range and maximum height of the trajectory of the missile on the initial angle of throwing air density aerodynamic drag coefficient an
60. bit characters pWideChar a pointer to a null terminated string of 16 bit characters double a 64 bit floating point ANSI IEEE Std 754 1985 number pointer a 32 bit pointer to data variant a value of undefined type THandle integer a handle TModelHandle THandle a handle to a model instance TVarHandle THandle a handle to a variable TRetCode integer a function return code 234 TRetCode constants rcOK 0 success rcModelDoesNotExist 1 the specified model instance does not exist rcModelIsNotAtBreakpoint 2 the specified model instance is not in the stopped state rcModelError 3 model error detected rcInvalidExpression 4 invalid expression xrcTimeOut 5 the operation timed out rcInvalidModelHadle 6 the specified model handle is invalid rcInvalidVarHandle 7 the specified variable handle is invalid rcVarDoesNotHaveValue s the specified variable does not have a value at this point rcInvalidVarType 9 invalid variable type rcInsufficientDataLength 10 buffer size is too small rclllegalVarValue 11 illegal variable value rcVarNotFound 12 the specified variable was not found rcExceptionWhileExecuting 1 the operation threw an exception TVarHandle constants vhVarNotFound 1 the specified variable was not found 4 4 2 Model
61. by the class to interact with its environment If a class is open see Section 2 3 it can have variables of two kinds external and internal External variables define the interface of the class If a class has external variables they appear on the class boundary on the structure diagram of the class see Section 2 7 2 Also if some structure diagram contains a local object whose class has external variables those external variables appear on the border of the local object see Section 2 7 1 Internal variables belong to the internal implementation of the class and have no direct effect on the class interface If a class is isolated it can only have internal variables Internal variables of an isolated class are usually called simply variables Every variable has the following properties e Name e Category if the variable is external e Type e Default initial value e Designation as a discrete optional The name of a variable is an identifier see Section 6 2 unique across all variables of the class If a variable is external it has a category The category defines the role of the variable in the class interface Possible variable categories are e Input e Output e Contact e Flow e Connector An input variable can transfer information in only one direction namely to the class The value of an input variable can only be changed from outside the class An output variable can transfer information in only one directio
62. ee 245 Cl ss name COsotriating nitai a a e a ates 245 5a Nonlin ar BIOCKS reani d ana E AE EAO 246 5 2 T CDEAdZONG ire ee denen aiin tea ai E iaa 246 Glass name Che ad ZOnE iirinn a AEE A EEEE AEE ANE 246 9 2 2 CUr a E AS 247 Class name CSatusata Ome piccit2eb cei sadd ieee Mec cceieacnscees teed seeia EEEIEE 247 32 3 CROIAY heres cd E ote E ae tacevs dents betes tein repentance tate aad es 248 Class naim CRalay wn sikeds aia teen i a ended eid ig eet eet ieee eh 248 524 CSOWIUCH irse Serta aa adean aea ea a Eaa aaea aE Ke E aa aieea 249 Glass name CSwi teh nieis lide dele EEE AE E A STANE EEN N a 249 5 2 5 CImterpOlator srar aeaaeae ea saad baad dnegea sda a aaataee ce 250 Class name CInt rpolat or ucte nena earn A aA ane enna 250 5 3 Signal Sources Generators cececeeeeeeeeeeeeeeeeeeeeeteeeeesaeeeeesneeeeeetnaeeeeee 250 5 3 1 CRampGenerator ccccccceceeeeeeneeeeeeeeeeeeeenneeeeeeeeeseeseneeeaeeeeees 250 Class name CRampGenerator 2 eceecececceceeeceeeeeeeeeceeeeeeeeceeeeeaeeeceeeeeeecaaeeeseeeseeeeeineeeeeeeeseeees 250 5 3 2 CSineGenerator iiien eenia na ana aeeai 251 Class name CSineGener ator caccedisie ce eveeecateviee event etevs eee aide ever enee ed SEEE nevis 251 5 3 3 CSawtoothGenerator 00 cceceeece a a a a a 252 Class NAME CSawtoOOthGeNnerat OL nenasoniiaiddri n dd ia 5 3 4 CPulseGenerator ccccescccceteeeecceseeeeceeteeeceeesnseceeesneanecenesneeeeeteaaae 253 Class nam
63. executable model startup and uses it to drive the execution of the model The fact that every project contains the Model class means that there is a one to one relationship between projects and model definitions Every project provides a definition of some model while every model definition resides in some project Each component of a project has visibility which can be either private or public Declared types always have public visibility A component with private visibility a private component can only be used in its containing project A component with public visibility a public component can be used in both its containing project and other projects In order to be able to use a public component of another project a project must import that other project An imported project is called an imported package Every project has an associated list of imported packages that identifies the packages imported into the project All public components of an imported package are imported into the importing project that is become available for use in the importing project The importing project can refer to imported components using compound component names that include the imported package name as the prefix for example SysLib CSineGenerator A project whose public components are mainly intended for use in other projects is usually called a library Even though the contents of a library is meant for use in other projects every library ha
64. has a base class The base class is specified upon creation of a class If a class is created with a base class the base class can be modified later but cannot be removed If a class is created without a base class the base class cannot be added later For more on class inheritance see Section 2 12 To modify the base class 1 84 Double click the Superclass node in the class editor tree or Right click the Superclass node in the class editor tree and choose Edit from the popup menu The Choose class dialog box will appear as shown in Figure 41 Choose class i i Imported packages sl P This project Class_1 mm Class 2 Class 3 Model mal New class Figure 41 The Choose class dialog box Select the new base class and click OK A confirmation message box will appear Click Yes If the recompilation succeeds without problems the Superclass node will start displaying the name of the newly selected base class Otherwise a window describing the encountered problem will appear as shown in Figure 42 In the latter case you can either try to correct the textual representation of the project see Section 3 6 and recompile the project again by clicking Retry or cancel the operation by clicking Close Error detected Current line 16 package al is import SysLib continuous class Class_1 is pragma class Class_1 rectangle Top 0 Left 0 Height 0 Width 0 x double 0 Equations unknow
65. how the Diagram window handles value gaps that occur when variables change discretely due to model state changes no indicates that gaps remain open dots indicates that gaps are closed with dotted lines solid indicates that gaps are closed with normal solid lines step These two fields if present specify the grid step along the x axis the first field and the y axis the second field 173 e min These two fields if present specify the minimum value along the x axis the first field and the y axis the second field e max These two fields if present specify the maximum value along the x axis the first field and the y axis the second field e scale These two fields if present specify the scaling factor for the x axis the first field and the y axis the second field e Color fill This group of color selectors specifies the fill colors The Plot colors are used to fill the plot area The Panels colors are used to fill the rest of the diagram In each row Color 1 specifies the starting color of the linear gradient while Color 2 specifies the ending color e Xaxis label This field specifies the label displayed along the x axis e Y axis label This field specifies the label displayed along the y axis e OK This button applies the current settings and closes the Diagram parameters dialog box e Cancel This button closes the Diagram parameters dialog box without applying the current settings
66. lt operator gt i lt assignment_operator gt lt procedure_call_operator gt lt if_operator gt lt case_operator gt lt loop_operator gt lt exit_operator gt lt return_operator gt lt send_operator gt lt optimization_operator gt lt comments gt lt text_until_end_of_line gt lt assignment_operator gt lt identifier gt lt expr lt procedure_call_operator gt lt procedure_name gt lt argument_list gt lt argument_list gt lt argument gt lt argument gt lt argument gt lt expression gt lt if_operator gt if lt conditional_expression gt then lt operator_sequence gt elsif lt conditional_expression gt then lt operator_sequence gt else lt operator_sequence gt end if lt conditional_expression gt lt expression gt lt case_operator gt ri case lt selector_expression gt of when lt option gt lt option gt gt lt operator_sequence gt when others gt lt operator_sequence gt end case lt option gt lt static_expression gt lt static_expression gt lt expression gt lt loop_operator gt lt loop_specification gt lt loop_body gt ssion gt 259 lt loop_specification gt for lt loop_variable gt in lt range gt while lt conditional_expression gt lt loop_variable gt lt identifier gt lt range gt lt lower_bound gt lt upper_bound gt lt lower_bound gt
67. methods These methods attempt to solve the aggregate system of equations using some well known algorithm These methods have well known characteristics that determine their suitability for solving different kinds of equation systems If the concrete method selected by the user cannot solve the current aggregate system of equations with the requested tolerance it stops the model execution and displays an error message e Debug methods These methods are designed to robustly solve the aggregate system of equations for the maximum possible period of model time allowing the user to quickly analyze and if necessary correct the model Debug methods are available for differential equations only To open the Numerical methods dialog box 1 Click Numerical methods on the main toolbar or Choose Settings Numerical methods from the popup menu The Numerical methods dialog box will appear as shown in Figure 238 Numerical methods Algebraic differential equations Algebraic equations Optimization Differential equations Phase variables Fixed step Absolute 1 000E 06 1 000E 02 Relative 1 000E 06 Time Relative 7 C Absolute KDOS Restore defaults Figure 238 The Numerical methods dialog box the Tolerance tab The Numerical methods dialog box consists of the following tabs Tolerance Differential equations Algebraic differential equations Algebraic equations Optimization and Modes These
68. nA Group w Figure 31 The Constant dialog box 2 Type the name of the new constant in the Identifier field 3 To specify the type of the new constant click Type The Choose type dialog box will appear Use the Choose type dialog box see Section 3 4 10 to choose the type of the constant When done click OK in the Choose type dialog box 4 To specify the value of the new constant click Value If the type of the constant is an enumeration the Choose enumerated value dialog box will appear as shown in Figure 32 Otherwise if the type of the constant is a record the Component Editor window will appear as shown in Figure 33 Otherwise the Text Editor window will appear as shown in Figure 34 Choose enumerated value Figure 32 The Choose enumerated value dialog box 77 Initial yalue for globConst_1 Mathematical editing Close Figure 34 Editing the value of a constant in the Text Editor window If the type of the constant is an enumeration choose the value of the constant in the Choose enumerated value dialog box When done click OK in the Choose enumerated value dialog box If the type of the constant is a record use the Component Editor window see Section 3 4 17 to specify the value of the constant When done click Apply in the Component Editor window If the type of the constant is any other type use the Text Editor window see Section 3 4 12 to specify the expressio
69. one or more groups click LJ The Groups dialog box will appear Use the Groups dialog box see Section 3 4 11 to assign the parameter to one or more groups When done click Apply in the Groups dialog box 10 Click OK in the Parameter dialog box To modify a parameter using the Parameter dialog box 1 2 Double click the parameter in the class editor tree or Right click the parameter in the class editor tree and choose Edit from the popup menu The Parameter dialog box will appear as shown in Figure 43 Use the Parameter dialog box to modify the parameter When done click OK To modify a parameter in place in the class editor tree 1 Click the parameter in the class editor tree After a short while click the parameter again An in place editing field will appear as shown in Figure 47 Parameters age 1 double 0 lt gt External variables Figure 47 Editing a parameter in pace Modify the parameter definition in place Hit Enter or click anywhere in the class editor 87 To convert a parameter into a variable or a constant 1 Drag the parameter to the External variables State variables Variables or Constants node of the class editor tree 3 4 4 Variables If a class is open its class editor tree contains the External variables and State variables nodes representing the external and internal variables of the class respectively If a class is closed its class editor tree con
70. operator Example loop ZS Zoom Ky exit when x lt 0 end loop 2 16 7 The return Operator The return operator transfers control to the invoker of a function returning a certain value as the result of the function Syntax lt return_operator gt return lt expression gt The return operator evaluates the expression following the return keyword and returns control to the caller of the function passing the result of the expression as the result of the function The expression must evaluate to the type of the return value of the function see Section 2 14 2 Example return 4 exp x 2 16 8 The send Operator The send operator creates and sends a signal Syntax lt send_operator gt send broadcast lt variable_name gt lt argument_list gt lt variable_ name gt lt identifier gt lt argument_list gt lt argument gt lt argument gt lt argument gt lt expression gt The send operator evaluates the argument expressions in the order of their appearance in the argument list and creates a signal using the resulting values as arguments The operator then sends the created signal to the specified source variable the source variable must be of a signal type see Section 2 13 5 As the result the signal arrives at all variables connected to the source variable either directly or through other variables At that moment if there are behavior chart transitions awaiting a
71. parameters within a series have the same category and type lt parameter_category gt is a parameter category with the following possible values in out and in out in the default indicates that the parameters of the corresponding series are input parameters out indicates that the parameters of the corresponding series are output parameters in out indicates that the parameters of the corresponding series are input output parameters lt parameter_name gt is a parameter name unique across all parameters of the function or procedure lt parameter_type gt is the type of a series of parameters This can be any available type see Section 2 13 lt return_value_type gt is the type of the return value of the function This can be any available type see Section 2 13 lt local_variables gt is the definition of the local variables of the function or procedure lt variable_series gt is a series of local variables All variables within a series have the same type lt variable_name gt is a local variable name unique across all local variables of the function or procedure lt variable_type gt is the type of all variables in a series of local variables This can be any available type see Section 2 13 lt expression gt is an expression see Section 2 15 specifying the initial value of a local variable lt operator_sequence gt is the sequence of operators that implements the function or procedure lt operato
72. range may not be less than 1 If the lower bound of an iteration range is greater than 1 the skipped rows and or columns are filled with zeros 43 2 13 2 3 Arrays The declaration of type array of TE defines a one dimensional dynamic array with elements of type TE numbered from zero TE type can be either a scalar type or the type of user defined declared type or an object type Current index bounds are available through predefined functions low and high and the current length through predefined function Length Dimension of a dynamic array can be changed by means of procedure set Length Array examples Al array of boolean false true false A2 array of integer A3 array of double 1 5 2 89 3E12 A7 array of string ABC abc type TAD is array of double type TInt is integer type TAV is vector 3 type T2 is record C1 double C2 integer C3 array of double end record type TAT2 is array of T2 A4 array of TInt 0 1 2 A5 array of TAD 1 2 3 4 5 A6 array of TAV zeros 3 ones 3 AR2 array of T2 Cl gt 1 C2 gt 0 C3 gt 1 2 Cl gt 1 3 C2 gt 8 C3 gt 4 5 6 In the iterative literal array a minimum value of the range in the iteration header can not be less than 0 If you specify a minimum value greater than 0 the missing elements are filled with default values type TAD is array of double A TAD for I in 2 4 i 2 A 0 0 4 9
73. situation depends on the context in which the Choose type dialog box is used In general the dialog box allows specifying any type supported by Rand Model Designer For more on types see Section 2 13 To specify a scalar type 1 Click the Standard tab if it is not active The Choose type dialog box will look as shown in Figure 66 2 Check the required type 3 Click OK To specify a vector type 1 Click the Vector tab The Choose type dialog box will look as shown in Figure 67 Choose type Signal Enumerated Declared Standard Matrix M Dimension C fied i yariable Type definition vector Figure 67 The Choose type dialog box the Vector tab 2 In the Dimension section check fixed for a fixed size vector type or variable for a variable size vector type 3 If you chose a fixed size vector type type the vector size in the Size field 98 4 Click OK To specify a matrix type 1 Click the Matrix tab The Choose type dialog box will look as shown in Figure 68 Choose type Signal Enumerated Declared Standard Vector Number of row Dimension C fixed variable M Type definition matrix Figure 68 The Choose type dialog box the Matrix tab 2 Inthe Dimension section check fixed for a fixed size matrix type or variable for a variable size matrix type 3 If you chose a fixed size matrix type type the number of rows in the Numb
74. termination of model run Random parameters need not to be specified if their values are defined as random in the model directly To add a parameter use your mouse to drag the desired one from the window of variables and drop it down to Parameter table To remove a parameter right click Parameter table and use the appropriate command of pop up menu For each parameter you need to choose a distribution law normal uniform or beta and specify the parameters for normal expectation and standard deviation for uniform lower and higher bounds of the value interval for beta parameters p and q To select the distribution law click cell in Distribution law column and select item of drop down list to set the distribution parameters edit the values of cells in Par1 and Par2 columns Fig 241 227 228 Calculation of event probability Par2 Hopmanbhbi 0 785398 163397449 0 039269908 1698724 Normal gt mo E Beta 1225 006125 Conditions x gt 2050 and x lt 2100 eA RSUOIS b Figure 8 Calculation of event probability Window To add or remove a condition right click Conditions table and use the appropriate command of the pop up menu Column Conditions contains the logical expressions Condition on Figure 241a corresponds to achieving by a missile the flight range of 2050 2100 meters Figure 241b shows two conditions that define exceeding consumption and production volume of so
75. the Name field 3 Click Browse and browse to the folder that will store the project 4 Select the model type in the Model type list The model type determines the initial stereotype of the automatically created Model class see Section 2 1 and Section 2 3 The stereotype of the Model class can be changed later 5 Click Create To open an existing project 1 Click Open project amp on the main toolbar or Choose Project Open from the main menu The Open dialog box will appear as shown in Figure 24 Look jn BallAndS pring e amp Ee tsi s Ball ndSpring mvb My Recent Documents Desktop My Documents My Computer My Network File name OOOO wt ee ren Places Files of type Projects myvb zr __ Cancel Figure 24 The Open dialog box 71 2 Select the project file you want to open 3 Click Open Recently used projects can be opened via the Project Reopen submenu of the main menu To save the currently open project 1 Click Save project on the main toolbar or Choose Project Save from the main menu To save the currently open project with a new name or location 1 Choose Project Save as from the main menu The Save project as dialog box will appear as shown in Figure 25 Save project as D s Ball ndSpring mvb My Recent Documents G My Network File name v Places Save as type Projects myvb v Cancel Figure 25 The
76. the following differences e A local class is an element of some other class whereas an ordinary class is an element of a project e A local class is only visible in its containing class A local class is not visible in other classes of the same project or other projects e A local class may not have no behavior e All parameters variables constants functions and procedures of the containing class are automatically visible in local classes This makes local classes convenient for implementing state activities e A local class may not be abstract and may not have subclasses 2 12 CLASS INHERITANCE Rand Model Designer supports class inheritance Class inheritance allows the user to create new classes from existing ones A class may have a base class A class that has a base class is called a derived class A derived class inherits all elements and characteristics of the base class including the stereotype behavior chart system of equations structure diagram parameters variables constants functions and procedures If necessary a derived class may extend the base class A derived class may e Widen the class stereotype For example if the base class is isolated the derived class can be open e Add new equations to the inherited system of equations e Override the inherited equations Overriding any subset of the inherited equations requires overriding the entire system of equations e Add new states and transition
77. the full name The third element is an array describing the local objects of the model object procedure SetEndMessage hW hM integer Specifies the message to be sent by threads created by the RunThreadTo function to inform the caller that the model has stopped The hw parameter specifies the window handle The hM parameter specifies the message code If hw is non zero every thread created by the RunThreadTo function will call PostMessage hW hM 0 0 after the model reaches the stopped state CHAPTER 5 SysLib The Standard Class Library This chapter describes the classes that comprise the SysLib library 5 1 LINEAR BLOCKS 5 1 1 CGain CGain 1 gt Figure 252 CGain Class name CGain Parameters K double 1 the gain factor X0 double 0 the initial value of X Input variables X double XO Output variables Y double 0 Function This block generates its output by multiplying its input by the specified gain factor implementing the function Y K X 5 1 2 CSummator CSummator Figure 253 CSummator Class name CSummator Parameters X0 double 0 the initial value of X YO double 0 the initial value of Y Input variables X double X0 YO Y double 242 Output variables Z double 0 Function This block outputs the sum of the inputs implementing the function Z X Y 5 1 3 CSubtractor CSubtractor Figure 254 CSubtractor C
78. the label text dialog box will appear as shown in Figure 212 Enter the label text Figure 212 The Enter the label text dialog box 2 Type the label text and click OK To toggle the edit mode 1 Right click anywhere in the 2D Animation window and choose Editing from the popup menu When a 2D Animation window is not in the edit mode its contents cannot be modified The properties of components added to a 2D Animation window can be modified via their context menus The following subsections describe the supported component types and their context menu items 4 2 7 3 Dancer This component provides the following context menu items e Min Allows to specify the minimum value displayed by the dancer e Max Allows to specify the maximum value displayed by the dancer e Style Allows to convert the dancer to a component of any other type e Value Shows hides the box displaying the associated variable value e Value format Allows to specify the floating point number display format e Show scale Shows hides the scale labels 184 Auto scaling Toggles automatic scaling Position Allows to specify the position and size of the component The position is relative to the upper left corner of the 2D Animation window 4 2 7 4 Linear Indicator Continuous or Discrete This component provides the following context menu items Min Allows to specify the minimum value displayed by the indicator M
79. type defines the type for which the declared type will act as a synonym Consider an MVL example see Section 6 3 type Alphabet is a b c This example creates a declared type Alphabet that acts as a synonym for the a b c enumeration The new type can be used for example as a variable type var Alphabet a This is equivalent to using the same enumeration type directly var a b c a Record and connector types cannot be used as types of parameters variables constants etc directly and can only play the role of the specification in declared types This means that in order to define for example a variable of a record or connector type the user should first declare a type representing the required record or connector type and then define a variable of the declared type Other types can be used as types of parameters variables constants etc both directly and through declared types Declared types have public visibility This means that every declared type can be used in both its containing project and any other project For the detailed discussion of the visibility of project components see Section 2 1 46 2 13 7 Object types The value of a variable of object type is a reference pointer to a particular object static or dynamic A particular object type is specified by class name Variable of this object type can refer to any instances of this class and derived classes Variables of the base type object can refer
80. type of the object read only cannot be associated with a variable Name specifies the name of the object cannot be associated with a variable Visible determines whether the object is visible Color specifies the color x1 y1 z1 specify the coordinates of the starting point nX nY nZ specify the arrow vector Length specifies the arrow length Cylinder radius specifies the arrow cylinder radius Head radius specifies the radius of the arrowhead cone Head length specifies the height of the arrowhead cone Slices specifies the number of segments used to model the arrow Transparency specifies the object transparency must be between 0 fully opaque and 1 fully transparent 4 2 8 12 Surface This object has the following properties Type reflects the type of the object read only cannot be associated with a variable Name specifies the name of the object cannot be associated with a variable Visible determines whether the object is visible Color specifies the color x1 y1 z1 specify the x y and z offset of the surface from the coordinate origin XYZs specifies the coordinates of the surface points This must be a three column matrix whose rows represent the points Points in row specifies the number of points in each row of the surface Transparency specifies the object transparency must be between 0 fully opaque and 1 fully transpa
81. window 1 Right click anywhere in the Aggregate System of Equations window and choose Print from the popup menu The standard Print dialog box will appear 2 Adjust printing properties if necessary and click OK 4 2 10 The Structure Matrix Window The structure matrix is a square matrix of size N where N is the number of scalar equations in the aggregate system of equations N may differ from the number of equations displayed in the Aggregate System of Equations window because every vector equation results in multiple scalar equations one for each component of the vector The i j th element of the structure matrix is equal to 1 if the i th equation includes the unknown variable of the j th equation or 0 otherwise The Structure Matrix window displays the current structure matrix of the model as shown in Figure 221 Every structure matrix element whose current value is 1 is displayed as a small filled square If the X Y checkbox is checked pressing the left mouse button on a matrix element displays the coordinates of that element in the field next to the checkbox 199 amp Structural matrix of numerically solv TBR Figure 221 The Structure Matrix window To open the Structure Matrix window 1 Choose Service Structure Matrix from the main menu The above command is only available if the Consider structure of the equations while calculating flag is checked in the numerical method settings If t
82. 0 hVar N Y function setVarValueEx hModel TModelHandle hVar TVarHandle const X variant TRetCode Assigns the specified value to the specified variable of arbitrary type The hModel parameter identifies the model instance The hvar parameter identifies the variable The X parameter specifies the value If the type of x does not match the variable type the function attempts to convert x to the variable type If that fails rclllegalVarValue is returned Assigning TRUE to a signal variable sends a signal without parameters to that variable function SetVarValue hVar TVarHandle X variant TRetCode Assigns the specified value to the specified variable of arbitrary type in the default model instance A call to this method is equivalent to set VarValueEx 0 hVar X function setVarDoubleValueEx hModel TModelHandle hVar TVarHandle X double TRetCode Assigns the specified value to the specified variable of type double The hMode1l parameter identifies the model instance The hvar parameter identifies the variable The X parameter specifies the value function SetVarDoubleValue hVar TVarHandle X double TRetCode Assigns the specified value to the specified variable of type double in the default model instance A call to this method is equivalent to set VarDoubleValueEx 0 hVar X function setVarVectorValueEx hModel TModelHandle hVar TVarHandle var N integer var X TArrayDouble TRetCode
83. 16 Square brackets are used for indexing the arrays as well as for vectors and matrices A3 A5 0 A5 1 7 8 9 3 V A6 1 ones 3 A4 2 5 AR2 1 Cl gt 3 62 C2 gt 2 C3 gt 1 2 4 Assigning the arrays means copying their values For the arrays there are defined the relations of equality and inequality Two arrays with the same types of items are equal if their indexing boundaries are the same and corresponding elements are equal External variables of type array can be inputs outputs contacts Record components and connectors can also be of type array 2 13 3 Record A record is a type that represents a collection of one or more components each of which has its own name and type Record components are often called fields 44 The name of a record field is an identifier see Section 6 2 unique across all fields of the record The type of a record field can be any available type except for signal and connector types An MVL example see Section 6 3 declaring a record type type MyRecord is record C1 double C2 string C3 vector 3 end record 2 13 4 Connector A connector is a type applicable only to external variables of a class see Section 2 9 A connector type represents a collection of one or more components each of which is analogous to an individual external variable and has the following properties e Name e Category e Type The name of a connector component is an identifier see
84. 2 1 1 Virtual Variables A virtual variable is a variable that is defined in the visual executable model rather than the project Every virtual variable has an associated expression specifying its value During model 157 execution the value of each virtual variable is updated automatically whenever the value of the associated expression changes Virtual variables are created and destroyed using the Variables window In the Variables window available virtual variables are displayed in red To create a new virtual variable 1 Right click anywhere in the Variables window and choose Create virtual variable from the popup menu The Virtual variable dialog box will appear as shown in Figure 166 Virtual variable Identifier Expression Comments po i Help OK Cancel Figure 166 The Virtual variable dialog box 2 Type the name of the new virtual variable in the Identifier field 3 Type the expression for the new virtual variable in the Expression field 4 If necessary type the comments in the Comments field 5 Click OK To modify a virtual variable 1 Double click the virtual variable or Right click the virtual variable and choose Edit from the popup menu The Virtual variable dialog box will appear as shown in Figure 166 2 Modify the properties of the virtual variable as necessary 3 Click OK To delete a virtual variable 1 Right click the virtual variable and choose Delete virtual variab
85. 7 Importing Project Components Project components created in one project can be used in other projects In order for a project component to be usable in other projects it must be declared as public in its containing project A project can gain access to the public components of another project by importing that other project An imported project is called an imported package Importing establishes a 80 permanent link between the importing project and the imported package so that all changes made to the imported package affect the importing project A project can be imported by any number of other projects So if there is a need to share a set of project components between multiple projects it is recommended to place such components into a dedicated ibrary project and have other existing and future projects import that library project this way the projects importing the library project will always use a single version of each library component For more on libraries and import see Section 2 1 The Project Manager window allows the user to import projects into the currently open project The SysLib library see Chapter 5 is automatically imported into every new project To import a project into the currently open project 1 Right click the Imported packages node in the Project Manager window and choose Add imported package from the popup menu The Open dialog box will appear 2 Select the project you want to import 3 C
86. Assigns the specified value to the specified variable of type vector N The hModel parameter identifies the model instance The hVar parameter identifies the variable The N parameter specifies the vector size The X parameter specifies the value function SetVarVectorValue hVar TVarHandle var N integer var X TArrayDouble TRetCode Assigns the specified value to the specified variable of type vector N in the default model instance A call to this method is equivalent to setVarVectorValueEx 0 hVar N X function getTimeValueEx hModel TModelHandle var Time double TRetCode Retrieves the current continuous model time of the specified model instance The hModel parameter identifies the model instance The Time parameter receives the current continuous model time If the specified model instance does not exist or is not in the stopped state Time is set to NaN and an appropriate error code is returned function GetTimeValue double Returns the current continuous model time of the default model instance or NaN if the default model instance is not in the stopped state 4 4 6 Numerical Methods Configuration Functions 238 procedure setTol ATOL RTOL TTOL double Sets the error tolerances The ATOL parameter specifies the absolute error tolerance for variable values The RTOL parameter specifies the relative error tolerance for variable values The TTOL parameter specifies the absolute time tolerance
87. By convention MVL files are given the extension mv1 To save the textual representation of the currently open project into a file 1 Choose Project Save as text from the main menu The Export project as text to dialog box will appear as shown in Figure 146 Export project as text to Savein mymodel X Imports EG IE Tmp My Recent Documents G Desktop My Documents A i My Computer My Network File name Places Save as type MYL modules mvl Figure 146 The Export project as text to dialog box 2 Browse to the folder where you want to save the textual representation 3 Type the name of the file in the File name field 140 4 Click Save The textual representation of the project will be saved to the specified file The resulting file will be opened in the default text editor as shown in Figure 147 E mymodel myl Notepad TBR File Edit Format view Help package mymodel is import SysLib private hybrid class model is pragma class Model rectangle Top 0 Left 0 Heig bchart initial state _Initstate pragma state _InitsState rectangle Top 80 Lef pragma state _InitState name point x 0 0 pragma state _Initstate footnote rectangle T state Sl pragma state sl rectangle Top 70 Left 80 Hei pragma state s1l name point x 0 15 pragma state sl footnote rectangle Top d Lef transition _Tran_10158082 from _Initstate to 51 pragma transition _Tran_10158082 line
88. C Environment options General Colors Fonts V Highlight inherited and overridden elements MV mathematical form for expressions in algorithmic statements Floating point format C general precision 3 fixed C exponential digits 3 a Figure 158 The Display tab This tab contains the following elements e Highlight inherited and overridden elements This checkbox enables disables highlighting of inherited and overridden elements on behavior charts and structure diagrams e Mathematical form for expressions in algorithmic statements This checkbox determines whether the Mathematical style option of the Text Editor window is on or off by default see Section 3 4 12 2 e Floating point format This group of options and fields defines the format used to display floating point numbers everywhere in the integrated modeling environment The general fixed and exponential options select the general fixed and exponential floating point formats respectively The precision field specifies the maximum number of digits in the textual representation of floating point numbers The digits field specifies the number of decimal places 3 9 4 The Fonts Tab A Environment options Window font Tahoma 8 Font OK Cancel Text editor font Courier New 10 Font Help Figure 159 The Fonts tab 151 This tab contains the following elements Window font This field specifies the font u
89. Documents My Computer My Network File name mymodel exe Places Save as type Programs exe X Cancel Figure 151 The Save model as dialog box Browse to the folder where you want to save the executable model Type the name of the file in the File name field Click Save If the visual model is not created earlier the program code is generated and compiled Then the executable program EXE is created it carries a visual model other program modules that are needed for its performance as well as model configuration information This process may take some time The program will be saved in the specified path After all the message about the successful preservation of the visual model will be displayed 3 8 THE PROJECT OPTIONS DIALOG BOX The Project options dialog box allows the user to edit the properties of the currently open project To open the Project options dialog box 144 1 Click Project options on the main toolbar or Choose Project Options from the main menu The Project options dialog box will appear as shown in Figure 152 9 Project options xs General Folders Embedded model Version Equation blocks IV default initial values for variables OK disable full checking while editing separate MVL file for every global dass Figure 152 The Project options dialog box the General tab The Project options dialog box consist of the
90. Imported packages SysLib Figure 27 The Project Manager window The Project Manager window only exist when there is a project open in the integrated modeling environment If present the Project Manager window can be resized or toggled on and off To resize the Project Manager window 1 Click and drag the right edge of the Project Manager window To toggle the Project Manager window 1 Click Show Project Manager on the main toolbar or Choose View Project Manager from the main menu The tree displayed in the Project Manager window contains five top level nodes Classes Types Project constants Project procedures and functions and Imported packages each representing a group of project components Within each group components are sorted in alphabetical order 73 Using the Project Manager window the user creates modifies and deletes project components imports other projects into the currently open project and exports components of the currently open project into other projects The following subsections describe the Project Manager window functions specific to each group of project components as well as the functions common to all components 3 3 1 Classes For detailed information on classes see Section 2 2 To create a new class 1 Right click the Classes node in the Project Manager window and choose New class from the popup menu The New Class dialog box will appear as shown
91. Par1 and Par2 columns Fig 242 To add variable use your mouse to drag the desired one from the window of variables and drop it down to Variable table To remove variable right click Variable table and use the appropriate command of pop up menu For each variable you need to specify the point of measuring a specific time T or model termination event and the magnitude of the absolute error Epsilon To specify the point of measuring enter the time value into Point time of gauging column or leave it empty for model termination event 229 Math expectation of variable value Probability Q Distribution law Par1 Para HopmanbHbii 0 785398163397449 0 039269908 1698724 HopmanbHbih HopManbHbilt 0 0145 HopManbHbilt 0 06125 HopManbHbilt 0 002 Point time of gauging Epsilon model termination 2 Minimum number of tests 40 Z Bar chart Maximum number of tests 10000 I Save results Number of tests 6663 Result 2060 198313 83 2924440 9500059C ij Figure 9 Math expectation of variable value Window For the experiment in whole you need to specify the value of probability Q it defines that found value of event probability differs from its true value at no more than for Eps the minimum and maximum number of test runs The minimum number of tests is necessary for the correct working of statistical laws A series of tests starts with pressing Start button The obta
92. RAND MODEL DESIGNER Version 7 0 1 USER MANUAL 2014 MVSTUDIUM Group All rights reserved The information contained herein is proprietary to MVSTUDIUM Group and shall not be duplicated in whole or in part The technical details contained in this manual are the best that are available at the date of issue but are subject to change without notice MVSTUDIUM Group pursues the policy of continuous development This may lead to the product described in this manual being different from the product delivered after its publication Contents RAND MODEL DESIGNER 2 cceccceeeeeeeceeeeeeeeeeeaeeeceaeeecaeeceeeeeseaeeesaaaeseneeeseaeeeseeesiaeesenees Version TOT airar iiir EAE ANRE EAEE TEE E ANA E neil AENEAN EARTEN USER MANUAL prn aeaee aa aaa aanaeio aga KoA veteran deen sinide CHAPTER TINtTOduUcCHON iienaa a E E EEEN Ea 1 1 What Is Rand Model Designer 0 cccceeeeeeeeeseeeeeeeseeeeeeseeeaeeeeeeeneeeeeeeaaees 10 1 2 How Rand Model Designer WOFKkS cceceeeeeceeeeeeeeeeeeeeeeteeeaeeeseenaeeeeeenaaees 10 1 3 Document Overview sirra anaE E A E TE ER 12 CHAPTER 2 Modeling Language 0 ccccceeeseeeeeee tenes ee teneeeeetiieeeeetineeeeeetieeeeetieeeetieeeeteaa 2V Projet isi ciiieineitnt airt sian esti T icin aaa 14 2 2 CIASSOS E E E E E N ee et ee 15 PAE ESELA o e APPEN E TIE atest E A T ATTAT E S 16 2 4 Behavior CRAN rer aa A r AEA A N 16 BAA NEA AAA O AAA eet eet anand 17 24 2 Transition fetter
93. Section 6 2 unique across all components of the connector The category of a connector component has the same meaning and possible values as the category of an external variable The type of a connector component can be any available type A connector variable can be viewed as a socket that can be connected to other compatible sockets the components of a connector variable can be viewed as the pins of the socket A link between two connector variables connects the components of these variables pairwise in the order of declaration of components in the types of these variables Two connector variables may only be connected if each respective pair of their components is connectable see Section 2 7 3 For the type connector a color can be specified this color will be used for displaying all the variables of this connector type on the structure diagram if its own color is not specified for each variable An MVL example see Section 6 3 declaring a connector type type MyConnector is connector contact U double flow I double end connector 2 13 5 Signal A signal is a type applicable only to input output and internal variables of a class see Section 2 9 A variable of a signal type is able to transmit signals discrete events that can trigger behavior chart transitions see Section 2 4 2 Signals can carry additional information in their parameters Signal parameters are similar to record fields 45
94. Value lo Comments ee Group m Variable category Input C Output C Contact C Flow C Connector Figure 52 The External variable dialog box Choose the category of the new external variable in the Variable category list Type the name of the new variable in the Identifier field To specify the type of the new variable click Type The Choose type dialog box will appear Use the Choose type dialog box see Section 3 4 10 to choose the type of the variable When done click OK in the Choose type dialog box To specify the default initial value of the new variable click Value If the type of the variable is an enumeration the Choose enumerated value dialog box will appear as shown in Figure 53 Otherwise if the type of the variable is a record or connector the Component Editor window will appear as shown in Figure 54 Otherwise the Text Editor window will appear as shown in Figure 55 Choose enumerated value Figure 53 The Choose enumerated value dialog box 6 10 11 Initial value for In_1 Figure 54 Editing the default initial value of a variable in the Component Editor window Initial value for In_1 Figure 55 Editing the default initial value of a variable in the Text Editor window If the type of the variable is an enumeration choose the default initial value in the Choose enumerated value dialog box When done click OK in the Choose enume
95. a structure diagram A link is shown as a polyline consisting of horizontal and vertical segments see Figure 15 or Figure 15 Link examples A link can connect e An output variable of one local object with an input variable of another or same local object see Figure 16 or Figure 16 Output to input connection e An input variable of the class with an input variable of a local object see Figure 17 29 Figure 17 Input to input connection e An output variable of a local object with an output variable of the class see Figure 18 Figure 18 Output to output connection 30 e A contact variable of one local object with a contact variable of another or same local object or a contact variable of the class see Figure 19 or or Figure 19 Contact to contact connection 31 32 A flow variable of one local object with a flow variable of another or same local object or a flow variable of the class see Figure 20 or or Figure 20 Flow to flow connection e A connector variable of one local object with a connector variable of another or same local object or a connector variable of the class see Figure 21 or or Figure 21 Connector to connector connection A variable may not be connected to itself Every pair of variables may be connected by only one link An input variable of a local object may be connect to only one other variable An output variable of the class may also be connected to only one other var
96. able as X coordinate as Y coordinate as image index Figure 213 The Use Variable As dialog box 2 To associate the variable with the x coordinate of the sprite choose the X coordinate option To associate the variable with the y coordinate choose the Y coordinate option To associate the variable with the index of the currently displayed image choose the Image index option 3 Click OK The image or images that a sprite will display can be added to the sprite via the Animation parameters dialog box see Section 4 2 7 7 1 To add one or more images to a sprite 1 Right click the sprite and choose Parameters from the popup menu The Animation parameters dialog box will appear as shown in Figure 214 186 Animation parameters Value 4xis orientation sA b tight et ve ht down eedgond Images LN Transparency Figure 214 The Animation parameters dialog box 2 Right click anywhere in the Images list and choose Add from the popup menu The Open dialog box will appear 3 Select the image file you want to add and click Open The file will be added to the Images list 4 If necessary repeat the above two steps to add more images 5 Set the checkbox next to the image that should be displayed by default 6 Close the Animation parameters dialog box Every sprite has the associated movement area that can be toggled on and off When toggled on the movement area is displayed as a
97. acter strings without any grammatical structure Non terminal symbols are named elements that can consist of terminal and non terminal symbols as defined by production rules Non terminal symbol names are by convention enclosed in angle brackets Every production rule indicates that the non terminal symbol on the left can be produced as specified by the expression on the right EBNF expressions support the following operations e Concatenation Terminal and non terminal symbols are concatenated as they appear in the expression For example the rule lt A gt B lt C gt indicates that lt A gt is a concatenation of B and lt c gt e Choice The exclamation mark between two or more symbols or sub expressions indicates that the result can be generated by following any of the alternatives For example the rule lt A gt B C lt D gt indicates that lt A gt is either B C or lt D gt e Optional inclusion The square brackets denote a sequence that may or may not be included in the generated sequence For example the rule lt A gt B lt C gt indicates that lt A gt is either B lt C gt a concatenation of B and lt C gt or empty e Repetition The curly braces denote a sequence that may be repeated any number of times including zero For example the rule lt A gt B indicates that lt A gt is either empty or consists of one or more Bs The following is an EBNF example specifying the syntax of natural number
98. actions lt actions gt Figure 6 Transition A transition has the following properties e Name 18 e Trigger e Guard e Actions The presence of a transition on a behavior chart indicates that if the specified trigger occurs while the object is in the transition s source state the object will instantly transition to the target state and execute the specified actions but only if the specified guard is satisfied The trigger of a transition can be specified in one of the following ways e when lt condition gt the trigger occurs if and when the specified condition becomes true The condition is specified by an expression that evaluates to boolean see Section 2 15 e when lt signal variable name gt the trigger occurs if and when the specified variable receives a signal see Section 2 13 5 and Section 2 16 8 e after lt timeout gt the trigger occurs if and when the time spent in the current state exceeds the specified timeout The timeout is specified in model time units by an expression that evaluates to double see Section 2 15 A transition may have no trigger If a transition has no trigger the trigger occurs immediately after the object enters the transition s source state The guard of a transition is specified by an expression that evaluates to boolean see Section 2 15 A transition is executed if its guard evaluates to true at the time the trigger occurs If the guard does not evaluates to true at
99. alculate row from the popup menu K To evaluate all available expressions 1 Right click anywhere in the Calculator window and choose Calculate all from the popup menu ae gt To add a row 1 Right click anywhere in the Calculator window and choose Add line from the popup menu Ke To remove a row 1 Right click the row and choose Delete line from the popup menu 4 2 13 Model Time The model time consists of two intertwined components continuous time and discrete time The continuous model time represents the time elapsed since the start of the model in model time units The discrete model time represents the number of behavior chart transition executions since the start of the model The current continuous and discrete model times are displayed on the main toolbar of the visual executable model see Section 4 2 The visual executable model can run either as fast as possible or at a certain ratio between the continuous model time and the real time This is configured on the Run tab of the Model settings dialog box see Section 4 2 15 1 1 Running the model as fast as possible allows to simulate the model at the highest possible speed whereas running the model at a fixed model 202 time to real time ratio allows to animate the model smoothly By default every newly created model is configured to run as fast as possible 4 2 14 The Breakpoint conditions Dialog Box The Breakpoint conditions dialog box all
100. and time to fields respectively 4 Click Export The resulting file will be opened in the default text editor as shown in Figure 190 170 The Diagram window can be customized using the Diagram parameters dialog box 4 2 4 1 The Diagram parameters Dialog Box diagram txt Notepad File Edit Format view Help model x model y 5 1999 3996 5986 7966 9933 1885 3818 5728 7614 9471 1297 3089 4844 6559 5 5 5 5 5 6 6 6 6 6 z Fs y Figure 190 Export result 0 10 10 10 10 10 10 10 10 10 10 10 10 10 10 8 To open the Diagram parameters dialog box 1 Double click anywhere in the Diagram window or O 0 0 v 3 Q I 94004 88029 82097 0 7623 0 O 0 0 O O 0 0 O 0 70448 64773 59224 53822 48586 43536 38688 34062 29672 25536 Right click anywhere in the Diagram window and choose Parameters from the popup menu The Diagram parameters dialog box will appear as shown in Figure 191 171 Diagram parameters double double IV legend V fixed Y bounds V auto scaling IV time scroller max grid Color fill N vert lines Color 1 Color 2 I horiz dots Piot points Panels co Caption vas oS OK Cancel Figure 191 The Diagram parameters dialog box step min At the top of the Diagram parameters dialog box there is a list di
101. ar as shown in Figure 58 Otherwise if the type of the constant is a record 92 a 8 9 the Component Editor window will appear as shown in Figure 59 Otherwise the Text Editor window will appear as shown in Figure 60 Choose enumerated value M Mathematical editing Figure 59 Editing the value of a constant in the Component Editor window i Initial value for Const_1 Figure 60 Editing the value of a constant in the Text Editor window If the type of the constant is an enumeration choose the value of the constant in the Choose enumerated value dialog box When done click OK in the Choose enumerated value dialog box If the type of the constant is a record use the Component Editor window see Section 3 4 17 to specify the value of the constant When done click Apply in the Component Editor window If the type of the constant is any other type use the Text Editor window see Section 3 4 12 to specify the expression for the value of the constant When done click OK in the Text Editor window If necessary type the comments for the constant in the Comments field If you want to assign the new constant to one or more groups click LJ The Groups dialog box will appear Use the Groups dialog box see Section 3 4 11 to assign the constant to one or more groups When done click Apply in the Groups dialog box 10 Click OK in the Constant dialog box 93 To modify a constant using the
102. arency specifies the object transparency must be between 0 fully opaque and 1 fully transparent 8 9 Beam This object has the following properties 4 2 Type reflects the type of the object read only cannot be associated with a variable Name specifies the name of the object cannot be associated with a variable Visible determines whether the object is visible Color specifies the color XYZs specifies the starting polygon of the beam as a three column matrix whose rows represent the points x y and z coordinates of the polygon dX dY dZ specifies the x y and z offset of the ending polygon Closed specifies whether the beam ends are capped Transparency specifies the object transparency must be between 0 fully opaque and 1 fully transparent 8 10 Quadrangle This object has the following properties 4 2 Type reflects the type of the object read only cannot be associated with a variable Name specifies the name of the object cannot be associated with a variable Visible determines whether the object is visible Color specifies the color x1 y1 21 x2 y2 22 x3 y3 z3 x4 y4 z4 specify the coordinates of the four points of the quadrangle Transparency specifies the object transparency must be between 0 fully opaque and 1 fully transparent 8 11 Arrow This object has the following properties 196 Type reflects the
103. ariable graphically amp Bar chart See Figure 194 The Histogram window A typical Histogram window is shown in Figure 194 The Histogram window displays a vector as a sequence of bars or other objects see below so that each object represents an individual vector element while the size and or position of the object represents the value of the corresponding element One Histogram window can display the contents of one vector The user can open as many Histogram windows as necessary To open a new Histogram window 1 Click New histogram ills on the main toolbar or Choose Window New histogram from the main menu A new Histogram window will appear as shown in Figure 195 The window now needs to be associated with a vector variable Bar chart TIBI Figure 195 New Histogram window To associate a Histogram window with a vector variable 1 Drag the variable from a Variables or Structure window and drop it onto the Histogram window The Histogram window will start displaying the name and the contents of the associated variable 175 The Histogram window supports the following view modes e Vertical bars see Figure 196 e Horizontal bars see Figure 197 e Points see Figure 198 e Line see Figure 199 e Pie see Figure 200 E Bar chart ee Figure 198 Points 176 E Bar chart TES Figure 200 Pie To change the view mode 1 Right click anywhere in th
104. at belong to local objects or object container Such connection with a link defines the relation of equivalence between these variables For external variables with the stereotype of the flow the link specifies the the sum of flows is zero relation For better visibility of the structure diagram a color can be assigned to the link Link color will be changed automatically if the link connects external variables whose colors differ from the default color if these colors are not the same the link color will be chosen from them in an arbitrary way To create a new link 1 Select an external variable and click Add link on the structure diagram editor toolbar or Right click an external variable and choose Add new link from the popup menu The structure diagram editor will start displaying a dashed polyline between the selected variable and mouse cursor see Figure 135 Figure 135 Creating a new link 2 Click another external variable A new link will appear connecting the two variables as shown in Figure 136 The new link will have the minimum required number of intermediate points If you want the link to have more intermediate points click the locations where the intermediate points should be created before clicking the second variable Figure 136 New link 134 3 If you want to cancel the operation click gt or hit Esc before you click the second variable To modify a link 1 Click on a segment of the link 2
105. ax Allows to specify the maximum value displayed by the indicator Style Allows to convert the indicator to a component of any other type Vertical Toggles between vertical and horizontal orientation Value Shows hides the box displaying the associated variable value Color Allows to specify the indicator color Value format Allows to specify the floating point number display format Show scale Shows hides the scale labels Auto scaling Toggles automatic scaling Position Allows to specify the position and size of the component The position is relative to the upper left corner of the 2D Animation window 4 2 7 5 Slider This component provides the following context menu items Min Allows to specify the minimum value displayed by the slider Max Allows to specify the maximum value displayed by the slider Style Allows to convert the slider to a component of any other type Vertical Toggles between vertical and horizontal orientation Value Shows hides the box displaying the associated variable value Value format Allows to specify the floating point number display format Show scale Shows hides the scale labels Auto scaling Toggles automatic scaling Position Allows to specify the position and size of the component The position is relative to the upper left corner of the 2D Animation window 4 2 7 6 Color Indicator This component provides the following context me
106. ble e byte short e integer e boolean e char e string e user defined enumerations 2 13 1 1 double The double type represents a double precision 64 bit floating point number with values ranging from 4 9E 324 to 1 7E 308 The double type and associated operations generally adhere to the IEEE Standard for Binary Floating Point Arithmetic ANSI IEEE Std 754 1985 The double type is used to approximately represent real numbers The operations defined for the double type are see also Section 2 15 1 e addition subtraction e x multiplication e division e xx raising a number to the power of another number equality relation e inequality relation e gt greater than relation e gt greater than or equal to relation e lt less than relation e lt less than or equal to relation Literals of the double type have the following syntax here and later in this document the Extended Backus Naur Form is employed to describe the syntax of certain language constructs see Section 6 1 39 lt double_literal gt lt sign gt lt significand gt lt exponent gt lt sign gt lt significand gt lt digits gt lt digits gt lt digits gt lt digit gt lt digit gt lt digit gt s 2 0222 Sar oro EBE lt exponent gt lt exponent_symbol gt lt sign gt lt digits gt lt exp
107. bles x y z 1 x y 0 Anyways if the result of the automatic selection of the unknown variables is not suitable the situation can be corrected by an explicit assignment of the unknown and or known variables The number of free variables cannot be less than the number of unknown variables that Rand Model Designer needs to select If the number of free variable is less than the required number of unknown variables it indicates that the system of equations is overdetermined An overdetermined system of equations is either redundant or non resolvable Rand Model Designer therefore disallows overdetermined systems of equations An example of an overdetermined system of equations x y 1 x y 0 x 2 y 0 25 Another example dx x 1 dt dx xe l1 dt The system of equations of a class has the following effect on the model during the model execution the system of equations of each instance of the class is automatically solved as part of the aggregate system of equations see Section 2 6 thereby realizing the behavior of each instance The system of equations of each instance is solved starting from whatever the initial variable values are in that instance If the system of equations of a class includes second order differential equations it must also specify the initial values of the first derivatives of the corresponding variables The initial value of the first derivative of a variable can be specified using the following syn
108. can either select the required number of unknown variables using the L and buttons and when done click OK or click Cancel at any time If you select the required number of unknown variables and click OK the resulting system of equations will appear in the equation system editor as shown in Figure 87 Otherwise if you click Cancel the resulting system of equations will also appear in the equation system editor but in that case the selection of unknown variables will be deferred to the stage of processing the aggregate system of equations Q Continuous behavior x y x 2 phit theta phittheta 1 thetat y 2 0 2 2 Unknown variables phi theta x 2 Initial values for derivatives 2z 0 Equations Figure 87 Resulting system of equations example 2 7 In any case after you get back to the equation system editor the selected unknown variables if any will appear under the Unknown variables node Additionally if the set of equations includes second order differential equations the Initial values of derivatives node will appear in the equation system editor with sub nodes representing the initial values of the corresponding first derivatives 110 To override inherited equations 1 Open the class editor for a class that inherits the system of equations from another class Activate the equation system editor which will look as shown in Figure 88 Q Continuous behavior
109. ck may reference any other elements defined in that block Thus for example the expression specifying the initial value of a variable of a class may use any functions defined in that class 68 CHAPTER 3 Integrated Modeling Environment This chapter describes the Rand Model Designer integrated modeling environment 3 1 MAIN WINDOW When the user starts the integrated modeling environment the integrated modeling environment s main window appears as shown in see Figure 22 Rand Model Designer 6 unregistered C My Documents model model myb Project Edit Tools View Model Window Help tenp S292 Marnu B z mad Classes Model description lol x E Class_1 id Model o f A Ba E Class_2 Parameters ial Model Variables E Types Gi Constants E Project constants Functions and procedures Class_1_1 Class_2 1 Project procedures ar Comments Imported packages E imal Local classes B Systib Th Hybrid Continuous Local objects Class Class_1 J L lol x ia Class_1 Continuous behavior Parameters lt gt External variables amp x double 1 State variables y double 0 G Constants A Functions and procedures Comments eye ya Unknown variables x Class Class_2 Parameters lt gt External variables gt In_1 double 0 gt In_2 double 0 lt 1 Out_3 double 0 State variables 7
110. color selection dialog can be used as well as the regular dialog for setting the initial value 2 13 1 3 boolean The boolean type represents a logical quantity with two possible values true and false The operations defined for the boolean type are see also Section 2 15 1 e or logical or e and logical and e not logical not e equality relation e inequality relation The syntax of boolean literals lt boolean_literal gt false true 2 13 1 4 char The char type represents a single text character The operations defined for the char type see also Section 2 15 1 e equality relation e inequality relation char literals are single characters enclosed in double quotes for example wan my man 2 13 1 5 string The string type represents a variable length string of characters The operations defined for the string type see also Section 2 15 1 41 e concatenation e equality relation e inequality relation string literals are character strings enclosed in double quotes for example AbCD 1234 a1B7 2 13 1 6 Enumerations An enumeration is a type whose set of values an ordered sequence of literals is specified by the user Every literal of an enumeration is an identifier see Section 6 2 unique across all literals of the enumeration An example of a sequence of literals specifying an enumeration North East South
111. considering the equation blocks is switched off 26 2 6 AGGREGATE SYSTEM OF EQUATIONS An aggregate system of equations is a join of the systems of equations of all object instances existing in the executable model at a particular time moment When executing a model Rand Model Designer solves the aggregate system of equations numerically thereby realizing the continuous behavior of the model Depending on the model the aggregate system of equations may remain constant or may change during the model execution The aggregate system of equations changes every time some continuous object appears in or disappears from the model A continuous object may appear in or disappear from the model as a result of transition of some hybrid object from one state to another see Section 2 4 This mechanism allows models to exhibit hybrid behavior The selection of unknown variables for which the aggregate system of equations is to be solved is performed by Rand Model Designer at the model start and every time the aggregate system of equations changes Variables selected as known and unknown in the systems of equations of classes become known and unknown respectively in the aggregate system of equations If the resulting number of unknown variables turns out to be equal to the number of equations in the aggregate system the aggregate system is considered formally resolvable and is solved in its existing form If the number of unknown variables turns out to
112. ct from a 3D Animation window 1 Open the 3D animation parameters dialog box 2 Activate the 3D objects tab 3 Select the object in the object list 4 Click Delete on the 3D objects tab toolbar To modify the current value of an object property 1 Open the 3D animation parameters dialog box 2 Activate the 3D objects tab 3 Select the object in the object list 4 Click the Value field of the property in the property panel An in place editing field will appear 5 Type the new value 6 Hit Enter or click anywhere outside the editing field To associate a variable with an object property 1 Open the 3D animation parameters dialog box 2 Activate the 3D objects tab 192 3 4 Select the object in the object list Drag the variable from a Variables or Structure window and drop it onto the Variable field of the property in the property panel To configure the color of an object 1 2 3 4 5 Open the 3D animation parameters dialog box Activate the 3D objects tab Select the object in the object list Click the Value field of the Color property in the property panel If there is no variable associated with the Color property the standard Color dialog box will appear In the Color dialog box choose the desired color and click OK If there is a variable associated with the Color property the Color change dialog box will appear as shown in Figure 219 In the Color change dialog box spec
113. cts tab see Figure 218 consists of the toolbar object list and property panel The toolbar provides the following buttons adds a line segment adds a sphere Y addsa cylinder A adds a cone adds a torus _ adds a spring 191 e 2 adds a beam adds a quadrangle c AL adds an arrow e Z adds a surface e _ adds a two dimensional text label e X deletes the currently selected object The object list displays all added objects and allows the user to select any one of them The property panel provides access to the properties of the currently selected object The property panel has the following columns e Parameter This column displays the name of each property e Value This column displays and allows the user to modify the current value of each property The current value may be either specified by the user or automatically set by the model to the current value of the associated variable if any e Variable This column specifies the name of the variable associated with each property The user can either enter variable names manually or drag variables from other windows and drop them onto fields in this column 4 2 8 2 Using the 3D Animation Window To add an object to a 3D Animation window 1 Open the 3D animation parameters dialog box 2 Activate the 3D objects tab 3 Click an appropriate button on the 3D objects tab toolbar To remove an obje
114. d Fun _ 1 Help Figure 62 Editing a function or procedure in the Text Editor window 2 Use the Text Editor window see Section 3 4 12 to edit the code of the function or procedure 3 Click OK 94 To modify a function or procedure 1 Double click the function or procedure in the class editor tree or Right click the function or procedure in the class editor tree and choose Edit from the popup menu The Text Editor window will appear as shown in Figure 62 2 Use the Text Editor window see Section 3 4 12 to edit the code of the function or procedure 3 Click OK 3 4 7 Local Classes If a class is hybrid its class editor tree contains the Local classes node that represents the local classes of the class The Local classes node if present consists of two sub nodes Hybrid and Continuous representing the hybrid and continuous local classes respectively For more on local classes see Section 2 11 To create a new hybrid local class 1 Right click the Hybrid node in the class editor tree and choose New local hybrid class from the popup menu A new local class will be added to the Hybrid node To create a new continuous local class 1 Right click the Continuous node in the class editor tree and choose New local continuous class from the popup menu A new local class will be added to the Continuous node To open the class editor for a local class 1 Double click the local clas
115. d of the variable The standard Color dialog box will appear as shown in Figure 192 Basic colors i Gel See SER eee ERE EER eS ER BEEBE EE Bee ee ee et mi m Custom colors Define Custom Colors gt gt Figure 192 The Color dialog box 2 Select the desired color and click OK To select or deselect the x axis variable 1 Double click the X field of the variable you want to select or deselect Besides the list of variables the Diagram parameters dialog box contains the following elements legend This checkbox shows hides the legend at the top of the Diagram window fixed Y bounds This checkbox enables disables sharing of the y axis by all plots auto scaling This checkbox enables disables automatic scaling for the y axis in the time diagram mode and for both axes in the phase diagram mode time scroller This checkbox enables disables scrolling along the x axis in the time diagram mode 3D This checkbox enables disables 3D display of empty areas around the chart smooth lines This checkbox enables disables line smoothing grid This group of checkboxes and options configures the grid The vert checkbox shows hides vertical grid lines The horiz checkbox shows hides horizontal grid lines The lines option selects solid grid lines The dots option selects dashed grid lines The points option selects dotted grid lines Jump line style This group of options specifies
116. d state The function returns rcTimeOut if the timeout expires or rcOK otherwise function RunUntilStop TimeOut integer TRetCode Runs the default mode instance until all discrete actions of the model are completed or the specified timeout expires whatever happens first A call to this function is equivalent to runUntilStopEx 0 TimeOut function RunThreadUntil C pChar TRetCode Runs the default mode instance in a separate thread until the specified conditional expression evaluates to true Creates a separate thread that calls RunUntil C and returns immediately The caller can detect the moment when the model stops by calling the Stopped function periodically or handling the message configured using the SetEndMessage function e function Restart TRetCode Restarts the default model instance that is resets the model time to 0 and brings all model objects to their initial states The function stops the model if it is currently running e function Stop TimeOut integer TRetCode Stops the default model instance at the nearest possible model time moment The TimeOut parameter specifies the wait timeout in milliseconds e function Stopped TRetCode Returns rcoOk if the model is in the stopped state or rcModelIsNotAtBreakpoint otherwise All functions except for Stop Stopped and Restart may only be called when the target model instance is in the stopped state 4 4 5 Variable Management Functions
117. d the initial velocity the values are measured at the end of model run Figure 239b shows the settings for obtaining dependencies of final consumption and production volume at the 10th year on the resource demanding coefficient the minimum of consumption the fond coefficient and the coefficient of disposal Parametric dependence x H Tetao x H Rho x H Cx x H vo Parameter Initial value Final value Step 0 2 1 3 0 1 Rho 0 8 1 8 0 1 Cx 0 2 0 4 vo 100 300 10 Point time of gauging model termination model termination 225 Parametric dependence b Figure 6 Tab Settings of Parametric dependence window Clicking Start button leads to carrying out the series of model runs Obtained dependences are displayed on the relevant pages of Parametric dependence window Fig 240 226 Parametric dependence jj x H Rho x H Cx x H vo Figure 7 Dependence of the range and maximum height of the missile s trajectory on the initial angle of the throw 4 3 2 Calculation of event probability To calculate the probability of one or a few events click Simulation gt Typical computing experiment gt Event probability On the page Settings see Figure 241 you need to specify the list of random parameters and the list of conditions that determine events It is considered that event occurred if the corresponding condition is satisfied at specified time or by
118. der of the source state and ending at the mouse cursor see Figure 108 Figure 108 Creating a new transition 2 Click the target state A new transition will appear as shown in Figure 109 The new transition will go straight from the source state to the target state and will have one intermediate point If you want the transition to be a more complex curve and or have more intermediate points click the locations where the intermediate points should be created before clicking the target state gt i Figure 109 New transition 3 If you want to cancel the operation click gt before you Click the target state 120 To rename a transition 1 Right click the transition and choose Rename from the popup menu To modify the source state of a transition 1 Right click the transition and choose a new source state from the Substitute transition starting state for submenu of the popup menu To modify the target state of a transition 1 Right click the transition and choose a new target state from the Substitute transition ending state for submenu of the popup menu The user can modify the curve of a transition by adding and removing intermediate points or moving intermediate points To add an intermediate point to a transition 1 Select the transition and click Add control point to transition i on the behavior chart editor toolbar 2 Move the mouse cursor over the transition and click where you want to add an
119. e e function GetVarValue hVar TVarHandle var Y variant TRetCode Retrieves the current value of the specified variable of the default model instance A call to this function is equivalent to get VarValueEx 0 hVar Y e function getVarDoubleValueEx hModel TModelHandle hVar TVarHandle var Y double TRetCode Retrieves the current value of the specified double variable The hModel parameter identifies the model instance The hvar parameter identifies the variable The y parameter receives the current value of the specified variable e function GetVarDoubleValue hVar TVarHandle var Y double TRetCode Retrieves the current value of the specified double variable of the default model instance A call to this function is equivalent to get VarDoubleValueEx 0 hVar Y e function getVarVectorValueEx hModel TModelHandle hVar TVarHandle var N integer var Y TArrayDouble TRetCode Retrieves the current value of the specified variable of type vector N The hModel parameter identifies the model instance The hVar parameter identifies the variable The N parameter specifies the vector size The y parameter receives the current value of the specified variable 237 function GetVarVectorValue hVar TVarHandle var N integer var Y TArrayDouble TRetCode Retrieves the current value of the specified variable of type vector N in the default model instance A call to this function is equivalent to getVarVectorValueEx
120. e Groups Dialog BOX cccecceeeeeeeeeeeeeneeeeteeneeeeeeeeeeeeeeaaees 104 DAT VOXUECNON era rack inte EA euaeetage 105 3 4 13 Equation System Editor cc ceccceceeeeeeeeeeeeeeeeeeneeeeeeeeeeeeeeeeeaees 107 3 4 14 Behavior Chart Editor ec eeceeeeeeeeeeeeeeeeeeeeeeeeeeseeeeeeeeeeeaees 113 3 4 15 Structure Diagram Editor eccceeeeeeeeeeeeeeeeeeeeeeeeeeneeeeeeeenaees 125 3 4 16 The Model Class Extra Features 00 cc ccceeeeeeseeeeeeeseeneeeeeeenaeees 135 3 4 17 Component EGitor cccccceceeeeeeecceccececeeeeeseeeaeeeeeeeeeseesenieeaeeeeees 137 3D GalCUlatOns ssi she set tad esas traces R fel betecerid eceatsl TTA acento 138 3 6 Textual Project Representation cc ccccceceeeeseeeeeeeneeeeeseieeeeesieeeeertneeeens 140 3 7 Working with Executable Models ccccecscuececeseteeeeeseneeeeetieeeeeetneeeeres 142 3 8 The Project options Dialog BOX 0 cccccecetereeeeeeeeeeseneeeeesteeeeeetneeeeees 144 3 6 1 The General TaD eere AEE EE E 145 3 8 2 The Folders Tabrn denii aeaa a a a a aaa 146 3 8 3 The Embedded model Tab eecccceceeceeeseeeeeeeseeeeeeeeeeneeeeennaeees 147 3 0 4 The Version TaD an aa et arcane bide saad aad 148 3 8 5 The Equation blocks Tab 2 cccecccceeeeeeeeeeneeceeeeeeeteeeeneneeeeeeees 148 3 9 The Environment options Dialog BOX cecccececeeeeeeeeeeeeeteneeeeetnaeeeeees 149 3 9 1 The General Tab west picts saved i
121. e CPulseGen rat fund nini niaaa a 5 3 5 CStepsGenerator cc ccccceeccecccececeeeceeeeeaeeeceeeeeseseneaeeeeeeeeeeeseenaees 254 Class name CSteEPSGENeLrat OF on cecececceseccececeeeeeeeeeaececeeeeeeceescaaeceeeeeeseeqanaeeeeeeeseesnnaneeeeeeess 513 6 CloCK tet cezdeetaal ccs a e e E aeedv ee tiviaeh fe 254 Class tane CCT OG i airo eA R AAEE dundee EAEE AEA ORT CHAPTER CAppendices Hrann eater ghee i 6 1 Extended Backus Naur Form ccccccceceeeeceeeeseeeeeeeseeneeeeseeeaeeeseeeaneeseenaees 256 62 ldentih or e T A r a ede Gaede hen ee 256 6 3 The MYL LanQuage eroria E AE AA RE 257 CHAPTER 1 Introduction Introduction to Rand Model Designer and this document 1 1 WHAT IS RAND MODEL DESIGNER Rand Model Designer is a simulation modeling tool that allows the user to create and experiment with models of complex dynamic systems The Rand Model Designer s key features are e Object oriented modeling language e Intuitive and easy to use integrated modeling environment e Ability to create continuous discrete and hybrid continuous discrete simulation models e Use of differential and algebraic equations to model continuous behavior e Use of behavior charts simplified statecharts to model discrete behavior e Model correctness verification throughout the model creation process e Automatic generation of the executable model from the model description created by the user e Interactive and automated experime
122. e lt state_name gt lt state_stereotype gt initial final switch switch probabilistic lt transition_definition gt lt triggerful_transition_definition gt lt triggerless_transition_definition gt 261 lt triggerful_transition_definition gt inner transition lt transition_name gt from lt state_name gt to lt state_name gt lt trigger_definition gt lt guard gt lt actions_definition gt lt transition_name gt lt identifier gt lt trigger_definition gt when lt conditional_expression gt when lt signal_name gt after lt double_expression gt lt signal_name gt lt identifier gt lt guard gt guard lt conditional_expression gt lt triggerless_transition_definition gt transition lt transition_name gt from lt state_name gt to lt state_name gt lt fire_condition gt lt actions_definition gt lt fire_condition gt lt expression gt else lt global_constant_definition gt lt visibility gt lt constant_definition gt lt global_function_or_procedure_definition gt lt visibility gt lt function_or_procedure_definition gt lt declared_type gt lt visibility gt type lt type_name gt is lt type_definition gt lt type_name gt lt identifier gt lt type_definition gt lt distinct_type_definition gt lt regular_type_definition gt lt enumerated_type_de
123. e Actual values dialog box 3 4 17 Component Editor The Component Editor window allows the user to edit record or connector component values Initial value for V_1 7 Mathematical editing Close Figure 141 The Component Editor window The Component Editor window looks as shown in Figure 141 The window displays components in a table one row per component Component names are displayed in the first column Their respective values are displayed in the second column 137 Every value can be edited either in place or using the Text Editor window see Section 3 4 12 This is controlled by the Mathematical editing checkbox Modified values are labeled with the sign as shown in Figure 142 Initial value for V_1 Mathematical editing Apply Figure 142 The Component Editor window showing a modified value The Apply button applies the current changes and closes the window The Close button closes the window without applying the current changes To edit a value in place 1 Make sure Mathematical editing is unchecked 2 Double click the row you want to modify An in pace editing field will appear 3 Edit the value 4 Hit Enter or click anywhere outside the editing field To edit a value in the Text Editor window 1 Make sure Mathematical editing is checked 2 Double click the row you want to modify The Text Editor window will appear 3 Use the Text Editor window to edit the
124. e Chapter 4 To run the visual executable model 1 Click Run model P on the main toolbar or Choose Model Run from the main menu or press lt F9 gt If the visual model was created earlier the main window of visual model will appear if not the program code will be generated and compiled If the compilation is successful the main window of visual model is opened if not window appears with an error message To terminate the visual executable model 1 Click Stop model l one the main toolbar or Choose Model Stop from the main menu or press lt Ctrl F2 gt The visual executable model will disappear To build the standalone executable model available in Rand Model Designer Corporate and Rand Model Designer Educational 1 Click Build model m on the main toolbar or Choose Model Build from the main menu or press lt Ctrl F9 gt If the compilation is successful you see the Successful compilation Ouwn6ka AcTouHnk CCbINKN He Hangen if not window appears with an error message 2 Click OK To save the standalone executable model with a specific name and location available in Rand Model Designer Corporate and Rand Model Designer Educational 1 Choose Model Save as from the main menu The Save model as dialog box will appear as shown in Figure 151 143 4 Save model as Saen Omma S y enam gt IE Imports EG IC Tmp My Recent Documents G Desktop CI My
125. e Histogram window and choose the desired mode from the Diagram style submenu of the popup menu All other properties of the Histogram window can also be configured via its context menu The properties include the title displayed at the top of the window 3D display flag colors used to draw the diagram background filling x axis labels and minimum value for the y axis To modify the title of a Histogram window 1 Right click anywhere in the Histogram window and choose Caption from the popup menu The Caption dialog box will appear as shown in Figure 201 Caption Figure 201 The Caption dialog box 2 Type the new title 3 Click OK 177 To toggle 3D display 1 Right click anywhere in the Histogram window and choose 3D from the popup menu To modify the color of objects bars pie slices points or lines displayed in a Histogram window 1 Right click anywhere in the Histogram window and choose Diagram colors Items color from the popup menu The standard Color dialog box will appear as shown in Figure 202 Basic colors Ei Ge eee ress fee f f roe Gg EE ee E n EE BSS ee Fee f ie 1E Custom colors Define Custom Colors gt gt Cancel Figure 202 The Color dialog box 2 Select the desired color and click OK To modify the title color 1 Right click anywhere in the Histogram window and choose Diagram colors Caption color from the popup men
126. e box will be displayed 2 Click Yes To edit the actual parameter values and initial variable values of the model object 1 Click Actual model parameters on the main toolbar or Choose Model Actual model parameters from the main menu or Right click anywhere in the class editor tree of the Model class and choose Actual model parameters from the popup menu The Actual values dialog box will appear as shown in Figure 139 136 Actual values model pl 0 p2 0 Initial values for variables n 0 outl 0 out2 0 Figure 139 The Actual values dialog box 2 To modify the actual value of a parameter or the initial value of a variable double click the corresponding item in the Actual values dialog box or right click the corresponding item in the Actual values dialog box and choose New value from the popup menu A value editing dialog box as shown in Figure 140 will appear Type of expression is Double Apply Figure 140 Value editing dialog box 3 Type the expression for the actual parameter value or initial variable value When done click Apply The Actual values dialog box will display the modified parameter or variable with the sign 4 Torestore the actual value of a parameter or the initial value of a variable to the default value right click the corresponding item in the Actual values dialog box and choose Restore default value from the popup menu 5 Finally click Apply in th
127. e in the File name field 4 Click Save The sections that follow describe the objects supported by the 3D Animation window 4 2 8 3 Line Segment This object has the following properties e Type reflects the type of the object read only cannot be associated with a variable e Name specifies the name of the object cannot be associated with a variable e Visible determines whether the object is visible e Color specifies the color e x1 y1 z1 specify the coordinates of the starting point e x2 y2 z2 specify the coordinates of the ending point e Width specifies the line width in pixels 4 2 8 4 Sphere This object has the following properties e Type reflects the type of the object read only cannot be associated with a variable e Name specifies the name of the object cannot be associated with a variable e Visible determines whether the object is visible e Color specifies the color e x1 y1 z1 specify the coordinates of the center of the sphere e Radius specifies the radius of the sphere e Slices specifies the number of segments used to model the sphere e Transparency specifies the object transparency must be between 0 fully opaque and 1 fully transparent 4 2 8 5 Cylinder This object has the following properties e Type reflects the type of the object read only cannot be associated with a variable e Name specifies the name of the object
128. e_definition gt lt function_or_procedure_specification gt is lt local_variable_definition gt lt function_or_procedure_body gt lt function_or_procedure_specification gt lt procedure_specification gt lt function_specification gt lt procedure_specification gt procedure lt procedure_name gt lt formal_parameters gt lt procedure_name gt lt identifier gt lt function_specification gt function lt function_name gt lt formal_parameters gt return lt result_type gt lt function_name gt lt identifier gt lt formal_parameters gt lt parameter_specification gt lt parameter_specification gt lt parameter_specification gt lt parameter_category gt lt parameter_name gt lt parameter_name gt lt parameter_type gt lt parameter_category gt in out in out lt parameter_name gt lt identifier gt lt parameter_type gt lt type gt lt result_type gt lt type gt lt local_variable_definition gt lt variable_name gt lt variable_name gt lt variable_type gt lt expression gt lt variable_ name gt lt identifier gt lt function_or_procedure_body gt begin lt operator_sequence gt end lt function_or_procedure_name gt lt function_or_procedure_name gt lt function_name gt lt procedure_name gt lt operator_sequence gt lt operator gt lt comments gt
129. ect Copy Ctrl C or press the appropriate button on the toolbar of structure editor To paste objects from the clipboard 1 Open the structure editor of the desired class and click on Insert on the toolbar or use the command Insert Ctrl V of pop up menu To open the class editor window for the class of a local object 1 Double click the local object 3 4 15 3 Class Boundary The class boundary see Section 2 7 2 represents the interface of the class and cannot be created or deleted Instead it appears and disappears automatically depending on whether the class is open or isolated However the class boundary can be resized To resize the class boundary 1 Select the class boundary 2 Drag any border of the boundary in the desired direction 3 4 15 4 External Variables External variables shown on a structure diagram can belong to either the class or local objects External variables of the class are displayed on the class boundary and can be created deleted modified and moved around the boundary External variables of local objects represent external variables defined in respective classes and cannot be moved created modified or deleted when editing the structure diagram of the containing class For more on external variables see Section 2 9 To create a new external variable 1 Select the class boundary 132 2 Click Add input al Add output 2 Add contact if Add flow i or Add connector
130. ect or imported into that project from other projects e Class The elements visible in a class are the parameters variables constants functions procedures local classes and local objects defined in that class e Function or procedure The elements visible in a function or procedure are the formal parameters and local variables of that function or procedure e The for loop The element visible in a for loop is the loop variable A block can enclose other blocks For example if a project contains a class it means that the corresponding project block encloses the corresponding class block Using the notion of a block the visibility rules can be defined as follows Suppose there is an element E1 with the name N defined in some block B1 E1 is visible in its defining block B1 and usually all enclosed blocks However if some enclosed block B2 defines another element 2 with the same name N E2 hides E1 in B2 that is makes N refer to E2 but not E1 in B2 and its enclosed blocks For example suppose there is a project that defines a constant x of type string and a class C which in its turn defines a variable x of type double Within the entire project x will refer to the constant of the project except for the class c where x will refer to the variable of the class 67 Unlike the majority of programming languages Rand Model Designer block elements are not ordered This means that a definition of an element within a blo
131. ecution Operator ecee eee eeeeee cece eeeeeeeeeeeeeeeeeeeeteees 67 2 17 Visibility RUES 3 nastier ities Anite adie ati ete aii x 67 CHAPTER 3 Integrated Modeling Environment 0 ccccccceeeeeeeeeeeeeeeecieeeeeeenaeeeseeneeeseaes Si 1 Mair WARD OW srs d sce a ead vacdesa aetna eaten ete ee cain 70 3 2 Working With Projects aiinsir eer ie A A EE EAA 70 3 3 Project Manage eriei i aA E EA 73 3 3 Classes mian a E a R 74 3 3 2 Declared Type S narnia ora A A R RTRA 75 3 33 CONSAN e a AA EEA EA TT 3 3 4 Global variables iaa ar E n A AA E AE 79 3 3 5 User Defined Functions and Procedures ccccceceseeeeeenteeeeenaes 80 3 3 6 Deleting Project Component 0 ceeeceeeeeeeeeenneeeeeecaeeeeeeneeeeeeeaas 80 CHAPTER 4 Executable Model 3 3 7 Importing Project Component ceceeeeeeeeeeeeteeeeettieeeeeeneeeeeees 80 3 4 Class Editor eoe TE A ae oe 81 3 4 1 Class Editor Tree sainia airite ienai ai A aie N 82 3 4 2 S percla SSi aaaeeeaa aerian aaae aSa aii dur aai Eaa 84 SAS Parameters i tices EAE EEEE E TEREE 85 34 4 Varlables aean ai a iea a e ted 88 340 CONStamt i cca vars a A E AT eia 92 3 4 6 Functions and Procedures ssessssesssreeessrresernresrnrnestennesrnnnesnnnnnennn 94 3AT Local Classe Seieriga AAE ATEA EAR 95 34 8 Local Objects nencai nie a A R a eee 95 SAY COMMENTS aan a n a E EAR 96 3 4 10 The Choose type Dialog BOX esesssssrissesreseerrssrrrnesrerrssrernsssees 97 3 4 11 Th
132. ed as either concrete the default or abstract Abstract classes differ from concrete classes in that creation of instances of abstract classes is not allowed whereas creation of instances of concrete classes is allowed Abstract classes can only be used as base classes A class that inherits from an abstract class can in its turn be either concrete or abstract 2 3 STEREOTYPE The stereotype of a class determines the behavior type the structure type the component type of the class and the ability to use the class in other projects The stereotype is a combination of the following characteristics e Behavior type e Structure type e Component type e Visibility The behavior type indicates that the class has either continuous behavior hybrid behavior or no behavior A class that has continuous behavior is called a continuous class The behavior of a continuous class is specified by the system of equations see Section 2 5 A class that has hybrid behavior is called a hybrid class The behavior of a hybrid class is specified by the behavior chart see Section 2 4 The structure type indicates that the class is either elementary or compound An elementary class does not have internal structure A compound class does have the internal structure The internal structure of a compound class is specified by the structure diagram see Section 2 7 The component type indicates that the class is either isolated or open An isolated class doe
133. ed by the user To delete a class element 1 Right click the element in the class editor tree and choose Delete from the popup menu A confirmation message box will be displayed 2 Click Yes 3 4 9 2 Modifying Class Stereotype Under certain conditions the class editor window allows the user to alter the stereotype of the class The following stereotype conversions are supported e Acontinuous class can be converted to an equivalent hybrid class e A hybrid class whose behavior chart consists of only one continuous activity state can be converted to an equivalent continuous class e Anelementary class can be converted to an equivalent compound class without local objects and links and vice versa e Anisolated class can be converted to an equivalent open class without external variables and vice versa To modify the class stereotype 1 Right click anywhere in the class editor tree and choose the desired conversion from the Transform to submenu of the popup menu 3 4 10 The Choose type Dialog Box The Choose type dialog box see Figure 66 allows the user to specify a type 97 Choose type Enumerated Declared Vector Matrix integer short byte boolean string char Type definition Figure 66 The Choose type dialog box the Standard tab The Choose type dialog box contains several tabs each dedicated to a certain kind of types The set of tabs available in every particular
134. ee De S actions if K gt 0 then XUpperLimit UpperLimit k vermeil L Saturation entry actions LowerLimit end if we 2 Behavior chart Figure 93 Behavior chart editor The behavior chart editor consists of the editing area and the toolbar The editing area allows the user to graphically edit the elements of the behavior chart The toolbar provides shortcuts to some of the most commonly used commands of the behavior chart editor 113 3 4 14 1 Toolbar Buttons The behavior chart editor toolbar contains the following buttons E creates a new state m zi creates a new transition creates a new final state gt opens the Transition conditions dialog box to edit the trigger and guard of the selected transition gt e opens the Text Editor window to edit the actions of the selected transition 5 open the Text Editor window to edit the entry actions of the selected state e a opens the Text Editor window to edit the exit actions of the selected state e opens the Internal transitions window to edit the internal transitions of the selected state creates a new switch point creates a new probabilistic switch point k deletes the selected elements toggles spline interpolation for the selected transition e gt allows the user to add a base point to the selected transition e a allows the user to de
135. eeeaas 234 4 4 1 Data Types and Constant 0 00 0 ececeeeeeneeeeteneeeeeteeeeeeeeeeeeee 234 4 4 2 Model Creation and Destruction Functions 235 4 4 3 Functions to Save and Restore Model State 0 ec eeeeeeeeeeees 235 4 4 4 Model Execution Functions ecccecccesceeeeeeeeeeeseeneeeseeneeeeeeaaees 236 4 4 5 Variable Management Functions ceeceeeceeeeeeeeeeteeeeeeeenteeeeeees 237 4 4 6 Numerical Methods Configuration Functions 238 Possible values of the NAE parameter cccccecceeeeecceceeeeeeeeeeaaeceeeeeeesecsnsaeceeeeeeeeeeenaeens 239 4 4 7 Miscellaneous FUNCTIONS 0 00 02 ce cceeeeeeeeeeneeeeeeetaeeeeeenaeeeeeeaeeeeeeeaas 239 CHAPTER 5 SysLib The Standard Class Library ecceccceeeeeeeseeeeeeeeeeneeeeseeneeeeseenees 241 SRUNI BIOCKS ti sisi eset tah R E A orden eee 242 5 51 CGA nii aed tach needa Ree ee 242 Class Name CGAI cs ccas gs es eed octane AEE RE AEEA RAA GA R A 242 5 12 CSUMMALON ader iie raai eiria 242 Classname CSummat OF eaea eE a E 242 STS CoubtractOr wasn A A OAT EA edhe 243 Class NAME CSUbDELACTOR Liicdicesccteided seeidaes tech unen EETA ERA 243 D1 Clntegratotes G A AIT AEA 243 Classname CIR EEGr ALOR ene aa aa iaaa a aa a a a a beeen daaa aat 243 S S LCUMereitialor oo AT ete oteasd pete eee 244 Class name GDit FERSt Tat OF wtise ceiaticcls i E AA Ea AE EEEE EAA EER 244 S TO CApeniodicU nit a eaa a Aa ar aa Aa AA EAE TEE 244 Sh COSCillatingUnt rar E E T detek
136. eine ha ipa Pinan ees 18 2 4 3 Internal Transition secara a aN 19 2AA MSO e ae EEE EEE AE RSE E 20 24 5 Final Sale aren ar a aa E A A E E O AA 20 240 SWitChy POIN orei raain irlan a RATEALE e AEA T Ea RALEA 20 2 4 7 Probabilistic Switch Point eeeeeeeeeeenesesrnesesrresernssrrnnssrenrnssrrnnsne 21 2 4 8 Orthogonal Me cccccecceeeeseceeedeseeeeeeeneneeedeneneeeeeneneeedeneneeedeneneees 21 2 5 System Of Equations sescca iais ari iiia Eai EENEN AAAA ARNa EVAN AA 22 2 6 Aggregate System of Equations 00 cc ececeeeeeeeeeeeeteeeeeeeneeeeesiieeeeeetneeeeees 27 2 f Stuers DIAG FAM ccctessecceetidcreedansncdeelandicdanhiteeed lantadadeaebedeceees Mhbeadbh ten eate 27 2 6 Local ODE ninn a aia lteter 27 2 7 2 Class BOUNALY onari is iant aas aeae a A E A a AE 28 PATA LAN EE EEA A E EN 29 2 0 1 Dynamic objects ose niirnsid iriiri ie iria 34 2 8 Parametar S ononon ari ir a A E A eet E E aa 35 2 ONAN S an ET E TE 36 2 AO CONStANIS an REE R ARER ERA E EEA 37 2 11 Local Clas5eS ennan r AA a er detatene 38 Ae Glass ImMeritanCe aeaa A A AAE EER 38 2 TS Typo Sna A E a A EAEE ieee he 39 213 1 Scalar Typ S radenenn ida de ede 39 2 13 2 Regula Types reene a r A 42 PANSRET i A A G A 44 213 4 CONNECTION aoei aittei ibe ia EENEN EAA TAEAE EAA EEEE TEANAS AEA 45 2 13 5 Signale 2 echt uarn dc a eee RAE ann dae 45 2130 Declared Typo Sarra a EEE EEEE 46 ZT ODjOCULY POS nai e end at he esa eee 47 21338 WSUS riadi s
137. element s to the desired location To delete the selected element s 1 Click Delete on the structure diagram editor toolbar or Right click the selection and choose Delete from the popup menu or Hit Delete To toggle the grid 1 Click Grid on the structure diagram editor toolbar Regardless of whether the grid is visible or not all operations align all elements to the grid 3 4 15 2 1 Local Objects For more on local objects see Section 2 7 1 A new local object can be created by either dragging a class from the Project Manager window and dropping it onto the structure diagram or using the Add object O toolbar button of the structure diagram editor To create a new local object via drag and drop 1 Drag a class from the Project Manager window and drop it onto the structure diagram editing area A new local object of the corresponding class will appear as shown in Figure 126 Class_1_1 m ir Figure 126 New local object 128 To create a new local object using the Add object O toolbar button 1 Click Add object H on the structure diagram editor toolbar The Choose class dialog box will appear as shown in Figure 127 Choose class Imported packages P This project Class 1 mal Model mal New class Figure 127 The Choose class dialog box 2 Select the class from which you want to create a local object 3 Click OK A new local object of the selected class will appear
138. embeddable model exports a set of functions that allow the application to control model execution and access the contents of the model These functions are described in detail in the subsections that follow The embeddable model allows the application to run multiple model instances simultaneously Every model instance maintains its own model time and state of objects and is independent from other model instances Every model instance is identified by a unique handle of type TModelHandl1le Many of the functions of the embeddable model take a TModelHandle as the first parameter allowing the caller to identify the model instance Some functions do not take an explicit TModelHandle parameter these work with the implicit default model instance whose TModelHandle is assumed to be 0 The default model instance is created automatically upon the first call to a function that requires the default instance Other model instances need to be created explicitly using the creat eModel function The embeddable model uses the numerical method settings that were active when the visual executable model was executed last time before the embeddable model was built These settings can be altered using the functions exported by the embeddable model 4 4 1 Data Types and Constants The embeddable model functions make use of the following data types and constants e Data types integer a 32 bit signed integer pChar a pointer to a null terminated string of 8
139. entheses operations are evaluated in the order of their precedence from highest to lowest Operations of equal precedence are evaluated from left to right For example the expression 20 4 Go 2i e A0 is evaluated in the following order the multiplication 5 2 the first addition 20 10 the second addition 30 40 Parentheses override the normal evaluation order so that every sub expression within parentheses is evaluated before any other operations are applied to it For example the expression 20 5 2 40 is evaluated in the following order the second addition 2 40 the multiplication 5 42 the first addition 20 210 61 2 16 OPERATORS An operator is an instruction to the model to take some action A sequence of one or more operators represents a sequence of instructions that are executed in the order of appearance of the corresponding operators in the sequence Operators are used to implement internal functions and procedures see Section 2 14 2 1 and specify behavior chart state and transition actions see Section 2 4 Every operator has its own syntax as described below Every operator ends with a semicolon 2 16 1 Assignment Operator The assignment operator assigns the value of its right hand side expression to the variable referenced by its left hand side expression Syntax lt assignment_operator gt lt lhs_expression gt lt rhs_expression gt lt lhs_expression gt
140. er of rows field and the number of columns in the Number of columns field 4 Click OK To specify a signal type 1 Click the Signal tab The Choose type dialog box will look as shown in Figure 69 Choose type Standard Vector Matrix Enumerated Declared Formal parameters OK Cancel Help gt Type definition signal Figure 69 The Choose type dialog box the Signal tab 2 To add a parameter to the signal type click Add The Parameter dialog box will appear as shown in Figure 70 99 7 8 9 Identifier Cancel Type double Comments Ce Group E Figure 70 The Parameter dialog box Type the name of the parameter in the Identifier field To specify the type of the parameter click Type Another Choose type dialog box will appear Use the Choose type dialog box to specify the type of the parameter When done click OK in the Choose type dialog box If necessary type the comments for the parameter in the Comments field If you want to assign the parameter to one or more groups click LJ The Groups dialog box will appear Use the Groups dialog box see Section 3 4 11 to assign the parameter to one or more groups When done click Apply in the Groups dialog box Click OK in the Parameter dialog box If necessary repeat the above steps to add more parameters to the signal type Click OK in the Choose type dialog box To specify an enume
141. ery variable value up to and including the upper bound A loop starting with the while keyword the while loop is executed as follows First the conditional expression following the while keyword is evaluated If the result is true the enclosed operator sequence is executed once Then the conditional expression is evaluated again and if the result is true the enclosed operator sequence is executed again This is repeated until the conditional expression evaluates to false A loop may start with the Loop keyword that is have no lt loop_specification gt Sucha loop executes the enclosed operator sequence repeatedly until the exit see Section 2 16 6 or return operator see Section 2 16 7 is executed Examples for k in 1 10 loop Zi Z y end loop while z gt 0 loop Z i Z X end loop 2 16 6 The exit Operator The exit operator transfers control out of an enclosing loop either unconditionally or if a certain condition is satisfied Syntax lt exit_operator gt exit when lt conditional_expression gt 64 A lt conditional_expression gt is an expression that evaluates to boolean If the optional when keyword is absent the exit operator unconditionally transfers control out of the current innermost loop operator If the when keyword is present the exit operator evaluates the conditional expression following the when keyword and if the result is true transfers control out of the current innermost loop
142. ery vector is and can be used as a matrix with one column matrix N 1 The current size of a matrix can be obtained using the size function see Section 2 14 1 2 The operations defined for matrices are see also Section 2 15 1 e x multiplication by a scalar or another matrix e 4 addition e subtraction e equality relation e 1 inequality relation Matrix literals have the following syntax lt matrix_literal gt lt matrix_row gt lt matrix_row gt lt itertive_matrix_literal gt lt matrix_row gt lt double_literal gt lt double_literal gt lt itertive_matrix_literal gt lt iteration_spec gt lt double_expression gt lt iteration_spec gt for lt row_iteration_variable gt in lt range gt lt column_iteration_variable gt in lt range gt lt row_iteration_variable gt lt identifier gt lt column_iteration_variable gt lt identifier gt lt range gt lt lower_bound gt lt upper_bound gt where lt double_expression gt is an expression see Section 2 15 that evaluates to double lt lower_bound gt and lt upper_bound gt are static expressions that evaluate to integer and lt identifier gt is an identifier see Section 6 2 Matrix literal examples 2 3257 1 20 tor i in DeSantis for i in 1 size A 1 j in 1 size A 2 A i j 2 In an iterative matrix literal the lower bound of an iteration
143. es whether the plan is active or not The OK button applies the current changes and closes the dialog box The Cancel button closes the dialog box without applying the current changes The simulation plan can contain the following commands Assign assigns a new value to a model variable Pause delays the plan execution for a given amount of model time Message displays a message Breakpoint stops the model execution Quit terminates the model Checkpoint compares the current state of the model with the specified model state file Variable values are compared with the tolerances specified in the numerical method settings If the two model states are found to be identical a message box is displayed indicating success Otherwise a special window is displayed listing the encountered differences Assignment commands are added to the plan by dragging respective variables from Variables and Structure windows Other commands are added via the context menu To add or insert an assignment command 1 Drag the variable you want to assign from a Variables or Structure window and drop it onto the command list in the Model run plan dialog box If you want to add the assignment to the end of the plan drop the variable onto the empty area below the last command Otherwise if you want to insert the assignment before a specific command drop it onto that command The Assignment dialog box will appear as shown in Figure 246
144. esponding then keyword is executed Otherwise the procedure is repeated for every next pair of the elsif and then keywords until there is no such pair or the conditional expression evaluates to true If all conditional expressions evaluate to false the operator sequence following the else keyword if any is executed Example if x gt x2 and y lt yl then zZz true elsif x lt x3 and x gt 0 and y lt y2 then Z aor b elsif x gt x3 and y lt a x b then z a and b else z false end if 2 16 4 The case Operator The case operator executes one of several operator sequences depending on the value of an expression Syntax lt case_operator gt i case lt selector_expression gt of when lt option gt lt option gt gt lt operator_sequence gt when others gt lt operator_sequence gt end case The lt selector_expression gt is an expression that evaluates to an integer or enumeration type Every lt option gt is a literal of the same type as the selector expression The case operator is executed by first evaluating the selector expression The result of the selector expression is then compared to each lt option gt If one of the lt options gt s is equal to the result of the selector expression the operator sequence following the corresponding gt label is executed Otherwise the operator sequence following the when others gt label if any is executed
145. ete step Pl on the main toolbar or Choose Simulation Discrete step from the main menu 217 To restart the model 1 Click Restart on the main toolbar or Choose Simulation Restart from the main menu 4 2 17 The Model run plan Dialog Box The Model run plan dialog box allows the user to create and activate the simulation plan The simulation plan is a sequence of commands that if active is executed in parallel with the model An example of the Model run plan dialog box containing a simple plan is shown in Figure 244 Model run plan Assign x 10 Pause 20 Assign model x 20 Assign objl y 25 Pause 50 Message Done Breakpoint Figure 244 The Model run plan dialog box containing a simple plan To open the Model run plan dialog box 1 Choose Service Plan from the main menu or If the simulation plan is already active click Model run plan O on the main toolbar The Model run plan dialog box will appear If the simulation plan has not been configured yet the dialog box will look as shown in Figure 245 218 Model run plan l Execute OK Cancel Help 5 Figure 245 Empty simulation plan The Model run plan dialog box displays the simulation plan in a list one command per row New commands can be either added to the end of the plan or inserted between existing commands Existing commands can be edited or deleted The Execute checkbox in the lower left corner determin
146. f the default model instance Returns the evaluation result The pC string specifies the expression If the expression is incorrect Unassigned is returned function GetVariables var vars variant TRetCode Retrieves information about all variables of the default model instance The vars parameter receives the result in the form of a two dimensional 1 N 1 3 variant array where N is the total number of variables in the model Every i 1 th element of the array contains a string specifying the full name of the i th variable Every i 2 th element contains an integer code specifying the type of the i th variable Every i 3 th element contains TRUE if the i th variable is independent or FALSE otherwise Possible type codes are double 4 integer 5 byte 6 short 7 boolean 9 numerated_type 10 char 11 string 12 vector 14 matrix 15 signal 17 function GetVariablesEx var vars variant TRetCode Retrieves information about the model object of the default model instance The vars parameter receives the result in the form of a variant array with three elements The first element is a string specifying the object identifier The second element is an array describing the variables of the object in the same format as the result of the Get Variables function except for that the first element of each variable description specifies the variable identifier instead of
147. f x trunc x rounds x towards zero to the nearest integer that is returns the integer part of x Some functions are defined in the standard packages Statistics 6 z double returns the value of the Laplace integral for the argument Z 2 14 1 2 Functions and Procedures for Vectors and Matrices column x j returns the j th column of the matrix x det x returns the determinant of the square matrix x eig A returns an n by 2 matrix containing the real and imaginary parts of the eigenvalues of the square n by n matrix A in the first and second column respectively eigs A returns a vector of size n containing the real eigenvalues of the symmetric n by n matrix A eigv in A matrix out W matrix out Z matrix computes the eigenvalues and eigenvectors of the square n by n matrix A Returns the n by 2 matrix w and the n by n matrix z Upon return w contains the real and imaginary parts of the eigenvalues in the first and second column respectively and Z contains the eigenvectors so that every i th column of z represents the eigenvector that corresponds to the i th eigenvalue in W eigvs in A matrix out W vector out Z matrix computes the eigenvalues and eigenvectors of the symmetric n by n matrix A Returns the vector w of size n and the n by n matrix z Upon return w contains the eigenvalues and z contains the eigenvectors so that every i th column of Z represents the eigenvector that corres
148. fied as the object model in the independent orthogonal time The object specified as the submodel should be discrete or hybrid and its behavior chart should have the final state Submodel quits after reaching the final state Syntax lt submodel_execution_operator gt do lt object_name gt lt actual_variables_values gt lt actual_variables_values gt lt variable_name gt lt expression gt lt variable_name gt lt expression gt Example do Missile TetaO rad 30 This operator runs model of missile motion in the air thrown with an angle of 30 degrees in the orthogonal time Executing the operator ends after the fall of the missile During this execution the time of the model is not changed The values of the variables of the Missile object at the end of this run correspond to the moment of missile falling 2 17 VISIBILITY RULES The visibility rules determine the scope of every project element Project elements are classes variables parameters functions procedures etc The scope of an element is the part of the project where that element is available for use or in other words visible The notion of a scope is closely intertwined with the notion of a block Each of the following entities designates a block e Project The elements visible in a project are the classes constants global parameters global variables declared types functions and procedures defined in that proj
149. finition gt lt signal_type_definition gt lt record_type_definition gt lt connector_type_definition gt lt distinct_type_definition gt lt base_type_name gt lt base_type_name gt lt type gt lt regular_type_definition gt lt vector_type_definition gt lt matrix_type_definition gt lt vector_type_definition gt vector lt static_expression gt lt matrix_type_definition gt matrix lt static_expression gt lt static_expression gt lt enumerated_type_definition gt lt literal gt lt literal gt 262 lt literal gt lt identifier gt lt signal_type_definition gt signal lt signal_parameter_definition gt lt signal_parameter_definition gt lt signal_parameter_definition gt lt parameter_name gt lt parameter_type gt lt parameter_name gt lt identifier gt lt parameter_type gt lt type gt lt record_type_definition gt record lt record_component_definition gt end record lt record_component_definition gt lt component_name gt lt component_type gt lt component_name gt lt identifier gt lt component_type gt lt type gt lt connector_type_definition gt connector lt connector_component_definition gt end connector lt connector_component_definition gt lt component_stereotype gt lt component_name gt lt component_t
150. following tabs General Folders Model and Version The subsections that follow describe the contents of these tabs 3 8 1 The General Tab This tab contains the following elements Default initial values for variables If this checkbox is checked Rand Model Designer automatically generates a reasonable default value for each new parameter variable or constant created by the user Otherwise the value of each new parameter variable or constant remains undefined unless explicitly specified by the user Disable full checking while editing if this checkbox is checked full control of the project will be carried out only while creating a visual model or by executing command Project Check Separate MVL file for every global class if this checkbox is checked while saving the project as MVL file the description of each global class is stored in a separate MVL file The main project file in this case is added by operators pragma include xxx mvl that allow MVL compiler to compile the full project description If an error occurs the text from corresponding file is displayed Variable groups This is a list of variable groups defined in the project see Section 3 4 11 The context menu which can be opened by right clicking on the list provides the Add group and Delete group items that allows the user to add and remove groups This function is only available in Rand Model Designer Corporate and Rand Model Designer Educat
151. for switch point detection This function affects all model instances e procedure setNumMethods ODE DAE NAE integer Selects the methods to be used to solve the aggregate system of equations The ODE parameter specifies the method that should be used in case the aggregate system of equations consists solely of differential equations The DAE parameter specifies the method that should be used in case the aggregate system of equations contains both differential and algebraic equations The NAE parameter specifies the method that should be used in case the aggregate system of equations consists solely of algebraic equations The selection affects all model instances Possible values of the ODE parameter nmAutoODE 13 automatic nmDOPRI5 2 DOPRI5 nmDOPRI853 4 DOPRI853 nmODEX 3 ODEX nmDDASSL 8 DDASSL nmRADAU5 10 RADAUS5 nmEiler 18 Euler nmRK4 1 RK4 Possible values of the DAE parameter nmAutoDAE 14 automatic nmDOPRI5_N 20 DOPRI5 Newton nmDOPRI853_N 21 DOPRI853 Newton nmODEX_N 22 ODEX Newton Possible values of the NAE parameter nmAutoNAE 12 automatic nmNewtonF 15 quick Newton nmNewtonM 11 modified Newton nmNewtoncC 6 classical Newton nmPowell 7 Powell 4 4 7 Miscellaneous Functions e function getLastHModErrorEx hModel TModelHandle
152. formation on user defined functions and procedures see Section 2 14 2 To create a new user defined function or procedure 1 Right click the Project procedures and functions node in the Project Manager window and choose New function or procedure from the popup menu The Text Editor window will appear as shown in Figure 36 fe Algorithmic procedure or function a Se a Bale ASA unction globFun_1 in Z double return double is end globFun_i Help Figure 36 Editing a function or procedure in the Text Editor window 2 Use the Text Editor window see Section 3 4 12 to edit the code of the function or procedure 3 Click OK To modify a user defined function or procedure 1 Double click the function or procedure in the Project Manager window or Right click the function or procedure in the Project Manager window and choose Edit from the popup menu The Text Editor window will appear as shown in Figure 36 2 Use the Text Editor window see Section 3 4 12 to edit the code of the function or procedure 3 Click OK 3 3 6 Deleting Project Components Any component of the currently open project except for the Model class can be deleted from the project via the Project Manager window To delete a component from the currently open project 1 Right click the component in the Project Manager window and choose Delete from the popup menu A confirmation message box will appear 2 Click Yes 3 3
153. fy the type of the component click Type Another Choose type dialog box will appear Use the Choose type dialog box to specify the type of the component When done click OK in the Choose type dialog box If necessary type the comments for the component in the Comments field Choose the category of the component in the Component type section Click OK in the Connector component dialog box If necessary repeat the above steps to add more components to the connector type oO MND Click OK in the Choose type dialog box 3 4 11 The Groups Dialog Box The Groups dialog box allows the user to edit the set of groups associated with a parameter variable or constant The Groups dialog box looks as shown in Figure 78 104 Groups for variable V_1 M Group 1 v Group 2 New group Figure 78 The Groups dialog box To create a new group 1 Click New group in the Groups dialog box The Enter the new group name dialog box will appear as shown in Figure 79 Enter the new group name Figure 79 The Enter the new group name dialog box 2 Type the name of the new group 3 Click OK To modify the set of groups associated with a parameter variable or constant 1 Check the groups that should be associated with the parameter variable or constant 2 Uncheck the groups that should not be associated with the parameter variable or constant 3 Click Apply 3 4 12 Text Editor The Text Editor
154. g box consists of the following tabs General Colors Display and Fonts The subsections that follow describe the contents of these tabs 3 9 1 The General Tab This tab contains the following element e Undo limit This field specifies the maximum undo buffer size that is the maximum number of actions that can be undone using the Edit Undo command 3 9 2 The Colors Tab A Environment options Display Fonts l Element Inherited element Overridden element Figure 157 The Colors tab The Colors tab see Figure 157 allows the user to configure colors for different categories of project elements Element categories appear in the Element list The available categories are Own element Inherited element and Overridden element The Own element category represents new elements of a class or project The Inherited element and Overridden element categories represent inherited and overridden elements respectively To view or modify colors for a particular category select that category in the Element list For every category two colors can be selected in the Color palette foreground and background The currently selected foreground and background colors are denoted by the FG and BG labels respectively To select a color as a foreground color click that color in the Color palette To select a color as a background color right click that color in the Color palette 150 3 9 3 The Display Tab
155. ght click anywhere in the Histogram window and choose X axis marks Initial value from the popup menu The Initial value dialog box will appear as shown in Figure 203 In the Initial value dialog box type the new value for the first label and click OK Initial value Figure 203 The Initial value dialog box To modify the increment between labels right click anywhere in the Histogram window and choose X axis marks Increment from the popup menu The Increment dialog box will appear as shown in Figure 204 In the Increment dialog box type the new value for the increment and click OK Increment Figure 204 The Increment dialog box To modify the number of decimal places in real number labels right click anywhere in the Histogram window and choose X axis marks Precision from the popup menu The Precision dialog box will appear as shown in Figure 205 In the Precision dialog box type the new value and click OK 179 Increment Figure 205 The Precision dialog box To modify the minimum y axis value 1 2 Right click anywhere in the Histogram window and choose Min value for Y axis from the popup menu The Min value for Y axis dialog box will appear as shown in Figure 206 Min value for Y axis Cancel Figure 206 The Min value for Y axis dialog box Type the new value and click OK The contents of a Histogram window can at any time be saved to a file as
156. gree of influence of this parameter to the value of the output variable when all parameters are independently varied within specified ranges To determine the global sensitivity indices by means of stochastic computational experiment Rand Model Designer uses the algorithm that was developed by Sobol I M I M Sobol Global sensitivity indices for the study of nonlinear mathematical models Mat Simulation 2005 v 17 Ne 9 43 52 To analyze the global sensitivity click Simulation gt Typical computing experiment gt Global sensitivity analysis In the dialog box see Figure 244 you need to specify the list of varying parameters and the output variable To add a varying parameter use your mouse to drag the desired one from the window of variables and drop it down to Parameter table To remove a parameter right click Parameter table and apply the appropriate command of pop up menu For each parameter you need to specify its minimum and maximum values To specify an output variable use your mouse to drag the desired one from the window of variables and drop it down to Variable table To remove variable right click Variable table and apply the appropriate command of pop up menu For output variable you need to specify the point of measuring a specific time T or model termination event enter the time value into Point time of gauging column or leave it empty for model termination 231 Global sensitivity analysis met
157. hat when satisfied cause the model to stop The tab shows the predicates in a list Every predicate has a checkbox next to it If a checkbox is checked the model will stop every time the corresponding condition becomes true To add a predicate 1 Right click anywhere in the list and choose Add from the popup menu The Edit predicate dialog box will appear as shown in Figure 231 Edit predicate Object SSS Cancel Expression E Figure 231 The Edit predicate dialog box 2 To select the object whose variables and parameters will participate in the predicate click The Choose object dialog box will appear as shown in Figure 232 205 Choose object Figure 232 The Choose object dialog box 3 Select the object and click OK 4 Type the predicate expression in the Expression field 5 Click OK To modify a predicate 1 Right click the predicate and choose Edit from the popup menu The Edit predicate dialog box will appear as shown in Figure 231 2 Use the Edit predicate dialog box to modify the predicate 3 Click OK To remove a predicate 1 Right click the predicate and choose Delete from the popup menu A confirmation message box will appear 2 Click Yes 4 2 15 Model Settings The visual model settings consist of the basic model settings and numerical method settings The basic model settings are configured in the Model settings dialog box see Section 4 2 15 1
158. hatched rectangle inside the sprite When toggled on the movement area can be moved and resized To toggle the movement area of a sprite 1 Right click the sprite and choose Track rectangle from the popup menu To move the movement area 1 Drag the movement area in the desired direction To resize the movement area 1 Drag any border of the movement area in the desired direction Other sprite properties can be customized using the Animation parameters dialog box 4 2 7 7 1 The Animation parameters Dialog Box To open the Animation parameters dialog box for a sprite 1 Right click the sprite and choose Parameters from the popup menu The Animation parameters dialog box will appear as shown in Figure 214 The Animation parameters dialog box contains the following elements e X These three fields specify the minimum Min maximum Max and initial Value x coordinate of the movement area e Y These three fields specify the minimum Min maximum Max and initial Value y coordinate of the movement area 187 4 2 right left These options specify the x axis orientation for the movement area up down These options specify the y axis orientation for the movement area Background This field specifies the path to the background image Color This field specifies the background fill color Images This area shows the list of image files associated with a sprite The default i
159. he Consider equation blocks option is tuned on the Structure Matrix window highlights available equation blocks and allows the user to view individual blocks 4 2 11 The Equation Blocks Window The Equation Blocks window displays information about equation blocks see Section 2 5 as shown in Figure 222 amp Equation blocks information TBS x 3 oe g Figure 222 The Equation Blocks window The information is organized in a table where each row represents a block and has the following fields e Block displays the name of the block e Diff eq displays the number of differential equations in the block e Alg eq displays the number of algebraic equations in the block e Formulas displays the number of formulas in the block 200 In order for the Equation Blocks window to display information about equation blocks the Consider equation blocks option must be set in the numerical method settings see Section 4 2 15 2 6 To open the Equation Blocks window 1 Choose Service Show information about equation blocks from the popup menu 4 2 12 The Calculator Window The Calculator window allows the user to evaluate expressions see Section 2 15 involving model variables and parameters The Calculator window looks as shown in Figure 223 E Formula calculator Expression Vytt2I2 Vy t2i2 g y Figure 223 The Calculator window To open the Calculator window
160. he User type editing dialog box To modify an existing declared type 76 1 Double click the declared type in the Project Manager window or Right click the declared type in the Project Manager window and choose Edit from the popup menu The User type editing dialog box will appear as shown in Figure 30 If you want to modify the name of the type type the new name in the Type identifier field If you want to modify the specification of the type proceed as follows If you want the type to act as a synonym for the double integer short byte boolean string Or char type or another declared type make sure the Distinct type option is checked and click Base type Otherwise select the option that corresponds to the category of the type for which the new type will act as a synonym The Choose type dialog box will appear Use the Choose type dialog box see Section 3 4 10 to specify the type for which the new declared type will act as a synonym When done click OK in the Choose type dialog box Click OK in the User type editing dialog box 3 3 3 Constants For detailed information on constants see Section 2 10 To create a new constant 1 Right click the Project constants node in the Project Manager window and choose New constant from the popup menu The Constant dialog box will appear as shown in Figure 31 Constant Identifier plobConst_1 Type double Cancel Value 0 Comments
161. he equations should be considered unknown and some should be considered known Unknown variables represent unknown values that need to be found by solving the equations The unknowns can be scalar variables of type double vectors of fixed and variable dimension record components and connectors of type double elements of arrays of type double Scalar variables and record components or connectors of integer type may be unknown only if they are on the left side of the formula for example k round y In other cases these variables are considered as known Expressions of the form A B where A and B are the arrays of real they are treated as a set of equivalences between elements of these arrays Known variables are those variables that participate in the equations but are not unknown Known variables are either fixed values or known functions of other known variables and or time A declaration indicating that one or more variables are unknown has the following syntax unknown lt variable name gt For example unknown x or unknown x y obj var A declaration indicating that one or more variables are known has the following syntax known lt variable name gt 24 For example known xX or known x y obj var Discrete variables see Section 2 9 are always known If the number of variables declared unknown is less than the number of equations in the system of equations this includes the case when no variables are declared
162. he new parameter click Value If the type of the parameter is an enumeration the Choose enumerated value dialog box will appear as shown in Figure 44 Otherwise if the type of the parameter is a record the Component Editor window will appear as shown in Figure 45 Otherwise the Text Editor window will appear as shown in Figure 46 Choose enumerated value Figure 44 The Choose enumerated value dialog box Initial yalue for P_1 Mathematical editing spp Close Figure 45 Editing the default value of a parameter in the Component Editor window 86 5 Initial value for P_1 f E E L Be A 00 gt fra Figure 46 Editing the default value of a parameter in the Text Editor window If the type of the parameter is an enumeration choose the default value of the parameter in the Choose enumerated value dialog box When done click OK in the Choose enumerated value dialog box If the type of the parameter is a record use the Component Editor window see Section 3 4 17 to specify the default value of the parameter When done click Apply in the Component Editor window If the type of the parameter is any other type use the Text Editor window see Section 3 4 12 to specify the expression for the default value of the parameter When done click OK in the Text Editor window If necessary type the comments for the parameter in the Comments field If you want to assign the new parameter to
163. hi Fortran etc Functions and procedures implemented in the Rand Model Designer programming language are called internal Functions and procedures implemented outside Rand Model Designer are called external If a function or procedure is defined in a project it has visibility The visibility indicates that the project function or procedure is either private or public A private function or procedure can only be used in the project containing that function or procedure A public function or procedure can be used in any project For the detailed discussion of the visibility of project components see Section 2 1 Class functions and procedures differ from project functions and procedures in their scope see Section 2 17 Project functions and procedures are visible in the entire project Moreover public project functions and procedures are visible in all other projects that import their containing project Class functions and procedures are only visible within their containing class 2 14 2 1 Internal Functions and Procedures An internal function or procedure is a subroutine implemented in the Rand Model Designer programming language 55 The definition of an internal function or procedure has the following syntax lt internal_function gt function lt function_name gt lt formal_parameters gt return lt return_value_type gt is lt local_variables gt begin lt operator_sequence gt end lt function_name gt lt internal_
164. iable Any other variable may be connected to any number of other variables A link between two connector variables connects the components of these variables pairwise in the order of declaration of components in the types of these variables see Section 2 13 4 Two connector variables may only be connected if each respective pair of their components is connectable Every link supplements the system of equations of the class see Section 2 5 as follows 2 7 3 1 Output input connection If obj1 out is an output variable of one local object and obj2 in is an input variable of another or same local object a link between obj1 out and obj2 in adds the following to the system of equations of the class obj2 in objl out known objl out unknown obj2 in 33 2 7 3 2 Input input connection If in is an input variable of the class and obj in is an input variable of a local object a link between in and obj in adds the following to the system of equations of the class obj in in known in unknown obj in 2 7 3 3 Output output connection If obj out is an output variable of a local object and out is an output variable of the class a link between obj out and out adds the following to the system of equations of the class out obj out known obj out unknown out 2 7 3 4 Contact contact connection If x and y are contact variables a link between x and y adds the following equation to the system of eq
165. ify the minimum and maximum values of the associated variable in the Value min and Value max fields respectively and choose the corresponding colors in the Color min and Color max fields The color of the object will vary between the specified colors proportionally to the current value of the associated variable Color change Variable Power_control Ksi2 Value min bp Color min Value max Color max OK Figure 219 The Color change dialog box To disassociate a variable from an object property 1 2 3 4 5 Open the 3D animation parameters dialog box Activate the 3D objects tab Select the object in the object list Click the Variable field of the property in the property panel An in place editing field will appear Hit Delete To rotate the scene within a 3D Animation window 1 Drag the contents of the 3D Animation window in the desired direction To zoom a 3D Animation window in 1 Click anywhere in the 3D Animation window while holding Shift To zoom a 3D Animation window out 1 Click anywhere in the 3D Animation window while holding Control 193 To save the contents of a 3D Animation window to a file as an image 1 Right click anywhere in the 3D Animation window and choose Save image from the popup menu The Save As dialog box will appear 2 Browse to the folder where you want to save the image 3 Type the file nam
166. ignal LowerLimit double UpperLimit the lower bound on the input signal X0 double 0 the initial value of X Input variables X double X0 Output variables Y double 0 Function This block implements the function shown in Figure 262 247 UpperLimit LowerLimit Figure 262 CSaturation function 5 2 3 CRelay Class name CRalay Parameters OnValue double OffValue double OnInput double OffInput double Input variables X double 0 Output variables CRelay aa Figure 263 CRelay 1 the output when the relay is on 0 the output when the relay is off 0 the on threshold 0 the off threshold Y double OffValue Function This block implements the function shown in Figure 264 248 Onvalue Offlmput x Onlnput Off alue Figure 264 CRelay function 5 2 4 CSwitch CSwitch Figure 265 CSwitch Class name CSwitch Parameters initX1 double 0 the initial value of X1 initX2 double 0 the initial value of X2 initZ boolean false the initial value of Z Input variables X1 double initX1 the first input X2 double initX2 the second input Z boolean initZ the control input Output variables Y double initX1 Function This block implements the function Y if Z then X2 else X1 249 5 2 5 Cinterpolator CInterpolator Figure 266 Cinterpolato
167. ilistic switch point can have either a probability or a special else label The probability is specified by an expression see Section 2 15 that evaluates to double A transition with an else label is called an e se transition A probabilistic switch point can have at most one outgoing else transition The probability of a transition indicates the probability of selection of that transition upon a visit to the probabilistic switch point If a probabilistic switch point has an outgoing else transition its probability is assumed to be equal to 1 s where S_is the sum of the probabilities of other transitions exiting the probabilistic switch point If a probabilistic switch point does not have an outgoing else transition upon visiting the probabilistic switch point the sum of the probabilities of all outgoing transitions must be equal to 1 If a probabilistic switch point does have an outgoing else transition upon visiting the probabilistic switch point the sum of the probabilities of other outgoing transitions must be less than or equal to 1 A probabilistic switch point cannot have entry actions exit actions or activity 2 4 8 Orthogonal time Behavior chart with the final state can be performed in an orthogonal time without affecting the time of the model i e it is performed an experiment in the experiment This can be done in two ways 1 Assign an object to some state of the Behavior chart in the main model and mark the item
168. in Figure 28 New Class Class identifier Stereotype Behavior type Structure type E Elementary object fes Compound object Component type Visibility HB isolated C private public Open Base class None Select Apply Close Figure 28 The New Class dialog box 2 Type the name of the new class in the Class identifier field 3 Specify the stereotype of the new class by selecting appropriate items in the Behavior type Structure type Component type and Visibility lists You will be able change the stereotype later For more on the class stereotype see Section 2 3 4 If itis necessary to specify the base class of the new class click Select The Choose class dialog box will appear as shown in Figure 29 Select the required base class in the Choose class dialog box and click OK 74 Choose class Tf Imported packages P This project Class 1 Class 2 Class 3 Figure 29 The Choose class dialog box 5 In the New Class dialog box click Apply To open the class editor window for a class 1 Double click the class in the Project Manager window or Right click the class in the Project Manager window and choose Edit from the popup menu The class editor window will appear see Section 3 4 To make a class abstract or concrete 1 Right click the class in the Project Manager window and choose Abstract class from the popup menu This will toggle the flag indicating whe
169. indow fs Initial value for V_1 i ae B L be N 00 gt fy 1 ey Figure 51 Editing the default initial value of a variable in the Text Editor window 5 Ifthe type of the variable is an enumeration choose the default initial value in the Choose enumerated value dialog box When done click OK in the Choose enumerated value dialog box 6 If the type of the variable is a record use the Component Editor window see Section 3 4 17 to specify the default initial value of the variable When done click Apply in the Component Editor window 7 If the type of the variable is any other type use the Text Editor window see Section 3 4 12 to specify the expression for the default initial value of the variable When done click OK in the Text Editor window 8 If necessary type the comments for the variable in the Comments field 9 If you want to assign the new variable to one or more groups click LJ The Groups dialog box will appear Use the Groups dialog box see Section 3 4 11 to assign the variable to one or more groups When done click Apply in the Groups dialog box 10 Click OK in the Internal variable dialog box To create a new external variable 1 Right click the External variables node in the class editor tree and choose New external variable from the popup menu The External variable dialog box will appear as shown in Figure 52 89 90 Identifier In 1 Cancel Type double Help
170. ined results are displayed in the bottom of the window the total number of tests and for each variable 1 calculated value of math expectation m 2 value of standard deviation sigma and 3 the probability P that defines that m differs from its true value at no more than at Epsilon The series of tests is terminated automatically when the ratio P gt Q is satisfied for all variables For example the results shown in Fig 242 mean that with given parameters of random scatter math expectation of a missile flight distance is within 2050 2100 meters with probability 0 95 The experiment can be stopped forcibly by pressing Stop button in this case the probability P does not reach the level of Q If Save results checkbox is checked at the end of the experiment the results of all tests values of parameters and variables are saved in the form of table to a text file for further processing by special programs If Bar chart checkbox is checked by clicking the icon in the column Bar you can see the histogram of distribution of variable values Fig 243 230 Bar chart 2sm mit 4 2 8 gf x 1 1776 09437496349 x 13 2344 45415059667 Figure 10 Histogram of variable x values 4 3 4 Global sensitivity analyses If a local sensitivity index is the partial derivative of the output variable with respect to given parameter at given point of the parameter space the global sensitivity index is the de
171. ink_name gt lt identifier gt 260 lt external_variable_reference gt lt object_name gt lt external_variable_name gt lt external_variable_ name gt lt external_variable_ name gt lt identifier gt lt behavior_definition gt lt equation_system_definition gt lt behavior_chart_definition gt lt equation_system_definition gt equations lt equation gt unknown lt unknown_variables gt yh initial lt first_derivative_initial_value gt Wy Bee lt unknown_variables gt lt variable_name gt lt variable_name gt lt first_derivative_initial_value gt lt value gt lt behavior_chart_definition gt bchart lt state_definition gt lt transition_definition gt WEM s lt state_definition gt lt ordinary_state_definition gt lt special_state_definition gt lt ordinary_state_definition gt state lt state_name gt do lt local_activity_definition gt lt entry_actions gt lt exit_actions gt lt state_name gt lt identifier gt lt local_activity_definition gt lt object_name gt lt class_name gt lt actual_initial_values gt lt entry_actions gt entry lt actions_definition gt lt exit_actions gt exit lt actions_definition gt lt actions_definition gt actions lt operator_sequence gt M lt special_state_definition gt lt state_stereotype gt stat
172. ional 145 3 8 2 The Folders Tab E Project options xs General Folders Embedded model Version Equation blocks Package search path OK Path to embedded model LinearBlock dll brewok i Browse IV Version auto correction Figure 153 The Folders tab This tab contains the following elements 146 Package search path This field specifies the set of folders where Rand Model Designer looks for imported packages The field is populated automatically as imported packages are added to the project see Section 3 3 7 However if an already imported package moves to a new location this field needs to be modified manually to let the importing project know the new location Path to hidden model This field specifies the path used to store the generated embeddable model see Section 4 4 The path is relative to the project folder 3 8 3 The Embedded model Tab Project options En S O Debug mode 7 Save all variables 7 Load all variables 7 Model execution tracing Numerical methods tracing Figure 154 The Embedded model tab This tab contains the following elements e Debug mode enables disables the ability to control the implementation of the built in model is checked by default If this option is disabled a series of checks is not carried out and the speed of the model execution may increase e Model execution tracing This checkbox enables disable
173. ions are defined in System package e System IntervalBegin System IntervalEnd return values of type boolean If these functions are used as the condition for triggering the internal transition this transition will be triggered at the beginning or the end of the interval of model time changing specified by an external application external application calls runToEx function e System ModelLoaded returns TRUE during the first discrete step after loading the model state and FALSE otherwise e System TimeGapBegin System TimeGapEnd return values of type boolean If these functions are specified as conditions for transition firing this transition will be triggered at the beginning or the end of the time gap accordingly e System TimeStep returns value of type double equal to the value of the interval of model time changing specified by external application external application calls runToEx function 2 14 2 User Defined Functions and Procedures Every class see Section 2 2 and every project see Section 2 1 can contain an arbitrary number of user defined functions and procedures User defined functions and procedures are subroutines that are created by the user A user defined function or procedure can be implemented either in the programming language offered by Rand Model Designer or in any other programming language outside Rand Model Designer with the use of third party tools such as Visual C Delp
174. ior Chart window of a hybrid state activity object 1 Double click the state or Right click the state and choose Behavior chart from the popup menu The Behavior Chart window of the activity object will appear as shown in Figure 168 A 2 behavior chart Figure 168 Opening the Behavior Chart window of a state activity object 159 If a state has an activity with parameters or variables the Variables window of the corresponding activity object can be opened as follows To open the Variables window of a state activity object 1 Right click the state and choose Variables from the popup menu The Variables window of the activity object will appear as shown in Figure 169 Figure 169 Opening the Variables window of a state activity object If a state has a compound activity the Structure window of the corresponding activity object can be opened as follows To open the Structure window of a compound state activity object 1 Right click the state and choose Local structure from the popup menu The Structure window of the activity object will appear as shown in Figure 170 A 2 structure Figure 170 Opening the Structure window of a state activity object If a state has internal transitions the state s Internal transitions window can be opened as follows To open the Internal transitions window for a state 1 Right click the state and choose Internal transitions from
175. ist A2 array of integer List add A2 1 List add A2 2 List addFirst A2 3 List delete A2 1 I A2 1 J List last A2 As a result of these operations A2 3 2 I 2 J 2 2 14 FUNCTIONS AND PROCEDURES Functions and procedures are subroutines that can be called from various places within a project A function is a subroutine that returns some value A procedure is a subroutine that does not return a value A function call executes the body of the called function and receives the value returned by the function The returned value can participate in the evaluation of the expression that called the function The syntax of function calls is described in Section 2 15 A procedure call executes the body of the called procedure and does not receive any value The syntax of procedure calls is described in Section 2 16 2 Functions and procedures can be divided into predefined functions and procedures and user defined functions and procedures The predefined functions and procedures are defined and automatically available in all projects User defined functions and procedures become available only after they are explicitly defined by the user The predefined functions and procedures are described in the section that follows User defined functions and procedures are discussed in Section 2 14 2 2 14 1 Predefined Functions and Procedures The following predefined functions and procedures are available in all projects
176. iting and entering the same state results in execution of the state exit actions destruction of the current state activity object creation of a new state activity object and execution of the state entry actions In all other respects internal transitions are equivalent to ordinary transitions 19 2 4 4 Initial State An initial state is a special state from which the execution of a behavior chart begins An initial state is shown as a solid filled circle see Figure 8 eo Figure 8 Initial state with mandatory outgoing transition Every behavior chart must have exactly one initial state Every initial state must have exactly one outgoing transition which must be unconditional An initial state cannot have incoming transitions An initial state cannot have entry actions exit actions or activity 2 4 5 Final State A final state is a special state that terminates the execution of a behavior chart A final state is shown as a circle surrounding a smaller solid filled circle see Figure 9 Figure 9 Final state A final state cannot have outgoing transitions A final state cannot have entry actions exit actions or activity 2 4 6 Switch Point A switch point is a special state that when visited results in immediate selection and execution of one of the outgoing transitions On a behavior chart a switch point is shown as a rhomb see Figure 10 lt guard 1 gt Figure 10 Switch Point A transition exiting a s
177. l supports the following command line options e A or A Causes the model to run automatically upon startup e S lt path_to_settings_file gt or S lt path_to_settings_file gt Instructs the model to load the settings from the specified file The standalone visual executable model loads its settings and window layout from the default settings file upon startup and saves them to the default settings file upon termination unless the s command line option is specified If the s command line option is specified the supplied settings file is used instead of the default one 4 3 TYPICAL COMPUTING EXPERIMENTS Visual model allows carrying out the following typical computing experiments obtaining a parametric dependence that is the dependence of the model output variable on a parameter calculating the event probability when laws of distribution for the model parameters are specified calculation of the mathematical expectation and standard deviation of the model output variable when laws of distribution for the model parameters are specified global sensitivity analysis ranking model parameters according to their impact on the model output variable 224 optimization finding the optimal values of the selected model parameters that minimize or maximize the value of specified objective function with consideration of constraints Constraints can be defined as the allowable range of values of the parameters to
178. lass name CSubtractor Parameters X0 double 0 the initial value of X YO double 0 the initial value of Y Input variables X double XO YO Y double Output variables Z double 0 Function This block implements the function Z X Y 5 1 4 Clntegrator CIntegrator D Vat Figure 255 Cintegrator Class name CIntegrator Parameters K double 1 the gain factor X0 double 0 the initial value of X YO double 0 the initial value of Y 243 Input variables X double X0 Output variables Y double YO Function This block integrates its input and outputs the result the integral The block K implements the transfer function W s which is equivalent to the equation S dY _ K X dt 5 1 5 CDifferentiator CDifferentiator DA A h gt Figure 256 CDifferentiator Class name CDifferetiator Parameters X0 double 0 the initial value of X YO double 0 the initial value of Y Input variables X double XO Output variables Y double YO Function aX This block implements the equation ae y t 5 1 6 CAperiodicUnit CAperiodicUnit Figure 257 CAperiodicUnit Class name CAperiodicUnit 244 Parameters K double 1 the gain factor T double 1 the time constant X0 double 0 the initial value of X YO double 0 the initial value of Y Input variables X double X0 O
179. le from the popup menu A confirmation message box will appear 2 Click Yes 4 2 2 The Behavior Chart Window The Behavior Chart window visualizes the behavior chart of a hybrid object see Section 2 4 The Behavior Chart window looks as shown in Figure 167 158 when Yl actions _2 sin Time after 10 when _1 actions 4 actions _5 3 14 Figure 167 The Behavior Chart window In the Behavior Chart window all states and transitions are shown grayed out except for the current state and active transitions When a transition is executed it is highlighted orange State and transition property labels can be turned on and off via the context menu To toggle property labels 1 Right click anywhere in the Behavior Chart window and choose Additional info from the popup menu To select a state or transition 1 Click the state or transition or Right click anywhere in the Behavior Chart window and choose the state or transition from the Go to submenu of the popup menu The Behavior Chart window of the model object opens automatically upon executable model startup if the model object is hybrid The Behavior Chart windows of other hybrid objects can be opened manually as described below and in Section 4 2 3 If a state displayed in a Behavior Chart window has a hybrid activity the Behavior Chart window of the corresponding activity object can be opened as follows To open the Behav
180. lect the state and click Internal transitions on the behavior chart editor toolbar or Right click the state and choose Internal transitions from the popup menu The Internal transitions window will appear as shown in Figure 116 123 Internal transitions Model 1 Figure 116 The Internal transitions window 2 Click Transition 4 on the toolbar of the Internal transitions window or Right click anywhere in the Internal transitions window and choose New transition from the popup menu 3 Click anywhere in the Internal transitions window A new transition will be created and displayed as shown in Figure 117 Internal transitions Model S1 Figure 117 New internal transition 4 Edit the properties of the new transition as if it was an ordinary transition 5 When done click OK in the Internal transitions window The state will now be displayed with an arrow inside as shown in Figure 118 indicating that the state has internal transitions 51 Figure 118 State with internal transitions To modify or delete an internal transition 1 Select the corresponding state and click Internal transitions on the behavior chart editor toolbar or 124 Right click the state and choose Internal transitions from the popup menu The Internal transitions window will appear as shown in Figure 116 2 Modify or delete the internal transition as if it was an ordinary transition 3 Click OK in the Internal transi
181. lete a base point from the selected transition HO toggles the grid in the editing area e A opens the Font dialog box to edit the font used by the behavior chart editor e allows the user to print the behavior chart e Je allows the user to save the behavior chart to a file as an image 3 4 14 2 Editing Area The behavior chart editing area allows the user to graphically edit the elements of the behavior chart The editing area can contain the following elements e States e Special states e Transitions The user can create new elements move them around modify their properties resize states modify transition curves and delete any elements except for the mandatory initial state Every element with at least one non empty property is displayed with an associated property label that shows all non empty properties of the element Property labels have links to their respective elements and can be moved around as well 114 When a new hybrid class is created its behavior chart is automatically populated with the mandatory initial state an ordinary state and a transition from the initial state to the ordinary one To select an element 1 Click the element or Right click anywhere in the editing area and choose the element from the Go to submenu of the popup menu The element will appear selected as shown in Figure 94 Figure 94 One element selected To select a group of elements 1 Press the left mouse b
182. lick Open 3 4 CLASS EDITOR The class editor window allows the user to edit the contents of a class including the name parameters variables constants functions procedures local classes behavior chart system of equations and structure diagram see Section 2 2 To open the class editor for a class 1 Double click the class in the Project Manager window or Right click the class in the Project Manager window and choose Edit from the popup menu Class Ideal ED TER i IdealtED t tS Superclass OnePort O Class icon do EqOutdoorLED Parameters lt gt External variables a Opened on Pin v gt 0 1 gt 0 Op Pin V gt 0 I gt 0 amp State variables 1 Current 0 when gt 0 t v Voltage 0 ers A Constants Functions and procedures 3 Comments do EqIndoorLEDa E Local classes Th Hybrid Continuous gt Behavior chart Interface Figure 37 The class editor window The class editor window looks as shown in Figure 37 The class editor window consists of two panels separated by a movable vertical splitter The left panel displays the tree of properties 81 and elements of the class and is called the class editor tree The right panel contains a combination of the following editors e The equation system editor if the class is continuous e The behavior chart editor if the class is hybrid e The structure diagram editor if the class is compo
183. mage is denoted by a checked checkbox The list provides a context menu containing the following items Add Insert Delete Add adds an image to the end of the list Insert inserts an image before the currently selected image Delete deletes the currently selected image Transparency This checkbox enables disables transparency If this checkbox is checked the color of the lower left pixel of every image is rendered as transparent for that image Otherwise all images are rendered opaque 7 8 Diagram The diagram component represents a Diagram window embedded into a 2D Animation window functioning just like a standalone Diagram window For more information see Section 4 2 4 4 2 7 9 Digital Indicator This component provides the following context menu items 4 2 Style Allows to convert the indicator to a component of any other type Value Shows hides the box displaying the associated variable value Font Allows to specify the font used to display the indicator value Color Allows to specify the indicator color Value format Allows to specify the floating point number display format Position Allows to specify the position and size of the component The position is relative to the upper left corner of the 2D Animation window 7 10 Knob This component provides the following context menu items Min Allows to specify the minimum value displayed by the knob Max Allows to specify
184. mand right click that command and choose Insert Breakpoint from the popup menu To add or insert a quit command 1 If you want to add a quit command to the end of the plan right click anywhere in the command list and choose Add Quit from the popup menu Otherwise if you want to insert a quit command before a specific command right click that command and choose Insert Quit from the popup menu 220 To modify an existing assignment pause or message command 1 Double click the command or Right click the command and choose Edit from the popup menu Depending on the command type either the Assignment Pause or Message dialog box will appear 2 Modify the command argument and click OK To delete a command 1 Right click the command and choose Delete from the popup menu A confirmation message box will appear 2 Click Yes 4 2 18 Saving and Restoring the Current Model State The current state of the visual executable model can at any time be saved to or restored from a file By convention model state files are given the extension mst To save the current model state to a file 1 Choose Simulation Save model state from the main menu The Save model state dialog box will appear as shown in Figure 249 Save model status Save in E mymodel gt gu 4 B Imports LD Sim My Recent Documents B Desktop My Documents My Computer Places My Network File name PO A
185. me boundary values on the 3rd and 10th year respectively For each condition you need to specify the point of measurement a specific time T or model termination event and the absolute error of calculation of the event probability Eps To specify the measurement point enter the time value into Point time of gauging column or leave it empty for model termination event For the experiment in whole you need to specify the value of probability Q it defines that found value of event probability differs from its true value at no more than for Eps the minimum and maximum number of test runs The minimum number of tests is necessary for the correct working of statistical laws A series of tests starts with pressing Start button The obtained results are displayed in the bottom of the window the total number of tests and for each condition 1 found the value of event probability p and 2 the probability P that defines that p differs from its true value at no more than at Eps The series of tests is terminated automatically when the ratio P gt Q is satisfied for all conditions For example the results shown in Fig 241a mean that with given parameters of random scatter the probability of a missile to reach the range 2050 2100 meters is 0 25 0 27 with probability 0 95 The experiment can be stopped forcibly by pressing Stop button in this case the probability P does not reach the level of Q Fig 241b
186. merical methods are instructed to take the declared equation blocks see Section 2 5 into account These options are not available in Rand Model Designer Trial and Rand Model Designer Individual 4 2 15 2 7 The Parameters Tab The Parameters tab is not available in Trial n Individual versions The Parameters tab Figure 5 contains the following elements e Initial condition calculation allows using only Newton s method or an only Powell s method or Newton s method and then Powell s method if Newton s method cannot find a solution while matching the initial conditions e Newton s method specifies the residual norm to be used while evaluating the residual accuracy of the Newton s method Euclidean or Cubic coordinate wise convergence is estimated e Apply iteration algorithm to DDASPK allows using the iterative method Krylov method for solving a system of linear algebraic equations when the method DDASPK is applied e u specifies the value of the threshold of leading element in the process of Gaussian elimination for sparse matrices u 1 means that the threshold is not set and the value of the selected item is not controlled e eps specifies the value of the threshold of leading element for serial tasks with the same sparsity portrait e try reordering to block lower triangular matrix 216 Numerical methods xs Tolerance Differential equations Algebraic differential equations Algebraic eq
187. method settings is used The following functors are supported 2 14 1 7 1 integral integral calculates the definite integral of the specified function on the specified interval Example integral x k sin x 0 1 In this example x is the independent variable k sin x is the expression specifying the function to be integrated 0 and 1 are the lower and upper bounds of the integration interval respectively k can be a variable a parameter or any other quantity visible at this point The lower and upper bounds can be infinite for example integral x exp sign x x Infinity Infinity 2 14 1 7 2 maxfun maxfun finds and returns the independent variable value that corresponds to the maximum value of the specified function on the specified interval Example maxfun z z 2 2 1 2 2 14 1 7 3 minfun minfun finds and returns the independent variable value that corresponds to the maximum value of the specified function on the specified interval Example minfun z z 2 2 1 2 54 2 14 1 7 4 root root finds and returns one root of the algebraic equation of the form lt expression gt 0 For example in order to find the root of the equation x 2 2 x 3 0 on the interval 0 10 the root functor can be called as follows root x x 2 2 x 3 0 10 If the specified equation has zero or more than one root at the specified interval an interrupt is raised 2 14 1 8 Special functions for built in model These funct
188. n end Class_1 continuous class Class_2 extends Class_3 is pragma class Class_2 rectangle Top 0 Left 0 Height 0 Width 0 y double 0 equations y M unknown y end Class 2 continuous class Class_3 is pragma class Class_3 rectangle Top 0 Left 0 Height 0 Width 0 equations unknown end Class_3 private continuous class Model is pragma class Model rectangle Top 0 Left 0 Height 0 Width 0 equations unknown F end Model static model Model end al Undeclared identifier x Corect the text and try again Figure 42 The Error window 3 4 3 Parameters The Parameters node of the class editor tree represents the parameters of the class For more on class parameters see Section 2 8 To create a new parameter 1 Right click the Parameters node in the class editor tree and choose New parameter from the popup menu The Parameter dialog box will appear as shown in Figure 43 85 Parameter Identifier Cancel Type double Help Value 0 Comments DAE Group m Figure 43 The Parameter dialog box 2 Type the name of the new parameter in the Identifier field 3 To specify the type of the new parameter click Type The Choose type dialog box will appear Use the Choose type dialog box see Section 3 4 10 to choose the type of the parameter When done click OK in the Choose type dialog box 4 To specify the default value of t
189. n namely from the class The value of an output variable can only be changed from inside the class The value of a contact variable can be changed from both inside and outside the class The values of any two contact variables connected with a link are always equal The value of a flow variable can be changed from both inside and outside the class The sum of values of flow variables connected with links is always equal to 0 A connector variable is a set of one or more components each of which is equivalent to an individual external variable and can in its turn be of any category see Section 2 13 4 Connector variables are useful for modeling physical systems of various kinds including electric circuits The type of a variable specifies the set of values that can be stored in that variable see Section 2 13 A contact or flow variable can only be of type double see Section 2 13 1 1 A connector 36 variable can only be of a connector type see Section 2 13 4 Any other variable can be of any available type except for connector types The default initial value of a variable is specified by an expression see Section 2 15 that may reference other variables of the class however such references are not allowed to form cycles A variable has some value in each instance of the class A variable is assigned its initial value upon creation of the corresponding instance After that the variable value can change in response to explicit a
190. n parameter m normal m d generates a random number from the normal distribution with mean parameter m and variance parameter d uniform xmin xmax generates a random number from the uniform distribution on the interval xmin xmax A few functions for generating the random numbers are defined in the package Statistics Statistics betarnd p double q double returns the next value of a random variable corresponding to the beta distribution with parameters p and q A similar function Statistics vbetarnd returns a vector value Statistics normrnd m double sigma double returns the next value of a random variable normally distributed with mean m and standard deviation sigma A similar function Statistics vnormrnd returns a vector value Statistics triangular a double b double m double returns the next value of a random variable distributed according to a triangular distribution with the minimum value of a the maximum value of b and the value of expectation of m Statistics unifrnd a double b double returns the next value of a random variable uniformly distributed on the interval a b A similar function Statistics vunifrnd returns a vector value The implementation of these functions differs from the implementation of function uniform 51 2 14 1 5 Special Functions and Procedures 52 BreakDiagrams inserts a break into all time and phase diagrams opened in the visual executable model cau
191. n for the value of the constant When done click OK in the Text Editor window If necessary type the comments for the constant in the Comments field If you want to assign the new constant to one or more groups click LJ The Groups dialog box will appear Use the Groups dialog box see Section 3 4 11 to assign the constant to one or more groups When done click Apply in the Groups dialog box 10 Click OK in the Constant dialog box To modify a constant using the Constant dialog box 1 Double click the constant in the Project Manager window or Right click the constant in the Project Manager window and choose Edit from the popup menu The Constant dialog box will appear as shown in Figure 31 2 Use the Constant dialog box to modify the constant When done click OK To modify a constant in place in the Project Manager window 1 78 Click the constant in the Project Manager window After a short while click the constant again An in place editing field will appear as shown in Figure 35 Project constants A double 9 8 E Project procedures and functions Figure 35 Editing a constant in place 2 Modify the constant definition in place 3 Hit Enter or click anywhere in the Project Manager window 3 3 4 Global variables To create a new global variable 1 Right click the Global variables node in the Project Manager window and choose the New global variable from the pop
192. nts with the executable model e 2D and 3D animation e Support for creation and re use of libraries of model components e Generation of the executable model as either a standalone Windows application or a dynamic link library 1 2 HOW RAND MODEL DESIGNER WORKS The user starts using Rand Model Designer by opening the integrated modeling environment The integrated modeling environment is a Windows application that looks as shown in Figure 1 Rand Model Designer 6 unregistered C My Documents model model myb Project Edit Tools View Model Window Help Deng tiaro MIR B z il Classes Model description B x faa Class_1 Model a id g noj B E Class_2 Parameters iz Lath z E Model Variables E Types E Constants Gi Project constants IA Functions and procedures Class_1_1 Class_2_1 Project procedures ar Comments Imported packages jas Local classes SysLib Ba Hybrid Continuous H Local objects Class Class 1 ig Class_1 Continuous behavior Parameters x y lt gt External variables y x xi double 1 Unknown variables State variables xy amp y double 0 E Constants A Functions and procedures Comments Class Class_2 Parameters lt gt External variables gt In_1 double 0 gt In_2 double 0 lt 2 Out_3 double 0 State variables z Yy E Constants eo
193. nu A confirmation message box will appear 3 Click Yes 4 Click OK in the Diagram parameters dialog box The Diagram window plots double integer short and byte values according to common plotting conventions Different plots can either share a single y axis or each use its own y axis range and scale as shown in Figure 185 Figure 185 Different plots each using its own y axis range and scale 168 Enumeration values are plotted so that each enumeration literal is assigned a value which is one grid step greater than the adjacent lower value and one grid step less than the adjacent upper value see Figure 186 for example A Time diagram model x 910 11 12 13 14 15 Figure 186 An enumeration variable plotted in the Diagram window Signal variables are plotted so that each signal occurrence is denoted by a vertical stroke as shown in Figure 187 9 10 11 12 13 14 Figure 187 A signal variable plotted in the Diagram window Every new Diagram window is configured to display a time diagram If there is more than one variable on a time diagram the diagram can at any time be converted to a phase diagram and back using the Diagram parameters dialog box For more information see Section 4 2 4 1 The contents of a Diagram window can at any time be cleared printed or saved to an image or text file To clear a Diagram window 1 Right click anywhere in the Diagram window and choose Clear from the popup men
194. nu items Min Allows to specify the minimum value displayed by the indicator Max Allows to specify the maximum value displayed by the indicator Style Allows to convert the indicator to a component of any other type Value Shows hides the box displaying the associated variable value Value format Allows to specify the floating point number display format Show scale Shows hides the scale labels Auto scaling Toggles automatic scaling Color min Allows to choose the color that corresponds to the minimum value 185 e Color max Allows to choose the color that corresponds to the maximum value e Position Allows to specify the position and size of the component The position is relative to the upper left corner of the 2D Animation window 4 2 7 7 Sprite The sprite component represents a rectangular area that can move around the animation and display one of the pre configured images Every sprite can have up to three variables associates with it The x coordinate of the sprite can be associated with one variable The y coordinate of the sprite can be associated with another variable The index of the currently displayed image can be associated with the third variable To associate a variable with a sprite 1 Drag the variable from a Variables or Structure window and drop it onto the sprite in the 2D Animation window The Use Variable As dialog box will appear as shown in Figure 213 Use vari
195. object and choose Rename from the popup menu An in place editing field will appear as shown in Figure 128 Figure 128 Renaming a local object 2 Modify the local object name 3 Hit Enter or click anywhere in the editing area 130 To edit the comments of a local object 1 Right click the local object and choose Edit comments from the popup menu An in place editing field will appear as shown in Figure 129 Figure 129 Editing the comments of a local object 2 Modify the local object comments 3 Click OK To edit the actual parameter values and initial variable values of a local object 1 Right click the local object and choose Actual values of parameters and variables from the popup menu The Actual values dialog box will appear as shown in Figure 130 Actual values Class_2_1 4 P 1 0 4 P_2 0 Hs Initial values for variables 4 Int 0 Out1 0 4 i 1 0 Figure 130 The Actual values dialog box 2 To modify the actual value of a parameter or the initial value of a variable double click the corresponding item in the Actual values dialog box or right click the corresponding item in the Actual values dialog box and choose New value from the popup menu A value editing dialog box as shown in Figure 131 will appear Type of expression is Double Apply Figure 131 Value editing dialog box 3 Type the expression for the actual parameter value or initial variable value When done click Ap
196. of the new local class and click OK This will create a new hybrid local class with the same behavior chart as the current one and erase the current behavior chart 3 4 14 2 1 States For more on states see Section 2 4 1 To create a new state 1 Click State on the behavior chart editor toolbar A new state will appear on the behavior chart as shown in Figure 98 Figure 98 New state To resize a state 1 Select the state 2 Drag any border of the state in the desired direction 116 To rename a state 1 Double click the name of the state or Right click the state and choose Rename from the popup menu An in place editing field will appear as shown in Figure 99 a Figure 99 Renaming a state 2 Modify the state name 3 Hit Enter or click anywhere in the editing area To edit the entry actions of a state 1 Select the state and click Entry actions on the behavior chart editor toolbar or Right click the state and choose Entry actions from the popup menu The Text Editor window will appear as shown in Figure 100 ie Entry actions for S1 Figure 100 Editing the entry actions of a state 2 Use the Text Editor window see Section 3 4 12 to specify the entry actions of the state 3 Click OK in the Text Editor window If the entry actions are not empty they will appear in the property label of the state as shown in Figure 101 trr ettirir twee etme Figure 101 State with ent
197. om the main menu To quit the integrated modeling environment 1 Choose Project Exit from the main menu 2 Ifthe currently open project contains unsaved changes a confirmation message box will appear If you want to save the changes click Yes Otherwise click No 152 CHAPTER 4 Executable Model This chapter describes the categories and capabilities of executable models An executable model is a program that is automatically created by Rand Model Designer from a project Every executable model consists of the Rand Model Designer runtime and an instance of the Model class defined in the project 4 1 EXECUTABLE MODEL CATEGORIES Rand Model Designer can create executable models of two types visual and embeddable The visual executable model is a Windows GUI application that can be run either from the integrated modeling environment or standalone The visual executable model is usually used to debug and demonstrate model behavior In addition to the minimal Rand Model Designer runtime the visual executable model includes the GUI front end that allows the user to e Create time and phase diagrams e Create interactive 2D and 3D animations e Animate behavior charts e Debug the model using breakpoints The visual executable model is discussed in Section 4 2 The embeddable executable model is a Windows DLL that does not include any visualization capabilities The embeddable executable model is intended for inclusion in other a
198. on of integer numbers Example 107 div 5 mod calculation of the remainder of division of one integer number by another Example 7 mod 5 x raising a number to the power of another number applicable to integer and floating point numbers Examples Dat RS 2 KAD equality relation applicable to integer numbers floating point numbers matrices vectors characters strings boolean values and enumeration values Examples 2 2 1 2 3y 4 1 2 3 4 Ta q 1 inequality relation applicable to integer numbers floating point numbers matrices vectors characters strings boolean values and enumeration values Examples 2 2 1 2 35 4 De T3 9 2 q l qg gt greater than relation applicable to integer numbers floating point numbers and enumeration values Examples 7 gt 2 224 gt 138 lt less than relation applicable to integer numbers floating point numbers and enumeration values Examples 7 lt 2 2 4 lt 1 8 gt greater than or equal to relation applicable to integer numbers floating point numbers and enumeration values Examples 7 gt 7 Pi gt 3 1 lt less than or equal to relation applicable to integer numbers floating point numbers and enumeration values Examples 7 lt 7 Pi s 341 and logical and for boolean values bitwise and fo
199. onding series are input output parameters lt parameter_name gt is a parameter name unique across all parameters of the function or procedure lt parameter_type gt is the type of a series of parameters This can be any available type see Section 2 13 e lt return_value_type gt is the type of the return value of the function This can be any available type see Section 2 13 e lt identifier gt is an identifier see Section 6 2 e lt path_to_d11 gt is the path to the DLL containing the implementation of the function or procedure If the path is relative it is assumed to be relative to the TMP folder of the executable model e lt dll_function_name gt is the name of the DLL function implementing the function or procedure If omitted it is assumed to be equal to the name of the external function lt function_name gt or procedure lt procedure_name gt The DLL function implementing an external function or procedure must be exported from the DLL and must use the stdcall calling convention The parameters of the DLL function must correspond to the parameters specified in the definition of the external function or procedure out and in out parameters are passed by address Vectors matrices arrays and records are passed to DLL functions as variants and always by address Vectors and matrices are passed as two dimensional 1 N 1 M variant arrays with elements of type double in case of vectors M equals 1 Example
200. onent from the Standard 2D components panel and drop it onto the 2D Animation window ate To associate a component with a variable 1 Drag the variable from a Variables or Structure window and drop it onto the component in the 2D Animation window ae e To move a component 1 Drag the component in the desired direction To resize a component 1 Drag any border of the component in the desired direction ate To delete a component from a 2D Animation window 1 Right click the component and choose Close from the popup menu ae To set or change the background image of a 2D Animation window 1 Right click anywhere in the 2D Animation window and choose Background from the popup menu The Open dialog box will appear 2 Select the file you want to use as a background and click Open ae gt To clear the background 1 Right click anywhere in the 2D Animation window and choose Clear background from the popup menu 183 To modify the window title 1 Right click anywhere in the 2D Animation window and choose Window caption from the popup menu The Edit window caption dialog box will appear as shown in Figure 211 Edit window caption Figure 211 The Edit window caption dialog box 2 Type the new window title 3 Click OK To add a text label 1 Right click where you want to place a text label and choose New label from the popup menu The Enter
201. onent_symbol gt Ele Examples 2 13 1 2 byte short integer The byte short and integer types represent integer numbers The byte type represents an 8 bit unsigned integer number ranging from 0 to 255 The short type represents a 16 bit signed integer number ranging from 32768 to 32767 The integer type represents a 32 bit signed integer number ranging from 2147483648 to 2147483647 The operations defined for the byte short and integer types are see also Section 2 15 1 e addition e subtraction e x multiplication e div integer division e mod remainder calculation modulo operator e xx raising a number to the power of another number e or bitwise or e and bitwise and e not bitwise not e equality relation e inequality relation e gt greater than relation e gt greater than or equal to relation e lt less than relation 40 e lt less than or equal to relation byte short and integer literals have the following syntax lt integer_literal gt lt sign gt lt digits gt lt sign gt lt digits gt lt digit gt lt digit gt lt digit gt 0 1 2 3 4 5 6 7 8 9 Examples 134 4567 The System package defines distinguishable type TColor type of TColor is integer To set the initial value for a variable of type System TColor the specific
202. onstraints lt constraint gt lt constraint gt lt direction gt minimize maximize lt variable_specification gt lt variable_name gt in lt range gt lt range gt lt lower_bound gt lt upper_bound gt lt constraint gt lt double_expression gt lt lt double_expression gt lt double_expression gt gt lt double_expression gt lt double_expression gt lt double_expression gt All variables listed after the for keyword the optimization variables must be of type double All expressions used in an optimization operator must evaluate to double Every optimization variable can be assigned an individual range of feasible values Arbitrary non linear constraints can be specified as well Using the current values of optimization variables as the initial estimate the optimization operator optimizes the specified expression When the optimum is found the operator assigns the found values back to the respective variables The numerical methods used by the optimization operator can be configured separately Examples maximize x 2 y 2 for x in 0 Infinity y in 0 Infinity constraints y lt 3 x y gt X lj minimize x 2 y 2 for x in 1 3 y in 1 2 minimize x 1 2 y 2 2 for x y x y z yy gt min xe 1 1 z 00 0 66 2 16 10 Submodel execution operator Submodel execution operator conducts a computational experiment with the object speci
203. ontains the following elements e Continuous model time Pause every If this checkbox is checked the model will stop every N continuous model time units where N is specified in the field next to the checkbox e Continuous model time Pause at If this checkbox is checked the model will stop at the continuous model time moment specified in the field next to the checkbox e Discrete model time Pause every If this checkbox is checked the model will stop every N discrete model time units where N is specified in the field next to the checkbox e Discrete model time Pause at If this checkbox is checked the model will stop at the discrete model time moment specified in the field next to the checkbox 203 4 2 14 2 The States Tab Breakpoint conditions Predicates Transitions States Time Figure 228 The States tab The States tab see Figure 228 allows the user to specify the states that when entered cause the model to stop The tab shows the states in a list Every state has a checkbox next to it If a checkbox is checked the model will stop every time the corresponding state is entered The list can be populated by dragging and dropping states from Behavior Chart windows To add a state 1 Drag the state from the corresponding Behavior Chart window and drop it onto the list in the States tab To remove a state 1 Right click the state in the list and choose Delete from the p
204. opup menu A confirmation message box will appear 2 Click Yes 4 2 14 3 The Transitions Tab Breakpoint conditions Predicates Transitions states Time Any transition Vi model T_16973826 51 gt 52 obj T_17694722 51 gt 52 Close obj T_17694722 51 gt 52 Continue Stop Figure 229 The Transitions tab The Transitions tab see Figure 229 allows the user to specify the transitions that when executed cause the model to stop The tab shows the transitions in a list Every transition has a checkbox next to it If a checkbox is checked the model will stop every time the corresponding transition is executed The list can be populated by dragging and dropping transitions from Behavior Chart windows 204 The additional Any transition checkbox when checked causes the model to stop on any transition in any behavior chart To add a transition 1 Drag the transition from the corresponding Behavior Chart window and drop it onto the list in the Transitions tab To remove a transition 1 Right click the transition in the list and choose Delete from the popup menu A confirmation message box will appear 2 Click Yes 4 2 14 4 The Predicates Tab Breakpoint conditions Predicates Transitions States Time Figure 230 The Predicates tab The Predicates tab see Figure 230 allows the user to specify one or more boolean conditions also known as predicates t
205. or chart a state with a continuous activity is shown with a thick border as in Figure 4 A state with a hybrid activity is shown with a double border as in Figure 5 do lt continuous activity gt onesie Siete e a atoere ae Figure 4 Continuous activity state 17 do lt hybrid activity gt Figure 5 Hybrid activity state A state may have no associated activity in which case no activity is executed while the state remains current In the case if the state activity is discrete or hybrid object with the final state it may be performed in the orthogonal time see Section 2 4 8 To do this you need to mark the item Orthogonal time of the context menu While performing activity in the orthogonal time the time of main model will not change 2 4 1 2 Activity composition Sometimes it is convenient to assign both hybrid and continuous activity to the state In this case in all states of the hybrid activity the continuous activity will also be carried out The state with the composition of activities is depicted by thick broken line as shown in Figure do lt rn6p geat gt lt Henp geat 2 4 2 Transition A transition is shown as an arrow starting at the border of one state called the source state and terminating at the border of another or possibly the same state called the target state see Figure 6 when lt condition gt or when lt signal variable name gt or after lt timeout gt guard lt guard gt
206. or text Find next finds the next occurrence of the string entered in the Find dialog box 3 4 13 Equation System Editor The equation system editor allows the user to edit the system of equations of a class For more on the system of equations see Section 2 5 Continuous behavior x y x 2 phi theta phittheta 1 2 2 Unknown variables phi x 2 Initial values for derivatives 2z 0 Equations Figure 81 Equation system editor The equation system editor looks as shown in Figure 81 The equations system editor allows the user to e Edit the equations participating in the system e Edit the declarations of known and unknown variables e Specify the initial values of the first derivatives for those variables whose second derivatives participate in the equations 107 To edit the equations participating in the system 1 108 Double click the Continuous behavior node or any of its sub nodes in the equation system editor or Right click the Continuous behavior node or any of its sub nodes in the equation system editor and choose Edit from the popup menu The Text Editor window will appear as shown in Figure 82 i Equation editor Class_1 Figure 82 Editing equations in the Text Editor window Use the Text Editor window see Section 3 4 12 to edit the equations of the system The result can look for example as shown in Figure 83 In the Text Editor window
207. or the initial value of a variable double click the corresponding item in the Actual values dialog box or right click the corresponding item in the Actual values dialog box and choose New value from the popup menu A value editing dialog box as shown in Figure 64 will appear Type of expression is Double Apply Figure 64 Value editing dialog box Type the expression for the actual parameter value or initial variable value When done click Apply The Actual values dialog box will display the modified parameter or variable with the sign To restore the actual value of a parameter or the initial value of a variable to the default value right click the corresponding item in the Actual values dialog box and choose Restore default value from the popup menu 5 Finally click Apply in the Actual values dialog box 3 4 9 Comments The Comments node of the class editor tree allows the user to specify the class comments To modify the class comments 1 96 Double click the Comments node in the class editor tree or Right click the Comments node in the class editor tree and choose Edit from the popup menu The Text Editor window will appear as shown in Figure 65 Class comments Class_1 Figure 65 Editing the class comments in the Text Editor window 2 Edit the comments in the Text Editor window 3 Click OK 3 4 9 1 Deleting Class Elements All class elements created by the user can be delet
208. ow will appear as shown in Figure 174 162 a model structure Thermostat Heater Subtractor Relay Figure 174 Opening the Structure window of a compound local object If a local object is hybrid its Behavior Chart window can be opened as follows To open the Behavior Chart window of a hybrid local object 1 Right click the local object and choose Behavior chart from the popup menu The object s Behavior Chart window will appear as shown in Figure 175 a model structure Thermostat Heater Figure 175 Opening the Behavior Chart window of a hybrid local object If a local object has parameters or variables its Variables window can be opened as follows To open the Variables window of a local object 1 Right click the local object and choose Variables from the popup menu The object s Variables window will appear as shown in Figure 176 163 a model structure Thermostat Heater 9 2 1 151515 Figure 176 Opening the Variables window of a local object The value of any external variable visible in a Structure window can be modified directly from the Structure window To modify the value of an external variable 1 Right click the variable and choose New value from the popup menu The New Value dialog box will appear as shown in Figure 177 Thermostat Out_1 Figure 177 The New Value dialog box 2 Type the new value for the variable 3 Click OK
209. ows the user to configure the model to stop when a certain condition is satisfied The supported condition types allow to stop the model e Every N units of continuous or discrete time e Ata given continuous or discrete time moment e When a specific behavior chart state is entered e When a specific or any behavior chart transition is executed e When a given conditional expression predicate becomes true To open the Breakpoint conditions dialog box 1 Click Breakpoint conditions on the main toolbar or Choose Service Breakpoint conditions from the main menu The Breakpoint conditions dialog box will appear as shown in Figure 227 Breakpoint conditions Continuous model time IV Pause every Pause at Discrete model time Pause every Pause at Figure 227 The Breakpoint conditions dialog box the Time tab The Breakpoint conditions dialog box consists of the following tabs Predicates Transitions States and Time These tabs are described in the subsections that follow The dialog box also contains the following buttons Apply Close Continue and Stop The Apply button applies the changes made in the Breakpoint conditions dialog box The Close button closes the Breakpoint conditions dialog box The Continue button runs the model The Stop button stops the model For more information on model states and execution commands see Section 4 2 16 4 2 14 1 The Time Tab The Time tab see Figure 227 c
210. pData pointer TRetCode Loads the state of the specified model instance from the specified buffer The hModel parameter identifies the model instance The pData parameter points to the buffer The size parameter specifies the buffer size 235 4 4 4 Model Execution Functions 236 function runToEx hModel TModelHandle Tau double TRetCode Runs the specified model instance for the specified amount of continuous model time The hMode1 parameter identifies the model instance The Tau parameter specifies the amount of model time in model time units The function returns only after all necessary computations are completed and all variables are updated accordingly Upon return from this function the model instance is guaranteed to be in the stopped state function RunTo Tau double TRetCode Runs the default model instance for the specified amount of continuous model time A call to this function is equivalent to runToEx 0 Tau function RunThreadTo Tau double var hThread THandle TRetCode Runs the default model instance for the specified amount of continuous model time in a separate thread Creates a separate thread that calls RunTo Tau and returns immediately The hThread parameter receives a handle to the created thread on success or 0 otherwise The caller can detect the moment when the model stops by calling the Stopped function periodically or handling the message configured using the SetEndMessage function
211. pecified by either the behavior chart or the system of equations The behavior chart is described in Section 2 4 The system of equations is discussed in Section 2 5 The structure diagram defines the internal structures and the interface of the class The structure diagram is discussed in Section 2 7 A class can have an arbitrary number of parameters and variables Parameters are discussed in Section 2 8 Variables are discussed in Section 2 9 Like a project a class can contain an arbitrary number of constants functions and procedures Constants are discussed in Section 2 10 Functions and procedures are discussed in Section 2 14 2 The constants functions and procedures of a class differ from the constants functions and procedures of a project in their scope see Section 2 17 The constants functions and procedures of a project are visible in the entire project Moreover the public constants functions and procedures of a project are visible in all other projects that import their containing project The constants functions and procedures of a class are only visible within their containing class A class can contain an arbitrary number of local classes Local classes are used to associate behavior with states of the behavior chart Local classes are discussed in Section 2 11 15 If a class has a base class it inherits all characteristics of the base class Class inheritance is discussed in Section 2 12 A class can be declar
212. pical computing experiment gt Optimization In the dialog box see Figure 245 you need to specify the list of optimization parameters objective function and the constraints if they exist To add an optimization parameter use your mouse to drag the desired one from the window of variables and drop it down to Parameter table To remove a parameter right click Parameter table and apply the appropriate command of pop up menu For each parameter you need to specify its minimum and maximum values 232 Optimization Oeae O OOOO O OO O poeg 3 V C C Minimize Maximize gt Start Number of tests 13 Objective function 27 434309 Figure 12 Optimization Window To set the target function enter the desired expression into Objective function cell If you use the mouse to drag a variable from variables window and drop it down on the Objective function cell the name of this variable is added to the end of the line For Objective function you need to specify the point of measuring a specific time T or model termination event enter the time value into Point time of gauging column or leave it empty for model termination To add a constraint right click the Constraints table and use Add command of the pop up menu In the line appeared enter constraint in the form of equality or inequality where the optimization parameters can be used only To remove the constraints use Delete command of the pop up menu
213. ply The Actual values dialog box will display the modified parameter or variable with the sign 131 4 Torestore the actual value of a parameter or the initial value of a variable to the default value right click the corresponding item in the Actual values dialog box and choose Restore default value from the popup menu 5 Finally click Apply in the Actual values dialog box To change the actual values of parameters for the group of object 1 Select a group of local objects right click it and choose the command Actual values of parameters and variables in pop up menu If objects are the instances of different classes it will be available for editing a set of parameters and variables of their nearest common superclass For example if the selected group contains instances of classes C2 C3 C4 and there is an inheritance relationship between them CO gt C1 C1 gt C2 C2 gt C3 C0 gt C4 there will be available for editing the initial values of parameters and variables in the amount of class CO Edited values are assigned to all objects in the group e To align the position or size of the group of objects 1 Select the group of objects 2 Right click the group and move the cursor to the command Alignment of a pop up menu then select the desired sub menu to the left on the upper edge etc and click appropriate command e To copy object to clipboard 1 Select the object right click it to open the context menu sel
214. ponds to the i th eigenvalue in w eye n returns an n by n square matrix with ones on the diagonal and zeros elsewhere inv x returns the inverse of the square matrix x 49 50 matrixfromfile fp loads a matrix from a text file fp specifies the path to the file If fp is a relative path it is assumed to be relative to the project folder The first line of the file is assumed to contain column names and therefore is ignored If different lines of the file have different number of elements the number of columns will be equal to the maximum number of elements and all unspecified elements will be set to 0 matrixtofile x fp stores the matrix or vector x as a table into a text file fp specifies the path to the file If fp is a relative path it is assumed to be relative to the project folder max x returns the largest element of x where x is either a vector or matrix mean x returns the mean value among all elements of x where x is either a vector or matrix min x returns the smallest element of x where x is either a vector or matrix norm1 x returns the 1 norm of the matrix x normE x returns the Euclidean norm of the matrix x normInf x returns the infinity norm of the matrix x normspectr x returns the spectral norm 2 norm of the matrix x norm_m x returns the M norm of the matrix x ones n returns a vector of size n filled with ones
215. pplications that can support their own visualization The embeddable executable model is discussed in Section 4 4 4 2 VISUAL EXECUTABLE MODEL When the user starts the visual executable model see Section 3 7 the model s main window appears as shown in Figure 160 Rand Model Designer Visual Model DARJ Settings Simulation Service Window Help 0 000 Oo fF Figure 160 Visual executable model main window The main window consists of the main menu main toolbar and working area The main menu provides access to most of the functions of the model The main toolbar displays the current continuous and discrete model time and provides shortcuts to some of the most commonly 154 used items of the main menu The working area is where all other windows of the visual executable model are opened Depending on the model the working area of a newly started model may initially contain some of the following windows e A Variables window displaying all parameters and variables of the model object e A Diagram window displaying the time diagram of all variables of the model object e A Behavior Chart window displaying the behavior chart of the model object e A Structure window displaying the structure diagram of the model object In addition to these default windows the user can manually open more Variables Diagram Histogram Behavior Chart Structure 2D Animation and 3D Animation windows 4 2 1 The Variables Window
216. procedure gt procedure lt procedure_name gt lt formal_parameters gt lt local_variables gt begin lt operator_sequence gt end lt procedure_name gt lt function_name gt lt identifier gt lt procedure_name gt lt identifier gt lt formal_parameters gt lt parameter_series gt lt parameter_series gt lt parameter_series gt lt parameter_category gt lt parameter_name gt lt parameter_name gt lt parameter_type gt lt parameter_category gt in out in out lt parameter_name gt lt identifier gt lt parameter_type gt lt identifier gt lt return_value_type gt lt identifier gt lt local_variables gt lt variable_series gt lt variable_series gt lt variable_ name gt lt variable_ name gt lt variable_type gt lt expression gt lt variable_ name gt lt identifier gt lt variable_type gt lt identifier gt lt operator_sequence gt lt operator gt Where 56 is lt function_name gt is the function name unique across all functions and procedures of the containing class or project lt procedure_name gt is the procedure name unique across all functions and procedures of the containing class or project lt formal_parameters gt is the definition of the formal parameters of the function or procedure lt parameter_series gt is a series of formal parameters All
217. psGenerator CStepsGenerator yee Figure 274 CStepsGenerator Class name CStepsGenerator Parameters Values vector 0 1 the sequence of output values Delays vector 1 2 the sequence of time intervals Input variables none Output variables Y double Values 1 Function This block outputs a periodic sequence of constant signal levels The block keeps its output at Values 1 for the amount of time Delays 1 then at Values 2 for the amount of time Delays 2 and so on until the last element and then restarts from the beginning 5 3 6 CClock Figure 275 CClock Class name CClock Parameters none Input variables none Output variables T double Time Function This block outputs the current model time that is implements the function T Time 254 CHAPTER 6 Appendices This chapter contains appendices to the User Manual 6 1 EXTENDED BACKUS NAUR FORM The Extended Backus Naur Form EBNF is a formal notation used to describe the syntax of context free grammars The EBNF specifies a grammar as a finite set of production rules that define how all legal sentences of the grammar can be generated Production rules have the following form lt non_terminal_symbol gt ebnf_expression where lt non_terminal_symbo1 gt is a non terminal symbol and ebnf_expression is an expression consisting of non terminal symbols terminal symbols and special operations Terminal symbols are fixed char
218. r Class name CSineGenerator Parameters Amplitude double 1 the amplitude of the signal Period double 2 the period of the signal InitialPhase double 0 the phase shift in radians Input variables none 251 Output variables Y double Amplitude sin InitialPhase Function who This block implements the function Y Amplitude sin IntalPhase erio 5 3 3 CSawtoothGenerator CSawtoothGenerator mM b Figure 270 CSawtoothGenerator Class name CSawtoothGenerator Parameters UpperLevel double 1 the upper bound LowerLevel double 0 the lower bound Period double 1 the period of the signal Input variables none Output variables Y double LowerLevel Function This block implements the function shown in Figure 271 7 Upperevel LowerLevel Period t Figure 271 CSawtoothGenerator function 252 5 3 4 CPulseGenerator CPulseGenerator mM p Figure 272 CPulseGenerator Class name CPulseGenerator Parameters Amplitude double 1 the pulse amplitude Period double 2 the pulse period PulseWidth double Period 2 the pulse width in model time units YO double 0 the average value of the output Input variables none Output variables Y double YO Function This block generates the output as shown in Figure 273 Y PulseWidth Amplitude Period Figure 273 CPulseGenerator function 253 5 3 5 CSte
219. r Class name CInterpolator Parameters FX vector 0 1 the vector of argument values FY vector 0 1 the vector of function values tabulated for FX Input variables X double 0 Output variables Y double 0 Function This block generates its output by interpolating the function whose values FY are tabulated for points Fx using the block input as the function argument The block raises an error if the input goes outside the interval spanned by FX Note The FX and Fy vectors can be loaded from file s using the VectorFromFile function for example static Int SysLib CInterpolator FX VectorFromFile funl txt X FY VectorFromFile funl txt Y 5 3 SIGNAL SOURCES GENERATORS 5 3 1 CRampGenerator CRampGenerator ial Figure 267 CRampGenerator Class name CRampGenerator 250 Parameters InitialOutput double 0 the initial value of the signal UpperLimit double 100 the maximum value of the generated signal Slope double 1 the rate of change of the generated signal StartTime double 0 the time at which the signal begins to be generated Input variables none Output variables Y double InitialOutput Function This block implements the function shown in Figure 268 Y ___Upperkinit Initial utput StartT ime t Figure 268 CRampGenerator function 5 3 2 CSineGenerator CSineGenerator An Figure 269 CSineGenerato
220. r gt is a single operator of the Rand Model Designer programming language see Section 2 16 lt identifier gt is an identifier see Section 6 2 Examples function xlim x a double return double is z double abs x begin if z gt a then return a sign z else return xX end if end xlim This function limits the absolute value of the input parameter x by the value of the input parameter a The local variable z is introduced primarily for demonstration purposes procedure setup is begin for i in 1 10 loop a i i 2 end loop end setup This procedure fills the vector a which is supposed to be visible at this point 57 2 14 2 2 External Functions and Procedures An external function or procedure is a subroutine implemented outside Rand Model Designer with the use of third party tools such as Visual C Delphi Fortran etc The definition of an external function or procedure within a class or project provides only the specification of the function or procedure The corresponding implementation must reside in a DLL dynamic link library loadable by the executable model The definition of an external function or procedure within a class or project has the following syntax lt external_function gt function lt function_name gt lt formal_parameters gt return lt return_value_type gt is external lt path_to_dll gt name lt dll_function_name gt j lt external_procedure gt procedu
221. r integer numbers Examples false and true 12 and 13 e or logical or for boolean values bitwise or for integer numbers Examples false or true 12 or 13 e not logical not for boolean values bitwise not for integer numbers Examples not true not 13 e Conditional selection operation which has the following syntax lt conditional_selection gt if lt selector_expression gt then lt expression_if_true gt else lt expression_if_false gt The conditional selection operation works as follows First lt selector_expression gt is evaluated If the result is true lt expression_if_true gt is evaluated Otherwise lt expression_if_false gt is evaluated The result of the operation is the result of whichever expression is evaluated last lt expression_if_true gt or lt expression_if_false gt Example if a gt 0 then 1 els 1 2 15 2 Evaluation Order The order of evaluation of any individual operation is determined by the operation The order of evaluation of an expression involving more than one operation is determined by the precedence of operations the order of operations in the expression and the presence or absence of parentheses The precedence of operations decreases in the following order e conditional selection e aK not e 77 div mod and e r r or yp _ EA SE EA meet Hs In the absence of par
222. rated value dialog box If the type of the variable is a record or connector use the Component Editor window see Section 3 4 17 to specify the default initial value of the variable When done click Apply in the Component Editor window If the type of the variable is any other type use the Text Editor window see Section 3 4 12 to specify the expression for the default initial value of the variable When done click OK in the Text Editor window If necessary type the comments for the variable in the Comments field If you want to assign the new variable to one or more groups click LJ The Groups dialog box will appear Use the Groups dialog box see Section 3 4 11 to assign the variable to one or more groups When done click Apply in the Groups dialog box Click OK in the External variable dialog box To modify a variable using the Internal variable or External variable dialog box 1 2 Double click the variable in the class editor tree or Right click the variable in the class editor tree and choose Edit from the popup menu The Internal variable or External variable dialog box will appear as shown in Figure 48 or Figure 52 respectively Use the appeared dialog box to modify the variable When done click OK 91 To modify a variable in place in the class editor tree 1 Click the variable in the class editor tree After a short while click the variable again An in place editing field will
223. ration 100 1 Click the Enumerated tab The Choose type dialog box will look as shown in Figure 71 Choose type Standard Vector Matrix Declared Literals Figure 71 The Choose type dialog box the Enumerated tab 2 To add a literal to the enumeration click Add The Enter the enumerated literal dialog box will appear as shown in Figure 72 Enter the enumerated literal Identifier Figure 72 The Enter the enumerated literal dialog box 3 Type the literal in the Identifier field and click OK 4 Repeat the last two steps to add more literals to the enumeration 5 Click OK in the Choose type dialog box To specify a declared type 1 Click the Declared tab The Choose type dialog box will look as shown in Figure 73 101 Choose type Standard Vector Matrix Signal Enumerated Imported packages This project L Type_1 L Type_2 Type definition Figure 73 The Choose type dialog box the Declared tab 2 Select the required type and click OK When editing the type for which a declared type acts as a synonym two additional categories of types become available record types and connecter types To specify a record type 1 Click the Record tab The Choose type dialog box will look as shown in Figure 74 Choose type Components Type definition record Figure 74 The Choose type dialog box the Record
224. re lt procedure_name gt lt formal_parameters gt external lt path_to_dll gt name lt dll_function_name gt j lt function_name gt lt identifier gt lt procedure_name gt lt identifier gt lt formal_parameters gt lt parameter_series gt lt parameter_series gt lt parameter_series gt lt parameter_category gt lt parameter_name gt lt parameter_name gt lt parameter_type gt lt parameter_category gt in out in out lt parameter_name gt lt identifier gt lt parameter_type gt lt identifier gt lt return_value_type gt lt identifier gt Where 58 lt function_name gt is the function name unique across all functions and procedures of the containing class or project lt procedure_name gt is the procedure name unique across all functions and procedures of the containing class or project lt formal_parameters gt is the definition of the formal parameters of the function or procedure lt parameter_series gt is a series of formal parameters All parameters within a series have the same category and type lt parameter_category gt is a parameter category with the following possible values in out and in out in the default indicates that the parameters of the corresponding series are input parameters out indicates that the parameters of the corresponding series are output parameters in out indicates that the parameters of the corresp
225. refresh their contents only when discrete events occur in the model e Show data exchange over links If this checkbox is checked links are highlighted in Structure windows when the variables they connect change during model execution 209 4 2 15 1 3 The Files Tab Model settings Run view Fies Application Help Read input data from file input data Fes Write output data to file output data fe F Trace model execution i F Figure 237 The Files tab The Files tab see Figure 237 contains the following elements e Application Help This field specifies the path to the help h1p file associated with the model e Read input data from file If this checkbox is checked the model upon startup loads parameter values and initial variable values from the text file specified in the next field ignoring parameter values and initial variable values specified elsewhere e Write output data to file If this checkbox is checked the model upon termination saves all parameter values and initial variable values to the text file specified in the next field e Trace model execution This checkbox enables disables model execution tracing When model execution tracing is enabled the model logs detailed information about its execution to the trace txt file e Trace numerical methods This checkbox enables disables tracing of numerical methods This checkbox is only available if model execu
226. relative path it is assumed to be relative to the project folder cj specifies the index of the column to be loaded as a vector for example vectorfromfile file txt 2 cn specifies the name of the column to be loaded as a vector for example vectorfromfile file txt A The file is assumed to contain the column names in the first line vnorm1 x returns the 1 norm of the vector x vnorm2 x returns the Euclidean norm of the vector x vnormInf x returns the infinity norm of the vector x vresize x n returns a vector of size n whose first element is equal to x 1 second element is equal to x 2 and so on If size x is less than n every element of the resulting vector that does not correspond to an element in x is set to 0 Examples vresize 1 2 3 4 1 2 3 0 vresize 1 2 3 2 1 2 zeros n returns a vector of size n filled with zeros zeros n m returns an n by m matrix of zeros 2 14 1 3 Functions and procedures for arrays high A returns the index of the last element of the array A length A returns number of elements of the array A low A returns index of first element of the array A setLength A L sets the number of elements in a dynamic array A to L Values of the stored elements of the array are not changed Added items get the default values 2 14 1 4 Random Number Generators expon m generates a random number from the exponential distribution with mea
227. rent 4 2 8 13 Text Label This object has the following properties Type reflects the type of the object read only cannot be associated with a variable Name specifies the name of the object cannot be associated with a variable Visible determines whether the object is visible Color specifies the color x1 y1 z1 specify the coordinates of the base point dX dY dZ specify the offsets between the base point and the lower left corner of the text Text specify the label text Transparency specifies the object transparency must be between 0 fully opaque and 1 fully transparent 4 2 9 The Aggregate System of Equations Window The Aggregate System of Equations window displays the current aggregate system of equations see Section 2 6 of the model as shown in Figure 220 197 1 Flight 2 Flight 3 Flight 4 Flight 5 Flight 6 Flight 7 Flight 8 Flight 9 Flight 10 Flight A Current global system of equations Seea Equation Dec variable Differential equations aS se ll x s s i Algebraic equations m g Fa sinTeta Fa cosTeta Formulas cosTeta Kes 2 Fa Cx Sm na sinTeta ee 2 2 y Ivy X Equivalent variables Figure 220 The Aggregate System of Equations window The window displays the equations in a table where each row represents an equation and has the following fields e N displays the equation number
228. rgument values and the second column contains the corresponding function values x specifies the argument for which to return the interpolated value Returns NaN if x is outside the interval spanned by the values found in the first column of xy e Interim mode if called with the mode parameter set to true causes Rand Model Designer to stop analyzing and solving the aggregate system of equations until the end of the current time gap or a call to this procedure with the mode parameter set to false e tIsInfinite x returns true if x is an infinity false otherwise e IsNaN x returns true if x is a not a number NaN false otherwise e length x returns the number of characters in the string x e MainWinHandle returns a handle to the main window of the visual executable model The returned handle can be used to for example open additional windows from within the visual executable model e Message t m opens a message box with the title t and message m and pauses the model execution until the message box is closed Ignored in the embeddable model e Message t m L displays a message with header t text m and with severity level L If the third parameter is absent the level L 0 is supposed The System package includes constants that define the standard severity levels msTrivial msMinor msMajor msCritical e ModelTime returns the current model time that is the amount of model time elapsed since the start of
229. rs automatically depending on whether the class is open or isolated External variables of the class are displayed on the class boundary and can be moved around the boundary but cannot be detached from it External variables of local objects represent external variables defined in respective classes and cannot be moved created or deleted when editing the structure diagram of the containing class Most elements have tooltips that display their properties To select an element 1 Click the element or Right click anywhere in the editing area and choose the element from the Go to submenu of the popup menu The element will appear selected as shown in Figure 123 Figure 123 One element selected To select a group of elements 1 Press the left mouse button and drag the selection rectangle around the elements you want to select 2 Release the left mouse button when finished To add an element to the selection 1 Click the element while holding Shift The element will be added to the selection This way you can have more than one element selected at a time see Figure 124 Figure 124 Multiple elements selected 127 To select all elements of the structure diagram 1 Right click anywhere in the editing area and choose Select all from the popup menu All elements of the structure diagram will be selected see Figure 125 Figure 125 All elements selected To move the selected element s 1 Drag the selected
230. ry An example of the 2D Animation window is shown in Figure 208 181 A 2D animation Heutron power master wer control master Po LJ 1 1 Figure 208 2D Animation window example To open a new 2D Animation window 1 Click New 2D animation A on the main toolbar or Choose Window New 2D animation from the main menu A new 2D Animation window will appear as shown in Figure 209 A 2D animation Figure 209 New 2D Animation window The user populates the 2D Animation window by dragging and dropping components from the Standard 2D components panel 4 2 7 1 The Standard 2D components Panel The Standard 2D components panel see Figure 210 provides a palette of components that can be dropped onto a 2D Animation or Structure window A Standard 2D components Figure 210 The Standard 2D components panel 182 To open the Standard 2D components panel 1 Click Standard 2D components amp on the main toolbar or Choose Service Standard 2D components from the main menu The panel provides the following components e dancer _ continuous linear indicator e _ discrete linear indicator e w slider H color indicator e K sprite Bs diagram e B _ digital indicator e knob e H button 4 2 7 2 Using the 2D Animation Window To add a component to a 2D Animation window ae 1 Drag the comp
231. ry actions 117 To edit the exit actions of a state 1 Select the state and click Exit actions 7 on the behavior chart editor toolbar or Right click the state and choose Exit actions from the popup menu The Text Editor window will appear as shown in Figure 102 i Exit actions for S1 BEE i E be 00 gt py Figure 102 Editing the exit actions of a state 2 Use the Text Editor window see Section 3 4 12 to specify the exit actions of the state 3 Click OK in the Text Editor window If the exit actions are not empty they will appear in the property label of the state as shown in Figure 103 peseeccewoedeeee Figure 103 State with exit actions To create a continuous local class and associate it with a state 1 Right click the state and choose Create continuous activity from the popup menu A new continuous local class will be created and added to the Local classes Continuous node of the class editor tree The state will be modified to use the created class as the state s activity The created class will appear in the property label of the state and the state will be displayed with a thick border as shown in Figure 104 peeecee sweet e Figure 104 State with continuous activity To create a hybrid local class and associate it with a state 1 Right click the state and choose Create hybrid activity from the popup menu A new hybrid local class will be created and added to the Local cla
232. s non negative integers lt natural_number gt lt digit gt lt digit gt lt digit gt O 1 2 13 4 5 6 7 8 9 6 2 IDENTIFIER An identifier is a sequence of characters used to identify some entity in a project Identifiers obey the following rules e Every identifier starts with a letter and contains only letters digits and underscores e English and Russian Cyrillic letters are allowed and may be mixed within a single identifier e Other characters are not allowed e Reserved keywords begin end etc may not be used as identifiers 256 e Identifiers are case sensitive e identifiers may have arbitrary length 6 3 THE MVL LANGUAGE The MVL language is a format used to represent Rand Model Designer projects in textual form The MVL language has the following syntax lt module gt lt package_definition gt lt package_definition gt package lt project_name gt is import lt list_of_imported_packages gt lt project_element_definition gt lt Model_class_definition gt static model Model lt actual_initial_values gt end lt project_name gt lt project_name gt lt name gt lt name gt lt identifier gt lt package_name gt lt identifier gt lt package_name gt lt identifier gt lt list_of_imported_packages gt lt package_name gt lt package_name gt lt project_element_definition gt lt class_definition gt l
233. s not have interface and thus cannot interact with the environment An open class does have the interface and therefore can interact with its environment The interface of an open class is specified by the structure diagram see Section 2 7 and Section 2 7 2 The visibility indicates that the class is either private or public A private class can only be used in its containing project A public class can be used in any project For the detailed discussion of the visibility of project components see Section 2 1 2 4 BEHAVIOR CHART If a class is hybrid see Section 2 3 it has the associated behavior chart A behavior chart is a diagram that defines the behavior of a hybrid class A behavior chart consists of states and transitions between states At any time moment exactly one state of a behavior chart is said to be current A behavior chart corresponds to a UML statechart without composite and orthogonal states 16 2 4 1 State A state represents some lasting state of the modeled object On a behavior chart a state is shown as a rectangle with rounded corners see Figure 3 entry actions lt entry actions gt exit actions lt exit actions gt do lt activity gt ssa soo See Seo eee Seo Figure 3 State A state has the following properties e Name e Entry actions e Exit actions e Activity The name of a state is an identifier see Section 6 2 unique across all states of the behavior chart The entry actions of a s
234. s in the class editor tree or Right click the local class in the class editor tree and choose Edit from the popup menu The class editor window for of the corresponding local class will appear 3 4 8 Local Objects If a class is compound its class editor tree contains the Local objects node that represents the local objects of the class Local objects are added to and deleted from the class using the structure diagram editor see Section 3 4 15 Local objects cannot be added or deleted via the class editor tree The class editor tree only displays the local objects as individual sub nodes under the Local objects node The sub nodes of the Local objects node allow the user to quickly select local objects and modify their actual parameter values and initial variable values For more on local objects see Section 2 7 1 To select a local object in the structure diagram editor 1 Double click the corresponding node in the class editor tree To modify the actual parameter values and initial variable values of a local object 1 Right click the corresponding node in the class editor tree and choose Actual values of parameters and variables from the popup menu The Actual values dialog box will appear as shown in Figure 63 95 Actual values Class_2_ 1 P 1 0 4 P 2 0 H Initial values for variables 4 Int 0 Out1 0 4 i 1 0 Figure 63 The Actual values dialog box 2 To modify the actual value of a parameter
235. s the Model class just like any other project In libraries the Model class is usually set to be private and have either some contents aimed to test the library or no important contents at all 14 2 2 CLASSES A Class is a modeling language construct that defines the characteristics that the objects of the class all share A class is fully specified by a class definition In the most general case a class definition consists of e Name e con e Comments e Stereotype e Behavior chart if the class is hybrid e System of equations if the class is continuous e Structure diagram if the class is compound and or open e Parameters e Variables e Class constants e Class functions and procedures e Local classes if the class is hybrid e Base class if the class inherits from another class e Indication whether the class is concrete or abstract The name of a class is an identifier unique across all classes of the project The syntax of identifiers is described in Section 6 2 The icon of a class is an optional image shown on every instance of the class whenever instances of the class appear visually The comments are text associated with the class The comments have no defined syntax or semantics The stereotype defines the behavior type the structure type the component type and the visibility of the class The stereotype is discussed in detail in Section 2 3 Depending on the stereotype the behavior of a class is s
236. s the user to configure the basic model settings To open the Model settings dialog box Click Model settings on the main toolbar or Choose Settings Model from the main menu The Model settings dialog box will appear as shown in Figure 235 1 Model settings Run view Files M Model time to real time ratio as quickly as possible IV Determine consistent values at initial moment V Execute initial discrete actions before running 7 Keep modified model parameters F Do not solve equations in interim states of a time gap Figure 235 The Model settings dialog box the Run tab The Model settings dialog box consists of the following tabs Run View and Files These tabs are described in the subsections that follow The dialog box also contains two buttons Apply 208 and Close The Apply button applies the current settings and closes the Model settings dialog box The Close button closes the dialog box without applying the current settings 4 2 15 1 1 The Run Tab The Run tab see Figure 235 contains the following elements e Model time to real time ratio This section allows the user to configure the model execution speed The as quickly as possible option instructs the model to run as fast as possible The other option configures the model to run at a fixed model time to real time ratio specified in the field next to the option For more information see Section 4 2 13
237. s to the inherited behavior chart e Override the activity associated with an inherited state including the actual parameter values of the activity object e Override the entry and exist actions of an inherited state e Override the trigger the guard and the actions of an inherited transition e Add new local objects and links to the inherited structure diagram e Override the actual parameter values of an inherited local object In a derived class all inherited elements are labeled with the sign If a derived class overrides the system of equations the overridden system of equations is labeled with the sign The inherited and overridden states transitions local objects and links are shown on the behavior chart and the structure diagram in special colors configurable by the user None of the elements of the base class can be removed in the derived class 38 In Rand Model Design a base class is often called a superclass and a derived class is often called a subclass 2 13 TYPES A type defines a set of values that an object or expression can take and a set of operations allowed on those values Every type has a name that uniquely identifies the type The use of a particular type name in a definition of an object such as parameter variable or constant indicates that the corresponding object has the corresponding type that is can take values from the corresponding set 2 13 1 Scalar Types The scalar types are e dou
238. s tracing in the embeddable model is not checked by default e Numerical methods tracing This checkbox enables disables tracing of numerical methods in the embeddable model is not checked by default 147 3 8 4 The Version Tab E Project options xs General Folders Embedded model Version Equation blocks Company name oe Legal copyright a 2 a Trademarks LOOS i l Product name File Product version File version 100 Internal name Original filename Indude version information in models Figure 155 The Version tab This tab contains the following elements e Company name This field specifies the name of the company that produced the model e Legal copyright This field specifies the copyright notices that apply to the model e Trademarks This field specifies the trademarks and registered trademarks that apply to the model e Product name This field specifies the name of the product with which the model is distributed e File description This field contains a brief description of the model e Product version This field specifies the version of the product with which the model is distributed e File version This field specifies the version of the model e Internal name This field specifies the internal name of the model e Original filename This field specifies the original name of the model e Include version information in models
239. sed by all windows of the integrated modeling environment except for the Text Editor window To modify the font click the Font button and use the standard Font dialog box to choose the font Text editor font This field specifies the font used by the Text Editor window To modify the font click the Font button and use the standard Font dialog box to choose the font 3 10 MISCELLANEOUS FUNCTIONS Like many applications the integrated modeling environment allows the user to e We e Ww Undo recent actions Cascade tile and minimize open windows Print the contents of windows Consult the built in help View application information Quit the application To undo the last action 1 Click Undo s on the main toolbar or Choose Edit Undo from the main menu or If you are currently in the Text Editor window click Undo on the Text Editor window toolbar To cascade open windows 1 Choose Window Cascade from the main menu To tile open windows 1 Choose Window Tile from the main menu To minimize open windows 1 Choose Window Minimize all from the main menu To print the contents of the active window 1 Choose Window Print from the main menu The standard Print dialog box will appear 2 Adjust printing properties if necessary and click OK To open the help 1 Choose Help Rand Model Designer Help from the main menu To view information about the application 1 Choose Help About fr
240. signal on any of these variables including the source variable all such transitions are triggered in undefined order The actions of the triggered transitions can access the arguments of the signal as described in Section 2 13 5 If the optional broadcast keyword is present in a send operator the signal is sent as a broadcast signal A broadcast signal differs from an ordinary signal in that it is automatically transmitted not only between connected variables but also between disconnected variables if they appear on the same structure diagram and have equal names and types In particular if a 65 broadcast signal arrives at an input variable or an internal variable of a compound class it is automatically relayed to all equally named and typed input variables of all contained local objects Also if a broadcast signal arrives at an output variable of a local object it is automatically relayed to all equally named and typed variables of the containing class and other local objects The use of broadcast signals helps reduce the number of links in complex models Example send x 10 true 34 7 send broadcast x 10 true 34 7 2 16 9 Optimization Operator The optimization operator finds the variable values that correspond to the minimum or maximum value of a certain expression Syntax lt optimization_operator gt lt direction gt lt double_expression gt for lt variable_specification gt lt variable_specification gt c
241. sing the next point to be disconnected from the previous point in all plots Ignored in the embeddable model ClearDiagrams Clears all time and phase diagrams opened in the visual executable model Ignored in the embeddable model connected x returns true if variable x is external and is involved in external relations internal connections of the external variables of the composite object with local objects are not considered and false otherwise connected x y returns true if variables are connected by direct link and false otherwise delay x t returns the value of the variable x at time moment time t where time is the current model time of the calling object During the time interval 0 lt time lt t returns the initial value of x deriv x returns the value of the derivative of x for the current time moment where x is a variable of type double or vector The value of the derivative is calculated numerically so at the time moment time 0 the return value is always 0 for double variables and 0 0 for vector variables here time is the current model time of the calling object Error m opens a message box with the message m and stops the model execution Displays the name of the calling object in the title of the message box Finalized returns true if all local objects are hybrid and have already reached the final state see Section 2 4 5 or if there are no local objects otherwise ret
242. splaying the variables added to the e e Diagram window The list has the following columns Variable This read only column shows the variable names Type This read only column shows the variable types Min This column allows the user to specify the minimum value for each variable Max This column allows the user to specify the maximum value for each variable Color This column allows the user to choose the color used to plot each variable Width This column allows the user to specify the line width used to plot each variable X This column allows the user to choose the variable associated with the x axis the x axis variable The selected variable if any is denoted by the sign shown in this column At most one variable can be selected If there is a variable denoted by the sign it means that the Diagram window displays a phase diagram and has the x axis associated with the denoted variable in this case the Diagram window is said to be in the phase diagram mode Otherwise the Diagram window displays a time diagram and is said to be in the time diagram mode To modify the Min Max or Width attribute of a variable 172 1 Double click the corresponding cell An in place editing field will appear 2 Type the new value 3 Hit Enter or click anywhere outside the editing field To modify the color used to plot a variable 1 Double click the Color fiel
243. sses Hybrid node of the class editor tree The state will be modified to use the created class as the 118 state s activity The created class will appear in the property label of the state and the state will be displayed with a double border as shown in Figure 105 peeecee sweet e e Sie a Figure 105 State with hybrid activity K To use an exiting class as the activity class of a state 1 Drag the class from the Project Manager window or the class editor tree and drop it onto the state The class will appear in the property label of the state and the state will change its border to reflect the type of the behavior of the class e To open the class editor window for the activity class of a state 1 Double click the state or Right click the state and choose State activity from the popup menu The class editor window for the class associated with the state will appear e To remove the activity from a state 1 Right click the state and choose Set empty activity from the popup menu The activity will disappear from the property label of the state and the state border will change to normal e To modify the actual parameter values and initial variable values of a state activity K gt 1 Right click the state and choose Actual values of parameters and variables from the popup menu The Actual values dialog box will appear as shown in Figure 106 Actual values 51 Initial
244. ssignments or as the result of solving the aggregate system of equations see Section 2 6 The initial value can be assigned to a variable via the set of initial variable values of the corresponding local object see Section 2 7 1 or activity object see Section 2 4 1 If the initial value of a variable is not specified the default initial value specified in the variable definition is used Each variable gets its initial value when an instance of the class is created and may change the its value in the future as a result of explicit assignments or the solution of total equation set of the model see Section 2 6 If the variable is marked as discrete it means that its value can only be changed in discrete actions Within the continuous intervals this variable is constant Links between variables are discussed in Section 2 7 3 For external variables the color can be specified in the structure editor this color will be used for representing variable on the structure diagram 2 10 CONSTANTS Both a class see Section 2 2 and a project see Section 2 1 can define an arbitrary number of constants A constant is a fixed value that has an associated symbolic name Every constant has the following properties e Name e Type e Value e Visibility if the constant is a project constant The name of a constant is an identifier see Section 6 2 unique across all constants of the class or project The type of a constant can be any
245. stroys the dynamic link between external variables v1 and v2 new lt name_of_class gt lt actual_values_of_variables gt name lt sting_expression gt returns a reference to a new instance of this class with the specified values of variables and specified name null returns a null object reference 53 2 14 1 7 Functors A functor is a function that accepts an expression rather than a value as one of its arguments A functor call looks like an ordinary function call but is in fact a special operator that specifies an independent variable an expression involving the independent variable an interval for the independent variable and optionally an absolute error tolerance for the result A functor call has the following syntax lt functor_call gt lt functor_name gt lt independent_variable_name gt lt expression gt lt independent_variable_lower_bound gt lt independent_variable_upper_bound gt lt absolute_tolerance gt The independent variable must be of type double The expression must evaluate to double The scope of the independent variable is limited to the expression Besides the independent variable the expression can involve any other quantities such as class variables parameters and constants but during the calculation of the functor all quantities remain constant except for the independent variable If the absolute error tolerance is omitted the default specified in the numerical
246. system of equations of the model and the link image appears in the appropriate window of visual model Dynamic link between the two external variables can be destroyed by means of predetermined procedure disconnect called in some discrete action in behavior chart of the composite object After the dynamic link destruction the corresponding equations are removed from the total system of equations of the model and the link image disappears from appropriate window of visual model 2 7 1 Dynamic objects Objects drawn in the Structure editor are static i e they always exist in the composite object Dynamic objects are created by applying the new operator executed in discrete actions While 34 executing this operator an instance of the class with the specified actual parameters is created Reference to this object is stored in a variable of the corresponding object type External variables and methods of the dynamic object are available through a compound name in which the name of the variable is used as a prefix The dynamic object can be passed as a parameter of procedure or function as well as the parameter of signal Dynamic object can be destroyed using a special procedure destroy Between dynamic objects as well as between dynamic and static objects there can be created and destroyed the dynamic links Example class Cl is parameter K double 1 input X double 0 output Y double 0 end Cl Z Cl null S signal X
247. t sinJ y dt dt 22 dt a2 K x 0 dt dt 2 d x dx d y dy zt x a ty dt dt dt dt Besides the usual equations the conditional equations can be used They have the following form if lt condition gt then lt system_of_equations gt elsif lt condition gt then lt system_of_equations gt else lt system_of_equations gt end if The system of equations of a class can contain one or more equations for example or dx dt dy dt or x y 0 x y k or or 0 ytet s if B gt 10 then y 5 x unknown x Y elsif B gt 1 then x 0 elsif B20 then oor 0 unknown x else y 0 end if The set of variables visible in a compound class see Section 2 3 includes external variables of the compound class local objects see Section 2 7 1 External variables of local objects can therefore participate in the system of equations of a compound class In the system of equations of a compound class an external variable of a local object can be referred to as lt local object name gt lt variable name gt For example if a class contains a local object obj with an external variable var the system of equations of the class can refer to that variable as obj var dobj var dt x obj var x obj var 0 Besides equations a system of equations can contain an arbitrary number of declarations indicating that some variables participating in t
248. t global_constant_definition gt lt global_function_or_procedure_definition gt lt declared_type gt lt class_definition gt lt class_stereotype gt class lt class_name gt is lt parameter_definition gt lt external_variable_definition gt lt variable definition gt lt constant_definition gt lt function_or_procedure_definition gt lt structure_diagram_definition gt lt behavior_definition gt end lt class_name gt lt class_stereotype gt local lt visibility gt lt behavior_type gt lt visibility gt public private lt behavior_type gt continuous hybrid lt class_name gt lt identifier gt lt parameter_definition gt parameter lt variable_definition gt 257 258 lt external_variable_definition gt lt external_variable_stereotype gt lt variable_definition gt lt external_variable_stereotype gt input output flow contact connector lt variable_definition gt lt variable_name gt lt variable_type gt lt initial_value gt lt variable_type gt lt type gt lt variable_ name gt lt identifier gt lt initial_value gt lt value gt lt constant_definition gt constant lt constant_name gt lt constant_type gt lt value gt lt constant_type gt lt type gt lt constant_name gt lt identifier gt lt function_or_procedur
249. tab 2 To add a field to the record type click Add The Record component dialog box will appear as shown in Figure 75 102 Record component Identifier Cancel Type double Help Comments pme ooo O Figure 75 The Record component dialog box 3 Type the name of the field in the Identifier field 4 To specify the type of the field click Type Another Choose type dialog box will appear Use the Choose type dialog box to specify the type of the field When done click OK in the Choose type dialog box 5 If necessary type the comments for the field in the Comments field 6 Click OK in the Record component dialog box 7 If necessary repeat the above steps to add more fields to the record type 8 Click OK in the Choose type dialog box To specify a connector type 1 Click the Connector tab The Choose type dialog box will look as shown in Figure 76 Choose type Components M Type definition connector Figure 76 The Choose type dialog box the Connector tab 2 To add a component to the connector type click Add The Connector component dialog box will appear as shown in Figure 77 103 Connector component Identifier CI Type double Cancel Comments M Component type Input Output Contact Flow Connector 3999 Figure 77 The Connector component dialog box 3 Type the name of the component in the Identifier field 4 To speci
250. tains the Variables node representing the internal variables of the class For more on class variables see Section 2 9 To create a new internal variable 1 Right click the Internal variables or Variables node in the class editor tree and choose New internal variable or New variable from the popup menu The Internal variable dialog box will appear as shown in Figure 48 Internal variable Identifier Cancel Type double Value 0 Comments ee Group A Figure 48 The Internal variable dialog box 2 Type the name of the new variable in the Identifier field 3 To specify the type of the new variable click Type The Choose type dialog box will appear Use the Choose type dialog box see Section 3 4 10 to choose the type of the variable When done click OK in the Choose type dialog box 4 To specify the default initial value of the new variable click Value If the type of the variable is an enumeration the Choose enumerated value dialog box will appear as shown in Figure 49 Otherwise if the type of the variable is a record the Component Editor window will appear as shown in Figure 50 Otherwise the Text Editor window will appear as shown in Figure 51 Choose enumerated value Figure 49 The Choose enumerated value dialog box 88 Initial value for V_1 Mathematical editing Figure 50 Editing the default initial value of a variable in the Component Editor w
251. tate are a sequence of operators see Section 2 16 that is executed instantly every time the state is entered A state may have no entry actions in which case no actions are executed when the state is entered The exit actions of a state are a sequence of operators that is executed instantly every time the state is exited A state may have no exit actions in which case no actions are executed when the state is exited 2 4 1 1 State Activity The activity of a state is specified by a class and a set of actual parameter values see Section 2 8 and initial variable values see Section 2 9 for an instance of that class The activity is executed while the state remains current The class used to specify the activity is called the activity class An instance of the activity class is called an activity object An activity object is created automatically when the state is entered executes the state s activity while the state remains current and is destroyed automatically when the state is exited The variables of an activity object are accessible from the state s entry and exit actions and from the actions of transitions existing the state Any ordinary class available in the project or local class defined in the containing class see Section 2 11 can be used as the activity class If the activity class is continuous it is said to implement a continuous activity If the activity class is hybrid it is said to implement a hybrid activity On a behavi
252. tax lt variable name gt 0 lt initial value gt For example x 0 1 If the system of equations of a class contains a set of equations whose variables do not participate in other equations of the system and are internal variables of the class see Section 2 9 such a set of equations can be declared as a block A block declaration has the following syntax linear block lt block name gt lt equation 1 gt end block For example block myblock dx y dt dy xX dt end block Declaring a set of equations as a block gives Rand Model Designer a hint that the equations of the block can be solved separately from other equations of the system Rand Model Designer may take advantage of such hints when solving the aggregate system of equations The optional linear keyword indicates that all the equations of the block are linear Declaring a block as linear may increase the efficiency of computations but may only be used if all the equations of the block are in fact linear If there are fast and slow variables blocks in the model the slow blocks can be used within the fast as discrete variables a method of frozen coefficients Using a variable from another block is performed by means of special function fromBlock The step of freezing is set on the page Equation Blocks in the project settings It is desirable to verify the freezing step by comparing the results with the results obtained when
253. the External variable dialog box to create an output variable i opens the External variable dialog box to create a contact variable aa opens the External variable dialog box to create a flow variable A opens the External variable dialog box to create a connector variable amp creates a new link e P deletes the selected elements H toggles the grid in the editing area amp toggles display of local object variable names A opens the Font dialog box to edit the font used by the structure diagram editor e allows the user to print the structure diagram allows the user to save the structure diagram to a file as an image 126 3 4 15 2 Editing Area The structure diagram editing area allows the user to graphically edit the elements of the structure diagram The editing area can contain the following elements e Local objects if the class is compound see Section 2 7 1 e Class boundary if the class is open see Section 2 7 2 e External variables see Section 2 9 e Links if the class is compound see Section 2 7 3 The user can create elements and in most cases move them around resize them modify their properties and delete them Local objects and external variables have associated names that can be moved around as well Local objects can be rotated The class boundary represents the interface of the class and cannot be created or deleted Instead it appears and disappea
254. the maximum value displayed by the knob Style Allows to convert the knob to a component of any other type Value Shows hides the box displaying the associated variable value Value format Allows to specify the floating point number display format Auto scaling Toggles automatic scaling Position Allows to specify the position and size of the component The position is relative to the upper left corner of the 2D Animation window 4 2 7 11 Button This component provides the following context menu items 188 Style Allows to convert the button to a component of any other type Caption Allows to specify the button label Fixation Toggles the two state button mode In the two state button mode each click ona button toggles the button between two states pressed and not pressed In the normal push button mode the button returns to its un pushed state automatically after every click e Shortcut Allows to assign a keyboard shortcut to the button e Picture Allows to specify the image to be displayed on the button e Frame Allows to specify the margin between the component outer border and the button inner border e Font Allows to choose the button font e Color min Allows to choose the starting color of the button s gradient fill e Color max Allows to choose the ending color of the button s gradient fill e Position Allows to specify the position and size of the component
255. the model in model time units e NaN returns a not a number NaN value as defined by ANSI IEEE Std 754 1985 e ObjectHandle returns the unique integer ID of the class of this object e OnVarChange x returns true if the variable x was modified during the current discrete time tick Returns false otherwise e Reinit x v sets new value v for global parameter x It can be used only in the actions of the initial transition of class Model e StateResult may only be used in the exit actions of a state see Section 2 4 1 Returns true if there were no errors while being in the state false otherwise e Stop causes Rand Model Designer to stop the model execution after finishing executing the transition whose actions called this procedure see Section 2 4 2 e time returns the current model time of this object that is the amount of model time elapsed since the creation of this object in model time units e Time if this object is an activity object returns the current model time of the object owning the behavior chart with the corresponding state Otherwise returns the current model time of the object e tostring x returns a string representation of x 2 14 1 6 Special procedures and functions for working with dynamic objects and links connect v1 v2 creates a dynamic link between the external variables v1 and v2 destroy Obj destroys the dynamic object Obj disconnect v1 v2 de
256. the popup menu The Internal transitions window will appear as shown in Figure 171 160 Eo A model 2 internal transitions Figure 171 Opening the Internal transitions window of a state The Behavior Chart window allows the user to associate a set of visual model settings with a state so that when the state becomes current the corresponding model settings are automatically activated This allows the user to configure the visual executable model to show different windows in different model states To associate a set of visual model settings with a state 1 Right click the state and choose Special model options from the popup menu The Special options dialog box will appear as shown in Figure 172 Special options ie Cancel ii Figure 172 The Special options dialog box 2 Click amp The Open dialog box will appear 3 Select a model settings file and click Open The selected name will appear in the Special options dialog box 4 Click OK To remove a set of visual model settings from a state 1 Right click the state and choose Special model options from the popup menu The Special options dialog box will appear as shown in Figure 172 2 Select the no option 3 Click OK 4 2 3 The Structure Window The Structure window visualizes the structure diagram of a compound object see Section 2 7 The Structure window looks as shown in Figure 173 161 A model s
257. the time the trigger occurs the transition is not executed and the trigger occurrence is lost A transition may have no guard in which case the guard is assumed to always be true A transition that has neither trigger no guard is called an unconditional transition An unconditional transition is executed immediately after the object enters the transition s source state The actions of a transition are a sequence of operators see Section 2 16 that is executed instantly every time the transition is executed A transition may have no actions in which case no actions are executed when the transition is executed 2 4 3 Internal Transition An internal transition is a transition of a special kind that takes place within a state without changing the current state Unlike an ordinary transition an internal transition is not shown as a separate arrow on a behavior chart Instead a state containing one or more internal transitions is shown as a rectangle with an arrow inside as in Figure 7 Figure 7 State with internal transition s When an internal transition is executed the object does not leave the current state The execution of an internal transition therefore does not result in execution of the current state s exit and entry actions or any changes to the state s activity This is what makes an internal transition different from an ordinary transition exiting and entering the same state The execution of an ordinary transition ex
258. the type of the object read only cannot be associated with a variable Name specifies the name of the object cannot be associated with a variable Visible determines whether the object is visible Color specifies the color x1 y1 z1 specify the coordinates of the center of the torus nX nY nZ specify the normal vector that represents the axis of symmetry of the torus Radius specifies the radius of the torus that is the distance from the center of the torus to the center of the tube Thickness specifies the radius of the tube Slices specifies the number of segments used to model the torus Transparency specifies the object transparency must be between 0 fully opaque and 1 fully transparent 4 2 8 8 Spring This object has the following properties Type reflects the type of the object read only cannot be associated with a variable Name specifies the name of the object cannot be associated with a variable Visible determines whether the object is visible Color specifies the color x1 y1 z1 specify the coordinates of the starting point of the spring x2 y2 z2 specify the coordinates of the ending point of the spring 195 4 2 Radius specifies the radius of the spring cylinder Thickness specifies the spring thickness Turns specifies the number of turns Slices specifies the number of segments used to model the spring Transp
259. ther the class is abstract To change the visibility of a class 1 Right click the class in the Project Manager window and choose Public or Private from the popup menu This will set the visibility of the class to the selected value 3 3 2 Declared Types For detailed information on declared types see Section 2 13 6 To create a new declared type 1 Right click the Types node in the Project Manager window and choose New type from the popup menu The User type editing dialog box will appear as shown in Figure 30 15 5 User type editing Type identifier type_t OK Distinct type B Cancel jase type Enumerated type Mb Signal type Vector type Help Matrix type Record type Connector type type Type_1 is double Figure 30 The User type editing dialog box Type the name of the new declared type in the Type identifier field If you want the new declared type to act as a synonym for the double integer short byte boolean string or char type or another declared type make sure the Distinct type option is checked and click Base type Otherwise select the option that corresponds to the category of the type for which the new declared type will act as a synonym The Choose type dialog box will appear Use the Choose type dialog box see Section 3 4 10 to specify the type for which the new declared type will act as a synonym When done click OK in the Choose type dialog box Click OK in t
260. tion f Boolean expression ey Cancel Help Figure 110 Editing the conditions of a transition exiting an ordinary state Transition conditions Guard condition Boolean expression amp o C else OK Cancel Help Figure 111 Editing the conditions of a transition exiting a switch point Be POATHOCTb C pabaTbipaHHA ne pexoa Real expression OK Cancel Help Figure 112 Editing the conditions of a transition exiting a probabilistic switch point 2 Specify the transition conditions 3 Click OK If the conditions are not empty they will appear in the property label of the transition as shown in Figure 113 122 ee after 10 Figure 113 Transition with conditions To edit the actions of a transition 1 Select the transition and click Transition actions b on the behavior chart editor toolbar or Right click the transition and choose Transition actions from the popup menu The Text Editor window will appear as shown in Figure 114 Transition actions Figure 114 Editing the actions of a transition 2 Use the Text Editor window see Section 3 4 12 to specify the actions for the transition 3 Click OK in the Text Editor window If the actions are not empty they will appear in the property label of the transition as shown in Figure 115 actions x 1 Figure 115 Transition with actions To create an internal transition in a state 1 Se
261. tion tracing is enabled e Trace variable values This checkbox enables disables tracing of variable values This checkbox is only available if model execution tracing is enabled If the Read input data from file checkbox is checked the text file specified after that checkbox must consist of lines of the following form lt paramater_or_variable_name gt lt value gt lt comments gt If the Write output data to file checkbox is checked the text file specified after that checkbox must consist of lines of the following form lt paramater_or_variable_name gt Upon termination the model will modify each line of the output file by adding the value of the specified parameter or variable after the sign 4 2 15 2 The Numerical methods Dialog Box The Numerical methods dialog box allows the user to choose and configure the numerical methods used to solve the aggregate system of equations of the model see Section 2 6 Rand Model Designer offers the following categories of numerical methods 210 e Automatic solvers These methods analyze the aggregate system of equations and automatically select the method that suits best If the selected method does not perform well the detailed information about encountered problems is presented to the user By analyzing that information the user can better understand the characteristics of the system and gather enough knowledge to manually choose the right method e Concrete
262. tions window To move an internal transition 1 Select and drag the internal transition or any of its intermediate points to the desired location 3 4 14 3 Special States Special states are final state see Section 2 4 5 switch point see Section 2 4 6 and probabilistic switch point see Section 2 4 7 To create a final state a switch point or a probabilistic switch point 1 Click Final state Switch point gS Or Probabilistic switch point on the behavior chart editor toolbar A new special state will appear as shown in Figure 119 Figure 120 or Figure 121 Figure 119 New final state Figure 120 New switch point ua Figure 121 New probabilistic switch point 3 4 15 Structure Diagram Editor The structure diagram editor see Figure 122 allows the user to edit the structure diagram of a class For more on the structure diagram see Section 2 7 125 Structure and InterFace Figure 122 Structure diagram editor The structure diagram editor consists of the editing area and the toolbar The editing area allows the user to graphically edit the elements of the structure diagram The toolbar provides shortcuts to some of the most commonly used commands of the structure diagram editor 3 4 15 1 Toolbar Buttons The structure diagram editor toolbar contains the following buttons e OL creates a new local object e g opens the External variable dialog box to create an input variable e k opens
263. to any object A null reference is given a predefined function null The operations of equality and inequality are defined for object types Example class Cl is parameter K double 1 input A double 0 end Cl class C2 extends Cl is static Ul Cl X Cl null Y object Z C2 null1 signal S x Cl X U1 Z new C2 K 3 Z A 2 6 Y X if X Z then 2 13 8 Lists Any dynamic array can be operated as a list using procedures and functions of the standard package List procedure List add in out A array of TE in Item TE adds an element Item to the end of array A Added element will have index length A 1 procedure List insert in out A array of TE in Index integer in Iten TE inserts an element Item to array A before the element with index Index error occurs if no such element exists Added element will have index Index procedure List delete in out A array of TE in Index integer removes the element with index Index from the array A error occurs if no such element exists procedure List addFirst in out A array of TE in Item TE adds an element Item to the array A first Added element will have index 0 function List first in A array of TE return TE returns the first element of the array A error occurs if the array is empty function List last in A array of TE return TE returns the last element of the array A error occurs if the array is empty 47 Example of operations with L
264. tructure Thermostat Heater Figure 173 The Structure window The Structure window is similar to the structure diagram editor see Section 3 4 15 in that it displays all elements of the structure diagram of an object However the Structure window does not allow the user to modify the structure diagram In the Structure window most elements have tooltips that display their properties The tooltip of a local object displays the class name actual parameter values initial variable values and comments associated with the object The tooltip of an external variable displays the name of the variable and its current value The tooltip of a link displays the names of the variables connected by the link If the Show data exchange over links option is set in the model settings see Section 4 2 15 1 2 links are highlighted when the variables they connect change during model execution The Structure window of the model object opens automatically upon executable model startup if the model object is compound The Structure windows of other compound objects can be opened manually as described below and in Section 4 2 2 If a local object displayed in a Structure window is compound its own Structure window can be opened as follows To open the Structure window of a compound local object 1 Double click the local object or Right click the local object and choose Local structure from the popup menu The object s Structure wind
265. tside the editing field To modify a vector or matrix in place 1 Right click the corresponding row in the Variables window and choose Edit as text from the popup menu An in place editing field will appear 2 Type the new value 3 Hit Enter or click anywhere outside the editing field To modify a vector or matrix using the Elements dialog box 1 Double click the corresponding row in the Variables window or Right click the corresponding row in the Variables window and choose Edit from the popup menu The Elements dialog box will appear as shown in Figure 162 2 Inthe Elements dialog box double click the element you want to modify An in place editing field will appear Type a new value for the element Hit Enter or click anywhere outside the editing field If necessary repeat the above steps to modify other elements oan fF w amp Click OK in the Elements dialog box To modify a record or connector 1 Double click the corresponding row in the Variables window or Right click the corresponding row in the Variables window and choose Edit from the popup menu The Components window will appear as shown in Figure 164 2 Inthe Components window double click the component you want to modify An in place editing field will appear 3 Type anew value for the component 4 Hit Enter or click anywhere outside the editing field 5 If necessary repeat the above steps to modify other components 4
266. u To print a Diagram window 1 Right click anywhere in the Diagram window and choose Print from the popup menu The standard Print dialog box will appear as shown in Figure 188 169 Printer Name Microsoft Office Document Image winter Status Ready Type Microsoft Office Document Image Writer Driver Where Microsoft Document Imaging Writer Port Comment Print range Copies All Number of copies fl aa oes ox Cancel Figure 188 The Print dialog box 2 Adjust printing properties if necessary and click OK To save the contents of a Diagram window to a file as an image 1 Right click anywhere in the Diagram window and choose Save image from the popup menu The Save As dialog box will appear 2 Browse to the folder where you want to save the image 3 Type the file name in the File name field 4 Click Save To save the contents of a Diagram window to a file as a text table 1 Right click anywhere in the Diagram window and choose Export from the popup menu The Diagram data export dialog box will appear as shown in Figure 189 Diagram data export Figure 189 The Diagram data export dialog box 2 Type the path to the destination file in the File field or click the button and specify the destination file in the dialog box that appears 3 Specify the start and end time of the time interval you want to save in the time from
267. u The standard Color dialog box will appear as shown in Figure 202 2 Select the desired color and click OK To modify the color of 3D surfaces 1 Right click anywhere in the Histogram window and choose Diagram colors 3D planes color from the popup menu The standard Color dialog box will appear as shown in Figure 202 2 Select the desired color and click OK To modify the background filling 1 Right click anywhere in the Histogram window and choose Background filling Color from from the popup menu The standard Color dialog box will appear as shown in Figure 202 2 Select the desired starting color for linear gradient filling and click OK 178 Right click anywhere in the Histogram window and choose Background filling Color to from the popup menu The standard Color dialog box will appear again Select the desired ending color for linear gradient filling and click OK To toggle the gradient direction between horizontal and vertical right click anywhere in the Histogram window and choose Background filling Vertically from the popup menu To modify the x axis labels 1 To modify the labeling mode right click anywhere in the Histogram window and choose either No Integer or Real from the X axis marks Mark style submenu of the popup menu No indicates that no labels will be shown Integer enables integer labels Real enables real number labels To modify the value of the first label ri
268. ual parameter values e initial variable values The name of a local object is an identifier see Section 6 2 unique across all local objects of the structure diagram The class of a local object can be any class available in the project see Section 2 2 The presence of a local object on the structure diagram of a class indicates that each instance of the class contains an instance of the local object s class with the specified name actual parameter values see Section 2 8 and initial variable values see Section 2 9 If the class of a local object declares external variables see Section 2 9 the corresponding external variables of the local object appear on the border of the local object as shown in Figure 13 The appearance of a particular variable depends on the category of the variable Figure 13 depicts the appearance of variables of each possible category For the discussion of variable categories see Section 2 9 input output contact flow connector Figure 13 Appearance of external variables 2 7 2 Class Boundary If a class is open its structure diagram contains the class boundary A class boundary is shown on a structure diagram as a rectangle see Figure 14 28 Figure 14 Class boundary If a class has external variables see Section 2 9 they appear on the class boundary in the same way as external variables of local objects see Section 2 7 1 2 7 3 Link A link is a connection between two variables on
269. uations Parameters Optimization Modes Initial conditions calculation Newton s method SLAE Sparse matrices Newton s method Eudidean norm u 1 000E 00 0 lt u lt 1 C Powell s method Cubic norm ens lioooes00 lo lt ut C Newton plus Powell vs i i Try reordering to Iteration methods block4tower triangular Apply iteration algorithm to DDASPK matrix Apply Close Help Figure 5 The Parameters tab To save changes of numerical methods settings 1 Click the Apply button in the Numerical methods dialog box 4 2 16 Executing the Model At any time the executable model can be in either running or stopped state When the model is in the running state its continuous and discrete times advance as the aggregate system of equations is solved and the behavior charts of hybrid objects are executed When the model is in the stopped state the model time does not change and no internal activity takes place within the model When the model is in the running state it can at any time be stopped When the model is in the stopped state it can be either run instructed to execute one discrete step or restarted from the beginning To run the model 1 Click Start P on the main toolbar or Choose Simulation Start from the main menu To stop the model 1 Click Stop Il on the main toolbar or Choose Simulation Stop from the main menu To execute one discrete step 1 Click Discr
270. uations of the class B 4 2 7 3 5 Flow flow connection If x and y are flow variables a link between x and y adds the following equation to the system of equations of the class x y 0 2 7 3 6 Connector connector connection If x and y are connector variables a link between them is equivalent to a set of links connecting their components in the order of declaration of components in the types of these variables see Section 2 13 4 2 7 3 7 Conditional link The condition of activity can be attributed to a link If this condition is satisfied connection is active the corresponding constraint equations are added to the model s total system of equations if it s not satisfied the link is not active the equations are taken out of the total system of equations Visual model displays inactive link by the dashed line 2 7 3 8 Dynamic link Links drawn in the structure editor are static i e they always exist in the object Dynamic link between two external variables can be created by means of predetermined procedure connect called in some discrete action in a behavior chart of a composite object Connected variables can be own external variables of a composite object and external variables of internal objects which stereotypes and value types are compatible There should be no static or dynamic links between the connected variables After the dynamic link is created the corresponding equations are added to the total
271. und and or open Depending on the stereotype of the class see Section 2 3 the right panel can contain one or more editors If the right panel contains more than one editor each one appears on a separate tab 3 4 1 Class Editor Tree The class editor tree consists of nodes representing groups of elements such as Parameters and Constants as well as nodes representing individual elements such as the class name individual parameters and individual constants Within a group elements are sorted in alphabetical order Inherited elements see Section 2 12 are shown with the sign The following subsections describe all possible types of elements that can appear in the class editor tree and the associated functions of the class editor 3 4 1 1 Class Name The first element of the class editor tree is the class name The class name uniquely identifies the class within the project To modify the class name 1 Double click the class name node in the class editor tree or Right click the class name node in the class editor tree and choose Edit from the popup menu An in place editing field will appear as shown in Figure 38 Class Class_1 Parameters Variables Figure 38 Editing the class name 2 Type the new class name 3 Hit Enter or click anywhere in the class editor window outside the editing field 3 4 1 2 Class Icon The class icon is an optional image that if specified is shown on every instance of the class
272. unknown Rand Model Designer attempts to automatically select the required number of variables and declare them unknown to equalize the number of unknown variables with the number of equations Rand Model Designer selects unknown variables from the set of free variables Free variables are variables that participate in the system of equations and are not yet declared as either known or unknown If the number of free variables is equal to the number of unknown variables that Rand Model Designer needs to select the selection succeeds and all free variables become unknown The resulting system of equations is considered formally resolvable For example given the system of equations x y 1 x y 0 where x and y are variables Rand Model Designer selects x and y as unknown variables and considers the resulting system formally resolvable Likewise given the system of equations x y 0 y x 0 Rand Model Designer selects x and y as unknown variables and considers the resulting system formally resolvable too If the number of free variables is greater than the number of unknown variables that Rand Model Designer needs to select the automatic selection fails the system of equations is considered underdetermined all free variables remain free and the selection of unknown variables is deferred to the stage of processing the aggregate system of equations see Section 2 6 An example of an underdetermined system of equations x y and z are free varia
273. up menu The Global variable dialog box will appear as shown in Figure 31 2 Type the name of the new global variable in the Identifier field 3 To specify the type of the new global variable click Type The Choose type dialog box will appear see Section 3 4 10 When done click OK in the Choose type dialog box 4 To specify the value of the new global variable click Value 5 If necessary type the comments for the global variable in the Comments field 6 If you want to assign the new global variable to one or more groups click LJ The Groups dialog box will appear see Section 3 4 11 When done click Apply in the Groups dialog box 7 If you want to mark the global variable as a discrete check the appropriate box 8 Click OK in the Global variable dialog box Global variable Identifier KF Type double Help Value 0 7 discrete variable Comments E More a Figure 1 Global variable dialog box To modify a global variable with Global variable dialog box 1 Double click the global variable in the Project Manager window or Right click it in the Project Manager window and choose Edit from the popup menu The Global variable dialog box will appear as shown in Figure 31 Use the Global variable dialog box to modify the variable When done click OK 79 3 3 5 User Defined Functions and Procedures For detailed in
274. upe serif ae ee haan nee EEE a tare AAE AE dears 47 2 14 Functions and Procedures rearing Ta ETE E TA ET 48 2 14 1 Predefined Functions and Procedures cccceeeeseeeeeeetteteeeenaes 48 2 14 2 User Defined Functions and Procedures cccecsceeeeeeeteeeeenaes 55 2 15 EXPLeSSIONS sicces tess iestce tecivcadeha n eed teens e a 59 2 1951 OperatlOns irea a eae are ia tle aT 59 2 15 2 Evaluation Order c cccecessccceeeseceretuecedeetesecececsnsccneentneecetueneceeeeseate 61 PAI LDN OTS KENO EEO EAE E can ras Sagat cea tee aces a eee eee 62 2 16 1 Assignment Operator ececeececeeeeecneeeeeeneeeeeenaeeeseenaeeeeeenaeeeeeseaas 62 2 16 2 Procedure Call Operator ccccccceceeeeeeeeceeeeeeeeeeseceaaeeeeeeeeettees 62 2 10 39 Theat Opera O aaea a lechelateltelied cael ad deadid psec eed deeded 62 2 16 4 The Case Operator cccccceceeececcccceceeeeeeeeeceeeaeeeeeeeeesecniaeeeeeeeeeteees 63 2 16 5 The loop Operator c ccccceeeeeceeceeceeeeeeeseceneaeeeeeeeeesecsieaeeeeeeeeettees 64 2 16 6 The exit Operator cc cccccccceeeecee cee ceeeeeeeeeceeeaeeeeeeeseseceaaeeeeeeeeeteees 64 2 16 7 The return Operator 2 0 2 0 cceceeecccceececeeeeeeeeeeeeeceeeeesesecuieeeeeeeeeeeteees 65 2 16 8 The Send Operator ccccccceeeecceceececeeeeeeececeaeeeeeeeeesecnacaeeeeeeeeeteees 65 2 16 9 Optimization Operator ccecececcceeeceeeeeeeeeeeaeeeeeeeeeeecniaeeeeeeeeeteee 66 2 16 10 Submodel ex
275. ure 242 contains the following elements e nonlinear constraints This group of options specifies the method used to solve optimization problems with nonlinear constraints Possible options Powell Random search e bounds on the variables This group of options specifies the method used to solve optimization problems where variables have individual feasibility ranges Possible options Quasi Newton Direct search e noconstraints This group of options specifies the method used to solve optimization problems without constraints Possible options Conjugate gradient algorithm Quasi Newtown Direct search 215 4 2 15 2 6 The Modes Tab Numerical methods Tolerance Differential equations Algebraic differential equations Algebraic equations Optimization V Consider structure of the equations while calculating V Execute structure analysis Consider equation blacks Figure 243 The Modes tab The Modes tab see Figure 243 contains the following elements e Consider structure of the equations while calculating If this checkbox is checked numerical methods are instructed to take into account the structure of the aggregate system of equations e Execute structure analysis If this checkbox is checked numerical methods are instructed to perform structure analysis of the aggregate system of equations e Consider equation blocks If this checkbox is checked nu
276. urns false Finalized x returns true if the object x is hybrid and has already reached its final state see Section 2 4 5 returns false otherwise fromBlock B x returns frozen value of the variable x from another block of equations with symbolic name B for example fromBlock B1 z 2 y 0 FullNane returns a string the full name of the object in view of hierarchy getFilePath title fexts opens a dialog box that allows the user to select a file Returns the path to the selected file title specifies the dialog box title fexts specifies the comma separated list of allowed file extensions Example getFilePath Select file txt tab Infinity returns the infinity value as defined by ANSI IEEE Std 754 1985 InputVar x opens a dialog box that allows the user to modify the value of the variable Ignored in the embeddable model x InstanceHandle returns the integer instance ID of this object Instance IDs are unique cross all instances of a particular class but are not unique across different classes o interpol fx fy x returns an interpolated value of the function whose values fy are tabulated for points fx x specifies the argument for which to return the interpolated value Returns NaN if x is outside the interval spanned by fx interpolXY xy x returns an interpolated value of the function specified by the n by 2 matrix xy whose first column contains the a
277. utput variables Y double YO Function This block implements the transfer function W s T 7 which is equivalent to S o d K X Y the equation dt T 5 1 7 COscillatingUnit COscillatingUnit Figure 258 COscillatingUnit Class name COscillatingUnit Parameters K double 1 the gain factor T double 1 the time constant Dzeta double 1 the damping factor 0 the initial value of X XO double 0 the initial value of Y YO double Input variables X double XO Output variables Y double YO Vy double 0 245 Function K T s 2 T E s 1 This block implements the transfer function W s which is equivalent to the following system of equations dY an dVy KX DET Vyay dt T 5 2 NONLINEAR BLOCKS 5 2 1 CDeadZone CDeadZone gt A B Figure 259 CDeadZone Class name CDeadZone Parameters K double 1 the gain factor D double 1 the dead zone width X0 double 0 the initial value of X Input variables X double X0 Output variables Y double 0 Function This block implements the function shown in Figure 260 246 Y Ke E D YeKe E D Figure 260 CDeadZone function 5 2 2 CSaturation CSaturation J p Figure 261 CSaturation Class name CSaturation Parameters K double 1 the gain factor UpperLimit double 1 the upper bound on the input s
278. utton and drag the selection rectangle around the elements you want to select 2 Release the left mouse button when finished To add an element to the selection 1 Click the element while holding Shift The element will be added to the selection see Figure 95 Figure 95 Multiple elements selected To select all elements of the behavior chart 1 Right click anywhere in the editing area and choose Select all from the popup menu All elements of the behavior chart will be selected see Figure 96 Figure 96 All elements selected To move the selected element s 1 Drag the selected element s to the desired location 115 To delete the selected element s 1 Click Delete on the behavior chart editor toolbar or Right click the selection and choose Delete from the popup menu or Hit Delete To toggle the grid 1 Click Grid on the behavior chart editor toolbar Regardless of whether the grid is visible or not all operations align all elements to the grid At any moment the behavior chart can be converted into a hybrid local class see Section 2 11 To convert the behavior chart into a hybrid local class 1 Right click anywhere in the editing area and choose Behavior chart to class from the popup menu The Enter the local class name dialog box will appear as shown in Figure 97 Enter the local class name Figure 97 The Enter the local class name dialog box 2 Type the name
279. vailable in Trial and Individual versions 213 4 2 15 2 4 The Algebraic equations Tab Numerical methods Tolerance Differential equations Algebraic differential equations Optimization Modes Automatic Explicit methods p Implicit methods DAE methods Modified Newton C RADAU C DDASSL C classical Newton l C Powell C Automatic Figure 241 The Algebraic equations tab The Algebraic equations tab see Figure 241 contains the following elements 214 Automatic This option selects the automatic solver Explicit methods This group of options allows the user to select one of the following explicit methods Modified Newton Classical Newton Powell Implicit methods This group of options allows the user to select the following implicit method RADAU DAE methods This group of options allows the user to select one of the following methods intended primarily for solving algebraic differential equations DDASSL Automatic 4 2 15 2 5 The Optimization Tab Numerical methods Tolerance Differential equations Algebraic differential equations Algebraic equations nonlinear constraints mno constraints Powell Conjugate gradient algorithm Random search C Quasi Newton Direct search bounds on the variables Quasi Newton Direct search Figure 242 The Optimization tab The Optimization tab Fig
280. value To apply the current changes and close the Component Editor window 1 Click Apply To close the Component Editor window without applying the current changes 1 Click Close 3 5 CALCULATOR The Calculator window allows the user to evaluate expressions involving parameters see Section 2 8 variables see Section 2 9 constants see Section 2 10 and predefined functions see Section 2 14 1 The Calculator window looks as shown in Figure 143 138 Formula calculator E ed felass expression Result Model x Model exp Ro sqrt 2 Figure 143 The Calculator window To open the Calculator window 1 Click Calculator HI on the main toolbar or Choose Tools Calculator from the main menu To enter an expression for evaluation 1 2 Select a row in the Calculator window If the expression will involve parameters variables or constants of some class specify the class To do that right click the selected row and choose Choose class from the popup menu The Choose class dialog box will appear as shown in Figure 144 In the Choose class dialog box select the class and click OK The name of the selected class will appear in the first cell of the row Note you can choose at most one class per row Choose class 4 IS Imported packages P This project Class 1 Class 2 Class_3 Model mal New class Figure 144 The Choose class dialog box
281. values for variables 4 1 0 Figure 106 The Actual values dialog box 2 To modify the actual value of a parameter or the initial value of a variable double click the corresponding item in the Actual values dialog box or right click the corresponding item in the Actual values dialog box and choose New value from the popup menu A value editing dialog box as shown in Figure 107 will appear 119 Type of expression is Double Apply Figure 107 Value editing dialog box 3 Type the expression for the actual parameter value or initial variable value When done click Apply The Actual values dialog box will display the modified parameter or variable with the sign 4 Torestore the actual value of a parameter or the initial value of a variable to the default value right click the corresponding item in the Actual values dialog box and choose Restore default value from the popup menu 5 Finally click Apply in the Actual values dialog box To restore the inherited activity of a state 1 Right click the state and choose Restore inherited activity from the popup menu 3 4 14 2 2 Transitions For more on transitions see Section 2 4 2 To create a new transition 1 Select the source state and click Transition 4 on the behavior chart editor toolbar or Right click the source state and choose New transition from the popup menu The behavior chart editor will start displaying a dashed line starting at the bor
282. ve model as class from the main menu or Right click anywhere in the class editor tree of the Model class and choose Save model as class from the popup menu The Enter the new class name dialog box will appear as shown in Figure 137 Enter the new class name Figure 137 The Enter the new class name dialog box 2 Type anew class name 3 Click OK A new class with the specified name with be created The contents of the Model class will be moved into the new class that is copied into the new class and erased in the Model class 135 To move the contents of another class into the Model class 1 Right click anywhere in the class editor tree of the Model class and choose Load model from class from the popup menu The Choose class dialog box will appear as shown in Figure 138 Choose class Ie Imported packages P This project Class 1 Class 2 Class 3 Model Figure 138 The Choose class dialog box 2 Select the class whose contents is to be moved into the Model class 3 Click OK The contents of the selected class will be moved into the Model class The selected class will be deleted To erase the contents of the Model class 1 Click Clear model description A on the main toolbar or Choose Model Clear model description from the main menu or Right click anywhere in the class editor tree of the Model class and choose Clear model description from the popup menu A confirmation messag
283. window allows the user to edit various textual properties including e Equations see Section 2 5 e Expressions specifying parameter variable and constant values see Section 2 15 e Function and procedure code see Section 2 14 2 e State and transition actions see Section 2 4 1 and Section 2 4 2 e Comments 105 is Equation editor Model Projectile E E L bY N 00 gt a y at _ 2x at m gq Fa sinTeta Fa cosTeta sinTeta Figure 80 The Text Editor window The Text Editor window see Figure 80 consists of the editing area and the toolbar The editing area allows the user to edit text The toolbar provides shortcuts to most of the functions of the Text Editor window When the Text Editor window is used to edit equations or expressions the editing area displays user input in natural mathematical form 3 4 12 1 Toolbar Buttons The Text Editor window toolbar contains the following buttons d inserts parentheses inserts a division t inserts a call to the sqrt function B inserts a call to the exp function B inserts a first derivative Ei inserts a second derivative e i inserts a call to the integral functor e E _ inserts a superscript power eo fs inserts a subscript e Gl inserts a fixed size matrix l inserts a minimize operator ws e inserts a maximize operator e _ inserts the infinity symbol e inserts a right arrow
284. witch point cannot have a trigger A transition exiting a switch point can have either a guard or a special else label A transition with an else label is called an else transition A switch point can have at most one outgoing else transition When a switch point is visited an outgoing transition whose guard evaluates to true is immediately selected and executed If there is no such transition the else transition is executed 20 If a switch point does not have an outgoing else transition upon visiting the switch point the guard of exactly one outgoing transition must evaluate to true If a switch point does have an outgoing else transition upon visiting the switch point the guard of at most one outgoing transition may evaluate to true A switch point cannot have entry actions exit actions or activity 2 4 7 Probabilistic Switch Point A probabilistic switch point is a special state that when visited results in immediate selection and execution of one of the outgoing transitions The transition to be executed is selected randomly among the outgoing transitions based on the probabilities associated with them On a behavior chart a probabilistic switch point is shown as a rhomb surrounding a smaller solid filled rhomb as in Figure 11 lt probability 1 gt Figure 11 Probabilistic switch point A transition exiting a probabilistic switch point can have neither trigger nor guard Instead of a guard a transition exiting a probab
285. wn in Figure 183 Select items of V_1 10 one item E H C all items Cancel Figure 182 The Select items dialog box for vectors Select items of V_2 10 10 x Figure 183 The Select items dialog box for matrices C all items 3 To add a single element of the vector or matrix choose the one item option and identify the element using the field s on the right 4 To add all elements of the vector or matrix choose the all items option 5 Click OK The selected element s will be added to the Diagram window Previously added variables can be removed from the Diagram window using the Diagram parameters dialog box see Section 4 2 4 1 To remove a variable from a Diagram window 1 Double click anywhere in the Diagram window or Right click anywhere in the Diagram window and choose Parameters from the popup menu The Diagram parameters dialog box will appear as shown in Figure 184 167 Diagram parameters variable Type Min max Color width x idouble 1 double double IV legend step IV fixed Y bounds IV auto scaling IV time scroller max Iv 3D F smooth lines aN OOo B grid Color fill i vert lines ics Z horiz dots 3 points Panels Caption Kaxislobel o Figure 184 The Diagram parameters dialog box min Color 1 Color 2 2 Right click the variable in the list at the top and choose Delete from the popup me
286. wn variables node or any of its sub nodes in the equation system editor or Right click the Unknown variables node or any of its sub nodes in the equation system editor and choose Edit from the popup menu The Select unknown variables dialog box will appear as shown in Figure 88 Select 5 unknown variables Independent variables 5 Unknown variables 1 Cancel Figure 91 The Select unknown variables dialog box 2 Use the and 3 Click OK uttons to modify the Unknown variables list as necessary If necessary the initial values of the first derivatives can be modified via the sub nodes of the Initial values for derivatives node 112 To modify the initial value of the first derivative of a variable 1 Double click the corresponding sub node of the Initial values for derivatives node or Right click the corresponding sub node of the Initial values for derivatives node and choose Edit from the popup menu The Text Editor window will appear as shown Figure 92 is Initial value for z Figure 92 Editing the value of the first derivative of a variable 2 Use the Text Editor window to edit the expression for the first derivative 3 Click OK 3 4 14 Behavior Chart Editor The behavior chart editor see Figure 93 allows the user to edit the behavior chart of a hybrid class For more on the behavior chart see Section 2 4 OL WP DGS 06 E aI xX p gt fA Bm U_Saturation CY Ee le ee ee ey eee m
287. you can specify not only equations but also declarations of known and unknown variables i Equation editor Class_1 Figure 83 Editing equations example 1 Click OK in the Text Editor window If the number of equations is equal to the number of explicitly declared unknown variables the new system of equations will appear in the equation system editor immediately as shown in Figure 84 Otherwise Rand Model Designer will attempt to select the required number of unknown variables automatically see Section 2 5 If the automatic selection succeeds the resulting system of equations will appear in the equation system editor immediately as well Continuous behavior x y x 2 phit theta phi theta 1 2 2 Unknown variables phi x Y z H A Initial values for derivatives 2 0 Equations Figure 84 Resulting system of equations example 1 If the automatic selection of unknown variables fails for example as in the case of a system of equations shown in Figure 85 the Select unknown variables dialog box will appear as shown in Figure 86 Js Equation editor Class_1 x z phit theta phi theta 2 thetatyvy O a z _ dt2 nknown phi Figure 85 Editing equations example 2 109 Select 5 unknown variables Independent variables 5 Unknown variables 1 Cancel Figure 86 The Select unknown variables dialog box 6 In the Select unknown variables dialog box you
288. ype gt lt component_stereotype gt input output flow contact connector lt Model_class_definition gt lt class_definition gt lt actual_initial_values gt lt variable_name gt lt value gt lt variable_name gt lt value gt In this syntax lt identifier gt is an identifier see Section 6 2 lt type gt is any type allowed in the current context For more information see Section 2 13 lt value gt is a value being assigned to an object parameter variable constant etc The type of the value must be convertible to the type of the object lt expression gt is an expression see Section 2 15 lt text_until_end_of_line gt is an arbitrary text until end of line The MVL language also includes the pragma operator that is used to represent behavior chart and structure diagram graphics 263

Download Pdf Manuals

image

Related Search

Download downloads download chrome download google chrome download teams download slack download zoom download windows 11 downloads folder download firefox download chrome for pc download steam download roblox download discord download winrar download chrome for windows 11 download adobe reader downloads on this device download google download youtube videos download youtube download whatsapp download excel download java download spotify download 7-zip

Related Contents

PILULAS COLMAN VITAMINADAS  EDITAL_SRPQ_ANEXO VI Regulamento  

Copyright © All rights reserved.
Failed to retrieve file