====== Editing values ====== ==== Overview ==== Most blocks require specific information, such as equations, initial conditions or parameter values. When you edit a block, these are entered in the **Values** tab. In most cases, the values tab contains a table which lists all the information asked for by the block. {{:values_table.png|Editing values}} |//Drop down// |The drop down menu is presented when the block has more than one dependency, as it is then not possible to display all the information using two dimensions. | |{{:TransposeTable10.png}} |Transposes the table (swaps rows for columns). Only works when the block has at least one dependency. When the block has more than two dependencies, the dependencies and headers are "rotated" as described below. | |{{:ShowMoreHeaders16.png}}|When selected, all available properties will be displayed in the table, when unchecked all but the most important properties are hidden. | |{{:HideDefaults16.png}} |When selected, rows and columns for [[Default_value|default values]] are hidden. This is makes sense for parameters, where you typically always have different values for different contaminants, whereas it makes less sense for expressions where the equation is typically the same for all contaminants.| |{{:HideIndices16.png}} |When selected, only default values are displayed. For expressions, clicking this button will provide more space to enter a long equation. | ==== Dimension ==== Blocks in Ecolego can have different dimensions. This allows blocks to have dependencies - the most common being material dependence. This way parameter values for different substances can be grouped inside the same block. ==== No dependencies ==== {{:EditingScalar.png|Editing values}} The picture above shows the editing window of a parameter with no dependencies. Each attribute, or type of value, is listed as a row in the table. Note that less important value types have been hidden by de-selecting the {{:ShowMoreHeaders16.png}} button. ==== One dependency ==== By selecting **1 Dependency** from the dropdown list, the table changes: {{:EditingVector.png|Editing values}} A new drop down menu appears next to the dependency menu, from which the dependency can be selected. Dependencies are defined by [[Index_list|index lists]] and by default a material dependency is selected. The table now displays one row for each index in the index list, including a row for the default value (see below). Each column displays a specific attribute. The rows and columns can be swapped in order to transpose the table: {{:TransposeTable10.png}} {{:EditingValuesSwap.png|Editing values}} The default value can be used in order to specify values which apply to all indices (materials in the example below). The default value will be applied to all values for which no explicit value has been set, and are coloured blue. {{:EditingValuesDefault.png|Editing values}} ==== Two dependencies ==== For a block with two dependencies, the table changes yet again: {{:EditingMatrix.png|Editing values}} The dependencies can be swapped by clicking on the **<>** button between their corresponding drop down lists. The table cannot display all data; a drop-down list appears from which you select the attribute to display. Clicking the {{:TransposeTable10.png}} button no longer transposes the table, but rotates the headers of the table. This way the attributes can be displayed as rows and the dependency as a drop down list. ^Header ^Before ^Becomes ^ |Drop-down|Attributes|Materials | |Rows |Population|Attributes| |Columns |Materials |Population| For a block with two dependencies, there are not only one default value per attribute but several. This way you can specify a default value for all indices or the default value for a specific index. A default value given for the last dependency will override a default value for the first dependency, which in turns overrides the default value given for all indices. ==== Three dependencies ==== {{:EditingTensor.png|Editing values}} Another drop down list will now be displayed for the last dependency. This drop down list contains all indices of the last dependency, as well as a default index. It might seem impossible to end up in a situation where all these dimensions and default values are required. However, when writing expressions, the dependencies are often determined by the parameters used in the expression. ==== Toggle ==== By clicking **Toogle** button [[constants_editing_tool|Constant editing tool]] is appiered. ==== Example: Three dependencies ==== Assume a model where a couple of compartments correspond to volumes of contaminated soil: //TopSoil//, //MidSoil// and //DeepSoil//. The compartments are material dependent. A parameter //Volume// is created which is compartment dependent: ^Index ^Value (m3)^ |TopSoil |200 | |MidSoil |300 | |DeepSoil|600 | An expression //Concentration// is created in order to calculate the concentrations of the three compartments and store them in a single block. The equation is the mass of each compartment x the volume of each compartment. //Concentration// thus has two dependencies: material and compartment. The equation will be the same for all materials, but different for the compartments. ^ ^-Default- ^Chloroform ^Benzo(a)Pyrene ^ |-Default-| | | | |TopSoil |**TopSoil/Volume** |TopSoil/Volume |TopSoil/Volume | |MidSoil |**MidSoil/Volume** |MidSoil/Volume |MidSoil/Volume | |DeepSoil |**DeepSoil/Volume**|DeepSoil/Volume|DeepSoil/Volume| The model is now properly vectorized. New contaminants can be added without having to change any equations. However, we would like to investigate how the model behaved if the volumes of the soil change over time. A [[Lookup_Table|lookup table]] is created named //VolumeOverTime//. A scenario is created called //Time changing volumes// and the dimension of the //Concentration// expression is changed to three where the new dependency is //Scenarios//. For the scenario //Time changing volumes// the equations are changed so that: For the -default- scenario ^Scenario: -Default-^-Default- ^Chloroform ^Benzo(a)Pyrene ^ |-Default- | | | | |TopSoil |**TopSoil/Volume** |TopSoil/Volume |TopSoil/Volume | |MidSoil |**MidSoil/Volume** |MidSoil/Volume |MidSoil/Volume | |DeepSoil |**DeepSoil/Volume**|DeepSoil/Volume|DeepSoil/Volume| For the time changing volumes scenario: ^Scenario: Time changing volumes^-Default- ^Chloroform ^Benzo(a)Pyrene ^ |-Default- | | | | |TopSoil |**TopSoil/VolumeOverTime** |TopSoil/VolumeOverTime |TopSoil/VolumeOverTime | |MidSoil |**MidSoil/VolumeOverTime** |MidSoil/VolumeOverTime |MidSoil/VolumeOverTime | |DeepSoil |**DeepSoil/VolumeOverTime**|DeepSoil/VolumeOverTime|DeepSoil/VolumeOverTime| We have now seen an example of where three dimensions where used, and where the default values where applied for different dependencies.