PACTOT model
Contents
PACTOT model¶
The PACTOT (Process ACTivity – Object Trade) model is based on linear constrained optimization. It was developed for the UK material flow mapping project, and then extracted here.
Model structure¶
One possible representation of processes is to define their “recipe”, that is the material inputs and outputs associated with the operation of the process.
For example, the processes in this figure:
can be defined as:
which describes, for example, that 70% of the output of the “rolling” process is finished goods, while 30% is scrap.
If the scale of operation of each process is \(X_j\), then the inputs and outputs of material \(i\) are \(u_{ij} X_j\) and \(s_{ij} X_j\) respectively.
In addition, there may be imports \(v_i\) and exports \(w_i\) of some materials. In the example diagram, this applies only to material \(i = 3\).
Finally, conservation of mass should apply for the intermediate materials (in this case \(i = 3\)):
The problem is to determine the flows (i.e. the size of the arrows on the diagram), such that the conservation equation(s) are satisfied, while accounting for any [uncertain] data that may be available.
Constraint matrices¶
The model variables are listed in a vector \(z\):
Because the magnitude of the flows of different objects may vary by orders of magnitude, the model is set up to use normalised variables. Each object type \(i\) has a representative scale \(K_i\). The scale of the process activity \(K_j\) is defined relative to the scale of the process’s main input or output. So:
These constraints are encoded into constraint matrices of the form \(\boldsymbol{C} \boldsymbol{z} = \boldsymbol{v}\).
First, objects must balance:
where the 4 sub-matrices correspond to \(\hat{\boldsymbol{x}}\), \(\hat{\boldsymbol{v}}\), \(\hat{\boldsymbol{w}}\), and \(\boldsymbol{\rho}\) respectively.
Second, some processes are expected to balance:
where the subscript “bal” indicates the subset of columns corresponding to processes which should be expected to balance.
Thirdly, the density should be 1 for objects which are measured in kg:
where, similarly, the subscript “kg” indicates the subset of rows corresponding to objects which are measured in kg.
Finally, the import and export flows should be zero for objects which are not traded:
where, again, the subscript “no trade” indicates the subset of rows corresponding to objects which are not traded.
These constraint matrices are stacked to form the complete set of constraints:
Cost function¶
The variables are solved in a least-squares optimisation, minimising the weighted residual error in the observed data values:
where \(D_k\) is the measured value for observation \(k\), and \(g_k\) is the function describing what the observation is measuring.
The cost function is
which should be minimised within the constraints described above.
The weight \(W_k\) is currently simply the numerical “quality” score assigned to the observation.
Observation types¶
Different types of observation measure different aspects of the system.
Process input observation of object \(i\) into process \(j\): \(g_k = u_{ij} x_{j} \)
Process output observation of object \(i\) from process \(j\): \(g_k = s_{ij} x_{j} \)
Import observation of object \(i\): \(g_k = v_{i} \)
Export observation of object \(i\): \(g_k = w_{i} \)
It’s also convenient to describe some more complex observations, which match the data that is sometimes available:
Consumption observation of object \(i\) is the sum of all inputs: \(g_k = \sum_j u_{ij} x_{j}\)
Production observation of object \(i\) is the sum of all outputs: \(g_k = \sum_j s_{ij} x_{j}\)
In the code, the measurement function \(g_k\) is represented by a matrix multiplication:
Example¶
Suppose we have data as follows. For example, these values might be reported in international trade statistics or national industry datasets.
Observation (\(k\)) |
Model variable \(g_k\) |
Value \(D_k\) |
---|---|---|
Input of iron ore |
\(u_{11} X_{1}\) |
\(= 80\) |
Input of coke |
\(u_{21} X_{1}\) |
\(= 30\) |
Imports of steel |
\(v_{3}\) |
\(= 50\) |
Exports of steel |
\(w_{3}\) |
\(< 20\) |
Production of final goods |
\(s_{62} X_{2}\) |
\(= 90\) |