## 6 An Example of the Numerical Calculations  
The designed algorithm is applied to optimize the heat and mass transfer phenomena described by a system of nonlinear differential-algebraic equations. In general, the technological effectiveness of the presented system in comparison with other available configurations was indicated in [25]. The modified counter-flow exchanger design task [26] with the DAE constraints in a semi-explicit form is constructed as follows:  
\[\min_{y_{1}(0)}(y_{1}(l_{f})-30)^{2} \tag{55}\]  
subject to:  
\[\dot{y}_{1}(l) = -B\cdot(z_{1}(l)-y_{1}(l))/l_{f}\] \[\dot{y}_{2}(l) = C\cdot(z_{2}(l)-y_{2}(l))/l_{f}\] \[\dot{y}_{3}(l) = C\cdot(z_{3}(l)-y_{3}(l))/l_{f}\] \[0 = E_{1}\cdotwhere \(y_{1}(l)\)--temperature in the first channel (\({}^{\circ}\)C), \(y_{2}(l)\)--temperature in the second channel (\({}^{\circ}\)C), \(y_{3}(l)\)--humidity ratio in the second channel (kg/kg), \(z_{1}(l)\)--temperature of the plate surface in the first channel (\({}^{\circ}\)C) \(z_{2}(l)\)--temperature of the plate surface in the second channel, \(z_{3}(l)\)--humidity ratio on the plate surface in the second channel (kg/kg), and \(z_{4}(l)\)--the static pressure (h Pa). Moreover, there is a vector of global parameters:  
\[p=\left[\begin{array}{c}B\\ C\\ D\\ E_{1}\\ E_{2}\\ P_{b}\end{array}\right]=\left[\begin{array}{c}30.0\\ 30.0\\ 0.058\\ 1.0\\ 2.5\times 10^{3}\\ 1000.0\end{array}\right] \tag{57}\]  
as well as a vector of initial conditions:  
\[y(0)=\left[\begin{array}{c}x_{y_{1}0}\\ 24.0\\ 10.4\cdot 10^{-3}\end{array}\right] \tag{58}\]  
and the independent variable domain:  
\[l\in[0.0\quad l_{f}]=[0.0\quad 1.0]. \tag{59}\]  
This model consisting of the differential-algebraic constraints has nonlinear algebraic relations. Therefore, analytical approaches are difficult to apply directly. Moreover, the numerical difficulty depends on the assumed parameters in the vector \(p\). In particular, the values of \(B\) and \(C\) show how dynamic the mass and heat transfer is in the system. Then, according to the vector \(p\), the solution procedure can result in an accurate solution for a slow dynamics or it can result in a computing error, if a considered transfer is rapid or sharp. The performed calculations indicate that the single shooting approach can be used if \(B\) and \(C\) are less than 10. The direct shooting strategies can be useful for \(B\) and \(C\) less than 20. For more dynamic processes, the co-operation of the multiple shooting with model parametrization seems to be appropriate.  
To solve the presented optimization task, the multiple shooting approach with DAE constraint parametrization is implemented. The applied parametrization fulfills the conditions:  
\[m_{f}=n_{y} \tag{60}\]  
and:  
\[m_{g}=n_{z}. \tag{61}\]  
The algorithm is implemented with two numerical procedures from the MATLAB environment [27]:  
* fmincon: The numerical optimization procedure is used to solve the parametrized continuous optimization task subject to the equality constraints. The numerical values of the objective and constraint functions are obtained with the outer DAE solver.
* ode15s: The outer solver is used to supply the state trajectories of the modified DAE relations for the given consistent initial conditions and values of parameters. This solver gives a support to finding consistent initial conditions.  
The new algorithm with 10 equidistant subintervals results in a stable solution. The added constraints force the continuity of the state trajectories, which are presented in Figures 1-3. The solution obtained for each subinterval is marked with a different color. The initial value of \(y_{1}(0)=17.7556\)\({}^{\circ}\)C is obtained. The value of the objective function is sequentially minimized, and finally, \((y_{1}(l_{f})-30)^{2}\leq 10^{-6}\).