1 Introduction

Let \(\tau >0,a_0,r\in \mathbb R _+=[0,\infty ]\) be given constants. Define

$$\begin{aligned} \Theta =(0,\tau )\times \mathbb R ^m,\quad \Theta _0=[-a_0,0]\times \mathbb R ^m,\quad E=\Theta _{0}\cup \Theta . \end{aligned}$$

Set \(D=[-a_0,0]\times B(r),\) where \(B(r)=\{x\in \mathbb R ^m:\ |x|\le r\}\) and \(|\cdot |\) is the norm in \(\mathbb R ^m\). For every \(z:E\rightarrow \mathbb R \) and \((t,x)\in \Theta \) we define a function \(z_{(t,x)}:\ D \rightarrow \mathbb R \) by \(z_{(t,x)}(s,y)=z(t+s,x+y), (s,y)\in D.\) We call the restriction operator \(z\rightarrow z_{(t,x)}\) Hale’s operator and a functional dependence in the equation “the Hale type” (see [7, 8]).

Throughout the paper \(C(D)\) stands for the space of all continuous functions \(w: D\rightarrow \mathbb R \) with the supremum norm \(\Vert \cdot \Vert _{D}\).

Let \(f:\bar{\Theta }\times C(D)\times \mathbb R ^m \rightarrow \mathbb R \) and \({\varphi }:\Theta _{0}\rightarrow \mathbb R \) be continuous functions.

We will consider the Cauchy problem for the first order differential-functional equation in the following form

$$\begin{aligned} D_{t}u&= f(t,x,u_{(t,x)},Du)\quad \text{ in}\ \Theta , \end{aligned}$$
(1)
$$\begin{aligned} u&= {\varphi }\quad \text{ in}\ \Theta _{0}. \end{aligned}$$
(2)

In the above \(Du\) denotes a gradient of \(u\) with respect to the space variable \(x\). We write \(Du,D_{t}u,u\) for the values at point \((t,x)\) and \(u_{(t,x)}\) for the Hale operator.

Although (1) is formulated in a rather abstract way it contains as a particular case a large group of differential-functional equations. The most important are: equations with a retarded and deviated argument, differential-integral equations, and of course equations without functional dependence on \(u\). All these situations can be derived from (1), (2) by specializing the function \(f\).

Example 1

Let \(\tilde{f}:\ \bar{\Theta }\times \mathbb R \times \mathbb R \times \mathbb R ^{n}\rightarrow \mathbb R \). Instead of (1) consider

$$\begin{aligned} D_{t}u=\tilde{f}(t,x,u,u(\mu (t,x),\beta (t,x)),Du) \quad \text{ in}\ \Theta , \end{aligned}$$
(3)

where \(\mu :\ \bar{\Theta }\rightarrow \mathbb R ,\ \beta :\bar{\Theta }\rightarrow \mathbb R ^{n},t-a_{0}\le \mu (t,x)\le t,\ |\beta (t,x)-x|\le r \text{ for}\ a_{0},r\ge 0\). It is easy to verify that putting

$$\begin{aligned} f(t,x,w,p)=\tilde{f}(t,x,w(0,0),w(\mu (t,x)-t,\beta (t,x)-x),p), \end{aligned}$$

for \((t,x,w,p)\in \bar{\Theta }\times C(D)\times \mathbb R ^{n}\), we obtain (1) (we replace \(w\) with \(u_{(t,x)}\) and use the definition of Hale’s operator).

The next example shows how to transform differential-integral problem to (1), (2).

Example 2

Let \(h:\ \bar{\Theta }\times \mathbb R \times \mathbb R ^{n}\rightarrow \mathbb R \), \(K:\bar{\Theta }\times D\times \mathbb R \rightarrow \mathbb R \) are given. Consider the Cauchy problem for differential-integral equation

$$\begin{aligned} D_{t}u=h\left(t,x,\int \limits _{D}K(t,x,s,y,u(t+s,x+y))dsdy,Du\right) \quad \text{ in}\ \Theta . \end{aligned}$$
(4)

Define \(f:\bar{\Theta }\times C(D)\times \mathbb R ^{n}\rightarrow R\) by

$$\begin{aligned} f(t,x,w,p) = h\left(t,x,\int \limits _{D}K(t,x,s,y,w(s,y))dsdy,p\right). \end{aligned}$$

It is evident that, (4), (2) is a particular case of (1), (2).

Of course, we can combine these two kinds of functional dependence and treat them using one model. We can also multiply functional dependence in (3) and (4) by putting \(u(\mu _{1}(t,x),\beta _{1}(t,x)),\ldots ,u(\mu _{N}(t,x),\beta _{N}(t,x))\) in place of \(u(\mu (t,x),\beta (t,x))\) in (3) and introducing \(K_{1},\ldots ,K_{N}\) in (4).

In this paper we will investigate viscosity solutions of (1), (2).

Definition 1

A function \(u\in C(E)\) is a viscosity subsolution (resp. supersolution) of (1), (2) provided for all \(\phi \in C^{1}(\Theta )\) if \(u-\phi \) attains a local maximum (resp. minimum) at \((t,x)\in \Theta \), then

$$\begin{aligned} D_t\phi (t,x)&\le f(t,x,u_{(t,x)},D\phi (t,x))\nonumber \\ (\text{ resp.}\ D_t\phi (t,x)&\ge f(t,x,u_{(t,x)},D\phi (t,x))), \end{aligned}$$
(5)

and

$$\begin{aligned} u\le {\varphi } \text{ in}\ \Theta _{0} \quad (\text{ resp.}\ u\ge {\varphi } \text{ in}\ \Theta _{0}). \end{aligned}$$
(6)

Definition 2

A function \(u\in C(E)\) is a viscosity solution of (1), (2) if \(u\) is both a viscosity subsolution and supersolution of (1), (2).

It is immediate that,

Remark 1

If \(u\in C(E)\cap C^{1}(\Theta )\), then \(u\) is viscosity solution (v. subsolution, v. super-solution) of (1), (2) if and only if \(u\) is a classical solution (subsolution, supersolution) of (1), (2).

We use the symbol \(SOL(f,{\varphi })\) for the set of all viscosity solutions of (1), (2).

This notion of solution was first introduced in [2, 15] for the first order differential equations. The second order equations (not considered here) are widely presented in [1]. The Cauchy problem for differential-functional equations is investigated in [20].

There are numerous papers concerning difference schemes for the first order equations where nonfunctional dependence and classical solution are investigated. Here we concentrate on functional problems where generalized solutions are treated. Numerical approximation for generalized solution of first order equation was first investigated in [16] for weak solutions (in distributional sense), and in [1113] for almost everywhere solutions. (with a restrictive assumption of convexity in the last variable). Difference methods are used in [18] to prove the existence of weak solutions for quasilinear equations with functional dependence and in [6] for generalized solutions with entropy uniqueness condition (see [1113]). The method presented leads to existence results rather than to practical applications. In the study of viscosity solution the convexity assumption can be released. We also do not need the additional assumption on the solution (entropy condition). Moreover, the difference scheme applied in purely theoretical papers [3, 17], although giving a slow convergence (a square root rate), can be useful in practical experiments. In this paper we extend results obtained in [3, 17] into the case of equation with functional dependence on \(u\). We based our reasoning on the estimations obtained for the nonfunctional case and on the a priori estimations for the functional case ([19]). We also present some numerical experiments where functional dependence leads to many practical difficulties.

Numerical approximation for classical solutions of first order equation with functional dependence was investigated in [4], where explicit method is considered and in [5, 10], where implicit schemes are treated. Convergence of the difference analog of the first order equation is investigated in [14] via difference inequalities.

2 Finite difference scheme

In this part we present finite difference method to approximate viscosity solution of (1), (2).

For two vectors \(a,b\in \mathbb R ^k\ a\le b\ (a<b)\) means \(a_i\le b_i\ (a_i<b_i)\) for \(i=1,\ldots ,k\). Similarly we define \(\ge \) and \(>\).

Put \(h>0\), \(k=(k_1,\ldots ,k_m)>0\) and \(N_{0}, N\in \mathbb N \) such that \((-N_0-1)h\le -a_{0}\le -N_0h,Nh\le \tau <(N+1)h.\) For \(\alpha =(\alpha _1,\ldots ,\alpha _m)\in \mathbb Z ^m\) we write \(\alpha k=(\alpha _1k_1,\ldots ,\alpha _mk_m)\) and \(\frac{\alpha }{k}=(\frac{\alpha _1}{k_1},\dots ,\frac{\alpha _m}{k_m})\). Let \(x_\alpha =\alpha k\) and \(t_n=nh\) for \(n\in \mathbb Z \). Define \(I_n=\{-N_0,\ldots ,0,\ldots ,n\},{\Delta }=\{(t_n,x_\alpha ):\ \alpha \in \mathbb Z ^m,n\in I_N\},{\Delta }_0=\{(t_n,x_\alpha ):\ \alpha \in \mathbb Z ^m,n\in I_0\}.\)

Let \(U:I_N\times \mathbb Z ^m\rightarrow \mathbb R ,\) i.e. \(U=\{U_{\alpha }^{n}\}^{n\in I_N}_{\alpha \in \mathbb Z ^m}\). Of course, for fixed \(n\) we have \(U^n:\mathbb Z ^m\rightarrow \mathbb R \) and for fixed \(\alpha ,U_{\alpha }:\ I_N\rightarrow \mathbb R \). Let \(e_i\) for \(i=0,\dots ,m\) denote standard versors in \(\mathbb R ^m\). Write \({\Delta }^+U= ({\Delta }_{x_1}^+U,\ldots ,{\Delta }_{x_m}^+U)\) where \({\Delta }_{x_i}^+U\) is defined by \(({\Delta }_{x_i}^+U)_{\alpha }=U_{\alpha +e_i}-U_{\alpha }\), for \(\alpha \in \mathbb Z ^m,i=0,\ldots ,m\). Put \(\frac{{\Delta }^+}{k}U=(\frac{{\Delta }_{x_1}^+U}{k_1},\ldots ,\frac{{\Delta }_{x_m}^+U}{k_m})\).

Let \(A\subseteq \mathbb Z ^k\). We will use the symbol \(l^{\infty }(A)\) for the space of all discrete real functions bounded on \(A\) with the norm \(|U|_{\infty }=\sup {\{|U_{\beta }|:\ \beta \in A\}}\). (In the following we write \(U^n_{\alpha }\) instead of \(U_\beta =U_{(n,\alpha )}\) for \(A= I_N\times \mathbb Z ^m\).) For \(U,V\in l^{\infty }(A)\) we write \(U\le V\) if \(U_{\beta }\le V_{\beta }\) for every \(\beta \in A\).

We write \(BC(X)\) for the space of all continuous and bounded real functions on \(X\subseteq \mathbb R ^k\) and \(BC(X;L)\) for the space of all \(u\in BC(X)\) Lipschitz with a fixed constant \(L>0\).

For \(X\subseteq \mathbb R ^{1+m}\) we define \(X_t=\{(s,z)\in R^{1+m}:s\le t\}\) and write for short \(\Vert \cdot \Vert _t=\Vert \cdot \Vert _{X_{t}}\) if the set \(X\) is known. Similarly we define a norm \(|\cdot |_{\infty }^n\) in \(l^{\infty }(I_{n}\times \mathbb Z ^m)\).

Define \(T^*:\ BC(E)\rightarrow l^{\infty }(I_N\times \mathbb Z ^m)\) by \((T^*u)(n,\alpha )=u(t_n,x_{\alpha })\) and an operator \(T:l^{\infty }(\mathbb Z \times \mathbb Z ^m)\rightarrow C(\mathbb R \times \mathbb R ^m)\) such that:

$$\begin{aligned}&(T^*T)U=U, \end{aligned}$$
(7)
$$\begin{aligned}&\Vert TU\Vert _{t_{n}}=|U|_{\infty }^n, \end{aligned}$$
(8)
$$\begin{aligned}&\Vert TT^*u-u\Vert _{t_{N}}\le L(|h|+|k_1|+\cdots |k_m|)\quad \text{ for}\ u\in BC(E;L). \end{aligned}$$
(9)

In view of the standard construction of \(T\) (see [9]) we can assume that \(T:l^{\infty }(I_n\times \mathbb Z ^m)\rightarrow C(E_{t_{n}})\) for every \(n\).

Put \(\gamma ,\beta \in \mathbb Z ^m\) such that \(\gamma ,\beta \ge 0\). Let \(p\) be a number of \(\delta \in \mathbb Z ^m\) satisfying inequalities \(\alpha -\gamma \le \delta \le \alpha +\beta \). For given \(g:\bar{\Theta }\times C(D)\times \mathbb R ^{mp}\rightarrow \mathbb R \) and \(\Phi =\varphi _{|\Delta _0}\) we define a finite difference scheme:

$$\begin{aligned}&U^{n+1}_{\alpha }=U^{n}_{\alpha }+h g\left(t_{n},x_{\alpha },(TU)_{(t_{n},x_{\alpha })}, \frac{{\Delta }^{+}}{k}U^{n}_{\alpha -\gamma }\cdots \frac{{\Delta }^{+}}{k}U^{n}_{\alpha +\beta }\right) \quad \nonumber \\&\quad \text{ for}\ n=0,\ldots ,N-1 \end{aligned}$$
(10)

and

$$\begin{aligned} U^n=\Phi ^n\quad \text{ for}\ n=-N_0,\ldots ,0. \end{aligned}$$
(11)

Of course, the above scheme always has a solution. We will write \(U\in AP(g,\Phi )\) if \(U\) solves (10), (11) nevertheless \(AP(g,\Phi )\) admits only one element.

Assume now that \(g\) is independent of \(w\). We will write for short \(U=U_{\alpha }^{n},\ V=V_{\alpha }^{n}\). Let \(l^{\infty }(\mathbb Z ^{m};L)=\{U\in l^{\infty }(\mathbb Z ^m): |\Delta ^{+}U|_{\infty }\le Lk\}\).

Define \(G:\ \{0,1,\ldots ,N\}\times l^{\infty }(\mathbb Z ^m)\rightarrow l^{\infty }(\mathbb Z ^m)\) by

$$\begin{aligned} G(s,U)_{\alpha }=U_{\alpha }+hg \left(t_{s},x_{\alpha }, \frac{{\Delta }^{+}}{k}U_{\alpha -\gamma }\cdots \frac{{\Delta }^{+}}{k}U_{\alpha +\beta }\right). \end{aligned}$$
(12)

Scheme (10), (11) takes now the form

$$\begin{aligned} U^{n+1}&= G(n,U^n) \quad \text{ for}\ n=0,\ldots ,N, \end{aligned}$$
(13)
$$\begin{aligned} U^0&= \Phi ^0. \end{aligned}$$
(14)

In this paper we will consider only the monotone schemes, i.e. such that \(G(s,U)\) is nondecreasing function of \(U\) (the exact definition will be given in the next section). This property of \(G\) is justified by the following,

Proposition 1

Let \(G\) be defined by (12) and \(s= 0,1,\ldots ,N\). Then,

  1. (1)

    \(G(s,U+\lambda )=G(s,U)+\lambda \) for \(\lambda \in \mathbb R \),

  2. (2)

    if \(G(s,\cdot )\) is nondecreasing in \(l^{\infty }(\mathbb Z ^m;L_s)\), then \(|G(s,U)-G(s,V)|_{\infty }\le |U-V|_{\infty }\) for \(U,V\in l^{\infty }(\mathbb Z ^m;L_s)\),

  3. (3)

    if \(G(s,\cdot )\) is nondecreasing in \(l^{\infty }(\mathbb Z ^m;L_s)\) and \(g\) is Lipschitz continuous in \(x\) with a constant \(L_x[g]\), then

    $$\begin{aligned} |{\Delta }^{+}G(s,U)|_{\infty }\le |{\Delta }^{+}U|_{\infty }+L_x[g]hk \quad \text{ on} \ l^{\infty }(\mathbb Z ^m;L_s). \end{aligned}$$
    (15)

Proof

As (1) is immediate we begin with (2). Since \(U\le V+|U-V|_{\infty }\) putting \(\lambda =|U-V|_{\infty }\) we get by (1) and by monotonicity of \(G(s,\cdot )\), \(G(s,U)-G(s,V)\le G(s,V+\lambda )-G(s,V)=\lambda \). By changing the role of \(U\) and \(V\) we obtain the desired estimation.

Now we will demonstrate (3). Let \(\tau _i:\ l^{\infty }(\mathbb Z ^m)\rightarrow l^{\infty }(\mathbb Z ^m)\) be defined by \((\tau _iU)_\alpha =U_{\alpha +e_i}\) for \(i=1,\ldots ,m\). Fix \(s\in \{0,1,\ldots ,N\}\). First we estimate \(|G(s,\tau _iU)-\tau _iG(s,U)|_{\infty }\). Since

$$\begin{aligned} G(s,\tau _iU)_{\alpha }=(\tau _iU)_{\alpha }+hg\left(t_{s},x_{\alpha }, \frac{{\Delta }^{+}}{k}(\tau _iU)_{\alpha -\gamma }\cdots \frac{{\Delta }^{+}}{k}(\tau _iU)_{\alpha +\beta }\right) \end{aligned}$$

and

$$\begin{aligned}{}[\tau _iG(s,U)]_{\alpha }=(\tau _iU)_{\alpha }+hg\left(t_{s},x_{\alpha +e_i}, \frac{{\Delta }^{+}}{k}(\tau _iU)_{\alpha -\gamma }\cdots \frac{{\Delta }^{+}}{k}(\tau _iU)_{\alpha +\beta }\right), \end{aligned}$$

we get

$$\begin{aligned} |G(s,\tau _iU)-\tau _iG(s,U)|_{\infty }\le L_x[g]k_ih. \end{aligned}$$

This and (2) imply

$$\begin{aligned} |\Delta ^{+}_{x_{i}}G(s,U)|_{\infty }&=|\tau _iG(s,U)-G(s,U)|_{\infty }\le |\tau _iG(s,U)-G(s,\tau _iU)|_{\infty }\\&\quad +|G(s,\tau _iU)-G(s,U)|_{\infty }\le L_x[g]k_ih+|\Delta ^{+}_{x_{i}}U|_{\infty } \end{aligned}$$

and (3) is proved.\(\square \)

Lemma 1

Let \(V\in AP(G,\Phi )\), \(\tilde{V}\in AP(\tilde{G},\tilde{\Phi })\) and \(\Phi ,\tilde{\Phi }\in l^{\infty }(\mathbb Z ^m;L_0)\). Suppose that \(g\) is Lipschitz continuous in \(x\), \(G(s,\cdot )\) is nondecreasing in \(l^{\infty }(\mathbb Z ^m;L_s)\) where \(L_s=L_0+L_{x}[g]sh\), and \(s\in \{0,1,\ldots ,N-1\}\). If there exists \(F(s)\) such that

$$\begin{aligned} |G(s,\cdot )-\tilde{G}(s,\cdot )|_{\infty }\le F(s), \end{aligned}$$

then

$$\begin{aligned} |V^{n+1}-\tilde{V}^{n+1}|_{\infty }\le \sum ^{n}_{s=0} F(s)+|\Phi -\tilde{\Phi }|_{\infty }\quad \text{ for} \text{ every}\ n\in \{0,1,\ldots ,N-1\}.\nonumber \\ \end{aligned}$$
(16)

Proof

In view of Proposition 1 (2) we have

$$\begin{aligned}&|V^{n+1}-\tilde{V}^{n+1}|_{\infty }=|G(n,V^n)-\tilde{G}(n,\tilde{V}^n)|_{\infty }\\&\quad \le |G(n,V^n)-G(n,\tilde{V}^n)|_{\infty }+|G(n,\tilde{V}^n)-\tilde{G}(n,\tilde{V}^n)|_{\infty }\le |V^{n}-\tilde{V}^{n}|_{\infty }+F(n). \end{aligned}$$

By repeating this \(n\)-times we obtain the desired inequality.

Notice that if \(\Phi ,\tilde{\Phi }\in l^{\infty }(\mathbb Z ^m;L_0)\), then in view of Proposition 1 (3) \(V^s,\tilde{V}^s\in l^{\infty }(\mathbb Z ^m;L_0+sL_{x}[g]h)\). Indeed, we use induction method. \(V^{0}=\Phi \in l^{\infty }(\mathbb Z ^m;L_0)\). Suppose that \(V^{s}\in l^{\infty }(\mathbb Z ^m;L_0+sL_{x}[g]h)\). Then by (15) and (12)

$$\begin{aligned} |{\Delta }^{+}U^{s+1}|_{\infty }\le |{\Delta }^{+}U^{s}|_{\infty }+L_{x}[g]hk\le (L_0+(s+1)L_{x}[g]h)k. \end{aligned}$$

This completes the proof. \(\square \)

3 Convergence of the scheme

In this section we will consider a general situation when \(f\) depends on \(w\). Particularly interesting is the case when this dependence is functional. Our results can be applied to a large class of differential-integral equations and equations with a retarded argument (see Examples 1 and 2).

Assumption 1

(A) Suppose that,

  1. (1)

    there exists \(\gamma >0\) such that \(|f(t,x,0,0)|\le \gamma \) in \(\bar{\Theta }\),

  2. (2)

    \(f(t,x,u,p)\) is global Lipschitz continuous in \(u\) and local Lipschitz continuous in \(p\),

  3. (3)

    there exists \(C>0\) such that

    $$\begin{aligned} |f(t,x,u,p)-f(t,\bar{x},u,p)|\le C(1+L_x[u]+p)|x-\bar{x}| \end{aligned}$$

    in \(\bar{\Theta }\times C_L(D)\times \mathbb R ^n,\)

  4. (4)

    there exists \(\Gamma :\mathbb R ^n \rightarrow [0,\infty )\) such that

    $$\begin{aligned} |f(t,x,u,p)-f(\bar{t},x,u,p)|\le \Gamma (p)(1+L_t[u])|t-\bar{t}| \end{aligned}$$

    in \(\bar{\Theta }\times C_L(D)\times \mathbb R ^n.\)

Here \(C_L(D)\) stands for the space of all Lipschitz functions on \(D\).

Since we use the space \(C_L(D)\) in (3) and (4) we can apply our results to equations with a retarded and deviated argument under restriction that \(\alpha \) depends on \(t\) and \(\beta \) depends on \(x\). It would be impossible if we considered the space \(C(D)\) leaving out \(L_x[u], L_t[u]\). Of course, the assumption would be stronger in this case, general enough to cover only differential-integral equation and constant retarded and deviated argument.

Assumption A can be formulated in more general form (see [19]) which gives a priori estimations on the solution and its Lipschitz constant in \(x\) (with a natural assumption on \(\varphi \)). Such general formulation can be reduced, however, to our formulation by a standard argument.

Now we will investigate the finite difference scheme (10), (11).

Definition 3

We say that \(g\) is consistent with \(f\) if for every \(a\in \mathbb R ^m\) \(g(t,x,u,a,\ldots ,a)=f(t,x,u,a)\) in \(\bar{\Theta }\times C(D)\).

In the following we will assume that \(g\) is consistent with \(f\), and \(k_{i}/h\) for \(i=1,\ldots ,m\) are constant. Put \(\lambda _{x_{i}}=k_{i}/h\).

In view of [19] we know that if \(f\) satisfies Assumption A, \(\varphi \in BC(\Theta _{0};L_0),\tilde{u}\in SOL(f,\varphi )\), then there exists \(L>0\) independent of \(\tilde{u}\) such that \(\tilde{u}\in BC(E;L)\). Let \(L\) be such a constant.

For \(u\in C(E)\) we define

$$\begin{aligned} f[u](t,x,p)=f(t,x,u_{(t,x)},p)\quad \text{ and}\quad g[u](t,x,p)=g(t,x,u_{(t,x)},a,\ldots ,a). \end{aligned}$$

Let \(G[u]\) be defined by (12) with \(g\) replaced by \(g[u]\).

Definition 4

We say that scheme (10), (11) is monotone on \([-L,L]\) if \(G[u](s,\cdot )\) is nondecreasing in \(l^{\infty }(\mathbb Z ^m,L)\) for every \(u\in C(D)\).

The main result of our paper is

Theorem 1

Suppose that \(f\) satisfies Assumption A and scheme (10), (11) is monotone on \([-L,L]\). Let \(\tilde{u}\in SOL(f,\varphi )\) and \(\tilde{U}\in AP(G,\Phi )\) where \(\varphi \in BC(\Theta _{0};L_0)\) and \(\Phi =\varphi _{|\Delta _{0}}\). Then there exists \(\tilde{K}>0\) independent of \(\tilde{u}\) such that if \(h\le 1\), then

$$\begin{aligned} |\tilde{U}-T^*\tilde{u}|_{\infty }\le \tilde{K}\sqrt{h}. \end{aligned}$$
(17)

Proof

Put \({\varphi }_{0}(x)={\varphi }(0,x)\) and \(\Phi _{0}(\alpha )=\Phi (0,\alpha )=\phi (0,\alpha )\) for \(\alpha \in \mathbb Z ^{m}\). Suppose that \(\tilde{u}\in SOL(f,{\varphi }),\tilde{U} \in AP(G,\Phi )\). Of course \(\tilde{u}\in SOL(f[\tilde{u}],{\varphi }_0),\tilde{U}\in AP(G[T\tilde{U}],\Phi _0)\). Obviously, it is clear that if \(f\) is consistent with \(g\), then \(f[\tilde{u}]\) is consistent with \(g[\tilde{u}]\).

Let \(V\in AP(G[\tilde{u}],\Phi _0)\). We have

$$\begin{aligned} |\tilde{U}-T^*\tilde{u}|^{n+1}_{\infty }\le |\tilde{U}-V|_{\infty }^{n+1}+|V-T^*\tilde{u}|^{n+1}_{\infty }. \end{aligned}$$

Based on the result obtained for the equation with no functional dependence (see [3, 17]) we can write that \(|V-T^*\tilde{u}|^{n+1}_{\infty }\le K\sqrt{h}\) where \(K\) is independent of \(\tilde{u}\). This gives

$$\begin{aligned} |\tilde{U}-T^*\tilde{u}|^{n+1}_{\infty }\le |\tilde{U}-V|_{\infty }^{n+1}+K\sqrt{h}. \end{aligned}$$

It remains to estimate \(|\tilde{U}-V|_{\infty }^{n+1}\). Since

$$\begin{aligned}&|G[T\tilde{U}](n,U)-G[\tilde{u}](n,U)|_{\infty }\le hC\Vert T\tilde{U}-\tilde{u}\Vert _{t_{n}}\\&\quad \le hC(\Vert T\tilde{U}-TT^{*}\tilde{u}\Vert _{t_{n}}+\Vert TT^{*}\tilde{u}-\tilde{u}\Vert _{t_{n}})\\&\quad \le hC[|\tilde{U}-T^{*}\tilde{u}|_{\infty }^{n}+L(h+k_1+\cdots +k_m)] \end{aligned}$$

by the property of \(T\), we obtain in view of Lemma 1

$$\begin{aligned} |\tilde{U}-V|_{\infty }^{n+1}\le hC\sum _{s=0}^{n}[|\tilde{U} -T^{*}\tilde{u}|_{\infty }^{s}+h L(1+\lambda _{x_1}+\cdots +\lambda _{x_m})] \end{aligned}$$

and consequently,

$$\begin{aligned} |\tilde{U}-T^*\tilde{u}|^{n+1}_{\infty } \le hC\sum _{s=0}^{n}[|\tilde{U}-T^{*}\tilde{u}|_{\infty }^{s}+Ah+K\sqrt{h} \end{aligned}$$

where \(A=\tau CL(1+\lambda _{x_1}+\cdots +\lambda _{x_m})\). Finally, we have for \(h\le 1\)

$$\begin{aligned} |\tilde{U}-T^*\tilde{u}|^{(n+1)}_{\infty }\le (h A+K\sqrt{h})e^{Ch n}\le \sqrt{h}(A+K)e^{C\tau }. \end{aligned}$$

This completes the proof.\(\square \)

4 Numerical examples

Put \(m=1\). Let us consider the following Lax scheme:

$$\begin{aligned} U^{n+1}_{j}&= \frac{U^{n}_{j+1}+U^{n}_{j-1}}{2}+ h f\left(t_{n},x_{j},(TU)_{(t_{n},x_{j})},\frac{U^{n}_{j+1}-U^{n}_{j-1}}{2k}\right) \quad \nonumber \\&\text{ for}\ n=0,\ldots ,N-1. \end{aligned}$$
(18)

Here we have \(\gamma =1, \beta =0,\ p=2,\ \alpha =j\). Since (18) can be written in the form

$$\begin{aligned} U^{n+1}_{j}&= U^{n}_{j}+\frac{h\lambda }{2}\left(\frac{\Delta ^{+}U^{n}_{j}}{k}- \frac{\Delta ^{+}U^{n}_{j-1}}{k}\right)\nonumber \\&+\, h f\left( t_{n},x_{j},(TU)_{(t_{n},x_{j})}, \frac{\Delta ^{+}U^{n}_{j}}{2k}+\frac{\Delta ^{+}U^{n}_{j-1}}{2k}\right) \end{aligned}$$
(19)

we define

$$\begin{aligned} g(t,x,w,a_{1},a_{2})=\frac{\lambda }{2}(a_2-a_1)+f\left(t,x,w,\frac{a_1+a_2}{2}\right) \end{aligned}$$

where \(\lambda =\frac{k}{h}\). It is easily seen that \(g\) is consistent with \(f\). Now we will describe what it means that our scheme is monotone on \([-L,L]\). Let \(U,V\in l^{\infty }(\mathbb Z ^{m};L)\), \(U\ge V\) and \(w\in C(E)\). We have

$$\begin{aligned}&G[w](s,U)_{j}= \frac{U_{j+1}+U_{j-1}}{2}+h f\left(t_{s},x_{j},w,\frac{U^{n}_{j+1}-U^{n}_{j-1}}{2k}\right),\\&G[w](s,U)_{j}-G[w](s,V)_{j}\ge \frac{1}{2}(U_{j+1}-V_{j+1}+U_{j-1}-V_{j-1})\\&\quad \quad -\frac{h}{2k}L_p[f](U_{j+1}-V_{j+1}-U_{j-1}+V_{j-1})\\&\quad =\left(\frac{1}{2}-\frac{L_p[f]}{2\lambda }\right)(U_{j+1}-V_{j+1})+ \left(\frac{1}{2}+\frac{L_p[f]}{2\lambda }\right)(U_{j-1}-V_{j-1}) \end{aligned}$$

where \(L_p[f]\) is a Lipschitz constant of \(f\) with respect to \(p\in [-L,L]\).

The above estimation shows that \(\lambda =k/h\ge L_{p}[f]\) is a sufficient condition for (18) to be monotone on \([-L,L]\).

Example 3

Consider the Lax scheme for the following problem

$$\begin{aligned} D_{t}u&= -\arctan {\left(\int \limits _{0}^{t}\int \limits _{-1}^{1}{u(s,x+y)}{dy}{ds}\right)}\nonumber \\&+\,\arctan {(g(t,x))}-h(t,x) +|D_{x}u|,\quad (t,x)\in [0,3]\times \mathbb R ,\end{aligned}$$
(20)
$$\begin{aligned} u(0,x)&= \cos {2x},\quad x\in \mathbb R \end{aligned}$$
(21)

where

$$\begin{aligned} g(t,x)=\left\{ \begin{array}{l@{\quad }l} 2\sin ^{2}{(t/2)}-\sin {(t/2-2)}\cos {2x}&\text{ if}\ |x|\le 1\\ 2\sin {(t/2)}\sin {2}\cos {(t/2-2|x|)}&\text{ if}\ |x|>1 \end{array}\right. \end{aligned}$$

and

$$\begin{aligned} h(t,x)=|2\sin (t-2|x|)|+\sin (t-2|x|). \end{aligned}$$

We set \(a_{0}=\tau =3\), \(D=[-\tau ,0]\times [-1,1]\), \(\phi (t,x)=\cos {2x}\) in \(\Theta _{0}=[-3,0]\times \mathbb R \) and \(K(t,x,s,y,u)=\rho (s,t)u\) where \(\rho (s,t)=0\) if \(s\in [-\tau ,-t]\) and \(\rho (s,t)= 1\) if \(s\in [-t,0]\) (see Example 2).

It is not difficult to verify that \(\tilde{u}(t,x)=\cos {(t-2|x|)}\) for \((t,x)\in [0,\pi ]\times \mathbb R \) is a viscosity solution of the above problem. The monotonicity condition for the scheme (18) holds if \(h\le k\) (\(L_{p}[f]=1\) is global).

A numerical experiment was made for \(h=0.01\) with different \(k\). The approximate values were obtained in the set \([0,3]\times [-B,B]\) where \(B\approx 298\). Maximal errors \(\delta \) for given \(t\) are presented in Table (a) below. The last two columns represent the case of non-monotonic scheme. From Table (b) we can see that errors (in monotonic case) satisfy a theoretical estimation given in Theorem 1. (\(K_{1}=Ae^{C\tau }\le \tilde{K}\)). In fact the theoretical error can be quite large for a large time interval. It is due to the fact that it grows exponentially in time and depends on a priori estimates. For instance an a priori Lipschitz constant \(L\) for the solution is much greater here than the real one.

\(\mathbf{\delta }\)

\(h=0.01\)

\(h=0.01\)

\(h=0.01\)

\(h=0.01\)

\(K_{1}\sqrt{h}\)

\(h=0.01\)

\(h=0.01\)

\(t\)

\(k=0.015\)

\(k=0.01\)

\(k=0.009\)

\(k=0.007\)

\(t\)

\(k=0.015\)

\(k=0.01\)

(a)

(b)

0.0

0.0000

0.0000

0.0000

0.0000

0.0

0.0000

0.0000

0.3

0.0121

0.0044

0.0039

0.0030

0.3

0.0539

0.0431

0.6

0.0237

0.0085

0.0073

0.8469

0.6

0.3698

0.2958

0.9

0.0338

0.0119

0.0100

290.14

0.9

2.0465

1.6372

1.2

0.0419

0.0148

0.0247

98231

1.2

12.826

10.261

1.5

0.0479

0.0171

0.1192

3.D \(+\) 07

1.5

101.27

81.015

1.8

0.0514

0.0185

0.4689

1.D \(+\) 10

1.8

1056.2

844.95

2.1

0.0520

0.0188

2.4524

4.D \(+\) 12

2.1

14924

11939

2.4

0.0493

0.0177

12.020

1.D \(+\) 15

2.4

3.D \(+\) 05

2.D \(+\) 05

2.7

0.0516

0.0187

58.000

4.D \(+\) 17

2.7

8.D \(+\) 06

6.D \(+\) 06

3.0

0.0657

0.0246

278.49

1.D \(+\) 20

3.0

3.D \(+\) 08

2.D \(+\) 08

An interesting effect can be observed if we prolong the time interval beyond \(\pi \). The error estimate is growing up. It is due to the fact that \(\tilde{u}(t,x)=\cos {(t-2|x|)}\) is no longer a viscosity solution for \(t>\pi \). (it is still a.e. solution). Our method gives an approximation of viscosity solution which exists and is unique globally. It is rather difficult to find an explicit formula for such solution if \(t>\pi \). Maximal errors in the set \([3,5]\times [-B,B]\) where \(B\approx 150\) are given in the table below (monotonicity condition holds).

\(\mathbf{\delta }\)

\(h=0.01\)

\(h=0.01\)

\(t\)

\(k=0.015\)

\(k=0.01\)

3.0

0.0657

0.0246

3.2

0.0800

0.0303

3.4

0.0963

0.0475

3.6

0.1341

0.1373

3.8

0.2620

0.2738

4.0

0.4284

0.4507

4.2

0.6241

0.6590

4.4

0.8368

0.8869

4.6

1.0507

1.1177

4.8

1.2491

1.3289

5.0

1.4228

1.5083

Example 4

Consider the Lax scheme for the following problem

$$\begin{aligned}&D_{t}u=\frac{1}{1\!+\!u^2(t^{2},x\!+\!\sin {x})}\!-\! g(t,x)\!+\!h(t,x)\!-\!|D_{x}u|,(t,x)\!\in \![0,1]\times \mathbb R \qquad \end{aligned}$$
(22)
$$\begin{aligned}&u(0,x)=-\sin {|x|},\quad x\in \mathbb R . \end{aligned}$$
(23)

where

$$\begin{aligned} g(t,x)=\frac{1}{1+\sin ^2{(t^2-|x+\sin {x}|)}},\quad h(t,x)=\max {\{2\cos {(t-|u|)},0)\}}. \end{aligned}$$

We can verify that \(\tilde{u}(t,x)=\sin {(t-|x|)}\) is a viscosity solution of the problem. The monotonicity condition for (18) has the form \(h\le k\) (\(L_{p}[f]=1\) is global). Here \(D=[-\frac{1}{4},0]\times [-1,1]\) and \(\phi (t,x)=-\sin {|x|}\) in \(\Theta _{0}=[-\frac{1}{4},0]\times \mathbb R \).

A numerical experiment was made for \(h=0.005\) with different \(k\). The approximate values were obtained in the set \([0,2]\times [-B, B]\) where \(B\approx 200\). Maximal errors are given in Table (a) below. The last two columns represent the case of non-monotonic scheme. Numerical errors can be compared with the theoretical results by using Table (b) (see Example 3).

\(\mathbf{\delta }\)

\(h=0.005\)

\(h=0.005\)

\(h=0.005\)

\(h=0.005\)

\(K_{1}\sqrt{h}\)

\(h=0.005\)

\(h=0.005\)

\(t\)

\(k=0.007\)

\(k=0.005\)

\(k=0.003\)

\(k=0.004\)

\(t\)

\(k=0.007\)

\(k=0.005\)

(a)

(b)

0.0

0.0000

0.0000

0.0000

0.0000

0.0

0.0000

0.0000

0.1

0.0140

0.0022

0.0169

0.0054

0.1

0.0188

0.0156

0.2

0.0130

0.0045

1.1045

0.0055

0.2

0.0415

0.0345

0.3

0.0155

0.0068

329.48

0.0258

0.3

0.0687

0.0573

0.4

0.0207

0.0091

94870.

0.4337

0.4

0.1013

0.0844

0.5

0.0261

0.0115

3.D \(+\) 07

4.6522

0.5

0.1399

0.1166

0.6

0.0317

0.0139

9.D \(+\) 09

39.357

0.6

0.1855

0.1546

0.7

0.0376

0.0165

3.D \(+\) 12

312.76

0.7

0.2392

0.1994

0.8

0.0437

0.0192

8.D \(+\) 14

3142.3

0.8

0.3021

0.2518

0.9

0.0501

0.0221

3.D \(+\) 17

32585

0.9

0.3757

0.3131

1.0

0.0567

0.0251

8.D \(+\) 19

3.D \(+\) 05

1.0

0.4613

0.3844

Example 5

Consider the Lax scheme for the following problem

$$\begin{aligned} D_{t}u&= \cos {u\left(t-t^{2},x+\frac{2}{\pi }\arctan {x}\right)}-g(t,x)\nonumber \\&+\,h(t,x)+\frac{1}{10+10|D_{x}u|}-\frac{19}{10}|D_{x}u|,\quad (t,x)\in [0,2]\times \mathbb R \end{aligned}$$
(24)
$$\begin{aligned} u(t,x)&= -\cos {t}\arctan {|x|},\quad (t,x)\in [-2,0]\times \mathbb R . \end{aligned}$$
(25)

where

$$\begin{aligned} g(t,x)&= \cos {\left[{\arctan {\left(|x+\frac{2}{\pi }\arctan {x}|\right)-(t-t^2)^{2}}}\right]},\\ h(t,x)&= \frac{2t}{1+ (|x|-t^2)^2}-\frac{1}{10+\frac{10}{1+(|x|-t^2)^2}} +\frac{19}{10+10(|x|-t^2)^2}. \end{aligned}$$

We verify that \(\tilde{u}\) such that \(\tilde{u}(t,x)=-\arctan {(|x|-t^2)}\) in \([0,2]\times \mathbb R \) and satisfying (25) is a viscosity solution of the problem. The monotonicity condition for the scheme (18) has the form \(2h\le k\) (\(L_{p}[f]=2\) is global). Here \(D=[-2,0]\times [-1,1]\).

A numerical experiment was made for \(h=0.005\) with different \(k\). The approximate values were obtained in the set \([0,2]\times [-B, B]\) where \(B\approx 202\). Maximal errors are given in Table (a) below. The last two columns represent the case of non-monotonic scheme. The errors can be compared with the theoretical results by using Table (b) (see Example 3).

\({\delta }\)

\(h=0.005\)

\(h=0.005\)

\(h=0.005\)

\(h=0.005\)

\(K_{1}\sqrt{h}\)

\(h=0.005\)

\(h=0.005\)

\(t\)

\(k=0.015\)

\(k=0.01\)

\( k=0.009\)

\( k=0.008\)

\(t\)

\(k=0.015\)

\(k=0.01\)

(a)

(b)

0.0

0.0000

0.0000

0.0000

0.0000

0.0

0.0000

0.0000

0.2

0.0112

0.0048

0.0038

0.0055

0.2

0.1382

0.1036

0.4

0.0171

0.0073

0.0060

0.2883

0.4

0.3376

0.2532

0.6

0.0186

0.0077

0.0156

8.9333

0.6

0.6184

0.4638

0.8

0.0175

0.0070

0.0575

199.64

0.8

1.0072

0.7554

1.0

0.0154

0.0057

0.2425

3839.4

1.0

1.5377

1.1533

1.2

0.0133

0.0045

0.7090

1.D \(+\) 05

1.2

2.2538

1.6903

1.4

0.0116

0.0034

1.0670

4.D \(+\) 06

1.4

3.2116

2.4087

1.6

0.0100

0.0023

3.1155

1.D \(+\) 08

1.6

4.4830

3.3622

1.8

0.0084

0.0012

8.4006

5.D \(+\) 09

1.8

6.1600

4.6200

2.0

0.0069

0.0007

22.910

2.D \(+\) 11

2.0

8.3598

6.2698

Example 6

Now we will give a numerical solution to the problem for which the exact solution is not known. Consider the Lax scheme for:

$$\begin{aligned} D_{t}u&= \frac{3u\left(t^3,\frac{x^3}{1+x^2}\right)}{1+|u\left(t^3,\frac{x^3}{1+x^2}\right)|}-5\sin {\left(\frac{|D_{x}u|}{5}\right)},\quad (t,x)\in [0,1]\times \mathbb R \end{aligned}$$
(26)
$$\begin{aligned} u(0,x)&= 1+\frac{1}{2}|\sin {x}|,\quad x\in \mathbb R . \end{aligned}$$
(27)

The monotonicity condition for the scheme (18) has the form \(h\le k\) (\(L_{p}[f]=1\) is global). Here \(D=[-\frac{2}{3\sqrt{3}},0]\times [-\frac{1}{2},\frac{1}{2}]\) and \(\phi (t,x)=1+\frac{1}{2}|\sin {x}|\) in \(\Theta _{0}=[-\frac{2}{3\sqrt{3}},0]\times \mathbb R \).

We compare approximate solutions in the set \([0,1]\times [-10,10]\) for different \(h\) and \(k\) with that obtained for \(h=k=0.002\) (it may be treated as the exact solution). The errors are given in the table:

\(t\)

\(h=0.01\)

\(h=0.005\)

\(h=0.01\)

 

\(k=0.01\)

\(k=0.01\)

\(k=0.005\)

0.0

0.0000

0.0000

0.0000

0.1

0.0041

0.0091

0.0259

0.2

0.0042

0.0124

0.1094

0.3

0.0043

0.0152

0.2517

0.4

0.0043

0.0176

0.4118

0.5

0.0042

0.0199

0.5324

0.6

0.0041

0.0220

0.6468

0.7

0.0039

0.0238

0.7819

0.8

0.0037

0.0255

0.9344

0.9

0.0034

0.0270

1.0616

1.0

0.0031

0.0284

1.2198

It is easily seen that violation of the monotonicity condition (the last column) leads to significant errors. It could also be seen from the graph of approximate solution. In Fig. 1 graphs of two solutions for which the monotonicity condition holds, are displayed. These graphs are very similar (we see both as almost one graph). Figure 2 represents the case for which the optimal link is not satisfied.

Fig. 1
figure 1

\(h=k=0.01\) and \(h=0.005,\ k=0.01\)

Fig. 2
figure 2

\(h=0.01,\ k=0.005\)