1 Introduction

An inverse eigenvalue problem concerns the reconstruction or identification of the parameters in the governing differential equation from the prescribed spectral data. It arises in various applications, such as control design, system identification, seismic tomography, principal component analysis, exploration and remote sensing, antenna array processing, geophysics, molecular spectroscopy, particle physics, structure analysis, circuit theory, mechanical system simulation, and so on [1].

The inverse eigenvalue problem for a weighted Helmholtz equation is a kind of the classical inverse Sturm-Liouville problem [2,3,4,5]. Given the first finite smallest eigenvalues, the density function in the weighted Helmholtz equation is recovered. McCarthy uses projection of the boundary value problem and its coefficients onto appropriate vector spaces, which leads to a matrix inverse problem [6, 7]. Andrew proposes a new algorithm for solving the inverse Sturm-Liouville problem of reconstructing a symmetric potential from eigenvalues [8]. Drignei deals with the recovery of the potential coefficient of a Sturm-Liouville operator from three known sequences of eigenvalues corresponding respectively to three sets of Dirichlet boundary conditions [9]. Jiang et al. investigate the inverse second-order Sturm-Liouville problem and the inverse fourth-order Sturm-Liouville problem, and derive trace formulas showing relations between the unknown coefficients and eigenvalues explicitly for both problems [10]. Gao et al. propose a new iterative method to recover the impedance of Sturm-Liouville problem from the finite eigenvalues [11]. Based on natural eigenfrequencies, Zhang et al. investigate the damage identification of elastic vibration structure, where level set method is introduced to represent two different material regions [12]. For the same objective functional, Zhang et al. propose the piecewise constant level set method to represent the shape and topology of the damaged region [13]. Lee and Shin introduce a frequency response function-based structural damage identification method for beam structures [14].

The finite element method is used to solve the eigenvalue problem. There are many excellent works on it, and we refer to [15, 16] and references cited therein. The refined estimates for Galerkin approximations of the eigenvalues and eigenvectors of selfadjoint eigenvalue problem is investigated in [17, 18]. The error estimates for the generalised Dirichlet eigenvalue problem with stochastic coefficients is presented in [19].

This paper is organized as follows. In Sect. 2, the mathematical formulations of the inverse eigenvalue problem of the weighted Helmholtz equation is described. In Sect. 3, the properties of existence, stability and Fr\(\acute{e}\)chet derivative of the continuous optimization problems are established. In Sect. 4, the properties of existence and the convergence of the discrete optimization problems are given. A conjugate gradient method is proposed in Sect. 5. 1D and 2D numerical results of inverse eigenvalue problem of the weighted Helmholtz equation are presented In Sect. 6.

2 Problem Statement

Consider the weighted Helmholtz equation

$$\begin{aligned} -\Delta u&= \lambda \rho u,\quad \textrm{in}\ \Omega , \end{aligned}$$
(1)
$$\begin{aligned} u&= 0, \quad \textrm{on}\ \partial \Omega , \end{aligned}$$
(2)

where \({\Omega \subset {\mathbb {R}}^d} \ (d=1,2)\) is a bounded and connected domain and \(\partial \Omega \) is the boundary of the domain. \(\rho (x)\) is the density function and is assumed to satisfy the condition

$$\begin{aligned} {0 <} \rho _0\le \rho (x)\le \rho _1\quad \text {in}\ \Omega , \end{aligned}$$
(3)

where \( \rho _0\) and \( \rho _1\) are two constants. \((\lambda ,u)\) is the eigenpair of the minus Laplace operator \(-\Delta \) with density function \(\rho (x)\). The weak formulation of (1) and (2) is given by

$$\begin{aligned} \int _\Omega \nabla u \cdot \nabla v dx =\lambda \int _\Omega \rho uv dx, \quad \forall v\in H_0^1(\Omega ). \end{aligned}$$
(4)

By rearranging, (4) admits a countable sequence of real eigenvalues [see 18]

$$\begin{aligned} 0<\lambda _1(\rho )\le \lambda _2(\rho ) \le \lambda _3(\rho )\le \cdots \end{aligned}$$
(5)

and the corresponding eigenfunctions

$$\begin{aligned} u_1(\rho ),\ u_2(\rho ),\ u_3(\rho ) \ldots . \end{aligned}$$
(6)

The i-th eigenpair \((\lambda _i(\rho ),u_i(\rho ))\) is obtained by the min-max principle [18]

$$\begin{aligned} \lambda _i (\rho )&=\min _{V_i\subset H_0^1(\Omega ),\ \dim (V_i)=i}\max _{u\in V_i}\frac{\int _\Omega \vert \nabla u \vert ^2 dx }{\int _\Omega \rho u^2 dx}\nonumber \\&=\max _{u\in span\{u_1, u_2,\ldots ,u_i\} }\frac{\int _\Omega \vert \nabla u \vert ^2 dx }{\int _\Omega \rho u^2 dx}\nonumber \\&=\frac{\int _\Omega \vert \nabla u_i(\rho ) \vert ^2 dx }{\int _\Omega \rho u_i^2(\rho ) dx}, \end{aligned}$$
(7)

where \(H_0^1(\Omega )\) is the subspace of \(H^1(\Omega )\) consisting of functions which vanish at the boundary of \(\Omega \) in the sense of trace. Notice that the eigenfunction \(u_i(\rho )\) in (7) is not unique, since for a nonzero constant C, \(C u_i(\rho )\) is also the eigenfunction corresponding to \(\lambda _i(\rho )\). When \(\lambda _i(\rho )\) is multiple, \(u_i(\rho )\) is assigned one of the eigenfunctions corresponding to \(\lambda _i(\rho )\). For any \(\lambda _i(\rho )\) we let

$$\begin{aligned} M(\lambda _i(\rho )) = \{u:\ u \text { is an eigenfunction of} (4)\text { corresponding to } \lambda _i(\rho )\}. \end{aligned}$$
(8)

The eigenfunction \(u_i(\rho )\) in (7) is deemed to be one of the eigenfunctions corresponding to \( \lambda _i(\rho )\), that is, \(u_i(\rho )\in M(\lambda _i(\rho )) \). The eigenfunctions in (6) are normalized and orthogonalized to satisfy

$$\begin{aligned} \int _\Omega \nabla u_i(\rho )\cdot \nabla u_j(\rho )dx= \lambda _i (\rho )\int _\Omega \rho u_i(\rho ) u_j(\rho )dx =\delta _{ij},\ i,j=1,\ 2,\ \ldots . \end{aligned}$$
(9)

It is known that an inverse eigenvalue problem, especially for the real-valued case, may not necessarily have an exact solution [1]. It is also known that the spectral information, in practice, is often obtained by experimental devices and thus inevitably contaminated with measurement errors. That is, there are situations where an approximate solution best in the sense of least squares would be satisfactory. In order to deal with the instability of the inverse problem, a \(L^2\) regularity term is added. The inverse eigenvalue problem is reformulated as the following constrained optimization problem:

$$\begin{aligned} \min _{\rho \in {\mathcal {A}}} F(\rho )=\frac{1}{2} \sum _{i=1}^{N}(\lambda _i(\rho )-{\widehat{\lambda }}_i)^2+\frac{\varepsilon }{2}\int _\Omega \rho ^2 dx \end{aligned}$$
(10)

where \({\widehat{\lambda }}_i,\ (i=1,2,\ldots , N)\) are the measured data of the first N eigenvalues, \(\varepsilon \) is the regularity parameter and \({\mathcal {A}}\) is the admissible set of the density function, that is,

$$\begin{aligned} {\mathcal {A}}=\{ \rho (x) \in L^{\infty }(\Omega ):\ \rho _0\le \rho (x)\le \rho _1 \ \mathrm{a.e.} x\in \Omega \}. \end{aligned}$$
(11)

3 Existence and Stability of the Optimization Problem

In this section, we present the properties of existence, stability and Fr\(\acute{e}\)chet derivative of the continuous optimization problem (10) and (4).

Lemma 3.1

For any \(\rho \in {\mathcal {A}}\), we have

$$\begin{aligned} \lambda _i(\rho _1)\le \lambda _i(\rho )\le \lambda _i(\rho _0),\ i=1,2,\ldots , N. \end{aligned}$$
(12)

Proof

For \(i=1,2,\ldots , N \), by (7), we set \(u_i^0, \ u_i^1 \in V_i \subset H_0^1(\Omega ) \text { and} \ dim (V_i)=i\) such that

$$\begin{aligned} \lambda _i (\rho _0)=\min _{V_i\subset H_0^1(\Omega ),\ dim (V_i)=i\ }\max _{u\in V_i}\frac{\int _\Omega \vert \nabla u \vert ^2 dx }{\int _\Omega \rho _0 u^2 dx}=\frac{\int _\Omega \vert \nabla u_i^0 \vert ^2 dx }{\int _\Omega \rho _0 {u_i^0}^2 dx}, \end{aligned}$$
(13)

and

$$\begin{aligned} \lambda _i (\rho _1)=\min _{V_i\subset H_0^1(\Omega ),\ dim (V_i)=i}\max _{u\in V_i}\frac{\int _\Omega \vert \nabla u \vert ^2 dx }{\int _\Omega \rho _1 u^2 dx}=\frac{\int _\Omega \vert \nabla u_i^1 \vert ^2 dx }{\int _\Omega \rho _1 {u_i^1}^2 dx}. \end{aligned}$$
(14)

Consequently, by (3), (7), (13) and (14), we have

$$\begin{aligned} \lambda _i (\rho _1)&=\frac{\int _\Omega \vert \nabla u_i^1 \vert ^2 dx }{\int _\Omega \rho _1 {u_i^1}^2 dx}\le \frac{\int _\Omega \vert \nabla u_i \vert ^2 dx }{\int _\Omega \rho _1 u_i^2 dx} \le \lambda _i (\rho )=\frac{\int _\Omega \vert \nabla u_i \vert ^2 dx }{\int _\Omega \rho {u_i}^2 dx}\nonumber \\&\le \frac{\int _\Omega \vert \nabla u_i^0 \vert ^2 dx }{\int _\Omega \rho {u_i^0}^2 dx}\le \frac{\int _\Omega \vert \nabla u_i^0 \vert ^2 dx }{\int _\Omega \rho _0 {u_i^0}^2 dx}=\lambda _i (\rho _0). \end{aligned}$$
(15)

\(\square \)

Lemma 3.2

For \( i=1,2,\ldots , N\), assume that \((\lambda _i(\rho ),u_i(\rho ))\) is the i-th eigenpair of (4), and (\({\tilde{\lambda }}_i,{\tilde{u}}_i)\) is the eigenpair of (4) replacing \(\rho \) by \({\tilde{\rho }}\), then

$$\begin{aligned}&\int _{\Omega }\vert \nabla (u_{i}(\rho )-{\tilde{u}}_{i})\vert ^{2}\,dx-{\tilde{\lambda }}_{i}\int _{\Omega }{\tilde{\rho }}(u_{i}(\rho )-{\tilde{u}}_{i})^{2}dx \nonumber \\&\quad =(\lambda _{i}(\rho )-{\tilde{\lambda }}_{i})\int _{\Omega }\rho u^{2}_{i}(\rho )dx+{\tilde{\lambda }}_{i}\int _{\Omega }(\rho -{\tilde{\rho }})u_{i}^{2}({\rho })dx. \end{aligned}$$
(16)

Proof

For \( i=1,2,\ldots , N\), since \((\lambda _i(\rho ),u_i(\rho ))\) satisfies (4) and (\({\tilde{\lambda }}_i,{\tilde{u}}_i)\) satisfies (4) by replacing \(\rho \) by \({\tilde{\rho }}\), we obtain

$$\begin{aligned}&\int _{\Omega }\vert \nabla (u_{i}(\rho )-{\tilde{u}}_{i})\vert ^{2}\,dx-{\tilde{\lambda }}_{i}\int _{\Omega }{\tilde{\rho }}(u_{i}(\rho )-{\tilde{u}}_{i})^{2}dx \\&\quad =\int _{\Omega }\vert \nabla u_{i}(\rho )\vert ^{2}dx-2\int _{\Omega }\nabla u_{i}(\rho )\cdot \nabla {\tilde{u}}_{i}dx+\int _{\Omega }\vert \nabla {\tilde{u}}_{i}\vert ^{2}dx-{\tilde{\lambda }}_{i}\int _{\Omega }{\tilde{\rho }}u^{2}_{i}(\rho ) dx \\&\qquad +2{\tilde{\lambda }}_{i}\int _{\Omega }{\tilde{\rho }}u_{i}(\rho ){\tilde{u}}_{i}dx- {\tilde{\lambda }}_{i}\int _{\Omega }{\tilde{\rho }} {\tilde{u}}^{2}_{i}dx\\&\quad =\lambda _{i}(\rho )\int _{\Omega }\rho u_{i}^{2}(\rho )dx-{\tilde{\lambda }}_{i}\int _{\Omega }{\tilde{\rho }} u^{2}_{i}(\rho ) dx \\&\quad =(\lambda _{i}(\rho )-{\tilde{\lambda }}_{i})\int _{\Omega }\rho u^{2}_{i}(\rho )dx+{\tilde{\lambda }}_{i}\int _{\Omega }(\rho -{\tilde{\rho }})u^{2}_{i}(\rho )dx. \end{aligned}$$

\(\square \)

Replacing \(\rho \in {\mathcal {A}}\) in (4)–(9) by \(\rho ^n\), \(\rho ^*\in {\mathcal {A}}\), the eigenpairs \((u _{i}(\rho ^{n}), \lambda _{i}(\rho ^{n}))\) and \((u_{i}(\rho ^{*}), \lambda _{i}(\rho ^{*})),\ i=1,\ 2,\ \ldots ,\) are obtained, respectively.

Lemma 3.3

For \( i=1,2,\ldots ,N,\) let \(\rho ^{n},\ \rho ^{*} \in {\mathcal {A}}\) and \(\rho ^{n} {\mathop {\rightharpoonup }\limits ^{*}} \rho ^{*}\ \text {in} \ L^{\infty }(\Omega )\) as \(n\rightarrow \infty \), then \(\lambda _{i}(\rho ^n)\rightarrow \lambda _{i}(\rho ^*)\). Moreover, there exists a subsequence \(u_{i}(\rho ^n)\in M(\lambda _i(\rho ^n))\), and some \(u_{i}(\rho ^*)\in M(\lambda _i(\rho ^*))\), satisfying \(u_{i}(\rho ^n)\rightarrow u_{i}(\rho ^*)\ in \ H^{1}(\Omega ).\)

Proof

For \( i=1,2,\ldots ,N,\) by Lemma 3.1, the boundedness of \(\lambda _i(\rho ^n)\) implies that there exists a subsequence, also denoted by \(\lambda _i(\rho ^n)\), such that

$$\begin{aligned} \lim _{n\rightarrow \infty }\lambda _i(\rho ^n)= \lambda _i^*. \end{aligned}$$
(17)

Notice that by (9) (replacing \(\rho \) by \(\rho ^n\)) the eigenfunction \(u_i(\rho ^n)\in M(\lambda _i(\rho ^n))\) satisfies

$$\begin{aligned} \int _\Omega \vert \nabla u_i(\rho ^n)\vert ^2 dx=1. \end{aligned}$$
(18)

By Poincar\(\acute{e }\) inequality, we have

$$\begin{aligned} \Vert u_i(\rho ^n)\Vert _{H^1(\Omega )}<C, \end{aligned}$$
(19)

where C is a constant independent of \(\rho ^n\). Thus, there exists a subsequence, also denoted by \(u_i(\rho ^n)\), such that

$$\begin{aligned} u_i(\rho ^n)\rightharpoonup u_i^* \ \textrm{in}\ H^1(\Omega )\ \textrm{and}\ u_i(\rho ^n)\rightarrow u_i^* \ \textrm{in}\ L^2(\Omega ). \end{aligned}$$
(20)

We need to prove that \((\lambda _i^*,u_i^*)\) is the eigenpair of (4) corresponding to \(\rho ^*\) for \( i=1,2,\ldots ,N.\) Notice that the eigenpair \((\lambda _i(\rho ^n), \ u_i(\rho ^n))\) corresponding to \(\rho ^n\) satisfies (4) (replacing \(\rho \) by \(\rho ^n\)), that is,

$$\begin{aligned} \int _\Omega \nabla u_i(\rho ^n) \cdot \nabla v dx= \lambda _i(\rho ^n) \int _\Omega \rho ^n u_i(\rho ^n) v dx,\ \forall \ v\in H_0^1(\Omega ),\ i=1,2,\ldots ,N. \end{aligned}$$
(21)

The RHS item of equation of (21) could be rewritten by

$$\begin{aligned} \lambda _i(\rho ^n) \int _\Omega \rho ^n u_i(\rho ^n) v dx=&(\lambda _i(\rho ^n)-\lambda _i^*) \int _\Omega \rho ^n u_i(\rho ^n) v dx+\lambda _i^* \int _\Omega \rho ^n (u_i(\rho ^n)-u_i^*)v dx\nonumber \\&+\lambda _i^* \int _\Omega (\rho ^n-\rho ^*) u_i^*v dx+\lambda _i^* \int _\Omega \rho ^* u_i^*v dx. \end{aligned}$$
(22)

By (11), (17), (19), (20) and \(\rho ^{n} {\mathop {\rightharpoonup }\limits ^{*}} \rho ^{*}\) in \(L^{\infty }(\Omega )\), we have

$$\begin{aligned} \lim _{n\rightarrow \infty } \lambda _i(\rho ^n) \int _\Omega \rho ^n u_i(\rho ^n)v dx=\lambda _i^* \int _\Omega \rho ^* u_i^*v dx. \end{aligned}$$
(23)

By (20), we have

$$\begin{aligned} \lim _{n\rightarrow \infty } \int _\Omega \nabla u_i(\rho ^n)\cdot \nabla v dx=\int _\Omega \nabla u_i^* \cdot \nabla v dx \end{aligned}$$
(24)

Combining (23) and (24), and taking the limitation of equation (21), we have

$$\begin{aligned} \int _\Omega \nabla u_i^* \cdot \nabla v dx=\lambda _i^* \int _\Omega \rho ^* u_i^*v dx, \ \forall \ v\in H_0^1(\Omega ),\ i=1,2,\ldots , N. \end{aligned}$$
(25)

Therefore, it concludes that \((\lambda _i^*,u_i^*)\ ( i=1,2,\ldots ,N)\) are eigenpairs of (4) corresponding to \(\rho ^*\).

Furthermore, replacing \(\rho ,\ u_{i}(\rho ), \ \lambda _{i}(\rho )\) by \(\rho ^n,\ u_{i}(\rho ^n), \ \lambda _{i}(\rho ^n)\), and replacing \({\tilde{\rho }},\ {\tilde{u}}_{i}, \ {\tilde{\lambda }}_{i}\) by \(\rho ^*,\ u_{i}^*, \ \lambda _{i}^*\) in Lemma 3.2, respectively, we have

$$\begin{aligned}&\int _{\Omega }\vert \nabla (u_{i}(\rho ^n)- u^*_{i})\vert ^{2}dx\nonumber \\&\quad =\lambda _{i}^{*}\int _{\Omega }\rho ^{*}(u_{i}(\rho ^n)-u_{i}^{*})^{2}dx+(\lambda _{i}(\rho ^n)-\lambda _{i}^{*})\int _{\Omega }\rho ^{n} u^{2}_{i}(\rho ^n)dx\nonumber \\&\qquad +\lambda _{i}^{*}\int _{\Omega }(\rho ^{n}-\rho ^{*}) u^{2}_{i}(\rho ^n)dx\nonumber \\&\quad \rightarrow 0\quad \text {as } n\rightarrow \infty , \end{aligned}$$
(26)

with (11), (20), (17), (19) and \(\rho ^{n}{\mathop {\rightharpoonup }\limits ^{*}} \rho ^{*} \ \text {in} \ L^{\infty }(\Omega )\). Combining (20) and (26), we have

$$\begin{aligned} u_i(\rho ^n)\rightarrow u_i^* \ \textrm{in}\ H^1(\Omega ). \end{aligned}$$
(27)

By the orthogonality (9) (replacing \(\rho \) by \(\rho ^n\)), (27), (17) and \(\rho ^{n}{\mathop {\rightharpoonup }\limits ^{*}} \rho ^{*} \ \text {in} \ L^{\infty }(\Omega )\), the orthogonality of \(u_i^*\) is obtained by

$$\begin{aligned} \int _\Omega \nabla u_i^*\cdot \nabla u_j^*dx= \lambda _i^* \int _\Omega \rho ^* u_i^* u_j^* dx =\delta _{ij},\ i,j=1,\ 2,\ \ldots \ N. \end{aligned}$$
(28)

Finally, we prove \((\lambda ^*_{i},u^*_{i})\ ( i=1,2,\ldots ,N)\) are the i-th eigenpairs for \(\rho ^{*}\) by induction. For \(i=1\), by (7) (replacing \(\rho \) by \(\rho ^*\)) we have

$$\begin{aligned} \lambda _{1}(\rho ^{*})&=\dfrac{\int _{\Omega } \vert \nabla u_{1}(\rho ^{*})\vert ^{2}\,dx}{\int _{\Omega }\rho ^{*}\vert u_{1}(\rho ^{*})\vert ^{2}\,dx}\nonumber \\&\le \dfrac{\int _{\Omega } \vert \nabla u_{1}^{*}\vert ^{2}\,dx}{\int _{\Omega }\rho ^{*}\vert u_{1}^{*}\vert ^{2}\,dx}=\lambda _{1}^{*} \end{aligned}$$
(29)

On the other hand, by (17), (7) ( replacing \(\rho \) by \(\rho ^n\)) and \(\rho ^{n}{\mathop {\rightharpoonup }\limits ^{*}} \rho ^{*} \ \text {in} \ L^{\infty }(\Omega )\), we have

$$\begin{aligned} \lambda _{1}^{*}&={\underset{n\rightarrow \infty }{\lim }} \lambda _{1}({\rho ^n})\nonumber \\&={\underset{n\rightarrow \infty }{\lim }}\dfrac{\int _{\Omega } \vert \nabla u_{1}(\rho ^{n})\vert ^{2}\,dx}{\int _{\Omega }\rho ^{n}u_{1}^{2}(\rho ^{n})\,dx}\nonumber \\&\le {\underset{n\rightarrow \infty }{\lim }}\dfrac{\int _{\Omega } \vert \nabla u_{1}(\rho ^{*})\vert ^{2}\,dx}{\int _{\Omega }\rho ^{n}u_{1}^{2}(\rho ^{*})\,dx}\nonumber \\&=\dfrac{\int _{\Omega } \vert \nabla u_{1}(\rho ^{*})\vert ^{2}\,dx}{\int _{\Omega }\rho ^{*}u_{1}^{2}(\rho ^{*})\,dx}=\lambda _{1}(\rho ^{*}). \end{aligned}$$
(30)

Combining (29) and (30), we obtain \(\lambda _{1}^{*}=\lambda _{1}(\rho ^{*})\). The eigenfunction \(u_{1}^{*} \) corresponding to \( \lambda _{1}^{*}\) is also the eigenfunction corresponding to \(\lambda _{1}(\rho ^{*})\). That is, \(u_{1}^{*} \in M (\lambda _{1}(\rho ^{*}))\). Thus, we set \(u_{1}(\rho ^{*})\in M (\lambda _{1}(\rho ^{*}))\) to satisfy \(u_{1}^{*}=u_{1}(\rho ^{*})\).

For \( i=1,2,\ldots , k\), assuming that

$$\begin{aligned} \lambda _{i}^{*}&=\lambda _{i}(\rho ^{*}),\end{aligned}$$
(31)
$$\begin{aligned} u_{i}^{*}&= u_{i}(\rho ^{*}) , \end{aligned}$$
(32)

we need to prove that \(\lambda _{k+1}^{*}=\lambda _{k+1}(\rho ^{*})\) and \(u_{k+1}^{*}=u_{k+1}(\rho ^{*})\). By (7) and (9) (replacing \(\rho \) by \(\rho ^*\)), (28) and (32), we have

$$\begin{aligned} \lambda _{k+1}(\rho ^{*})&=\dfrac{\int _{\Omega } \vert \nabla u_{k+1}(\rho ^{*})\vert ^{2}\,dx}{\int _{\Omega }\rho ^{*}u_{k+1}^{2}(\rho ^{*})\,dx}\nonumber \\&=\underset{V_{k+1}\subset H_{0}^{1}(\Omega ),\dim (V_{k+1})=k+1\ }{\min }\underset{u\in V_{k+1}}{\max }\dfrac{\int _{\Omega } \vert \nabla u\vert ^{2}\,dx}{\int _{\Omega }\rho ^{*}u^{2}\,dx}\nonumber \\&\le \underset{u\in span\left\{ u_{1}^{*},u_{2}^{*},...,u_{k}^{*},u_{k+1}^{*}\right\} }{\max }\dfrac{\int _{\Omega } \vert \nabla u\vert ^{2}\,dx}{\int _{\Omega }\rho ^{*}u^{2}\,dx}=\dfrac{\int _{\Omega } \vert \nabla u^*\vert ^{2}\,dx}{\int _{\Omega }\rho ^{*}{u^*}^{2}\,dx}. \end{aligned}$$
(33)

Let \(u^*=\alpha _{1}u_{1}^{*}+\alpha _{2}u_{2}^{*}+...+\alpha _{k}u_{k}^{*}+\alpha _{k+1}u_{k+1}^{*}.\) By the orthogonality (28), we have

$$\begin{aligned} \int _{\Omega } \vert \nabla u^*\vert ^{2}\,dx&=\sum \limits _{j=1}^{k+1} \int _{\Omega } \alpha _{j}^{2}\vert \nabla u_{j}^{*}\vert ^{2}\,dx=\sum \limits _{j=1}^{k+1} \alpha _{j}^{2}\lambda _{j}^{*}\int _{\Omega } \rho ^{*}{u_{j}^{*}}^{2}\,dx,\end{aligned}$$
(34)
$$\begin{aligned} \int _{\Omega } \rho ^{*}{u^*}^{2}\,dx&=\sum \limits _{j=1}^{k+1} \alpha _{j}^{2}\int _{\Omega } \rho ^{*}{u_{j}^{*}}^{2}\,dx. \end{aligned}$$
(35)

By (5) (replacing \(\rho \) by \(\rho ^*\)) and (31), we have

$$\begin{aligned} \lambda _{1}^{*}\le \lambda _{2}^{*}\le ...\le \lambda _{k}^{*}. \end{aligned}$$
(36)

Then, we use reduction to absurdity to prove \(\lambda _{k+1}^{*}\ge \lambda _{k}^{*}\). If the claim is negated to assume that

$$\begin{aligned} \lambda _{k+1}^{*}<\lambda _{k}^{*}, \end{aligned}$$
(37)

combining with (34), (35) and (36), we have

$$\begin{aligned} \int _{\Omega } \vert \nabla u^*\vert ^{2}\,dx&= \sum \limits _{j=1}^{k+1} \alpha _{j}^{2}\lambda _{j}^{*}\int _{\Omega } \rho ^{*}{u_{j}^*}^{2}\,dx\nonumber \\&<\lambda _{k}^{*}\sum \limits _{j=1}^{k+1} \alpha _{j}^{2}\int _{\Omega } \rho ^{*}{u_{j}^*}^{2}\,dx\nonumber \\&=\lambda _{k}^{*}\int _{\Omega } \rho ^{*}{u^*}^{2}\,dx. \end{aligned}$$
(38)

By (33) and (38), we can get \(\lambda _{k+1}(\rho ^{*})<\lambda _{k}^{*}=\lambda _{k}(\rho ^{*})\), which incurs the contradiction. Therefore, we conclude that

$$\begin{aligned} \lambda _{k+1}^{*}\ge \lambda _{k}^{*}. \end{aligned}$$
(39)

Combining with (34), (35), (36) and (39), we obtain

$$\begin{aligned} \int _{\Omega } \vert \nabla u^*\vert ^{2}\,dx&= \sum \limits _{j=1}^{k+1} \alpha _{j}^{2}\lambda _{j}^{*}\int _{\Omega } \rho ^{*}{u_{j}^*}^{2}\,dx\nonumber \\&\le \lambda _{k+1}^{*}\sum \limits _{j=1}^{k+1} \alpha _{j}^{2}\int _{\Omega } \rho ^{*}{u_{j}^*}^{2}\,dx=\lambda _{k+1}^{*}\int _{\Omega } \rho ^{*}{u^*}^{2}\,dx. \end{aligned}$$
(40)

Substituting (40) into (33), we obtain

$$\begin{aligned} \lambda _{k+1}(\rho ^{*})\le \lambda _{k+1}^{*}. \end{aligned}$$
(41)

On the other hand, we need to prove that \(\lambda _{k+1}(\rho ^{*})\ge \lambda _{k+1}^{*}.\) First, we can conclude that

$$\begin{aligned} \dim span\left\{ u_{1}(\rho ^{n}),u_{2}(\rho ^{n}),...,u_{k}(\rho ^{n}),u_{k+1}(\rho ^{*})\right\} =k+1. \end{aligned}$$
(42)

If the claim is negated to assume that

$$\begin{aligned} \dim span\left\{ u_{1}(\rho ^{n}),u_{2}(\rho ^{n}),...,u_{k}(\rho ^{n}),u_{k+1}(\rho ^{*})\right\} =k, \end{aligned}$$

since \(u_{1}(\rho ^{n}),u_{2}(\rho ^{n}),...,u_{k}(\rho ^{n})\) are orthogonal by (9) (replacing \(\rho \) by \(\rho ^n\)), then

$$\begin{aligned} u_{k+1}(\rho ^{*})=\gamma _1 u_{1}(\rho ^{n})+\gamma _2 u_{2}(\rho ^{n})+...+\gamma _k u_{k}(\rho ^{n}). \end{aligned}$$
(43)

Thus,

$$\begin{aligned} \int _\Omega \nabla u_{k+1}(\rho ^{*})\nabla u_{i}(\rho ^{*})dx=\sum _{j=1}^k \gamma _j \int _\Omega \nabla u_{j}(\rho ^{n}) \nabla u_{i}(\rho ^{*})dx, \ i=1,2,\ldots ,k. \end{aligned}$$
(44)

Taking the limitation of (44) as \(n\rightarrow \infty \), with (27), (32) and (9) (replacing \(\rho \) by \(\rho ^*\)), we obtain

$$\begin{aligned} 0&=\int _\Omega \nabla u_{k+1}(\rho ^{*})\nabla u_{i}(\rho ^{*})dx\nonumber \\&=\sum _{j=1}^k \gamma _j \int _\Omega \nabla u_{j}(\rho ^{*}) \nabla u_{i}(\rho ^{*})dx\nonumber \\&=\gamma _i, \ i=1,2,\ldots ,k. \end{aligned}$$
(45)

Therefore, \(u_{k+1}(\rho ^{*})\equiv 0\), which contradicts the definition of a nontrivial eigenfunction.

By (7) (replacing \(\rho \) by \(\rho ^n\)) and (42), we have

$$\begin{aligned} \lambda _{k+1}(\rho ^n)&=\dfrac{\int _{\Omega } \vert \nabla u_{k+1}(\rho ^{n})\vert ^{2}\,dx}{\int _{\Omega }\rho ^{n}u_{k+1}^{2}(\rho ^{n})\,dx}\nonumber \\&=\underset{V_{k+1}\subset H_{0}^{1}(\Omega ) ,\dim {V_{k+1}}=k+1\ }{\min }\underset{u\in V_{k+1}}{\max }\dfrac{\int _{\Omega } \vert \nabla u\vert ^{2}\,dx}{\int _{\Omega }\rho ^{n}u^{2}\,dx}\nonumber \\&\le \underset{u\in span\left\{ u_{1}(\rho ^{n}),u_{2}(\rho ^{n}),...,u_{k}(\rho ^{n}),u_{k+1}(\rho ^{*})\right\} }{\max }\dfrac{\int _{\Omega } \vert \nabla u\vert ^{2}\,dx}{\int _{\Omega }\rho ^{n}u^{2}\,dx}\nonumber \\&=\dfrac{\int _{\Omega } \vert \nabla u^n\vert ^{2}\,dx}{\int _{\Omega }\rho ^{n}{u^n}^{2}\,dx}. \end{aligned}$$
(46)

Let \(u^n=\beta _{1}u_{1}(\rho ^{n})+\beta _{2}u_{2}(\rho ^{n})+,...,\beta _{k}u_{k}(\rho ^{n})+\beta _{k+1}u_{k+1}(\rho ^{*})\). By (9) and (4) (replacing \(\rho \) by \(\rho ^n\) and \(\rho ^*\), respectively), (11), (17), (27), (31), (32) and \(\rho ^{n}{\mathop {\rightharpoonup }\limits ^{*}} \rho ^{*} \ in \ L^{\infty }(\Omega )\), we have

$$\begin{aligned} \int _{\Omega }\vert \nabla u^n\vert ^{2}\,dx&=\sum \limits _{j=1}^{k}\beta _{j}^{2}\int _{\Omega }\vert \nabla u_{j}(\rho ^{n})\vert ^{2}\,dx+\beta _{k+1}^{2}\int _{\Omega }\vert \nabla u_{k+1}(\rho ^{*})\vert ^{2}\,dx\nonumber \\&\quad +2\sum \limits _{j=1}^{k}\beta _{j}\beta _{k+1}\int _{\Omega }\nabla u_{j}(\rho ^{n})\nabla u_{k+1}(\rho ^{*})\,dx\nonumber \\&=\sum \limits _{j=1}^{k}\beta _{j}^{2}\lambda _{j}(\rho ^{n})\int _{\Omega }\rho ^{n}u_{j}^{2}(\rho ^{n})\,dx+\beta _{k+1}^{2}\lambda _{k+1}(\rho ^{*})\int _{\Omega }\rho ^{*}u_{k+1}^{2}(\rho ^{*}) \,dx\nonumber \\&\quad +2\sum \limits _{j=1}^{k}\beta _{j}\beta _{k+1}\lambda _{j}(\rho ^{n})\int _{\Omega }\rho ^{n} u_{j}(\rho ^{n})u_{k+1}(\rho ^{*})\,dx\nonumber \\&\rightarrow \sum \limits _{j=1}^{k}\beta _{j}^{2}\lambda _{j}(\rho ^{*})\int _{\Omega }\rho ^{*}u_{j}^{2}(\rho ^{*})\,dx+\beta _{k+1}^{2}\lambda _{k+1}(\rho ^{*})\int _{\Omega }\rho ^{*}u_{k+1}^{2}(\rho ^{*}) \,dx\nonumber \\&\quad +2\sum \limits _{j=1}^{k}\beta _{j}\beta _{k+1}\lambda _{j}(\rho ^{*})\int _{\Omega }\rho ^{*} u_{j}(\rho ^{*})u_{k+1}(\rho ^{*})\,dx,\quad \text {as } n\rightarrow \infty \end{aligned}$$
(47)

and

$$\begin{aligned} \int _{\Omega }\rho ^{n}{u^n}^{2}\,dx&=\sum \limits _{j=1}^{k}\beta _{j}^{2}\int _{\Omega }\rho ^{n}u_{j}^{2}(\rho ^{n})dx+\beta _{k+1}^{2}\int _{\Omega } \rho ^{n} u_{k+1}^{2}(\rho ^{*})dx\nonumber \\&\quad +2\sum \limits _{j=1}^{k}\beta _{j}\beta _{k+1}\int _{\Omega }\rho ^{n} u_{j}(\rho ^{n})u_{k+1}(\rho ^{*})dx\nonumber \\&\rightarrow \sum \limits _{j=1}^{k}\beta _{j}^{2}\int _{\Omega }\rho ^{*}u_{j}^{2}(\rho ^{*})dx+\beta _{k+1}^{2}\int _{\Omega } \rho ^{*} u_{k+1}^{2}(\rho ^{*})dx\nonumber \\&\quad +2\sum \limits _{j=1}^{k}\beta _{j}\beta _{k+1}\int _{\Omega }\rho ^{*} u_{j}(\rho ^{*})u_{k+1}(\rho ^{*})dx,\quad \text {as } n\rightarrow \infty . \end{aligned}$$
(48)

By (5) (replacing \(\rho \) by \(\rho ^*\)) and (47), we have

$$\begin{aligned}&\sum \limits _{j=1}^{k}\beta _{j}^{2}\lambda _{j}(\rho ^{*})\int _{\Omega }\rho ^{*}u_{j}^{2}(\rho ^{*})\,dx+\beta _{k+1}^{2}\lambda _{k+1}(\rho ^{*})\int _{\Omega }\rho ^{*}u_{k+1}^{2}(\rho ^{*}) \,dx\nonumber \\&\quad +2\sum \limits _{j=1}^{k}\beta _{j}\beta _{k+1}\lambda _{j}(\rho ^{*})\int _{\Omega }\rho ^{*} u_{j}(\rho ^{*})u_{k+1}(\rho ^{*})\,dx \nonumber \\&\le \lambda _{k+1}(\rho ^{*})\Big [ \sum \limits _{j=1}^{k}\beta _{j}^{2}\int _{\Omega }\rho ^{*}u_{j}^{2}(\rho ^{*})\,dx+\beta _{k+1}^{2}\int _{\Omega }\rho ^{*}u_{k+1}^{2}(\rho ^{*}) \,dx\nonumber \\&\quad +2\sum \limits _{j=1}^{k}\beta _{j}\beta _{k+1}\int _{\Omega }\rho ^{*} u_{j}(\rho ^{*})u_{k+1}(\rho ^{*})\,dx\Big ]. \end{aligned}$$
(49)

Combining (17), (46), (47), (48) and (49), it implies that

$$\begin{aligned} \lambda _{k+1}^*&=\lim _{n\rightarrow \infty }\lambda _{k+1}(\rho ^n)\le \lambda _{k+1}(\rho ^{*}). \end{aligned}$$
(50)

With (41) and (50), we conclude that \(\lambda _{k+1}^{*}=\lambda _{k+1}(\rho ^{*})\). Moreover, the eigenfunction \(u_{k+1}^{*}\) corresponding to \(\lambda _{k+1}^{*}\) is also the eigenfunction corresponding to \(\lambda _{k+1}(\rho ^{*})\). That is, \(u_{k+1}^{*} \in M (\lambda _{k+1}(\rho ^{*}))\). We set \(u_{k+1}(\rho ^{*})\in M (\lambda _{k+1}(\rho ^{*}))\) to satisfy \(u_{k+1}^{*}=u_{k+1}(\rho ^{*})\). By induction, we conclude that \(\lambda ^*_{i}=\lambda _{i}(\rho ^*)\) and \(u^*_{i}=u_{i}(\rho ^*)\), for \(i=1,2,\ldots ,N\). Combined with (17) and (27), the proof is complete. \(\square \)

Theorem 3.1

There exists at least one minimizer to the optimization problem (10) and (4).

Proof

By Lemma 3.1, we conclude that the minimization of \(F(\rho )\) is finite over the admissible set \({\mathcal {A}}\). Therefore, there exists a sequence \(\rho ^n\in {\mathcal {A}}\) such that

$$\begin{aligned} \lim _{n\rightarrow \infty }F(\rho ^n)=\inf _{\rho \in {\mathcal {A}}} F(\rho ). \end{aligned}$$
(51)

The uniform boundedness of the sequence \(\rho ^n\) in \(L^\infty (\Omega )\) implies that there exists a subsequence, also denoted by \(\rho ^n\), and some \(\rho ^*\in {\mathcal {A}}\) such that

$$\begin{aligned} \rho ^n{\mathop {\rightharpoonup }\limits ^{*}} \rho ^{*} \ \ \textrm{in }\ L^\infty (\Omega ). \end{aligned}$$
(52)

By Lemma 3.3, we have

$$\begin{aligned} \lambda _{i}(\rho ^n)&\rightarrow \lambda _{i}(\rho ^*), \text { for } i=1,2,\ldots ,N. \end{aligned}$$
(53)

Now the convergence of \(\lambda _i(\rho ^n)\) and the lower semicontinuity of a norm imply that

$$\begin{aligned} F(\rho ^*)&=\frac{1}{2} \sum _{i=1}^{N}(\lambda _i(\rho ^*)-{\widehat{\lambda }}_i)^2+\frac{\varepsilon }{2}\int _\Omega (\rho ^*)^2 dx\nonumber \\&\le \lim _{n\rightarrow \infty }\frac{1}{2} \sum _{i=1}^{N}(\lambda _i(\rho ^n)-{\widehat{\lambda }}_i)^2+\liminf _{n\rightarrow \infty }\frac{\varepsilon }{2}\int _\Omega (\rho ^n)^2 dx\nonumber \\&\le \liminf _{n\rightarrow \infty }\Big (\frac{1}{2} \sum _{i=1}^{N}(\lambda _i(\rho ^n)-{\widehat{\lambda }}_i)^2+\frac{\varepsilon }{2}\int _\Omega (\rho ^n)^2 dx\Big )\nonumber \\&=\liminf _{n\rightarrow \infty } F(\rho ^n)\le \inf _{\rho \in {\mathcal {A}}} F(\rho ). \end{aligned}$$
(54)

Therefore \(\rho ^*\) is a minimizer of \(F(\rho )\). \(\square \)

Next theorem shows the stability of the optimization problem with respect to the data perturbation.

Theorem 3.2

For \(i=1,2,\ldots , N\), let \({\widehat{\lambda }}_i^n\) be a sequence such that

$$\begin{aligned} {\widehat{\lambda }}_i^n\rightarrow {\widehat{\lambda }}_i \end{aligned}$$

and \(\rho ^n\) be the minimizer of the optimization problem (10) and (4) with \({\widehat{\lambda }}_i\) replaced by \({\widehat{\lambda }}^n_i\). Then there exists a subsequence of \(\rho ^n\) weak\(-*\) converging in \(L^\infty (\Omega )\) to a minimizer of the optimization problem (10) and (4).

Proof

Since \(\rho ^n\) is the minimizer of the optimization problem (10) and (4) with \({\widehat{\lambda }}_i\) replaced by \({\widehat{\lambda }}^n_i\), for all \(\rho \in {\mathcal {A}}\), we have that

$$\begin{aligned} \frac{1}{2} \sum _{i=1}^{N}(\lambda _i(\rho ^n)-{\widehat{\lambda }}^n_i)^2+\frac{\varepsilon }{2}\int _\Omega (\rho ^n)^2 dx\le \frac{1}{2} \sum _{i=1}^{N}(\lambda _i(\rho )-{\widehat{\lambda }}^n_i)^2+\frac{\varepsilon }{2}\int _\Omega \rho ^2 dx \end{aligned}$$
(55)

The uniform boundedness of the sequence \(\rho ^n\) in \(L^\infty (\Omega )\) implies that there exists a subsequence, also denoted by \(\rho ^n\), and some \(\rho ^*\in {\mathcal {A}}\) such that

$$\begin{aligned} \rho ^n{\mathop {\rightharpoonup }\limits ^{*}} \rho ^{*} \ \textrm{in }\ L^\infty (\Omega ). \end{aligned}$$
(56)

By Lemma 3.3, there exists a subsequence of \(\lambda _i(\rho ^n)\), also denoted by \(\lambda _i(\rho ^n)\), such that

$$\begin{aligned} \lim _{n\rightarrow \infty }\lambda _i(\rho ^n)= \lambda _i(\rho ^*), \ i=1,2,\ldots ,N. \end{aligned}$$
(57)

Thus, by the convergence of \({\widehat{\lambda }}_i^n\rightarrow {\widehat{\lambda }}_i\), we have

$$\begin{aligned} \lim _{n\rightarrow \infty }\sum _{i=1}^{N}(\lambda _i(\rho ^n)-{\widehat{\lambda }}^n_i)^2=\sum _{i=1}^{N}(\lambda _i(\rho ^*)-{\widehat{\lambda }}_i)^2. \end{aligned}$$

Now, for all \(\rho \in {\mathcal {A}}\), we have that

$$\begin{aligned} F(\rho ^*)&=\frac{1}{2} \sum _{i=1}^{N}(\lambda _i(\rho ^*)-{\widehat{\lambda }}_i)^2+\frac{\varepsilon }{2}\int _\Omega (\rho ^*)^2 dx\nonumber \\&\le \lim _{n\rightarrow \infty }\frac{1}{2} \sum _{i=1}^{N}(\lambda _i(\rho ^n)-{\widehat{\lambda }}^n_i)^2+\liminf _{n\rightarrow \infty }\frac{\varepsilon }{2}\int _\Omega (\rho ^n)^2 dx\nonumber \\&\le \liminf _{n\rightarrow \infty }\Big (\frac{1}{2} \sum _{i=1}^{N}(\lambda _i(\rho ^n)-{\widehat{\lambda }}^n_i)^2+\frac{\varepsilon }{2}\int _\Omega (\rho ^n)^2 dx\Big )\nonumber \\&\le \liminf _{n\rightarrow \infty }\Big (\frac{1}{2} \sum _{i=1}^{N}(\lambda _i(\rho )-{\widehat{\lambda }}^n_i)^2+\frac{\varepsilon }{2}\int _\Omega \rho ^2 dx\Big )\nonumber \\&=\frac{1}{2} \sum _{i=1}^{N}(\lambda _i(\rho )-{\widehat{\lambda }}_i)^2+\frac{\varepsilon }{2}\int _\Omega \rho ^2 dx= F(\rho ). \end{aligned}$$
(58)

Therefore \(\rho ^*\) is a minimizer of (10) and (4). \(\square \)

Theorem 3.3

For \(\rho \in {\mathcal {A}} \) and \(i=1,2,\ldots ,N,\) if eigenvalues \(\lambda _i(\rho )\) of (4) are simple, then the functional \(F{: {\mathcal {A}}\subset L^{\infty }(\Omega )\rightarrow {\mathbb {R}}}\) is Fr\(\acute{e}\)chet differentiable and its Fr\(\acute{e}\)chet derivative \(F^\prime (\rho )\) at \(\rho \in {\mathcal {A}}\) is given by

$$\begin{aligned} F^\prime (\rho )[\gamma ]=-\sum _{i=1}^N (\lambda _i(\rho )-{\widehat{\lambda }}_i) \frac{\lambda _i(\rho ) \int _\Omega \gamma u_i^2 (\rho ) dx}{\int _\Omega \rho u_i^2(\rho ) dx}+\varepsilon \int _\Omega \rho \gamma dx. \end{aligned}$$
(59)

Proof

Replacing \(\rho \) by \((\rho +\gamma )\) in (7), we define the i-th eigenpair \((\lambda _i (\rho +\gamma ), u_i(\rho +\gamma ))\) for \((\rho +\gamma )\) by

$$\begin{aligned} \lambda _i (\rho +\gamma )&=\frac{\int _\Omega \vert \nabla u_i(\rho +\gamma ) \vert ^2 dx }{\int _\Omega (\rho +\gamma ) u_i^2(\rho +\gamma ) dx}, \ i=1,2,\ldots ,N. \end{aligned}$$
(60)

Similar to the proof of Lemma 3.3, we can show that as \(\gamma \rightarrow 0 \ \text {in} \ L^{\infty }(\Omega )\),

$$\begin{aligned} \lambda _{i}(\rho +\gamma )&\rightarrow \lambda _{i}(\rho ), \end{aligned}$$
(61)
$$\begin{aligned} u_{i}(\rho +\gamma )&\rightarrow u_{i}(\rho )\ in \ H^{1}(\Omega ),\ i=1,2,\ldots ,N, \end{aligned}$$
(62)

where \(u_{i}(\rho )\in M(\lambda _{i}(\rho ))\). Combined with (7) and (60), we have

$$\begin{aligned}&\lambda _i (\rho +\gamma )- \lambda _i (\rho ) =\frac{\int _\Omega \vert \nabla u_i(\rho +\gamma ) \vert ^2 dx }{\int _\Omega (\rho +\gamma ) u_i^2(\rho +\gamma ) dx}-\frac{\int _\Omega \vert \nabla u_i(\rho ) \vert ^2 dx }{\int _\Omega \rho u_i^2(\rho ) dx}\nonumber \\&\quad =\frac{\int _\Omega \vert \nabla u_i(\rho +\gamma ) \vert ^2 dx \int _\Omega \rho u_i^2(\rho ) dx-\int _\Omega (\rho +\gamma ) u_i^2(\rho +\gamma ) dx\int _\Omega \vert \nabla u_i(\rho ) \vert ^2 dx }{\int _\Omega (\rho +\gamma ) u_i^2(\rho +\gamma ) dx\int _\Omega \rho u_i^2(\rho ) dx} \end{aligned}$$
(63)

With (4), (7) and (60), the numerator of (63) could be evaluated by

$$\begin{aligned}&\int _\Omega \vert \nabla u_i(\rho +\gamma ) \vert ^2 dx \int _\Omega \rho u_i^2(\rho ) dx-\int _\Omega (\rho +\gamma ) u_i^2(\rho +\gamma ) dx\int _\Omega \vert \nabla u_i(\rho ) \vert ^2 dx\nonumber \\&\quad = \int _\Omega (\vert \nabla u_i(\rho +\gamma )\vert ^2-\vert \nabla u_i(\rho ) \vert ^2) dx \int _\Omega \rho u_i^2(\rho ) dx\nonumber \\&\qquad -\int _\Omega ((\rho +\gamma ) u_i^2(\rho +\gamma )-\rho u_i^2(\rho )) dx\int _\Omega \vert \nabla u_i(\rho ) \vert ^2 dx\nonumber \\&\quad = \int _\Omega \nabla ( u_i(\rho +\gamma )-u_i(\rho ))\cdot \nabla ( u_i(\rho +\gamma )+u_i(\rho )) dx \int _\Omega \rho u_i^2(\rho ) dx\nonumber \\&\qquad -\int _\Omega (\gamma u_i^2(\rho +\gamma )+\rho (u_i(\rho +\gamma )-u_i(\rho ))(u_i(\rho +\gamma )+u_i(\rho ))) dx\int _\Omega \vert \nabla u_i(\rho ) \vert ^2 dx \nonumber \\&\quad = \lambda _i(\rho +\gamma )\int _\Omega (\rho +\gamma ) ( u_i(\rho +\gamma )-u_i(\rho )) u_i(\rho +\gamma ) dx \int _\Omega \rho u_i^2(\rho ) dx\nonumber \\&\qquad +\lambda _i(\rho )\int _\Omega \rho ( u_i(\rho +\gamma )-u_i(\rho ))u_i(\rho ) dx \int _\Omega \rho u_i^2(\rho ) dx\nonumber \\&\qquad -\int _\Omega \gamma u_i^2(\rho +\gamma )dx\lambda _i(\rho ) \int _\Omega \rho u_i^2(\rho ) dx\nonumber \\&\qquad -\int _\Omega \rho (u_i(\rho +\gamma )-u_i(\rho ))(u_i(\rho +\gamma )+u_i(\rho )) dx\lambda _i(\rho ) \int _\Omega \rho u_i^2(\rho ) dx\nonumber \\&\quad = \Big [ (\lambda _i(\rho +\gamma )-\lambda _i(\rho ))\int _\Omega (\rho +\gamma ) ( u_i(\rho +\gamma )-u_i(\rho )) u_i(\rho +\gamma ) dx \nonumber \\&\qquad -\lambda _i(\rho )\int _\Omega \gamma u_i(\rho )(u_i(\rho +\gamma )- u_i(\rho )) dx -\lambda _i(\rho )\int _\Omega \gamma u_i^2(\rho ) dx \Big ]\int _\Omega \rho u_i^2(\rho ) dx \end{aligned}$$
(64)

and the denominator of (63) could be evaluated by

$$\begin{aligned}&\int _\Omega (\rho +\gamma ) u_i^2(\rho +\gamma ) dx\int _\Omega \rho u_i^2(\rho ) dx\nonumber \\&\quad =\Big [\int _\Omega \gamma u_i^2(\rho +\gamma ) dx+\int _\Omega \rho (u_i(\rho +\gamma )-u_i(\rho ))(u_i(\rho +\gamma )+u_i(\rho ))dx\nonumber \\&\qquad +\int _\Omega \rho u_i^2(\rho ) dx\Big ]\int _\Omega \rho u_i^2(\rho ) dx. \end{aligned}$$
(65)

Combining (64) and (65), (63) could be simplified by

$$\begin{aligned}&\lambda _i(\rho +\gamma )-\lambda _i(\rho ) \nonumber \\&\quad =\frac{-\lambda _i(\rho )\int _\Omega \gamma u_i(\rho )(u_i(\rho +\gamma )- u_i(\rho )) dx -\lambda _i(\rho )\int _\Omega \gamma u_i^2(\rho ) dx}{\int _\Omega \rho u_i^2(\rho ) dx+\int _\Omega \rho (u_i(\rho +\gamma )-u_i(\rho ))u_i(\rho )dx +\int _\Omega \gamma u_i(\rho ) u_i(\rho +\gamma ) dx}. \end{aligned}$$
(66)

Thus,

$$\begin{aligned}&\lambda _i(\rho +\gamma )-\lambda _i(\rho )+\frac{\lambda _i(\rho )\int _\Omega \gamma u_i^2(\rho ) dx}{\int _\Omega \rho u_i^2(\rho ) dx} \nonumber \\&\quad =\Big [-\lambda _i(\rho )\int _\Omega \gamma u_i(\rho )(u_i(\rho +\gamma )- u_i(\rho )) dx )\int _\Omega \rho u_i^2(\rho ) dx\nonumber \\&\qquad +\lambda _i(\rho )\int _\Omega \gamma u_i^2(\rho ) dx\big (\int _\Omega \rho (u_i(\rho +\gamma )-u_i(\rho ))u_i(\rho )dx +\int _\Omega \gamma u_i(\rho ) u_i(\rho +\gamma ) dx\big )\Big ]\nonumber \\&\qquad \Big /\Big [\big (\int _\Omega \rho u_i^2(\rho ) dx+\int _\Omega \rho (u_i(\rho +\gamma )-u_i(\rho ))u_i(\rho )dx \nonumber \\&\qquad +\int _\Omega \gamma u_i(\rho ) u_i(\rho +\gamma ) dx\big )\int _\Omega \rho u_i^2(\rho ) dx\Big ]. \end{aligned}$$
(67)

By (9) and (62), we have \(\Vert u_i(\rho )\Vert _{H^1(\Omega )}<C\) and \(\Vert u_i(\rho +\gamma )\Vert _{H^1(\Omega )}<C\) when \(\Vert \gamma \Vert _{L^\infty (\Omega )}\) is small enough. Therefore, the denominator of (67) could be bounded. Combined with Lemma 3.1, (67) is evaluated by

$$\begin{aligned}&\vert \lambda _i(\rho +\gamma )-\lambda _i(\rho )+\frac{\lambda _i(\rho )\int _\Omega \gamma u_i^2(\rho ) dx}{\int _\Omega \rho u_i^2(\rho ) dx}\vert \\&\quad \le C\vert \lambda _i(\rho )\int _\Omega \gamma u_i(\rho )(u_i(\rho +\gamma )- u_i(\rho )) dx )\int _\Omega \rho u_i^2(\rho ) dx\vert \\&\qquad +\vert \lambda _i(\rho )\int _\Omega \gamma u_i^2(\rho ) dx\big (\int _\Omega \rho (u_i(\rho +\gamma )-u_i(\rho ))u_i(\rho )dx +\int _\Omega \gamma u_i(\rho ) u_i(\rho +\gamma ) dx\big )\vert \\&\quad \le C\Vert \gamma \Vert _{L^\infty (\Omega )} \big (\Vert u_i(\rho +\gamma )- u_i(\rho )\Vert _{H^1(\Omega )} + \Vert \gamma \Vert _{L^\infty (\Omega )} \big ). \end{aligned}$$

Thus, by (62), we have

$$\begin{aligned} \frac{\vert \lambda _i(\rho +\gamma )-\lambda _i(\rho )+\frac{\lambda _i(\rho )\int _\Omega \gamma u_i^2(\rho ) dx}{\int _\Omega \rho u_i^2(\rho ) dx}\vert }{\Vert \gamma \Vert _{L^\infty (\Omega )}} \rightarrow 0 \text { as }\gamma \rightarrow 0 \ \text {in} \ L^{\infty }(\Omega ). \end{aligned}$$

The Fr\(\acute{e}\)chet derivative \(\lambda _i^\prime (\rho )\) at \(\rho \in {\mathcal {A}},\ i=1,2,\ldots ,N,\) is given by

$$\begin{aligned} \lambda _i^\prime (\rho )[\gamma ]=-\frac{\lambda _i(\rho )\int _\Omega \gamma u_i^2(\rho ) dx}{\int _\Omega \rho u_i^2(\rho ) dx}. \end{aligned}$$
(68)

Consequently,

$$\begin{aligned} F^\prime (\rho )[\gamma ]=-\sum _{i=1}^N (\lambda _i(\rho )-{\widehat{\lambda }}_i) \frac{\lambda _i(\rho )\int _\Omega \gamma u_i^2(\rho ) dx}{\int _\Omega \rho u_i^2(\rho ) dx}+\varepsilon \int _\Omega \rho \gamma dx. \end{aligned}$$
(69)

\(\square \)

4 Finite-Element Approximation and Its Convergence

The finite-element method is applied to discretize the optimization problem (10) and (4). The domain \(\Omega \) is partitioned into regular elements \({\mathcal {T}}_h\). The linear finite-element space \(V_h\) is defined by

$$\begin{aligned} V_h=\{\phi _h \in C^0(\Omega ):\ \phi _h\vert _{T_i}\in P_1(T_i),\ \forall T_i \in {\mathcal {T}}_h\} \end{aligned}$$
(70)

where \(P_1(T_i)\) denotes the space of linear (bilinear) polynomials on the element \(T_i\). The discrete admissible set of the \(\rho _h\) is defined by

$$\begin{aligned} {\mathcal {A}}_h=\{\rho _h\in V_h: \ \rho _0\le \rho _h(x)\le \rho _1, \forall x\in \Omega \} \end{aligned}$$
(71)

and \({\mathcal {A}}_h\subset {\mathcal {A}} \). Then the optimization problem (10) and (4) is approximated by the discrete minimization optimization

$$\begin{aligned} \min _{\rho _h\in {\mathcal {A}}_h} F_h(\rho _h)=\frac{1}{2} \sum _{i=1}^{N}(\lambda _{i,h}(\rho _h)-{\widehat{\lambda }}_i)^2+\frac{\varepsilon }{2}\int _\Omega \rho ^2_h dx, \end{aligned}$$
(72)

where the eigenpairs \((\lambda _{i,h}(\rho _h),u_{i,h}(\rho _h)),\ i=1,2,\ldots , m=\dim V_h\), satisfy the following weak formulations

$$\begin{aligned} \int _\Omega \nabla u_{i,h}(\rho _h) \cdot \nabla v_h dx =\lambda _{i,h} (\rho _h)\int _\Omega \rho _h u_{i,h} (\rho _h) v_h dx, \quad \forall v_h\in {V}_h, \ i=1,2,\ldots , m. \end{aligned}$$
(73)

The i-th eigenpair \((\lambda _{i,h}(\rho _h),u_{i,h}(\rho _h))\) is obtained by the min-max principle [see 18]

$$\begin{aligned} \lambda _{i,h}(\rho _h)&=\min _{V_i\subset V_h,\ \dim (V_i)=i}\max _{u_h\in V_i}\frac{\int _\Omega \vert \nabla u_h \vert ^2 dx }{\int _\Omega \rho _h u_h^2 dx}\nonumber \\&=\max _{u_h\in span\{u_{1,h}(\rho _h), u_{2,h}(\rho _h),\ldots ,u_{i,h}(\rho _h)\} }\frac{\int _\Omega \vert \nabla u_h \vert ^2 dx }{\int _\Omega \rho _h u_h^2 dx}\nonumber \\&=\frac{\int _\Omega \vert \nabla u_{i,h}(\rho _h) \vert ^2 dx }{\int _\Omega \rho _h u_{i,h}^2(\rho _h) dx},\quad \forall u_{i,h}\in M_h(\lambda _{i,h}(\rho _h)), \end{aligned}$$
(74)

where

$$\begin{aligned} M_h(\lambda _{i,h}(\rho _h))= \{u:\ u \text { is an eigenfunction of} (73)\text { corresponding to } \lambda _{i,h} (\rho _h)\}. \end{aligned}$$
(75)

By rearranging, (73) admits a sequence of real eigenvalues

$$\begin{aligned} 0<\lambda _{1,h}(\rho _h)\le \lambda _{2,h}(\rho _h)\le \cdots \le \cdots \le \lambda _{m,h}(\rho _h), \end{aligned}$$
(76)

and the corresponding eigenfunctions

$$\begin{aligned} u_{1,h}(\rho _h),\ u_{2,h}(\rho _h) \ldots ,\ u_{m,h}(\rho _h) \end{aligned}$$
(77)

which can be chosen to satisfy

$$\begin{aligned} \int _\Omega \nabla u_{i,h}(\rho _h)\cdot \nabla u_{j,h}(\rho _h)dx&= \lambda _{i,h}(\rho _h)\int _\Omega \rho _h u_{i,h}(\rho _h) u_{j,h}(\rho _h)dx\nonumber \\&=\delta _{ij},\ i,j=1,\ 2,\ \ldots ,\ m. \end{aligned}$$
(78)

Analogous to Lemma 3.1, the boundedness of \(\lambda _{i,h}(\rho _h)\) could be obtained as follows:

Lemma 4.1

For any \(\rho _h \in {\mathcal {A}}_h\), we have

$$\begin{aligned} \lambda _{i,h}(\rho _1)\le \lambda _{i,h}(\rho _h)\le \lambda _{i,h}(\rho _{0}),\ i=1,2,\ldots , m. \end{aligned}$$
(79)

Lemma 4.2

For \( i=1,2,\ldots ,m\), let \(\rho _h^{n},\ \rho _h^{*} \in {\mathcal {A}}_h\) and \(\rho _h^{n}\rightarrow \rho _h^{*} \) in any norm as \(n\rightarrow \infty \), then \(\lambda _{i,h}(\rho _h^n)\rightarrow \lambda _{i,h}(\rho _h^*)\). Moreover, there exists a subsequence \(u_{i,h}(\rho _h^n)\in M_h(\lambda _{i,h}(\rho _h^n))\), and some \(u_{i,h}(\rho _h^*)\in M_h(\lambda _{i,h}(\rho _h^*))\), satisfying \(u_{i,h}(\rho _h^n)\rightarrow u_{i,h}(\rho _h^*)\ in \ H^{1}(\Omega ),\) as \(n\rightarrow \infty \).

Proof

The proof is analogue to Lemma 3.3, replacing \(\rho ^{n},\ \rho ^{*}, \ \lambda _{i}(\rho ^n),\ u_{i}(\rho ^n)\) by \(\rho _h^{n},\ \rho _h^{*},\ \lambda _{i,h}(\rho _h^n), u_{i,h}(\rho _h^n)\), respectively. \(\square \)

Theorem 4.1

There exists at least one minimizer to the optimization problem (72) and (73).

Proof

By Lemma 4.1, we conclude that the minimization of \(F_h(\rho _h)\) is finite over the admissible set \({\mathcal {A}}_h\). Therefore, there exists a sequence \(\rho ^n_{h}\in {\mathcal {A}}_h\) such that

$$\begin{aligned} \lim _{n\rightarrow \infty }F_{h}(\rho _h^n)=\inf _{\rho _h\in {\mathcal {A}}_h} F_{h}(\rho _h). \end{aligned}$$
(80)

The uniform boundedness of the sequence \(\rho _h^n\) in \(L^\infty (\Omega )\) implies that there exists a subsequence, also denoted by \(\rho _h^n\), and some \(\rho _h^*\) such that

$$\begin{aligned} \rho _h^n\rightarrow \rho _h^*, \ \ \mathrm{in \ any \ norm\ as \ n\rightarrow \infty .} \end{aligned}$$
(81)

By Lemma 4.2, and the lower semicontinuity of a norm, we obtain

$$\begin{aligned} F_{h}(\rho _h^*)&=\frac{1}{2} \sum _{i=1}^{N}(\lambda _{i,h}(\rho _h^*)-{\widehat{\lambda }}_{i,h})^2+\frac{\varepsilon }{2}\int _\Omega (\rho _h^*)^2 dx\\&\le \lim _{n\rightarrow \infty }\frac{1}{2} \sum _{i=1}^{N}(\lambda _{i,h}(\rho _h^n)-{\widehat{\lambda }}_{i,h})^2+\liminf _{n\rightarrow \infty }\frac{\varepsilon }{2}\int _\Omega (\rho _h^n)^2 dx\\&\le \liminf _{n\rightarrow \infty }\Big (\frac{1}{2} \sum _{i=1}^{N}(\lambda _{i,h}(\rho _h^n)-{\widehat{\lambda }}_{i,h})^2+\frac{\varepsilon }{2}\int _\Omega (\rho _h^n)^2 dx\Big )\\&=\liminf _{n\rightarrow \infty } F_{h}(\rho _h^n)\le \inf _{\rho _h\in {\mathcal {A}}_h} F_{h}(\rho _h). \end{aligned}$$

Therefore, \(\rho _h^*\) is a minimizer of \(F_{h}(\rho _h)\). \(\square \)

Lemma 4.3

Assume that \((\lambda _{i,h}(\rho _h),u_{i,h}(\rho _h))\) (\( i=1,2,\ldots ,M\)) are the eigenpairs of (73), and (\({\tilde{\lambda }}_i,{\tilde{u}}_i)\) are the eigenpairs of (4) replacing \(\rho \) by \({\tilde{\rho }}\), then

$$\begin{aligned}&\int _{\Omega }\vert \nabla (u_{i,h}(\rho _h)-{\tilde{u}}_{i})\vert ^{2}\,dx-{\tilde{\lambda }}_{i}\int _{\Omega }{\tilde{\rho }}(u_{i,h}(\rho _h)-{\tilde{u}}_{i})^{2}dx \nonumber \\&=(\lambda _{i,h}(\rho _h)-{\tilde{\lambda }}_{i})\int _{\Omega }\rho _h u^{2}_{i,h}(\rho _h)dx+{\tilde{\lambda }}_{i}\int _{\Omega }(\rho _h-{\tilde{\rho }})u_{i,h}^{2}(\rho _h)dx. \end{aligned}$$
(82)

Proof

The proof is analogue to Lemma 3.2, replacing \(\rho , \ \lambda _{i}(\rho ),\ u_{i}(\rho )\) by \(\rho _h\), \(\lambda _{i,h}(\rho _h), u_{i,h}(\rho _h)\), respectively. \(\square \)

We introduce the standard interpolation operator \({\mathcal {I}}_h:\ W^{1,\infty }(\Omega )\rightarrow {V}_h\) and the projection operator \({\mathcal {R}}_h: \ H^{1}(\Omega )\rightarrow {V}_h\) defined by

$$\begin{aligned} \int _\Omega \nabla {\mathcal {R}}_h w \cdot \nabla \phi _h dx =\int _\Omega \nabla w \cdot \nabla \phi _h dx,\ \forall \ w \in H^1(\Omega ),\ \phi _h\in V_h. \end{aligned}$$

It is well known [see 20, 21] that, for any \(p>d=dim(\Omega )\), we have

$$\begin{aligned} \lim _{h\rightarrow 0}\Vert {\mathcal {I}}_h w-w\Vert _{W^{1,p}(\Omega )}=0,\ \forall \ w \in W^{1,p}(\Omega ) \end{aligned}$$
(83)

and

$$\begin{aligned} \lim _{h\rightarrow 0}\Vert {\mathcal {R}}_h w-w\Vert _{H^1(\Omega )}=0,\ \forall \ w \in H^1(\Omega ). \end{aligned}$$
(84)

Lemma 4.4

Let \(\rho _h\in {\mathcal {A}}_h\), \(\rho ^*\in {\mathcal {A}} \ \text {in} \ L^{\infty }(\Omega )\), if \(\rho _h {\mathop {\rightharpoonup }\limits ^{*}} \rho ^{*}\ \text {in} \ L^{\infty }(\Omega )\) as \(h\rightarrow 0\), then \(\lambda _{i,h}(\rho _{h})\rightarrow \lambda _{i}(\rho ^*)\). Moreover, there exists a subsequence \(u_{i,h}(\rho _{h})\in M_h(\lambda _{i,h}(\rho _{h}))\), and some \(u_{i}(\rho ^*)\in M(\lambda _i(\rho ^*))\), satisfying \(u_{i,h}(\rho _{h})\rightarrow u_{i}(\rho ^*)\ in \ H^{1}(\Omega ),\) as \(h\rightarrow 0\).

Proof

By Lemma 4.1, for \( i=1,2,\ldots , N\), we have

$$\begin{aligned} \lambda _{i,h}(\rho _1)\le \lambda _{i,h}(\rho _h)\le \lambda _{i,h}(\rho _0). \end{aligned}$$

The finite-element solutions \(\lambda _{i,h}(\rho _0)\) and \(\lambda _{i,h}(\rho _1)\) have the following convergence [see 18]

$$\begin{aligned} \lambda _{i,h}(\rho _0)&\rightarrow \lambda _i(\rho _0),\\ \lambda _{i,h}(\rho _1)&\rightarrow \lambda _i(\rho _1). \end{aligned}$$

Therefore,

$$\begin{aligned} \vert \lambda _{i,h}(\rho _h)\vert <C,\ i=1,2,\ldots , N. \end{aligned}$$

It implies that there exists a subsequence, also denoted by \(\lambda _{i,h}(\rho _{h})\), such that

$$\begin{aligned} \lim _{h\rightarrow 0}\lambda _{i,h}(\rho _{h})= \lambda _{i}^{*},\ i=1,2,\ldots , N. \end{aligned}$$
(85)

By (78), the eigenfunction \(u_{i,h}(\rho _h)\in M_h(\lambda _{i,h}(\rho _h))\) satisfies

$$\begin{aligned} \int _\Omega \vert \nabla u_{i,h}(\rho _h)\vert ^2 dx=1, \end{aligned}$$
(86)

and by Poincar\(\acute{e }\) inequality, we have

$$\begin{aligned} \Vert u_{i,h}(\rho _h)\Vert _{H^1(\Omega )}<C, \end{aligned}$$
(87)

where C is a constant independent of h. Thus, there exists a subsequence, also denoted by \(u_{i,h}(\rho _h)\), such that

$$\begin{aligned} u_{i,h}(\rho _h)\rightharpoonup u_i^* \ \textrm{in}\ H^1(\Omega )\ \textrm{and}\ u_{i,h}(\rho _h)\rightarrow u_i^* \ \textrm{in}\ L^2(\Omega ),\ i=1,2,\ldots , N, \end{aligned}$$
(88)

as \(h\rightarrow 0\).

We need to prove that \((\lambda _i^*,u_i^*)\) is the eigenpair of (4) corresponding to \(\rho ^*\) for \( i=1,2,\ldots , N\). Notice that the eigenpair \((\lambda _{i,h}(\rho _h), \ u_{i,h}(\rho _h))\) corresponding to \(\rho _h\) satisfies the weak formula (73). Substituting \(v_h\) in (73) by \({\mathcal {R}}_h v, \ \forall v\in H_{0}^{1}(\Omega )\), we obtain

$$\begin{aligned} \int _\Omega \nabla u_{i,h}(\rho _h) \cdot \nabla {\mathcal {R}}_h v dx= \lambda _{i,h}(\rho _h) \int _\Omega \rho _h u_{i,h}(\rho _h) {\mathcal {R}}_h v dx,\ i=1,2,\ldots , m. \end{aligned}$$
(89)

The RHS item of equation of (89) could be rewritten by

$$\begin{aligned}&\lambda _{i,h}(\rho _h) \int _\Omega \rho _h u_{i,h}(\rho _h) {\mathcal {R}}_h v dx=(\lambda _{i,h}(\rho _h)-\lambda _i^*) \int _\Omega \rho _h u_{i,h}(\rho _h) {\mathcal {R}}_h v dx\nonumber \\&\quad +\lambda _i^* \int _\Omega \rho _h (u_{i,h}(\rho _h)-u_i^*){\mathcal {R}}_h v dx+\lambda _i^* \int _\Omega (\rho _h-\rho ^*) u_i^*{\mathcal {R}}_h v dx\nonumber \\&\quad +\lambda _i^* \int _\Omega \rho ^* u_i^*({\mathcal {R}}_h v-v) dx+\lambda _i^* \int _\Omega \rho ^* u_i^* v dx. \end{aligned}$$
(90)

By (11), (71), (87), (85), (88), (84) and \(\rho _h {\mathop {\rightharpoonup }\limits ^{*}} \rho ^{*}\ \text {in} \ L^{\infty }(\Omega )\) as \(h\rightarrow 0\), we have

$$\begin{aligned} \lim _{h\rightarrow 0} \lambda _{i,h}(\rho _h) \int _\Omega \rho _h u_{i,h}(\rho _h) {\mathcal {R}}_h v dx=\lambda _i^* \int _\Omega \rho ^* u_i^*v dx. \end{aligned}$$
(91)

By (88) and (84), we have

$$\begin{aligned} \lim _{h\rightarrow 0} \int _\Omega \nabla u_{i,h}(\rho _h)\cdot \nabla {\mathcal {R}}_h v dx=\int _\Omega \nabla u_i^* \cdot \nabla v dx \end{aligned}$$
(92)

Taking the limitation of equation (89) as \(h\rightarrow 0\), combined with (91) and (92), we have

$$\begin{aligned} \int _\Omega \nabla u_i^* \cdot \nabla v dx=\lambda _i^* \int _\Omega \rho ^* u_i^*v dx. \end{aligned}$$
(93)

Therefore, it could conclude that \((\lambda _i^*,u_i^*)\ ( i=1,2,\ldots ,N)\) are eigenpairs of (4) corresponding to \(\rho ^*\). Replacing \({\tilde{\rho }},\ {\tilde{u}}_{i}, \ {\tilde{\lambda }}_{i}\) by \(\rho ^*,\ u_{i}^*, \ \lambda _{i}^*\) in Lemma 4.3, we have

$$\begin{aligned}&\int _{\Omega }\vert \nabla (u_{i,h}(\rho _h)- u^*_{i})\vert ^{2}dx\nonumber \\&=\lambda _{i}^{*}\int _{\Omega }\rho ^{*}(u_{i,h}(\rho _h)-u_{i}^{*})^{2}dx+(\lambda _{i,h}(\rho _h)-\lambda _{i}^{*})\int _{\Omega }\rho _h u^{2}_{i,h}(\rho _h)dx\nonumber \\&\quad +\lambda _{i}^{*}\int _{\Omega }(\rho _h-\rho ^{*}) u^{2}_{i,h}(\rho _h)dx\nonumber \\&\rightarrow 0, \ \text {as}\ h\rightarrow 0 \end{aligned}$$
(94)

with (11), (71), (88), (87), (85) and \(\rho _{h}{\mathop {\rightharpoonup }\limits ^{*}} \rho ^{*} \ in \ L^{\infty }(\Omega )\). Combining (88) and (94), we have

$$\begin{aligned} u_{i,h}(\rho _h)\rightarrow u_i^* \ \textrm{in}\ H^1(\Omega ),\ i=1, 2, \ldots , N, \end{aligned}$$
(95)

as \(h\rightarrow 0\).

Taking the limitation of (78) as \(h\rightarrow 0\), by (71), (87), (95), (85) and \(\rho _h{\mathop {\rightharpoonup }\limits ^{*}} \rho ^{*} \ in \ L^{\infty }(\Omega )\) as \(h\rightarrow 0\), the orthogonality of \(u_i^*\) is obtained by

$$\begin{aligned} \int _\Omega \nabla u_i^*\cdot \nabla u_j^*dx= \lambda _i^* \int _\Omega \rho ^* u_i^* u_j^* dx =\delta _{ij},\ i,j=1,\ 2,\ \ldots , \ m. \end{aligned}$$
(96)

Finally, we prove \((\lambda ^*_{i},u^*_{i})\) (\(i=1,2,\ldots ,N\)) is the i-th eigenpair of (4) corresponding to \(\rho ^*\) by induction. For \(i=1\), by (7) (replacing \(\rho \) by \(\rho ^*\)), we have

$$\begin{aligned} \lambda _{1}(\rho ^{*})&=\dfrac{\int _{\Omega } \vert \nabla u_{1}(\rho ^{*})\vert ^{2}\,dx}{\int _{\Omega }\rho ^{*}u_{1}^{2}(\rho ^{*})\,dx}\nonumber \\&\le \dfrac{\int _{\Omega } \vert \nabla u_{1}^{*}\vert ^{2}\,dx}{\int _{\Omega }\rho ^{*}{u_{1}^{*}}^{2}\,dx}=\lambda _{1}^{*}. \end{aligned}$$
(97)

On the other hand, by (85), (74), (71), (84) and \(\rho _h{\mathop {\rightharpoonup }\limits ^{*}} \rho ^{*} \ in \ L^{\infty }(\Omega )\) as \(h\rightarrow 0\), we have

$$\begin{aligned} \lambda _{1}^{*}&={\underset{h\rightarrow 0}{\lim }} \lambda _{1,h}({\rho _h})\nonumber \\&={\underset{h\rightarrow 0}{\lim }}\dfrac{\int _{\Omega } \vert \nabla u_{1,h}({\rho _h})\vert ^{2}\,dx}{\int _{\Omega }\rho _h u_{1,h}^{2}({\rho _h})\,dx}\nonumber \\&\le {\underset{h\rightarrow 0}{\lim }}\dfrac{\int _{\Omega } \vert \nabla {\mathcal {R}}_h u_{1}(\rho ^{*})\vert ^{2}\,dx}{\int _{\Omega }\rho _{h}({\mathcal {R}}_h u_{1}(\rho ^{*}))^{2}\,dx}\nonumber \\&=\dfrac{\int _{\Omega } \vert \nabla u_{1}(\rho ^{*})\vert ^{2}\,dx}{\int _{\Omega }\rho ^{*}u_{1}^{2}(\rho ^{*})\,dx}=\lambda _{1}(\rho ^{*}). \end{aligned}$$
(98)

Combining (97) and (98), we obtain \(\lambda _{1}^{*}=\lambda _{1}(\rho ^{*})\) and \(u_{1}^{*} \in M (\lambda _{1}(\rho ^{*}))\). We set \(u_{1}(\rho ^{*})\in M (\lambda _{1}(\rho ^{*}))\) to satisfy \(u_{1}^{*}=u_{1}(\rho ^{*})\).

For \( i=1,2,\ldots , k\), assuming that

$$\begin{aligned} \lambda _{i}^{*}&=\lambda _{i}(\rho ^{*}), \end{aligned}$$
(99)
$$\begin{aligned} u_{i}^{*}&= u_{i}(\rho ^{*}) , \end{aligned}$$
(100)

we need to prove that \(\lambda _{k+1}^{*}=\lambda _{k+1}(\rho ^{*})\) and \(u_{k+1}^{*}=u_{k+1}(\rho ^{*})\). On one hand, similar to the proof of (41), we have

$$\begin{aligned} \lambda _{k+1}(\rho ^{*})\le \lambda _{k+1}^{*}. \end{aligned}$$
(101)

On the other hand, we can conclude that

$$\begin{aligned} \dim span\left\{ u_{1,h}(\rho _h),u_{2,h}(\rho _h),...,u_{k,h}(\rho _h),{\mathcal {R}}_h u_{k+1}(\rho ^*)\right\} =k+1. \end{aligned}$$
(102)

If the claim is negated to assume that

$$\begin{aligned} \dim span\left\{ u_{1,h}(\rho _h),u_{2,h}(\rho _h),...,u_{k,h}(\rho _h),{\mathcal {R}}_h u_{k+1}(\rho ^{*})\right\} =k, \end{aligned}$$

since \(u_{1,h}(\rho _h),u_{2,h}(\rho _h),...,u_{k,h}(\rho _h)\) are orthogonal by (78), then

$$\begin{aligned} {\mathcal {R}}_h u_{k+1}(\rho ^{*})=\gamma _1 u_{1,h}(\rho _h)+\gamma _2 u_{2,h}(\rho _h)+...+\gamma _k u_{k,h}(\rho _h). \end{aligned}$$
(103)

By the orthogonality (78), we obtain

$$\begin{aligned} \int _\Omega \nabla {\mathcal {R}}_h u_{k+1}(\rho ^{*})\nabla u_{i,h}(\rho _h)dx&=\sum _{j=1}^k \gamma _j \int _\Omega \nabla u_{j,h}(\rho _h) \nabla u_{i,h}(\rho _h)dx\nonumber \\&=\gamma _i, \ i=1,2,\ldots ,k. \end{aligned}$$
(104)

Taking the limitation of (104) as \(h\rightarrow 0\), with (84), (95), (100) and (9) (replacing \(\rho \) by \(\rho ^*\)), we obtain

$$\begin{aligned} 0= \int _\Omega \nabla u_{k+1}(\rho ^{*})\nabla u_{i}(\rho ^{*})dx&=\gamma _i, \ i=1,2,\ldots ,k. \end{aligned}$$
(105)

Therefore, \( {\mathcal {R}}_h u_{k+1}(\rho ^{*})\equiv 0\). By (84), it implies that \(u_{k+1}(\rho ^{*})\equiv 0\), which contradicts the definition of a nontrivial eigenfunction.

By (74) and (102), we have

$$\begin{aligned} \lambda _{k+1,h}(\rho _h)&=\dfrac{\int _{\Omega } \vert \nabla u_{k+1,h}(\rho _h)\vert ^{2}\,dx}{\int _{\Omega }\rho _h u_{k+1,h}^{2}(\rho _h)\,dx}\nonumber \\&=\min _{V_{k+1}\subset V_h,\ \dim (V_{k+1})=k+1}\max _{u_h\in V_{k+1}}\frac{\int _\Omega \vert \nabla u_h \vert ^2 dx }{\int _\Omega \rho _h u_h^2 dx}\nonumber \\&\le \underset{u_h\in span\left\{ u_{1,h}(\rho _h), u_{2,h}(\rho _h),\ldots ,u_{k,h}(\rho _h),{\mathcal {R}}_h u_{k+1}(\rho ^*)\right\} }{\max }\frac{\int _\Omega \vert \nabla u_h \vert ^2 dx }{\int _\Omega \rho _h u_h^2 dx}\nonumber \\&=\frac{\int _\Omega \vert \nabla {\tilde{u}}_h \vert ^2 dx }{\int _\Omega \rho _h {\tilde{u}}_h^2 dx}. \end{aligned}$$
(106)

Let \({\tilde{u}}_h=\beta _{1}u_{1,h}(\rho _h)+\beta _{2}u_{2,h}(\rho _h)+,...,\beta _k u_{k,h}(\rho _h)+\beta _{k+1} {\mathcal {R}}_h u_{k+1}(\rho ^{*})\). By (78), (95), (100), (84), \(\rho _h{\mathop {\rightharpoonup }\limits ^{*}} \rho ^{*} \ in \ L^{\infty }(\Omega )\) as \(h\rightarrow 0\) and (9) (replacing \(\rho \) by \(\rho ^*\)), we have

$$\begin{aligned} \int _{\Omega }\vert \nabla {\tilde{u}}_h\vert ^{2}\,dx&=\sum \limits _{j=1}^{k}\beta _{j}^{2}\int _{\Omega }\vert \nabla u_{j,h}(\rho _h)\vert ^{2}\,dx+\beta _{k+1}^{2}\int _{\Omega }\vert \nabla {\mathcal {R}}_h u_{k+1}(\rho ^{*})\vert ^{2}\,dx\nonumber \\&\quad +2\sum \limits _{j=1}^{k}\beta _{j}\beta _{k+1}\int _{\Omega }\nabla u_{j,h}(\rho _h)\nabla {\mathcal {R}}_h u_{k+1}(\rho ^{*})\,dx\nonumber \\&\rightarrow \sum \limits _{j=1}^{k}\beta _{j}^{2}\int _{\Omega }\vert \nabla u_{j}(\rho ^{*})\vert ^{2}\,dx+\beta _{k+1}^{2}\int _{\Omega }\vert \nabla u_{k+1}(\rho ^{*})\vert ^{2}\,dx \quad \text {as } h\rightarrow 0 \end{aligned}$$
(107)

and

$$\begin{aligned} \int _{\Omega }\rho _h {\tilde{u}}_h^{2}\,dx&=\sum \limits _{j=1}^{k}\beta _{j}^{2}\int _{\Omega }\rho _h u_{j,h}^{2}(\rho _h)dx+\beta _{k+1}^{2}\int _{\Omega } \rho _h ({\mathcal {R}}_h u_{k+1}(\rho ^{*}))^{2}dx\nonumber \\&\quad +2\sum \limits _{j=1}^{k}\beta _{j}\beta _{k+1}\int _{\Omega }\rho _h u_{j,h}(\rho _h) {\mathcal {R}}_h u_{k+1}(\rho ^{*})dx\nonumber \\&\rightarrow \sum \limits _{j=1}^{k}\beta _{j}^{2}\int _{\Omega }\rho ^{*}u_{j}^{2}(\rho ^{*})dx+\beta _{k+1}^{2}\int _{\Omega } \rho ^{*} u_{k+1}^{2}(\rho ^{*})dx\quad \text {as } h \rightarrow 0. \end{aligned}$$
(108)

By (5) and (9) (replacing \(\rho \) by \(\rho ^*\)), (107) could be further evaluated by

$$\begin{aligned}&\sum \limits _{j=1}^{k}\beta _{j}^{2}\int _{\Omega }\vert \nabla u_{j}(\rho ^{*})\vert ^{2}\,dx+\beta _{k+1}^{2}\int _{\Omega }\vert \nabla u_{k+1}(\rho ^{*})\vert ^{2}\,dx\nonumber \\&= \sum \limits _{j=1}^{k}\beta _{j}^{2}\lambda _{j}(\rho ^{*})\int _{\Omega }\rho ^{*}u_{j}^{2}(\rho ^{*})\,dx+\beta _{k+1}^{2}\lambda _{k+1}(\rho ^{*})\int _{\Omega }\rho ^{*}u_{k+1}^{2}(\rho ^{*}) \,dx\nonumber \\&\le \lambda _{k+1}(\rho ^{*})\Big [ \sum \limits _{j=1}^{k}\beta _{j}^{2}\int _{\Omega }\rho ^{*}u_{j}^{2}(\rho ^{*})\,dx+\beta _{k+1}^{2}\int _{\Omega }\rho ^{*}u_{k+1}^{2}(\rho ^{*}) \,dx\Big ]. \end{aligned}$$
(109)

Combining (85), (106), (107), (108) and (109), it implies that

$$\begin{aligned} \lambda _{k+1}^*&=\lim _{h\rightarrow 0}\lambda _{k+1,h}(\rho _h)\le \lambda _{k+1}(\rho ^{*}). \end{aligned}$$
(110)

With (101) and (110), we obtain \(\lambda _{k+1}^{*}=\lambda _{k+1}(\rho ^{*})\). The eigenfunction \(u_{k+1}^{*}\) corresponding to \(\lambda _{k+1}^{*}\) is also the eigenfunction corresponding to \(\lambda _{k+1}(\rho ^{*})\). That is, \(u_{k+1}^{*} \in M (\lambda _{k+1}(\rho ^{*}))\). We set \(u_{k+1}(\rho ^{*})\in M (\lambda _{k+1}(\rho ^{*}))\) to satisfy \(u_{k+1}^{*}=u_{k+1}(\rho ^{*})\). By induction, we conclude that \(\lambda ^*_{i}=\lambda _{i}(\rho ^*), \ u^*_{i}=u_{i}(\rho ^*), \ i=1,2,\ldots , N\). Combined with (85) and (95), the proof is complete. \(\square \)

Lemma 4.5

(See [21, LEMMA 4.3]) \(C^\infty (\Omega )\) is weak-* dense in \(L^\infty (\Omega )\).

Theorem 4.2

Let \(\{\rho _h^*\}_{h>0}\) be a sequence of minimizers to the discrete minimization problem (72) and (73). Then each subsequence of \(\{\rho _h^*\}_{h>0}\) has a subsequence converging to a minimizer of the continuous optimization problem (10) and (4).

Proof

The uniform boundedness of the sequence \(\rho _h^*\) in \(L^\infty (\Omega )\) implies that there exists a subsequence, also denoted by \(\rho _h^*\), and some \(\rho ^*\) such that

$$\begin{aligned} \rho _h^*{\mathop {\rightharpoonup }\limits ^{*}} \rho ^{*} \ \mathrm{\ in }\ L^\infty (\Omega )\ \textrm{as}\ h\rightarrow 0. \end{aligned}$$
(111)

Lemma 4.4 implies that

$$\begin{aligned} \lambda _{i,h}(\rho _h^*)\rightarrow \lambda _i(\rho ^*)\ \textrm{as}\ h\rightarrow 0. \end{aligned}$$
(112)

By Lemma 4.5, for any \(\rho \in {\mathcal {A}}\) and fixed \(\delta >0\), there exists a \(\rho ^{\delta }\in C^\infty (\Omega )\) such that

$$\begin{aligned} \rho ^\delta {\mathop {\rightharpoonup }\limits ^{*}} \rho \ \ \mathrm{\ in }\ L^\infty (\Omega )\ \textrm{as}\ \delta \rightarrow 0. \end{aligned}$$
(113)

By its construction, \(\rho ^{\delta }\in {\mathcal {A}}\). Let \(\rho _h^{\delta }={\mathcal {I}}_h\rho ^{\delta }\in {\mathcal {A}}_h\). By (83) and Lemma 4.4, we have

$$\begin{aligned} \lambda _{i,h}(\rho _h^\delta )\rightarrow \lambda _i(\rho ^\delta )\ as\ h\rightarrow 0. \end{aligned}$$
(114)

Noting that \(\rho _h^*\) is the minimizer of \(F_h(\cdot )\) over \({\mathcal {A}}_h\), we have

$$\begin{aligned} F_h(\rho _h^*)&=\frac{1}{2} \sum _{i=1}^{N}(\lambda _{i,h}(\rho _h^*)-{\widehat{\lambda }}_i)^2+\frac{\varepsilon }{2}\int _\Omega (\rho _h^*)^2 dx\nonumber \\&\le F_h(\rho _h^\delta )=F_h({\mathcal {I}}_h\rho ^\delta ). \end{aligned}$$
(115)

Thus, by (112), (115), (114) and the lower semicontinuity of a norm, we have

$$\begin{aligned} F(\rho ^*)&=\frac{1}{2} \sum _{i=1}^{N}(\lambda _i(\rho ^*)-{\widehat{\lambda }}_i)^2+\frac{\varepsilon }{2}\int _\Omega (\rho ^*)^2 dx\\&\le \lim _{h\rightarrow 0}\frac{1}{2} \sum _{i=1}^{N}(\lambda _{i,h}(\rho _h^*)-{\widehat{\lambda }}_i)^2+{\liminf _{h\rightarrow 0}} \ \frac{\varepsilon }{2}\int _\Omega (\rho ^*_h)^2 dx\\&\le {\liminf _{h\rightarrow 0}}\ F_h(\rho ^*_h) \le {\liminf _{h\rightarrow 0}}\ F_h({\mathcal {I}}_h\rho ^\delta ) \ \\&={\liminf _{h\rightarrow 0}} \big [\frac{1}{2} \sum _{i=1}^{N}(\lambda _{i,h}(\rho _h^\delta )-{\widehat{\lambda }}_i)^2+\frac{\varepsilon }{2}\int _\Omega (\rho ^\delta _h)^2 dx\big ]\\&\le \frac{1}{2} \sum _{i=1}^{N}(\lambda _{i}(\rho ^\delta )-{\widehat{\lambda }}_i)^2+\frac{\varepsilon }{2}\int _\Omega (\rho ^\delta )^2 dx \end{aligned}$$

Letting \(\delta \) tend to zero, we obtain that

$$\begin{aligned} F(\rho ^*)\le \frac{1}{2} \sum _{i=1}^{N}(\lambda _{i}(\rho )-{\widehat{\lambda }}_i)^2+\frac{\varepsilon }{2}\int _\Omega \rho ^2 dx.\ \end{aligned}$$

Therefore, \(\rho ^*\) is a minimizer of \(F(\rho )\). \(\square \)

5 Algorithm

For \(\rho \in {\mathcal {A}} \) and \(i=1,2,\ldots ,N,\) if eigenvalues \(\lambda _i(\rho )\) of (4) are simple, we solve the optimization problem (10) and (4) by the Fletcher–Reeves conjugate gradient algorithm [22]. That is, with the Fr\(\acute{e}\)chet derivative (59), the decent direction is set by

$$\begin{aligned} d_{k}=-F^{\prime }(\rho ^{(k)})+\beta _{k-1}d_{k-1}. \end{aligned}$$
(116)

With the Fletcher–Reeves scheme [22], the conjugate coefficient \(\beta _{k-1}\) is given by

$$\begin{aligned} \beta _{k-1}=\dfrac{\Vert F^{\prime }(\rho ^{(k)})\Vert ^{2}_{L^{2}(\Omega )}}{\Vert F^{\prime }(\rho ^{(k-1)})\Vert ^{2}_{L^{2}(\Omega )}} \end{aligned}$$
(117)

and \(\beta _{-1}=0.\) The step length \(\alpha _{k}\) in the conjugate direction \(d_{k}\) is determined by

$$\begin{aligned} \alpha _{k} = \arg \min _\alpha F(\rho ^{(k)}+\alpha d_{k}). \end{aligned}$$

In our numerical algorithm, by taking the derivative of \(F(\rho ^{(k)}+\alpha d_{k})\) with respect to \(\alpha \) and setting it to be zero, the step length \(\alpha _{k}\) is approximated by

$$\begin{aligned} \alpha _{k} =-\dfrac{F^{\prime }(\rho ^{(k)})[d_{k}]}{\sum _{i=1}^{N}(\lambda ^{\prime }(\rho ^{(k)})[d_{k}])^{2}+\varepsilon \Vert d_{k} \Vert ^{2}_{L^{2}(\Omega )}}. \end{aligned}$$
(118)

Now, we summarize the Fletcher–Reeves conjugate gradient algorithm as follows:

Algorithm 5.1

STEP 1. Initialize the density function \(\rho ^{(0)}\), and set the regularity coefficient \(\varepsilon \) and the input data \({\widehat{\lambda }}_i,i=1,2,\ldots , N.\)

STEP 2. Solve the eigenpairs \((\lambda _i(\rho ^{(k)}),u_{i}(\rho ^{k})),i=1,2,\ldots , N\) of (4).

STEP 3. Determine the gradient \(F^{\prime }(\rho ^{(k)})\) by (59) and calculate the descent direction \(d_{k}\) by (116) and (117).

STEP 4. Calculate the step length \(\alpha _{k}\) by (118).

STEP 5. Update the density function \(\rho ^{(k)}\) by

$$\begin{aligned} \rho ^{(k+1)}=\rho ^{(k)}+\alpha _{k}d_{k}. \end{aligned}$$

STEP 6. Set \(k=k+1\) and go to STEP 2. Repeat the procedure until a stopping criterion is satisfied.

Remark 5.1

In the numerical experiments, the stopping criterion is set that the norm of the decent direction is small enough. That is, if \(\vert \vert d_{k}\vert \vert _{L^2(\Omega )}<\delta \), where \(\delta \) is a given number, the iteration of the Fletcher–Reeves conjugate gradient algorithm is stopped.

6 Numerical Results

In this section, we present numerical results of the optimization problem (10) and (4) in 1D and 2D cases. The domain is partitioned into uniform meshes. The piecewise linear (bilinear) basis functions are used. The noisy data is generated by using the following formula:

$$\begin{aligned} {\widehat{\lambda }}_i(x)=\lambda _{i}(x)(1+\sigma \zeta ) \ \text { in } \Omega , i=1,2,\ldots , N \end{aligned}$$

where \(\zeta \) is a uniformly distributed random variable in \( [-1,1]\) and \(\sigma \) dictates the level of noise. The eigenpairs of (4) are solved by eigs found in MATLAB. The Algorithm 5.1 is conducted in MATLAB codes.

6.1 1D Case

Set the domain \(\Omega =(0,\pi )\), which is uniformly partitioned into 2000 elements. The exact density function is set by

$$\begin{aligned} \rho (x)=\left\{ \begin{array}{ll} 1+e^{-\frac{128}{9\pi ^{2}-256(x-\frac{\pi }{2})^{2}}}, &{}\frac{5\pi }{16}{<} x {<} \frac{11\pi }{16},\\ 1 , &{}\quad \text { otherwise}. \end{array} \right. \end{aligned}$$
(119)

The first 5 least eigenvalues with noise level \(\sigma =0.001\) are listed in the first row of Table 1 and used as the input data. Set \(\varepsilon =10^{-6}\) and \( \delta =10^{-4}\). With the initialization of density function \(\rho ^{(0)}=1\) in the whole domain (see the dash line in Fig. 1a), the evolutions of density function are illustrated in Fig. 1, after \(k=10,~20,~30,~50,~156\) iterations. The solid curve represents the exact density function, while the dash curve represents the recovered density function. After 156 iterations, the curve of the recovered density function fits well with the one of the exact density function, but it has some oscillations. The initial and the finial first 5 least eigenvalues are listed in the second row and the third row of Table 1, respectively.

Table 1 The first 5 least eigenvalues for 1D case \((\sigma =0.001)\)
Fig. 1
figure 1

The evolutions of the density function with the first 5 eigenvalues as the input data. The noise level is \(\sigma =0.001\)

With more input data, the recovery of the density function is improved. Using the first 10 least eigenvalues as the input data (see Table 2), with the same setting parameters, the evolutions of density function are illustrated in Fig. 2, after \(k=10,~30,~50,~100,~483\) iterations. The solid curve represents the exact density function, while the dash curve represents the recovered density function. After 483 iterations, the recovered density function fits the exact one much better, compared to the numerical results shown in Fig. 1 using first 5 least eigenvalues as the input data. The initial and the finial first 10 least eigenvalues are listed in Table 2.

Table 2 The first 10 least eigenvalues for 1D case with continuous density \((\sigma =0.001)\)
Fig. 2
figure 2

The evolutions of the density function with the first 10 eigenvalues as the input data. The noise level is \(\sigma =0.001\)

Various levels of noise are considered. Set \(\sigma =0.001,0.005,0.01,0.02,\) respectively. Set \(\varepsilon =10^{-6}\) and \( \delta =10^{-4}\). With the first 5 small least eigenvalues as the input data, we initialize the density function \(\rho ^{(0)}=1\) in the whole domain. The final recovered density function are illustrated in Fig. 3, with \(\sigma =0.001,0.005,0.01,0.02,\) respectively. The solid curve represents the exact density function, while the dash curve represents the recovered density function. Note that the higher level of noise incurs the inaccuracy of the recovery of density function. It may be caused by the sensitivity of the eigenvalue to the variation of the density function.

Fig. 3
figure 3

The recovered density functions with different noise levels of input data

The measured spectral data with gaps are considered. As listed in the first row of Table 2, the eigenvalues \({\widehat{\lambda }}_1\), \({\widehat{\lambda }}_2\), \({\widehat{\lambda }}_3\), \({\widehat{\lambda }}_6\), \({\widehat{\lambda }}_9\) with noise level \(\sigma =0.001\) are chosen as the input data. Setting \(\varepsilon =10^{-6}\), \( \delta =10^{-4}\) and \(\rho ^{(0)}=1\) in the whole domain, the evolutions of density function are illustrated in Fig. 4, after \(k=10,~20,~30,~50,~94\) iterations. The solid curve represents the exact density function, while the dash curve represents the recovered density function. Compared to the numerical results shown in Fig. 1, it is observed that the first 5 least eigenvalues as the measured spectral data could recover the density function better than the 5 eigenvalues with gaps. After 94 iterations, the finial eigenvalues are \({\lambda }_1=0.91426600\), \({\lambda }_2=3.93801788\), \({\lambda }_3=8.47125761\), \({\lambda }_6=34.24481075 \), \({\lambda }_9=77.22502904\), respectively.

Fig. 4
figure 4

The evolutions of the density function with 5 eigenvalues with gaps as the input data. The noise level is \(\sigma =0.001\)

The discontinuous density case is also considered, which is defined by

$$\begin{aligned} \rho (x)=\left\{ \begin{array}{ll} 1+e^{-\frac{128}{9\pi ^{2}-128(x-\frac{\pi }{2})^{2}}}, &{}\frac{5\pi }{16}< x < \frac{11\pi }{16},\\ 1 , &{}\quad \text { otherwise}. \end{array} \right. \end{aligned}$$
(120)

The first 10 least eigenvalues with noise level \(\sigma =0.001\) are listed in the first row of Table 3 and used as the input data. Set \(\varepsilon =10^{-6}\) and \( \delta =10^{-4}\). With the initialization of density function \(\rho ^{(0)}=1\) in the whole domain (see the dash line in Fig. 5 (a)), the evolutions of density function are illustrated in Fig. 5, after \(k=10,~30,~50,~80,~368\) iterations. The solid curve represents the exact density function with discontinuity at \(x=\frac{5\pi }{16}\) and \( \frac{11\pi }{16}\), while the dash curve represents the recovered density function. After 368 iterations, the curve of the recovered density function fits well with the one of the exact density function at most part of the region \(\Omega =(0,\pi )\). It has some deviations in the vicinity of \(x=\frac{5\pi }{16}\) and \( \frac{11\pi }{16}\). The initial and the finial first 10 least eigenvalues are listed in Table 3.

Table 3 The first 10 least eigenvalues for 1D case with discontinuous density \((\sigma =0.001)\)
Fig. 5
figure 5

The evolutions of the density function with the first 10 eigenvalues as the input data. The noise level is \(\sigma =0.001\). The original density function is discontinuous

6.2 2D Case

Set the domain \(\Omega =(0,\pi /a)\times (0,\pi )\) with \(a=\sqrt{0.9}\). It is uniformly partitioned into \(100\times 100\) rectangular elements. The exact density function is set by

$$\begin{aligned} \rho (x)=\left\{ \begin{array}{ll} 1+e^{-\frac{128}{9\pi ^{2}-64(x_1-\frac{\pi }{2a})^{2}-256(x_2-\frac{\pi }{2})^{2}}}, &{}(x_1-\frac{\pi }{2a})^{2}+4(x_2-\frac{\pi }{2})^{2}{<} \frac{9\pi ^2}{64},\\ 1 , &{}\quad \text { otherwise}. \end{array} \right. \end{aligned}$$
(121)

The first 10 least eigenvalues with noise level \(\sigma =0.001\) are listed in the Table 4 and used as the input data. Set \(\varepsilon =10^{-8}\) and \( \delta =10^{-4}\). The exact density function is illustrated in Fig. 6a. With the initialization of density function \(\rho ^{(0)}=1\) in the whole domain (see Fig. 6b), the evolutions of density function are illustrated in Fig. 6, after \(k=10, ~30,~50,~165\) iterations. After 156 iterations, the recovered density function fits the exact one well. The initial and the finial first 10 least eigenvalues are listed in the Table 4.

Various levels of noise are considered. Set \(\sigma =0.001,0.005,0.01,0.02,\) respectively. Set \(\varepsilon =10^{-8}\) and \( \delta =10^{-4}\). With the first 10 small least eigenvalues as the input data and with the initialization of the density function \(\rho ^{(0)}=1\) in the whole domain, the final recovered density functions are illustrated in Fig. 7.

Table 4 The first 10 least eigenvalues for 2D case \((\sigma =0.001)\)
Fig. 6
figure 6

The exact and the recovered density function after \(k=0, ~10, ~30,~50,~165\) iterations with the first 10 eigenvalues as the input data. The noise level is \(\sigma =0.001\)

Fig. 7
figure 7

The recovered density functions with different noise levels of input data

7 Conclusions

The inverse eigenvalue problem for a weighted Helmholtz equation is investigated. The continuity of the eigenvalue and the eigenfunction with respect to the density function is proved by induction. Then the properties of existence, stability and Fr\(\acute{e}\)chet derivative of the continuous optimization problems are established. The finite element method is applied to solve the weighted Helmholtz equation. The convergence of the discrete i-th eigenpair to the continuous i-th eigenpair is proved. The properties of existence and the convergence of the discrete optimization problems are derived. A conjugate gradient algorithm is proposed. In the numerical experiments, reconstructions of continuous density function from different input eigenvalue data are discussed, including the first 5 least eigenvalues, the first 10 least eigenvalues and 5 eigenvalues with gaps. Also, the reconstruction of a discontinuous density function from the first 10 least eigenvalues as the input data is investigated. The proposed algorithm has the capacity to reconstruct the density function efficiently, especially for the cases that the density function is continuous and the input eigenvalue data are the first few least ones without gaps.