The model for the calorimetric simulation required the solution to a co-current heat exchanger in order to determine the amount of subcooling in the condensate that is returned to the reactor. This heat exchanger calculation needed to be repeated many times as the ODEs for the mass and energy balances were being solved. Therefore, the solution needed to be specified as a function which could be called by the ODE solver.
One method attempted was a symbolic solution to the three energy balances (hot fluid, cold fluid, and exchanged energy). However, the log mean temperature difference for the exchange equation could not be solved by the Mathcad symbolic solver. The system of equations could have been solved numerically in parametric form. Although I didn't use that method, it is demonstrated as "Method 2" in the attached file.
Instead, the balances on the hot and cold fluid were expressed as a system of two linear ODEs. This system has a know analytical solution that involves the use of eigenvalues and eigenvectors. Mathcad has built-in functions that compute the eigenvalues and eigenvectors for a matrix, so it was easy to obtain the solution. See "Method 1" in the attached file.
In the kinetic analysis program, the flow rate of the hot fluid, the inlet temperatures of both fluids, and the length of the subcooling zone were all functions of the state variables (i.e. the dependent variables in the ODEs for the reactor). Thus, the T0 vector of inlet temperatures, the B matrix and all eigenvalues and eigenvectors become functions of the state variables, Y, and dimensionless time, tau. This creates the functions needed for the outlet temperatures, T(Y,tau), a vector with two elements. The problem and solution in function form are shown below.
The capabilities of Mathcad made obtaining the solution very easy and its format made documentation very straight forward and easy to read.