Working with Building Blocks
Use building blocks to construct your model.
The Model Build Toolbar provides five building blocks:
- Stocks – A stock is a container that accumulates something. It collects whatever flows into it.
- Flows – A flows fills or drains stocks. An arrowhead on the flow pipe indicates the direction of the flow. The flow's equation acts as a valve, controlling the rate of flow.
- Converters – A converter holds values for constants, defines external inputs to the model, calculates algebraic relationships, and serves as the repository for graphical functions. In general, they convert inputs into outputs.
- Connectors – A connector connects model variables to each other.
-
Modules and Sectors
Modules are self-contained "sub-models" that you can connect to other models. Modules let you break a single model into well-defined "chunks" or sub-models, with each module appearing in its own window.
Sectors let you group building blocks in the same diagram to identify "sub-sections" of a model. When you're running a simulation, you can use sectors to choose parts of the model to run without running other parts.
General Tips for Working with Building Blocks
- Add a block to the diagram - Click a building block tool, then click in the diagram. The block will appear in the diagram. It'll be selected when it shows up, and its properties will appear in the Properties panel. After adding a building block, holding down the Alt key will allow you to add another of the same type.
- Add multiple blocks of the same type - Double-click the building block tool. The tool will remain selected after you add a block and until you click on another building block tool.
- Select a block for editing - Click a block. For flows, click the circle for the flow you want to edit. If you're in Explore mode, double-click the block. The block will be selected, and its properties will appear in the Properties panel.
- Move a block - While it's selected, drag the block to a new location.
- Rename a block - While it's selected and in Edit mode, click the name of the block, then type a new name or edit the existing one. Press Enter to create a multi-line block name.
- Move a block's nameplate - Click and drag the nameplate to a new location (above, below, to the left, or to the right of the block). Hold down Shift to get more control over positioning it.
- View or edit a block's properties - Select the block. The block's properties will appear in the Properties panel.
- View results for a block - With an open Results Panel, single-click the block. Simulation results for it will be displayed in the Results panel.
- Change a block's appearance - In the Properties panel, click the Style tab to change a block's font or colors.
- Delete a block - Select the block, and press Delete or Backspace, or choose Cut or Delete from the Edit menu.
- View or edit a module's model - Double-click the module. Its underlying model will appear. Click to view the parent module or to view the model.
Resizing Model Objects
When you select an object in Edit mode, a number of handles appear.
- Objects with six handles - These objects can be resized by dragging any handle. They include stocks, converters, modules, text objects, numeric displays, tables, and graphs.
- Flows - By default, flows have a draggable valve and two draggable handles, one on each flow connection. The valve can be dragged in any direction when it's not connected, and the entire object will move. When it's connected to another object, its motion is constrained in various ways.
- Connectors - By default, connectors have a start and end point. Once you've created a connector, you can select the start node (tail), and you can disconnect the end (arrowhead). See Controlling Flow and Connector Paths, next.
Controlling Flow and Connector Paths
When connecting flows and connectors to other objects, you can add nodes to the connection paths, letting you control their shape. Nodes create right-angle turns for flows and bezier curves for connectors.
Use the same process for either type.
To add one or more nodes to a flow or connector path:
- With the flow or connector disconnected at one end, press Shift. A node will be added each time.
- Add more nodes as needed.
- When you're finished, drag the flow or connector to a compatible building block until it highlights, then release the mouse. Then they'll be connected, and the nodes will become handles you can move as needed.
To add more nodes to an existing path:
- Disconnect the flow or connector from the block it's connected to, but don't release the mouse. For connectors, you can just disconnect the arrowhead.
- Press Shift to add a node.
- Add more nodes as needed.
- Reconnect the flow or connector to the building block.
- Move the nodes as needed to adjust the connection path.
To delete a node:
- Click to select a flow. A handle will appear for each node. For connectors, node handles are always shown.
- Click to select the node you want to delete. It will highlight.
- Right-click (Ctrl-click or ⌘-click on Mac) and choose Delete. The node will be removed.
Tip: When a flow or connector has more than one node in its connection path and you click to select a node, you can delete the node without deleting the building block.
To reposition flows and connectors:
- To detach a flow from a stock, click and drag the flow's move handle away from the stock.
- To re-attach a flow to a stock, click and drag the cloud end of the flow onto the stock.
- To reposition a connector, click and drag the connector's handle to a new position on the variable it's attached to.
See Also