For example,
It is desired to model the heat transfer to the wall of a container
with liquid and gas, each phase modeled with one node while the
wall has some number of nodes with fixed areas. The level of the
liquid height varies so the area involved in the heat transfer
changes. To capture this ratios of the areas of the wall associated
with the heat transfer are needed to create the balance equations
for Q_flows and T. This function will return the factor matrix (fA)
such that
for i in 1:nPhases loop
Q_flows_phase[i] + f[i,:]*Q_flows_wall[:] = 0; // where f is from function variableFactor
T_phase[i] = fA[i,:]*T_wall[:];
end for;
function meanFactor extends TRANSFORM.Icons.Function; input Real[:] variable "Array with variable values"; input Real[:] fixed "Array with fixed values"; output Real[size(variable, 1), size(fixed, 1)] fA "Ratio factor matrix"; output Real[size(variable, 1), size(fixed, 1)] f "Ratio factor matrix"; end meanFactor;