• Keine Ergebnisse gefunden

Solution with controlled convection term

3 | Optimal control of the convection- convection-diffusion equation

3.2 Solution with controlled convection term

Reordering by terms dependent and independent of y yields

Z

3.2 Solution with controlled convection term

We first consider the case where both the boundary heating u and the convection term v can be controlled. For simplicity, we restrict ourselves to a 1-dimensional domain Ω = [0,1] ⊂ R with a single control boundary Γc on the right and an uncontrollable outside temperature at the left boundary Γout. We want to constrain the temperature on the subinterval Ωy := [14,34]. An illustration of this setting can be found in Figure 3.2. Another simplification that is made is the assumption that the convection term acts uniformly on the domain, i.e., v(w)(t, x) =v(w)(t) =:vw(t)∈Ris independent of the positionx.

y

Γc

Γout

Figure 3.2: Illustration of the domain and control boundaries as well as the subdomain Ωy where the temperature constraints should be satisfied.

3.2.1 Galerkin spatial discretization

As the first step, we discretize equation (3.12) by a Galerkin method [7, 18, 41]. To this end, we consider a finite dimensional subspaceVh ⊂V and a basis of this space consisting of trial functions {ψi}Li=1, i.e., Vh := span{ψ1, . . . , ψL}. The idea is to approximate the functions y(t) and the initial condition y0 via

yh(t, x) = a system of equations which is derived as follows. Inserting the approximations in the weak form (3.11) and considering only test functions ψ1, . . . , ψLwe obtain

d

dthyh(t), ψiiL2(Ω)+hA(w)(t)yh(t), ψiiV0,V =hBu(t), ψiiV0,V +hF(t), ψiiV0,V,

∀i∈ {1, . . . , L} a.e. on (0, T).

(3.15)

This yields a total of L equations, one for each test function ψi. We now consider the individual components in the above equation to obtain the mass and stiffness matrices as well as the right-hand side of the system of equations. Starting with the first term, we insert the definition ofyh to get

d

3.2 Solution with controlled convection term 23 In addition, we get L equations from the projection of the initial condition y0(x) to the space Vh:

y0,i= Z

y0(x)ψi(x)dx, i∈ {1, . . . , L}. (3.19) Let us define the coefficient vectors

yh(t) := (y1(t), . . . , yL(t))> (3.20) y0:= (y0,1, . . . , y0,L)>. (3.21) Then, for given data yout, y0 and given controls u, w, we can compute an approximate solution of the PDE by solving the (nonlinear) ODE initial value problem

M ˙yh(t) +Ayh(t) +vw(t)Bwyh(t) =buu(t) +foutyout(t)

yh(0) =y0. (3.22)

So far we did not specify the choice of the basis of trial functions which span the finite dimensional subspace Vh ⊂ V. A popular way to choose them is using Finite Elements.

An in-depth introduction to the Finite Element method can be found in [41, 71]. Briefly, for the method we subdivide the domain Ω into subsets Ki, e.g. by triangulation (which simplifies to subdivision by finite intervals in the 1D case). We then consider piecewise polynomial trial functions on each subset. This approach offers the advantage that the resulting mass and stiffness matrices are sparse which facilitates the numerical solution of the system.

3.2.2 Time discretization by implicit Euler method

To solve the ODE system (3.22) numerically, the system has to be discretized in time.

We will apply the implicit Euler method for this purpose. LetN ∈N and define the step size h := NT > 0. We want to obtain a solution at the discrete time instances tk = kh, k∈ {0, . . . , N}. For a general control system

˙

y(t) =f(t, y(t), u(t))

y(0) =y0, (3.23)

the implicit Euler discretization computes approximationsyk+1 of the statey(tk+1) at the time pointstk+1 by solving the (nonlinear) system

yk+1 =yk+hf(tk+1, yk+1, uk+1) (3.24) for each k∈ {0, . . . , N−1}, starting at time k = 0 with the initial state y0. We assume that the controls u are piecewise constant, i.e., they are kept constant during the time interval [tk, tk+1), and identify uk with the value of the function u(tk). The same holds for the controls wk =vw(tk) and the outside temperature yout,k=yout(tk).

Applying this discretization scheme to the system (3.22) and replacing the time derivative

˙yh by the difference quotient yk+1hyk we obtain

(M+hA)yk+1+hwk+1Bwyk+1 =Myk+h(buuk+1+foutyout,k+1). (3.25) Iteratively solving this system for each time step k ∈ {0, . . . , N −1} yields an approxi-mationyk+1 of yh(tk+1), which, in turn, corresponds to the spatial approximation of the PDE statey(tk+1).

Remark 3.1 (Alternative discretization approaches)

The method presented above of first discretizing in space by Finite Elements followed by subsequent time discretization is also known as method of lines. There exist alternative approaches where essentially both time and space discretization are based on Galerkin methods [33]. This offers the advantage that optimality conditions translate directly from the continuous to the discrete level [14]. Moreover, a rigorous convergence analysis is available, as well as error estimates measuring the discrepancy between discrete and con-tinuous solutions [80]. The approach is also suitable for efficient implementation with adaptive time and space grids [79].

3.2.3 Finite dimensional optimal control problem

Recall that we aim to solve the optimal control problem (3.6) numerically. In the previous sections, we have already described how the state equation is discretized using Finite

3.2 Solution with controlled convection term 25 Elements and the Implicit Euler Method. What is left to discretize is the cost functional

J(y, u, w) =σT

For this, we replace the integrals over the domain Ω and over the time interval [0, T] by discrete approximations. For functionsz∈L2(Ω) this can be achieved by approximating

kzk2L2(Ω) = Z

(z(x))2 dx≈zh>Mzh, (3.27)

where zh = (z0, . . . , zL)> is the coefficient vector of the Finite Element discretization of z and M is the mass matrix (see equation (3.16)). In addition, the time integral on the interval [0, T] of a functionf(t) can be approximated using the (right) Riemann sum

Z T

By applying these discretizations to (3.26), we obtain the discretized cost functional Jd(y,u,w) = σT

The last issue to address is how the state constraints on y can be enforced. For this we make the assumption that we use linear Lagrange Finite Elements. In this case, the coefficients (yk,1, . . . , yk,L) = yk directly correspond to the value of the Finite Element approximation of y(tk) at the Finite Element nodes. Thus, we can constrain the state by demanding

yk,i ≤yk,i ≤yk,i (3.30)

for each k ∈ {0, . . . , N} and i ∈ Iy, where yk and yk are the coefficient vectors of appropriate Finite Element representations of y and y and Iy is the index set of Finite Element nodes in the subdomain Ωy.

With all of the above, we can finally write down the fully discretized finite dimensional

optimization problem of (3.6):

Observe that the equality constraints of the finite dimensional optimization problem are nonlinear due to the mixed termswk+1Bwyk+1. For the numerical solution, we thus need a method capable of handling nonlinear equality constraints, as well as (in our case linear) inequality constraints. One option is to apply an interior point method (see [88]) such as the one implemented in the library Ipopt[104].