tutorial_4-creating_expressions_and_parameters

Tutorial 4 - Creating expressions and parameters

Page 3 of 5

In this lesson an expression is created which calculates the contaminant concentration in different plants, and also the two parameters CF and RootFactor.

Creating CF

  • Open the Blocks window.
  • Select Parameter from the Type drop down list and click the New button on the title bar, or right-click the window and select Create | Parameter from the pop-up menu.
  • Edit the new parameter. In the Properties tab, give it the following properties:
NameFull Name
CF Concentration Factor
  • Select the Values tab.
  • Change dimension from “Scalar” to “Matrix”.
  • Set Index-1 to “Materials”. Set Index-2 to “Plants”.
  • Assign the following values to the parameter:
MaterialsPlantsValue
NO Pine 0.003
SO2 Pine 0.12
NO Fir 0.21
SO2 Fir 0.013
NO Wheat 0.06
SO2 Wheat 0.013
NO Oats 0.093
SO2 Oats 0.013

Click Ok to close the window.

Creating RootFactor

  • Select Parameter from the Type drop down list and click the New button on the title bar, or right-click the window and select Create | Parameter from the pop-up menu.
  • Edit the new parameter. In the Properties tab, give it the following properties:
Name Full Name
RootFactorRoot penetration factor
  • Select the Values tab. Change dimension from “Scalar” to “Vector”.
  • Set Index-1 to “Plant types”.
  • Assign the following values to the parameter:
Plant typesValue
Tree 0.6
Grain 0.001

Click Ok to close the window.

Creating the expression

  • Open the Blocks window
  • Click the New button on the title bar, or right-click the window and select Create | Expression from the pop-up menu.
  • Right-click the new expression and select Edit from the pop-up menu.
  • In the Properties tab, give the expression the following properties:
Name Full Name Symbol
PlantConcentration in plantAPlant
  • Select the Values tab. Change dimension from “Scalar” to “Matrix”. Set Index-1 to “Materials” and Index-2 to “Plants”.
  • In the Default row, enter the expression “CF * ( Upper_Soil + Lower_Soil * RootFactor )”
  • Click Ok to close the window.
NoteYou might wonder why Plant has to be a matrix when the expression is the same for all indices. This is because the dimension of an object determines the dimension of the output. Also, the parameters and blocks that are used have the combined dimension of 2).

Next

Previous

References

tutorial_4-creating_expressions_and_parameters.txt · Last modified: by Boris Alfonso

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki