1 Introduction

The domain-agnostic mathematical representations and datafication require interpolation and regression of discrete data. Interpolation and regression of data play a significant role in many scientific disciplines. A data point, entity, object, etc. interacts with its surrounding media. In real life, data sets are mostly connected with surge of irregularities, breakages, and discontinuities. It is essential that interpolation and regression methods capture such irregularities and scatter within a set of discrete data in a multi-dimensional space. Also, they should transfer information among data sets representing multiple scales such as fine and coarse models.

Interpolation is an estimation of an unknown variable at output points (locations) by employing the known values at surrounding input points. Regression is an estimation of a variable at both input and output points by employing the known values at the surrounding input locations. Smoothing is an estimation of a variable at only known input points by employing the known input values. Smoothing may be necessary if the input data is noisy. The estimation of the unknown variable is based on interpolation passing through all the known input values. In other words, there is an exact recovery of the known values of the input points.

Although the idea of interpolation and regression seems to be rather rudimentary, it has a profound impact and forms one of the building blocks in science and engineering. Over the years, scientists have tried to elaborate on it through different methods as discussed by Franke [1], Mittas and Mitasova [2], and Steffensen [3].

The simplest interpolation method is the polynomial expansion. It requires the determination of the coefficients of a complete polynomial by using the known input values. The coefficients are determined such that the polynomial recovers the known values at the input points. Hence, a system of equations is generated to solve for the unknown coefficients. Although the polynomial form of interpolation is simple to apply, it is not practical if the number of input values is substantially high.

The Lagrangian functions can be employed to eliminate the process of solving a large system of equations. This approach generates a unique set of polynomials for each input point such that it is equal to the input value at the input point, and zero at all other points. Combination of the Lagrangian functions forms the interpolation. However, the input points must form a structured grid especially in two-dimensional applications in order generate a unique set of Lagrangian polynomials. As the number of input points increases, both the polynomial and Lagrangian forms of interpolations require high degree of polynomials leading to undesirable oscillations.

An alternative to the polynomial and Lagrangian interpolations is the spline interpolation in which a low-order polynomial passes through the adjacent points. The spline interpolation ensures the continuity of the polynomials at the input points. However, it also requires a structured grid configuration in two-dimensional applications; thus, it cannot be applied to scattered data points. Additional conditions may have to be imposed based on the nature of interpolation technique and the character of the data describing the phenomenon. As discussed by Cressie [4], these conditions may be based on geostatistical concepts (Kriging), locality (nearest neighbor), smoothness (splines), or functional forms (polynomials). These techniques yield satisfactory predictions for smooth variations without scatter.

Liszka and Orkisz [5] and Liszka [6] introduced a method to consider scattered data without using high degree of polynomials. The interpolation is achieved by employing the Taylor Series Expansion (TSE) about the output points. The TSE is truncated after the second order derivative terms. For each output point, a system of equations is established by enforcing the function (i.e., TSE) to match the value at the input points. Thus, it leads to a set of equations to solve for the unknowns at the output points. However, the values of the function at the output points are obtained via least squares minimization because the number of equations in the resulting system is more than the unknowns at the output points.

This study introduces a unified approach for interpolation and regression of data with irregularities and scatter in a multi-dimensional space based on the non-local Peridynamic Differential Operator (PDDO) within a set of discrete data and among data sets representing multiple scales. Also, the PD interpolation functions between fine- and coarse-level grids enable the reduction of number of unknowns in the analysis while retaining the accuracy associated with the fine grid.

The most common applications of interpolation and regression analyses with the existing methods are conducted in one- and two-dimensional spaces. The PDDO is not limited by the order of dimension. Also, the present approach is not restricted to any kind of spatial discretization. In addition, it is not limited for interpolating fields with C0 continuity. Furthermore, the evaluation of the determinant of very large matrices is not tractable due to memory, precision, and computational time requirements. The PD interpolation functions between the unknowns of the fine and coarse grids enable the reduction of the size of stiffness matrix and yet retain sufficient accuracy. It is worth noting that the PDDO is computationally more expensive than the existing methods when using a single processor; however, it is extremely suitable for GPU architecture. The computational speed will be the topic of a future study.

Subsequent sections present the PDDO operator and its use for interpolation and regression within a scale and between fine and coarse scales. The numerical results concern interpolation of real data in two and three dimensions, interpolation to approximate a three-dimensional function, adaptive data recovery in three-dimensional space, recovery of missing pixels in an image, adaptive image compression and recovery, and accurate evaluation of free energy. The model reduction is achieved by employing PD interpolation between fine and coarse grids. It is demonstrated by considering the thermal fluctuation of a rod.

2 Peridynamic Differential Operator

Recently, Madenci et al. [7] introduced the Peridynamic Differential Operator (PDDO) to approximate the non-local representation of a scalar field \(f=f(\mathbf{x})\) and its de'rivatives at point \({\mathbf{x}}\) by accounting for the effect of its interactions with the other points, \({\mathbf{x}}^{\boldsymbol{{\prime}}}\), in the domain of interaction, as shown in Fig. 1.

Fig. 1
figure 1

Interaction of peridynamic points, \(\mathbf{x}\) and \({\mathbf{x}}^{\boldsymbol{{\prime}}}\), with arbitrary family size and shape

The PDDO employs the concept of PD interactions, and the PD functions without performing any differentiation as explained by Madenci et al. [7, 8]. The PDDO requires the construction of PD functions. They are determined directly by making them orthogonal to each term in the Taylor Series Expansion (TSE). The derivation of the PDDO up to second-order derivatives of a function with two independent variables is presented in Appendix 1.

The major difference between the PDDO and other existing local and non-local numerical differentiation methods is that the PDDO leads to analytical expressions for arbitrary order derivatives in integral form for symmetric interaction domains. It provides accurate estimation of the function and its derivatives in the interior as well as the near the boundaries of the domain without any special boundary treatment. Also, the PD differentiation serves as a natural filter in the presence of noisy data, as it provides their derivatives [7, 8].

Each point has its own family members in the domain of interaction (family), and occupies an infinitesimally small entity such as volume, area, or a distance. The points \(\mathbf{x}\) and \({\mathbf{x}}^{\boldsymbol{{\prime}}}\) only interact with the other points in their own families, \({H}_{\mathrm{x}}\) and \({H}_{{\mathrm{x}}^{^{\prime}}}\), respectively. Neither point \(\mathbf{x}\) nor \({\mathbf{x}}^{\boldsymbol{{\prime}}}\) is necessarily symmetrically located in their interaction domains. The initial relative position, \(\xi\), between the material points \(\mathbf{x}\) and \({\mathbf{x}}^{\boldsymbol{{\prime}}}\) can be expressed as \(\xi ={\mathbf{x}}^{\boldsymbol{{\prime}}}-\mathbf{x}\). This ability permits each point to have its own unique family with an arbitrary position. Therefore, the size and shape of each family can be different, and they significantly influence the degree of non-locality. The degree of interaction between the material points in each family is specified by a non-dimensional weight function, \(w(\left|\xi \right|)\) which can vary from point to point. The interactions become more local with decreasing family size. Thus, the family size and shape are important parameters. In general, the family of a point can be non-symmetric due to non-uniform spatial discretization. The PDDO is not restricted to any kind of spatial discretization. The family points can be uniformly or arbitrarily spaced. Thus, the number of family members can vary depending on the discretization. The family members of point \(\mathbf{x}\) can be selected by simply retaining the neighboring points within a circle or by applying a family search method such as KD tree and clustering.

The PDDO for the N-th order derivative of a function \(f(\mathbf{x})\) with M dimensions can be expressed as

$$\frac{{\partial }^{{p}_{1}+{p}_{2}+\cdot \cdot \cdot +{p}_{N}}f(\mathbf{x})}{\partial {x}_{1}^{{p}_{1}}\partial {x}_{2}^{{p}_{2}}\cdot \cdot \cdot \partial {x}_{M}^{{p}_{N}}}=\underset{{H}_{\mathbf{x}}}{\overset{}{\int }}f(\mathbf{x}+{\varvec{\upxi}}){g}_{N}^{{p}_{1}{p}_{2}\cdot \cdot \cdot {p}_{N}}({\varvec{\upxi}})d{\xi }_{1}d{\xi }_{2}\cdot \cdot \cdot d{\xi }_{M}$$
(1)

in which \({p}_{i}\) denotes the order of differentiation with respect to variable \({x}_{i}\) with \(i=1,\dots ,M\), and \({g}_{N}^{{p}_{1}{p}_{2}\cdot \cdot \cdot {p}_{N}}({\varvec{\upxi}})\) are the PD functions explained in detail in a recent book by Madenci et al. [8].

They can be constructed as

$${g}_{N}^{{p}_{1}{p}_{2}\cdot \cdot \cdot {p}_{N}}\left({\varvec{\upxi}}\right)=\sum\limits_{{q}_{1}=0}^{N}\sum\limits_{{q}_{2}=0}^{N-{q}_{1}}\cdot \cdot \cdot \sum\limits_{{q}_{N}=0}^{N-{q}_{1}\cdot \cdot \cdot -{q}_{N-1}}{a}_{{q}_{1}{q}_{2}\cdot \cdot \cdot {q}_{N}}^{{p}_{1}{p}_{2}\cdot \cdot \cdot {p}_{N}}{\omega }_{{q}_{1}{q}_{2}\cdot \cdot \cdot {q}_{N}}(\left|{\varvec{\upxi}}\right|){\xi }_{1}^{{q}_{1}}{\xi }_{2}^{{q}_{2}}\cdot \cdot \cdot {\xi }_{M}^{{q}_{N}}$$
(2)

where \({\omega }_{{q}_{1}{q}_{2}\cdot \cdot \cdot {q}_{N}}(\left|{\varvec{\upxi}}\right|)\) is the weight function associated with each term \({\xi }_{1}^{{q}_{1}}{\xi }_{2}^{{q}_{2}}\cdot \cdot \cdot {\xi }_{M}^{{q}_{N}}\) in the polynomial expansion. The PDDO recovers the local differentiation as the size of family \({H}_{\mathbf{x}}\) decreases or the number of terms in the functions \({g}_{N}^{{p}_{1}{p}_{2}\cdot \cdot \cdot {p}_{N}}\left({\varvec{\upxi}}\right)\) increases.

The coefficients of the PD functions can be determined without any difficulty. Although it is not a limitation, the weight functions, \({\omega }_{{q}_{1}{q}_{2}\cdot \cdot \cdot {q}_{N}}(\left|{\varvec{\upxi}}\right|)\), in Eq. (2) can be replaced with \({\omega }_{n}(\left|{\varvec{\upxi}}\right|)\) for simplification based on the order of differentiation. A MATLAB code for performing PD differentiation for the N-th order derivative of a function with M dimensions is given by Madenci et al. [8].

3 Peridynamics for Estimation

This section provides the construction of functions for PD interpolation and regression. It is a unique framework for data estimation and data recovery. The PD interpolation estimates the unavailable data from the available data set while passing through all the available data. However, the PD regression does not necessarily pass through all the input points. The input data referred to as available data points can be uniformly or arbitrarily spaced without any restriction to spatial discretization. Therefore, the number of family members for each point can be different depending on the nature of the data. The contribution of each available data point is distributed to the unknown data points based on an area based fraction parameter.

As shown in Fig. 2, there may exist M input points with respect to a Cartesian coordinate system. Each input point \({\stackrel{\sim }{\mathbf{x}}}_{j}={\mathbf{x}}_{k}+{{\varvec{\upxi}}}_{kj}\) occupies a volume of \({\tilde{V }}_{j}\), and a generic (output) point \({\mathbf{x}}_{k}\) occupies a volume of \({V}_{k}\). The PD interaction domain (family) of the generic point \({\mathbf{x}}_{k}\) is \({H}_{k}\). While the shape of its interaction domain can be arbitrary, the output point, \({\mathbf{x}}_{k}\), has a horizon size of \({\delta }_{k}\) which represents the radius of a sphere encompassing a specified number of input points as shown in Fig. 2. It defines the family population, \({N}_{k}\), of the output point, \({\mathbf{x}}_{k}\), i.e., number of input points, \({\stackrel{\sim }{\mathbf{x}}}_{j}\), in \({H}_{k}\). The specified weight function, \({\omega }_{kj}=\omega (\left|{{\varvec{\upxi}}}_{kj}\right|)\), dictates the influence of the input points on the output points.

Fig. 2
figure 2

Input points within the family of output point, \({\mathbf{x}}_{k}\)

The value of the function at the input point, \(({\tilde{x }}_{j},{\tilde{y }}_{j})\), is denoted by \({\tilde{f }}_{j}=\tilde{f }({\stackrel{\sim }{\mathbf{x}}}_{j})\), for \(j=1,\dots ,M\). As derived in Appendix 1, the PD approximation of the function (zeroth-order derivative) at point, \({\mathbf{x}}_{k}\), can be expressed in discrete form as

$$f({\mathbf{x}}_{k})\cong \sum\limits_{j=1}^{{N}_{k}}\tilde{f }({\mathbf{x}}_{k}+{{\varvec{\upxi}}}_{kj}){g}_{2}^{000}\left({{\varvec{\upxi}}}_{kj};{\omega }_{kj},{\tilde{V }}_{j}\right){\tilde{V }}_{j}$$
(3)

In matrix form, it can be rewritten as

$$f\left({\mathbf{x}}_{k}\right)={\mathbf{h}}^{T}\left({{\varvec{\upxi}}}_{kj}\right)\stackrel{\sim }{\mathbf{f}}\left({\stackrel{\sim }{\mathbf{x}}}_{j}\right)\mathrm{ with}\;j=1,\dots ,M$$
(4)

where h is the vector of PD estimation and \(\stackrel{\sim }{\mathbf{f}}\) is the vector of input values associated with point \({\mathbf{x}}_{k}\). They are defined as

$${\mathbf{h}}^{T}\left({{\varvec{\upxi}}}_{kj}\right)=\left\{{g}_{2}^{000}\left({{\varvec{\upxi}}}_{kj};{\omega }_{k1},{\tilde{V }}_{1}\right){\tilde{V }}_{1},\dots ,{g}_{2}^{000}({{\varvec{\upxi}}}_{k{N}_{k}};{\omega }_{k{N}_{k}},{\tilde{V }}_{{N}_{k}}){\tilde{V }}_{{N}_{k}}\right\}$$
(5)

and

$${\tilde{\mathbf{f}}}^{T}({\tilde{x }}_{j})=\left\{{\tilde{f }}_{1},{\tilde{f }}_{2},\dots ,{\tilde{f }}_{{N}_{k}}\right\}.$$
(6)

where \({\xi }_{kj}={\tilde{\mathbf{x}}}_{j}-{\mathbf{x}}_{k}\) and the subscript 2 represent the highest order of derivatives retained in the TSE. The derivation of the PD function, \({g}_{2}^{000}\left({\xi }_{kj};{\omega }_{kj},{\tilde{V }}_{j}\right)\), is described in Appendix 1.

The PD approximation given by Eq. (3) passes through all input points within the horizon of point \({\mathbf{x}}_{k}\) for

$${\omega }_{kj}={\left(\frac{{\delta }_{k}}{{\xi }_{kj}}\right)}^{p}\mathrm{with}\;p>1.$$
(7)

Thus, it is referred to as the PD interpolation, and it can be applied to estimate the missing (unavailable) data from the existing (available) data set.

The PD approximation given by Eq. (3) does not necessarily pass through all the input points for any other form of a weight function such as

$${\omega }_{kj}={e}^{-4{\xi }_{kj}^{2}/{\delta }_{k}^{2}}$$
(8)

This PD approximation provides a regression (curve fit) through the input points. As demonstrated by Madenci et al. [7, 8], it can be also used to filter the noise and smooth out the irregularities in the data. The major difference between these weights is that \({\omega }_{kj}={e}^{-4{\xi }_{kj}^{2}/{\delta }_{k}^{2}}\) approaches a unit value whereas \({\omega }_{kj}={\delta }_{k}^{p}\text{/}{\xi }_{kj}^{p}\) approaches infinity as \(|{\xi }_{kj}|\to 0\). As the number of spacing and the horizon size decreases, the degree of interaction becomes stronger, and the PD regression recovers the interpolation.

It is worth pointing out that Eq. (3) is not limited to a three-dimensional space; it is expandable to higher dimensional spaces as derived by Madenci et al. [8]. However, the literature shows that most common applications of interpolation and regression analyses are conducted in one- and two-dimensional spaces.

As shown in Fig. 3, the output point \(({x}_{k},{y}_{k})\) associated with area, \({A}_{k}\), and the corresponding recovered data \(f({x}_{k},{y}_{k})\) for \(k=1,..,K\) are denoted by blue circles.

Fig. 3
figure 3

Input and output point for two-dimensional: (a) interpolation and (b) regression

A set of M input points are arbitrarily positioned on the \(x-y\) plane. The two-dimensional form of the vector of PD interpolation or regression function becomes

$$\mathbf{{h}}^{T}({\xi }_{kj})=\left\{{g}_{2}^{00}({\xi }_{k1};{w}_{k1},{\tilde{A }}_{1}){\tilde{A }}_{1},..,{g}_{2}^{00}({\xi }_{k{N}_{k}};{w}_{k{N}_{k}},{\tilde{A }}_{{N}_{k}}){\tilde{A }}_{{N}_{k}}\right\}$$
(9)

in which \({\xi }_{kj}\) denotes the relative position vector between input and output points and \({\tilde{A }}_{j}\) represents the area associated with each input point, \(({\tilde{x }}_{j},{\tilde{y }}_{j})\), which are yet unknown. The relative position vector, \({\xi }_{kj}\), is defined as

$${\xi }_{kj}={\left\{({\tilde{x }}_{j}-{x}_{k}),({\tilde{y }}_{j}-{y}_{k})\right\}}^{T}$$
(10)

with

$${\xi }_{kj}=\sqrt{{\left({\tilde{x }}_{j}-{x}_{k}\right)}^{2}+{\left({\tilde{y }}_{j}-{y}_{k}\right)}^{2}}$$
(11)

As shown in Fig. 4, the area of each output point, \({A}_{k}\), is rectangular in shape. The output points are located at the center of each area defined by \({A}_{k}=({x}_{k}-{x}_{k-1})({y}_{k}-{y}_{k-1})\), and both the locations of output points and their associated areas, \({A}_{k}\), are known. It must be kept in mind that the total area of input points must be identical to that of output points. Hence, the total area, A, is defined in terms of the sum of the areas associated with the output points as

Fig. 4
figure 4

Distribution of area segment from an output point to the input points

$$A=\sum\limits_{k=1}^{K}{A}_{k}$$
(12)

Similarly, the total area of the domain can be computed from the sum of the areas of input points as

$$A=\sum\limits_{j=1}^{M}{\tilde{A }}_{j}$$
(13)

There is no unique way to express the unknown areas of input points in terms of those of output points. However, the unknown area of each input point \({\tilde{A }}_{j}\) can be estimated by the weighted distribution of the area of an output point, \({A}_{k}\), to all of the areas of input points as shown in Fig. 4. To achieve a weighted distribution, a fraction parameter \({\rho }_{kj}\) is defined as

$${\rho }_{kj}=\frac{{A}_{kj}}{{A}_{k}}$$
(14)

in which \({A}_{kj}\) represents the segment of \({A}_{k}\) distributed to \({\tilde{A }}_{j}\). Note that the fraction parameter \({\rho }_{kj}\) varies between \(0\le {\rho }_{kj}\le 1\) and it satisfies the partition of unity, i.e., \(\sum\limits_{r=1}^{M}{\rho }_{kr}=1\). In accordance with this assumption, \({A}_{k}\) can be expressed as

$${A}_{k}=\sum\limits_{j=1}^{M}{A}_{kj}$$
(15)

Substituting from Eqs. (15) and (12) into Eq. (13) leads to

$$\sum\limits_{j=1}^{M}{\tilde{A }}_{j}=\sum\limits_{k=1}^{K}\sum\limits_{j=1}^{M}{A}_{kj}$$
(16)

or

$$\sum\limits_{j=1}^{M}\left({\tilde{A }}_{j}-\sum\limits_{k=1}^{K}{A}_{kj}\right)=0$$
(17)

After substituting from Eq. (14), this equation yields the expression for \({\tilde{A }}_{j}\) in the form

$${\tilde{A }}_{j}=\sum_{k=1}^{K}{\rho }_{kj}{A}_{k}$$
(18)

The fraction parameter, \({\rho }_{kj}\), can be defined as ratio of the weight defined between an input and output point, \({\omega }_{kj}={\delta }_{k}^{p}\text{/}{\xi }_{kj}^{p}\), to the sum of the weights defined between the same input and all output points as

$${\rho }_{kj}=\frac{{\omega }_{kj}}{\sum\limits_{r=1}^{M}{\omega }_{kr}}=\frac{1\text{/}{\xi }_{kj}^{p}}{\sum\limits_{r=1}^{M}1\text{/}{\xi }_{kr}^{p}}$$
(19)

Invoking Eq. (19) into Eq. (18) provides the value of \({\tilde{A }}_{j}\) in terms of \({A}_{k}\) as

$${\tilde{A }}_{j}=\sum\limits_{k=1}^{K}\left(\frac{1\text{/}{\xi }_{kj}^{p}}{\sum\limits_{r=1}^{M}1\text{/}{\xi }_{kr}^{p}}\right)\;{A}_{k}\;\mathrm{for}\;j=1,M$$
(20)

in which \(p\ge 1\). This approximation satisfies the requirement of conservation of area. For a uniform spacing among the output points, the area of each output point, \({A}_{k}\), can be set to \({A}_{k}=A\text{/}K\). Hence, Eq. (20) simplifies to

$${\tilde{A }}_{j}=\frac{A}{K}\sum\limits_{k=1}^{K}\left(\frac{1\text{/}{\xi }_{kj}^{p}}{\sum\limits_{r=1}^{M}1\text{/}{\xi }_{kr}^{p}+\varepsilon }\right)\mathrm{ for}\;j=1,M$$
(21)

in which K denotes the number of output points in the region. Also, a small number, \(\varepsilon ={10}^{-9}\), is introduced in order eliminate any possible numerical singularity.

4 Peridynamic Regression for Data Compression and Recovery

The PD regression can be applied to data compression and recovery by employing a selective set of data with known values as input points, referred to as picked data, from the original data set. By employing Eq. (4), the unknown data points can be estimated based on the known (or picked) data by

$$f(\mathbf{{x}}_{k})=\mathbf{{h}}^{T}({\xi }_{kj})\tilde{\mathbf{f}}({\tilde{\mathbf{x}}}_{j})$$
(22)

This equation enables the recovery of data points by using only a portion of the data with \({N}_{p}\) points from the original data set with N points. It can be rewritten as

$$f\left({\mathbf{x}}_{k}\right)=\sum\limits_{j=1}^{{N}_{p}}H\left(\delta -{\xi }_{kj}\right){\omega }_{kj}{g}_{2}^{00}\left({\xi }_{kj}\right)\tilde{f }\left({\tilde{\mathbf{x}}}_{j}\right){\tilde{A }}_{j}\;\;\;(k=1,\dots ,{N}_{u})$$
(23)

where \({N}_{p}\) and \({N}_{u}\) indicate the number of picked and unpicked points, \(H(\delta -{\xi }_{kj})\) is the Heaviside step function, and weight function \({\omega }_{kj}\) is defined as

$${\omega }_{kj}={e}^{-4{\xi }_{kj}^{2}/{\delta }_{k}^{2}}$$
(24)

Note that the total of the number of picked and unpicked points are equal to the total number of points in the original data set, i.e., \(N={N}_{p}+{N}_{u}\).

The complete data set with N sample points can be stored in a vector, \({\mathbf{f}}^{*}\), as

$${\mathbf{f}}^{*}={\left\{{f}_{1}^{*},{f}_{2}^{*},\dots ,{f}_{N}^{*}\right\}}^{T}$$
(25)

The iterative for procedure adaptive data compression and recovery involves the following steps:

  1. 1.

    Start by randomly picking 1% of the N data points of the original data and store them in the vector, \(\stackrel{\sim }{\mathbf{f}}\), as

    $${\stackrel{\sim }{\mathbf{f}}}^{T}=\{\,{f}_{{p}_{1}}^{*},{f}_{{p}_{2}}^{*},\dots ,{f}_{{p}_{{N}_{p}}}^{*}\}$$
    (26)

    where \({p}_{k}\) with \((k=1,\dots ,{N}_{p})\) represents the index IDs of the picked data and \({N}_{p}\) is the number of picked data points. The remaining unpicked data points are unknown and they are contained in vector, f, as

    $$\mathbf{{f}}^{T}=\{\,{f}_{{u}_{1}},{f}_{{u}_{2})},\dots ,{f}_{{u}_{{N}_{u}}}\}$$
    (27)

    where \({u}_{k}\) with \((k=1,\dots ,{N}_{u})\) denotes the index ID numbers of the unknown data points with \({N}_{u}\) representing the number of unknown data points.

  2. 2.

    Use Eq. (23) along with Eq. (21) to predict the unknown data in vector, f.

  3. 3.

    Compute the difference between the original and the predicted data values of the unpicked data points as

    $$\Delta {f}_{{u}_{k}}=\left|\,{f}_{{u}_{k}}^{*}-{f}_{{u}_{k}}\right|(k=1,\dots ,{N}_{u})$$
    (28)
  4. 4.

    Sort the difference values, \(\Delta {f}_{{u}_{k}}\), in descending order and store them in a new array, \(\Delta \mathbf{f}\), defined as

    $$\Delta \mathbf{{f}}^{T}=\left\{\Delta {f}_{{n}_{1}},\Delta {f}_{{n}_{2}},\dots ,\Delta {f}_{{n}_{{N}_{u}}}\right\}$$
    (29)

    where the indices \(n_{k}\) with \((k=1,\dots ,{N}_{u})\) are ordered such that

    $$\Delta {f}_{{n}_{1}}>\Delta {f}_{{n}_{2}}>\dots >\Delta {f}_{{n}_{{N}_{u}}}$$
    (30)
  5. 5.

    Calculate the error, \(e\), due to \(\Delta {f}_{{n}_{k}}\) defined in the form

    $$e= \frac{1}{\left|\,{f}_{\mathrm{max}}^{*}\right|}\sqrt{\frac{1}{N}\sum\limits_{j=1}^{{N}_{u}}{\left(\Delta {f}_{{n}_{j}}\right)}^{2}}$$
    (31)

    where \(\left|\,{f}_{\mathrm{max}}^{*}\right|\) is the maximum absolute value of \({\mathbf{f}}^{*}\) among N data points and it is defined as

    $$\left|\,{f}_{\mathrm{max}}^{*}\right|={\text{Max}}\left\{\left|\,{f}_{1}^{*}\right|,\left|\,{f}_{2}^{*}\right|,\dots ,\left|\,{f}_{N}^{*}\right|\right\}$$
    (32)
  6. 6.

    If \(e<0.1\), convergence is achieved; print the converged results for unpicked data points along with the known data points and stop the analysis. Otherwise, continue with step 7.

  7. 7.

    Pick additional M points from the original data set, \({\mathbf{f}}^{*}\), and append them to the vector of picked data set, \(\tilde{f }\), as

    $${\tilde{\mathbf{f}}}^{T}=\left\{{f}_{{p}_{1}}^{*},{f}_{{p}_{2}}^{*},\dots ,{f}_{{p}_{{N}_{p}}}^{*},{f}_{{n}_{1}}^{*},{f}_{{n}_{2}}^{*},\dots ,{f}_{{n}_{M}}^{*}\right\}$$
    (33)

    Limit the size of M not more than 5% of the total number of data points, N. The indices for these additional data points are chosen from the first M indices of vector \(\Delta \mathbf{f}\) in Eq. (29) for faster convergence. Subsequently, remove the data points with indices \({n}_{1}\) through \({n}_{M}\) from the vector of unpicked data points, in Eq. (27), to balance the total of picked and unpicked data points, in the form

    $$\mathbf{f}^{T}=\left\{{f}_{({n}_{M+1})},{f}_{({n}_{M+2})},\dots ,{f}_{({n}_{{N}_{u}})}\right\}$$
    (34)

    Also, update the number of picked and unpicked data points as \({N}_{p}={N}_{p}+M\) and \({N}_{u}={N}_{u}-M\).

  8. 8.

    Continue performing steps 2 through 8 until convergence is reached in step 6.

5 Peridynamic Regression for Image Compression and Recovery

The PD regression can be applied to image compression and recovery by employing a selective set of pixels with known values as input points, referred to as picked pixels, from the original image.

An image is described by a set of pixels each of which includes three basic color tones, known as the RGB which stands for Red, Green, and Blue. These colors usually vary between 0 and 255. Combination of varying color tones of red, green, and blue provide the true color of the pixel. For example, pure white color is achieved by \({\text{RGB}}=(\mathrm{255,255,255})\) and pure black color by \({\text{RGB}}=(\mathrm{0,0},0)\). As shown in Fig. 5, H and W denote the height and width of the image, respectively. The coordinates of a pixel with an unknown value, \(P_{k}\), on the image are defined by \({x}_{k}\) and \({y}_{k}\). Its unknown RGB values are defined by \({r}_{k}({x}_{k},{y}_{k}),{g}_{k}({x}_{k},{y}_{k})\) and \({b}_{k}({x}_{k},{y}_{k})\), respectively. Similarly, the coordinates of a pixel with a known value, \(\tilde{P}_{j}\), on the image are defined by \({\tilde{x }}_{j}\) and \({\tilde{y }}_{j}\). Its known (available) RGB pixel values are defined by \({\tilde{r }}_{j}({\tilde{x }}_{j},{\tilde{y }}_{j}),{\tilde{g }}_{j}({\tilde{x }}_{j},{\tilde{y }}_{j})\) and \({\tilde{b }}_{j}({\tilde{x }}_{j},{\tilde{y }}_{j})\).

Fig. 5
figure 5

Input and output points for PD image recovery

By employing Eq. (4), the unknown RGB values at pixel \({P}_{k}\) can be estimated based on the known (or picked) pixels by

$${f}_{c}(\mathbf{x}_{k})=\mathbf{{h}}_{c}^{T}({\xi }_{kj}){\tilde{\mathbf{f}}}_{c}({\tilde{\mathbf{x}}}_{j})$$
(35)

in which the subscripts \(c=r,g\), or b represent red, green, and blue, respectively. This equation enables the recovery of an image by using only a portion of the image with \({N}_{p}\) pixels from the original image with N pixels. It can be rewritten as

$${f}_{c}({\mathbf{x}}_{k})=\sum\limits_{j=1}^{{N}_{p}}H\left(\delta -{\xi }_{kj}\right){\omega }_{kj}{g}_{2}^{00}\left({\xi }_{kj}\right){\tilde{f }}_{c}\left({\tilde{\mathbf{x}}}_{j}\right){\tilde{A }}_{j}\;\;\;(k=1,\dots ,{N}_{u})\;\;\mathrm{for}\;c=r,g,b$$
(36)

where \({N}_{p}\) and \({N}_{u}\) indicate the number of picked and unpicked pixels, \(H(\delta -{\xi }_{kj})\) is the Heaviside step function, and weight function \({\omega }_{kj}\) is defined as

$${\omega }_{kj}={e}^{-4{\xi }_{kj}^{2}/{\delta }_{k}^{2}}$$
(37)

Note that the total of the number of picked and unpicked pixels are equal to the total number of pixels of the original image, i.e., \(N={N}_{p}+{N}_{u}\).

The total area of the image, A, can expressed as

$$A=\sum\limits_{j=1}^{{N}_{p}}{A}_{j}+\sum\limits_{k=1}^{{N}_{u}}{A}_{k}$$
(38)

where \({A}_{j}\) and \({A}_{k}\) denote the areas of each pixels in the picked and unpicked portions of the image. Also, the total area of the image is distributed to the unknown lumped areas of each picked pixels, \({\tilde{A }}_{j}\), as

$$A=\sum\limits_{j=1}^{{N}_{p}}{\tilde{A }}_{j}$$
(39)

Equating these expressions for the total area of the image leads

$$\sum\limits_{j=1}^{{N}_{p}}{\tilde{A }}_{j}=\sum\limits_{j=1}^{{N}_{p}}{A}_{j}+\sum\limits_{k=1}^{{N}_{u}}{A}_{k}$$
(40)

By using Eqs. (14) and (15), the area of each unpicked pixel, \({A}_{k}\), can be expressed as

$${A}_{k}=\sum\limits_{m=1}^{{N}_{p}}{A}_{km}=\sum\limits_{m=1}^{{N}_{p}}{\rho }_{km}{A}_{k}$$
(41)

Substituting from Eq. (41) into Eq. (40) yields

$$\sum\limits_{j=1}^{{N}_{p}}{\tilde{A }}_{j}=\sum\limits_{j=1}^{{N}_{p}}{A}_{j}+\sum\limits_{k=1}^{{N}_{u}}\left(\sum\limits_{m=1}^{{N}_{p}}{\rho }_{km}\right)\;{A}_{k}$$
(42)

or

$$\sum\limits_{j=1}^{{N}_{p}}\left[{\tilde{A }}_{j}-\left({A}_{j}+\sum\limits_{k=1}^{{N}_{u}}{\rho }_{kj}{A}_{k}\right)\right]=0$$
(43)

Hence, the unknown lumped areas, \({\tilde{A }}_{j}\), associated with the picked pixels are determined as

$${\tilde{A }}_{j}={A}_{j}+\sum\limits_{k=1}^{{N}_{u}}{\rho }_{kj}{A}_{k}$$
(44)

Noting that \({A}_{k}\) and \({A}_{j}\) are identical with \({A}_{j}=\Delta A\) and \({A}_{k}=\Delta A\) with \(\Delta A\) being the area of each pixel in the original image, this equation can be rewritten as

$${\tilde{A }}_{j}=\left(1+\sum\limits_{k=1}^{{N}_{u}}{\rho }_{kj}\right)\Delta\,A$$
(45)

Furthermore, the area of each pixel in the original image can be set to 1 for convenience, thus leading to

$${\tilde{A }}_{j}=1+\sum\limits_{k=1}^{{N}_{u}}{\rho }_{kj}\;\,\mathrm{for}\;\,(j=1,\dots ,{N}_{p})$$
(46)

with

$${\rho }_{kj}=\frac{1\text{/}{\xi }_{kj}^{2}}{\sum\limits_{m=1}^{{N}_{p}}1\text{/}{\xi }_{km}^{2}}$$
(47)

The recovered pixel values at the unpicked points are compared against the true image by comparing the predicted image colors to the original image colors. The convergence is reached if more than 90% of the original image is recovered. Otherwise, the analysis is repeated by picking more pixels from the original image.

The original image with N pixels for each color, \(c=r,g\), or b, can be stored in a vector, \({\mathbf{f}}_{c}^{*}\), as

$$\mathbf{f}_{c}^{*}={\left\{{f}_{c(1)}^{*},{f}_{c(2)}^{*},\dots ,{f}_{c(N)}^{*}\right\}}^{T}$$
(48)

The iterative procedure adaptive image compression and recovery involves the following steps:

  1. 1.

    Start by picking a uniformly distributed pixels of about 1% of the total of N pixels from the original image and store them into the array of picked pixels, \({\stackrel{\sim }{\mathbf{f}}}_{c}\), as

    $${\tilde{\mathbf{f}}}_{c}^{T}=\{{f}_{c({p}_{1})}^{*},{f}_{c({p}_{2})}^{*},\dots ,{f}_{c({p}_{{N}_{p}})}^{*}\}\;\,\mathrm{for}\;c=r,g,b$$
    (49)

    where \({p}_{k}\) with \((k=1,\dots ,{N}_{p})\) represents the index IDs of the picked pixels and \({N}_{p}\) is the number of picked pixels, which is initially close to \({N}_{p}\approx 0.01N\). The initial grid points are picked based on a coarse structured grid with uniform spacing because it covers the entire domain. Also, the unpicked pixels with unknown values are stored in vector, \({\mathbf{f}}_{c}\), containing

    $${\mathbf{f}}_{c}^{T}=\{{f}_{c({u}_{1})},{f}_{c({u}_{2})},\dots ,{f}_{c({u}_{{N}_{u}})}\}\;\,\mathrm{for}\;c=r,g,b$$
    (50)

    where \({u}_{k}\) with \((k=1,\dots ,{N}_{u})\) denotes the index ID numbers of the unpicked pixels with \({N}_{u}\) being the number of unpicked pixels.

  2. 2.

    Use Eq. (36) along with Eq. (46) to predict the colors of unpicked pixels. Note that each color code has integer values and varies between 0 and 255. For this reason, the computed values of the unpicked pixels must be converted to the nearest integer between 0 and 255, i.e., \({f}_{c({u}_{k})}=\text{Round(}{f}_{c({u}_{k})})\), \({f}_{c({u}_{k})}=0\) if \(\text{Round(}{f}_{c({u}_{k})})<0\) and \({f}_{c({u}_{k})}=255\) if \(\text{Round(}{f}_{c({u}_{k})})>255\) for \(k=1,\dots ,{N}_{u}\);

  3. 3.

    Compute the difference between the color values of the original image and the unpicked pixels, whose values are predicted by Eq. (36) and rounded to integers in step 2 as

    $$\Delta {f}_{c({u}_{k})}=\left|{f}_{c({u}_{k})}^{*}-{f}_{c({u}_{k})}\right|\;\;\;(k=1,\dots ,{N}_{u})$$
    (51)
  4. 4.

    Sort the difference values, \(\Delta {f}_{c({u}_{k})}\), in descending order and store them in an array, \(\Delta {f}_{c}\), defined as

    $$\Delta {\mathbf{f}}_{c}^{T}=\left\{\Delta {f}_{c({n}_{1})},\Delta {f}_{c({n}_{2})},\dots ,\Delta {f}_{c({n}_{{N}_{u}})}\right\}\;\,\mathrm{for}\;c=r,g,b$$
    (52)

    where the indices \({n}_{k}\) with \((k=1,\dots ,{N}_{u})\) are such that

    $${\text{Max}}(\Delta {f}_{c({n}_{1})})>{\text{Max}}(\Delta {f}_{c({n}_{2})})>\dots >{\text{Max}}(\Delta {f}_{c({n}_{{N}_{u}})})$$
    (53)

    in which \({\text{Max}}(\Delta {f}_{c({n}_{k})})\) is defined as

    $${\text{Max}}(\Delta {f}_{c({n}_{k})})={\text{Max}}\left\{\Delta {f}_{r({n}_{k})},\Delta {f}_{b({n}_{k})},\Delta {f}_{g({n}_{k})}\right\}\;(k=1,\dots ,{N}_{u})$$
    (54)
  5. 5.

    Calculate the error, \(e\), due to \(\Delta {f}_{c({n}_{k})}\) defined in the form

    $$e=\frac{\sum\limits_{k=1}^{{N}_{u}}\left(\Delta {f}_{r({n}_{k})}+\Delta {f}_{b({n}_{k})}+\Delta {f}_{g({n}_{k})}\right)}{3\times N\times 255}$$
    (55)
  6. 6.

    If \(e<0.01\), convergence is achieved; print the converged image and stop the analysis. Otherwise, continue with step 7.

  7. 7.

    Pick additional M pixels with indices \({n}_{1}\) through \({n}_{M}\) from the original image and append them to the vector of picked pixels, \({\stackrel{\sim }{\mathbf{f}}}_{c}\), in Eq. (49) as

    $${\stackrel{\sim }{\mathbf{f}}}_{c}^{T}=\left\{{f}_{c({p}_{1})}^{*},{f}_{c({p}_{2})}^{*},\dots ,{f}_{c({p}_{{N}_{p}})}^{*},{f}_{c({n}_{1})}^{*},{f}_{c({n}_{2})}^{*},\dots ,{f}_{c({n}_{M})}^{*}\right\}\;\;\mathrm{for}\;c=r,g,b$$
    (56)

    Limit the size of M not more than 5% of the total number of pixels, N. The indices for these additional pixels are chosen from the first M indices of vector \(\Delta {\mathbf{f}}_{c}\) in Eq. (52) for faster convergence. Subsequently, remove the pixels with indices \({n}_{1}\) through \({n}_{M}\) from the vector of unpicked pixels, in Eq. (50), to balance the total of picked and unpicked pixels, in the form

    $${\mathbf{f}}_{c}^{T}=\left\{{f}_{c({n}_{M+1})},{f}_{c({n}_{M+2})},\dots ,{f}_{c({n}_{{N}_{u}})}\right\}$$
    (57)

    Also, update the number of picked and unpicked pixels as \({N}_{p}={N}_{p}+M\) and \({N}_{u}={N}_{u}-M\).

  8. 8.

    Continue performing steps 2 through 8 until convergence is reached in step 6.

6 Peridynamic Regression for Model Order Reduction

The PD regression can be employed to link two levels of discretization as shown in Fig. 6. The level-1 discretization is coarse and it enables reduction in the number of unknowns in the expression. The level-2 discretization is fine and controls the accuracy of evaluations. In the coarse grid shown in Fig. 6, the spacing between the green points is defined by \(\Delta {x}_{1}=L\text{/(}m-1)\) where m represents the number of points in \(x-\) and \(y-\) directions. It results in \(M=m\times m\) points in the discretization of the domain. The position vector, the functional value, and the volume of \(j\text{-th}\) point in level-1 grid are designated as \({\mathbf{x}}_{j}\), \({w}_{j}\), and \({A}_{j}\), respectively.

Fig. 6
figure 6

Discretization of domain with level-1 (coarse) and level-2 (refined) grids

In level-2 grid, the spacing between the blue points is defined by \(\Delta {x}_{2}=L\text{/}n\) where \(N=n\times n\) represents the number of PD points. In this fine grid, the position vector, the functional value, and the area of \(k\text{-th}\) point are denoted by \({\hat{x}}_{k}\), \({\hat{w}}_{k}\), and \({\hat{A}}_{k}\), respectively. As shown in Fig. 6, the horizon (radius) of the \(k\text{-th}\) PD point in level-2 grid is denoted by \({\hat{\delta }}_{k}\). The distance between \(k{\text{ - th}}\) PD point of level-1 grid and any other PD point in the level-2 grid is represented by \({\xi }_{kj}={x}_{j}-{\hat{x}}_{k}\).

Using the PDDO introduced by Madenci et al. [8], the functional values of the points in the fine grid, \({\hat{w}}_{(k)}\), as well as their derivatives can be expressed in terms of the unknown functional values of the points in the coarse grid \({w}_{(j)}\) provided that the total area of the points in both grids is preserved as

$$\sum\limits_{j=1}^{M}{A}_{j}=\sum\limits_{k=1}^{N}{\hat{A}}_{k}.$$
(58)

As shown in Fig. 6, the area of each PD point in the coarse grid, \({A}_{j}\), and fine grid, \({\hat{A}}_{k}\), can be calculated as

$${A}_{j}=LW\text{/}M\;\;\;j=1,\dots ,M$$
(59)

and

$${\widehat{A}}_{k}=LW\text{/}N\;\;\;k=1,\dots ,N.$$
(60)

Using the concept of PD regression, the functional value and its derivatives at each point in the fine grid can be expressed as

$$\hat{w}\left({\hat{\mathbf{x}}}_{k}\right)=\sum\limits_{j=1}^{{N}_{k}}{w}_{j}{g}_{2}^{00}\left({\xi }_{kj};{\omega }_{kj}\right){A}_{j},$$
(61)
$${\hat{w}}_{,x}\left({\hat{\mathbf{x}}}_{k}\right)=\sum\limits_{j=1}^{{N}_{k}}{w}_{j}{g}_{2}^{10}\left({\xi }_{kj};{\omega }_{kj}\right){A}_{j},$$
(62)
$${\hat{w}}_{,y}\left({\hat{\mathbf{x}}}_{k}\right)=\sum\limits_{j=1}^{{N}_{k}}{w}_{j}{g}_{2}^{01}\left({\xi }_{kj};{\omega }_{kj}\right){A}_{j},$$
(63)
$${\hat{w}}_{,xx}\left({\hat{\mathbf{x}}}_{k}\right)=\sum\limits_{j=1}^{{N}_{k}}{w}_{j}{g}_{2}^{20}\left({\xi }_{kj};{\omega }_{kj}\right){A}_{j},$$
(64)
$${\hat{w}}_{,xy}\left({\hat{\mathbf{x}}}_{k}\right)=\sum\limits_{j=1}^{{N}_{k}}{w}_{j}{g}_{2}^{11}\left({\xi }_{kj};{\omega }_{kj}\right){A}_{j},$$
(65)

and

$${\hat{w}}_{,yy}({\hat{\mathbf{x}}}_{k})=\sum\limits_{j=1}^{{N}_{k}}{w}_{j}{g}_{2}^{02}({\xi }_{kj};{\omega }_{kj}){A}_{j}$$
(66)

In these equations, \({N}_{k}\) represents the number of level-1 points within the horizon of level-2 point,\({\hat{\mathbf{x}}}_{(k)}\). In matrix form, Eqs. (61)–(66) can be rewritten as

$$\hat{w}\left({\hat{\mathbf{x}}}_{k}\right)={\mathbf{h}}^{T}\left({\hat{\mathbf{x}}}_{k}\right){\hat{\mathbf{w}}}_{k},$$
(67)
$${\hat{w}}_{,x}\left({\hat{\mathbf{x}}}_{k}\right)={\mathbf{h}}_{,x}^{T}\left({\hat{\mathbf{x}}}_{k}\right){\hat{\mathbf{w}}}_{k},$$
(68)
$${\hat{w}}_{,y}\left({\hat{\mathbf{x}}}_{k}\right)={\mathbf{h}}_{,y}^{T}\left({\hat{\mathbf{x}}}_{k}\right){\hat{\mathbf{w}}}_{k},$$
(69)
$${\hat{w}}_{,xx}\left({\hat{\mathbf{x}}}_{k}\right)={\mathbf{h}}_{,xx}^{T}\left({\hat{\mathbf{x}}}_{k}\right){\hat{\mathbf{w}}}_{k},$$
(70)
$${\hat{w}}_{,xy}\left({\hat{\mathbf{x}}}_{k}\right)={\mathbf{h}}_{,xy}^{T}\left({\hat{\mathbf{x}}}_{k}\right){\hat{\mathbf{w}}}_{k},$$
(71)

and

$${\hat{w}}_{,yy}({\hat{\mathbf{x}}}_{k})={\mathbf{h}}_{,yy}^{T}({\hat{\mathbf{x}}}_{k}){\hat{\mathbf{w}}}_{k}$$
(72)

where the coefficient vectors, \(\mathbf{h}({\hat{\mathbf{x}}}_{k})\), \({\mathbf{h}}_{,x}({\hat{\mathbf{x}}}_{k})\), \({\mathbf{h}}_{,y}({\hat{\mathbf{x}}}_{k})\),\({\mathbf{h}}_{,xx}({\hat{\mathbf{x}}}_{k})\), and \({\mathbf{h}}_{,yy}({\hat{\mathbf{x}}}_{k})\), and the unknown vector, \({\hat{\mathbf{w}}}_{k}\), are defined as

$${\mathbf{h}}^{T}\left({\hat{\mathbf{x}}}_{k}\right)=\left\{{g}_{2}^{00}\left({\xi }_{k1};{\omega }_{k1}\right){A}_{1},..,{g}_{2}^{00}\left({\xi }_{k{N}_{k}};{\omega }_{k{N}_{k}}\right){A}_{{N}_{k}}\right\},$$
(73)
$${\mathbf{h}}_{,x}^{T}\left({\hat{\mathbf{x}}}_{k}\right)=\left\{{g}_{2}^{10}\left({\xi }_{k1};{\omega }_{k1}\right){A}_{1},..,{g}_{2}^{10}\left({\xi }_{k{N}_{k}};{\omega }_{k{N}_{k}}\right){A}_{{N}_{k}}\right\},$$
(74)
$${\mathbf{h}}_{,y}^{T}\left({\hat{\mathbf{x}}}_{k}\right)=\left\{{g}_{2}^{01}\left({\xi }_{k1};{\omega }_{k1}\right){A}_{1},..,{g}_{2}^{01}\left({\xi }_{k{N}_{k}};{\omega }_{k{N}_{k}}\right){A}_{{N}_{k}}\right\},$$
(75)
$${\mathbf{h}}_{,xx}^{T}\left({\hat{\mathbf{x}}}_{k}\right)=\left\{{g}_{2}^{20}\left({\xi }_{k1};{\omega }_{k1}\right){A}_{1},..,{g}_{2}^{20}\left({\xi }_{k{N}_{k}};{\omega }_{k{N}_{k}}\right){A}_{{N}_{k}}\right\},$$
(76)
$${\mathbf{h}}_{,xy}^{T}\left({\hat{\mathbf{x}}}_{k}\right)=\left\{{g}_{2}^{11}\left({\xi }_{k1};{\omega }_{k1}\right){A}_{1},..,{g}_{2}^{11}\left({\xi }_{k{N}_{k}};{\omega }_{k{N}_{k}}\right){A}_{{N}_{k}}\right\},$$
(77)
$${\mathbf{h}}_{,yy}^{T}({\hat{\mathbf{x}}}_{k})=\left\{{g}_{2}^{02}({\xi }_{k1};{\omega }_{k1}){A}_{1},..,{g}_{2}^{02}({\xi }_{k{N}_{k}};{\omega }_{k{N}_{k}}){A}_{{N}_{k}}\right\}$$
(78)

and

$${\hat{\mathbf{w}}}_{k}^{T}=\left\{{w}_{1},{w}_{2},\dots ,{w}_{{N}_{k}}\right\}.$$
(79)

The major implication of Eq. (67) is that the zeroth-order PDDO can be used for interpolation. Hence, the PD regression for model order reduction can be used to approximate the field variables such as the displacements of a point in the material based on the principle of minimum potential energy. The present approach can readily be used in the solution of structural problems where the equilibrium equations are derived based on energy principles as demonstrated by Madenci et al. [9, 10].

7 Numerical Results

The numerical results concern interpolation of real data in two and three dimensions, interpolation to approximate a three-dimensional function, adaptive data recovery in three-dimensional space, recovery of missing pixels in an image, adaptive image compression and recovery, and free energy function of a thermally fluctuating rod through model reduction.

7.1 Interpolation of Temperature Data

The data consists of the maximum temperature readings across 121 weather stations with the corresponding latitude, longitude, and elevation of each weather station. This weather data on January 4, 2020 in Arizona is obtained from NOAA [11]. The exact locations and temperature readings are given in Appendix 3. In order to demonstrate the capability of the present approach, 10 data points shown in Fig. 7 as red crosses are removed at random from the original 121 data points. The remaining 111 data points serve as input points. The locations and temperature readings of the randomly removed stations are shown in Table 1. Figure 8 shows the PD interpolation grid overlayed on the Arizona map. The family population, \({N}_{k}\), of each output point, \({\mathbf{x}}_{k}\), is defined by including input points within its horizon, \(\delta\). Therefore, the number of family members may be different for each output point. The family member selection is achieved using a k-d tree nearest neighbor algorithm [4].

Fig. 7
figure 7

Location of input and output (red) points given in Table 1

Table 1 Locations and values of data points removed from the original data set
Fig. 8
figure 8

PD grid of output points overlayed on the Arizona map and the horizon of point \({\mathbf{x}}_{k}\)

The temperature is estimated at each output point on the grid. The values at the output points are estimated while recovering the original 111 data points for both two- and three-dimensional interpolation. The PD interpolation is performed through Eq. (23) along with Eq. (20) for \(p=2\), and the PD functions are constructed by truncating the TSE after the first-order derivatives. The PD temperature predictions at the output points closest to the red circles are compared with their original readings in order to measure the error.

In the case of a two-dimensional data interpolation, temperature, T, varies over x and y representing the longitude and latitude, respectively. The number of output points is \(40\times 40\), and they are equally spaced in the region of \(-{115}^{\circ }\le x\le -{109.1}^{\circ }\) and \(-{31}^{\circ }\le {\text{y}}\le {37.5}^{\circ }\). The grid spacing is defined by \(\Delta x=0.{1475}^{\circ }\) and \(\Delta y=0.{1525}^{\circ }\) in the longitudinal and latitude directions, respectively. The family population of each output point, \(N_{k}\), is defined by including input points within a radius of \({3}^{\circ }\). The horizon, \({\delta }_{k}\), is determined by the furthest input point from \({\mathbf{x}}_{k}\).

Figure 9 shows the PD interpolation values at the output points. The values with closest coordinates to the red circles are shown in Table 2. These PD estimates are compared with their original values and the predictions based on Ordinary Kriging method [4]. The Kriging algorithm described in Appendix 2 is implemented using the PyKrige python software package. The error, \(e\), between the readings and predictions is calculated as 4.54 and 5.01 for PD and Kriging estimations, respectively.

Fig. 9
figure 9

PD interpolation values on the Arizona map

Table 2 PD and Kriging estimates of the temperature based on the 2D coordinates of weather stations

In order to demonstrate the performance of PD interpolation in a three-dimensional space, the elevation is also included in the input data. In the case of a three-dimensional data, temperature, T varies over x, y, and z representing the longitude, latitude, and elevation, respectively. The number of output points is \(25\times 25\times 30\), and they are equally spaced in the region of \((-{115}^{\circ }\le x\le -{109.1}^{\circ })\), \((-{31}^{\circ }\le y\le {37.5}^{\circ })\), and \((0\le z\le 3000\text{ m})\). The grid spacing is defined by \(\Delta x=0.{236}^{\circ }\), \(\Delta y=0.{244}^{\circ }\), and \(\Delta z=100\text{ m}\) in the longitudinal, latitude, and elevation directions, respectively. The family population of each unknown point, \({N}_{k}\), is defined by including input data points within a cylindrical interaction domain. Its radius is defined as \(\delta ={1.9}^{\circ }\) with a height of 3000 m. As shown in Fig. 10, the horizon, \({\delta }_{k}\), is determined by the furthest input point from the output point, \({\mathbf{x}}_{k}\).

Fig. 10
figure 10

Family members and horizon of point \({\mathbf{x}}_{k}\) encompassing the input points in a cylindrical interaction domain

The PD interpolation values at the output points with closest coordinates to the red circles are shown in Table 3. These PD estimates are compared with their original values and the predictions based on the Ordinary Kriging method [4]. The error is calculated as 5.14 and 6.72 for PD and Kriging estimations, respectively. The 3D interpolation is not as robust as the 2D interpolation due to the sparsity of the data. Introducing another dimension without increasing the number of data points suffers from the curse of dimensionality.

Table 3 PD and Kriging estimates of the temperature based on the 3D coordinates of weather stations

7.2 Interpolation to Approximate a Function

The input data shown in Fig. 11 is generated randomly at 270 points within a unit cube \((0\le x,y,z\le 1)\) by evaluating the following function:

Fig. 11
figure 11

Randomly generated input data

$$f\left(x,y,z\right)=\left[1-{\text{sin}}(\pi x)\right]{y}^{3}{e}^{z}$$
(80)

The number of output points is \(30\times 30\times 30\), and they are equally spaced with grid spacing by \(\Delta x=\Delta y=\Delta z=1/30\). The randomly generated input data constitutes 1% of the PD grid points. The PD interpolation is performed at the 27,000 output points through Eq. (23) along with Eq. (21) for \(p=3\). The family population of each unknown point, \({N}_{k}\), is defined by the closest 50 PD points. Also, the PD functions are constructed by truncating the TSE after the third-order derivatives, i.e., \(N=3\). The PD estimates of the function value at the output points are shown in Fig. 12. The error measure, \(e\), between the functional value and the estimates is 0.2943%.

Fig. 12
figure 12

Functional variation at the output points: (a) actual data and (b) PD recovery

The PD recovery of data is compared against the actual data along the line specified by \(x=y=z\) in Figs. 13 and 14. Also, these figures show the number of picked input data points along this line.

Fig. 13
figure 13

Comparison of the actual data with PD recovery along the line \((x=y=z)\)

Fig. 14
figure 14

Comparison of the actual data with PD recovery along the line \((x,y=0.55,z=0.55)\)

7.3 Adaptive Data Recovery

In order to demonstrate data recovery, the data is fabricated by using the following function:

$$\begin{aligned}&{f}^{*}(x,y,z)=\frac{2xyz}{{x}^{2}+{y}^{2}+{z}^{2}}\;\text{ for }-1\le x,y,z\le 1 \text { }\\&-1\le x,y,z\le 1\end{aligned}$$
(81)

The data is generated for a grid spacing of \(40 \times 40 \times 40\) in the 3-D space. The PD regression at each unknown point is performed through Eq. (23) along with Eq. (21) for \(p=3\). The family population of each unknown point, \({N}_{k}\), is defined by a minimum of 50 pixels encompassed by a circle. As explained in Sect. 4, the initial data is 1% of the complete data and randomly picked, and subsequently the data is increased adaptively in 5% increments.

As shown in Fig. 15, the recovered data with the randomly picked initial data has an overall error of 3.745%. Although this error is high, the recovered data provides crucial information about the location of high gradients for the selection of additional 5% data points for the next iteration. Figure 16a shows the picked data points for the second iteration. The recovered data with only 6% of the total data points has overall error of 2% as shown in Fig. 16b. Finally, the adaptive selection of data points after the third iteration with only 11% of the total data points, shown in Fig. 17a, results in the desired error less than 1% against the original data set as shown in Fig. 17b. The PD regression successfully estimates the unknown functional values.

Fig. 15
figure 15

Randomly picked 1% of the data population and recovered data with percentage error of \(3.745\)

Fig. 16
figure 16

Adaptively picked 6% of the data population and recovered data with percentage error of \(2.0\)

Fig. 17
figure 17

Adaptively picked 11% of the data population and recovered data with percentage error of 0.847

7.4 Image Recovery

The image shown in Fig. 18 is constructed by 512 × 512 number of pixels specifying its resolution. The blue spots in Fig. 19a are randomly distributed and indicate the pixels of unknown values. The areas of known pixels are determined by using Eq. (46) for \(p=3\), and the PD regression at each unknown pixel is performed through Eq. (36). The family population of each unknown point, \({N}_{k}\), is defined by a minimum of 50 pixels encompassed by a circle.

Fig. 18
figure 18

Image with complete pixels of \({512}\times {512}={262144}\) [12]

The image with recovered pixels is shown in Fig. 19b. The PD interpolation successfully estimates the missing pixel values. The small spots of missing pixels have continuous color variations. The blue spots on the eyes are successfully recovered. However, the large spots of missing locations have some smeared color discontinuity. The overall error measured against the original image is 0.0256%.

Fig. 19
figure 19

Image with (a) missing pixels (blue spots) and (b) recovered pixels (error of 0.0256%)

7.5 Adaptive Image Compression

The adaptive data compression is applied to the image shown in Fig. 18. The areas of known pixels are determined by using Eq. (46) for \(p=3\), and the PD regression at each unknown pixel is performed through Eq. (36). The family population of each unknown point, \({N}_{k}\), is defined by a minimum of 50 pixels encompassed by a circle.

Since the critical pixels in the image are not known a priori, the initial set of 572 pixels (0.195313% of total pixels 262,144) are selected uniformly as shown in Fig. 20a. The image with recovered pixels is shown in Fig. 20b. Although the recovered image looks poor, it is obtained by using only 0.195313% of the total pixels of 262,144. The overall error is 9.067%. However, this image provides crucial information about the high gradients of color changes.

Fig. 20
figure 20

Iteration 1 — images with (a) 572 picked pixels indicated with white (0.195313% of total pixels) and (b) recovered pixels (error of 9.067%)

The new set of picked pixels is used in the next iteration with a 5% increase in pixel numbers. Figures 21, 22, 23, 24, 25, 26, 27, 28 and 29 show the adaptively picked pixels and recovered images for the next 9 iterations. As the number of picked pixels increases, the recovered image looks much improved, and the overall error reduces to 4.69422% with 15.21568% of total pixels at iteration 4 as shown in Fig. 23. The error reduces to 1.70792% with 30.21355% of total pixels as shown in Fig. 25 at iteration 6. Finally, the adaptive selection with 45.21103% of total pixels, shown in Fig. 29, results in a desired error (0.88737%) less than 1% against the original image as shown in Fig. 18. The original and the recovered images are shown in Fig. 30.

Fig. 21
figure 21

Iteration 2 — images with (a) 13,677 picked pixels indicated with white (5.217361% of total pixels) and (b) recovered pixels (error of 13.3117%)

Fig. 22
figure 22

Iteration 3 — images with (a) 26,782 picked pixels indicated with white (10.21652% of total pixels) and (b) recovered pixels (error of 6.85677%)

Fig. 23
figure 23

Iteration 4 — images with (a) 39,887 picked pixels indicated with white (15.21568% of total pixels) and (b) recovered pixels (error of 4.69422%)

Fig. 24
figure 24

Iteration 5 — images with (a) 52,992 picked pixels indicated with white (20.21484% of total pixels) and (b) recovered pixels (error of 3.23066%)

Fig. 25
figure 25

Iteration 6 — images with (a) 66,098 picked pixels indicated with white (25.21439% of total pixels) and (b) recovered pixels (error of 2.33139%)

Fig. 26
figure 26

Iteration 7 — images with (a) 79,203 picked pixels indicated with white (30.21355% of total pixels) and (b) recovered pixels (error of 1.70792%)

Fig. 27
figure 27

Iteration 8 — images with (a) 92,308 picked pixels indicated with white (35.21271% of total pixels) and (b) recovered pixels (error of 1.3637%)

Fig. 28
figure 28

Iteration 9 — images with (a) 105,413 picked pixels indicated with white (40.21187% of total pixels) and (b) recovered pixels (error of 1.08388%)

Fig. 29
figure 29

Iteration 10 — images with (a) 118,518 picked pixels indicated with white (45.21103% of total pixels) and (b) recovered pixels (error of 0.88737%)

Fig. 30
figure 30

Images with (a) original and (b) recovered pixels with 45.21103% of total pixels

7.6 Model Reduction for Thermal Fluctuation of a Rod

The free energy function, \(\mathcal{G}\), can be expressed in terms of the partition function as

$$\mathcal{G}=-{k}_{B}T\mathrm{ln}Z$$
(82)

in which \(k_\text{B}=1.38\text{(pN)(nm)}^\circ\text{K}^{-1}\) is the Boltzmann constant, T is the temperature in \(^\circ K\), and Z is the partition function. It can be expressed in the form of a multi-dimensional Gaussian integration as [13]

$$Z=\int {e}^{-U\left(w\right)\text{/}{k}_{B}T}d\mathbf{w}.$$
(83)

This integration can be carried out for the stored energy of a quadratic form as [14, 15]

$$Z=\int {e}^{-U(w)\text{/}{k}_{B}T}d\mathbf{w}={e}^{-\frac{{U}_{\mathrm{min}}}{{k}_{B}T}}\sqrt{\frac{{\left(\pi {k}_{B}T\right)}^{M}}{\mathrm{det}\,\mathbf{K}}}$$
(84)

where M is the number of unknowns in the vector of w which represents the possible deformation states. It fluctuates about the lowest elastic energy state \({U}_{\mathrm{min}}\) for \(T>0\). The symmetric and positive definite matrix, K of size \((M\times M)\), represents the stiffness of the structure. Substituting for the partition function, Z, and expanding the terms, the free energy function can be evaluated as

$$\mathcal{G}={U}_{\mathrm{min}}-\frac{{k}_{B}MT}{2}\mathrm{ln}(\pi {k}_{B}T)+\frac{{k}_{B}T}{2}\left[\mathrm{ln}\left(\mathrm{det}\,\mathbf{K}\right)\right]$$
(85)

For a flat configuration with \({U}_{\mathrm{min}}=0\), the free energy simplifies to

$$\mathcal{G}=-\frac{{k}_{B}TM}{2}\mathrm{ln}(\pi {k}_{B}T)+\frac{{k}_{B}T}{2}\left[\mathrm{ln}\,{D}_{1}+\mathrm{ln}\,{D}_{2}+\cdots +\mathrm{ln}\,{D}_{M}\right]$$
(86)

where \({D}_{i}\) (\(i=1,\dots ,M\)) are the diagonal entries of the diagonal matrix D appearing in the decomposition as

$$\mathbf{K}=\mathbf{L}\mathbf{D}{\mathbf{L}}^{T}$$
(87)

where L is a lower triangular matrix whose diagonals are equal to unity with \(\mathrm{det }\,\mathbf{L}=1\) and D has positive entries.

The evaluation of the free energy requires the computation of the determinant of K. However, computing the determinant of an extremely large stiffness matrix poses computational challenges. Accurate evaluation of the determinant of the stiffness matrix is a key step in the calculation of the partition function. The simultaneous use of fine and coarse grids along with PD interpolation eliminates the computational challenges.

Su and Purohit [12] modeled the thermal fluctuation of a rod by considering its total energy, U, in the form

$$U=\frac{1}{2}\underset{L}{\int }{K}_{B}{w}_{,xx}^{2}dx+\frac{1}{2}\underset{L}{\int }F{w}_{,x}^{2}dx.$$
(88)

where w is the out-of-plane deflection and F represents the force. Its bending modulus, \({K}_{B}\), can be measured experimentally. The length of the rod is L. They derived the analytical expression for the reduction in length of a fluctuating rod as

$$\Delta L=\frac{1}{4}{k}_{B}T\left(\frac{L}{\sqrt{{K}_{B}F}}{\text{coth}}\frac{FL}{\sqrt{{K}_{B}F}}-\frac{1}{F}\right)$$
(89)

By using Eq. (59), the reduction in length can be also expressed as

$$\Delta L=\frac{\partial \mathcal{G}}{\partial F}=\frac{{k}_{B}T}{2}\frac{d}{dF}\mathrm{ln}\left(\mathrm{det }\,\mathbf{K}\right)$$
(90)

The energy of each point \({\hat{\mathbf{x}}}_{(k)}\) in the fine grid can be expressed in the form

$${U}_{(k)}=\frac{1}{2}{K}_{B}{\left({\hat{w}}_{(k),xx}\right)}^{2}{\hat{\ell}}_{(k)}+\frac{1}{2}F\left({\hat{w}}_{(k),x}^{2}\right){\hat{\ell}}_{(k)}$$
(91)

with \({\hat{\ell}}_{(k)}=L\text{/}N\) representing the length of each point. After expanding this equation and substituting for the derivatives of \({\hat{w}}_{(k)}\) from Eqs. (68) and (70), the strain energy at point \({\hat{\mathbf{x}}}_{(k)}\) is expressed in matrix form as

$${U}_{(k)}=\frac{1}{2}{\hat{\mathbf{w}}}_{(k)}^{T}{\mathbf{K}}_{(k)}{\hat{\mathbf{w}}}_{(k)}$$
(92)

where the stiffness matrix, \({\mathbf{K}}_{(k)}\), is defined as

$${\mathbf{K}}_{(k)}=\left[{K}_{B}\left({\mathbf{h}}_{(k),xx}{\mathbf{h}}_{(k),xx}^{T}\right)+F\left({\mathbf{h}}_{(k),x}{\mathbf{h}}_{(k),x}^{T}\right)\right]{\hat{\ell}}_{(k)}$$
(93)

The total energy in the rod can be expressed in the form

$$U=\sum\limits_{j=1}^{M}{U}_{(j)}=\frac{1}{2}\sum\limits_{j=1}^{M}{\hat{\mathbf{w}}}_{(j)}^{T}{\mathbf{K}}_{(j)}{\hat{\mathbf{w}}}_{(j)}={\mathbf{w}}^{T}\mathbf{Kw}$$
(94)

The symmetric and positive definite matrix, K, of size (\(M\times M\)) can be determined as

$$\mathbf{K}={\text{Assemble}}\left[{\mathbf{K}}_{(1)},{\mathbf{K}}_{(2)},\cdots ,{\mathbf{K}}_{(M)}\right],$$
(95)

The PD model of a rod is subjected to a force, F, varying from 200 to \(\text{2000 pN}\) at a specified temperature of \(T=300\;{^\circ{\text{K}}}\). The contour length of the rod is \(L=2.5\text{ nm}\), and its flexural rigidity is specified as \({K}_{B}=2.5{k}_{B}T\text{ nm}\). Its persistence length, \(p={K}_{B}\text{/(}{k}_{B}T)\), is the same as the contour length.

The determinant of the rod stiffness matrix is computed for three different level-1 grid sizes specified by \(m=51\), \(m=101\), and \(m=201\) points. The corresponding level-2 grid division is achieved by \(n=4(m-1)\) points. The horizon of point, \({\hat{\mathbf{x}}}_{(k)}\), in the refined grid is specified as \({\hat{\delta }}_{(k)}=5\Delta {x}_{1}\).

The PD evaluation of reduction in length, \(\Delta L\), is evaluated for specified force values of \(F-\Delta F\), F, and \(F+\Delta F\) with \(\Delta F\) representing the incremental values for numerical differentiation based on central difference approximation as

$$\Delta L\left(F,T\right)=\frac{{k}_{B}T}{4\Delta F}\mathrm{ln}\frac{\left(\mathrm{det}\,\mathbf{K}(F+\Delta F,T)\right)}{\left(\mathrm{det}\,\mathbf{K}(F-\Delta F,T)\right)}$$
(96)

The extension in length defined as \((L-\Delta L)\) is computed for each discretization at \(T=300\;{^\circ {\text{K}}}\).

As shown in Fig. 31, the PD prediction provides sufficiently accurate results with 51 unknowns and converges to the analytical formula (the worm-like-chain relation for force extension), Eq. (96) with 201 unknowns. Su and Purohit [12] performed their analysis with 500 elements and recovered the analytical solution with 50,000 elements. The simultaneous use of fine and coarse grids along with PD interpolations reduces the number of unknowns and yet provides very accurate results. This reduction in degrees of freedom is an essential gain in capability especially for the computation of the determinant of stiffness matrix. It was also successfully applied in the evaluation of the partition function for a lipid membrane with inclusions [14].

Fig. 31
figure 31

Force-extension relations in a rod under thermal fluctuation at \(T=300^\circ \mathrm{K}\)

8 Conclusions

The study presents a unified approach for interpolation and regression of data with irregularities and scatter in a multi-dimensional space. It provides a single mathematical framework for diverse datasets and multi-dimensional data manipulation and model order reduction. The mathematical framework is based on the Peridynamic Differential Operator (PDDO) to transfer information within a set of discrete data, and among data sets representing multiple scales. The robustness and capability of this approach have been demonstrated by considering various real or fabricated data concerning two- or three-dimensional applications. The numerical results concern interpolation, regression, and recovery/compression of non-uniform data and model reduction.