We start the the project model development by defining its basic structure. We identify first the basic components the system consists of and how they are interconnected. In this simple problem we may identify the following components:
- - The system consists of the spring of stiffness k, damper of linear viscosity coefficient b, and body of mass m. The body is connected by the spring and damper.
- - The wall at the left serves to fix the left ends of the spring and damper. It belongs to the environment, which restricts the possible motion of the system. There is also a force by which environment acts on the body.
- - The body moves over the ground. By neglecting the friction between the body and the ground, we can neglect the interactions in the vertical direction.
To create the model we generally use the component models tools. Only for very simple processes the elementary models are used. We dragged the corresponding tools and drop them in the project document window.
Note that default font size for Component Model is large one, and for the elementary components the normal size. However, because there are more components we will choose a smaller font, the normal size. In addition the text for the components by default runs horizontally from left to right. We wish, however, to write the Wall title in the vertical direction. Therefore, before we drag and drop the component tool we select Normal in the Font Size branch of the Editing Box, and Vertical in the Text Orientation branch.
Creating Wall component model
Now we may construct the Wall component model. Thus, we put the mouse over the Component Model tool, press the left key and drag it to the project document window. As the mouse cursor enters the document area it changes its shape to the cross. We drop the tool near, but not too close to, the left gray border strip by releasing the key. The component is created only if it is completely off the gray strip. Now, a blinking vertical short line appears (the caret), indicating that we are in component title editing mode. Thus, we simply type the text “Wall” and the text starts running vertically up. We click somewhere outside the text to complete the component creation (see the figure on the left)
The component appears surrounded by a red bounding rectangle, which indicates that it is selected. The component already has two power ports at its boundary, a power-in and power-out ones. We note that the component icon also appears in the model three on the left of the document window. It is just beneath the project title. Before we continue editing we will click again to Horizontal in the Text Orientation branch to return to default horizontal running component titles.
In a similar way we create the other components: Spring, Damper and Body (see below). To define the force acting on the body we add elementary component SE (Source Effort) by dragging the corresponding tool and dropping it to the right of the Body. When dropping it the text “SE” appears and the caret. We accept it as default title by clicking outside of the text.
Creating and connecting the components
Now we have created all components the problem contains. We will rearrange the components and slightly change them. First, we drag Wall by its title and move it upwards near the top of the document. Because the spring and damper are connected to the right side of the wall, we put the mouse on the upper Wall's port and drag it around its boundary and drop it at the right top position; we drag also the bottom port and drop it at the right bottom position. In addition, we assume that spring and damper acts to the wall, and hence the power is transferred into the wall. Thus, we need to change the positive power sense of the bottom port. We can do it simply by clicking the port by mouse to select it, and then click the Change Port toolbar button (one with two opposite ports picture). The power port now is directed into the wall (see the figure below).
Moving the components up
Next, we drag Spring upwards by its title until its left port is on the same level as the Wall upper port and drop it there. Similarly, we drag upwards Damper and drop it beneath the Spring. Similarly we did with Body. We also move the SE port from its right side to the left side by dragging it around the component boundary. We drag SE component then by its title and until its port is at the same level as the right Body port and drop it. Note that we can move the components or their ports also by the cursor keys, but have to select them first. Note also that the Body needs an additional power port for connection of the Damper. Thus, we insert the additional port by dragging the Power-out port tool from Ports branch in Editing Box and drop it within the Body component boundary. Note that, as we approach the Body it’s bounding box jumps out. We drop the tool at bottom left position. The port is created and appears selected (see the figure above).
Connecting the component ports by bonds
Now we interconnect the components by drawing the bonds between the corresponding ports. Thus, to connect the Wall upper-right port to the left Spring port we put mouse over the Wall port, press it, and drag the mouse (by holding the key pressed) towards the Spring and the bond line appears following the mouse cursor. When the cursor is over the corresponding Spring port, because it is of the correct sense, it becommes selected and we release the key to connect to it. Now, the bond appears in red (selected) and the power-out port merges with it. In similar ways we may connect the other components, i.e. Spring to Body, Damper to Wall, etc.
When drawing a bond we may click to the intermediate points if we wish, e.g. to form a corner in the bond. Also, when the bond is drawn, it is possible to change its shape by dragging a point on the bond. As we drag it the bond changes its shape as an elastic strip that is fixed at its ends. We release it when we obtain the shape we wish.
Note, that all previous figures, but the last one, were generated by screen capture tool. The last one, however, was generated using Print to File command from Document menu. This command stores the current active document as graph in emf (Enhanced Metafile) file format. Such a file can be used for documenting (as we did here).
The model created thus far, however, is not complete; without the display components that collect and display data generated during the simulation it is really useless. BondSim has two such components: X-Y Display, which displays the input signals as X-T or X-Y plots, and Numerical Display, which displays the current value of the input signal.
The display components contain only the signal ports. Thus, their tools are inside Continuous Signal Components branch of Edit Box. We need to expand this branch first. It contains the other tools as well, such as input generator, function, integrator, nodes, etc. We drag X-Y Display tool and drop it below SE component. Similarly, we can drag the Numerical Display tool and drop it bellow X-Y Display (see the figure below).
The system level model of Body Spring Damper Problem
We wish to display the body position and its velocity during the simulation. Thus, we need to extract the corresponding signals from Body component and connect them to the displays. Thus, we have to create such ports first. Hence, we drag Control-out tool from Port branch in Editing Box and drop it at the bottom of Body. We repeat this operation and insert also one more control-out port to the right of it. Thus, we have created two control-out ports to extract the body position and velocity signals. We will connect the left one (the position port) to both X-Y Display and Numerical Display ports, and the right one (the velocity port) to a X-Y Display port only.
To branch the position signal we need to create a branching node first by dragging Node tool from Continuous Signal Components and drop it below the left bottom output port of Body. The Node has one input and two output ports. We will move the input port to the top position and drag the Node so that its top input port is straight bellow the Body left output port. Before we interconnect the signal ports we rearrange the bottom and left ports of X-Y Display so that they are tidily positioned on the left side of the display component. Now we may connect the Node input port to the left Body output port, and the node output ports to the input ports of X-Y Display and Numerical Display (see the figure above). Similarly, we connect the bottom right control port of Body to the upper left X-Y Display port. We may also to reshape the bond to look as in the figure above.
Thus, we have created the system level model of the problem in which all basic component models are created and are interconnected. Note that all components created so far also appears in the model tree on the left. The first four components are represented by icons in form of the empty pages, which indicate that it is necessary do define their models. We will come to this shortly. The other components use the icons reserved for the elementary components, i.e. the components that represent the complete entities. We consider them next.
The SE (Source Effort) is used to define an external force applied to the body. The process that such elementary component describes is defined in its port. Thus, we will open the component port by double clicking it. We may open it also by selecting it (by clicking) and then applying Open Next command from Document menu, or clicking Open Component toolbar button. A SE port dialog opens as shown in the figure below.
Source Effort port dialog
This dialog serves to define the constitutive relation of the effort (force) that this component delivers at its port. At the top of the window, inside Output Relation box, there are two editing boxes connected by the equality symbol. The effort variable on the left side can be defied in Port Variable box beneath this. We may change it to ‘F’. The right side defines it as a constant eValue. We may retain this symbol, but we will change its value by clicking Parameter button. Edit Parameters dialog opens as shown in the figure below on the left. Next, we select eValue from the list and click Edit button.
Define a parameter
A Define Parameter dialog opens as shown in the figure above on the right. We type 500.0 as the new value of the input force (in Newton; note the values of the physical parameters are in SI units). Now we accept the value by clicking OK in Define Parameter dialog, then OK in Edit Parameter dialog, and finally OK in SE Port dialog.
Next we define the symbols used to label the axes of X-Y Display. We can do it by clicking the input ports. Thus, if we click the position port (i.e. the lower one) an Output Port dialog opens as shown in the figure below. We define the variable name as ‘x’, and select Y axis. This means that variable will be plotted along the Y axis.
Output Port dialog
By default the variables are plotted on Y axis. X axis is used for time (in seconds), and thus we generate Y-T plot. We can also plot one of input variables on X axis, and all other to Y axis, and thus create X-Y plots. We can also select None as axis, i.e. not plot the variable. Because, the variables are often of very different ranges, we usually plot jointly the variables of the similar ranges, excluding the others. We do not need to define the scales for axes; they are done automatically during the simulation.
The final change that we will apply to the System model above is to change Numerical Display title to Position. To that end we disconnect its connecting bond first, by selecting it (i.e. clicking) and then press the delete key. Next, we choose small font from Font Size branch of Editing Box. After that we select the display component and right click it. From drop-down menu we select Edit Text. As the caret appears we delete title “Display” and type in “Position”. Now we click outside of this text to end editing. No we reconnect the display component port to the Node. We select again the Font Sizes back to normal. The final form of the system level model is shown below.
The final form of the system level model