====== Tutorial 3 - Creating vector and matrix parameters ====== ===== 3/4 ===== **Creating materials** Like in [[Tutorial_2-Creating_a_compartment_model|Tutorial 2-Creating a compartment model]], we will use [[Material|Material]]s to model the contaminants. Open the [[Materials_window|Materials window]] and create the following [[Material|Material]]s: ^Name^Full name ^Symbol ^ |NO |Nitrogen Oxide |NO | |SO_2|Sulphur Dioxide|SO2| \\ **Changing parameter dimensions** If you open the [[Index_lists_window|Index lists window]] you will see a list of all available index lists. The index lists are expanded by clicking the ”+” symbol. As you see there are indices for all transfers, compartments and materials. {{:tutorial_3_3_1.png|Screenshot}} These index lists can be used to create [[Parameter|Parameter]]s that are material, compartment or transfer dependent. This makes it, for example, possible for you to create //one// parameter which is used in many different [[Transfer|Transfer]]s. Depending on in which object it is used, Ecolego will use a corresponding value found in the parameter. \\ **Creating input** The //input// parameter is a simple material-dependent vector.
  1. Open the [[Blocks_window|Blocks window]] if it is not already open.

  2. Right-click the //input// parameter, and choose **Edit** from the pop-up menu.

  3. Select the **Values** tab. Change dimension to “1 dependency”.

  4. Set the drop-down list that appears to “Materials”.

  5. Assign the following values:

    ^Materials^Value^ |NO |10 | |SO2 |20 |
  6. Close the window by clicking **Ok**

\\ **Creating ic** The //ic// [[Parameter|Parameter]] is used as the initial condition for both [[Compartment|Compartment]]s. It is a matrix parameter with different values for different compartments and different materials.
  1. Right-click the //ic// parameter, and choose **Edit** from the pop-up menu.

  2. Select the **Values** tab. Change dimension to “2 dependencies”.

  3. Set the first dependency to to “Materials”.

  4. Set the second dependency to “Compartments”.

  5. Assign the following values:

    ^Materials^Compartment^Value^ |NO |Upper_Soil |1000 | |SO2 |Upper_Soil |1000 | |NO |Lower_Soil |10 | |SO2 |Lower_Soil |100 |
  6. Close the window by clicking **Ok**

\\ **Creating a sub-set index list for TC** The //Transfers// [[Index_list|Index list]] has one index for each [[Transfer|Transfer]] in the model. It thus have the following indices: \\ |Deposition | |Upper_to_Lower| |Lower_to_Sink | \\ The parameter //TC// is only used for the two [[Transfer|Transfer]]s //Upper_to_Lower// and //Lower_to_Sink//. If we assign the //Transfers// index list to //TC//, we would have to put a “dummy”-value for //Deposition//, as the parameter is not used there. Instead we can create a sub-set of the //Transfers// [[Index_list|Index list]] which does not include //Deposition//, and use it for //TC//.
  1. Open the [[Index_lists_window|Index lists window]]

  2. Right-click the //Transfers// [[index_list|index list]] and choose **New | Sub-set** from the pop-up menu.

  3. A new [[Index_list|Index list]] is added to the list named “Transfers_Sub_Set”. Right-click it and select **Edit** from the pop-up menu.

  4. Select the **Properties** tab and change the name to “Soil fluxes”.

  5. Select the **Values** tab. Unselect the “Deposition” index.

  6. Close the window by pressing **Ok**

  7. Open the [[Blocks_window|Blocks window]].

  8. Right-click the //TC// parameter, and choose **Edit** from the pop-up menu.

  9. Select the **Values** tab. Change dimension to “2 dependencies”.

  10. Set the first dependency to “Materials”.

  11. Set the second dependency to “Soil fluxes”.

  12. Assign the following values:

    ^Materials^Soil fluxes ^Value^ |NO |Upper_to_Lower|0.005| |SO2 |Upper_to_Lower|0.03 | |NO |Lower_to_Sink |0.13 | |SO2 |Lower_to_Sink |0.07 |
  13. Close the window by clicking **Ok**

\\ **Next** * [[Tutorial_3-Running_a_simulation|Running a simulation (4/4)]] **Previous** * [[Tutorial_3-Creating_the_model_objects|Creating the model (2/4)]] **References** * [[Tutorials|Back to Tutorials]] * [[start|Home]]