4. Optimization
In this section, the formulation of the mathematical optimization problem is presented. Therefore, we adopt the model equations presented in
Section 3 above and translate them into a set of decision variables, constraints, and an objective function. The resulting Optimal Control Problem (OCP) is implemented in Matlab as a Nonlinear Program (NLP) via the CasADi interface [
38]. The problem is solved by Ipopt [
39] and the linear solver MUMPS [
40].
For the transcription of the mathematical model, we discretize the ODEs based on the forward Euler method and adopt the direct multiple shooting approach [
41], where the continuity of the state variables is ensured via so-called gap closing constraints. As a result, the exemplary ODE
is implemented as a set of
equality constraints as follows:
where
k is the discrete time index and
is the uniform time period between consecutive samples. The square brackets are used to indicate discrete-time vector elements, compared to the parentheses for arguments of continuous-time functions. Due to the non-convexity of the overall OCP, we acknowledge that local optima might exist, and therefore do not claim global optimality within this study.
4.1. Constraints
To implement the model from
Section 3, we utilize (22) to transcribe (3), (4), (7), and (13)–(21). To further ensure the integrity of our model the following identities are always in place. They are also indicated in
Figure 2. The temperature of the cooling water exiting the engine is equal to the temperature entering the plate heat exchanger, i.e.,
The temperature of the heating water exiting the HXE is equal to the temperature entering the HXP, i.e.,
Furthermore, we ensure that the following physical boundaries are met at all times. The difference between the temperatures of the coolant entering the engine and leaving the engine is kept below a certain threshold value in order to prevent stress cracks in the engine block. We therefore set
Hence, in order to emulate the dynamical behavior of the pumps and valves, respectively, we further constrain the change rates of the mass flows controlled by both centrifugal pumps and the split factors of both three-way valves, yielding:
with
for cooling and heating circuit, respectively. Finally, the temperature state of the coolant inside the engine introduced in (5) is defined to be the arithmetic mean of the temperature entering and exiting the engine,
4.2. Objective
The main purpose of our optimization problem is to find quick warm-up strategies, an objective that is not simple to implement within the proposed time discretization in (22). Therefore, we use a workaround by adding an additional condition to the problem that forces the warm-up phase to be completed after a certain time, and then we repeatedly reduce this time and continue to solve the problem until it is no longer feasible. The last feasible solution is the one we are looking for. Of course, there are many other search algorithms that are applicable here, such as the bracketing method.
The additional condition mentioned above is implemented as the following inequality constraint
where
represents the point in time
from which the desired temperature
of the water supplied by the CHP is guaranteed to be at least at the reference
. For numerical stability, we formulate the objective of our OCP as follows:
where
is again predefined for each iteration as described above. This formulation minimizes the sum of squared temperature deviations at
only instead of along the entire horizon, which offers the optimization as much freedom as possible in how it arrives there.
To obtain actuator and state trajectories of the system beyond the warm-up phase, we chose a time horizon that is longer than . We further set , which in our experience represents a good balance between accuracy and computational efficiency. Still, due to the computational effort caused by the iterative nature, we see this method, at least in its current rudimentary implementation, as being suitable mainly for offline optimizations. For example, for creating reference trajectories, comparing system designs and control strategies, or gaining a deeper understanding of optimal warm-up strategies.
4.3. Further Variants of Objectives
The objective in
Section 4.2 is mostly intuitive, as we aim to reach a defined steady-state temperature as quickly as possible. However, many further cost functions can be implemented in a straightforward fashion, depending on the respective physical priorities. To showcase the flexibility of our framework we include two cost function variants in the following considerations, while the one introduced above in (30) is denoted by Temperature Deviation for clarity.
The first variant prioritizes heating up the engine. As soon as the engine has reached the steady-state reference temperature, the objective changes to raise the supply temperature as quickly as possible. This variant thus accounts for the fact that the engine is the main source of heat energy that is being transferred to the heating water circuit during warm-up conditions. As a further benefit, a quick warm-up of the engine also means a rapid warm-up of the engine oil, which has a favorable effect on durability. This variant is thus further denoted by Durability. The associated objective function reads as
where
is the earliest point in time at which
is reached.
The index is constructed via a pre-simulation with a closed coolant valve, i.e., . We further note that we use the temperature exiting the engine in this case, as this is the relevant temperature for the heat transfer to the heating water via the plate heat exchanger.
The second variant connects to the statement of
Section 1 that the warm-up phase is characterized by a low total efficiency due to the almost complete lack of thermal efficiency. In this variant, we therefore formulate the objective so that the thermal efficiency during warm-up is maximized. An adequate measure is given by
where the time dependence is omitted for clarity. Since the supplied combustion heat
, the specific heat capacity
, and the return temperature
are all treated as constant, we can simplify the corresponding objective function to
This variant is further denoted by Efficiency.
5. Case Study
In this section, we present eight cases listed in
Table 1 that illustrate the versatility and flexibility of our proposed framework. Each case is associated with one of the three priorities and their corresponding cost functions presented in
Section 4.3. For a fair comparison of their performance, the time from which the temperature
must be at least be
is set to the smallest possible value that is feasible for all of them. For the corresponding cases ①, ②, and ③, this shortest warm-up time is found to be
, imposed by case ③ representing the priority Thermal Efficiency. This warm-up time already represents a reduction of about
compared to the measured reference case in
Section 3.5.
As is not the minimal warm-up time for the priorities Temperature Deviation and Durability, their time-optimal cases are represented by ④ and ⑤ with the corresponding warm-up times and , respectively.
To shed light on the influence of the system-specific actuator constraints on the solution of the OCP, we revisit cases ① to ③ as cases ⑥ to ⑧, respectively, but omit the actuator constraints (26) and (27).
Figure 5 directly contrasts cases ①–③ by means of two temperature curves: the main temperature of interest
and the temperature of the coolant exiting the engine
. The latter is listed to better illustrate the heat transfer across the plate heat exchanger, as both the hot side inlet temperature and the cold side outlet temperature are shown. In addition, the mass flows resulting from solving the optimization problem are listed for each case. Following our modeling approach in
Section 3, the valve inputs precisely represent a split factor that only forms a mass flow in combination with the associated pump input.
For case ①,
Figure 5 suggest that the optimal temperature curve for
closely follows the temperature curve of
, with a difference of about
for a large part of the warm-up process. The optimal characteristic for
consists of reaching a temperature level well above the steady-state reference temperature shortly before
. This strategy enables the water pump and valve, or
and
as their equivalents in the optimization, to ramp up the mass flow through the HXP and increase the heat transferred from the cooling to the water circuit. This quickly bridges the gap between
and
such that the latter rises above the steady-state reference of
at
. In turn,
decreases due to the elevated heat transfer. If
were to drop below the reference temperature,
would inevitably follow with a certain time delay. To prevent this, the optimizer reduces the coolant mass flow through the HXP by reducing the split factor
, thereby effectively dampening the effect on
. Furthermore, it can be noted that the optimization keeps the main coolant mass flow
as the equivalent of the coolant pump actuator approximately constant. This is largely due to the constraint in (25) that limits the coolant temperature difference across the engine.
In light of the observation that during warm-up conditions
represents the main source of thermal energy, case ② can be considered as an intuitive warm-up strategy. Here,
as in case ①. However,
Figure 5 shows that the slightly different objective leads to different key characteristics. As the priority is to bring
into line with the reference temperature, the optimizer closes both valves or sets both split factors
and
to zero, such that no heat transfer via the HXP is possible. Once
reaches the steady-state reference temperature, the control strategy raises
to
. As a result, heat is transferred from the cooling circuit to the water circuit. The mass flow
and the split factors
and
are therefore increased. Subsequently,
drops below the reference temperature. However, in this particular situation the optimal strategy is to decrease
and
, i.e., the mass flow of the heating water through HXP
, instead of
. This behavior can be attributed to the large temperature difference between
and
. To achieve the objective, it is optimal to slowly decrease the mass flow
. Consequently, both temperatures rise. Shortly before
, the engine temperature is well above the reference temperature such that the mass flows of both the pump and the valve of the water circuit are sharply increased to raise
to reference temperature levels. Similar to case ①,
is actuated here to prevent
from dropping below the reference temperature, as this would lead
to do the same and violate (29). Furthermore,
is also used here to limit the coolant temperature difference across the engine, which indicates that the influence on optimizing the warm-up process is negligible.
Case ③ shows a different characteristic than the two previous cases. Here, the warm-up strategy is actually time-optimal, as values smaller than
render the optimization problem infeasible. Following
Section 4.3, the objective is to maximize the thermal efficiency over the entire horizon while reaching
at
. The temperature trajectories shown in
Figure 5 share similarities with those in case ②, e.g., the engine is heated up first, the heating water valve is closed (
), and the heating water pump is kept at minimum speed (
). However,
and
are at their maximum for large parts of the entire warm-up process. This measure once again aims to limit the coolant temperature difference across the engine. The optimal strategy also takes advantage of
in this case because both the water pump and valve, i.e.,
and
, are actuated with high rates, which has a large impact on the temperature difference. The settings of the heating water mass flows are a direct result of the cost function in (33) since the product of both control inputs and the main CHP temperature
is maximized. From a strategic point of view, in case ③, the temperature
is first increased, although not up to reference temperature as in case ②. Subsequently, the mass flow through HXP, i.e., the product of
, is strongly increased, such that the CHP temperature
approaches
. Before
starts to decrease due to the high heat flow to the water circuit, the mass flow
is again decreased at a high rate. This is followed by a phase in which the mass flow alternately increases and decreases, which results in an increase-and-hold pattern of
until the reference temperature is reached at time
.
The previous considerations are limited to the comparison to a uniform warm-up time
, which is determined according to the feasibility limit of case ③. Accordingly, the comparison of the respective time-optimal cases ④ and ⑤ is shown in
Figure 6, where
and
, respectively (see also
Table 1). For case ④, except for the reduction in warm-up time, only marginal differences in the input trajectories from case ① can be observed. However, case ⑤ shows similar mass flow and split factor trajectories as case ③, despite the different objectives. This is due to the fact that in both cases,
is only raised once
has reached a certain temperature level. The resulting input trajectories are thus optimal to rapidly increase
according to the rate constraints in (26) and (27) and with respect to
.
In contrast to the previous considerations, the proposed framework can also be used to investigate interdependencies that would otherwise be cumbersome or technically impossible to determine. Thus,
Figure 7 illustrates cases ⑥–⑧, which are analogous with cases ①–③ presented in
Figure 5, but with the difference being that the input rate constraints (26) and (27) are omitted.
Figure 7 illustrates that the pumped mass flows and the water valve split factor do not fundamentally change compared to cases ①, ② and ③. The high-rate actuation becomes even more prominent for “Thermal Efficiency” (case ⑧) and begins to also occur for ⑥ and ⑦ shortly before the reference temperature is reached. The main characteristics of these actuators, however, remain similar. The exception to this is the coolant split factor, particularly for cases ⑥ and ⑦. The lifted rate-constraint enables the optimizer to utilize the split factor of the coolant valve to generate a smoother heat-transfer via the plate heat exchanger. This in turn also results in a smoother characteristic of the output temperature
. This can be seen particularly well in cases ⑦ and ⑧ as an initially large temperature difference between
and
is reduced until
. For cases ②, ③, and ⑤ the constraints (26) and (27) lead to a kind of plateau formation in phases of high-rate actuation (
Figure 5 and
Figure 6).