11. Hyperflow Model¶
The hyperflow model on derivation graphs accessible through
mod::flow::Flow
(C++) and mod.Flow
(Python)
consists of many different variables and constraints.
This page is not meant to fully describe the model but to describe how the
variables are available in the C++ and Python interface.
11.1. Variable Specifiers¶
The following information is common for both the C++ and Python interface.
Though, in Python the specifiers are defined in module scope, while in C++ they
are defined in the namespace mod::flow::vars
.
Thus, it may be useful to use the using-declaration
using namespace mod::flow::vars;
when defining linear expressions/constraints in C++.
Each defined specifier represents a sum of variables, and indexing the
specifier retrieves a specifier for a single variable (or a sum of a subset of
the variables) as indicated by the argument.
E.g., inFlow
represents the sum \(\sum_{v\in V}x^-_v\) while
inFlow[x]
retrieves the specifier for \(x^-_v\) where x
is either
the vertex \(v\) or a graph associated with that vertex
in the underlying derivation graph \(\mathcal{H} = (V, E)\).
In the table below, the “Type” column refers to the types
flow::VarSumVertex
/FlowVarSumVertex
or
flow::VarSumEdge
/FlowVarSumEdge
.
Specifier |
Type |
Module |
Description |
---|---|---|---|
|
Vertex |
Base |
The input flow variables, \(x^-_v\).
When listing a solution the column header for this variable is |
|
Vertex |
Base |
The output flow variables, \(x^+_v\).
When listing a solution the column header for this variable is |
|
Vertex |
Base |
Indicator variables for \(x^-_v > 0\). |
|
Vertex |
Base |
Indicator variables for \(x^+_v > 0\). |
|
Vertex |
Base |
Indicator variables for \(x^-_v < x^+_v\). |
|
Vertex |
Base |
Indicator variables for \(x^-_v > x^+_v\). |
|
Vertex |
Base |
Indicator variables for \(x^-_v = x^+_v = 0\). |
|
Vertex |
Base |
Variables for flow through each vertex, \(\sum_{v\in V}\sum_{e\in \delta^-(v)} x_e\). The indexed variable specifier retrieves the inner sum for some \(v\). |
|
Vertex |
Base |
Indicator variables for \(\sum_{e\in \delta^-(v)} x_e\). |
|
Vertex |
Base |
Variables for flow through each vertex, which enters and exits the vertex from/to the network.
That is, excluding the flow that is covered by |
|
Edge |
Base |
The edge flow variables, \(x_e\), without the input/output edges. |
|
Edge |
Base |
Indicator variables for \(x_e > 0\) for the non-input/output edges. |
|
Edge |
Base |
For each unique unordered pair of edges (not input/output)
\(e_a = (S_a, T_a), e_b = (T_a, S_a)\) there is an indicator variable indicating
\(x_{e_a} > 0 \wedge x_{e_b} > 0\).
The indexed specifier can only be retrieved if the given
|
|
Vertex |
OverallCatalysis |
Indicator variables for overall catalysis.
When listing a solution the column header for this variable is |
|
Vertex |
OverallAutocatalysis |
Indicator variables for overall autocatalysis.
When listing a solution the column header for this variable is |
|
Vertex |
Thermodynamics |
Variables for the free energy of each molecule/vertex.
When listing a solution the column header for this variable is |
|
Vertex |
Thermodynamics |
Variables for the logarithm of the concentration for each molecule/vertex.
Note that the concentration it self does not appear in the model, only these variables.
When listing a solution the column header for this variable is |
|
Edge |
Thermodynamics |
The thermodynamic energy difference for each reaction/hyperedge. |
11.2. Objective Function¶
The objective function is always minimised and can be changed to any linear expression. The default objective function is determined by the enabled modules. Each module will add some linear expression to the objective function if it is enabled. If the objective function is explicitly specified by the user, it is not modified by the modules.
Extension |
Added Linear Expression |
---|---|
Base |
|
OverallAutocatalysis |
|
OverallCatalysis |
|
Thermodynamics |
\(0\) |