System Dynamics Calculator
The Model Builder
The Model Builder is one of two basic components of the System Dynamics Calculator. The Model Builder offers the user a convenient graphical user interface to construct a model. Some users will not want to build a model or modify an existing model, and some calculator platforms will not afford the user interface capabilities necessary to make the model building process possible except fr the simplest of models.
The Model Builder immediately presents the user with a blank “canvas” and a “palette” of model components. The Model Builder allows the user to pick model components from the palette, place them on the canvas, connect them to other model components, define rules and relationships, and describe the nuances of behavior that will make the model meaningful. The Model Builder preserves graphical connections between components to allow the user to easily clean up and rearrange the model to keep it visually organized and uncluttered. The Model Builder also ensures that the model is logically rigorous and that the user describes all the essential details as the model is built.
Basic Drawing Functions
Many model-building operations resemble the actions performed with a typical computer 2D drawing application. A suite of basic drawing tools and features are required to build understandable and visually appealing models include the following features:
•a palette of model component shapes to select from and place on the canvas – the standard set of system dynamics model component types and their derivative subtypes
•a text tool for user input to define and place formatted text in a text box on the canvas
•select / unselect / select another / select all by each and by a region
•copy / paste / delete
•multiple undo / redo
•group / ungroup
•move to front / move to back
•units of measure such as pixels, metric (millimeters) or English (inches)
•grid feature that is configurable to display or hide major and minor gradients and establish their ratio
•guides for alignment of a number of model components
•snap to grid / snap to guide
•align selected to guide feature for edges and centers
•attach / detach lines (flow lines and variable lines) to shapes (stocks, flows, transformers, factories and fragments)
•scale shape on canvas by corners and edge relative to opposite or center
•scale canvas by percent / scale canvas to fit for display and to print / reset scale to default
•report template with a title, header, footer, multiple page support, page numbering, and date and time stamping
Basic Model Building Functions
Basic model building tasks begin with selecting a model component from the component palette and dragging or gesturing it onto the canvas. The symbols displayed on the palette are the last used; if the desired symbol is not displayed, it is available with a pop-up or pull-down list to select alternatives from. When the desired component is identified, it is selected and dragged onto the model canvas with a mouse movement or gesture, and it is placed with another mouse movement or button click or gesture.
Several techniques are essential for rapid model building such as shortcuts for component connection and expansion. The following user interface techniques are incorporated into the model builder:
•click or gesture on the canvas for the default text tool to present an alpha-numeric input method and locate the point of the text
•click or gesture on a model component on the canvas to select the component
•shift-click or gesture on a component to unselect a component or select another component
•drag or gesture on the canvas to select an area of the model
•drag or gesture on one or more selected components to move them on the canvas
•drag or gesture from the palette to the canvas to add a model component to the canvas
•drag or gesture a modeled stock, modeled flow or transformer from the palette and drop on an existing flow on the canvas to bisect the existing flow and insert the new component into the model
•drag or gesture a converter from the palette and drop on a variable line on the canvas to add an intermediate computation to the model
•click or gesture on the palate to select a flow or variable model component, then option-click or gesture on a component on the canvas to select a “from” component, and finally drag to the “to” component to connect two components with the flow or variable that is displayed on the palette
•option click or gesture on one end of a flow on the canvas and drag it to detach it from the model component it is attached to and drag it to another model component to attach it
•double-click or gesture on a converter operand variable line to add another operand to the converter; this technique is convenient with a custom palette that supports conventional calculator applications or when SHOWUSERINPUT is enabled for a converter that supports operand expansion
•click or gesture on a converter variable line label to enter a constant value
•click or gesture a model component on the canvas and drag off the edge to delete it
•click or gesture on the canvas (but not on a model component) and drag past the display edge to view the next canvas – to view another model layer
Several techniques are essential for efficient editing of a model component’s attributes:
•double-click or gesture on a component on the canvas to edit the component – to change the component subtype or modify any of its other attributes
•double-click or gesture on a character string in a formula or other attribute in a model component definition window to highlight the string, and then type to replace what was highlighted
•option-click or gesture on a function name or function place indicator to expose a function browser
Several style specification options are required features to present significant model characteristics and to maintain model clarity:
•symbol size style of small, medium, large and custom with a default
•minimum component spacing style specification including a default
•semicircular or right-angled variable lines style specification including a default
•semicircular or right-angled flow lines style specification including a default
•the ability to revert back to the current default style preferences for the entire model
•the ability to revert back to the current default style preferences for a selected subset of the model
•the ability to edit the current default for any style preference
•the ability to reset the current default to the manufactured default for any style preference
Several techniques are required to accommodate making and changing connections between model components. In particular, techniques supporting the following flow connectivity behaviors are required for flow lines and variable lines:
•drag an end of a line within a certain close distance of a modeled stock, custom modeled flow or transformer to connect the line to the model component – at a threshold distance, the line will snap to the edge of the model component and a modeled connection will be created
•drag and end of a line from the edge of a modeled stock, custom modeled flow or transformer up to a certain distance without disconnecting the line – up to a threshold distance, the line will snap back to the edge of the model component
•drag and end of a line along the edge of a modeled stock, modeled flow, transformer or converter to the other side of an adjacent line to reverse their order on the model component’s edge
•drag an end of a line more than a certain distance from the edge of a modeled stock, custom modeled flow or transformer to disconnect the line – past a threshold distance, the line will disconnect from the edge of the other model component and move freely according to the user’s mouse movement or gesture and a modeled connection will be deleted
•the user can release the end of a line without connecting it to another model component – in this instance, the Model Builder will establish a model builder alarm condition for the line until it is either deleted or connected to another model component
Moving shapes (stocks, flows, transformers, factories and fragments) also moves attached lines (flow lines and variable lines) and respects the right-angled or semicircular style specifications for the lines. There are several nuances to moving model components (shapes and lines) to preserve the model appearance:
•flow line edges and variable line edges on a modeled stock are initially orthogonal to each other
•flow line hemispheres and variable line hemispheres on a flow control are initially orthogonal to each other
•flow lines pass through the center of modeled flow controls
•flow lines and variable lines are distributed on an edge of a component from the center to the corners or on a hemisphere from the 90 degree angle to the 0 and 180 degree angles
•moving one or more attached lines from an edge of a model component to another component redistributes the lines on both edges affected
Several features are essential to facilitate cleanup, changes and rearrangement of the model drawing. For example, it may be necessary to reposition a stock to emphasize a reinforcement loop. The following methods are performed on the entire model or on collections of model components:
•compact the model
•expand (distribute) the model to an area
•remove overlap by rerouting flow and variable lines or repositioning the connected shapes
•cluster a group of model component on a horizontal and vertical basis for a grid arrangement
•cluster a group of model components on a circular basis for a loop arrangement
•create a fragment / destroy a fragment
•collapse to a fragment / expand from a fragment
Defining Model Relationships
Several simple rules are necessary for a convenient and straightforward model building procedure:
•stocks, transformers and factories are placed before the flows that connect them
•a custom flow can be placed on the canvas without inflow or outflow attachments
•converters are placed before the variables that attach to them
•naming is essential for graphs, tables and reports
Once stocks and transformers have been placed and attached to flows, the user begins to define relationships with formulas. The formula for a modeled stock level is a trivial formula that is built automatically by the calculator for the user:
•LEVEL t= i = LEVELt=i-1 + Σt= i inflows – Σt= i outflows where outflows include wastage
The formula for flow rates can be defined in either of two ways. The calculator begins to build the formula automatically. In the simplest case when only one variable is connected to the flow, the formula that the calculator automatically builds is the following:
•RATE = (variable)
The user can choose to insert a function
•RATE = ƒ(variable) where ƒ is a function placeholder to be defined by the user
If more than one variable is connected to the flow, the formula that the calculator builds automatically is the following:
•RATE = ƒ(variable1, variable2…)
A method is required for the user to choose an attribute to define with a formula. A method is required for the user to build a formula from functions supported by the calculator applied to the variables that are connected. The simplest approach to build a formula is to have the user act to insert a function, select the function from a list, and then choose the associated function variables required from a list of those that are connected to the flow. This method is applicable to any instance that the user has to build a formula for any definable attribute of any model component.
File Import / Export Functions
Several import and export methods are required for socializing models.
•import and export the model builder part in SD Calculator XML format
•import and export the model metadata part in SD Calculator XML format
•import and export the model builder file in Stella STM format
•import and export the model builder file in Vensim MDL format
•export of the model diagram in JPG, PNG and PDF formats
The Model Builder
Basic Drawing Functions
Basic Model Building Functions
Defining Model Relationships
File Import and Export Functions
Appendix: The Modeling Process