1 Introduction

Problems with multiple spatial and temporal scales occur in a variety of different phenomena and materials. Prominent examples are saltwater intrusion, storage of radioactive waste products or various composite materials [7, 15, 19]. These examples all have in common that both macroscopic and microscopic scales occur. Consequently, they are particularly challenging from a numerical point of view. However, from the application point of view, it is often sufficient to know a description of the macroscopic properties. Therefore, it is quite relevant to develop a method that includes all small-scale effects without having to calculate them simultaneously. This is the main component of (numerical) homogenization.

In this work we are interested in the following parabolic problem

$$\begin{aligned} \dfrac{\partial u^{\epsilon }}{\partial t} - \nabla \cdot \Bigl (a\Bigl (t,x, \frac{t}{\epsilon ^2}, \frac{x}{\epsilon }\Bigr ) \nabla u^{\epsilon }\Bigr )&= f, \end{aligned}$$

with initial and boundary condtions. The precise setting is given further below. \(a\bigl (t,x, \frac{t}{\epsilon ^2}, \frac{x}{\epsilon }\bigr )\) is called the time-space multiscale coefficient and represents physical properties of the considered material. If we use standard finite element and time stepping methods, we obtain sufficiently good solutions only for small time steps and fine grids as the following example illustrates.

Fig. 1
figure 1

a \(L^2\)-Error with respect to grid width h and \(\epsilon \) at time \(t = 1\). b Illustration of \(u_\epsilon \)

Example 1.1

Let \(\varOmega = (0,1)\) and \(T = 1\). Furthermore we consider

$$\begin{aligned} a(t,x,s,y) = 3 + \cos (2\pi y) + \cos ^2(2\pi s). \end{aligned}$$

Let the initial condition be \( u^{\epsilon }(0,x) = 0\) for all \(x \in \varOmega \). Figure 1a shows the error in the \(L^2\)-norm with respect to the numerical and a reference solution. The reference solutions were calculated using finite elements with grid width \(h= 10^{-6}\) and the implicit Euler method time step size \(\tau = 1/100\). The theory yields an expected quadratic order of convergence. However, this occurs here only for small grid sizes.

More precisely, the error converges only when \(h < \epsilon \), see Fig. 1a. Similar observations can be made for the time step, where one even needs \(\tau <\epsilon ^2\) in general. The reason is that \(u^\epsilon \) is highly oscillatory in space and time, see Fig. 1b.

To tackle the outlined challenges, various multiscale methods have been proposed. Focusing on approaches for parabolic space-time multiscale problems, examples include generalized multiscale finite element methods [12], non-local multicontinua schemes [18], high-dimensional (sparse) finite element methods [28], an approach based on an appropriate global coordinate transform [23], a method in the spirit of the Variational Multiscale Method and the Localized Orthogonal Decomposition [21] as well as optimal local subspaces [26, 27]. As already mentioned, we consider locally periodic problems in space and time here. Hence, we employ the Heterogeneous Multiscale Method (HMM), first induced by E and Enquist [13], see also the reviews [1, 3]. The HMM has been successfully applied to various time-dependent problems such as (nonlinear) parabolic problems [2, 4,5,6], time-dependent Maxwell equations [14, 16, 17] or the heat equation for lithium ion batteries [30]. We use the finite element version of the HMM, but note that other discretization types such as discontinuous Galerkin schemes are generally possible as well.

The present contribution is inspired by [22], which considers the same parabolic model problem and analyzes a semi-discrete HMM for it. Precisely, the microscopic cell problems are solved analytically in [22]. Our main contribution is to propose a suitable discretization of these cell problems and to show rigorous error estimates for the resulting fully discrete HMM. A particular challenge for the estimate is to balance the order of the mesh size and the time step on the one hand and the period \(\epsilon \) on the other hand. Further, we illustrate our theoretical results with numerical experiments and thereby underline the applicability of the method.

The paper is organized as follows. In Sect. 2, we introduce the setting and present the main homogenization results. In Sect. 3, we derive the fully discrete finite element heterogeneous multiscale method. The error of the macroscopic discretization is estimated in Sect. 4 and the error arising from the microscopic modeling is investigated in Sect. 5. Finally, numerical results are presented in Sect. 6.

2 Setting

In this section, we present our model problem and the associated homogenization results. Throughout the paper, we use standard notation on function spaces, in particular the Lebesgue space \(L^2\), the Sobolev spaces \(H^1\) and \(H^1_0\), as well as Bochner spaces for time-dependent functions. We denote the \(L^2\)-scalar product (w.r.t to space) by \(\langle \cdot , \cdot \rangle _0\) and the \(L^2\)-norm by \(\Vert \cdot \Vert _0\). Furthermore, we mark by \(\#\) spaces of periodic functions. Let \(X_{\#}(\varOmega )\) be such a space for an arbitrary \(\varOmega \subset \mathbb {R}^d\), then the subspace \(X_{\#,0}(\varOmega ) \subset X_{\#}(\varOmega )\) consist of all functions whose integrals over \(\varOmega \) is 0.

2.1 Model problem

Let \(\varOmega \subset \mathbb {R}^d\), be a bounded Lipschitz domain, \(T>0\) the final time and \(Y:= (-\frac{1}{2},\frac{1}{2})^d\). We consider the following parabolic problem

$$\begin{aligned} {\left\{ \begin{array}{ll} \dfrac{\partial u^{\epsilon }}{\partial t} - \nabla \cdot (a^{\epsilon }(t,x) \nabla u^{\epsilon }) &{}= f(t,x) \quad x \in \varOmega , \quad t \in (0,T) \\ u^{\epsilon }(0,x) &{}= u_0(x) \quad \; \, x \in \varOmega \\ u^{\epsilon }(t,x) &{}= 0 \quad \quad \,\quad \, x \in \partial \varOmega , \quad t \in (0,T), \end{array}\right. } \end{aligned}$$
(2.1)

where \( f \in L^2((0,T),L^2(\varOmega )) \) and \( u_0 \in H_0^1(\varOmega )\). These conditions are sufficient for the well-posedness of (2.1). For the error proofs we will later assume more regularity, see the discussion after Theorem 4.1. \(a^{\epsilon }\) is the time-space multiscale coefficient as introduced in Sect. 1 and is defined by the matrix-valued function \(a(t,x,s,y) \in C([0,T] \times {\bar{\varOmega }} \times [0,1] \times {\bar{Y}}, \mathbb {R}^{d \times d}_{sym})\). The function a is \((0,1)\times Y\)-periodic with respect to s and y, furthermore it is coercive and uniformly bounded, in particular this means that there are constants \(\varLambda , \lambda > 0\), such that for all \(\xi , \eta \in \mathbb {R}^d\):

$$\begin{aligned} \eta \cdot a(t,x,s,y) \xi \le \varLambda \, |\eta |\,|\xi |\quad \text { und } \quad \xi \cdot a(t,x,s,y) \xi \ge \lambda |\xi |^2 \end{aligned}$$

for all \((t,x,s,y) \in [0,T] \times {\overline{\varOmega }} \times [0,1] \times Y\). Further, we assume that a is Lipschitz continuous in t and x.

2.2 Homogenized problem

Analytical homogenization results for (2.1) were obtained in [8, 28]. For ease of presentation, we follow the traditional approach of asymptotic expansions here, but we emphasize that the same results are obtained with the more recent approach of time-space multiscale convergence as in [28], which is a generalization of two-scale convergence. Based on the multiscale asymptotic expansion

$$\begin{aligned} u^{\epsilon }(t,x) = U_0(t,x,\frac{t}{\epsilon ^2},\frac{x}{\epsilon }) + \epsilon U_1(t,x,\frac{t}{\epsilon ^2},\frac{x}{\epsilon }) + \epsilon ^2 U_2(t,x,\frac{t}{\epsilon ^2},\frac{x}{\epsilon }) + \dots , \end{aligned}$$
(2.2)

it is shown that \(U_0\) solves the homogenized problem

$$\begin{aligned} {\left\{ \begin{array}{ll} \dfrac{\partial U_0}{\partial t} - \nabla \cdot (A_{0} \nabla U_0) &{}= f \quad \text { in } (0,T) \times \varOmega \\ U_0 &{}= 0 \quad \text { on } (0,T) \times \partial \varOmega \\ U_0(0,\cdot ) &{}= u_0 \quad \text { in } \varOmega . \\ \end{array}\right. } \end{aligned}$$
(2.3)

Here, the homogenized coefficient \(A_0\) is defined by

$$\begin{aligned} A_0^{ij}(t,x) = \int _{0}^{1}\int _{Y} \sum _{k = 1}^d a_{ik}(t,x,s,y)\bigl (\delta _{jk} + \dfrac{\partial \chi ^{j}}{\partial y_k}(t,x,s,y)\bigr ) dyds, \end{aligned}$$
(2.4)

where \(\delta _{jk}\) denotes the Kronecker delta. The function \(\chi ^i \in L^2((0,T) \times \varOmega \times (0,1), H^1_{\#,0}(Y)) \cap L^2((0,T) \times \varOmega ,H^1_{\#}((0,1),H^{-1}_{\#,0}(Y)))\) solves the cell problem

$$\begin{aligned} {\left\{ \begin{array}{ll} \dfrac{\partial \chi ^{i}}{\partial s} - \,\nabla _{y} \cdot (a(e^{i} + \nabla _{y} \chi ^{i})) = 0 \quad \text { in } (0,1) \times Y,\\ \chi ^{i}(t,x,s, \cdot ) \quad Y\text {-periodic for all } t,x,s, \\ \chi ^{i}(t,x, \cdot ,y) \quad (0,1)\text {-periodic for all } t,x,y. \end{array}\right. } \end{aligned}$$
(2.5)

Using these \(\chi ^i\), \(U_1\) in the asymptotic expansion (2.2) can be written as

$$\begin{aligned} U_1(t,x,s,y) = \sum _{i = 1}^{d} \frac{\partial U_0}{\partial x_i}(t,x) \chi ^{i}(t,x, s,y). \end{aligned}$$

[8, Chapter 2, Section 1.7] shows in Theorem 2.1 and Theorem 2.3 that

$$\begin{aligned} \Vert u^{\epsilon } - U_0 - \epsilon U_1 \Vert _{L^2((0,T),H^1_0(\varOmega ))} \rightarrow 0 \text { for } \epsilon \rightarrow 0 . \end{aligned}$$

We call \(U_0\) the homogenized solution. \(U_0\) describes the macroscopic behavior of \(u^{\epsilon }\), because \(U_0\) only depends on the macroscopic scale x. \(U_1\) is called the first-order corrector.

Remark 2.1

\(A_0\) is not symmetric in \(\mathbb {R}^d\) for \(d>1\) in general since

$$\begin{aligned} A_0^{ij}(t,x)= & {} \int _{0}^{1}\int _{Y} \sum _{l = 1}^d \sum _{k = 1}^d \delta _{il} a_{lk} (t,x,s,y)(\delta _{jk} +\dfrac{\partial \chi ^{j}}{\partial y_k}(t,x,s,y)) dyds \nonumber \\{} & {} = \int _{0}^{1}\int _{Y} \sum _{l = 1}^d \sum _{k = 1}^d (\delta _{il} +\dfrac{\partial \chi ^{i}}{\partial y_l}(t,x,s,y)) a_{lk}(t,x,s,y) (\delta _{jk} \nonumber \\{} & {} \quad +\dfrac{\partial \chi ^{j}}{\partial y_k}(t,x,s,y)) dyds + \int _{0}^{1}\int _{Y} \chi ^i(t,x,s,y) \dfrac{\partial \chi ^j}{\partial s} (t,x,s,y) dyds.\nonumber \\ \end{aligned}$$
(2.6)

The last term does not vanish in general, but it is zero for \(i = j\) due to integration by parts and the time-periodicity of \(\chi ^i\).

In the following we reformulate \(A_0\) in a way which we use to derive the discretized problem later. We transform the reference cell \((0,1) \times Y\) to a general cell \((t,t + \epsilon ^2) \times \{x_0\} + I_{\epsilon }\) with \(I_\epsilon {:}{=}\epsilon Y\) for \(t \in [0,T)\) and \( x_0 \in \varOmega \) fixed. Application of the chain and transformation rule allows us to write

$$\begin{aligned} A_0(t,x )= & {} \int _{0}^{1}\int _{Y} a(t,x,s,y) ({\text{ Id }}_d + D_y \chi (t,x,s,y)) dyds \end{aligned}$$
(2.7)
$$\begin{aligned}= & {} \dfrac{1}{\epsilon ^2| I_{\epsilon }|}\int _{t}^{t+ \epsilon ^2}\int _{\{x_0\} + I_{\epsilon }} a\Big (t,x,\dfrac{s}{\epsilon ^2},\dfrac{y}{\epsilon }\Big )\Big ({\text {Id}}_d + D_y \chi \Big (t,x,\dfrac{s}{\epsilon ^2},\dfrac{y}{\epsilon }\Big )\Big )\, dyds.\nonumber \\ \end{aligned}$$
(2.8)

3 The finite-element heterogeneous multiscale method (FE-HMM)

Based on the results of Sect. 2, we want to compute an approximation of the homogenized solution \(U_0\) based on the Finite-Element Heterogeneous Multiscale Method (FE-HMM). In [22], this method was already introduced, but it was assumed that the cell problems (2.5) could be solved exactly/analytically. The main aim of this section is to introduce also the (microscopic) discretization of the cell problems, allowing for a fully discrete method. Further, we also account for the non-symmetry of \(A_0\). This leads to a slightly different formulation in comparison to [22] where the symmetric part of \(A_0\) was considered throughout. In the following, we will derive the full method step by step, which is on the one hand hopefully instructive for the readers to understand the final formulation and on the other makes it easier to follow the error estimates in the following sections.

We start with the discretized macro problem. For the spatial discretization we use linear finite elements based on a triangulation \(\mathcal {T}_H\) and for the time discretization we use the implicit Euler method. Precisely, let \(V_{H} \subset H_0^1(\varOmega )\) be the space of all piecewise linear functions which are zero on \(\partial \varOmega \) and let \(\tau = T/N\) be the time step size. For \(1 \le n\le N\) we set \( t_n = n \tau \). Further, we define \(U_H^0:= Q_Hu_0\), where \(Q_H:L^2(\varOmega )\rightarrow V_H\) is the \(L^2\)-projection.

Let \(U_H^n\) then be the solution of the discretized equation

$$\begin{aligned} \Bigl \langle \dfrac{{\overline{\partial }} U_H^n}{\partial t}, \varPhi _H \Bigr \rangle _{0} + B[t_n,U_H^n, \varPhi _H] = \bigl \langle f^n,\varPhi _H\bigr \rangle _{0} \, \text { for all } \varPhi _H \in V_{H}, \end{aligned}$$
(3.1)

where \(f^n(x)= f(t_n,x)\) and \( \dfrac{{\bar{\partial }} U_H^n}{\partial t} = (U^n_H - U^{n-1} _H)/ \tau \). Here, the discrete bilinear form \(B[t_n,\cdot ,\cdot ]\) is defined for any \(\varPhi _H, \varPsi _H \in V_H\) via

$$\begin{aligned} B[t_n,\varPhi _H,\varPsi _H]:= & {} \int _{\varOmega } \nabla \varPsi _H(x)\cdot A_0(t_n,x) \nabla \varPhi _H(x) dx \nonumber \\ {}= & {} \sum _{K \in \mathcal {T}_H} \int _{K} \nabla \varPsi _H(x)\cdot A_0(t_n,x) \nabla \varPhi _H(x) dx \nonumber \\ {}\approx & {} \sum _{K \in \mathcal {T}_H} |K| \nabla \varPsi _H(x_K)\cdot A_0(t_n,x_K)\nabla \varPhi _H(x_K). \end{aligned}$$
(3.2)

In the integral with a quadrature formula, where \(x_K\) denotes the barycenter of \(K\in {\mathcal {T}}_H\). If we now consider the individual summands, we could calculate \(A_0(t_n,x_K)\) starting from Eq. (2.7). However, this would have several disadvantages. First, we would have to compute \(A_0(t_n,x_K) \) for all time points \(t_n\), which would require a lot of memory depending on the time step size. Furthermore, we want to change the boundary conditions later, which is not possible with this approach. Therefore, the idea is to compute \(\nabla \varPsi _H(x_K)\cdot A_0(t_n,x_K)\nabla \varPhi _H(x_K)\) directly. For this, set \(I_{\epsilon ,K}:= \{x_K\} + I_{\epsilon }\) and use reformulation (2.72.8) to give

$$\begin{aligned}{} & {} \nabla \varPsi _H(x_K) \cdot A_0(t_n,x_K)\nabla \varPhi _H(x_K) \nonumber \\{} & {} \quad = \dfrac{1}{\epsilon ^2| I_{\epsilon }|}\int _{t_n}^{t_n+ \epsilon ^2} \int _{ I_{\epsilon ,K}} \nabla \varPsi _{H \mid _{ I_{\epsilon ,K}}}(x_K) \cdot \overbrace{a(t_n,x_K,\dfrac{t}{\epsilon ^2},\dfrac{x}{\epsilon })}^{ : = {a_{n,K}^{\epsilon }}(t,x) }\nonumber \\{} & {} \qquad \qquad \qquad \qquad \qquad \nabla (\varPhi _{H \mid _{I_{\epsilon ,K}}}(x_K) + \underbrace{\nabla \varPhi _{H \mid _{I_{\epsilon ,K}}}(x_K)\epsilon \chi (t_n,x_K\dfrac{t}{\epsilon ^2},\dfrac{x}{\epsilon })}_{=: {\tilde{\varPhi }}})dxdt \nonumber \\{} & {} \quad = \dfrac{1}{\epsilon ^2\mid I_{\epsilon }\mid }\int _{t_n}^{t_n+ \epsilon ^2} \int _{ I_{\epsilon ,K}} \nabla \varPsi _{H \mid _{ I_{\epsilon ,K}}}(x_K) \cdot {a_{n,K}^{\epsilon }}(t,x) \nabla \phi _{\#}^{\epsilon } (t_n,x_K,\dfrac{t}{\epsilon ^2},\dfrac{x}{\epsilon }) dx dt, \nonumber \\ \end{aligned}$$
(3.3)

where

$$\begin{aligned} \phi ^{\epsilon }_{\#} = \varPhi _{H \mid _{I_{\epsilon ,K}}} + {\tilde{\varPhi }} \in V_{H} + X((t_n,t_n + \epsilon ^2),I_{\epsilon ,K}), \end{aligned}$$
(3.4)

with

$$\begin{aligned} X((t_n,t_n + \epsilon ^2),I_{\epsilon ,K}):= & {} L^2((t_n,t_n + \epsilon ^2),H^1_{\#,0}(I_{\epsilon ,K} )) \\ {}{} & {} \cap H^1_{\#}((t_n,t_n + \epsilon ^2),H^{-1}_{\#,0}(I_{\epsilon ,K} )). \end{aligned}$$

\(\phi ^{\epsilon }_{\#}\) solves the equivalent cell problem

$$\begin{aligned} {\left\{ \begin{array}{ll} \dfrac{\partial \phi ^{\epsilon }_{\#}}{\partial t} - \,\nabla \cdot ( {a_{n,K}^{\epsilon }}\nabla \phi _{\#}^{\epsilon } )= 0 \quad &{}\text {in } (t_n,t_n + \epsilon ^2) \times I_{\epsilon ,K} \\ \phi _{\#}^{\epsilon }(t,x,s, \cdot )-\varPhi _{H \mid _{I_{\epsilon ,K}}} \qquad &{}\text {periodic on } \partial I_{\epsilon ,K} \\ \phi _{\#}^{\epsilon }(t,x, \cdot ,y)-\varPhi _{H \mid _{I_{\epsilon ,K}}} \qquad &{}\text {periodic on } \partial (t_n, t_n+\epsilon ^2). \end{array}\right. } \end{aligned}$$
(3.5)

We can thus give the first discretization for the bilinear form in (3.1)

$$\begin{aligned} B_{H,\#}&[t_n,\varPhi _H,\varPsi _H] \\&:= \sum _{K \in \mathcal {T}_H} \dfrac{|K|}{| I_{\epsilon }|\epsilon ^2} \int _{t_n}^{t_n+ \epsilon ^2} \int _{ I_{\epsilon ,K}} \nabla \varPhi _{H \mid _{I_{\epsilon ,K}}}(x_K)\cdot {a_{n,K}^{\epsilon }}(t,y) \nabla \phi ^{\epsilon }_{\#}(t,y)dydt \\&\approx \sum _{K \in \mathcal {T}_H} \int _K \dfrac{1}{|I_{\epsilon }| \epsilon ^2} \int _{t_n}^{t_n+ \epsilon ^2} \int _{ I_{\epsilon ,K}} \nabla \varPhi _{H \mid _{I_{\epsilon ,K}}}(x)\cdot {a_{n,K}^{\epsilon }}(t,y) \nabla \phi ^{\epsilon }_{\#}(t,y)dydtdx \end{aligned}$$

Note that \( B_{H,\#}\) is generally not symmetric.

In practice, the period may be known only approximately. Therefore we consider the case with cell side length \(\delta > \epsilon \) and cell time \(\sigma > \epsilon ^2\) and where the two terms \(\frac{\sigma }{\epsilon ^2} \), \(\frac{\delta }{\epsilon }\) are not integers. Thus, the periodic boundary conditions no longer hold (see [1, p.164] for the stationary case). In this case, we need to find alternative boundary and initial values. We approximate \(\nabla \varPsi _H \cdot A_0(t_n) \nabla \varPhi _H\) by replacing \(\epsilon \) by \(\delta \) and \(\epsilon ^2\) by \(\sigma \) in (3.3), and also X by

$$\begin{aligned} L^2((t_n,t_n + \sigma ),H^1_{0}(I_{\delta ,K} )) \cap H^1((t_n,t_n + \sigma ),H^{-1}_{0}(I_{\delta ,K} )) \end{aligned}$$

in (3.4). Then we approximate

$$\begin{aligned} \nabla \varPsi _H \cdot A_0(t_n,&x_K) \nabla \varPhi _H \\ {}&\approx \dfrac{1}{\sigma | I_{\delta }| } \int _{t_n}^{t_n+ \sigma }\int _{I_{\delta ,K}} (\nabla \varPhi _{H }(x_K)\cdot {a_{n,K}^{\epsilon }}(t,x)\nabla \phi ^{\epsilon }(t,x))dxdt \\&:=\dfrac{1}{\sigma | I_{\delta }|} \int _{t_n}^{t_n+ \sigma }\int _{I_{\delta ,K}} (\nabla \varPhi _{H \mid _{ I_{\delta ,K}}}(x_K)\cdot {a_{n,K}^{\epsilon }}(t,x)\nabla \phi ^{\epsilon }(t,x))dxdt, \end{aligned}$$

where \(\phi ^{\epsilon }\) solves the initial value problem

$$\begin{aligned} {\left\{ \begin{array}{ll} \dfrac{\partial \phi ^{\epsilon }}{\partial t} - \,\nabla \cdot ( {a_{n,K}^{\epsilon }}\nabla \phi ^{\epsilon } ) &{}= 0 \quad \text { in } (t_n,t_n + \sigma ) \times I_{\delta ,K} \\ \phi ^{\epsilon } &{}= \varPhi _H \quad \text { on } (t_n, t_n + \sigma ) \times \partial I_{\delta ,K}\\ \phi ^{\epsilon }_{\mid _{t = t_n} } &{}= \varPhi _H. \end{array}\right. } \end{aligned}$$
(3.6)

This means that we replace periodic boundary conditions by Dirichlet ones and the time “boundary value problem” by an initial value problem.

In the following, we consider the bilinear form resulting from the above approximation. We set \( \mathcal {Q}_{n,K}:= (t_n,t_n + \sigma ) \times I_{\delta ,K}\) and define

$$\begin{aligned} B_H[t_n,\varPhi _H,\varPsi _H]&:= \sum _{K \in \mathcal {T}_H} |K| \nabla \varPsi _H(x_K) \cdot A_H(t_n,x_K) \nabla \varPhi _H(x_K), \end{aligned}$$
(3.7)
$$\begin{aligned}&= \sum _{K \in \mathcal {T}_H} \int _K \nabla \varPsi _H(x) \cdot A_H(t_n,x_K) \nabla \varPhi _H(x) dx, \end{aligned}$$
(3.8)

where

$$\begin{aligned} \nabla \varPsi _H \cdot A_H(t_n, x_K) \nabla \varPhi _H&:=\dfrac{1}{|\mathcal {Q}_{n,K}|} \int _{ \mathcal {Q}_{n,K}} \nabla \varPsi _H(x_K)\cdot {a_{n,K}^{\epsilon }}(t,x) \nabla \phi ^{\epsilon }(t,x)dxdt. \end{aligned}$$

To finally get the fully discrete method we consider a triangulation \(T_{{\tilde{h}}}\) of the unit cell Y and the resulting triangulation \(T_h(I_{\delta ,K})\) of the shifted cell with the finite element space \(V_h^p\subset H_0^1(I_{\delta ,K})\), which consist of all piecewise polynomials of order \(p \ge 2\). We stress that the mesh size h is meant with respect to the scaled triangulation \(T_h(I_{\delta ,K})\). Let \(1\le k \le N_{cell}\), \(\theta = \frac{\sigma }{N_{cell}}\) and \(s_k = k \theta \). For any \(\varPhi _H \in V_H\) seek \(\phi _{h,k}^{\epsilon }\in \varPhi _H + V_h^p\) as the unique solution of the discrete cell problem

$$\begin{aligned} \int _{I_{\delta ,K}} \dfrac{{\overline{\partial }} \phi _{h,k}^{\epsilon }}{\partial t}z_h + \nabla z_h \cdot {a_{n,K}^{\epsilon }}\nabla \phi _{h,k}^{\epsilon }dx = 0 \quad \text {for all }z_h \in V_h^p\end{aligned}$$

with \(\phi _{h,0}^{\epsilon } = \varPhi _H\).

We consider the following bilinear form, which we get from the approximations above

$$\begin{aligned} B_{H,h}[t_n,\varPhi _H,\varPsi _H]&:= \sum _{K \in \mathcal {T}_H} |K| \nabla \varPsi _H(x_K) \cdot A_{H,h}(t_n,x_K) \nabla \varPhi _H(x_K) \end{aligned}$$
(3.9)
$$\begin{aligned}&\; = \sum _{K \in \mathcal {T}_H} \int _K \nabla \varPsi _H(x) \cdot A_{H,h}(t_n,x_K) \nabla \varPhi _H(x) dx, \end{aligned}$$
(3.10)

where

$$\begin{aligned} \nabla \varPsi _H \cdot A_{H,h}(t_n,x_K) \nabla \varPhi _H:= & {} \dfrac{1}{\sigma |I_{\delta }|} \Bigl (\dfrac{\theta }{2} \int _{ I_{\delta ,K}} \nabla \varPsi _H(x_K)\cdot {a_{n,K}^{\epsilon }}(t_n,x) \nabla \phi ^{\epsilon }_{h,0} dx \\{} & {} + \theta \sum _{ k= 1}^{N_{cell}-1}\int _{ I_{\delta ,K}} \nabla \varPsi _H(x_K) \cdot {a_{n,K}^{\epsilon }}(t_n + s_k,x) \nabla \phi ^{\epsilon }_{h,k}dx \\{} & {} + \dfrac{\theta }{2} \int _{ I_{\delta ,K}} \nabla \varPsi _H(x_K)\cdot {a_{n,K}^{\epsilon }}(t_n + s_{N_{cell}},x) \nabla \phi _{h,n}^{\epsilon } dx \Bigr ). \end{aligned}$$

Remark 3.1

In the above definition of \(A_{H,h}\) we used the trapezoidal rule for the approximation for the time integral, which is consistent with our numerical experiments below. We emphasize that the choice of other quadrature rules is equally possible. In practice, also the spatial integral over \(I_{\delta , K}\) is approximated by a quadrature rule.

We reformulate the discrete homogeneous equation by substituting \(B_{H,h}[t_n,\varPhi _H,\varPsi _H]\) into (3.1): Seek \(U_H^n\in V_H\) such that

$$\begin{aligned} \Bigl \langle \dfrac{{\bar{\partial }} U_H^n}{\partial t}, \varPhi _H \Bigr \rangle _0 \! + B_{H,h}[t_n,U_H^n, \varPhi _H] = \bigl \langle f^n,\varPhi _H\bigr \rangle _0 \text { for all } \varPhi _H \in V_{H}, \end{aligned}$$
(3.11)

where again \(U_H^0=Q_H u_0\).

Remark 3.2

The restriction to use only piecewise linear functions for the macrodiscretization is important for proving the claimed error bounds later. For finite elements of higher degree, one approach is to consider the linearization \(\varPhi _{H,lin}\) of finite element functions \(\varPhi _H \in V_H\), where

$$\begin{aligned} \varPhi _{H,lin} : = \sum _{K \in \mathcal {T}_H} \varPhi _{H,lin,K} = \sum _{K \in \mathcal {T}_H} \varPhi _{H}(x_K) + (x -x_K) \cdot \nabla \varPhi _H(x_K). \end{aligned}$$

We refer to [1] for details in the stationary case.

In the following, we will show well–posedness as well as error estimates for the FE-HMM. Note that for the well–posedness, it is sufficient to show stability for the macrodiscretization since the microproblem is “only” used to calculate the homogenized coefficient \(A_{H,h}\) or the discrete bilinear form \(B_{H,h}\), respectively.

4 Error estimation of the macrodiscretization

We start with a stability result which we will use to show coercivity and boundedness of \(B_{H,h}\). The statement and the proof are similar to [22, Lemma 2.1]. However, we consider here the time-discretized case.

Lemma 4.1

Let \(\varOmega \subset \mathbb {R}^d\) be a bounded domain, \( T >0\) and \(\varPhi \) a linear function. Further, let \(\varphi \) be a solution to the following problem.

$$\begin{aligned} {\left\{ \begin{array}{ll} \dfrac{\partial \varphi }{\partial t} - \,\nabla \cdot ( a(t,x) \cdot \nabla \varphi ) &{}= 0 \quad \text { in } (0,T] \times \varOmega \\ \varphi &{}= \varPhi \; \; \; \text { on } (0,T] \times \partial \varOmega \\ \varphi \!\mid _{ t = 0} &{}= \varPhi , \end{array}\right. } \end{aligned}$$
(4.1)

where \(a(t,x) = (a_{ij}(t,x))_{i,j = 1\dots d}\) fulfills the following conditions

$$\begin{aligned} \lambda {\text {Id}}_d \le a(t,x) \le \varLambda {\text {Id}}_d \quad \text { a.e. on } (0,T] \times \varOmega , \end{aligned}$$

where \({\text {Id}}_d: \mathbb {R}^d \rightarrow \mathbb {R}^d\) is the d-dimensional unit matrix. Let \(V_{h}^p \subset H_0^1(\varOmega )\) be the space of all piecewise polynomials of degree p on \(\varOmega \) using the simplicial mesh \({\mathcal {T}}_h\). For \(1 \le n \le N\) we define \(\theta = T/N\), \(t_n = n \theta \) and let \(\varphi _h^n \in \varPhi + V_h^p\) be the weak solution of the discrete problem

$$\begin{aligned} \int _{\varOmega } \dfrac{ \varphi ^n_h - \varphi ^{n-1}_h}{\theta }z_h + \nabla z_h \cdot a(t_n,x) \nabla \varphi ^n _h(x) dx = 0 \end{aligned}$$

for all \(z_h \in V_h\) and \(\varphi _h^0 = \varPhi \). Then it holds for all \( n \in \{0,\dots ,N\}\):

$$\begin{aligned} \Vert \nabla \varPhi \Vert _{0}&\le \Vert \nabla \varphi _h^n \Vert _{0} \end{aligned}$$
(4.2)
$$\begin{aligned} C T^{1/2}\Vert \nabla \varPhi \Vert _{0}&\ge \Bigl (\theta \sum _{i=0}^{N}\Vert \nabla ( \varphi _h^i- \varPhi ) \Vert ^2_{0} \Bigr )^{1/2}. \end{aligned}$$
(4.3)

Proof

Let \( n \in \{0,\dots ,N \}\) be arbitrary. Since \( \varphi _h^n = \varPhi \) on \(\partial \varOmega \) and \( \nabla \varPhi \) is constant, we get with partial integration

$$\begin{aligned} \int _{\varOmega }\nabla \bigl (\varphi _h^n(x) - \varPhi (x)\bigr ) \cdot \nabla \varPhi (x)dx&= -\int _{\varOmega } \bigl (\varphi _h^n(x) - \varPhi (x)\bigr ) \varDelta \varPhi (x) dx \\ {}&\quad + \oint _{\partial \varOmega } \bigl (\varphi _h^n(x) -\varPhi (x)\bigr ) \nabla \varPhi (x)\cdot \nu d\nu \\&= 0 \end{aligned}$$

and, hence,

$$\begin{aligned} \int _{\varOmega } |\nabla \varphi _h^n(x)|^2dx = \int _{\varOmega } |\nabla \varPhi (x)|^2dx + \int _{\varOmega } |\nabla \bigl (\varphi _h^n(x) - \varPhi (x)\bigr )|^2 dx. \end{aligned}$$

Since the second term is positive, the first inequality (4.2) is proved. For the other inequality (4.3), we use that \(\varphi \) is the weak solution of (4.1). We choose \(\varphi _h^ n - \varPhi \) as the test function to obtain

$$\begin{aligned}{} & {} \sum _{n = 1}^N \Big [ \int _{\varOmega } (\varphi _h^n(x) - \varphi _h^{n-1}(x)) (\varphi _h^ n(x) - \varPhi (x)) dx \\{} & {} \qquad + \;\theta \int _{\varOmega } \nabla (\varphi _h^ n(x) - \varPhi ) \cdot a(t_n,x) \nabla (\varphi _h^ n(x) - \varPhi (x)) dx \Big ] \\{} & {} \quad = \sum _{n = 1}^N \theta \int _{\varOmega } \nabla (\varphi _h^ n(x) - \varPhi (x)) \cdot a(t_n,x) \nabla \varPhi (x) dx. \end{aligned}$$

From the Cauchy–Schwarz inequality and boundedness of a it follows

$$\begin{aligned}{} & {} \sum _{n = 1}^N \int _{\varOmega } \nabla (\varphi _h^ n(x) - \varPhi (x)) \cdot a(t_n,x) \nabla \varPhi (x) dx \\{} & {} \quad \le \Bigl ( \sum _{n = 1}^N \int _{\varOmega } \nabla (\varphi _h^ n(x) - \varPhi (x) ) \cdot a(t_n,x) \nabla (\varphi _h^ n(x) - \varPhi (x)) dx \Bigr )^{1/2} \\{} & {} \qquad \Bigl (\sum _{n = 1}^N \int _{\varOmega } \nabla \varPhi (x) \cdot a(t_n,x) \nabla \varPhi (x) dx \Bigr )^{1/2} \\{} & {} \quad \le \varLambda ^{1/2} \sqrt{N} \Vert \nabla \varPhi \Vert _0 \Bigl ( \sum _{n = 1}^N\int _{\varOmega } \nabla (\varphi _h^ n(x) - \varPhi (x) ) \cdot a(t_n,x) \nabla (\varphi _h^ n(x) - \varPhi (x)) dx \Bigr )^{1/2}\!. \end{aligned}$$

Inserting this inequality into the equation above and using that

$$\begin{aligned} \sum _{n= 1}^N\int _{\varOmega } (\varphi _h^n(x) - \varphi _h^{n-1}(x)) (\varphi _h^ n(x) - \varPhi (x)) dx \ge \frac{1}{2}(\Vert \varphi _h^N - \varPhi \Vert _0^2 - \Vert \varphi _h^0 - \varPhi \Vert _0^2) \ge 0, \end{aligned}$$

we finally obtain

$$\begin{aligned} \sum _{n = 1}^N \theta{} & {} \int _{\varOmega } \nabla (\varphi _h^ n(x) - \varPhi (x) ) \cdot a(t_n,x) \nabla (\varphi _h^ n(x) - \varPhi (x)) dx \\{} & {} {\le } C \theta ^{1/2} \Vert \nabla \varPhi \Vert _0 \Bigl (\sum _{n = 1}^N \theta \int _{\varOmega } \nabla (\varphi _h^ n(x) {-} \varPhi (x) ) \cdot a(t_n,x) \nabla (\varphi _h^ n(x) {-} \varPhi (x)) dx \Bigr )^{1/2} \end{aligned}$$

Finally dividing by \(\bigl (\sum _{n = 1}^N \theta \int _{\varOmega } \nabla (\varphi _h^ n - \varPhi )(x) \cdot a(t_n,x) \nabla (\varphi _h^ n - \varPhi (x)) dx \bigr )^{1/2}\) finishes the proof. \(\square \)

Using this lemma, we now show the boundedness and coercivity of the discretized bilinear form \(B_{H,h}\).

Lemma 4.2

For all \( n \in \{1,\dots , N\}\), \(B_{H,h}[t_n,\cdot ,\cdot ]: V_H\times V_H \rightarrow \mathbb {R}\) is a coercive and bounded bilinear form.

Proof

Using the definition of \(\phi ^{\epsilon }_{h,k}\), we obtain with Lemma 4.1 and \(\sigma =N_{cell} \theta \)

$$\begin{aligned}{} & {} \nabla \varPsi _H \cdot A_{H,h}(t_n,x_K) \nabla \varPhi _H \\{} & {} \quad = \dfrac{1}{\sigma |I_{\delta }|} \Bigl (\dfrac{\theta }{2} \int _{I_{\delta ,K}} \nabla \varPsi _H(x_K)\cdot {a_{n,K}^{\epsilon }}(t_n,x) \nabla \phi ^{\epsilon }_{h,0} dx \\{} & {} \qquad + \theta \sum _{ k= 1}^{N_{cell}-1}\int _{I_{\delta ,K}} \nabla \varPsi _H(x_K) \cdot {a_{n,K}^{\epsilon }}(t_n + s_k,x) \nabla \phi ^{\epsilon }_{h,k}dx \\ {}{} & {} \qquad + \dfrac{\theta }{2} \int _{ I_{\delta ,K}} \nabla \varPsi _H(x_K)\cdot {a_{n,K}^{\epsilon }}(t_n + s_{N_{cell}},x) \nabla \phi _{h,n}^{\epsilon } dx \Bigr ) \\{} & {} \quad \le \dfrac{1}{\sigma |I_{\delta }|} C\Bigl (\dfrac{\theta }{2} \Vert \nabla \varPsi _H\Vert _{L^2(I_{\delta ,K})} \bigl (\Vert \nabla ( \phi ^{\epsilon }_{h,0} - \varPhi _H)\Vert _{L^2(I_{\delta ,K})} + \! \Vert \nabla \varPhi _H\Vert _{L^2(I_{\delta ,K})}\bigr ) \\{} & {} \qquad + \theta \!\!\sum _{ k= 1}^{N_{cell}-1} \Vert \nabla \varPsi _H\Vert _{L^2(I_{\delta ,K})} \bigl (\Vert \nabla (\phi ^{\epsilon }_{h,k}\!-\! \varPhi _H)\Vert _{L^2(I_{\delta ,K})} \! +\! \Vert \nabla \varPhi _H\Vert _{L^2(I_{\delta ,K})}\bigr ) \\{} & {} \qquad + \dfrac{\theta }{2} \Vert \nabla \varPsi _H \Vert _{L^2(I_{\delta ,K})} \bigl (\Vert \nabla (\phi _{h,n}^{\epsilon } - \varPhi _H)\Vert _{L^2(I_{\delta ,K})} + \Vert \nabla \varPhi _H\Vert _{L^2(I_{\delta ,K})}\bigr ) \Bigr ) \\{} & {} \quad \le \dfrac{1}{\sigma |I_{\delta }|} C \Big [ \Bigl (\theta \sum _{ k= 0}^{N_{cell}} \Vert \nabla \varPsi _H\Vert ^2_{L^2(I_{\delta ,K})} \Bigr )^{1/2} \Bigl (\theta \sum _{ k= 0}^{N_{cell}} \Vert \nabla (\phi ^{\epsilon }_{h,k}- \varPhi _H)\Vert ^2_{L^2(I_{\delta ,K})} \Bigr )^{1/2} \\ {}{} & {} \qquad + \theta \sum _{ k= 0}^{N_{cell}} \Vert \nabla \varPsi _H\Vert _{L^2(I_{\delta ,K})} \Vert \nabla \varPhi _H\Vert _{L^2(I_{\delta ,K})} \Big ] \\{} & {} \quad \le C\frac{1}{|I_{\delta }|}\Vert \nabla \varPsi _H\Vert _{L^2(I_{\delta ,K})}\Vert \nabla \varPhi _H\Vert _{L^2(I_{\delta ,K})}=C |\nabla \varPsi _H(x_K)| |\nabla \varPhi _H(x_K)|, \end{aligned}$$

where we used in the last step that \(\nabla \varPhi _H\) is constant. Summation over K shows the boundedness of \(B_{H,h}\).

It remains to show the coercivity. Since \( \frac{A_{H,h}(t_n,x_K) - A_{H,h}(t_n,x_K)^T}{2} \) is skew-symmetric, it follows that

$$\begin{aligned} \nabla \varPhi \cdot \Bigl ( \dfrac{A_{H,h}(t_n,x_K) - A_{H,h}(t_n,x_K)^T}{2} \Bigr ) \nabla \varPhi = 0. \end{aligned}$$

For the symmetric part, we obtain with (2.6)

$$\begin{aligned} \dfrac{A_0(t,x) + A_0(t,x)^T}{2}= & {} \int _{0}^{1}\int _{Y} \sum _{l = 1}^d \sum _{k = 1}^d (\delta _{il} +\dfrac{\partial \chi ^{i}}{\partial y_l}(t,x,s,y)) a_{lk}(t,x,s,y) (\delta _{jk} \nonumber \\{} & {} +\dfrac{\partial \chi ^{j}}{\partial y_k}(t,x,s,y)) dyds. \end{aligned}$$

With the lower bound on \(a_{n,K}^\varepsilon \) and Lemma 4.1, we calculate

$$\begin{aligned}{} & {} \nabla \varPhi _H \cdot A_{H,h}(t_n,x_K) \nabla \varPhi _H \\{} & {} \quad = \nabla \varPhi _H \cdot \Bigl ( \dfrac{A_{H,h}(t_n,x_K) + A_{H,h}(t_n,x_K)^T}{2} \Bigr ) \nabla \varPhi _H \\{} & {} \quad = \dfrac{1}{\sigma |I_{\delta }|} \Bigl (\dfrac{\theta }{2} \int _{I_{\delta ,K}} \! \nabla \phi ^{\epsilon }_{h,0} \cdot {a_{n,K}^{\epsilon }}(t_n,x) \nabla \phi ^{\epsilon }_{h,0} dx \\{} & {} \qquad + \theta \sum _{ k= 1}^{N_{cell}-1}\int _{ I_{\delta ,K}} \nabla \phi ^{\epsilon }_{h,k} \cdot {a_{n,K}^{\epsilon }}(t_n + s_k,x) \nabla \phi ^{\epsilon }_{h,k}dx \\{} & {} \qquad + \dfrac{\theta }{2} \int _{ I_{\delta ,K}} \nabla \phi ^{\epsilon }_{h,n} \cdot {a_{n,K}^{\epsilon }}(t_n + s_{N_{cell}},x) \nabla \phi _{h,n}^{\epsilon } dx \Bigr ) \\{} & {} \quad \ge C _{0}|\nabla \varPhi _H(x_K)|^2 \end{aligned}$$

and the coercivity of \(B_{H,h}\) follows by summation over K and the fact that \(\varPhi _H\) is piecewise linear. \(\square \)

The macrodiscretization is thus a usual finite element discretization with implicit Euler time stepping of a coercive and bounded parabolic (discrete) problem, which directly implies its stability. We will now present the main error estimate which is of similar form as in [22]. We define the error arising from the estimation of microscopic data as

$$\begin{aligned} e(\text {HMM}) = \max _{1 \le k \le n} e_k(\text {HMM}), \end{aligned}$$

where

$$\begin{aligned} e_k(\text {HMM})&:= \max _{K \in \mathcal {T}_H}\Vert (A_0 - A_{H,h})(t_k,x_K) \Vert \\&:= \max _{K \in \mathcal {T}_H} \Biggl [ \;\max _{\begin{array}{c} \varPhi _H,\varPsi _H \in V_H \\ |\nabla \varPhi _{H\mid _{K}}|,|\nabla \varPsi _{H\mid _ K}| = 1 \end{array} } |\nabla \varPsi _H \cdot (A_0 - A_{H,h})(t_k,x_K)\nabla \varPhi _H| \! \Biggr ]. \end{aligned}$$

Note that the definition is analogous to [22], but includes the microscopic discretization by comparing \(A_0\) with \(A_{H,h}\) and not \(A_H\). Using the same perturbation argument as [22] one directly obtains the main error estimate.

Theorem 4.1

Let \(U_0\) and \(U^n_H\) be solutions of (2.3) and (3.11), respectively. If a and \(U_0\) are sufficiently regular, there exists a constant C independent of \(\epsilon , \delta , \sigma , H, \tau \) such that

(4.4)
(4.5)

where is defined as

for all \(\varPhi = \{\varPhi ^k\}_{k=1}^n\) with \(\varPhi ^k \in H_0^1(\varOmega )\).

It should be noted here that the constants in Theorem 4.1 depend on the constants \( \lambda , \varLambda \) as well as the Lipschitz constant of a (cf. e.g. [22]). We further assume that \(f \in C^2((0,T), H_0^2(\varOmega )) \) and \(u_0 \in H_0^4(\varOmega )\) fulfill the compatibility condition [25, Equation (1.3)] for \(q = 2\). Thus, the required regularity of \(U_0\) in time can be deduced by [25, (1.4)]. Using the same arguments as in the time-independent case [11] we obtain the required regularity in space.

5 Estimation of e(HMM)

In this section, we prove the error bound for e(HMM). In contrast to [22], we also consider the error of the microscopic discretization, which requires additional effort. Further slight differences to [22] arise from the lacking symmetry of \(A_0\) and \(A_{H,h}\). Instead of estimating e(HMM) directly, we introduce auxiliary matrices \({\tilde{A}}\) and \({\tilde{A}}_H\) and calculate the error with respect to them. Let \(\varPhi _H, \varPsi _H \in V_H\). \({\tilde{A}}\) is defined via

where \(\phi ^{\epsilon }_{\#}\) solves (3.5). Note that \({\tilde{A}}\) uses the macroscopic discretization as \(A_H\), but solves the cell problem with periodic boundary conditions in space as well as time. \({\tilde{A}}_H\) is defined via

$$\begin{aligned} \nabla \varPsi _H \cdot{} & {} {\tilde{A}}_H(t_n,x_K) \nabla \varPhi _H \\ {}:= & {} \dfrac{1}{\sigma |I_{\delta }|} \Bigl (\dfrac{\theta }{2} \int _{I_{\delta , K}} \! \nabla \varPsi _H(x_K)\cdot {a_{n,K}^{\epsilon }}(t_n,x) \nabla \phi ^{\epsilon }(t_n,x) dx \\ {}{} & {} \quad + \theta \sum _{ k= 1}^{n-1}\int _{I_{\delta ,K}} \! \nabla \varPsi _H(x_K) \cdot {a_{n,K}^{\epsilon }}(t_n + s_k,x) \nabla \phi ^{\epsilon }(t_n + s_k,x)dx \\ {}{} & {} \quad + \dfrac{\theta }{2} \int _{I_{\delta , K}} \! \nabla \varPsi _H(x_K)\cdot {a_{n,K}^{\epsilon }}(t_n + s_{N_{cell}},x) \nabla \phi ^{\epsilon }(t_n + s_{N_{cell}},x)dx \Bigr ), \end{aligned}$$

where \(\phi ^{\epsilon }\) solves (3.6). Note that \({\tilde{A}}_H\) includes the approximation of the temporal integral, but in contrast to \(A_{H,h}\) solves the microscopic cell problems exactly. In the following, we write \(\varPhi ,\varPsi \) instead of \(\varPhi _H,\varPsi _H\) for simplicity and omit the variables in the integrals for readability. The central result of this section is

Theorem 5.1

If a sufficient regular, then it holds for any \(\alpha >0\)

$$\begin{aligned} e(\text {HMM})\le C_{\alpha } \Bigl ( \Bigl (\frac{\epsilon }{\delta }\Bigr )^{1/2} + \dfrac{\epsilon }{\sigma ^{1/2}} + \dfrac{\theta }{\epsilon ^2}\dfrac{\sqrt{\sigma }}{\epsilon } + \frac{h^{3-\alpha }}{\epsilon ^3} + \frac{h}{\epsilon } \, \Bigr ), \end{aligned}$$

where \(\sigma \) and \(\delta \) are the time and cell size, respectively, of the cell problem (3.6).

The first two terms arise from the oversampling as well as the change of the temporal and spatial boundary conditions and are already present in [22]. The other terms come from the discretization of the cell problems, where the leading terms orders are \(h/\epsilon \) and \(\theta /\epsilon ^2\). Linear convergence in time is expected due to the choice of implicit Euler for time stepping. Since we are in the non-symmetric case we only get a theoretical convergence order of h in space. For the case that \(A_0\) is symmetric, convergence order of \(h^2\) is expected. In a different setting with non-symmetric homogenized coefficient, [14] even observed \(h^2\) convergence numerically. The term \(h^{3-\alpha }/\epsilon ^3\) occurs due to the \(H^{-1}\)-norm estimate and the geometry of the cells \(I_{\delta ,K}\). Since we consider hypercubes, we obtain only \(H^{3- \alpha }\)-regularity for the solution of the dual elliptic cell problem with \( \alpha > 0\) arbitrarily small. Details can be found in the appendix. To sum up, when choosing \(\delta \) and \(\sigma \) in practice, one has to balance the oversampling and the microdiscretization error in e(HMM). Further, note that no additional terms \(\delta \) and \(\sigma \) appear as it is the case in [22]. The reason is that we fix the macroscopic scales in the coefficient (so-called macroscopic collocation of the HMM, cf. [3]).

For the proof we use the triangle inequality and our auxiliary matrices \({\tilde{A}}\) and \({\tilde{A}}_H\) via

$$\begin{aligned} \Vert A_0 {-} A_{H,h}\Vert \le \Vert A_0 {-} {\tilde{A}}\Vert {+} \Vert {\tilde{A}} {-} A_H\Vert {+} \Vert A_H - {\tilde{A}}_H\Vert {+} \Vert {\tilde{A}}_H {-} A_{H,h}\Vert . \end{aligned}$$
(5.1)

In the following, these terms will be estimated in four steps. 1.Step: Estimate \(\Vert A_0 - {\tilde{A}}\Vert \). This error is caused by the wrong cell time and cell size.

To even consider the difference of \(A_0\) and \({\tilde{A}}\), we still need an alternative representation of \( \nabla \varPsi \cdot A_0(t_n,x_K) \nabla \varPhi \). Let \(l = \lfloor \sigma / \epsilon ^2 \rfloor \), \(\kappa = \lfloor \delta /\epsilon \rfloor \) and \( \tilde{\mathcal {Q}}_{n,K}:= I_{\kappa \epsilon ,K} \times (t_n,t_n + l \epsilon ^2)\). Since \({\chi _n^{\epsilon }}\) is the solution of problem (2.5), it follows that

With that, we can handle the first step of estimating e(HMM).

Proposition 5.1

There exists a constant C such that

$$\begin{aligned} \Vert ({\tilde{A}} - A_0)\Vert \le C\Bigl (\dfrac{\epsilon }{\delta } + \dfrac{\epsilon ^2}{\sigma } \Bigr ), \end{aligned}$$

Proof

From the calculation above it follows that

We now consider the terms one by one. We use that \( \delta - \epsilon \le \kappa \epsilon \le \delta \) and \( \sigma - \epsilon ^2 \le \kappa \epsilon ^2 \le \sigma \) to estimate

$$\begin{aligned} G_1&= \Bigl ( 1 - \dfrac{|I_{\kappa \epsilon }| \cdot l \epsilon ^2}{\sigma |I_{\delta }|} \Bigr ) \le \Bigl ( 1 - \dfrac{(\delta ^d - \epsilon ^d)(\sigma - \epsilon ^2)}{\sigma |I_\delta |}\Bigr ) \\ {}&\le \Bigl ( \frac{\epsilon }{\delta } + \frac{\epsilon ^2}{\sigma } - \dfrac{\epsilon ^{d+2}}{\sigma \delta ^d} \Bigr ) \le \Big (\frac{\epsilon }{\delta } + \frac{\epsilon ^2}{\sigma } \Big ) . \end{aligned}$$

Using the same arguments, the estimate follows for \(G_2\) as well

$$\begin{aligned} G_2&= \Bigl ( \dfrac{(|I_\delta |- |I_{\kappa \epsilon }|)(l\epsilon ^2)}{|\sigma | |I_ \delta |} \Bigr ) \le \Bigl (\dfrac{l\epsilon ^2}{\sigma } - \dfrac{(\delta ^d - \epsilon ^d)(\sigma - \epsilon ^2)}{\sigma |I_\delta |}\Bigr ) \\ {}&\le \Bigl ( \frac{\epsilon }{\delta } + \frac{\epsilon ^2}{\sigma } - \dfrac{\epsilon ^{d+2}}{\sigma \delta ^d} \Bigr ) \le \Big (\frac{\epsilon }{\delta } + \frac{\epsilon ^2}{\sigma } \Big ) . \end{aligned}$$

To estimate \(G_3\) we use that \( l\dfrac{\epsilon ^2}{\sigma } \ge 1 - \dfrac{\epsilon ^2}{\sigma }\) and obtain

$$\begin{aligned} G_3 = \Bigl ( \dfrac{|I_\delta |(\sigma -l\epsilon ^2)}{|\sigma | |I_\delta |} \Bigr ) \le \Bigl ( 1 - l \frac{\epsilon ^2}{\sigma } \Bigr ) \le \dfrac{\epsilon ^2}{\sigma }. \end{aligned}$$

Altogether, after substitution and from the boundedness of \(a^{\epsilon }\) it follows that

$$\begin{aligned} |\nabla \varPsi \cdot ({\tilde{A}} - A_0)(t_n,x_K) \nabla \varPhi |\le C\Bigl ( \dfrac{\epsilon }{\delta } + \dfrac{\epsilon ^2}{\sigma } \Bigr ) |\nabla \varPhi ||\nabla \varPsi |. \end{aligned}$$

\(\square \)

2. Step: Estimate\(\Vert {\tilde{A}} - A_H \Vert \) This error can be described as the error of using wrong boundary values and wrong time conditions.

Define \(\zeta ^{\epsilon }: = \phi ^{\epsilon } -\phi ^{\epsilon }_{\#}\). Then \(\zeta ^{\epsilon }\) satisfies the following differential equation

$$\begin{aligned} {\left\{ \begin{array}{ll} \dfrac{\partial \zeta ^{\epsilon } }{\partial t} - \,\nabla \cdot ({a_{n,K}^{\epsilon }}\nabla \zeta ^{\epsilon })&{}= 0 \qquad \qquad \quad \; \text { in } \mathcal {Q}_{n,K}\\ \zeta ^{\epsilon } &{}= - \epsilon {\chi _n^{\epsilon }}\nabla \varPhi \quad \text { on } \partial I_{\delta ,K} \times (t_n,t_n + \sigma ) \\ \zeta ^{\epsilon } \mid _{t = t_n} &{}= - \epsilon {\chi _n^{\epsilon }}\nabla \varPhi . \end{array}\right. } \end{aligned}$$
(5.2)

We derive an estimate for \(\zeta ^{\epsilon }\) in the following. This in turn provides a bound for the term \(\phi ^{\epsilon } - \phi ^{\epsilon }_{\#}\), which appears in the final calculation of the error of \( A_H \) with respect to \( {\tilde{A}}\).

Lemma 5.1

There exists a constant C independent of \(\epsilon , \delta , \sigma \) such that

$$\begin{aligned} \Vert \nabla \zeta ^{\epsilon }\Vert _{L^{2}(\mathcal {Q}_{n,K})} \le C \biggl (\Bigl (\dfrac{\epsilon }{\delta }\Bigr )^{1/2} + \dfrac{\epsilon }{\sigma ^{1/2}}\biggr ) \Vert \nabla \varPhi \Vert _{L^2(\mathcal {Q}_{n,K})} \end{aligned}$$

for all \(\varPhi \in V_H\).

The proof can be found in [22, Lemma 3.3]. We can now complete the second step as well.

Proposition 5.2

It holds that

$$\begin{aligned} \Vert ({\tilde{A}} - A_H) \Vert \le C\Bigl (\Bigl ( \dfrac{\epsilon }{\delta }\Bigr )^{1/2} +\dfrac{\epsilon }{\sigma ^{1/2}}\Bigr ). \end{aligned}$$

Proof

Using Lemma 5.1 we obtain

where we used again that \(\nabla \varPhi \) is constant. \(\square \)

3.Step: Estimate \(\Vert A_H - {\tilde{A}}_H\Vert \) This error can essentially be described as a quadrature error.

Proposition 5.3

For \( \varPhi , \varPsi \in V_H\) we obtain

$$\begin{aligned} |\nabla \varPsi \cdot (A_H - {\tilde{A}}_H) \nabla \varPhi | \le C \theta ^2 |\nabla \varPsi | |\nabla \varPhi |. \end{aligned}$$

The proof follows directly from the quadrature order of the trapezoidal rule. In general, if use a quadrature rule of order q in the definition of \(A_{H,h}\) (and consequently, for \({\tilde{A}}_H\)), this error will be bounded by \( \theta ^q\).

4.Step: Estimate \(\Vert {\tilde{A}}_H - A_{H,h}\Vert \) This term describes the error from the microscopic discretization. A direct calculation shows that

$$\begin{aligned} \phi ^{\epsilon }(t,x) = \varPhi _H + \eta (t,x) \cdot \nabla \varPhi _H(x_K), \end{aligned}$$

where

$$\begin{aligned} \eta = (\eta ^ 1, \dots , \eta ^d ) \in \bigl (L^2((t_n,t_n + \sigma ),H^1_{0}(I_{\delta ,K} )) \cap H^1_{0}((t_n,t_n + \sigma ),H^{-1}_{0}(I_{\delta ,K} ))\bigr )^d \end{aligned}$$

satisfies

$$\begin{aligned} \int _{I_{\delta ,K}} \partial _t \eta ^i (t,x) z(x) + \nabla z(x) \cdot {a_{n,K}^{\epsilon }}\bigl ( e^i + \nabla \eta ^i(t,x)\bigr )dx = 0 \end{aligned}$$

for all \(z\in H^1_0(I_{\delta , K})\) and \(\eta (0,x) = 0\).

Analogously,

$$\begin{aligned} \phi _{h,k}^{\epsilon }(x) = \varPhi _H(x) + \eta _{h,k}(x_K) \cdot \nabla \varPhi _H(x) \end{aligned}$$

where \( \eta _{h,k} = (\eta _{h,k}^ 1, \dots , \eta _{h,k}^d )\in (V_h^p(I_{\delta ,K}) )^d\) satisfies

$$\begin{aligned} \int _{I_{\delta ,K}} {\overline{\partial }}_t \eta ^i_{h,k}(x) z_h(x) + \nabla z_h(x) \cdot {a_{n,K}^{\epsilon }}(t_k,x) \bigl (e^i +\nabla \eta ^i_{h,k}(x)\bigr )dx = 0 \end{aligned}$$

for all \(z_h\in V_h^p(I_{\delta ,K})\) and \(\eta _{h,0}^i=0\) for all \(i=1,\ldots d\). \(\eta \) and \(\eta _{h,k}\) obviously depend on \(\epsilon , \delta \) and \(\sigma \). To better investigate this dependence, we re-scale \(\eta \) in the following lemma.

Lemma 5.2

Define \(\xi ^i \in L^2((0, \frac{\sigma }{\epsilon ^2}), H_0^1(I_{\delta /\epsilon }))\) via \(\xi ^i(s,y) = \frac{1}{\epsilon } \eta ^i(t_n + \epsilon ^2\,s, x_K + \epsilon y)\). Then \(\xi ^i\) solves

$$\begin{aligned} {\left\{ \begin{array}{ll} \int _{I_{\delta /\epsilon }} \partial _s \xi ^i {\tilde{z}} + \nabla {\tilde{z}} \cdot {\tilde{a}}^{\epsilon }_{n,K} \bigl (e^i +\nabla \xi ^i\bigr )dx &{}= 0 \qquad \forall {\tilde{z}} \in H_0^1(I_{\delta /\epsilon }) \\ \xi ^{\epsilon } \mid _{t = 0} &{}= 0 , \end{array}\right. } \end{aligned}$$

where \({\tilde{a}}^{\epsilon }_{n,K}(s,y) = a(t_n,x_K,\frac{t_n}{\epsilon ^2}+ s,\frac{x_K}{\epsilon } + y)\).

Proof

Define

$$\begin{aligned} x_K^{\epsilon ,\delta }: I_{\delta /\epsilon }&\rightarrow I_{\delta ,K}: y \rightarrow x_K + \epsilon y \\ t_n^{\epsilon ,\sigma }: (0,\frac{\sigma }{\epsilon ^2})&\rightarrow (t_n, t_n + \sigma ) : t \rightarrow t_n + \epsilon ^2 s \end{aligned}$$

Using the transformation and chain rule, we obtain

$$\begin{aligned}&\!\!\!\int _{I_{\delta ,K}} \partial _t \eta ^i (t,x) z(x) + \nabla z(x) \cdot {a_{n,K}^{\epsilon }}\bigl ( e^i + \nabla \eta ^i(t,x)\bigr )dx \\&\quad = \int _{I_{\delta /\epsilon }} \frac{1}{\epsilon }\partial _s \eta ^i(t_n^{\epsilon ,\delta }(s), x_K^{\epsilon ,\delta }(y)) \frac{1}{\epsilon }{\tilde{z}}(x_K^{\epsilon ,\delta }(y))\\&\qquad + \frac{1}{\epsilon } \nabla {\tilde{z}}(x_K^{\epsilon ,\delta }(y)) \cdot {\tilde{a}}^{\epsilon }_{n,K}(s,y) \bigl (e^i + \frac{1}{\epsilon }\nabla \eta ^i(t_n^{\epsilon ,\delta }(s), x_K^{\epsilon ,\delta }(y))\bigr )dy. \end{aligned}$$

\(\square \)

Based on the rescaling of \(\eta \), we estimate the error between \(\eta \) and \(\eta _{h,k}\), which is the key ingredient for the bound of \(\Vert {\tilde{A}}_H - A_{H,h}\Vert \).

Proposition 5.4

Assume that a is sufficiently regular. Then, it holds for any \(\alpha >0\)

$$\begin{aligned} \Vert A_{H,h} - {\tilde{A}}_H\Vert \le C \Bigl (\dfrac{\theta }{\epsilon ^2}\dfrac{\sqrt{\sigma }}{\epsilon } + \frac{h^{3-\alpha }}{\epsilon ^3} + \frac{h}{\epsilon } \Bigr ) . \end{aligned}$$

Proof

Let \(\varPhi _H, \varPsi _H \in V_H\). We obtain with the boundedness of \(a_{n,K}^\epsilon \) and the fact that \(\nabla \varPsi _H\) is piece-wise constant

$$\begin{aligned}{} & {} | \nabla \varPsi _H \cdot A_{H,h} \nabla \varPhi _H - \nabla \varPsi _H \cdot {\tilde{A}}_H \nabla \varPhi _H|\\{} & {} \quad = \frac{1}{|\mathcal {Q}_{n,K}|} \Bigl ( \frac{\theta }{2} \int _{I_{K,\delta }} \nabla \varPsi _H\cdot {a_{n,K}^{\epsilon }}(t_n,x) \nabla \bigl (\phi _{h,0}^{\epsilon }(x) - \phi ^{\epsilon }(t_n,x)\bigr ) \\{} & {} \qquad + \theta \sum _{k = 1}^{N_{cell}-1 } \int _{I_{K,\delta }} \nabla \varPsi _H(x)\cdot {a_{n,K}^{\epsilon }}(t_n + s_k) \nabla \bigl (\phi _{h,k}^{\epsilon }(x) - \phi ^{\epsilon }(t_n + s_k ,x)\bigr ) \\{} & {} \qquad + \frac{\theta }{2} \int _{I_{K,\delta }} \nabla \varPsi _H \cdot {a_{n,K}^{\epsilon }}(t_n + s_{N_{cell}},x) \nabla \bigl (\phi _{h,n}^{\epsilon }(x) - \phi ^{\epsilon }(t_n,x)\bigr ) \Bigr ) \\{} & {} \quad \le C \frac{1}{|\mathcal {Q}_{n,K}|} \Bigl ( \sum ^{N_{cell}}_{k = 1} \theta \Vert \nabla \varPsi _H\Vert _0^2\Bigr )^{1/2}\Bigl ( \sum ^{N_{cell}}_{k = 1} \theta \Vert \nabla (\phi _{h,k}^{\epsilon } - \phi ^{\epsilon })(t_n, \cdot ) \Vert _0^2\Bigr )^{1/2} \\{} & {} \quad \le C \frac{1}{|\mathcal {Q}_{n,K}|} \Bigl ( \sum ^{N_{cell}}_{k = 1} \theta \Vert \nabla \varPsi _H\Vert _0^2\Bigr )^{1/2} \Bigl (\max _{i=1}^d \sum ^{N_{cell}}_{k = 1} \theta \Vert \nabla (\eta ^i_{h,k} - \eta ^i(t_k, \cdot ) )\Vert _0^2\Vert \nabla \varPhi _H\Vert _0^2\Bigr )^{1/2} \\{} & {} \quad \le C \frac{1}{|\mathcal {Q}_{n,K}|} \Bigl ( \sum ^{N_{cell}}_{k = 1} \theta \Vert \nabla \varPsi _H\Vert _0^2\Bigr )^{1/2} \Bigl ( \max _{i=1}^d \sum ^{N_{cell}}_{k = 1} \theta \Big [ \theta ^2 \Vert \partial _{tt} \eta ^i\Vert ^2_{L^{2}((t_n, t_n + \sigma ),L^2(I_{K,\delta }))} \\{} & {} \qquad + h^{6-2\alpha } \Vert \partial _t \eta ^i(t_k)\Vert ^2_{H^2(I_{K,\delta })} + h^2 \Vert \eta ^i(t_k)\Vert ^2_{H^2(I_{K,\delta })}\Big ]\Vert \nabla \varPhi _H\Vert _0^2\Bigr )^{1/2}\\{} & {} \quad \le C \frac{1}{|\mathcal {Q}_{n,K}|} \Bigl ( \sum ^{N_{cell}}_{k = 1} \theta \Vert \nabla \varPsi _H\Vert _0^2\Bigr )^{1/2} \Bigl ( \max _{i=1}^d \Bigl [ \sigma \theta ^2 \Vert \partial _{tt} \eta ^i\Vert ^2_{L^{2}((t_n, t_n + \sigma ),L^2(I_{K,\delta }))} \\{} & {} \qquad + h^{6-2\alpha } \Vert \partial _t \eta ^i\Vert ^2_{L^{2}((t_n, t_n + \sigma ),H^2(I_{K,\delta }))} \\{} & {} \qquad + h^2 \Vert \eta ^i\Vert ^2_{L^{2}((t_n, t_n + \sigma ),H^2(I_{K,\delta }))}\Big ]\Vert \nabla \varPhi _H\Vert _0^2\Bigr )^{1/2}\end{aligned}$$

where we used Theorem A.1 in the last step. We now employ Lemma 5.2 and regularity results for parabolic problems [24] to estimate the above terms as follows

$$\begin{aligned} \Vert \partial _{tt}\eta ^i\Vert _{L^{2}((t_n, t_n + \sigma ),L^2(I_{K,\delta }))}= & {} \epsilon \frac{1}{\epsilon ^4} {\epsilon ^{d/2}} \epsilon \Vert \partial _{ss}\xi ^i\Vert _{L^{2}((0,\frac{\sigma }{\epsilon ^2}),L^2(I_{\delta /\epsilon }))} \\\le & {} C_2\frac{1 }{\epsilon ^3} {\epsilon ^{d/2}}\sqrt{ |I_{\delta /\epsilon }|} \, \epsilon \, \sqrt{\dfrac{\sigma }{\epsilon ^2}} \\\le & {} C_2\frac{1 }{\epsilon ^3} \sqrt{ |I_{\delta ,K}|} \sqrt{{\sigma }},\\ \Vert \partial _t \eta ^i\Vert _{{L^{2}((t_n, t_n + \sigma ),H^2(I_{K,\delta }))}}= & {} \epsilon \frac{1}{\epsilon ^2} \frac{1}{\epsilon ^2} {\epsilon ^{d/2}} \epsilon \Vert \partial _{s}\xi ^i\Vert _{{L^{2}((0, \frac{\sigma }{\epsilon ^2}),H^2(I_{\delta /\epsilon }))}} \\ {}\le & {} C_3\frac{1 }{\epsilon ^3} {\epsilon ^{d/2}}\sqrt{ |I_{\delta /\epsilon }|} \,\epsilon \, \sqrt{\dfrac{\sigma }{\epsilon ^2}} \\\le & {} C_3\frac{1}{\epsilon ^3} \sqrt{ |I_{\delta ,K}|}\sqrt{{\sigma }}, \\ \Vert \eta ^i\Vert _{{L^{2}((t_n, t_n + \sigma ),H^2(I_{K, \delta }))}}= & {} \epsilon \frac{1}{\epsilon ^2} {\epsilon ^{d/2}}\epsilon \Vert \xi ^i\Vert _{{L^{2}((0, \frac{\sigma }{\epsilon ^2}),H^2(I_{\delta /\epsilon }))}} \\\le & {} C_4\frac{1 }{\epsilon } {\epsilon ^{d/2}}\sqrt{|I_{\delta /\epsilon }|}\, \epsilon \,\sqrt{\dfrac{\sigma }{\epsilon ^2}} \\\le & {} C_4\frac{1 }{\epsilon } \sqrt{ |I_{\delta ,K}|}\sqrt{{\sigma }}. \end{aligned}$$

Inserting these inequalities, we get

$$\begin{aligned} | \nabla \varPsi _H \cdot A_{H,h} \nabla \varPhi _H&- \nabla \varPsi _H \cdot {\tilde{A}}_H \nabla \varPhi _H| \\ {}&\quad \le C \Bigl (\dfrac{\theta }{\epsilon ^2}\dfrac{\sqrt{\sigma }}{\epsilon } + \frac{h^{3-\alpha }}{\epsilon ^3} + \frac{h}{\epsilon } \Bigr ) | \nabla \varPhi _H(x_K)| |\nabla \varPsi _H(x_K)|. \end{aligned}$$

\(\square \)

Summing up, we have proved the estimate for e(HMM).

Proof of Theorem 5.1

Using (5.1) and Propositions 5.1, 5.2, 5.3 and 5.4 we obtain the desired error bound.

6 Numerical experiments

In the following, numerical results calculated with the Heterogeneous Multiscale Method are presented. The convergence rate with respect to the time step and mesh width is investigated for the macrodiscretization as well as for the microdiscretization. The implementation was done in Python, building on the Fenics software library [20], where Version 2019.2.0 was used for this paper.

6.1 Setting

We choose \(\varOmega = (0,1)\) and \(T = 1\). Let the initial condition be \( u^{\epsilon }(0,x) = 0\) for all \(x \in \varOmega \). As the exact solution of the homogenized equation we choose

$$\begin{aligned} U_{0}(t,x) = t^2(x - x^2) \end{aligned}$$

and accordingly the right side

$$\begin{aligned} f = 2t(x-x^2) + 2A_0 t^2 \end{aligned}$$

with the homogenized coefficient \(A_0\). As in Sect. 4, the error between the numerical solution \(U_H\) and the exact solution \(U_0\) is investigated. For this purpose, we consider \(\Vert U_H^N - U_0(t_N,x)\Vert _{L^2(\varOmega )}\) the error at time \(t_N\). As seen in Theorem 5.1, the error bound of e(HMM) depends on the terms \(\sigma \), \(\frac{\epsilon }{\delta }\), and \(\frac{\epsilon ^2}{\sigma }\), which we get from the boundary and initial values. When choosing the parameters \(\delta \) and \(\sigma \), it is important that \(H \gg \delta \) and \(H \gg \sigma \). Here, as suggested by [22], we choose \(\delta = \epsilon ^{1/3} \) and \(\sigma = \epsilon ^{2/3}\).

6.2 First example

In the first example, we select the coefficient as

$$\begin{aligned} a(t,x,s,y) = 3 + \cos (2\pi y) + \cos ^2(2\pi s). \end{aligned}$$

According to [28], \(A_0 \approx 3.352429824667637\). For simplicity and more efficient calculation, in f the coefficient \(A_0\) is replaced by this value. Figure 2 (left) shows the error in the \(L^2\) norm over the grid width H for different cell grid widths h. Time step sizes were fixed as \(\tau = \frac{1}{15}\) and \(\theta = \frac{\sigma }{15}\). It can be clearly seen that for coarser cell grid widths \(h = 2^{-7} \) and \(h = 2^{-8}\) the error of microdiscretization dominates and therefore we do not get convergence order \(H^2\). However, for fine cell grid widths, the expected order shows up. Similarly, we obtain linear convergence w.r.t. H in the \(H^1(\varOmega )\) norm (Fig. 2 right). Note that for the \(H^1\) norm, convergence in the macro mesh size can already be observed for relatively large cell grid widths. These results agree nicely with our findings in Theorems 4.1 and 5.1.

Fig. 2
figure 2

\(L^2\)-error (left) and \(H^1\)-error (right) with respect to the grid sizes H and h of the macro and micro discretization, respectively, at the time \(t = 1\) and \(\epsilon = 10^{-3}\)

Fig. 3
figure 3

\(L^2\)-error (left) and \(H^1\)-error (right) with respect to the grid sizes H and h of the macro and micro discretization, respectively, at the time \(t = 1\) and \(\epsilon = 10^{-3}\)

6.2.1 Second example

In the next example we set

$$\begin{aligned} a_1(y) = \dfrac{1}{2 - \cos (2\pi y)} \end{aligned}$$

independent of s. A straight forward calculation shows

$$\begin{aligned} A_0 = \dfrac{1}{2}. \end{aligned}$$

We again consider the error between the numerical solution \(U_H\) and the exact solution \(U_0\). As in the previous example, we choose as time step sizes \(\tau = \frac{1}{15}\) and \(\theta = \frac{\sigma }{15}\). We again first consider the \(L^2\)-error and study its convergence w.r.t. to H, see Fig. 3 left. For \(h = 2^{-3}\) no convergence can be seen. For fine grid widths \(h = 2^{-7} \) and \(h = 2^{-8}\), quadratic convergence is initially seen, but still the microerror dominates. Only for very fine cell grid widths quadratic convergence does appear. The fact that for \(h = 2^{-10}\) the error flattens out is probably due to rounding errors. Figure 3 (right) shows the convergence in the \(H^1\) norm. Here, for sufficiently small cell grid width, the expected linear convergence is also observed. The results are again in alignment with the theory and the observations for the first example.

In addition, we investigate the error of the time discretization. For this, we fix \(H = \frac{1}{10}\) and \( h= \frac{1}{1000}\). Figure 4 shows that for fixed cell time step size \( \theta = \frac{\sigma }{4}\) linear convergence in the macro time step \(\tau \) can be observed. Again, this underlines our theoretically predicted results.

Fig. 4
figure 4

\(L^2\)-error with respect to time steps \(\tau \) at \(t = 1\) and \(\epsilon = 10^{-3}\)