1 Introduction

The Trefftz functions method (T-functions method) is used for solving linear partial differential equations. The approximation of the solution is in the form of a linear combination of the functions satisfying the equation identically. The coefficients of the combination are determined based on known initial-boundary conditions. The method was first described in 1926 in the paper (Trefftz 1926). The next stage of the method’s development falls on the 70s, when the works of Herera, Sabina, Kupradze, Jirousek, Leon, Zieliski and Zienkiewicz were published. These authors discussed mostly stationary problems, i.e., without the time. The non-stationary problems are brought down to stationary by the discretization of the time. The first paper devoted to the Trefftz functions in which the time is considered as a continuous variable, discussed a one-dimensional (one spatial variable) heat conduction equation (Rosenbloom and Widder 1956). This aspect of the Trefftz functions method was developed for the heat conduction problems in the papers (Ciałkowski et al. 1999, 2007; Yano et al. 1983) for the wave equation and thermoelasticity problems in the papers (Grysa and Maciag 2011; Maciag 2004, 2005, 2007, 2011; Maciag and Wauer 2005a, b) and for the equation of a plate vibration in the paper (Maciag 2011). So far, also monographs concerning the Trefftz method have been published (Ciałkowski and Fra̧ckowiak 2000; Grysa 2010; Kołodziej and Zieliński 2009; Li et al. 2008; Maciag 2009; Qing-Hua 2000). Source identification problem has been considered by different authors. For example in the paper (Kuo et al. 2013) time-dependent heat source for a one-dimensional heat conduction equation was identified. Source identification for an Euler–Bernoulli beam equation was considered for example in Liu (2012) and Hasanov (2009).

This very paper is a significant development and supplement of the work (Al-Khatib et al. 2008), in which recurrent formulas for the Trefftz functions for a homogenous beam vibration equation were derived. A particularly important advantage of the presented method is its usefulness for solving inverse problems. Many types of such problems exist. The most often described and used include boundary inverse problems (identification of boundary conditions) and identification of the sources, i.e., looking for the function describing the inhomogeneity in the equation (identification of the load).

Although there are many methods of solving direct problems for the Bernoulli–Euler linear equation of a beam vibration, no satisfactory method of solving an inverse case of the problem exists. Generally, inverse problems are ill-posed, which result in a great sensitivity of the solutions to the disturbances in the input data. The papers published hitherto show a high effectiveness of the Trefftz functions method for solving inverse problems for the heat conduction equation, wave equation and for thermoelasticity problems. This very paper confirms its usefulness for solving inverse problems for the beam vibration equation.

2 Stating the problem

Let us consider an inhomogeneous beam vibration equation

$$\begin{aligned} \frac{\partial ^{4} u}{\partial x^{4}} +\frac{1}{a^{2}} \frac{\partial ^{2} u}{\partial \tau ^{2}}=Q(x,\tau ), \quad \mathrm{for}\ x\in (0,1), \tau >0, \end{aligned}$$
(1)

where function \(Q(x,\tau )\) describes the load, \(a^{2}=\frac{EJ}{\rho S} \); \(E[\frac{N}{m^2}]\) is the coefficient of elasticity (Young’s modulus), \(J[m^4]\) is the inertia moment of the beam cross-section, \(S[m^2]\) is the surface of the beam cross-section and \(\rho [\frac{kg}{m^3}]\) is the beam density. Next, defining new time variable as \(t=a\tau \) we get the Eq. (1) in dimensionless coordinates:

$$\begin{aligned} \frac{\partial ^{4} u}{\partial x^{4}}+\frac{\partial ^{2} u}{\partial t^{2}} =Q(x,t), \quad {\text {for}}\ x\in (0,1), t>0. \end{aligned}$$
(2)

In the case of a direct problem, Eq. (2) should be complemented with proper initial and boundary conditions. The initial conditions describe the initial deflection of the beam and its velocity. The boundary conditions on borders \(x=0\) and \(x=1\) depend on the way of its attachment.

In the case of a boundary inverse problem, the conditions on one of the borders are unknown. Instead, the values of the deflection of the beam at a specific point within the interval \((0,1)\) are known. They are the so-called internal responses. In the case of identification of the load \(Q(x,y)\), we will assume that the boundary conditions are known, while function \(Q(x,y)\) itself remains unknown.

3 The properties of the Trefftz functions

Two methods exist for obtaining T-functions for the inhomogeneous beam vibration equation. The first of them is based on the usage of a generating function. In the second one, a function satisfying the homogenous beam vibration equation is expanded into the Taylor series. Both methods were presented in paper (Al-Khatib et al. 2008), which included formulas concerning the Trefftz functions and their derivatives for the beam vibration equation. Table 1 presents illustrative beam polynomials of up to fifth degree, obtained in paper (Al-Khatib et al. 2008). Table 1 suggests that there are exactly two beam polynomials of degree \(n\) (\(n>0\)). A particularly important property of them is the linear independence, which is the content of Theorem 3.1.

Table 1 Beam polynomials of degree from one to five

Theorem 3.1

To an accuracy of the polynomial of third degree, two linearly independent beam polynomials of degree \(n\), \(n>0\) exist.

Proof

Let us denote \(u_{n}\) as a linear combination of two variables of degree \(n\), which is determined by the following formula:

$$\begin{aligned} u_{n}=\alpha _{n0} x^{n}+\alpha _{\left( n-1\right) 1} x^{n-1} t+\cdots +\alpha _{1\left( n-1\right) } xt^{n-1} +\alpha _{0n} t^{n}+R, \end{aligned}$$
(3)

where \(\alpha _{pq}\) are the coefficients of monomials of degree \(n\), \(R\)-polynomial of two variables of degree lower than \(n\). It is clear that the coefficients \(\alpha _{pq}\) can be presented in the following form:

$$\begin{aligned} \alpha _{pq} =\frac{1}{p!q!} \frac{\partial ^{n} u_{n}}{\partial x^{p} \partial t^{q}}, \end{aligned}$$
(4)

where \(p=0,1,\ldots ,n\) and \(q=0,1,\ldots ,n\) such that \(p+q=n\).We will show that if \(u_{n} \) is a linear combination of beam polynomials, the coefficients \(\alpha _{pq}\) for \(q\ge 2\) equal zero. Using formula (4) and the homogenous beam vibration equation we obtain:

$$\begin{aligned} \alpha _{pq}&= \frac{1}{p!q!}\frac{\partial ^{n} u_{n}}{\partial x^{p} \partial t^{q}}=\frac{1}{p!q!}\frac{\partial ^{n-2}}{\partial x^{p} \partial t^{q-2}} \left( \frac{\partial ^{2} u_{n}}{\partial t^{2}} \right) \nonumber \\&= \frac{1}{p!q!} \frac{\partial ^{n-2}}{\partial x^{p} \partial t^{q-2}} \left( -\frac{\partial ^{4} u_{n}}{\partial x^{4}} \right) =-\frac{1}{p!q!} \frac{\partial ^{n+2} u_{n}}{\partial x^{p+4} \partial t^{q-2}} =0. \end{aligned}$$
(5)

Based on the equality (5), the linear combination of beam polynomials takes the form:

$$\begin{aligned} u_{n} =\alpha _{n0} x^{n} +\alpha _{\left( n-1\right) 1} x^{n-1}t+R, \end{aligned}$$
(6)

where \(R\) is the properly chosen polynomial. To obtain the polynomial \(R\) the operator \(L=\frac{\partial ^{4} }{\partial x^{4} } +\frac{\partial ^{2} }{\partial t^{2} } \) needs to be used for the Eq. (6). As a result we obtain:

$$\begin{aligned} L\left( \alpha _{n0} x^{n}+\alpha _{\left( n-1\right) 1} x^{n-1} t\right) +L(R)=0, \end{aligned}$$
(7)

and finally

$$\begin{aligned} R=L^{-1}\left( -L\left( \alpha _{n0} x^{n}+\alpha _{\left( n-1\right) 1} x^{n-1} t\right) \right) +L^{-1}\left( 0\right) . \end{aligned}$$
(8)

It follows that there are exactly two linearly independent beam polynomials of the degree \(n\). This ends the proof of the theorem. \(\square \)

4 The Trefftz function method

To determine the approximation of the solution of the inhomogeneous equation (2), we use a linear combination of the solving polynomials, which has the form:

$$\begin{aligned} u(x,t)\approx w(x,t)=\sum _{n=1}^{N}c_{n}V_{n}+w_{p} , \end{aligned}$$
(9)

where \(c_{n}\) is the linear combination of the coefficients, \(V_{n}\) is the Trefftz functions satisfying the homogenous beam vibration equation, \(w_{p}\) is the particular solution of the Eq. (2). To determine the coefficients of the linear combination of the polynomials \(V_{n}\) , we need to minimize the functional describing the fitting of the approximate solution to the given initial and boundary conditions.

The approximation of the particular solution \(w_{p}\) is determined by the inverse operator \(L^{-1} (Q)\), where \(L=\frac{\partial ^{4}}{\partial x^{4}} + \frac{\partial ^{2}}{\partial t^{2}} \). Expanding function \(Q(x,t)\) into the Taylor series we obtain:

$$\begin{aligned} L^{-1}(Q)&= L^{-1}\left( \sum _{n=0}^{N}\sum _{k+l=n} \frac{\partial ^{(k+l)} Q(x_{0}, t_{0})}{\partial x^{k} \partial t^{l} } \frac{\hat{x}^{k} \hat{t}^{l} }{k!l!}\right) \nonumber \\&= \sum _{n=0}^{N}\sum _{k+l=n}a_{kl}L^{-1}\left( \hat{x}^{k}\hat{t}^{l}\right) , \end{aligned}$$
(10)

where \(\hat{x}=x-x_{0}, \hat{t}=t-t_{0}\) and \(a_{kl} =\frac{1}{k!l!} \frac{\partial ^{(k+l)} Q(x_{0} ,t_{0})}{\partial x^{k}\partial t^{l}}\) for \(k=0,1,\ldots ,N\) and \(l=0,1,\ldots ,N\).

The inverse operator for monomials can be determined using the recurrent formulas, which are included in Theorem 4.1.

Theorem 4.1

Let us denote \(Z_{kl} =L^{-1} \left( x^{k} t^{l} \right) \). Then,

$$\begin{aligned} Z_{kl}^{1}=\frac{x^{k+4} t^{l} -l(l-1)Z_{\left( k+4\right) \left( l-2\right) }}{\left( k+4\right) \left( k+3\right) \left( k+2\right) \left( k+1\right) } \end{aligned}$$
(11)

or

$$\begin{aligned} Z_{kl}^{2}=\frac{x^{k} t^{l+2} -k(k-1)(k-2)(k-3)Z_{\left( k-4\right) \left( l+2\right) }}{\left( l+2\right) \left( l+1\right) }. \end{aligned}$$
(12)

In formulas (11) and (12) we put \(Z_{kl}=0\), if \(k\) or \(l\) is negative.

Proof

It is clear that \(L\left( Z_{kl} \right) =L\left( L^{-1} \left( x^{k} t^{l}\right) \right) =x^{k} t^{l}\). Using the operator \(L\) for formulas (11) and (12) we obtain, respectively:

$$\begin{aligned} L\left( Z_{kl}^{1} \right)&= \frac{\left( k+4\right) \left( k+3\right) \left( k+2\right) \left( k+1\right) x^{k} t^{l}}{\left( k+4\right) \left( k+3\right) \left( k+2\right) \left( k+1\right) }+\,\frac{l(l-1)x^{k+4} t^{l-2} }{\left( k+4\right) \left( k+3\right) \left( k+2\right) \left( k+1\right) } \\&\quad -\frac{l(l-1)x^{k+4} t^{l-2} }{\left( k+4\right) \left( k+3\right) \left( k+2\right) \left( k+1\right) } =x^{k} t^{l}, \end{aligned}$$

and

$$\begin{aligned} L\left( Z_{kl}^{2}\right)&= \frac{\left( l+2\right) \left( l+1\right) x^{k} t^{l}}{\left( l+2\right) \left( l+1\right) }-\frac{k(k-1)(k-2)(k-3)x^{k-4} t^{l+2} }{\left( l+2\right) \left( l+1\right) }\\&\quad +\,\frac{k\left( k-1\right) \left( k-2\right) \left( k-3\right) x^{k-4} t^{l+2}}{\left( l+2\right) \left( l+1\right) }=x^{k} t^{l}. \end{aligned}$$

This ends the proof of the theorem. \(\square \)

5 Examples

5.1 The solution of a direct problem for the inhomogeneous equation

To check the quality of the approximate solution obtained using the Trefftz functions, first we need to solve the problem for which the analytical solution is known. Let us consider an inhomogeneous beam vibration equation, which in the dimensionless coordinates has the form:

$$\begin{aligned} \frac{\partial ^{4} u}{\partial x^{4} }+\frac{\partial ^{2}u}{\partial t^{2}}=\frac{2\left( x^{4}-4x^{3}+6x^{2} \right) +24t^{2}}{2{,}000}, \quad \mathrm{for}\ x\in (0,1), t>0. \end{aligned}$$
(13)

Equation (13) has been complemented by the initial conditions:

$$\begin{aligned} u(x,0)=\frac{x^{2}}{1{,}000}\quad \frac{\partial u(x,0)}{\partial t} =0 \end{aligned}$$
(14)

and boundary conditions:

$$\begin{aligned} u(0,t)&= \frac{\partial u(0,t)}{\partial x}=0, \quad \mathrm{for}\ t>0,\end{aligned}$$
(15)
$$\begin{aligned} \frac{\partial ^{2} u(1,t)}{\partial x^{2}}&= \frac{\partial ^{3} u(1,t)}{\partial x^{3}} =0, \quad \mathrm{for}\ t>0, \end{aligned}$$
(16)

The conditions (15) point to a rigid attachment of the border \(x=0\), because neither the displacement nor the deflection of the beam occurs. The conditions (16) concern the loose end \(x=1\) and point to the lack of the load by the deflection and force moment. The solution of the problem (1316) is determined by the following equation:

$$\begin{aligned} u(x,t)=\sum _{n=1}^{\infty }\left( \frac{X_{n} (x)\cos \left( \lambda _{n}^{2} t\right) \int _{0}^{1}X_{n} (x)\frac{x^{2}}{1{,}000}{\text {d}}x}{\left( \sin \left( \lambda _{n} \right) +\sinh \left( \lambda _{n}\right) \right) ^{2}}\right) +\frac{t^{2}\left( x^{4}-4x^{3}+6x^{2}\right) }{2{,}000}, \end{aligned}$$
(17)

where

$$\begin{aligned} X_{n}(x)&= \left( \cos (\lambda _{n})+\cosh (\lambda _{n})\right) \left( \sinh (\lambda _{n} x)-\sin (\lambda _{n} x)\right) \\&-\left( \sin (\lambda _{n} )+\sinh (\lambda _{n})\right) \left( \cosh (\lambda _{n} x)-\cos (\lambda _{n} x)\right) , \end{aligned}$$

while \(\lambda _{n}\) are the consecutive positive roots of the equation \(\cos \left( x\right) \cosh \left( x\right) +1=0.\) It should be highlighted that the roots \(\lambda _{n} \) can only be determined numerically. It means that the analytical solution is in fact numerical and may be subject to some error.

To determine the approximation of the solution \(u(x,t)\) a linear combination of polynomials was used, together with the particular solution of the inhomogeneous equation (13), i.e.:

$$\begin{aligned} u(x,t)\approx w(x,t)=\sum _{n=1}^{N}c_{n} V_{n}+\frac{t^{2} \left( x^{4}-4x^{3} +6x^{2} \right) }{2{,}000}. \end{aligned}$$
(18)

The approximated solution of the problem is sought within the time interval \(\left( 0,1\right) \). The coefficients \(c_{n} \) are chosen so that the functional is minimized:

$$\begin{aligned} I&= \varpi _{1} \cdot \underbrace{\int _{0}^{1}\left( w(x,0)- \frac{x^{2}}{1{,}000}\right) ^{2}{\text {d}}x}_{{\text {condition}}(14)}+ \varpi _{1}\cdot \underbrace{\int _{0}^{1}\left( \frac{\partial w(x,0)}{\partial t}\right) ^{2} {\text {d}}x}_{{\text {condition}}(14)}\nonumber \\&\quad +\,\varpi _{2}\cdot \underbrace{\int _{0}^{1}\left( w(0,t)\right) ^{2} {\text {d}}t}_{{\text {condition}}(15)}+\varpi _{3} \cdot \underbrace{\int _{0}^{1}\left( \frac{\partial w(0,t)}{\partial x} \right) ^{2} {\text {d}}t}_{{\text {condition}}(15)}\nonumber \\&\quad +\,\varpi _{3}\cdot \underbrace{\int _{0}^{1}\left( \frac{\partial ^{2} w(1,t)}{\partial x^{2}}\right) ^{2}{\text {d}}t+}_{{\text {condition}}(16)} \varpi _{3}\cdot \underbrace{\int _{0}^{1}\left( \frac{\partial ^{3} w(1,t)}{\partial x^{3}}\right) ^{2} {\text {d}}t,}_{{\text {condition}}(16)} \end{aligned}$$
(19)

where \(\varpi _{1}\), \(\varpi _{2}\), \(\varpi _{3}\)—weights.

Functional \(I\) contains weights, which enable us to decrease the error of approximation. The incorporation of the weights is justified, as individual parts of the functional have different values (usually the value of the function and its derivative differ). Moreover, the integration range can be different for different summands of the functional. If the time interval were very short then the fitting of the solution to the initial condition can be better than to the boundary condition. A different order of magnitude for the function and its derivative, as well as and different integration range can be taken into account using weights. If we know these quantities, we can choose the values of the weight. The sum of the all weights should equal to one, i.e., \(2\varpi _{1}+\varpi _{2}+3\varpi _{3}=1\). The following values were taken for the calculations: \(\varpi _{1} =0.06,^{} \varpi _{2} =0.85,^{} \varpi _{3} =0.01\). The necessary condition for the minimization of the functional:

$$\begin{aligned} \frac{\partial I}{\partial c_1} = \frac{\partial I}{\partial c_2} = \cdots = \frac{\partial I}{\partial c_N} = 0, \end{aligned}$$
(20)

leads to the determination of the coefficients \(c_n\) in (18). Figure 1 presents the exact solution in the entire time–space domain and its approximation for the first 118 beam polynomials. Figure 2 depicts the free vibrations of the end \(x=1\) of the beam.

Fig. 1
figure 1

Solution in the entire time–space domain: a exact, b approximation by the first 118 beam polynomials (direct problem)

Fig. 2
figure 2

Vibrations of the end of the beam \((x=1)\)—exact solution and approximated by 118 T-functions (direct problem)

To determine the accuracy of the approximation of the vibration of the end of the beam \(u(1,t)\) for \(x=1\), the relative error in the norm \(L^2\) was determined, according to the following formula:

$$\begin{aligned} \varepsilon =\sqrt{\frac{\int _{0}^{1}\left( w(1,t)-u(1,t)\right) ^{2} {\text {d}}t}{\int _{0}^{1}\left( u(1,t)\right) ^{2} {\text {d}}t}} \cdot 100\,\%. \end{aligned}$$
(21)

In functional (19), the weights \(\varpi _{1}=0.06, \varpi _{2}=0.85, \varpi _{3} =0.01.\) were used. To examine the influence of weights the calculations without weight were made. Table 2 presents the error of the approximation of the vibrations of the end of the beam depending on the number of the polynomials used in both cases.

Table 2 The extent of the error of approximation (\(\varepsilon \) [%]) depending on the number of the polynomials

On the basis of the presented results, it can be observed that the increase in the number of polynomials results in the decrease of the error of approximation. The uncertainties obtained stay on a low level and are satisfactory. In the direct problem the influence of the weights in almost negligible.

In engineering practice, the time \(t\le 1\) is too small. Unfortunately, the Trefftz method requires all variables less than 1 (in the Trefftz polynomials appear powers of all variables). It is not a problem for the spatial variable which can be simply reduced to the interval \((0,1)\) by introducing dimensionless length. But for \(t>1\), the iterations have to be used. In the first time interval \((0,1)\) the solution is calculated similarly as above. Next, the value of the obtained solution and its derivative for \(t=1\) are initial conditions for the next time interval; similarly for the next time intervals. Table 3 presents the error of the approximation of the vibrations of the end of the beam in successive time steps.It is visible that the error stay still at the low level.

Table 3 The extent of the error of approximation (\(\varepsilon \) [%]) in successive time steps

5.2 The solution of the inverse problem

In the inverse problem, the behavior of the free end of the beam will be tested. Similarly as for the direct problem, we will consider the movement equation (13) complemented by initial and boundary conditions (14) and (15), respectively. We assume that the conditions (16) are unknown. Instead, we know the internal responses (22), obtained from the exact solution (17) for \(x=0.9\):

$$\begin{aligned} u(0.9,t_{i} )\quad \mathrm{and}\quad \frac{\partial u(0.9,t_{i} )}{\partial x},\quad i=1,\ldots ,K \end{aligned}$$
(22)

where \(t_{i}\) denotes the time moment. It means that we look for the solution for \(x=1\), not knowing any of the boundary conditions at this end of the beam. Such case belongs to the category of boundary inverse problems. This problem was solved in entire domain and by means of nodeless finite elements method.

5.2.1 The solution in the entire domain

The exact solution \(u(x,t)\) is approximated according to formula (18). The coefficients \(c_{n} \) of the linear combination are determined by minimizing suitable functional [similar to (19)]. Figure 3 shows the free vibrations of the end of the beam \(x=1\) and approximation obtained by means of first 58 beam polynomials and the number of measurements \(K=51\). Based on formula (21), a mean relative error of the approximation of the vibrations of the end of the beam \(u(1,t)\) was determined. Similarly as before, the influence of the weights was checked. The results are presented in Table 4. Generally, the result presented in Table 4 can be regarded as satisfactory for the inverse problem. In this case, the influence of the weights is significant, especially for the large number of polynomials. Namely, at first the error decreases, while for more polynomials it increases. It can be caused by the so-called Runge effect—waving the polynomials of the high degree at the end of the considered interval. Comparing the uncertainty of the approximation of the beam vibration in Tables 2 and 4, one can observe that they are similar for the direct and inverse problems. Similarly as before, it is interesting how the solution behaves in the next time steps. Table 5 presents the error of the approximation of the vibrations of the end of the beam (inverse problem) in successive time steps.Comparing the values presented in Tables 3 and 5, one can observe that the error for inverse problem is negligible bigger, but stay at the low level.

Fig. 3
figure 3

The vibrations of the end of the beam \((x=1)\)—exact solution and approximation by 58 beam polynomials (inverse problem)

Table 4 A mean relative error of approximation (\(\varepsilon \) [%]) depending on the number of beam polynomials
Table 5 The extent of the error of approximation (\(\varepsilon \) [%]) in successive time steps (inverse problem)

As mentioned above, inverse problems are ill-posed, which means that they are highly sensitive to the disturbances of the input data. Therefore, each method’s sensitivity to these disturbances needs to be tested. To this end, the displacements and deflections of the beam in the point \(x=0.9\) were disturbed by a random error, according to the following formulas:

$$\begin{aligned} u_\mathrm{dis}(0.9,t_{i})&= u(0.9,t_{i})\cdot (1+{\delta }_{i}),\end{aligned}$$
(23)
$$\begin{aligned} \frac{\partial u_{{\text {dis}}}(0.9,t_{i} )}{\partial x}&= \frac{\partial u(0.9,t_{i} )}{\partial x}\cdot (1+{\delta }_{i}) , \end{aligned}$$
(24)

where \({\delta }_{i}\) has a normal distribution with mean 0 and standard deviation 0.02. Internal responses generated in such a method were used for determining the exact solution \(u(x,t)\).

Similarly as for the undisturbed data, the approximation was determined using a linear combination of beam polynomials (18). The extent of the errors of the vibrations’ approximation of the end of the beam \(u(1,t)\) was presented in Table 6. Comparing Tables 4 and 6 it is clearly seen that in most cases the disturbance of the measurements results only in a slight increase of the relative error of approximation. This proves the method’s invulnerability to the random disturbance of the data.

Table 6 The relative error of approximation (\(\varepsilon \) [%]) for the disturbed internal responses

5.2.2 Nodeless finite elements method

Solving polynomials can be used as the base functions in finite elements method. Such approach for solving direct problems for homogeneous beam vibration equation has been described in the paper (Al-Khatib et al. 2008). Here, this technique was used to solve boundary inverse problem. The approximate solution is looked for \((x,t)\in (0,1)\times (0,1)\) but now we divide time–space domain into elements \(((k-1)\cdot \Delta x,k\cdot \Delta x)\times ((l-1)\cdot \Delta t, l\cdot \Delta t)\) where \(k=1,\ldots ,K\) and \(l=1,\ldots ,L\). Here, \(K\) denotes the number of spatial subintervals and \(L\) denotes the number of time steps. Of course \(K\cdot \Delta x=L\cdot \Delta t=1\). The exact solution \(u(x,t)\) is approximated in each time–space subregion according to formula (18). The procedure of obtaining the coefficients of the linear combination has been described in paper (Al-Khatib et al. 2008). To obtain necessary coefficients suitable functional has to be minimized. The weights used in this functional are the same as for solution in entire time–space domain. The error of approximation can be calculated based on formula (21). Table 7 presents values of this error depending on the number of beam polynomials, the number of spatial subintervals \(K\) and the number of time steps \(L\).Analyzing results presented in Tables 4 and 7 we can notice some observations:

  • increasing number of polynomials decreases the error,

  • in most cases increasing number of subregions decreases the error,

  • number of polynomials is more important than number of subregions. It means that we can use big time–space elements and the accuracy of the solution can be improved by taking more base functions into account. This conclusion is very significant if we solve inverse problems,

  • dividing entire domain into time–space elements enables decreasing number of polynomials used in approximation,

  • the error at the level 0.91 % can be regarded as satisfactory for the inverse problem.

Table 7 A mean relative error of approximation (\(\varepsilon \) [%]) depending on the number of beam polynomials, the number of spatial subintervals \(K\) and the number of time steps \(L\)

5.3 Identification of the load imposed on the beam: an inverse problem

The Trefftz function method may be used for the identification of the load \(Q(x,t)\). Similarly as in the previous cases, we consider the inhomogeneous equation of the beam vibration, which has the following form:

$$\begin{aligned} \frac{\partial ^{4} u}{\partial x^{4}}+\frac{\partial ^{2}u}{\partial t^{2}}=Q(x,t),\ \quad \mathrm{for}\ x\in (0,1),\ t>0, \end{aligned}$$
(25)

where function \(Q(x,t)=\frac{2\left( x^4-4x^3+6x^2 \right) +24t^2}{2{,}000}\) is the identified load. Equation (25) was complemented with the initial-boundary conditions (1416). In addition, we assume that the values of deflection of the beam in nine points, placed uniformly within the domain (0,1), are known. The values of the sought function inside the spatial area are in practice determined in the chosen time moments. Therefore, we assume that the values of the beam deflection are measured in nine chosen points with the time step \({\Delta }t=0.02\). As a consequence, the internal responses are known:

$$\begin{aligned} u_{ij}=u \left( 0.1 \cdot i, 0.02 \cdot j \right) , \quad i=1, \ldots , 9, \quad j = 1, \ldots , 50. \end{aligned}$$
(26)

The approximation of the solution \(u(x,t)\) was determined on the basis of the following formula:

$$\begin{aligned} u(x,t)\approx w(x,t)=\sum _{n=1}^{N}c_{n}V_{n}+\sum _{k=1}^{K}\alpha _{k}v_{k}, \end{aligned}$$
(27)

where \(v_{k} \) denotes an inverse operator for a proper monomial from such set:

$$\begin{aligned} \{1,x,t,x^{2},t^{2},xt\} . \end{aligned}$$
(28)

Then, the approximation of function \(Q(x,t)\) takes the form:

$$\begin{aligned} Q(x,t)\approx L\left( \sum _{k=1}^{K}\alpha _{k} v_{k} \right) . \end{aligned}$$
(29)

To determine the coefficients \(c_{n}\) and \(\alpha _{k}\) suitable functional is minimized. Figure 4 shows the surface presenting the beam load and its approximation obtained using 106 beam polynomials. Making use of the fact that we know the function \(Q(x,t)\)—determining the exact load of the beam—we are able to determine the approximation error. Let \(\tilde{Q}(x,t)\) denote the load approximation. Then, the mean relative error of the approximation can be determined on the basis of the following formula:

$$\begin{aligned} \varepsilon =\sqrt{\frac{\int _{0}^{1}\int _{0}^{1} \left( \tilde{Q}(x,t)-Q(x,t)\right) ^{2}{\text {dx dt}}}{\int _{0}^{1}\int _{0}^{1}\left( Q(x,t)\right) ^{2} {\text {dx dt}}}}\cdot 100\,\% . \end{aligned}$$
(30)

Table 8 shows the error of the approximation of the beam load depending on the number of polynomials used for the estimation. In the above calculations, the number of measurements with respect to the time \(M=50\) and with respect to space \(N=9\). Table 9 shows the values of error (30) depending on the number of measurements \(M\) and \(N\).In this case, the increase in the number of measurements with respect to the time improves the solution. The influence of the number of measurements with respect to space is less visible.

Fig. 4
figure 4

Beam load \(Q(x,t) = \frac{2 \left( x^4 - 4x^3 + 6x^2\right) +24t^2}{2,000}\): a exact, b identification obtained by 106 beam polynomials (inverse problem)

Table 8 The extent of the error of approximation depending on the number of polynomials
Table 9 The mean relative error of approximation (\(\varepsilon \) [%]) depending on the number of measurements \(M\) and \(N\)

The load of a beam has been calculated in next time step. Table 10 presents the error of the approximation of the load for \(x=1\) in successive time steps. It is visible that the error stays at the low level.

Table 10 The error of approximation of load for \(x=1\) in successive time steps

To test the sensitivity of the method to the error of the input data, the measurement data were disturbed by a random error, i.e.:

$$\begin{aligned} u_{ij}^d=u_{ij} \cdot \left( 1+{\delta }_j \right) ,\quad i=1, \ldots , 9,\, j = 1, \ldots , 50, \end{aligned}$$
(31)

where \({\delta }_j\) has a normal distribution with mean equalling 0 and standard deviation 0.02. Internal responses thus obtained were used for the determination of function \(Q(x,t)\). The error of approximation was determined on the basis of formula (30). The extent of this uncertainty was presented in Table 11. Comparing Tables 8 and 11 one can infer that also for this case the method is invulnerable for the disturbances of the measurement data. The usage of the weights is justified if the data are disturbed.

Table 11 Relative error of approximation obtained for the disturbed internal responses

6 Conclusions

In the paper, a simple method of solving direct and inverse problems described by an inhomogeneous equation of the beam vibration has been presented. The approximate solution is a linear combination of the functions satisfying identically the proper homogenous equation—they are called the Trefftz functions. A significant result of the paper is formulating and proving the theorem of the linear independence of the polynomials used. In the case of an inhomogeneous equation, the exact solution needs to be known. A way of obtaining such a solution has been presented in the paper. The greatest advantage of the method is its usability for solving the ill-posed inverse problems, which in general constitute a serious mathematical challenge. The paper proposes a method of solving two types of such problems: the boundary inverse problem and the identification of the load (the source). The examples presented show a remarkable efficiency of the method for solving these types of problems. In addition, the approach proposed here seems to be relatively invulnerable to the disturbance of the input data, which is a serious advantage in respect of inverse problems. What is also beneficial is the method’s mathematical simplicity—the Trefftz functions are generated by means of proper formulas, and the coefficients of the linear combination (which is an approximate solution) are determined by solving a linear system of equations.

The presented method is useful especially for solving inverse problems. Although it should obviously be developed further, it already has a few significant advantages. First, the Trefftz function can be used as a base function in the finite element method. In general, FEM is not suitable for solving inverse problems. In case of direct problems, smaller elements in FEM lead to better results. Unfortunately, this rule is not true regarding inverse problems. The finite element method gives good results for such problems only if the internal responses are located in the first layer from the border, which means that the elements should be relatively large. Then, however, in each element the quality of the approximation should be high. It can be achieved by means of Trefftz base function. The examples presented in the paper show that the usage of Trefftz base functions in nodeless finite element method leads to good results for inverse problems. Second, the method should be extended for solving nonlinear problems. Currently, this problem is still being investigated, and the first results are promising.