Groundwater modelling with MicroFEM • Lesson 7B: Using formulas and the Xtra worksheet 
The same [Mark data or labels (F2)] button can be used for parameter values. When we want to mark the area where T1 is between 500 and 1500 m^{2}/d, select T1 / [Input mode] / [Ins] / [Del] / [Mark data or labels (F2)] / select the middle radio button "values in between" and enter 500 and 1500 in the upper and lower box / [OK].
Formulas: constants, operators, functions, parameters and variables
So far, we only assigned constant values in Input mode, for all or for a selection of nodes, e.g. 600 or 1800. However, similar to spreadsheets, it is allowed to also enter "formulas" and use brackets. Unlike Excel, you don't start with an = . A few examples: Open the Online Help (F1 key) and search the Index for "numbers" or "operators" to find the page "Using formulas when entering data" with all possible options. The same page can be found in Chapter: "Input of model data", section: "Using formulas".
Of these options many will only seldom be used. Nevertheless, expressions like: (1200334)/12*1.2^3 or sqrt(1000)+exp(3*ln(1.2)) are perfectly allowed. In previous lessons it became clear that all parameter have codes, e.g. H0, C1, T1, H1, Q1, C2, etc. All such parameter codes may also be used in formulas. The value of a code is (or can be) different for each node. For example, when the transmissivity of aquifer 1 is heterogeneous, varying from 200 m^{2}/d in one area to 1800 m^{2}/d in another, and you decide at a later stage that all these transmissivities are too low, and should be 100 m^{2}/d higher, all you have to enter is: "T1+100" and [F5] to assign this to all nodes. Similarly, "T1*1.1" will increase all values by 10%. When we enter a formula like: (H0–H1)/C1*1000 and assign that to all nodes, we compute the downward flux (mm/d) in the upper aquitard for each node of the entire model. There are also a limited number of variables that you can use in formulas. A variable is also a code that represents a value that is (possibly) different for all nodes. Here are some examples: Formulas are not stored when you enter them in a cell. They are immediately evaluated and the result is assigned to the parameter of the appropriate nodes. Later on we will see how such formulas can be stored for repeated use (when we discuss batch files). When we use formulas like (H0H1)/C1*1000 to compute results that should not be assigned to any model parameter, we need additional "working space" to store such results. This is where the "Xtra worksheet" comes in handy.
The Xtra worksheet
When assigning values in Input mode, the results of the formula are assigned to the parameter that corresponds with the cell where the formula is entered. For example, when we use the upper cell of the "Param" list, the resulting values are assigned to the H0 (fixed head at the top of the model) of each node. Each cell in the list has its own meaning, especially relevant when the model is run. This implies that we have a problem when we want to store temporal information that is no regular input or output data of the model. So we developed a special unit for that: the Xtra worksheet. It is sort of a spreadsheet, where each cell (row) contains data for all nodes.
Menu bar: Project / Project manager ... / add unit to project [green +] / Select Xtra worksheet / New / [OK] / Set the number of registers (cells, rows) to 20 / [OK] / Close project manager A new tab is added to the Table "Xtra". Click on it to display X1, X2, ... X20. In the left part there are no texts (only three dots) and in the right part are only 0 values.
Right click on the three dots of X1 / Enter a new text: "H0H1" / [OK] / Open the cell to the right / enter the formula "H0H1" / [F5] Right click on the three dots of X2 / Enter text "Flux mm/d" / [OK] / Open the cell to the right / X1/C1*1000 / [F5]
This assignment will fail when the C1 value of one or more nodes is zero. The parameter codes of the Xtra worksheet are: X1, X2, ..., etc. The Xtra worksheet will be saved with the model, but its contents are not used for model computations. It is only used to store additional information. The list can be as long as 99 cells (registers). The Xtra worksheet can be useful in many situations. For example, you can store the computed heads of different scenarios and compare results afterwards. To copy H1 into X8, all you have to do is open the cell X8, enter H1 and click the [F5] to copy the H1 value for all nodes. The Xparameters can be contoured in Drawing mode and displayed in the 3D viewer.
