Page 54 - ExtendSim User Guide
P. 54

28
Building a Model
Building the model
Connecting blocks
As mentioned in Chapter 1, connections pass information from one block to another. Blocks are usually connected together by drawing connections from one block’s output connector to another block’s input connector.
☞ For a quick one-step method to add and connect a new Item or Rate block in a model, or to insert a new Item or Rate block between two already-connected blocks, see “Quick Tricks” on page 798.
Connectors
In ExtendSim, the behavior of most connectors is predefined for each specific block. For example, when you set a Math block to use a function (add, subtract, divide, etc.) it knows what to do with the values that are input into the block. This makes model building easy since you can connect blocks and run simulations without having to write equations to define what each block should do with the inputs or outputs.
There are several types of connectors in ExtendSim. Continuous mod- els, such as Reservoir, only use value input and output connectors to pass information from one block to another. Other types of connectors will be discussed in later chapters.
☞ Each input connector can only have one source of information. There- fore, blocks that need to have many sources of input require a separate input connector for each piece of information.
Types of connections
Input Output Value connectors
There are two types of connections in ExtendSim: line connections and named connections. Line connections join the output of one block to the input of another using connection lines; named connections use text labels as outputs and inputs, causing data to jump from the output to the input without using connection lines.
Connection lines can be drawn using three different styles: right-angle, straight, and multi-seg- ment. The default style is right-angle, which you will use in the following example.
The other styles of line connections, as well as named connections, will be discussed at “Addi- tional ways to connect blocks” on page 33.
Connecting the Lookup Table block to the Math block’s variable connector
In the Reservoir model, the two water sources need to be connected to the Math block so that the amounts of water entering the reservoir from rainfall and from the stream can be added together. The first step is to connect the Lookup Table block to the Math block.
As mentioned earlier, blocks that need to have more than one source of input require a separate input connector for each piece of information. ExtendSim provides for this by putting variable connectors on blocks that might need them. This is usually indicated by a black arrow beneath the connector that can be dragged to display additional connectors.
The Math block, for example, has a variable input connector as indicated by the black arrow below its input. However, since the Math block displays two inputs by default, you do not need to expand the variable connector. For more information about using variable connectors, see “Variable connectors” on page 574.
To connect the Lookup Table block to the Math block:
Tutorial


































































































   52   53   54   55   56