The calculation procedure includes, if possible, data reconciliation, computation of unknown quantities and calculation of uncertainties using error propagation. At the beginning the plausibility of the system is checked and in the end statistical tests are performed to evaluate whether the performed data reconciliation is tolerable or not .

Here you find information about the following topics:

- Select Layers for Calculation
- Select Periods for Calculation
- Exclude Processes from Balancing (on Layer of Goods)
- Enter Additional Linear Relations
- Perform Calculation
- Change Options of Calculation Module Cencic 2012
- Change Options of calculation Module IAL-IMPL2013
- Toggle Scaling
- Change Initial Values of Unknown Variables
- Define Scale Basis
- Scale Data
- Install new Calculation Modules

Select which of the defined layers shall be considered for calculation.

- On the
*Edit*menu, select*Layers and Periods.* - On the
*Layers*tab, in column*Calculation*select which layer shall be considered for calculation. - Click OK.

Select which of the defined periods shall be considered for calculation.

- On the
*Edit*menu, select*Layers and Periods.* - On the
*Periods*tab select the first and the last period of the interval to be considered for calculation. - Click OK.

If only those input and output flows of process are modeled that contain a certain substance the balancing on the layer of goods (law of material conservation, transfer coefficient equations) does not make any sense. Those processes have to be marked.

- Select a process.
- On the
*Properties*window, select the*Process*tab. - Remove the tick in front of
*Balancing*.

Note:

- In the system diagram the name of processes that are not balanced during calculation on the layer of goods is written in brackets.

Additional linear relation between similar data types (e.g. two flows) can be added.

- On the
*Edit*menu, select*Edit Relations*. - Click on
*[Enter new relation]*and afterwards the button. - Choose the
*Value Type*(e.g. Masses, Volumes, Concentrations, Transfer coefficients),*Layer, Period*and*Source*of the variables A and B. - Define the proportion factor and confirm with
*OK.*

Note:

- You can delete defined relations by clicking the relation in the list and
pressing
*DEL.* - If relations between different layers have been defined scaling will be switched of during calculation out of technical reasons.

- For a quick start of the calculation click in the
*Data Input*toolbar or press*F5*.

or

- To set additional calculation options (calculation method, trace level)
choose
*Calculation Dialogue*from*Edit*menu or press*ALT + F5:* - Choose the calculation method (Cencic 2012 or IAL-IMPL2013)
- Optional: Settings to change parameters of the calculation methods. For
options refer to
*Options Calculation Module Cencic 2012*and*IAL-IMPL2013* - Optional: Choose the trace level (none < errors < warning < information < details) of logging.
- Click
*Start*. - After the calculation click
*Close*to display the results in the system diagram.

Note:

- After the calculation in the
*Trace Output*window a list of information, warnings and errors is displayed. Click any entry in this list to highlight the corresponding object in the system diagram. - The
*Trace Output*window offers the following options:

Show message grid

Show text messages. Output is dependent on trace level

Show/Hide Group-by-box: To group the listed messages by certain fields pull the according column descriptions into the grey grouping area above.

Clear all messages

This module was developed by Oliver Cencic. It offers the following calculation options:

- Convergence tolerance: If the 2-norm of the changes in the variable vector is less than this tolerance the iterative calculation will be stopped. Default = 1E-10.
- Zero values tolerance: All absolute values less than this tolerance will be considered zero during update of vectors and matrices.
- Observability tolerance: Matrix entries (absolute) smaller than this tolerance will be considered zero during variable classification according to Madron. Default = 1E-10.

Note:

- The old calculation module Cencic 2008 is still included in STAN 2.5 but it is recommended to use Cencic 2012 or IAL-IMPL2013.

This module was developed by Jeffrey Dean Kelly from Industrial Algorithms. It offers the following calculation options:

- Maximum number of non-zeros in any working matrix.
- Multiplier needed for sparse matrix operations.
- Scaling factor
- Scaling type: 0 (none), 1 (rows only), 2 (rows and columns = default), 3 (columns only).
- Gamma: A regularization parameter for B'*B to increase the numerical stability of the iterative solution especially when solving ill-conditioned systems => B'*B + gamma*Iy. Default = 1E-12.
- Epsilon: A regularization parameter for A'*Q*A + lambda*B*B' to increase the numerical stability if a row is vacuous => A'*Q*A + lambda*B*B' + epsilon*Ig. Default = 1E-12.
- Lambda: Estimated variance of the unmeasured variables used as a regularization parameter in A*Q*A' + lambda*B*B'. Default = 1E6. Will be used if no values for Lambda1 and Lambda2 are given.
- Lambda1 and Lambda2: for improved calculation of estimated raw variance of the unmeasured variables => w(i) = Lambda1 * (abs(y(i)) + Lambda2)^2. If Lambda1 or Lambda2 is less or equal 0 Lambda will be used instead. default = 100.
- Convergence tolerance: Convergence tolerance for constraint closure. If the constraint or function residuals have a 2-norm less than this tolerance then the iterative calculation is stopped.
- Zero values tolerance: All absolute values less than this tolerance will be considered zero during update of vectors and matrices.
- Observability tolerance: All entries in o.dat with an absolute value less than this tolerance will be considered zero (= observable).
- Method 1: Sparse matrix factorization technique or method used in the reconciliation solver. Valid values: 1,2,3,4
- Method 2: Sparse matrix factorization technique or method used in the post-reconciliation sensitivity solver to compute the observability and redundancy metrics. Valid values: 1,2.

Note:

- For large systems calculation module IAL-IMPL2013 is much quicker than Cencic 2012 because it is operating with sparse matrices.
- The license of IAL-IMPL 2013 included in STAN is
limited to a number of 200 equations + variables. If you are
interested in an unlimited version of IAL-IMPL 2013, please contact Jeffrey
Dean Kelly at Industrial Algorithms (jdkelly@industrialgorithms.ca)
to get an unlimited 7-days-trial-license or to purchase an unlimited perpetual
version for $100 (USD). The license file has to be installed by clicking the
*Install license*button.

Goal of the automatic scaling procedure is to reduce the condition number of the equation system (matrices) thus reducing the influence of disturbed input data (e.g. due to rounding errors) on the results. if scaling is not desirable or possible (e.g. use of subgood layers => scaling is switched off automatically) it can be switched off manually.

- On the
*Extras*menu, select*Options*and then tab*Calculation*. - Set/Delete the tick under
*Enable Scaling*.

To iteratively solve non-linear equation systems it is necessary to assign initial values to unknown variables. In STAN this procedure is performed automatically with the assistance of a random number generator. In some problems the choice of random numbers influences the results what is not desirable. Because of that STAN offers the possibility to change the start value of the random numbers generator, thus generating a different set of random numbers. If the calculation with different start values delivers the same results the problem can be considered stable.

- On the
*Extras*menu, select*Options*and then tab*Calculation*. - Enter a value between 0 and 999 as
*start value for generation of random numbers*.

- On the
*Model-Explorer*window, click the name of the system. - On the
*Properties*window, enter scale unit (e.g. capita) and scale factor (e.g. 100.000, meaning the entered data refer to 100.000 inhabitants).

Note:

- How to apply the scale factor look at Scale Data.

- On the
*Extras*menu, select*Options*and click the*Number Formats*tab. - On the
*Scale*pane, select the reference entity (scale basis, sum of imports, sum of exports).

Note:

- How to define the scale factor look at Define Scale Basis.

- On the
*Extras*menu, click*Calculation Modules*. - Click
*Install New Modules*. - Select the new module and click
*Open*. - Close the window.

Note:

- Copy the new calculation module (extension = .dll) to the subfolder "CalcModules" in the STAN directory ".
- The existing default calculation module "CalcModules.dll" must not be removed.
- To remove installed modules requires a restart of STAN.