Keywords

1 Introduction

A simplified optimal control problem is considered which is motivated by energy efficient building operation. The goal is to reach a certain desired temperature distribution in a room while choosing an optimal (underfloor) heating strategy. The temperature is governed by a heat equation with convection which extends our results in [3, 4], where no convection was involved in the modeling of the heat transfer. Since the heating is described by a time-depending discrete control, the optimization problem involves continuous and discrete variables. These kinds of problems are considered in [10, 11, 22, 32]. For partial differential equations (PDEs) we refer to the note [24]. In particular, mixed-integer problems for hyperbolic PDEs are considered, e.g., for problems in gas transportation systems [15], electric transmission lines [12] and traffic flow [16, 17].

Frequently, integer problems are solved with the branch-and-bound method (see, e.g., [5]) to guarantee global optimality. Especially for finite-dimensional linear integer programming, the branch-and-bound method is the method of choice. However, this is often not possible or very expensive for optimal control problems, where infinite-dimensional control spaces are involved. Therefore, methods are used to approximate an optimal integer solution by sufficiently accurate solutions, which can be computed by techniques from infinite-dimensional optimization. In this work we apply relaxation methods which can be found in [31] for the case of ordinary differential equations and in [16, 17] for the case of PDEs. To solve the relaxed optimal control problems, we rely on techniques from PDE-constrained optimization ( [25, 36]). Utilizing sum-up-rounding strategies (introduced by Sager in [31, 33]) we construct discrete controls from the continuous ones; see also [26, 27].

To speed-up the numerical solution of the relaxed optimal control problems we apply reduced-order modeling; cf. [1, 34], for instance. In this work the relaxed optimal control problems are solved by POD Galerkin projection methods; cf. [14, 19]. The POD method is known to be very efficient for dynamical systems. An POD a-posteriori error analysis – developed in [35] for optimal control problems – is extended in such a way that the error of the computed suboptimal POD solution can be controlled. This leads to an efficient and a certified optimization method which is also analytically based on theoretical results in [17].

Let us mention that there are other reduced-order approaches available, e.g., the reduced basis methods; cf. [13]. Especially for non-linear problems, the proper orthogonal decomposition (POD) method is a popular and widely used method. Here, predefined points in time are considered by a previously released dynamic system to build up the so-called snapshot space. The leading eigenfunctions of a singular value decomposition are then chosen as the basis for the reduced space, see for example [14]. It has been shown, that this method has good properties in the context of optimal control problems, especially thanks to an available a-posteriori estimate, see [23, 35].

The chapter is organized as follows: In Sect. 2 the mixed-integer optimal control problem is introduced. Its relaxation is explained in Sect. 3. The numerical solution approach is described in Sect. 4 and Sect. 5 is devoted to present numerical results. Finally, we draw some conclusions in Sect. 6.

2 Problem Formulation

Let \(\Omega \subset \mathbb R^n\), \(n\in \{1,2,3\}\), be a bounded domain with Lipschitz-continuous boundary \(\Gamma =\partial \Omega \). For \(T>0\) we set \(Q=(0,T)\times \Omega \) and \(\Sigma =(0,T)\times \Gamma \). Moreover, let H and V denote the standard real and separable Hilbert spaces \(L^2(\Omega )\) and \(H^1(\Omega )\), respectively, endowed with the usual inner products

$$ {\langle \varphi ,\psi \rangle }_H=\int _\Omega \varphi \psi \,\mathrm d{\textit{\textbf{x}}},\quad {\langle \varphi ,\psi \rangle }_V=\int _\Omega \varphi \psi +\nabla \varphi \cdot \nabla \psi \,\mathrm d{\textit{\textbf{x}}}$$

and associated induced norms. For more details on Lebesgue and Sobolev spaces we refer to [9]. Recall the Hilbert space \(W(0,T)=\{\varphi \in L^2(0,T;V)\,|\,\varphi _t\in L^2(0,T;V')\}\) endowed with the common inner product [8, pp. 472–479]. It is well-known that W(0, T) is continuously embedded into C([0, T]; H), the space of continuous functions from [0, T] to H. When t is fixed, the expression \(\varphi (t)\) stands for the function \(\varphi (t,\cdot )\) considered as a function in \(\Omega \) only.

In this work we consider the following mixed-integer optimal control problem:

$$\begin{aligned} \min _{(y,u)}J(y,u)=\frac{1}{2}\int _0^T \int _\Omega |y(t,{\textit{\textbf{x}}})-y^d(t,{\textit{\textbf{x}}})|^2\,\mathrm d{\textit{\textbf{x}}}\mathrm dt+\frac{\gamma }{2} \sum _{i=1}^m \int _{0}^T|u_i(t)|^2\,\mathrm dt \end{aligned}$$
(1a)

subject to a convection-diffusion equation

$$\begin{aligned} y_t(t,{\textit{\textbf{x}}})- \Delta y(t,{\textit{\textbf{x}}}) + v({\textit{\textbf{x}}}) \cdot \nabla y(t,{\textit{\textbf{x}}})&=f(t,{\textit{\textbf{x}}})+\sum _{i=1}^m u_i(t) b_i({\textit{\textbf{x}}}),&(t,{\textit{\textbf{x}}})\in Q ,\end{aligned}$$
(1b)
$$\begin{aligned} \frac{\partial y}{\partial n}(t,{\textit{\textbf{s}}})+ q({\textit{\textbf{s}}})y(t,{\textit{\textbf{s}}})&=g(t,{\textit{\textbf{s}}}),&(t,{\textit{\textbf{s}}})\in \Sigma ,\end{aligned}$$
(1c)
$$\begin{aligned} y(0,{\textit{\textbf{x}}})&=y_\circ ({\textit{\textbf{x}}}),&{\textit{\textbf{x}}}\in \Omega \end{aligned}$$
(1d)

and binary control constraints

$$\begin{aligned} u(t) \in \{ 0,1 \}^m=\{u^i \}_{i=1}^N\quad \text {in } [0,T] \, \text {a.e.} \, \text {(almost everywhere)}, \end{aligned}$$
(1e)

where the \(u^i\)’s are 0–1-vectors in \(\mathbb R^m\) and \(N=2^m\) holds.

The desired temperature fulfills \(y^d \in L^\infty (Q)\). For the regularization parameter we have \(\gamma >0\). The convection field v is supposed to be in \(L^\infty (\Omega ;\mathbb R^n)\). The heat source function satisfied \(f\in C(\overline{Q})\). For \(m \in \mathbb {N}\) we assume that the control shape functions fulfill \(b_1,\ldots ,b_m \in C(\overline{\Omega })\) and \(b_i \ge 0\) on \(\Omega \) a.e., but at least for one \(i \in \{1, \ldots , m \}\) it holds \(b_i > 0\) on \(\Omega \) a.e. The isolation function satisfies \(q\in L^\infty (\Gamma )\) with \(q \ge 0\) on \(\Gamma \) a.e. The outer temperature is described by g and belongs to \(C(\overline{\Sigma })\). Finally, for the initial temperature distribution we have \(y_\circ \in C(\overline{\Omega })\).

Since we are interested in weak solutions to the state equation (1b)–(1d), we recall this solution concept for our case: A solution \(y\in W(0,T)\) to (1b)–(1d) is understood as a weak solution, i.e., y belongs to W(0, T) and satisfies

$$\begin{aligned} \frac{\mathrm d}{\mathrm dt}\,{\langle y(t),\varphi \rangle }_H+a(y(t),\varphi )&={\langle {\mathcal F}(t,u(t)),\varphi \rangle }_{V',V}&\text {for all }\varphi \in V\text { in }(0,T],\end{aligned}$$
(2a)
$$\begin{aligned} {\langle y(0),\varphi \rangle }_H&={\langle y_\circ ,\varphi \rangle }_H&\text {for all }\varphi \in V, \end{aligned}$$
(2b)

where the bilinear form \(a:V\times V\rightarrow \mathbb R\) is defined as

$$ a(\varphi ,\phi )=\int _\Omega \nabla \varphi \cdot \nabla \phi \,\mathrm d{\textit{\textbf{x}}}+\int _\Omega (v \cdot \nabla \varphi ) \phi \,\mathrm d{\textit{\textbf{x}}}+\int _\Gamma q \varphi \phi \,\mathrm d{\textit{\textbf{s}}}\quad \text {for }\varphi ,\phi \in V $$

and the inhomogeinity \({\mathcal F}:[0,T]\times \mathbb R^m\rightarrow V'\) is given by

$$ {\langle {\mathcal F}(t,u),\varphi \rangle }_{V',V}= \int _\Omega \Big (f(t)+\sum _{i=1}^m u_ib_i\Big ) \varphi \,\mathrm d{\textit{\textbf{x}}}+ \int _\Gamma g(t)\varphi \,\mathrm d{\textit{\textbf{s}}}$$

for \((t,u)\in [0,T]\times \mathbb R^m\), \(u=(u_i)_{1\le i\le m}\) and \(\varphi \in V\). Note that the mapping \({\mathcal F}(\cdot \,,u)\) is continuous for every \(u\in \mathbb R^m\). The next proposition follows from the results in [20, Chapter 5].

Proposition 1

Under the above assumptions on the data the following properties hold:

  • 1) The bilinear form \(a(\cdot \,,\cdot )\) is continuous and coercive, i.e., there are constants \(\eta \ge 0\), \(\eta _ 1>0\) and \(\eta _2\ge 0\) satisfying

    $$\begin{aligned} |a(\varphi ,\phi )|&\le \eta \,{\Vert \varphi \Vert }_V{\Vert \phi \Vert }_V&\text {for all }\varphi ,\phi \in V,\\ |a(\varphi ,\varphi )|&\ge \eta _1\,{\Vert \varphi \Vert }_V^2-\eta _2\,{\Vert \varphi \Vert }_H^2&\text {for every } \varphi \in V. \end{aligned}$$
  • 2) For any \(u\in U=L^2(0,T;\mathbb R^m)\) there exists a unique solution \(y \in W(0,T)\) to (2) that satisfies

    $$ {\Vert y\Vert }_{W(0,T)} \le C \big ({\Vert {\mathcal F}(\cdot \,,u(\cdot ))\Vert }_{C([0,T]; V')} +{\Vert y_\circ \Vert }_H\big ) $$

    for a constant \(C>0\).

Remark 1

The bilinear form \(a(\cdot \,,\cdot )\) defines a bounded linear operator \({\mathcal A}:V\rightarrow V'\) by

$$ {\langle {\mathcal A}\varphi ,\phi \rangle }_{V',V}=a(\varphi ,\phi )\quad \text {for }\varphi ,\phi \in V. $$

Furthermore, the operator \({\mathcal A}\) can also be considered as an unbounded operator on H with domain \(\mathscr {D}({\mathcal A})=H^2(\Omega )\cap V\cap C(\overline{\Omega })\) which is dense in \(C(\overline{\Omega })\). The operator \(-{\mathcal A}\) generates a \(C_0\)-semigroup on \(C(\overline{\Omega })\) and the solution y to (2) belongs to \(W(0,T)\cap C(\overline{Q})\); cf. [29, Chapter 5]. Utilizing the continuity assumptions for f, \(b_1,\ldots ,b_ m\), g and \(y_\circ \) we can write (2) as the Cauchy problem

$$ \dot{y}(t)=-{\mathcal A}y(t)+{\mathcal F}(t,u(t))\text { for }t\in (0,T],\quad y(0)=y_\circ $$

posed in \(C(\overline{\Omega })\). It is proved in [28, Theorem 4.3] that \(-{\mathcal A}\) also generates a holomorphic semigroup on \(C(\overline{\Omega })\).\(\Diamond \)

Throughout this work the binary problem (1a)–(1e) is called (BN). Its cost value at an admissible solution is denoted by \(J^{BN}\). Furthermore, we introduce a relaxed problem, where (1e) is replaced by the relaxation

figure a

Problem (1a)–(1d) together with (1e’) is denoted by (RN). We write \(J^{RN}\) for the objective value obtained by an admissible solution for (RN). Let us mention that (1a)–(1d) together with (1e’) does not involve any integrality constraints. Thus, solution methods from continuous optimization can be applied.

3 Relaxation Method

Commonly, mixed-integer problems are solved with the branch-and-bound method (see e.g. [5]) to guarantee global optimality. However, for optimal control problems this is often computationally too expensive. In order to get an optimal control problem without any integer restrictions we apply therefore the approach in [17] which leads to convexified relaxed problems that can be solved by available techniques from PDE-constrained optimization; see [18, 35], for instance.

3.1 Convexification

Using (1e) we introduce the following representation of the control variable

$$ \beta (t)\in \{0,1\}^N,~\sum _{i=1}^N\beta _i(t)=1\text { and } u(t)=\sum _{i=1}^N\beta _i(t)u^i\quad \text {for }t\in [0,T]. $$

To solve our mixed-integer optimal control problem (BN) we consider the following convexification (cf. [17, Section 2])

$$\begin{aligned} \min _{(y_\beta , \beta )} \frac{1}{2}\int _0^T \int _\Omega |y_\beta (t,{\textit{\textbf{x}}})-y^d(t,{\textit{\textbf{x}}})|^2\,\mathrm d{\textit{\textbf{x}}}\mathrm dt+\frac{\gamma }{2} \sum _{i=1}^N \Vert u^i\Vert ^2_{\mathbb {R}^m} \int _{0}^T \beta _i(t)\,\mathrm dt \end{aligned}$$
(3a)

subject to

$$\begin{aligned} \frac{\mathrm d}{\mathrm dt}\,{\langle y_\beta (t),\varphi \rangle }_H+a(y_\beta (t),\varphi )&=\sum _{i=1}^N\beta _i(t)\,{\langle {\mathcal F}(t,u^i),\varphi \rangle }_{V',V}&\forall \varphi \in V\text { in }(0,T],\end{aligned}$$
(3b)
$$\begin{aligned} {\langle y_\beta (0),\varphi \rangle }_H&={\langle y_\circ ,\varphi \rangle }_H&\forall \varphi \in V,\end{aligned}$$
(3c)
$$\begin{aligned} \beta (t)&=\big (\beta _i(t)\big )_{1\le i\le N} \in \{ 0,1\}^{N}&\text {in } [0,T],\end{aligned}$$
(3d)
$$\begin{aligned} \sum _{i=1}^{N} \beta _i(t)&= 1&\text {in } [0,T]. \end{aligned}$$
(3e)

The convexification (3) of (BN) is called (BL) and we write \(J^{BL}\) for the objective value obtained by an admissible solution. Of course, (BL) still contains the integrality constraint (3d). Therefore, we introduce its relaxation – that we call (RL) – by

$$\begin{aligned} \min _{(y_\alpha , \alpha )} \frac{1}{2}\int _0^T \int _\Omega |y_\alpha (t,{\textit{\textbf{x}}})-y^d(t,{\textit{\textbf{x}}})|^2\,\mathrm d{\textit{\textbf{x}}}\mathrm dt+\frac{\gamma }{2} \sum _{i=1}^N \Vert u^i\Vert ^2_{\mathbb {R}^m} \int _{0}^T \alpha _i(t)\,\mathrm dt \end{aligned}$$
(4a)

subject to

$$\begin{aligned} \frac{\mathrm d}{\mathrm dt}\,{\langle y_\alpha (t),\varphi \rangle }_H+a(y_\alpha (t),\varphi )&=\sum _{i=1}^N\alpha _i(t){\langle {\mathcal F}(t,u^i),\varphi \rangle }_{V',V}&\forall \varphi \in V\text { in }(0,T],\end{aligned}$$
(4b)
$$\begin{aligned} {\langle y_\alpha (0),\varphi \rangle }_H&={\langle y_\circ ,\varphi \rangle }_H&\forall \varphi \in V,\end{aligned}$$
(4c)
$$\begin{aligned} \alpha (t)&=\big (\alpha _i(t)\big )_{1\le i\le N} \in [ 0,1 ]^{N}&\text {in } [0,T],\end{aligned}$$
(4d)
$$\begin{aligned} \sum _{i=1}^{N} \alpha _i(t)&= 1&\text {in } [0,T]. \end{aligned}$$
(4e)

We write \(J^{RL}\) for the objective value obtained by an admissible solution.

In the following theorem we show that the convexification does not change the optimal values of the original problem (BN) and the convexified problem (BL). The proof is similar to the one in [31, Theorem 4.6] and therefore adapted from there.

Theorem 1

If the convexified binary optimal control problem (BL) has an optimal solution \((y_\beta ^*,\beta ^*)\) with objective value \(J^{BL}\), then there exists an m-dimensional control function \(u^*\) such that \((y^*,u^*)\) is an optimal solution of the binary optimal control problem (BN) with objective value \(J^{BN}\) satisfying \(J^{BL} = J^{BN}\). The converse holds true as well.

Proof

Assume that \((y_{\beta }^*,\beta ^*)\) is a minimizer of (BL). Since it is feasible we have the special order set property (3e) with \(\beta _i^*(\cdot ) \in \{ 0,1 \}\) for all \(i = 1, \ldots , N\). Thus, there exists one index \(1 \le j(t) \le N\) for almost all (f.a.a.) \(t \in [0,T]\) such that

$$ \beta ^*_{j(t)}= 1 \text { and } \beta ^*_i = 0, \quad i \ne j(t). $$

The binary control function

$$ u^*(t) = u^{j(t)}, \quad t \in [0,T]\text { a.e.} $$

is therefore well-defined and yields an identical right-hand side function value

$$ {\mathcal F}(t,u^*(t))={\mathcal F}(t, u^{j(t)})=\beta ^*_{j(t)}{\mathcal F}(t, u^{j(t)})= \sum _{i=1}^{N}\beta _i^*(t){\mathcal F}(t,u^i),\quad t \in [0,T]\text { a.e.} $$

and identical objective function

$$ J(y^*,u^*)=J(y^*,u^{j(\cdot )})=\beta ^*_{j(\cdot )}J(y^*_{\beta },u^{j(\cdot )})=\sum _{i=1}^N \beta _i^*(\cdot )J(y^*_{\beta },u^i) $$

compared to the feasible and optimal solution \((y^*_{\beta },\beta ^*)\) of (BL). Therefore \((y^*,u^*)\) is a feasible solution of (BN) with objective value \(J^{BL}\). Next we show – by contradiction – that there exists no admissible solution to (BN) with a smaller cost value than \(J^{BL}\). Hence, we assume that a feasible solution \((\hat{y},\hat{u})\) of (BN) exists with objective value \(\hat{J}^{BN} < J^{BL}\). Since the set \(\{ u^1, \ldots , u^{N} \}\) contains all feasible assignments of \(\hat{u}\), there exists again an index function \(\hat{j}(\cdot )\) such that \(\hat{u}\) can be written as

$$ \hat{u}(t) = u^{\hat{j}(t)}, \quad t \in [0,T]\text { a.e.} $$

With the same arguments above, \(\beta \) is defined as

$$ \beta _i(t) =\left\{ \begin{aligned}&1&\text {if }i= \hat{j}(t),\\&0&\text {otherwise} \end{aligned} \right\} \quad \text {for } i = 1, \ldots , 2^{N}\text { and } t \in [0,T]\text { a.e.}. $$

Consequently, \(\beta \) is feasible for (BL) with objective function value \(\hat{J}^{BN} < J^{BL}\) which contradicts the optimality assumption of problem (BN). Thus \((y^*, u^*)\) is an optimal solution of problem (BN).

The converse is proven with the same argumentation starting from the optimal solution (BN).

In the following we want to apply [17, Theorem 1]. For that purpose we additionally suppose that \(f(\cdot ,{\textit{\textbf{x}}})\) and \(g(\cdot \,,{\textit{\textbf{s}}})\) belong to \(W^{1,\infty }(0,T)\) for almost all \({\textit{\textbf{x}}}\in \Omega \) and \({\textit{\textbf{s}}}\in \Gamma \), respectively. Next we verify assumptions (H0) to (H3) of [17, Theorem 1]:

  • (H0): In [20, Theorem 5.13] is proved that (RL) has a unique optimal solution.

  • (H1): Due to our regularity assumptions for the inhomogeneities f and g, the objective J and \({\mathcal F}\) are (locally) Lipschitz-continuous.

  • (H2): Utilizing the \(W^{1,\infty }\)-regularity for the inhomogeneities f and g again, we notice that \({\mathcal F}(\cdot \,,u^i)\) belongs also \(W^{1,\infty }(0,T)\) for any \(i=1,\ldots ,N\). Now, (H2) follows from [17, Proposition 1], i.e., there exists a constant \(C>0\) with

    $$ \Big \Vert \frac{\mathrm d}{\mathrm d\tau }\,\big (e^{-{\mathcal A}(t-\tau )}{\mathcal F}(\tau ,u^i)\big )\Big \Vert _{C(\overline{\Omega })}\le C\quad \text {for }0<\tau<t<T\text { a.e. and }1\le i\le N. $$
  • (H3): It follows also that the mapping \(t\mapsto {\mathcal F}(t,u^i)\) is essentially bounded in \(C(\overline{\Omega })\) for any \(i\in \{1,\ldots ,N\}\).

Summarizing we have the following result [17, Theorem 1 and Corollary 1]:

Proposition 2

Let the regularity conditions for the data stated in Sect. 2 hold. Moreover, \(f(\cdot \,,{\textit{\textbf{x}}})\) and \(g(\cdot \,,{\textit{\textbf{s}}})\) belong to \(W^{1,\infty }(0,T)\) for almost all \({\textit{\textbf{x}}}\in \Omega \) and \({\textit{\textbf{s}}}\in \Gamma \), respectively. Suppose that \((y_{\alpha }^*, \alpha ^*)\) is the solution to the relaxed problem (RL) with objective value \(J^{RL}\). Choose an arbitrary \(\varepsilon >0\). Then there exists a feasible solution \((y^*_\varepsilon ,u^*_\varepsilon )\) of problem (BN) satisfying

$$ J^{BN} \le J^{RL} + \varepsilon . $$

Remark 2

Notice that a feasible solution \((y^*_\varepsilon ,u^*_\varepsilon )\) of problem (BN) can be constructed from \((y_{\alpha }^*, \alpha ^*)\) by sum-up rounding; cf. Sect. 4.2 and [17, Algorithm 1].\(\Diamond \)

4 Numerical Solution Method

In the following we describe in detail how to apply the theoretical results in a numerical realization. We utilize Algorithm 1 which is based on the approach described in [17]. To guarantee convergence in a finite number of steps, the sequences of non-negative accuracies \(\{\varepsilon _k\}_{k \in \mathbb {N}}\) and the time discretizations should be chosen such that \(\varepsilon _k \rightarrow 0\) and \(\Delta t_k=\max _{i=1,\ldots ,\nu ^k} \{t_i^k-t_{i-1}^k\} \rightarrow 0\), according to Theorem 1 in [17].

figure b

4.1 Solution of the Relaxed Problem

Let us introduce two particular solutions for the state and dual equations:

  • \(\hat{y}\in W(0,T)\) is the weak solution to

    $$\begin{aligned} \hat{y}_t(t,{\textit{\textbf{x}}})-\Delta \hat{y}(t,{\textit{\textbf{x}}})+v({\textit{\textbf{x}}})\cdot \nabla \hat{y}(t,{\textit{\textbf{x}}})&=f(t,{\textit{\textbf{x}}})&\text {in } Q\text { a.e.},\\ \frac{\partial \hat{y}}{\partial n}(t,{\textit{\textbf{s}}})+ q({\textit{\textbf{s}}})\hat{y}(t,{\textit{\textbf{s}}})&=g(t,{\textit{\textbf{s}}})&\text {on }\Sigma \text { a.e.},\\ \hat{y}(0,{\textit{\textbf{x}}})&=y_\circ ({\textit{\textbf{x}}})&\text {in }\Omega \text { a.e.} \end{aligned}$$
  • Further, \(\hat{p}\in W(0,T)\) is the weak solution to

    $$\begin{aligned} -\hat{p}_t(t,{\textit{\textbf{x}}})-\Delta \hat{p}(t,{\textit{\textbf{x}}})-\nabla \cdot \big ( v({\textit{\textbf{x}}}) \hat{p}(t,{\textit{\textbf{x}}})\big )&=y^d(t,{\textit{\textbf{x}}})-\hat{y}(t,{\textit{\textbf{x}}})&\text {in } Q\text { a.e.},\\ \frac{\partial \hat{p}}{\partial n}(t,{\textit{\textbf{s}}})+ \big (q({\textit{\textbf{s}}}) + v({\textit{\textbf{s}}}) \cdot {\textit{\textbf{n}}}({\textit{\textbf{s}}})\big )\hat{p}(t,{\textit{\textbf{s}}})&=0&\text {on } \Sigma \text { a.e.},\\ \hat{p}(T,{\textit{\textbf{x}}})&=0&\text {in } \Omega \text { a.e.}, \end{aligned}$$

    where \({\textit{\textbf{n}}}\) denotes the outwart normal vector.

The first step in Algorithm 1 is to solve (RL). To do so we use a first-order augmented Lagrange method. Thus, we consider for \(c\ge 0\)

$$\begin{aligned} \min \hat{J}(\alpha )+\frac{c}{2} \int _0^T \bigg |\sum _{j=1}^N\alpha (t)-1\bigg |^2\,\mathrm dt\quad \text {s.t.}\quad \alpha \in \mathcal A_\mathsf {ad}\text { and } \sum _{j=1}^N \alpha _j(t) = 1, \end{aligned}$$
(5)

where the penalty term

$$ \frac{c}{2} \int _0^T \bigg |\sum _{j=1}^N \alpha (t) - 1 \bigg |^2\,\mathrm dt $$

is the augmentation term, \(\hat{J}(\alpha ) = J(y_{\alpha },\alpha )\) is the reduced cost functional and \(y_\alpha \) solves (4b)–(4c). The set \(\mathcal A_\mathsf {ad}\) is defined by

$$\begin{aligned} \mathcal {A}_\mathsf {ad} =\big \{\alpha \in \mathcal {A}\,\big |\,\alpha _j(t)\in [0,1]\text { on }[0,T]\text { a.e. for }j=1,\ldots ,N\big \} \end{aligned}$$

and \(\mathcal A = L^2(0,T;\mathbb {R}^N)\). For \(c>0\) the augmented Lagrangian is given as

$$\begin{aligned} \mathcal L_c(\alpha , \lambda )= \hat{J}(\alpha ) + \bigg \langle \sum _{j=1}^N \alpha _j(\cdot ) - 1, \lambda \bigg \rangle _{L^2(0,T)} + \frac{c}{2}\,\bigg \Vert \sum _{j=1}^N \alpha _j(\cdot ) - 1\bigg \Vert _{L^2(0,T)}^2. \end{aligned}$$

For the inner optimization (i.e., the minimization of \(\mathcal L_c(\cdot \,\lambda )\) with respect to the primal variable \(\alpha \)) we choose a multiplier \(\lambda ^0 \in \mathcal A\) and set \(k=0\). Then, for \(k = 0,1,\ldots \), we solve for \(c_k > 0\)

figure c

and set

$$\begin{aligned} \lambda ^{k+1} = \lambda ^k + c_k \left( \sum _{j=1}^N \alpha _j(\cdot ) - 1 \right) . \end{aligned}$$

For more details about Lagrangian methods see, e.g., [6, Chapter 3 and 4]. We repeat this process until we have

$$ \bigg \Vert \sum _{j=1}^N \alpha _j(\cdot ) - 1\bigg \Vert _{L^2(0,T)}^2 \le \varepsilon $$

for a given tolerance \(\varepsilon > 0\). The optimality conditions are given as

$$\begin{aligned} \partial _\alpha \mathcal L(\bar{\alpha },\bar{\lambda })(\alpha -\bar{\alpha }) = \langle \nabla _\alpha \mathcal L_c(\bar{\alpha },\bar{\lambda }),\alpha - \bar{\alpha }\rangle _{\mathcal { A}} \ge 0 \quad \text {for all }\alpha \in \mathcal { A}_\mathsf {ad}, \end{aligned}$$

where \(\partial _\alpha \mathcal L(\bar{\alpha },\bar{\lambda }):\mathcal { A}\rightarrow \mathbb R\) stands for the partial derivative with respect to \(\alpha \), \(\mathcal L_c(\bar{\alpha },\bar{\lambda })\in \mathcal { A}\) is the gradient with respect to \(\alpha \). Moreover, \(\bar{\alpha }\) is a local optimal solution to (\(\text {P}^k_c\)), and we have

$$\begin{aligned}&\partial _\alpha \mathcal L(\bar{\alpha },\bar{\lambda })\alpha ^\delta ={\langle \nabla _\alpha \mathcal L_c(\bar{\alpha },\bar{\lambda }),\alpha ^\delta \rangle }_{\mathcal { A}}\\&\qquad =\hat{J}'(\bar{\alpha })\alpha ^\delta +\sum _{j=1}^N{\langle \bar{\alpha }_j^\delta ,\bar{\lambda }\rangle }_{L^2(0,T)}+ c\sum _{j=1}^N\sum _{l=1}^N{\langle \bar{\alpha }_j-1,\alpha _l^\delta \rangle }_{L^2(0,T)} \end{aligned}$$

for all directions \(\alpha ^\delta \in \mathcal { A}\). For a given point \(\alpha \in \mathcal { A}_\mathsf {ad}\) and a direction \(\alpha ^\delta \in \mathcal { A}\) the directional derivative \(\hat{J}'(\alpha ) \alpha ^\delta \) can be computed as follows:

  1. 1)

    Compute for a given \(\alpha = (\alpha _i)_{1\le i\le N}\in \mathcal { A}_\mathsf {ad}\) the state \(y_\alpha \) solving

    $$\begin{aligned} (y_\alpha )_t(t,{\textit{\textbf{x}}})-\Delta y_\alpha (t,{\textit{\textbf{x}}})+v({\textit{\textbf{x}}})\cdot \nabla y_\alpha (t,{\textit{\textbf{x}}})&=\sum _{j=1}^{N} \bigg ( \sum _{i=1}^m b_i({\textit{\textbf{x}}}) u_i^j \bigg ) \alpha _j&\text {in } Q\text { a.e.},\\ \frac{\partial y_\alpha }{\partial n}(t,{\textit{\textbf{s}}})+ q({\textit{\textbf{s}}})y_\alpha (t,{\textit{\textbf{s}}})&=0&\text {on }\Sigma \text { a.e.},\\ y_\alpha (0,{\textit{\textbf{x}}})&=0&\text {in }\Omega \text { a.e.} \end{aligned}$$

    and set \(y=\hat{y}+y_\alpha \).

  2. 2)

    Solve the adjoint equation

    $$\begin{aligned} -(p_\alpha )_t(t,{\textit{\textbf{x}}})-\Delta p_\alpha (t,{\textit{\textbf{x}}})-\nabla \cdot \big ( v({\textit{\textbf{x}}}) p_\alpha (t,{\textit{\textbf{x}}})\big )&=-y_\alpha (t,{\textit{\textbf{x}}})&\text {in } Q\text { a.e.},\\ \frac{\partial p_\alpha }{\partial n}(t,{\textit{\textbf{s}}}) + \big (q({\textit{\textbf{s}}}) + v({\textit{\textbf{s}}}) \cdot {\textit{\textbf{n}}}({\textit{\textbf{s}}})\big )p_\alpha (t,{\textit{\textbf{s}}})&=0&\text {on } \Sigma \text { a.e.},\\ p_\alpha (T,{\textit{\textbf{x}}})&=0&\text {in } \Omega \text { a.e.} \end{aligned}$$

    and set \(p=\hat{p}+p_\alpha \).

  3. 3)

    Set for \(\alpha ^\delta \in \mathcal { A}\)

    $$\begin{aligned} \hat{J}'(\alpha )\alpha ^\delta&=\frac{\gamma }{2}\sum _{j=1}^N\bigg (\int _0^T \sum _{i=1}^m u_i^j \alpha _j^\delta (t)\,\mathrm dt \bigg ) - \int _0^T \int _\Omega \sum _{j=1}^N\bigg ( \sum _{i=1}^m b_i({\textit{\textbf{x}}})u_i^j\bigg )\alpha _j^\delta (t) p\,\mathrm d{\textit{\textbf{x}}}\mathrm dt \\&=\sum _{j=1}^N \int _0^T \bigg ( \frac{\gamma }{2}\sum _{i=1}^m\big (u_i^j \alpha _j^\delta (t)\big )-\alpha _j^\delta (t)\int _\Omega p(t,{\textit{\textbf{x}}})\sum _{i=1}^m \big (b_i({\textit{\textbf{x}}}) u_i^j \big ) \,\mathrm d{\textit{\textbf{x}}}\bigg )\,\mathrm dt\\&=\sum _{j=1}^{N} \int _0^T \bigg (\frac{\gamma }{2} \sum _{i=1}^m u_i^j-\int _\Omega p(t,{\textit{\textbf{x}}})\sum _{i=1}^m\big (b_i({\textit{\textbf{x}}}) u_i^j\big )\,\mathrm d{\textit{\textbf{x}}}\bigg ) \alpha _j^\delta (t)\,\mathrm dt \\&=\bigg \langle \Big ( \frac{\gamma }{2} \sum _{i=1}^m u_i^j - \int _\Omega p(\cdot \,,{\textit{\textbf{x}}})\sum _{i=1}^m \big (b_i({\textit{\textbf{x}}}) u_i^j \big ) \,\mathrm d{\textit{\textbf{x}}}\Big )_{1 \le j \le N},\alpha ^\delta \bigg \rangle _{L^2(0,T)}. \end{aligned}$$

Therefore we can introduce the Riesz representant of the linear, bounded functional \(\hat{J}'(\alpha ):\mathcal { A}\rightarrow \mathbb R\) by

$$ \bigg (\frac{\gamma }{2} \sum _{i=1}^m u_i^j - \int _\Omega p(\cdot \,,{\textit{\textbf{x}}})\sum _{i=1}^m\big (b_i({\textit{\textbf{x}}}) u_i^j\big )\,\mathrm d{\textit{\textbf{x}}}\bigg )_{1 \le j \le N} =: \nabla \hat{J}(\alpha )\in \mathcal A. $$

In particular, \(\hat{J}'(\alpha )=\langle \nabla \hat{J}(\alpha ),\cdot \rangle _{L^2(0,T)}\) holds true.

Remark 3

The first order optimality conditions for problem (\(\text {P}^k_c\)) are given by the variational inequality

$$\begin{aligned}&\bigg \langle \Big (\frac{\gamma }{2} \sum _{i=1}^m u_i^j - \int _\Omega p(\cdot \,,{\textit{\textbf{x}}})\sum _{i=1}^m\big (b_i({\textit{\textbf{x}}}) u_i^j\big )\,\mathrm d{\textit{\textbf{x}}}+\bar{\lambda }\Big )_{1 \le j \le N},\alpha -\bar{\alpha }\bigg \rangle _{\mathcal A}\\&\qquad +c\sum _{j=1}^N\sum _{l=1}^N{\langle \bar{\alpha }_j-1,\alpha _l-\bar{\alpha }_l\rangle }_{L^2(0,T)} \ge 0 \end{aligned}$$

for all \(\alpha =(\alpha _i)_{1\le i\le N} \in \mathcal { A}_\mathsf {ad}\), where \(\bar{\alpha }\) is the optimal solution to (5). For more details see [20, Chapter 5]. \(\Diamond \)

4.2 Sum-Up Rounding

Assume that we have found an optimal solution \(\alpha \) to (RL). The next step in Algorithm 1 is to construct a binary admissible control function \(\beta \) for (BL). There we need to guarantee that we will not lose the special ordered set property (SOS-1). Therefore we construct \(\beta \) by using the following so-called sum up rounding strategy (compare to [17] and [31, Section 5.1]) as follows.

Let \(\mathcal {G} = \{ t_0, t_1, \ldots , t_\nu \}\) be a time grid with \(0 = t_0< t_1< \cdots < t_\nu = T\). Define \(\beta = ( \beta _1, \ldots , \beta _N): [0,T] \rightarrow \{ 0,1 \}^N\) by

$$\begin{aligned} \beta _i(t) = p_{i,j}, \quad t \in [t_j, t_{j+1}), \quad i=1, \ldots , N, \, j = 0, \ldots ,\nu -1, \end{aligned}$$

where for all \( i=1, \ldots , N\), \(j = 0\), \(\ldots , \nu -1\)

Finally, to define a binary admissible control function for (BN) \(u: [0,T] \rightarrow \{ 0,1 \}^m\) we set

$$\begin{aligned} u(t) = \sum _{j=1}^{N} u^j \beta _j(t). \end{aligned}$$

Thanks to Theorem 1 we get then \(J^{BL} = J^{BN}\), where \(J^{BL}\) depends on \(\beta \) and \(J^{BN}\) depends on u.

4.3 Redefine the Time Discretization

If the values between the cost functions of (BN) and (RL) are not small enough we need to redefine the time grid to get a better solution. To do so, there are several strategies given in [31, Section 5.3]. However, the simplest way would be just to define the grid in an equidistant way by double it and to use the old solution as a warmstart. In our numerical experiments this is the way we have done.

4.4 The POD Method

The most expensive part in Algorithm 1 is to find an optimal control \(\alpha \) of (RL). If one use here, e.g., finite elements to discretize the state and adjoint equations these leads to huge computational time. Therefore, to reduce the cost of the numerical solution method we apply a POD-method. To apply POD to the convexified problem assume that we have already computed a POD basis of rank \(\ell \) and the corresponding POD space \(V^\ell =\mathrm {span}\{\psi _1,\ldots ,\psi _\ell \}\subset V\) is given. Moreover, we assume that we have computed the inhomogeneous part \(\hat{y}\) of the solution to the state equation. With the same notations as in Sect. 4.1 we introduce the weak formulation of the homogeneous part of the reduced-order state equation

$$\begin{aligned} \frac{\mathrm d}{\mathrm dt}\,{\langle y^\ell _\alpha (t),\psi \rangle }_H+a(y^\ell _\alpha (t),\psi )&=\bigg \langle \sum _{i=1}^m u_ib_i,\psi \bigg \rangle _H&\forall \psi \in V^\ell \text { in }(0,T],\end{aligned}$$
(6)
$$\begin{aligned} {\langle y^\ell _\alpha (0),\psi \rangle }_H&=0&\forall \psi \in V^\ell . \end{aligned}$$
(7)

and set \(y^\ell =\hat{y}+y_\alpha ^\ell \). Moreover we define the POD approximated reduced cost function by

$$ \hat{J}^\ell (\alpha ) := \frac{1}{2}\,{\Vert y^\ell - y_d\Vert }^2_{L^2(Q)} + \frac{\gamma }{2} \sum _{j=1}^{N} {\Vert u^j\Vert }_{\mathbb {R}^{m}}^2 \int _0^T \alpha _j(t)\,\mathrm { dt}. $$

With the definition of the POD approximated reduced cost we can define the POD approximated reduced problem for the inner optimization of the Lagrange method, more precisely for (\(\text {P}^k_c\)). For the inner optimization we consider therefore the POD approximated reduced problem

figure d

for a given \(c_k\) and \(\lambda ^k\), where we have for \(c\ge 0\)

$$ \mathcal L_c^\ell (\alpha ,\lambda ^k) = \hat{J}^\ell (\alpha ) + \bigg \langle \sum _{j=1}^{N} \alpha _j- 1, \lambda ^k \bigg \rangle _{L^2(0,T)} + \frac{c}{2}\,\bigg \Vert \sum _{j=1}^{N} \alpha _j - 1\bigg \Vert _{L^2(0,T)}^2. $$

Then the gradient of \(\hat{J}^\ell \) is given by

$$ \nabla \hat{J}^\ell (\alpha )=\bigg (\frac{\gamma }{2} \sum _{i=1}^m u_i^j - \int _\Omega p^\ell (\cdot \,,{\textit{\textbf{x}}})\sum _{i=1}^m\big (b_i({\textit{\textbf{x}}}) u_i^j\big )\,\mathrm d{\textit{\textbf{x}}}\bigg )_{1 \le j \le N}\in \mathcal { A}, $$

where \(p^\ell =\hat{p}+p_\alpha ^\ell \) holds true und \(p_\alpha ^\ell \) solves the adjoint problem

$$\begin{aligned} -\frac{\mathrm d}{\mathrm dt}\,{\langle p^\ell _\alpha (t),\psi \rangle }_H+a(\psi , p_\alpha ^\ell (t))&=-{\langle y^\ell _\alpha (t),\psi \rangle }_H&\forall \psi \in V^\ell \text { in }(0,T],\end{aligned}$$
(8)
$$\begin{aligned} {\langle p_\alpha ^\ell (T), \psi \rangle }_H&= 0&\forall \psi \in V^\ell . \end{aligned}$$
(9)

In [20, Theorem 5.38] is the following a-priori convergence result given.

Theorem 2

Suppose assumptions from Sect. 2 hold. Let the linear, bounded operator \(\mathcal B:\mathcal A\rightarrow L^2(0,T;(V^\ell )')\) be given as

$$ {\langle \mathcal B\alpha )(t),\psi \rangle }_{(V^\ell )',V^\ell }=\sum _{j=1}^N\alpha _j(t)\sum _{i=1}^mu_i^j{\langle b_i,\psi \rangle }_H\quad \text {for }\alpha \in \mathcal A\text { in }[0,T]\text { a.e.} $$

We assume that \(\mathcal B\) is injective. For arbitrarily given \(\alpha \in \mathcal A\) we suppose that the solutions \(y_\alpha \) and \(p_\alpha \) to (6) and (9), respectively, belong to \(H^1(0,T;V) \setminus \{ 0 \}\).

  • 1) If we compute the POD space \(V^\ell \) by solving

    $$ \min \sum _{j=1}^4\int _0^T\Big \Vert y^j(t)-\sum _{i=1}^\ell {\langle y^j(t),\psi _i\rangle }_V\,\psi _i\Big \Vert _V^2\,\mathrm dt\text { s.t. }\{\psi _i\}_{i=1}^\ell \subset V,~{\langle \psi _i,\psi _j\rangle }_V=\delta _{ij} $$

    using the snapshots \(y^1= y_\alpha \), \(y^2=(y_\alpha )_t\), \(y^3 = p_\alpha \) and \(y^4 = (p_\alpha )_t\), then the optimal solution \(\bar{\alpha }\) of (\(\text {P}^k_c\)) and the optimal solution \(\bar{\alpha }^\ell \) to the reduced problem (\(\text {P}_c^{\ell ,k}\)) satisfy

    $$ \lim _{\ell \rightarrow \infty }{\Vert \bar{\alpha }^\ell - \bar{\alpha }\Vert }_{\mathcal A}=0. $$
  • 2) If an optimal POD basis of rank \(\ell \) is computed by choosing the snapshots \(y^1= y_{\bar{\alpha }}\), \(y^2=(y_{\bar{\alpha }})_t\), \(y^3 = p_{\bar{\alpha }}\) and \(y^4 = (p_{\bar{\alpha }})_t\), then we have

    $$ \lim _{\ell \rightarrow \infty }{\Vert \bar{\alpha }^\ell - \bar{\alpha }\Vert }_{\mathcal A}\le C \sum _{i = \ell +1}^\infty \mu _i, $$

    where \(\{ \mu \}_{i \in \mathbb {N}}\) are the eigenvalues of the corresponding POD problem satisfying the error formula

    $$ \sum _{j=1}^4\int _0^T\Big \Vert y^j(t)-\sum _{i=1}^\ell {\langle y^j(t),\psi _i\rangle }_V\,\psi _i\Big \Vert _V^2\,\mathrm dt=\sum _{i = \ell +1}^\infty \mu _i; $$

    cf. [14], for instance.

The following a-posteriori error estimate guarantees that the error stays small in the numerical solution method. A proof can be found in [20, Theorem 5.39].

Theorem 3

Let all assumptions of Theorem 2 hold. For arbitrarily given \(\alpha \in \mathcal A\) we choose the snapshots \(y^1= y_\alpha \), \(y^2=(y_\alpha )_t\), \(y^3 = p_\alpha \) and \(y^4 = (p_\alpha )_t\). Define the function \(\zeta ^\ell \in {\mathcal A}\) by

where \(\xi ^\ell = \nabla _{\alpha } \mathcal L_c(\alpha ^\ell , \lambda )\) in \({\mathcal A}\). Then, for \(c>0\) we get the a-posteriori error estimate

(10)

and in particular, \(\lim \limits _{\ell \rightarrow \infty } \Vert \zeta ^\ell \Vert _{\mathcal A} = 0\).

With these results, we can solve (RL) with the POD method and control the error with the a-posteriori error estimate in our numerical solution approach.

Table 1. Parameter and function values for the numerical experiments

5 Numerical Experiments

In this section we investigate the mixed-integer optimal control problem numerically by the method introduced in Sect. 4. To recall, we consider the following mixed-integer optimal control problem:

$$\begin{aligned} \min _{y, u } \, J (y,u) = \frac{1}{2} \int _0^T \int _{\Omega } \vert y(t,{\textit{\textbf{x}}}) - y^d(t,{\textit{\textbf{x}}}) \vert ^2 \mathrm d{\textit{\textbf{x}}}\mathrm dt + \frac{\gamma }{2} \sum _{i=1}^m \int _{0}^T \vert u_i(t) \vert ^2 \mathrm dt \end{aligned}$$
(11a)

subject to a convection-diffusion equation

$$\begin{aligned} {2} y_t - \Delta y + v \cdot \nabla y&= f + \sum _{i=1}^m u_i b_i&\quad \text {in } \Omega \end{aligned}$$
(11b)
$$\begin{aligned} \frac{\partial y}{\partial n} + q y&= g&\quad \text {on } \Sigma \end{aligned}$$
(11c)
$$\begin{aligned} y(0)&= y_0&\quad \text {in } \Omega \end{aligned}$$
(11d)

and binary admissibility of \(u(\cdot )\)

$$\begin{aligned} u(t) \in \{ 0,1 \}^m \text { in } [0,T] \, \text {a.e.} \, \text {(almost everywhere)}. \end{aligned}$$
(11e)

We will use the parameters and function values which are given in Table 1. Moreover, for the desired temperature we first want a decrease in the temperature to \(10^{\circ }\) until \(t = 0.25\), an increase to \(18^{\circ }\) until \(t = 0.75\) and then again a decrease to \(10^{\circ }\). With this we want to avoid simple solutions which are like \(u(t) = 1\) or \(u(t) = 0\) for all \(t \in [0,T]\). Therefore we set for all \(x \in \Omega \)

$$\begin{aligned} y^d(t,x) = {\left\{ \begin{array}{ll} 10 &{} \text{ if } t < 0.25 \text{ or } t > 0.75, \\ 18 &{} \text{ otherwise }. \end{array}\right. } \end{aligned}$$

In the following we will use all notations from the previous sections. The implementations are done in Python where we use the packages NumPy, SciPy and Matplotlib, see [21] as well as FEniCS, see [2, 30]. All computations are done on a standard laptop (Acer Aspire 5, Intel(R) Core(TM) i5-8250U, 1.6 GHz (up to 3.4 GHz), 8 GB DDR4-RAM).

For solving the relaxed optimal control problems (RL) we use for the inner optimization in each iteration of the augmented Lagrange method (e.g. solving (\(\text {P}^k_c\))) the L-BFGS-B method from SciPy, [7]. The maximum number of iterations for the L-BFGS-B method is set up to 100. For the first time grid we utilize a tolerance of \(\varepsilon _0 = 10^{-4}\). After each modification of the time grid we divided \(\varepsilon _0\) by 10 until \(\varepsilon _k = 10^{-7}\) which give us a sequence of non-negative accuracies \(\{ \varepsilon _k \}\). To solve the integer problem we use as a tolerance \(\varepsilon = 10^{-5}\). The first time discretization is given by an equidistant time grid \(\mathcal {G}^0 \subset [0,T]\) with 50 time steps. The first optimal control problem (RL) is solved with a (pseudo) random initial control function. After that one we reuse the old solution to get faster convergence results. We stop the algorithm either if

$$\begin{aligned} \left| J^{BN} - J^{RL} \right| \le \varepsilon \end{aligned}$$

or if the size of the time grid is bigger than 800 grid points. We redefine the time grid in an equidistant way by double it.

In the tests we consider a tow dimensional control and impose a floor heating in the subdomains \(\Omega _{b_1} = (0,0.25) \times (0,0.5) \subset \Omega \) and \(\Omega _{b_2} = (0.25,0.5) \times (0,0.5) \subset \Omega \). Therefore we set \(b_1({\textit{\textbf{x}}}) = 1\) for all \({\textit{\textbf{x}}}\in \Omega _{b_1}\) and \(b_2({\textit{\textbf{x}}}) = 1\) for all \({\textit{\textbf{x}}}\in \Omega _{b_2}\). Set \(u_1^1 = 0\), \(u_1^2 = 1\), \(u_2^1 = 0\) and \(u_2^2 = 1\) the convexification and the relaxation leads to (RL) which has the form

$$\begin{aligned} \min _{y, \alpha } \, J (y,\alpha ) = \frac{1}{2} \int _0^T \int _{\Omega } \vert y(t,{\textit{\textbf{x}}}) - y^d(t,{\textit{\textbf{x}}}) \vert ^2 \text {d}{\textit{\textbf{x}}}\text {d}t + \frac{\gamma }{2} \int _{0}^T (\alpha _2(t) + \alpha _3(t) + 2 \alpha _4(t) ) \text {d}t \end{aligned}$$

subject to

figure e

After finding an optimal control \(\alpha \) we use the sum-up rounding strategy as described in Sect. 4.2 to get a binary admissible \(\beta \) and set

$$\begin{aligned} u(t) = \left( \begin{array}{c} 0 \\ 0 \end{array} \right) \beta _1(t) + \left( \begin{array}{c} 1 \\ 0 \end{array} \right) \beta _2(t) + \left( \begin{array}{c} 0 \\ 1 \end{array} \right) \beta _3(t) + \left( \begin{array}{c} 1 \\ 1 \end{array} \right) \beta _4(t) \end{aligned}$$

for all \(t \in [0,T]\).

Fig. 1.
figure 1

Temperature outside given by real data and the interpolated polynom.

5.1 Full Finite Element Method Model

In our numerical experiments we compare the behavior of the algorithm with different regularization parameters \(\gamma \). Notice, that for \(\gamma = 0\) the problem leads to a bang-bang solution. Therefore, as bigger the regularization parameter gets, as more complicated is the integer problem. But on the other hand, big regularization parameters should make the relaxed problem easier to handle.

5.1.1 Case \(\gamma =0.01\)

The first test is done with \(\gamma = 0.01\). Here we use the initial condition that represents a constant temperature of \(16^{\circ }\) in the whole room, i.e. \(y_0({\textit{\textbf{x}}}) = 16\) for all \({\textit{\textbf{x}}}\in \Omega \). After four times redefining the grid, the algorithm has found a solution with a difference between \(J^{BN} =J^{BL}\) and \(J^{RL}\) around \(6 \cdot 10^{-5}\). The convergence behavior is given in the left subfigure of Fig. 2. Notice, that in the same figure we see also the difference between \(J^{BN} =J^{BL}\) and \(J^{RL}\) (blue line) as well as the difference between \(J^{BN}\) and \(J^{RN}\) (orange line) which is close to the other one, caused of the small regularization parameter \(\gamma \). Notice as well that we always have that \(J^{RL} < J^{RN}\) which we could expect from the theoretical results. In Fig. 3 are the optimal control functions \(u_1\) and \(u_2\) and the corresponding binary functions \(\beta _1\), \(\beta _2\), \(\beta _3\) and \(\beta _4\). Notice that all control functions are close to bang-bang. Notice as well that to guarantee the SOS-1 property for the binary control functions \(\beta _i\) we need in \(\beta _2\) an additional 1 at time step \(t \approx 0.08\) which we don’t see in the relaxed control \(\alpha _2\).

Fig. 2.
figure 2

Difference between \(J^{BN}\) and \(J^{RL}\) as well as between \(J^{BN}\) and \(J^{RN}\). Case \(\gamma =0.01\) on the top left, \(\gamma =0.1\) on the top right and \(\gamma =1\) on the bottom middle.

5.1.2 Case \(\gamma =0.1\)

Next we increase the regularization parameter and set therefore \(\gamma = 0.1\). The algorithm modifies the time grid four times to reach a tolerance around \(10^{-6}\) for the difference of \(J^{BN} =J^{BL}\) and \(J^{RL}\). The convergence behavior is given in the right subfigure of Fig. 2. Notice that the difference of \(J^{BN} =J^{BL}\) and \(J^{RN}\) is bigger compared to the case \(\gamma = 0.01\) and would not converge to a solution which is as close as that one we have found. Or in other words, just relax the integer problem leads to big duality gaps which do not close by just redefining the time grid.

Fig. 3.
figure 3

Optimal control functions (relaxed and rounded) and corresponding optimal binary functions \(\beta _i\) for \(\gamma = 0.01\).

5.1.3 Case \(\gamma =1\)

Finally, we do the same test with \(\gamma = 1\). To avoid solutions which are zero everywhere, we set \(y_0({\textit{\textbf{x}}}) = 14\) for all \({\textit{\textbf{x}}}\in \Omega \). The algorithm is done after four times redefinition of the time grid and a difference between \(J^{BN} =J^{BL}\) and \(J^{RL}\) which is \(\approx 10^{-6}\). The convergence behavior is given in the bottom subfigure of Fig. 2. Notice that there is a big difference between \(J^{BN}\) and \(J^{RN}\). Here we see again the nice benefit of the convexification. Without that, it would be impossible to get such a small difference as for the solution, and we could say nothing how good our solution would be. Again we see that the duality gab between the integer solution and the relaxed solution without convexification is huge compared to the gap of the confexified problem.

If we have a look on Fig. 4 we can see the influence of the convection term in the control functions. The second control function is on the right side in the domain and from the convection therefore more expansive in the costs, although we do not weight our control functions. Therefore we get a zero control function for the second control. For the first one we have a little (but less than in the case without convexification) chattering behavior. Summarized we see for a two-dimensional problem that the convexification leads to good solutions and the gap between integer and relaxed closes nicely. We also see, that the estimate between \(J^{BN}\) and \(J^{RL}\) is sharp, in contrast to \(J^{RN}\) which we could expect from the theoretical results. Moreover, we see a nice linear convergence behavior for the solutions by redefining the time grid in an equidistant way by doubling it.

Fig. 4.
figure 4

Optimal control functions (relaxed and rounded) and corresponding optimal binary functions \(\beta _i\) for \(\gamma = 1\).

5.2 The Reduced POD Model

In the following we do the same tests as in Sect. 5.1 but apply the POD method on the corresponding relaxed problems. We investigated the quality of the POD approximated solutions with the a-posteriori error estimate from Theorem 3 and compare the computational time. Since we are solving an integer problem we expect similar solutions as before and compare therefore the values of the cost functions corresponding to (RL) as well as (RN).

To generate a POD basis of rank l we use the snapshots \(y^1 = S \alpha _0\) and \(y^2 = \mathcal {A} \alpha _0\), where \(\alpha _0\) is a (pseudo) random initial control function which we use for both problems as initial one e.g. we start both optimal control problems with this one. We compute the POD basis as describes in [20, Section 4] using trapezoidal weights and solve the eigenvalue problem corresponding to the POD problem with the SVD method. As weighting matrix we use the mass matrix and we use \(l = 10\) snapshots. The offline phase, which mean calculating the POD ansatz functions need in all three cases around 0.025 s.

5.2.1 Case \(\gamma = 0.01\)

For the FEM method, the algorithm needs to redefine the grid four times and found a solution after 1994.2 s. The algorithm spends the most time (around 1400 s) in the last time grid. This could come from a bad initial condition since in all other cases, the reuse of the old solution works pretty well. The difference between \(J^{BN} = J^{BL}\) and \(J^{RL}\) is \(\approx 7*10^{-5}\).

The POD method needs 154.2 s and is therefore more than 12 times faster, although we have use the same initial condition. In this test for \(u_2\), at \(t \approx 0.5\) the POD method has found a solution where \(u_2^{POD}(t) = 1\) and \(u_2^{FEM}(t) = 0\). The rest is equal. The convergence behavior of the full problem and the POD problem is given in Fig. 5 as well as the difference between \(J^{RL}_{FEM}\) and \(J^{RL}_{FEM}\). In Table 2 we have given all values of the cost in the different time grids for the full problem as well as for the POD problem. Notice the interesting behavior of the a-posteriori error functions \(\zeta \).

Finally we have a look of the difference of the controls in the final grid. Here we have

$$\begin{aligned} \left\| u_{FEM}^{Rel} - u_{POD}^{Rel} \right\| _A = 0.02171, \quad \left\| u_{FEM}^{Int} - u_{POD}^{Int} \right\| _A = 0.02. \end{aligned}$$

Therefore we can conclude that the POD method founds a similar solution and is much faster than the full method. Moreover, we can see that the POD method has found a solution in each time grid which is equal or slightly bigger than that one from the full model.

Fig. 5.
figure 5

Convergence behavior of the cost for \(\gamma = 0.01\). On the top left, difference between the relaxed and the binary cost for the FEM. On the top right the difference for the POD method and on the bottom middle the difference between the convexified relaxed cost for the FEM and the POD method.

Table 2. Summarized values in the different time grids for \(\gamma = 0.01\).

5.2.2 Case \(\gamma = 0.1\)

Like before both algorithms need to redefine the time grid four times. For the full model the algorithm needs 1789.4 s. Again, the augmented Lagrange method in the final time grid needs the most time of the whole process. The difference between \(J^{BN} = J^{BL}\) and \(J^{RL}\) is \(\approx 10^{-6}\) and therefore reached our accuracy.

For the reduced POD model the algorithm needs 144.9 s and is therefore again more than 12 times faster. But the difference between \(J^{BN}_{POD} = J^{BL}_{POD}\) and \(J^{RL}_{POD}\) is \(\approx 10^{-5}\) and therefore a bit worse than for the full model. The convergence behavior of the costs for the full model and the POD model is given in Fig. 6. Table 3 shows again the different values of the cost and the behavior of the error functions \(\zeta \).

Fig. 6.
figure 6

Convergence behavior of the cost for \(\gamma = 0.1\). On the top left, difference between the relaxed and the binary cost for the FEM. On the top right the difference for the POD method and on the bottom middle the difference between the convexified relaxed cost for the FEM and the POD method.

Again we have a look at the difference of the control in the final grid. This time we have

$$\begin{aligned} \left\| u_{FEM}^{Rel} - u_{POD}^{Rel} \right\| _A = 0.039, \quad \left\| u_{FEM}^{Int} - u_{POD}^{Int} \right\| _A = 0.141. \end{aligned}$$

The discrete control \(u_1\) of the full model and the POD model differs for

$$ t \in \big \{ 0.13625, 0.48875, 0.49, 0.49125\big \} $$

and the discrete control \(u_2\) differs for

$$ t \in \big \{ 0.13375, 0.135, 0.41, 0.4125, 0.49125 \big \} $$

which causes the difference of the binary control functions. Notice, again the value of the cost function \(J^{BN}_{POD}\) is equal at every time grid except in the case where the grid is of the size 200. Here the value of \(J^{BN}_{POD}\) is slightly bigger.

Table 3. Summarized values in the different time grids for \(\gamma = 0.1\).

5.2.3 Case \(\gamma = 1\)

The full model redefines the time grid three times and needed 277.1 s. The difference between \(J^{BN} = J^{BL}\) and \(J^{RL}\) is \(\approx 10^{-6}\), so we reach our tolerance what is the reason why the algorithm needs much less time and one time grid less than in the cases of \(\gamma = 0.01\) and \(\gamma = 0.1\). This could come from a good initial control \(u_0\). Notice in the test of Subsect. 5.1 the algorithm needed one time grid more to reach this tolerance.

Fig. 7.
figure 7

Convergence behavior of the cost for \(\gamma = 1\). On the top left, difference between the relaxed and the binary cost for the FEM. On the top right the difference for the POD method and on the bottom middle the difference between the convexified relaxed cost for the FEM and the POD method.

Using the reduced POD model the algorithm needs 42.8 s and redefined the time grids three times. The plots of the convergence behavior are given in Fig. 7 and in Table 4 we have summarized our findings. Notice this time the value of \(J_{POD}^{BL}\) is a bit smaller or equal than the cost \(J^{BL}\) for the full model. The difference between \(J^{BN}_{POD} = J^{BL}_{POD}\) and \(J^{RL}_{POD}\) is \(\approx 10^{-6}\).

Having a look at the difference of the control functions in the final time grid we get

$$\begin{aligned} \left\| u_{FEM}^{Rel} - u_{POD}^{Rel} \right\| _A&= 0.0073, \\ \left\| u_{FEM}^{Int} - u_{POD}^{Int} \right\| _A&= 0.02. \end{aligned}$$

The only difference in the binary control functions is for \(u_1\) at \(t = 0.205\).

Table 4. Summarized values in the different time grids for \(\gamma = 1\).
Table 5. Different computational times for the FEM method and the POD method for different regularization parameter.

Summarized we can definitely say that working with a reduced POD model instead of the full model gives a huge improvement of the computational time (see Table 5 for summarizing the speed up). Moreover, we get with this approach similar solutions which can lead incidental to smaller values of the cost function, therefore even better solutions. We have also seen, that a very small number l of ansatz functions for the POD basis are enough to reach this good solutions.

6 Conclusions and Outlook

In this chapter the authors have dealt with the application of relaxation methods combined with proper orthogonal decomposition (POD) methods for model order reduction to solve mixed-integer optimal control problems governed by linear convection-diffusion equations. After adopting the algorithm of [17] and verifying that this problem satisfies the assumptions of Theorem 1 in [17] to guarantee convergence a detailed description of the numerical solution method was given. Since the finite element method to discretize the state and adjoint equations from the optimization procedure leads to huge systems which have to be solved frequently, the POD method was introduced. This reduced the time-consuming optimization process and leads to a significant acceleration of the CPU times while the error remains small. The functionality of the algorithm and this behavior was verified by numerical experiments.