====== Compartment ====== A compartment is a [[Block|block]] that acts as an integrator of quantities of [[Material|materials]] in a model. The quantity held within this block is calculated with a differential equation, where the input and output rates are defined by the [[Transfer|transfer]] blocks. Compartment is often used with [[source_sink]|Source Sink]] block. ===== Creating a compartment ===== From the [[Projects_window|Projects window]] * Expand the Project to which you wish to add the compartment by clicking the + symbol next to it. Right-click on ‘Blocks’, or a [[Sub-system|sub-system]] in ‘Blocks’, and select **New|Compartment** from the pop-up menu. From the [[Matrix_window|Matrix window]] * Right click an empty diagonal cell of the matrix and select **Compartment** from the the pop-up menu. From the [[graph_window|Graph window]] * Place the mouse anywhere over the area and right click on it. Select **Compartment** from 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 **Create | Compartment** from the pop-up menu, //or// * In the title bar, select **Compartment** from the **Type** drop-down list and click on the {{:New24.png|New}} button. ===== Editing a compartment ===== |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 “Notification” column of the block. The block editor has five tabs: ==== Properties ==== This page lets you edit basic properties such as name,full name, sub-system and base unit. See [[Editing_properties|editing properties]] for more information. ==== Appearance ==== This page 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 page lets you specify initial conditions and other index specific properties. See [[Editing_values|Editing values]] for more information. **Dimension** - You can specify the dimension of the block by using the **Type** drop down list. Depending on the dimension the index drop down lists are activated. **Settings** button allows enable or disable handling radioactive decay. **Headers** - You can select way to display data. **Data** * **//Indices//** - For blocks that are non-scalar, the first columns will specify indices from the [[Index_list|index lists]]. This allows you to specify different expressions for different indices. The top row is named “default” and can be used when the same value should be set for all indices. * **Initial condition** - Allows you to enter an expression for the initial inventory of the corresponding material. Note that a value, a parameter or an [[Expression|Expression]] in the initial condition is evaluated when the simulation is started and time = t0. The [[Expression_editing_tool|Expression editing tool]] is available to help the user to enter and edit data. * **dy/dt** - Lets you add extra term to the differential equation of the compartment. This feature is useful, for instance, for a simple integration of values where it is not logical to modify the state of the compartment through transfers. * **Non-negative** – If set, the inventory of the compartment cannot be negative. //Default = “disabled”//. This feature, though very useful, can affect the model in a way that the non-existing inventory is later added to following compartments. To avoid issues with this, make sure transfer blocks around it take into account for this truncation. Use [[Mass balance|mass balance block]] to test the system. * **Abs.tol.**– Sets the absolute error tolerance for the given material. If empty, the “global” value set in simulation settings is used. //Default = ''%%%%''// * **Author**- Allows to specify author of the compartment. May be usefull during the quality control of the model. * **Referece**- Allows to specify of literature source of the equation.May be usefull during the quality control of the model and for other users of the model. * **Comment**- Allows to put notes related ti this compartment. ===== See also ===== * [[Block|Blocks]] * The [[Blocks_window|Blocks window]] * The [[Matrix_window|Matrix window]] * The [[Graph_window|Graph window]] * The [[transfer|Transfer]]