====== Mass balance ====== Mass balance block is used to calculate the difference between the total of inputs and outputs of a system. **Note:** //In versions prior to Ecolego 8, this functionality does not exist.// {{:mass_balance_block.png?100|}} Mass balance block can be used for monitoring if there are any unpredicted differences between inputs and outputs of a model.\\ * __In case your model has source/sink blocks defined__, user selects the relevant sources and sinks, in the values tab of the created mass balance block. It is important to list **all** sources that represent the external input to the model, as well as **all** of the sinks, that represent parts where the matter is leaving the model, inside the mass balance block for the correct result. * __In case that the user doesn't have any defined source/sink blocks in the model__, it is enough just to add the mass balance block to the model, and Ecolego will know how to calculate the mass balance on it's own. ===== Creating a Mass balance block ===== From the [[Projects_window|Projects window]] * Expand the Project to which you wish to add the mass balance block by clicking the + symbol next to it. Right-click on ‘Blocks’, or a [[Sub-system|sub-system]] in ‘Blocks’, and select **Mass balance** from the pop-up menu. From the [[Matrix_window|Matrix window]] * Right click an empty diagonal cell of the matrix and select **Mass balance** from the the pop-up menu. From the [[Blocks_window|Blocks window]] * Place the mouse anywhere over the area of this window and right-click on it. Select **New | Mass balance** from the pop-up menu, //or// * In the title bar, select **Mass balance** from the **Type** drop-down list and click on the {{:New24.png|New}} button. ===== Editing a Mass balance block ===== |Note|Most block properties can be edited directly in the [[Blocks_window|Blocks window]].| The block editor is shown by right-clicking the block in a window and selecting **Edit**. In the [[Blocks_window|Blocks window]], you can also show the block editor by selecting the block and clicking the {{:Edit24.png|Edit}} button, or by double-clicking the right-most “validation” column of the block. The block editor has three tabs: == Properties == This tab lets you edit basic properties such as name, sub-system and base unit. See [[Editing_properties|editing properties]] for more information. == Appearance == This tab lets you edit the visual properties of the block in the [[Matrix_window|matrix window]] and [[Graph_window|graph window]]. See [[Editing_appearance|editing appearance]] for more information. == Values == This tab contains the information on the values that the user defines for this block. To select the sources/sinks that should be included in the calculation of the mass balance block, the user needs to move them from the column in the left to the column to the right, in this tab. {{:mass_balance_values_tab.png?400|}} **Dimension** - The dimension is specified by selecting the dropdown list named Dependencies. Here the user can select the amount of dependencies, which define the number of dimensions that are added to the block. The later appearing dropdown lists define what you want your block to be dependent on (e.g. Materials, Elements, but also custom made Index lists). ===== Example: Practical use of Mass balance block ===== This block can be a very helpful tool for testing models that contain a big number of [[Compartment|compartments]] and are using the "non-negative" option. When the user wants to make sure that compartments inventory is not going bellow the 0 value, the "non-negative" field is selected inside the compartment. This is a useful feature of Ecolego, however, if the user is not careful, they can create systems that might have some "false positive input" (where the inventory of one compartment increases, even though it should decrease). When using this mentioned feature, it is important to write proper logical equations inside the [[Transfer|transfer]] blocks connected to these compartments, to take into account of this truncations. To make sure this is done properly, one might want to use the Mass balance block. This block can easily detect if there are any discrepancies of this sort, and show the difference from the excepted output and the actual output of the model. ===== See also ===== * [[Block|Blocks]] * The [[Blocks_window|Blocks window]] * The [[Matrix_window|Matrix window]] * The [[Graph_window|Graph window]]