1 Introduction

We consider the scattering problem of a wave by a layered medium in the positive half line. The medium is supported in (0, L),  where \(L>0\) describes its length. We examine both the direct and the inverse problems. The direct problem is to compute the solution of the wave equation at a detector position \(x= L+D,\) with \(D>0,\) given the optical properties of the medium (refractive index \(\nu \) and length of every layer) and the initial wave, to be supported at \((L,\infty ).\)

The much more interesting, but difficult to solve, problem is the corresponding inverse problem where we aim to reconstruct the optical properties of the medium from the knowledge of the back-reflected data, meaning the wave at \(x=L+D,\) for some time interval \(t\in (0,T).\)

The study of the inverse problem for the wave equation in layered media plays a crucial role in understanding and modelling complex wave propagation phenomena. It enables the estimation of important material parameters in various practical applications such as seismology, geophysics, acoustics, and medical imaging [1,2,3,4,5,6,7,8].

In such cases, the media are commonly assumed to have a structure composed of multiple layers with different physical properties. For example, the Earth’s subsurface consists of seismic layers but also the human skin is made up of tissue layers. The wave propagation becomes more complex due to the presence of discontinuities and variations in material properties across the different layers.

The Fresnel equations are often relevant in the study of inverse problems for the wave equation. These equations describe the reflection and transmission of waves (acoustic and electromagnetic) at the interface between two media with different refractive indices [9, 10].

For instance, in optical coherence tomography, the measured intensity is the interference of a backscattered light (coming from the sample) with a back-reflected light (from a fixed mirror). For a layered medium, the backscattered signal can be described by a (infinite) sum of waves back-reflected by the discontinuities of the medium (layer interfaces) with coefficients given by the Fresnel equations. A layer stripping algorithm is usually applied for solving the inverse problem, see for example [11,12,13,14,15].

The above approach is based on an analytical representation which involves infinite series of transforms of the initial and boundary conditions. This is reflected also on the numerical simulations where one has to truncate the summation, depending on the number of multiple reflections to be considered. In the current work, we bypass this issue by deriving a d’Alembert-type representation of the solution for the wave equation, on a layered medium, which involves only finite sums of known functions on the physical domain. The formulated expression for a single-layered structure, as presented in Proposition 2, coincides with previously documented equations for the case that the incident field has the form of short pulses, see for example [16, Section 3]. Enhancing the later analysis to more general incident fields is rather straightforward. However, we find worth mentioning that our analysis yields Proposition 2 in a natural way for general incident field, based on the results obtained by the Fokas method in [17] and avoiding using their Fourier transforms. This is to be contrasted to the approach of [16] where the crucial assumption that the incident field is given in the form of pulses allows for exploiting the specific structure of their Fourier transform in order to derive the solution of the direct problem. Therefore, the significance and novelty of the current research reside in the methodologies employed to derive the form of the reflectance, which can be seen as a slight generalization of established results to diverse incident field profiles.

The derivation of this solution representation is based on the Fokas method for solving linear initial-boundary value problems (IBVPs). This method, which is also known as the unified transform, was introduced in 1997 by Fokas [18], for solving IBVPs for nonlinear integrable partial differential equations (PDEs). Later, it was realised that it produced effective analytical and numerical solutions for linear PDEs [19]; for an overview of the method we refer to [20, 21]. The last two decades hundreds of works have been published, using and extending the Fokas method to substantially different directions, including fluid dynamics [22,23,24], control theory [25, 26], regularity results [27,28,29]. In general, the Fokas method yields solutions of the IBVPs as integral representations involving the Fourier (spectral) transforms of the initial and boundary conditions. Starting from these representations, one can also obtain representations in the physical space, in terms of the associated Green’s functions, which involve integrals in the spectral space. For the case of the wave equation, these integrals can be easily computed explicitly, yielding, in a natural way, d’Alembert type representations.

The current work is based on the formulae obtained in [17] where the classical d’Alembert solution of the wave equation was extended to the half-line and the finite interval problem. Employing the fact that the solutions of the IBVPs derived by the Fokas method converge uniformly to the assigned initial and boundary conditions, we extend the classical d’Alembert solution to the layered medium, by coupling the relevant conditions on the boundaries between the layers. This concept reduces the solution of the problem to a system of algebraic or functional equations, which is to be contrasted to the initial problem involving a system of partial differential equations. This reduction is a feature induced by the Fokas method to interface problems for a variety of PDEs, for example the heat equation [30,31,32,33] and the Schrödinger equation [34, 35].

1.1 Organisation of the paper

In Sect. 2, we present the characterisation of IBVP for the wave equation for the single and double-layered medium. Furthermore, we derive the extension of the d’Alembert-type solution for the single-layered medium, as well as the analogue formula for the measurement at the detector for the case that the initial condition displays a delta-like pulse distribution, both for the single and double-layered medium. Based on the above results, in Sect. 3, we present in detail the solution for the inverse scattering problem for the multi-layered medium, both for the full and phaseless data/measurements. We note that although the latter is an ill-posed problem, we provide evidence that one could find the unique solution if the total length of the medium is known. The numerical illustration of both the direct and inverse problem is provided in Sect. 4.

2 The direct scattering problem

We consider the scattering problem in the half line \(x>0.\) The support of the medium is in the interval (0, L) with boundaries placed at \(x=0\) and \(x=L.\) We assume illumination from the right, meaning for \(x>L\) with a wave having support (short pulse) in the interval \((L,\infty ).\) We define

$$\begin{aligned} c_j = \frac{c}{\nu _j}, \quad j = 0,1,\ldots \end{aligned}$$
(1)

the wave speed in the jth layer of the medium. Without loss of generality, we assume \(c_0 \equiv 1,\) describing the speed in free space; then \(0<c_j<1, \ j=1,2, \ldots .\)

The direct problem then reads: Given the initial wave and the properties of the medium (wave speed and length), find the back-scattered wave at some position \(x>L.\)

2.1 Single-layered medium

For a single-layered medium, we have only one wave speed \(c_1,\) for \(0<x<L,\) and the scattering problem can be decomposed into two sub-problems in the intervals \((0,\,L)\) and \((L,\,+\infty )\) as follows:

IBVP I (half line):
$$\begin{aligned} u_{tt} - u_{xx}&= 0, \qquad x>L, \, t>0, \end{aligned}$$
(2a)
$$\begin{aligned} u(x,0) = U_0 (x), \, u_t (x,0)&=0, \qquad x >L, \end{aligned}$$
(2b)
$$\begin{aligned} u(L,t) = G (t), \, u_x(L,t)&= F (t), \quad t>0, \end{aligned}$$
(2c)

where \(U_0: [L,\,+\infty ) \rightarrow \mathbb {R}.\)

IBVP II (finite interval):
$$\begin{aligned} v_{tt} - c_1^2 v_{xx}&= 0, \quad 0<x <L, \, t>0, \end{aligned}$$
(3a)
$$\begin{aligned} v(x,0) = v_t (x,0)&=0, \quad 0<x <L, \end{aligned}$$
(3b)
$$\begin{aligned} v(0,t)&= 0, \quad t>0, \end{aligned}$$
(3c)
$$\begin{aligned} v(L,t) = H (t), \, v_x(L,t)&= Q (t), \quad t>0. \end{aligned}$$
(3d)

In addition, we impose the compatibility condition

$$\begin{aligned} U_0 (L) = G(0) = H(0)=0. \end{aligned}$$
(4)

The problems (2) and (3) are coupled through the boundary conditions (2c) and (3d) to be seen as continuity equations in the sense:

$$\begin{aligned} G (t)&= u(x,t) \mid _{x=L} = v(x,t) \mid _{x=L} = H (t) , \qquad&t>0, \end{aligned}$$
(5a)
$$\begin{aligned} F (t)&= u_x(x,t) \mid _{x=L} = v_x(x,t) \mid _{x=L} = Q (t) , \qquad&t>0. \end{aligned}$$
(5b)

In order to obtain the solution of (2) we employ [17, Eq. (25)] using the change of variables \(x= \tilde{x} +L:\)

$$\begin{aligned} u(x,t) = \frac{1}{2} u_0 (x-L+t) + {\left\{ \begin{array}{ll} \tfrac{1}{2} u_0 (x-L-t), &{} x>L+t, \\ g (t-x+L) -\tfrac{1}{2} u_0 (t-x+L), &{} L<x<L+t. \end{array}\right. } \end{aligned}$$
(6)

This function satisfies the initial conditions

$$\begin{aligned} u(x,0) = u_0 (x-L), \quad u_t (x,0)=0, \quad x>L, \end{aligned}$$
(7)

as well as the condition \( u(L,t) = g (t), \quad t>0\).

Hence, it suffices to set \(g(t) = G(t)\) and \(u_0 (x-L) = U_0 (x)\) which modifies (6) into

$$\begin{aligned} u(x,t) = \frac{1}{2} U_0 (x+t) + {\left\{ \begin{array}{ll} \tfrac{1}{2} U_0 (x-t), &{} x>L+t, \\ G (t-x+L) -\tfrac{1}{2} U_0 (t-x+2L), &{} L<x<L+t , \end{array}\right. } \end{aligned}$$
(8)

which satisfies the boundary condition

$$\begin{aligned} u(L,t) = G (t), \quad t>0. \end{aligned}$$
(9)

Thus, the function defined in (8) is the solution of (2). The spatial derivative of (8), evaluated at \(x=L,\) gives

$$\begin{aligned} u_x(L,t) = U'_0 (L+t) -G' (t) =: F(t), \quad t>0. \end{aligned}$$
(10)

Similarly, from [17, Eq. (63)] setting \(t = \tilde{t}/c_1\) we get

$$\begin{aligned} v(x,t) = \sum _{n=0}^{\left[ \tfrac{c_1 t +x-L}{2L}\right] } h (c_1 t +x - (2n+1)L) - \sum _{n=0}^{\left[ \tfrac{c_1 t -x-L}{2L}\right] } h (c_1 t -x - (2n+1)L), \end{aligned}$$
(11)

where [a] denotes the integer part of the real number a. The solution provided by the Fokas method converges uniformly to the initial and boundary conditions. Indeed, it is straightforward to observe that the initial conditions (3b) and the boundary condition (3c) are satisfied. Also, for \(x=L,\) we obtain

$$\begin{aligned} \begin{aligned} v(L,t)&= \sum _{n=0}^{\left[ \tfrac{c_1 t}{2L}\right] } h \left( c_1 t -2nL\right) - \sum _{n=0}^{\left[ \tfrac{c_1 t}{2L}\right] -1 } h \left( c_1 t - 2 (n+1)L\right) \\&= \sum _{n=0}^{\left[ \tfrac{c_1 t}{2L}\right] } h \left( c_1 t -2nL\right) - \sum _{n=1}^{\left[ \tfrac{c_1 t}{2L}\right] } h \left( c_1 t - 2nL\right) \\&= h (c_1 t), \end{aligned} \end{aligned}$$
(12)

where we have set \(n+1 = \tilde{n}\) in the second sum. We set \(h(c_1 t) = H(t)\) and we derive the solution of (3) as

$$\begin{aligned} v(x,t) = \sum _{n=0}^{\left[ \tfrac{c_1 t +x-L}{2L}\right] } H \left( t +\tfrac{x - (2n+1)L}{c_1}\right) - \sum _{n=0}^{\left[ \tfrac{c_1 t -x-L}{2L}\right] } H \left( t - \tfrac{x + (2n+1)L}{c_1}\right) , \end{aligned}$$
(13)

satisfying

$$\begin{aligned} v(L,t) = H(t), \quad t>0. \end{aligned}$$
(14)

By taking the spatial derivative of (11) at \(x=L,\) we obtain

$$\begin{aligned} \begin{aligned} v_x (L,t)&= \frac{1}{c_1}\sum _{n=0}^{\left[ \tfrac{c_1 t}{2L}\right] } H' \left( t -\tfrac{2nL}{c_1}\right) + \frac{1}{c_1}\sum _{n=0}^{\left[ \tfrac{c_1 t }{2L}\right] -1 } H' \left( t - \tfrac{2 (n+1)L}{c_1}\right) \\&= \frac{1}{c_1}H' ( t) + \frac{2}{c_1}\sum _{n=1}^{\left[ \tfrac{c_1 t}{2L}\right] } H' \left( t - \tfrac{2n L}{c_1} \right) =: Q(t). \end{aligned} \end{aligned}$$
(15)

Then, the continuity equations (5) using (9), (10), (14) and (15) result in the system

$$\begin{aligned} G (t)&= H ( t), \quad t >0, \end{aligned}$$
(16a)
$$\begin{aligned} U'_0 (L+t) -G' (t)&= \frac{1}{c_1}H' ( t) + \frac{2}{c_1}\sum _{n=1}^{\left[ \tfrac{c_1 t}{2L}\right] } H' \left( t - \tfrac{2n L}{c_1} \right) , \quad t >0, \end{aligned}$$
(16b)

which by integrating and using (4) takes the compact form

$$\begin{aligned} G(t) = \frac{c_1}{c_1 +1} U_0 (L+t) - \frac{2}{c_1 +1} \sum _{n=1}^{\left[ \tfrac{c_1 t}{2L}\right] } G \left( t - \tfrac{2n L}{c_1} \right) , \quad t\ge 0, \end{aligned}$$
(17)

under the convention that if \(0\le t<2L/c_1,\) then the sum yields no terms, thus vanishes.

The solution of the above system of equations gives the boundary function G in terms of the known initial condition \(U_0.\) Then, the wave is given by (13) (by replacing H with G) for \(0\le x \le L\), and by (8) for \(x>L.\)

Equation (17) is also used for deriving the backscattered wave at some position \(x=L+D,\) with \(D>0.\) Thus, by determining the solution G(t) from the above equation, we will be able to compute the function

$$\begin{aligned} m(t) := u(L+D,t), \quad t>0. \end{aligned}$$
(18)

Theorem 1

Let \(U_0\) be supported in \((L,\, \infty ),\) then the solution of (17) is given by

$$\begin{aligned} \begin{aligned} G(t)&= \frac{c_1}{c_1 +1} U_0 (L+t) \\&\quad - \frac{2c_1}{(c_1 + 1)^2} \sum _{n=0}^{\left[ \tfrac{c_1 t}{2L}-1\right] } \frac{(c_1 - 1)^n}{(c_1 +1)^{n}} U_0 \left( L+ t - \tfrac{2(n+1) L}{c_1} \right) , \quad t \ge 0, \end{aligned} \end{aligned}$$
(19)

under the convention that if \(0\le t<2L/c_1,\) then the above sum yields no terms, thus vanishes.

Proof

The proof is done by induction. By definition, if \(t\in [0, 2\,L/c_1 ),\) then (17) and (19) coincide. Let (19) be true for \(t\in [0,T),\) we will employ (17) to show that it is also valid for \(t\in [0, T+2\,L/c_1).\)

We consider (17) for \(t\in [0, T+2L/c_1),\) and as in (12), we rewrite it as

$$\begin{aligned} G(t) = \frac{c_1}{c_1+1} U_0 (L+t) - \frac{2}{c_1 +1} \sum _{n=0}^{\left[ \tfrac{c_1 t}{2L}-1\right] } G \left( t - \tfrac{2(n+1) L}{c_1} \right) . \end{aligned}$$
(20)

Since \( t - \tfrac{2(n+1) L}{c_1}<T+\tfrac{2L}{c_1} - \tfrac{2(n+1) L}{c_1} < T+\tfrac{2L}{c_1}-\tfrac{2L}{c_1}=T\), the term in the summation can now by computed using (19), thus

$$\begin{aligned} \begin{aligned} G \left( t - \tfrac{2(n+1) L}{c_1}\right)&= \frac{c_1}{c_1 +1} U_0 \left( L+t - \tfrac{2(n+1) L}{c_1} \right) \\&\quad - \frac{2 c_1}{(c_1 +1)^2} \sum _{k=0}^{\left[ \tfrac{c_1 t}{2L} -n-2\right] } \frac{(c_1 - 1)^k}{(c_1 +1)^k} U_0 \left( L+ t - \tfrac{2(n+k+2) L}{c_1} \right) . \end{aligned} \end{aligned}$$
(21)

Substituting (21) into (20), results in

$$\begin{aligned} \begin{aligned} G(t)&= \frac{c_1}{1+c_1} U_0 (L+t) - \frac{2c_1}{(c_1 +1)^2} \sum _{n=0}^{\left[ \tfrac{c_1 t}{2L}-1\right] } U_0 \left( L+t - \tfrac{2(n+1) L}{c_1} \right) \\&\quad + \frac{4 c_1}{(c_1 +1)^3} \sum _{n=0}^{\left[ \tfrac{c_1 t}{2L}-1\right] } \sum _{k=0}^{\left[ \tfrac{c_1 t}{2L} -n-2\right] } \frac{(c_1 - 1)^k}{(c_1 +1)^k} U_0 \left( L+ t - \tfrac{2(n+k+2) L}{c_1} \right) . \end{aligned} \end{aligned}$$
(22)

We can simplify the double summation into a single summation, by defining \(\lambda = n+k+1,\) and adding “diagonally" the double sum on \(\lambda ,\) meaning, by collecting all terms involving \(U_0 \left( L+t-\tfrac{2(\lambda +1) L}{c_1}\right) .\) In more detail, the double sum in (22) is rewritten in the form

$$\begin{aligned} \sum _{n=0}^{\left[ \tfrac{c_1 t}{2L}-1\right] }&\sum _{\lambda =n+1}^{\left[ \tfrac{c_1 t}{2L} -1\right] } \left( \frac{c_1 - 1}{c_1 +1}\right) ^{\lambda -n-1} U_0 \left( L+ t - \tfrac{2(\lambda +1) L}{c_1} \right) \nonumber \\&=\sum _{\lambda =1}^{\left[ \tfrac{c_1 t}{2L}-1\right] } \sum _{n=0}^{\lambda -1} \left( \frac{c_1 - 1}{c_1 +1}\right) ^{\lambda -n-1} U_0 \left( L+t-\tfrac{2(\lambda +1)L}{c_1}\right) \nonumber \\&=\sum _{\lambda =1}^{\left[ \tfrac{c_1 t}{2L}-1\right] } \left( \sum _{\mu =0}^{\lambda -1} \left( \frac{c_1 - 1}{c_1 +1}\right) ^{\mu } \right) U_0 \left( L+t-\tfrac{2(\lambda +1)L}{c_1}\right) \nonumber \\&= -\frac{c_1 +1}{2} \sum _{\lambda =0}^{\left[ \tfrac{c_1 t}{2L}-1\right] } \left[ \left( \frac{c_1 -1}{c_1 +1}\right) ^{\lambda } -1 \right] U_0 \left( L+t-\tfrac{2(\lambda +1) L}{c_1}\right) . \end{aligned}$$
(23)

Substituting the double sum in (22) by the expression at the RHS of (23), with the change of notation \(\lambda = n\), results in (19) for \(t\in [0, T+2L/c_1)\), completing the induction. \(\square \)

Remark 1

An alternative way for obtaining G(t) follows by the observation that the function Q(t),  appearing in the right-hand side of (15), can be analysed as

$$\begin{aligned} Q(t)&= \tfrac{1}{c_1} H'(t), \quad t\in \left( 0, \tfrac{2L}{c_1}\right) , \end{aligned}$$
(24a)
$$\begin{aligned} Q(t)&= \tfrac{1}{c_1} H'(t) + \tfrac{2}{c_1} H'\left( t-\tfrac{2L}{c_1} \right) , \quad t\in \left( \tfrac{2L}{c_1}, \tfrac{4L}{c_1}\right) , \end{aligned}$$
(24b)
$$\begin{aligned}&\vdots \nonumber \\ Q(t)&= \tfrac{1}{c_1} H'(t) + \tfrac{2}{c_1} \sum _{n=1}^N H'\left( t-\tfrac{2nL}{c_1} \right) , \quad t\in \left( \tfrac{2NL}{c_1}, \tfrac{2(N+1)L}{c_1}\right) , \end{aligned}$$
(24c)

for \(N \in \mathbb {N}_0,\) and with \(N=0,\) we mean that no summation is performed.

Thus, we could also compute the solution of (16) by dividing time in appropriate intervals, as in (24), and compute the boundary functions sectionally. This approach is presented in Appendix A.

By substituting (19) in (8) we obtain the measured data (18) in a d’Alembert form; this reads as the following proposition.

Proposition 2

Let \(U_0\) be supported in \((L,\, \infty ),\) then the measurements at the detector is given by

$$\begin{aligned} m(t) = \frac{1}{2} U_0 (L+D+t) + \frac{1}{2} U_0 (L+D-t), \quad 0 \le t \le D, \end{aligned}$$
(25)

and for \(t>D,\) we get

$$\begin{aligned} \begin{aligned} m(t)&= \frac{1}{2} U_0 (L+D+t) +\frac{1}{2}\frac{c_1 -1}{c_1 +1} U_0 (L-D+t) \\&\quad -2 c_1 \sum _{n=0}^{\left[ \tfrac{c_1 (t-D)}{2L}-1\right] }\frac{(c_1 -1)^n}{(c_1+1)^{n+2}} U_0 \left( L-D -\frac{2(n+1)L}{c_1}+t\right) . \end{aligned} \end{aligned}$$
(26)

2.1.1 Delta-like short pulse

In the ideal case of an initial function of the form

$$\begin{aligned} U_0 (x) = \left\{ \begin{array}{lr} 1, &{} \text {for } x=x_0,\\ 0, &{} \text {for } x \ne x_0, \end{array}\right. \end{aligned}$$
(27)

with \(x_0 >L,\) the previous result allows us to represent G,  (and consequently m) at specific time points, as a function of \(c_1\) only.

Without loss of generality, we place the source at the detector position, meaning \(x_0 = L+D.\) Defining \(G^{(k)}:= G(D + k\tfrac{2L}{c_1}),\ k\in \mathbb {N}\) and evaluating (17) at \(t=D+k\tfrac{2L}{c_1}, \ k\in \mathbb {N}\), we obtain

$$\begin{aligned}&G^{(0)} = \frac{c_1}{c_1 + 1}, \qquad G^{(1)} = -\frac{2c_1}{(c_1 + 1)^2}, \end{aligned}$$
(28)
$$\begin{aligned}&G^{(k)} = - \frac{2}{c_1 +1} \sum _{n=1}^{\left[ \tfrac{c_1 D}{2L}+k\right] } G^{(k-n)}, \qquad k\ge 2. \end{aligned}$$
(29)

Then, the subtraction of the kth term from the \((k-1)\)th term of (29) yields

$$\begin{aligned} G^{(k)} = \frac{c_1 -1}{c_1 +1}G^{(k-1)}, \qquad k\ge 2. \end{aligned}$$
(30)

Thus, (28) and (30) yield

$$\begin{aligned} G^{(k)} = {\left\{ \begin{array}{ll} \frac{c_1}{c_1 + 1}, &{} \text {for } k=0,\\ -\frac{2c_1 (c_1 -1)^{k-1}}{(c_1 + 1)^{k+1}}, &{} \text {for } k=1,2,\ldots \end{array}\right. } \end{aligned}$$
(31)

Setting \(t=0\) in (25), we get \(m(0)=1,\) as expected. We define \(m^{(k)}:= m(2D + k\tfrac{2L}{c_1}),\) and from (26) we get

$$\begin{aligned} m^{(k)} = {\left\{ \begin{array}{ll} \frac{1}{2}\frac{c_1-1}{c_1 + 1}, &{} \text {for } k=0,\\ G^{(k)}, &{} \text {for } k=1,2,\ldots \end{array}\right. } \end{aligned}$$
(32)

2.2 Double-layered medium

We consider the same scattering problem but now the medium consists of two layers, again supported in (0, L). Let the jth layer have wave speed \(c_j,\) and length \(l_j,\) for \(j=1,2,\) such that \(l_1 + l_2 = L.\)

This scattering problem can be decomposed into three sub-problems in the intervals \((0,\, l_2),\) \((l_2,\, L),\) and \((L,+\infty )\) as follows:

IBVP I (half line):
$$\begin{aligned} u_{tt} - u_{xx}&= 0, \quad x>L, \, t>0, \end{aligned}$$
(33a)
$$\begin{aligned} u(x,0) = U_0 (x), \, u_t (x,0)&=0, \quad x >L, \end{aligned}$$
(33b)
$$\begin{aligned} u(L,t) = G_0 (t), \, u_x(L,t)&= F_0 (t), \quad t>0, \end{aligned}$$
(33c)

where \(U_0: [L,\,+\infty ) \rightarrow \mathbb {R}.\)

IBVP II (finite interval):
$$\begin{aligned} v_{tt} - c_1^2 v_{xx}&= 0, \quad l_2<x <L, \, t>0, \end{aligned}$$
(34a)
$$\begin{aligned} v(x,0) = v_t (x,0)&=0, \quad l_2<x <L, \end{aligned}$$
(34b)
$$\begin{aligned} v(l_2,t) = G_1(t), \, v_x(l_2,t)&= F_1 (t), \quad t>0, \end{aligned}$$
(34c)
$$\begin{aligned} v(L,t) = H_1 (t), \, v_x(L,t)&= Q_1 (t), \quad t>0. \end{aligned}$$
(34d)
IBVP III (finite interval):
$$\begin{aligned} w_{tt} - c_2^2 w_{xx}&= 0, \quad 0<x <l_2, \, t>0, \end{aligned}$$
(35a)
$$\begin{aligned} w(x,0) = w_t (x,0)&=0, \quad 0<x <l_2, \end{aligned}$$
(35b)
$$\begin{aligned} w(0,t)&= 0, \quad t>0, \end{aligned}$$
(35c)
$$\begin{aligned} w(l_2,t) = H_2 (t), \, w_x(l_2,t)&= Q_2 (t), \quad t>0. \end{aligned}$$
(35d)

The compatibility condition now reads

$$\begin{aligned} U_0 (L) = G_0 (0) = G_1 (0) = H_1 (0) = H_2 (0)=0. \end{aligned}$$
(36)

The problems (33), (34), and (35) are coupled through the boundary—continuity conditions:

$$\begin{aligned} G_0 (t)&= u(x,t) \mid _{x=L}= v(x,t) \mid _{x=L}=H_1 (t), \quad \quad t>0, \end{aligned}$$
(37a)
$$\begin{aligned} F_0 (t)&= u_x(x,t) \mid _{x=L} = v_x(x,t) \mid _{x=L}= Q_1 (t) , \quad \quad t>0, \end{aligned}$$
(37b)
$$\begin{aligned} G_1 (t)&= v(x,t) \mid _{x=l_2}= w(x,t) \mid _{x=l_2}=H_2 (t), \quad \quad t>0, \end{aligned}$$
(37c)
$$\begin{aligned} F_1 (t)&= v_x(x,t) \mid _{x=l_2} = w_x(x,t) \mid _{x=l_2}= Q_2 (t) , \quad \quad t>0. \end{aligned}$$
(37d)

The solution of (33) is given by (8) by replacing G with \(G_0.\) Similarly, the solution of (35) is given by

$$\begin{aligned} w(x,t) = \sum _{n=0}^{\left[ \tfrac{c_2 t +x-l_2}{2l_2}\right] } H_2 \left( t +\tfrac{x - (2n+1)l_2}{c_2}\right) - \sum _{n=0}^{\left[ \tfrac{c_2 t -x-l_2}{2l_2}\right] } H_2 \left( t - \tfrac{x + (2n+1)l_2}{c_2}\right) , \end{aligned}$$
(38)

using (13) in this problem.

Using [17, Eq. (63)] for \(t = \tilde{t}/c_1,\) and \(x = \tilde{x} + l_2,\) we get

$$\begin{aligned} \begin{aligned} v(x,t)&= \sum _{n=0}^{\left[ \tfrac{c_1 t +x-l_2-l_1}{2l_1}\right] } H_1 \left( t +\tfrac{x - l_2 - (2n+1)l_1}{c_1}\right) - \sum _{n=0}^{\left[ \tfrac{c_1 t -x + l_2 -l_1}{2l_1}\right] } H_1 \left( t - \tfrac{x -l_2 + (2n+1)l_1}{c_1}\right) \\&\quad \quad -\sum _{n=0}^{\left[ \tfrac{c_1 t +x-l_2-2l_1}{2l_1}\right] } G_1 \left( t +\tfrac{x - l_2 - 2(n+1)l_1}{c_1}\right) + \sum _{n=0}^{\left[ \tfrac{c_1 t -x + l_2}{2l_1}\right] } G_1 \left( t - \tfrac{x -l_2 + 2n l_1}{c_1}\right) , \end{aligned} \end{aligned}$$
(39)

where we have set \(h_1 (c_1 t) =H_1 (t),\) and \(g_1 (c_1 t) =G_1 (t).\) The initial conditions (34b) are clearly satisfied and at the right boundary \(x=L = l_1 +l_2,\) we get

$$\begin{aligned} v(L,t)= & {} \sum _{n=0}^{\left[ \tfrac{c_1 t }{2l_1}\right] } H_1 \left( t -\tfrac{2n l_1}{c_1}\right) - \sum _{n=0}^{\left[ \tfrac{c_1 t}{2l_1}\right] -1 } H_1 \left( t - \tfrac{2(n+1)l_1}{c_1}\right) \nonumber \\{} & {} \quad -\sum _{n=0}^{\left[ \tfrac{c_1 t -l_1}{2l_1}\right] } G_1 \left( t -\tfrac{ (2n+1)l_1}{c_1}\right) + \sum _{n=0}^{\left[ \tfrac{c_1 t - l_1}{2l_1}\right] } G_1 \left( t - \tfrac{(2n+1) l_1}{c_1}\right) \nonumber \\= & {} H_1 (t), \end{aligned}$$
(40)

and

$$\begin{aligned} v_x(L,t)= & {} \frac{1}{c_1}\sum _{n=0}^{\left[ \tfrac{c_1 t }{2l_1}\right] } H'_1 \left( t -\tfrac{2n l_1}{c_1}\right) + \frac{1}{c_1}\sum _{n=0}^{\left[ \tfrac{c_1 t}{2l_1}\right] -1 } H'_1 \left( t - \tfrac{2(n+1)l_1}{c_1}\right) \nonumber \\{} & {} -\frac{1}{c_1}\sum _{n=0}^{\left[ \tfrac{c_1 t -l_1}{2l_1}\right] } G'_1 \left( t -\tfrac{ (2n+1)l_1}{c_1}\right) -\frac{1}{c_1} \sum _{n=0}^{\left[ \tfrac{c_1 t - l_1}{2l_1}\right] } G'_1 \left( t - \tfrac{(2n+1) l_1}{c_1}\right) \nonumber \\= & {} \frac{1}{c_1}H'_1 (t) + \frac{2}{c_1}\sum _{n=1}^{\left[ \tfrac{c_1 t }{2l_1}\right] } H'_1 \left( t -\tfrac{2n l_1}{c_1}\right) -\frac{2}{c_1} \sum _{n=0}^{\left[ \tfrac{c_1 t - l_1}{2l_1}\right] } G'_1 \left( t - \tfrac{(2n+1) l_1}{c_1}\right) \nonumber \\=: & {} Q_1 (t). \end{aligned}$$
(41)

At the left boundary \(x=l_2,\) we obtain

$$\begin{aligned} v(l_2,t)= & {} \sum _{n=0}^{\left[ \tfrac{c_1 t -l_1}{2l_1}\right] } H_1 \left( t -\tfrac{(2n+1) l_1}{c_1}\right) - \sum _{n=0}^{\left[ \tfrac{c_1 t -l_1}{2l_1}\right] } H_1 \left( t - \tfrac{(2n+1)l_1}{c_1}\right) \nonumber \\{} & {} \quad -\sum _{n=0}^{\left[ \tfrac{c_1 t}{2l_1}\right] -1 } G_1 \left( t -\tfrac{ 2(n+1)l_1}{c_1}\right) + \sum _{n=0}^{\left[ \tfrac{c_1 t }{2l_1}\right] } G_1 \left( t - \tfrac{2n l_1}{c_1}\right) \nonumber \\= & {} G_1 (t), \end{aligned}$$
(42)

and

$$\begin{aligned} v_x (l_2,t)= & {} \frac{1}{c_1}\sum _{n=0}^{\left[ \tfrac{c_1 t -l_1}{2l_1}\right] } H'_1 \left( t -\tfrac{(2n+1) l_1}{c_1}\right) +\frac{1}{c_1} \sum _{n=0}^{\left[ \tfrac{c_1 t -l_1}{2l_1}\right] } H'_1 \left( t - \tfrac{(2n+1)l_1}{c_1}\right) \nonumber \\{} & {} -\frac{1}{c_1}\sum _{n=0}^{\left[ \tfrac{c_1 t}{2l_1}\right] -1 } G'_1 \left( t -\tfrac{ 2(n+1)l_1}{c_1}\right) -\frac{1}{c_1} \sum _{n=0}^{\left[ \tfrac{c_1 t }{2l_1}\right] } G'_1 \left( t - \tfrac{2n l_1}{c_1}\right) \nonumber \\= & {} -\frac{1}{c_1} G'_1 (t)-\frac{2}{c_1}\sum _{n=1}^{\left[ \tfrac{c_1 t }{2l_1}\right] } G'_1 \left( t -\tfrac{2n l_1}{c_1}\right) + \frac{2}{c_1}\sum _{n=0}^{\left[ \tfrac{c_1 t -l_1}{2l_1}\right] } H'_1 \left( t -\tfrac{(2n+1) l_1}{c_1}\right) \nonumber \\=: & {} F_1 (t). \end{aligned}$$
(43)

The function \(F_1\) is similar to \(Q_1\) with the roles of \(H_1\) and \(G_1\) interchanged.

Finally, we substitute (9) and (10) (for \(G_0\) and \(F_0\)) and (40)–(43) in (37) to derive

$$\begin{aligned} G_0 (t)&= H_1 ( t), \quad t>0, \end{aligned}$$
(44a)
$$\begin{aligned} U'_0 (L+t) -G'_0 (t)&= Q_1 (t), \quad t>0, \end{aligned}$$
(44b)
$$\begin{aligned} G_1 (t)&= H_2 (t), \quad t>0, \end{aligned}$$
(44c)
$$\begin{aligned} F_1 (t)&= Q_2 (t), \quad t>0. \end{aligned}$$
(44d)

We consider the condition (36) and we write the above system of equations only for the two unknown functions \(G_0\) and \(G_1\)

$$\begin{aligned} G_0 (t)&= \frac{c_1}{c_1 +1} U_0 (L+t) -\frac{2}{c_1 +1} \sum _{n=1}^{\left[ \tfrac{c_1 t }{2l_1}\right] } G_0 \left( t -\tfrac{2n l_1}{c_1}\right) \nonumber \\&\quad + \frac{2}{c_1 +1} \sum _{n=0}^{\left[ \tfrac{c_1 t - l_1}{2l_1}\right] } G_1 \left( t - \tfrac{(2n+1) l_1}{c_1}\right) , \end{aligned}$$
(45a)
$$\begin{aligned} G_1 (t)&= \frac{2c_2}{c_2 +c_1} \sum _{n=0}^{\left[ \tfrac{c_1 t - l_1}{2l_1}\right] } G_0 \left( t - \tfrac{(2n+1) l_1}{c_1}\right) -\frac{2c_2}{c_2 +c_1} \sum _{n=1}^{\left[ \tfrac{c_1 t }{2l_1}\right] } G_1 \left( t -\tfrac{2n l_1}{c_1}\right) \nonumber \\&\quad -\frac{2c_1}{c_2 +c_1} \sum _{n=1}^{\left[ \tfrac{c_2 t }{2l_2}\right] } G_1 \left( t -\tfrac{2n l_2}{c_2}\right) . \end{aligned}$$
(45b)

The system of equations (45) is the analogue to (17) for the double-layered medium. However, the two unknown functions are not only coupled but also evaluated at different time intervals.

Remark 2

In order to derive a formula for the measurements, it is sufficient to obtain \(G_0\). This is doable using the methodology described in Remark 1 to solve (45), which yields the solution in the form

$$\begin{aligned} G_0(t)= \sum _{k_1=0}^{\left[ \tfrac{c_1 t }{2l_1}\right] }\sum _{k_2=0}^{\left[ \tfrac{c_2 t }{2l_2}\right] } A^{(2k_1,2k_2)} U_0 \left( L+t - k_1\tfrac{2l_1}{c_1}- k_2\tfrac{2l_2}{c_2}\right) , \end{aligned}$$
(46)

where \(A^{(2k_1,2k_2)}\) are real constants depending on \(c_1\) and \(c_2\).

In this work we omit the elaborate analysis that should be followed in order to determine all the coefficients \(A^{(2k_1,2k_2)}\) in the different physical setups. Instead, we present

$$\begin{aligned} A^{(0,0)}&= \frac{c_1}{1+c_1} \qquad A^{(2,0)} =\frac{2c_1(c_2 - c_1)}{(1+c_1)^2(c_1+c_2)} \\ A^{(2,2)}&=-\frac{8c_1^2 c_2 }{(1+c_1)^2(c_1+c_2)^2}, \end{aligned}$$

which correspond to the information obtained by the three principle reflections, at \(x = L, \, l_2,\) and 0,  respectively.

In fact, for the inverse problem, only the first two coefficients are needed, since these two constraints are enough for obtaining the two unknowns \(c_1\) and \(c_2\). The third coefficient serves as an assurance that the boundary at \(x=0\) is indeed totally reflecting the wave, namely that the Dirichlet condition vanishes at \(x=0\).

In what follows we present the treatment of the above problem for the case of a delta-like initial function as in Sect. 2.1.1 in order to simplify the upcoming calculations.

Let \(U_0\) be of the form (27) with \(x_0 = L+D.\) Following the above remark, we are interested in computing \(G_0\) at the time steps \(t = D, \, D+ \tfrac{2l_1}{c_1},\) corresponding to the reflections by the boundaries at the positions \(x = L,\) and \(l_2,\) respectively. Multiple reflections can also be computed but are not necessary for the inverse problem. We define \(G_j^{(k_1,k_2)}:= G_j(D + k_1\tfrac{l_1}{c_1}+ k_2\tfrac{l_2}{c_2}),\) for \(j=0,1\) and \(k_j \in \mathbb {Z}.\)

We evaluate (45a) at the time steps \(t=D\) and \(t=D+\tfrac{2l_1}{c_1},\) meaning for \((k_1, k_2) = (0,0)\) and \((k_1, k_2) = (2,0),\) respectively, and we subtract the two formulas. Then, we obtain

$$\begin{aligned} G_0^{(2,0)} - G_0^{(0,0)} = -\frac{c_1}{c_1+1} - \frac{2}{c_1+1} G_0^{(0,0)} +\frac{2}{c_1+1} G_1^{(1,0)}. \end{aligned}$$
(47)

Given that \(G_0\) and \(G_1\) refer to boundary functions, we recall from (33) and (34) that

$$\begin{aligned} \begin{aligned} G_0 (t)&= 0, \quad \text {for} \quad t<D, \\ G_1 (t)&= 0, \quad \text {for} \quad t<D+\tfrac{l_1}{c_1}, \end{aligned} \end{aligned}$$
(48)

meaning

$$\begin{aligned} \begin{aligned} G_0^{(k_1,k_2)}&= 0, \quad \text {for} \quad k_1<0 \text { and } k_2< 0 , \\ G_1^{(k_1,k_2)}&= 0, \quad \text {for} \quad k_1< 1 \text { and } k_2 < 0. \end{aligned} \end{aligned}$$
(49)

We set \(t=D\) in (45a)–(45b) and using (27) and (48) we get

$$\begin{aligned} G_0^{(0,0)} = \frac{c_1}{c_1 +1}, \quad \text {and} \quad G_1^{(0,0)} = 0. \end{aligned}$$
(50)

In addition, setting \(t=D+\tfrac{l_1}{c_1}\) in (45b), we see that only the first sum contributes a non-zero term and precisely

$$\begin{aligned} G_1^{(1,0)} = \frac{2 c_2}{c_2 +c_1} G_0^{(0,0)}. \end{aligned}$$
(51)

Then, employing (50) and (51) in (47), we obtain

$$\begin{aligned} G_0^{(2,0)} = \frac{2 c_1 (c_2 - c_1)}{(c_1 +1)^2 (c_2 +c_1)}. \end{aligned}$$
(52)

The above procedure can be continued in order to compute the terms describing multiple reflections. For example, starting from

$$\begin{aligned} G_0^{(4,0)} - G_0^{(2,0)} = - \frac{2}{c_1+1} G_0^{(2,0)} +\frac{2}{c_1+1} G_1^{(3,0)}, \end{aligned}$$
(53)

after some straightforward calculations we compute

$$\begin{aligned} G_0^{(4,0)} = -\frac{(c_1-1)(c_2-c_1)}{(c_1+1)(c_2+c_1)} G_0^{(2,0)}. \end{aligned}$$
(54)

In general, we get

$$\begin{aligned} G_0^{(2k+2,0)} = -\frac{(c_1-1)(c_2-c_1)}{(c_1+1)(c_2+c_1)} G_0^{(2k,0)}, \qquad k=1,2,\ldots , \end{aligned}$$
(55)

which, together with (52), yields

$$\begin{aligned} G_0^{(2k,0)} = 2c_1 \frac{(-1)^{k+1} (c_1-1)^{k-1}(c_2-c_1)^k}{(c_1 +1)^{k+1}(c_2 +c_1)^k}, \quad k=1,2,\ldots \end{aligned}$$
(56)

Remark 3

Recalling the discussion in Remark 2, we note that the major peak induced by the reflection at \(x=0\) is given by evaluating \(G_0\) at \( t=D+ \tfrac{2l_1}{c_1}+ \tfrac{2l_2}{c_2},\) namely

$$\begin{aligned} G_0^{(2,2)} = - \frac{8c_1^2 c_2}{(c_2 +c_1)^2 (c_1 + 1)^2}. \end{aligned}$$
(57)

The derivation of this formula is given in Appendix B.

The terms in (50) (first equation), (52) and (57) summarize the single reflections from the boundary interfaces for delta-like pulse of the form (27) and describe the major terms in the representation of the back-reflected wave.

We have derived all the ingredients needed for the following proposition considering the measurements at \(x=L+D\):

Proposition 3

Let \(m^{(n)}:= m\left( 2D + \sum _{j=1}^n\tfrac{2 \ell _j}{c_j}\right) .\) Then, the three major peaks are given by

$$\begin{aligned} m^{(n)} ={\left\{ \begin{array}{ll} \frac{1}{2}\frac{c_1-1}{c_1 + 1}, &{} \text {for } n=0,\\ G_0^{(2,0)}, &{} \text {for } n=1,\\ G_0^{(2,2)}, &{} \text {for } n=2. \end{array}\right. } \end{aligned}$$
(58)

where \(G_0^{(2,0)}\) and \(G_0^{(2,2)}\) are given by (52) and (57), respectively.

Proof

The proof is straightforward by employing (8) in (18), and evaluating the resulting expression at \(t=2D + \sum _{j=1}^n\tfrac{2 \ell _j}{c_j}, \ \ n=0,1,2\). \(\square \)

3 The inverse scattering problem

In this section we examine the numerical solution of the inverse problem, to recover the properties of the medium from the knowledge of the initial function and the measured data. We consider the setup as described in Sect. 2.1.1 for a delta-like \(U_0\) and back-reflected data either full (as defined in (32)) or phaseless, meaning \(m(t) = |u(L+D,t)|.\)

3.1 Single-layered medium

The data consists of peaks with varying heights at specific time steps. We ignore the one corresponding to the non-reflected initial wave (see for example the most left peak in Fig. 4). Let us denote by \(h_k,\) the height of the kth peak appearing at time \(t_k,\) for \(k=1,2,\ldots .\) We have more than enough information to reconstruct just two unknowns: the wave speed \(0<c_1<1\) and the length \(L>0.\)

The peaks appear at the following time steps

$$\begin{aligned} \begin{aligned} t_1&= 2D,\\ t_2&= 2D + \frac{2L}{c_1},\\&\vdots \\ t_k&= 2D + (k-1)\frac{2L}{c_1}, \quad k = 1,2,\ldots \end{aligned} \end{aligned}$$
(59)

Thus, the difference of the first two equations gives us the ratio

$$\begin{aligned} \frac{L}{c_1} = \frac{t_2 - t_1}{2}. \end{aligned}$$
(60)

The wave speed will be recovered from the equations of the heights and it will be substituted in the above equation, in order to recover also the length. In what follows, we consider both the cases of full and phaseless data.

3.1.1 Full-data

The solution of the inverse problem in this case is trivial. The information of the first peak, namely \(m^{(0)} = h_{1}\), is sufficient. Hence, we obtain the unique solution:

$$\begin{aligned} c_1 = \frac{1+2 h_1}{1-2 h_1}. \end{aligned}$$
(61)

3.1.2 Phaseless-data

In this case, we have to solve \(|m^{(0)}| = |h_1 |\) which admits two solutions, in general. Recalling that \(c_1 <1,\) then the peak corresponding to the reflected wave from the first boundary will have negative sign, namely \(h_1 <0\) (see the second peak in Fig. 4). Thus, in view of (32) the equation to be solved takes the form:

$$\begin{aligned} \frac{1}{2}\frac{c_1-1}{c_1+1}=-|h_1|, \end{aligned}$$

which yields the unique solution

$$\begin{aligned} c_1=\frac{1-2 |h_1|}{1+2 |h_1|}, \end{aligned}$$

which is identical to (61).

As we will see later, excluding one solution even for the double-layered medium is not possible and additional information is needed.

3.2 Double-layered medium

We are interested in reconstructing the wave speeds \(0<c_j<1\) and the lengths \(\ell _j >0,\) for \(j=1,2.\)

The main peaks appear at the following time steps

$$\begin{aligned} \begin{aligned} t_1&= 2D,\\ t_2&= 2D + \frac{2 \ell _1}{c_1},\\ t_3&= 2D + \frac{2 \ell _1}{c_1}+ \frac{2 \ell _2}{c_2}. \end{aligned} \end{aligned}$$
(62)

As in the single-layered case, the combination of the above equations gives

$$\begin{aligned} \frac{\ell _j}{c_j} = \frac{t_{j+1} - t_j}{2}, \quad j=1,2. \end{aligned}$$
(63)

3.2.1 Full-data

Equating the amplitudes, we obtain

$$\begin{aligned} \frac{c_1 -1}{2(c_1 +1)}&= h_1, \end{aligned}$$
(64a)
$$\begin{aligned} \frac{2 c_1 (c_2 - c_1)}{(c_1 +1)^2 (c_2 +c_1)}&= h_2, \end{aligned}$$
(64b)

which admits the unique solution

$$\begin{aligned} c_1&= \frac{1+2 h_1}{1-2 h_1}, \end{aligned}$$
(65a)
$$\begin{aligned} c_2&= \frac{(1+2 h_1) \left( 4 h_1^2-2 h_2-1\right) }{(1-2 h_1) \left( 4 h_1^2+2 h_2-1\right) }. \end{aligned}$$
(65b)

3.2.2 Phaseless-data

We observe that \(h_1 <0\) but the sign of \(h_2\) is determined by the term \(c_2 -c_1\) which is unknown. Hence, \(c_1\) is uniquely recovered by (65a), and \(c_2\) is satisfying

$$\begin{aligned} \frac{2 c_1 ( c_2 - c_1) }{(c_1 +1)^2 (c_2 +c_1)} = \pm |h_2|, \end{aligned}$$
(66)

which admits two solutions, depending on the sign of \(h_2,\) namely

$$\begin{aligned} c_2= \frac{(1+2 h_1) \left( 4 h_1^2\mp 2 |h_2|-1\right) }{(1-2 h_1) \left( 4 h_1^2\pm 2 |h_2|-1\right) }. \end{aligned}$$
(67)

Remark 4

One idea to eliminate one of the above two solutions is to check them against the third measurement, \(m^{(2)}\), namely to substitute (65a) and (67) in

$$\begin{aligned} - \frac{8c_1^2 c_2}{(c_2 +c_1)^2 (c_1 + 1)^2} = h_3, \end{aligned}$$
(68)

producing an additional constraint in order to determine the sign of \(h_2\). However, this procedure results in

$$\begin{aligned} h_3 = \frac{2 h_2^2}{1-4 h_1^2} -\frac{1-4 h_1^2}{2}, \end{aligned}$$
(69)

which yields no extra information, since the RHS of (69) is independent of the sign of \(h_2\).

The extra information comes from the nature of the scattering problem. Recall that

$$\begin{aligned} \sum _{j=1}^2 \ell _j = L, \end{aligned}$$
(70)

where the right-hand side can be found from the first equation of (62), since both source and detector positions (same here) are known, meaning that the sum \(L+D = L + t_1/2\) is given. The last equation, considering (63), leads to the equation

$$\begin{aligned} \sum _{j=1}^2 (t_{j+1} - t_j) c_j = 2L. \end{aligned}$$
(71)

Thus, the correct \(c_2\) is the one that solves (66) and satisfies (71). Of course, in the double-layer case, one can solve directly (71) since \(c_1\) is already reconstructed. However, this is not true for more layers as we are going to see later.

3.3 Multi-layered medium

As in the previous cases, we aim to reconstruct the wave speeds \(0<c_j<1\) and the lengths \(\ell _j >0,\) for \(j=1,\ldots ,N\) of a N-layered medium. The data consists of \(N+1\) peaks with amplitudes \(h_j\) at points \(t_j,\) for \(j=1,\ldots ,N+1.\)

The equations (63), (70) and (71) still hold by simply replacing the index 2 with N.

The system of equations to be solved for the wave speeds admit the general form

$$\begin{aligned} \begin{aligned} \rho _1 ( c_1) :=\frac{c_1 -1}{2(c_1 +1)}&= h_1, \\ \rho _2 (c_1, c_2) := \frac{2 c_1 (c_2 - c_1)}{(c_1 +1)^2 (c_2 +c_1)}&= h_2, \\ \rho _3 (c_1,c_2,c_3)&= h_3, \\&\vdots \\ \rho _N (c_1,\ldots ,c_N)&= h_N, \end{aligned} \end{aligned}$$

The form of the functions \(\rho _j,\) for \(j=3,\ldots ,N\) can be found by considering the corresponding direct problem for a N-layered medium. We omit the explicit formulas above for the sake of presentation. As discussed in the previous section, the last measurement yields the equation \(\rho _{N+1} (c_1,\ldots ,c_N) = h_{N+1}\) which does not provide any additional information, thus it is neglected in the formation of the above system of equations.

3.3.1 Full-data

Following the same procedure as in the double-layered medium, we solve the first equation of the above system, obtaining a unique value for \(c_1\). Then, we substitute \(c_1\) in the second equation and solve for \(c_2,\) obtaining a unique solution. This simple procedure yields the unique values of the wave speeds \(\big \{c_j\big \}_{j=1}^N\).

3.3.2 Phaseless-data

In this case, we know that \(h_1<0\) and \(h_{N+1}<0.\) Thus, we have to solve

$$\begin{aligned} \begin{aligned} \rho _1 (c_1)&= h_1,\\ |\rho _2 (c_1, c_2)|&= |h_2|, \\ |\rho _3 (c_1,c_2,c_3)|&= | h_3|, \\&\vdots \\ |\rho _N (c_1,\ldots ,c_N)|&= | h_N |. \end{aligned} \end{aligned}$$
(72)

We propose the following iterative scheme:

  • Step \(\varvec{1}\): Solve \(\rho _1 (c_1) = h_1,\) for \(c_1.\)

  • Step \(\varvec{2}\): Substitute \(c_1\) in \(|\rho _2 (c_1, c_2)| = |h_2|,\) and solve it for \(c_2,\) obtaining two solutions \(c_{2,1}\) and \(c_{2,2}.\)

  • Step \(\varvec{3}\): For the values \(c_{2,j_2}\in (0,1), \ \ j_2=1,2,\) solve the equations

    $$\begin{aligned} |\rho _3 (c_1,c_{2,j_2},c_3)| = | h_3|, \end{aligned}$$

    to obtain \(c_3,\) namely maximum four solutions \(c_{3,j_3},\) for \(j_3=1,2,3,4.\)

  • \(\quad \vdots \)

  • Step \(\varvec{N}\): Substitute the values \(c_{N-1,j_{N-1}}\in (0,1),\ \ j_{N-1}=1,2,\ldots , 2^{N-2}\), in the last equation of (72) and solve the (at most) \(2^{N-2}\) equations

    $$\begin{aligned} |\rho _N(c_1,c_{2,j_2},c_{3,j_3},\ldots , c_N)| = | h_N|, \end{aligned}$$

    for \(c_N,\) to obtain maximum \(2^{N-1}\) possible solutions.

  • Step \(\varvec{N+1}\): The set of possible solutions consists of the sequences \(\big \{ c_1, c_{2,j_2},\ldots , c_{N,j_N}\big \},\) with \(j_n=1,2,\ldots ,2^{n-1}\). The solution of the inverse problem is the sequence that satisfies (71); see Fig. 1 for an illustration.

4 Numerical examples

In the first part, we implement the presented formulas of the solution of the direct problems for single- and double-layered media. Then, we solve the inverse problem to reconstruct the material parameters of a 4-layered medium using the iterative scheme presented in Sect. 3.3.

4.1 The direct scattering problem

We consider the formulas of Sect. 2 for different coefficients and initial functions \(U_0.\) In addition, the numerical solutions are compared with the ones obtained from the classical finite difference scheme for piecewise constant wave speed.

Fig. 1
figure 1

The iterative scheme for a 3-layered medium with length L. If all solutions are in the (0, 1)-interval, we obtain 4 sequences of possible wave speeds. In Step 4, the output of the algorithm is the sequence whose elements satisfy \(\sum _{j=1}^3 (t_{j+1}-t_j) c_j = 2L\)

Fig. 2
figure 2

The function W given by (73) for the first example (left) and its projection in the \(x-t\) plane (right). The plane (in red) identifies the boundary at \(x=3\)

4.1.1 Single-layered medium

The solution W(xt) of the direct problem is given in the following analytical form which provides an extension of the d’Alembert formula for the single-layered medium:

$$\begin{aligned} W(x,t) = {\left\{ \begin{array}{ll} v(x,t), &{} 0<x \le L, \, t>0, \\ u(x,t), &{} x> L, \, t>0, \end{array}\right. } \end{aligned}$$
(73)

where v(xt) is given by (13) (replace H by G) for \(0<x \le L\) and u(xt) is given by (8) for \(x>L.\) The function G is given by (19).

In the first example, we set \(L=3,\) and \(c_1 = 1/2.\) We consider an initial function of the form

$$\begin{aligned} U_0 (x) = e^{-10(x-x_0)^2}, \end{aligned}$$
(74)

for \(x_0=6,\) and we plot the function W for \(x\in [0,10]\) and \(t \in [0,30],\) in Fig. 2.

In the second example, we set \(L=2,\) and \(c_1 = 3/8.\) We consider the continuous but non-differentiable initial condition

$$\begin{aligned} U_0 (x) = {\left\{ \begin{array}{ll} 0, &{} x\le 3\pi /2, \\ \tfrac{\cos (x)}{x-3}, &{} x> 3\pi /2. \end{array}\right. } \end{aligned}$$

The function W,  for \(x\in [0,10]\) and \(t \in [0,40],\) is plotted in Fig. 3.

Fig. 3
figure 3

The function W given by (73) for the second example (left) and its projection in the \(x-t\) plane (right). The plane (in red) identifies the boundary at \(x=2\)

In Fig. 4, we present the cross-section of u at \(x=L+D,\) meaning the data function m(t),  for the first example (left) and the second example (right). The position \(x=L+D=8,\) is identified with a black dotted line in Figs. 2 and 3. In addition, we plot the numerical solution of the initial boundary value problem using the finite difference method (FDM) for piecewise constant wave speed. The two solutions are matched perfectly. In the second example, the lack of differentiability of the initial condition prevent us from using the typical FDM. This is another advantage of the proposed scheme since no special discretization is needed.

It is helpful for the corresponding inverse problem (to be addressed later) to discuss the form of the measured data. In the left picture of Fig. 4, the first peak located at \(t=2\) refers to the right-going wave (\(x\rightarrow \infty \)) originated from \(x=6\) and measured at \(x=8,\) at the exterior region with \(c_0 =1.\) The second and the third peak are the ones of interest, showing the back-reflected waves from the first (at \(x=3\)) and the second boundary (at \(x=0\)) of the medium, respectively.

Fig. 4
figure 4

The cross-section of u at \(x=8,\) corresponding to the data m (solid blue line), compared with its numerical solution using FDM (red dotted line) of the first example (left) and of the second example (right)

4.1.2 Double-layered medium

In the third example, we consider a double-layered medium with \(\ell _1 = 1\) and \(\ell _2 = 2,\) resulting in \(L=3.\) The initial function is given by (74) for \(x_0 = 5.\) We present u(5, t) for \(t\in [0,30]\) for two different sets of wave speeds in Fig. 5. We choose once \((c_1,\,c_2) = (1/2,\,1/5)\) and then \((c_1,\,c_2) = (1/5,\,1/2).\) In the first case, the condition (B9) is satisfied. We mark with a red arrow the peaks corresponding to multiple reflected waves (minor peaks). In the first case, all major peaks appear before the minor ones whereas in the second case we observe minor peaks before the last reflection from the boundary at \(x=0.\)

Fig. 5
figure 5

The function u(5, t),  for \(t\in [0,30]\) of the third example. In the left picture the assumption (B9) holds but in the right picture does not hold. The red arrows point at the (minor) peaks appearing after (left) or in between (right) the major peaks

4.2 The inverse scattering problem

In the fourth example, we consider a 4-layered medium with total length \(L=7\) and its parameters are described in Table 1. The initial wave is of the form (27) with \(x_0=9,\) which is also the detector position. The measured data, meaning the positions and heights of the major peaks (referring to single reflections), are presented in Table 2.

Table 1 Material parameters
Table 2 Phaseless-data
Table 3 The output of the iterative scheme for the 4-layered medium. All sequences solve (72) but only the fourth one (highlighted) satisfies in addition (71), since \(2L=14\)

We focus at the solution of the inverse problem from phaseless-data and we present the output of the proposed iterative scheme. The system of equations takes the form:

$$\begin{aligned} \frac{c_1 -1}{2(c_1 +1)}&= h_1, \\ \frac{2 c_1 (c_2 - c_1)}{(c_1 +1)^2 (c_2 +c_1)}&= \pm h_2, \\ \frac{8c_1^2 c_2 (c_3 - c_2)}{(c_2 +c_1)^2 (c_1 + 1)^2 (c_3 + c_2)}&= \pm h_3, \\ \frac{32c_1^2 c_2^2 c_3 (c_4 - c_3)}{(c_2 +c_1)^2 (c_1 + 1)^2 (c_3 + c_2)^2 (c_4 +c_3)}&= \pm h_4 \end{aligned}$$

In Table 3 we present the \(2^3\) sequences of possible solutions, one of them satisfies the condition (71) and is the output of the algorithm. Furthermore, as expected, all sequences satisfy the constraint induced by the reflection of the wave from the boundary at \(x=0\), which reads as \(\rho _5(c_1,c_2,c_3,c_4)=h_5\); thus it does not provide any extra information. Our reconstructions are exact and very well approximated by numerical reconstructions based on iterative algorithms, see for example [11, 12].

5 Conclusion

In this work we presented the solution of the direct and inverse scattering problem, associated with the 1-D wave equation for a multi-layered medium with constant refractive indices. To our knowledge this is the first time that the Fokas method is employed for solving this problem, producing a d’Alembert-type solution for the direct problem on the single-layered medium. One could wonder whether this methodology could be generalised to a medium with variable refractive index (in the current work is piecewise constant), as well as to the wave equation in more spatial dimensions. For the latter question we speculate a positive answer, taking into account other works on evolution equations which apply the Fokas method to more spatial variables [19, 36]. For the case of variable refractive index, the answer seems more complicated, but still doable taking into account the work of Deconinck et al. on the heat equation [30, 37].

In this work we provided some evidence that the knowledge of the total length of the medium L is enough to uniquely reconstruct the lengths and the refractive indices of the layers of medium; in previous numerical reconstructions, more a priori assumptions are needed [12]. Although a unique reconstruction is not guaranteed in general for every N-layered medium, we have no sign of failure of our strategy; a rigorous proof is still an open question. In addition, this is an exact reconstruction method and the case of real data (data with noise) needs special treatment. The set of equations has to be replaced by a constrained minimization problem and then error and convergence analysis is needed. Both topics are out of scope of this work but an important task for future research.