====== Tutorial 2 - Creating compartments ======
===== 2/7 =====
This lesson will teach you how to create [[Compartment|Compartment]] blocks, and how to connect them with [[Transfer|Transfer]] blocks.
The two state variables //Cwater// and //Cfish// (the mass of the contaminant in water and fish resp.) are modelled with [[Compartment|Compartment]] blocks.
\\
**Creating a project**
- Create a new project by clicking the {{:New24.png|New}} button on the [[Menu_bar#Toolbar|toolbar]] or by selecting **File | New** from the [[Menu_bar|Menu bar]].
- Make sure that the [[Modeling_layout|Modeling layout]] is visible by clicking the {{:MatrixView24.png}} Modelling button on the [[Menu_bar#Toolbar|toolbar]].
\\
**Creating the Water compartment**
- Make sure that the [[Matrix_window|Matrix window]] is opened by selecting **Window | Matrix** from the [[Menu_bar|Menu bar]].
- Right-click the first diagonal element in the [[Interaction_matrix|Interaction matrix]]. Select **Compartment** from the pop-up menu.
- Double-click the [[Compartment|Compartment]], or right-click it and select **Edit** from the pop-up menu.
- Make sure that the **Properties** tab is selected
* Enter “Water” in the **Name** field.
* Enter “Mass in water” in the **Full Name** field.
- Select the **Apperance** tab.
* Click the **Image** button. Select “Media | Water.jpg”.
- Select the **Values** tab. In the table, write //“100”// in the **Initial Condition** column.
- Close the edit window by clicking **Ok**
\\
**Creating the Fish compartment**
- Right-click the second diagonal element in the [[Interaction_matrix|Interaction matrix]]. Select **Compartment** from the pop-up menu.
- Double-click the second [[Compartment|Compartment]], or right-click it and select **Edit** from the pop-up menu.
- Select the **Properties** tab
* Enter “Fish” in the **Name** field.
* Enter “Mass in fish” in the **Full Name** field.
- Select the **Apperance** tab.
* Click the **Image** button. Select “Fauna | Fish.jpg”.
- The initial condition for //Fish// is 0 by default, so you do not need to enter anything in the **Values** tab.
- Close the edit window by clicking **Ok**
{{tutorial_compartment.png}}
\\
**Next**
* [[Tutorial_2-Creating_transfers|Creating transfers (3/7)]]
**Previous**
* [[Tutorial_2-Creating_a_compartment_model|Creating a compartment model (1/7)]]
**References**
* [[Tutorials|Back to Tutorials]]
* [[start|Home]]