Efficient model based on genetic programming and spline functions to find modes of unconventional waveguides
Abstract
The contribution of this work is twofold: the authors developed an accurate model to solve the vector wave equation of radially-layered inhomogeneous waveguides based on spline function expansions and automated grid construction by genetic programming, and thenemployed this model to analyse the propagation of electromagnetic waves within oil wells. The developed model uses a spline expansion of the fields to convert the wave equation into a quadratic eigenvalue problem where eigenvectors represent the coefficients of the splines and eigenvalues represent the propagation constant of the eigenmode. The present study compared the proposed model using the classical winding number technique. The results obtained for the first eigenmodes of a typical oil well geometry were more accurate than those obtained by the winding number method. Moreover, the authors model could find a larger amount of eigenmodes for a fixed azimuthal parameter than the standard approach.
1 Introduction
Predicting the physics of electromagnetic (EM) waves in oil fields has been a topic of interest. The applications include oil heating, drill stem testing, and more recently, wi-fi downhole sensors. While the first applications are more frequent in the industry, the last one is of particular interest in the present article because there is a growing interest in building a reliable communication system between the downhole sensors and the platform.
The literature has proposed some approaches for wireless downhole communication, most of them using the well as an antenna that radiates EM signals through rock formations [[1]–[5]]. In these approaches, the methods of propagation usually solve the radiation problem in a layered inhomogeneous medium for frequencies of few Hertz, which introduces an obstacle for duplex digital communication links. These approaches usually suffer from numerical issues, due to the discretisation of a metallic structure that is both thin and very long.
Another method is to propagate the EM signal within the region between the production string and the formation [[6]]. This area is usually known as the annular region of the well. In this region, the wave is guided using a transverse EM mode at a low frequency to minimise losses. However, this approach suffers from scattering of the fields on the equipment usually placed within this region of the well.
We are interested in predicting the wave modes and attenuation losses of an EM wave guided by the production string, as opposed to the propagation through rock formations or the annular region. Propagating through the production string is theoretically better because it should have less attenuation since the signal is confined to a metallic casing.
In our approach, the production string behaves like a circular waveguide, filled with oil. Usually, the oil has a non-constant conductivity in the direction of propagation due to temperature variations. Additionally, solid CaCO3 incrustations are common on the wall of the pipe string [[7]], causing a radial inhomogeneity on the waveguide (Fig. 1).

Slice of the pipe string model at a fixed z coordinate. The oil flows into the outer tube, whereas the incrustation stays adhered to the inner wall of the pipe
In [[8]], the authors studied propagating EM waves within the production string, considering only the oil inhomogeneity. In that paper, the authors divided the production string into equal segments and assumed that each segment is a homogeneous medium. After that, by applying boundary conditions between adjacent sections, the authors of [[8]] defined an approximated solution for the original inhomogeneous problem. This approach, however, does not consider the CaCO3 incrustations on the walls of the production string.
On the contrary, the present paper considers both the radial inhomogeneity and the axial inhomogeneity, that is, we assume that the oil is an inhomogeneous medium and there are two dielectrics radially separated: oil and incrustations. Therefore, we are interested in finding the modes of propagation and the attenuation of the waves in a radially layered and axially inhomogeneous waveguide, which models the production pipe of the oil well. This waveguide has two layers of the dielectric material in the radial direction, and these layers might be inhomogeneous in the axial direction.
The problem of finding modes of unconventional waveguides has been studied in the literature. Some authors [[9], [10]] found the modes of a radially layered circular waveguide using a semi-analytical procedure: the vector wave equation is solved analytically to obtain the general solution, and then boundary conditions are applied to find the particular parameters of the analytical solution. Usually, this procedure results in a transcendental equation on a single complex variable, and numerical methods [[11], [12]] become necessary to find a solution. We refer to it as the classical method.
Despite its analytical nature, the conventional method does not behave well numerically because finding a (possibly infinite) number of roots of a non-linear equation in the complex plane is not an easy task. Usually, given a fixed azimuthal dependence, five or more modes are required to do mode matching at adjacent waveguide sections, and the numerical methods to find roots of a non-linear equation might struggle to find this amount of roots accurately. Another drawback of the classical method is the need to specify a rectangular interval in the complex plane to look for the roots. This requirement forces the engineer to know the approximate position of the modes in the complex plane, which may be ineffective. Finally, the majority of the available methods to find the roots of a non-linear equation rely on the argument principle to count the number of roots within a closed domain in the complex plane. However, since the computation of the number of roots inside a domain involves a numerical integration, sometimes poor convergence may interfere on the number of roots computed and, as a consequence, the final result may have missing modes.
We propose a new method to calculate the modes, based on spline functions, which converts the problem of solving the vector wavefunction subject to boundary conditions into a problem to find the first eigenvalues of a sparse matrix. The eigenvalues are the modes of propagation for a given azimuthal dependence, and they are guaranteed to be sorted by increasing attenuation. Therefore, our method can determine the first N least-attenuated modes of a radially layered circular waveguide given the azimuthal parameter without any primary guess, which is very useful to mode-matching applications. In particular, this model is helpful herein to do mode matching of the adjacent sections of the production pipe, as we show in the next section.
-
Section 2’ depicts both the classical method and the proposed method to compute the modes of a radially layered circular waveguide. Then, it shows how to split the inhomogeneous waveguide into smaller homogeneous segments, and describes how to perform mode matching between adjacent waveguide segments to obtain the final solution of the wave propagating within the inhomogeneous waveguide.
-
Section 3 compares the classical method and our proposed approach on a typical oil well scenario for a high wave frequency and a low wave frequency.
-
Section 4 outlines our findings and reveals possible applications of our method outside the oil and gas area.
2 Description and methodology
This section approaches the problem of solving the EM wave equation in inhomogeneous waveguides that are radially layered. We divide this section into three subsections: (1) the mathematical formulation of the problem, (2) the classical approach, and (3) our model.
Moreover, we also apply the models to the context of oil wells wireless telemetry, because they behave very similar to circular waveguides. Therefore, in this paper the oil and gas terminology is used to explain how parts of the oil wells are being modelled as waveguides.
2.1 Mathematical formulation
This work uses a cylindrical coordinate system with unit vectors
, respectively. We represent the production string of the oil wells as an infinite cylindrical waveguide with a lossless wall, filled with crude oil and CaCO3. The crude oil fills the space having
, whereas the CaCO3 incrustation fills the space separating the petroleum and the pipe wall
, where a is the radius of the production string (Fig. 1).




























At this point, one should pay attention that the proposed solution has a vanishing divergence. Thus it does not satisfy (2). However, we assume, for now, that the wave travels a small distance in the z-direction, so it can be assumed that and
are approximately constant and consequently, the divergence of the electric field vanishes. Thus, the forthcoming paragraphs adopt the solution of (7), that is,
is not a function of the space variables. After that, we present how to use this solution to the case which
is a function of z.


















Inhomogeneous waveguide split into small segments. Each segment is assumed to be small enough to be considered a homogeneous medium. The EM wave propagates in the z-direction
The next subsections show how the classical and the proposed spline-based model solve the mathematical problem described in this subsection. In particular, they show how to apply the boundary conditions between adjacent materials to compute the modes of propagation and then between adjacent waveguide sections to do mode matching. As the following subsections show, the main difference between the classical and the proposed approaches is how the modes are computed. While the classical approach uses the exact analytical solution and computes the propagation constant of the modes by numerically finding the roots of a transcendental equation, the proposed method approximates the electric field using splines, thus converting the original problem to the well-known problem of finding the smallest eigenvalues of a sparse matrix.
2.2 Classical method
-
Formulation of the transcendental equation whose solution is the set of modes of a particular homogeneous segment of the waveguide.
-
Description of a numerical algorithm to solve this transcendental equation.
-
Description of how to do mode matching between adjacent waveguide sections.
Therefore, each of the following sections depicts these topics in detail.
2.2.1 Formulation of the modes equation








Recall that we are particularly interested in understanding the propagation of waves in an oil well, as shown in Fig. 1. Thus, we apply boundary conditions to the electric and magnetic fields in the oil, in the incrustation and the interface between them. We use ‘ o ’ and ‘ c ’ superscripts to denote coefficients for and
, respectively.







































2.2.2 Numerical solution of the modes equation
There are numerous approaches to solving (34) in the complex plane. In [[12]], the authors developed a branch-and-bound method based on two root tests and the Newton–Raphson method to enumerate all isolated roots in a rectangular domain. However, our equation might have multiple roots, so we believe this approach might not be ideal.
In [[11]], the authors developed a method for enclosing all the zeros of a complex function using a combination of the argument principle technique and the Newton–Raphson algorithm. In [[10]], the authors used a similar approach to find the modes of cylindrical tunnels. The drawback of these approaches is the need for numerical integration in the complex plane during the algorithm execution. We use the method described in [[10], [11]].
Although it might seem straightforward, this approach has many drawbacks. For example, the argument principle is not true whenever a root lies in the contour of the integral. Sometimes, a domain splitting procedure may render sub-domains have roots in the contour, which requires special treatment. Another issue arises when a sub-domain has multiple roots because splitting this sub-domain does not reduce the number of roots in it, which may lead to infinite subdivisions. In this case, heuristics must be applied to detect root multiplicity and, therefore, stop splitting the domain. Again, for more information, please refer to [[10], [11]].
2.2.3 Mode matching between adjacent sections









































Hence, by splitting the propagation direction into small uniform subsections, we can mode match adjacent subsections and, consequently, solve the inhomogeneous problem by reducing it to many homogeneous problems.
2.3 Proposed spline-based model
The proposed model depicts the radial dependency of the fields using spline functions. Therefore, instead of solving the wave equation analytically, we solve it numerically. More precisely, the original partial differential equation is converted to a discrete eigenvalue problem, whose eigenpairs represent the eigenmodes. To address inhomogeneous problems, we employ the split-and-mode-match approach presented above, where the waveguide is split into segments small enough to be considered homogeneous, and the propagation problem is solved for each segment. Then, we apply boundary conditions to mode match adjacent sections.
The following sections describe how the waves are represented by spline functions and show how to solve the resulting quadratic eigenvalue problem.
2.3.1 Spline function representation of the waves
In the context of this work, spline functions are piecewise polynomial functions having a specific degree of smoothness [[15], [16]]. The smoothness usually requires the continuity of the function and some of its derivatives at every point.
Since spline functions are piecewise functions, they are defined over a discrete grid of points within the domain of the approximated function. The choice of this grid is, a priori, an arbitrary decision, but the grid usually has a significant influence on the approximation accuracy. Therefore, we employ a computational intelligence methodology, known as genetic programming [[17]], to optimally define the grid points given the required number of points. The following paragraphs define the equations of the spline model, how to determine the spline coefficients and how to employ genetic programming to set the optimal grid.






















































The matrices involved in (58) are usually sparse matrices, that is, most of their elements are null. Therefore, there are methods available to find a predefined number smallest (or largest) eigenvalue. For example, the implicitly restarted Arnoldi method [[18]] is used in ScyPy [[19]] and Matlab [[20]] via the function eigs. In particular, we suggest finding the first eigenvalues with the smallest imaginary parts, which represent the attenuation of the mode.
Hence, our model consists of finding the eigenvalues of (58) having the smallest imaginary part (the less attenuated modes). Then, again we apply mode matching as described in Section 2.2.3 between adjacent sections to understand how the waves propagate in the inhomogeneous medium.
We are now in a position to describe how to define the set of points in the oil and in the incrustation using genetic programming.
Genetic programming is a technique that mimics the Darwin theory of evolution, where individuals compete for resources and the more suitable ones are selected for crossover and mutation to generate children. As the algorithm evolves, the individuals become more adapted, and the best of them approaches the optimal solution.
The degree of adaptation of an individual is measured by a fitness function, which is designed such that the best grid of points yields the smallest fitness value. Therefore, by defining a minimisation problem using a suitable fitness function, we find the best grid of points. By doing so, we expect to use considerably fewer grid points than a uniform grid while keeping the same accuracy. Using fewer grid points requires less memory and less running time, and simplifies the computation of the integrals used in mode matching, as defined in (48). Additionally, this technique becomes very useful in multidimensional grids, where the number of points are high and uniform grids are impractical. For instance, a uniform grid having 100 points per dimension and three dimensions would have a total of 1 million points, which might pose a severe computational problem.
In our model, we minimise the total error of the solution of the fundamental mode, given a fixed amount of points in the grid. The total error is defined as the Euclidean 2-norm of the l.h.s. of the wave equation (3) plus the Euclidean 2-norm of the boundary condition equations. Since the solution is written as combinations of degree-3 polynomials, the integrals involved in the Euclidean norm are straightforward and analytically computable. The solution of this problem is an optimal grid of points to find the fundamental mode. Then, we use this grid to solve for any amount of modes. Since our fitness function calculates only the first eigenvalue of (57), it is computed very quickly, which makes the whole optimisation fast and meaningful.
The next section discusses experiments and comparisons between our model and the classical model and presents results for typical configurations of oil wells.
3 Experiments and results
This section presents the comparison between the proposed spline model and the classical model to find the modes of a radially layered inhomogeneous oil well. The oil parameters follow the Cole–Cole model presented in [[21]] for the oil of type D. Additionally, from [[22], p. 323] we chose for and zero conductivity. We used
and
.





The experiments used a linear temperature profile, with oil temperature ranging from 323 K in the reservoir to 288 K in the well head. Then, we split the oil well along the z-direction into A segments (see Fig. 2), and we considered the temperature in the middle point of the segment to use in (59).
Additionally, we fixed and simulated many values of
to compare the classical and the proposed method.
This section is divided into two subsections. The first subsection presents a comparison between the classical and the proposed model to find the modes of propagation within a particular segment of the oil well. The experiments include a range of incrustation amounts and two ranges of frequencies: ultra-high frequency (UHF) and ultra-low frequency (ULF).
The second subsection is concerned with analysing the non-conventional propagation medium we defined in this study. We are interested in determining the attenuation of the fundamental mode, which is close to the fundamental TE11 mode in an ideal circular waveguide.
3.1 Mode determination of a particular well segment
In the following experiments, we determined the modes of propagation using the classical and the proposed model. To compare them quantitatively, we defined two measures: the total running time and the relative accuracy.
To define the relative accuracy, we first define the method error as the Euclidean 2-norm of the l.h.s. of the wave equation (3) plus the Euclidean 2-norm of the boundary condition equations. Then, the relative accuracy is defined as the ratio between the error of the classical method and the error of the proposed method. Therefore, if the relative accuracy is >1, then the proposed method is more accurate than the classical one. The subsequent paragraphs present the results of these experiments at UHF and ULF.
3.1.1 Mode determination at UHF
Tables 1 and 2 show the results of the wave number computed at the frequency of 1 GHz using both the classical and the proposed spline model for an incrustation length of 5% a. Moreover, the last line of each table shows the total time spent to compute the modes. As seen, the spline model is about 35% faster than the classical model. These experiments were conducted using a fixed temperature of 298 K in (59).


Mode | ![]() ![]() |
![]() ![]() |
rel. acc. |
---|---|---|---|
1 | 20.653–0.10465![]() |
20.6521–0.10465![]() |
1.01 |
2 | 0.090337–22.2483![]() |
0.092429–19.292![]() |
1.33 |
3 | 0.048623–47.301![]() |
0.048603–47.3277![]() |
1.02 |
4 | 0.031924–62.7733![]() |
0.023235–59.8709![]() |
1.10 |
5 | 0.03082–83.7544![]() |
0.030807–83.8719![]() |
1.07 |
6 | 0.020626–96.7284![]() |
0.011018–93.5797![]() |
0.99 |
7 | 0.025621–117.8677![]() |
0.025638–118.1887![]() |
1.03 |
8 | 0.01533–129.3947![]() |
0.006350–126.4481![]() |
1.46 |
time (s): | 1.33 | 1.20 | — |


Mode | ![]() ![]() |
![]() ![]() |
rel. acc. |
---|---|---|---|
1 | 0.039601–54.8998![]() |
0.0218–48.3901![]() |
1.21 |
2 | 0.030432–85.0917![]() |
0.030395–85.1215![]() |
1.08 |
3 | 0.020152–100.2463 ![]() |
0.010074–96.7512![]() |
1.13 |
4 | 0.02505–123.7617![]() |
0.025056–123.9048![]() |
1.02 |
5 | 0.014633–136.1614![]() |
0.0053842–132.9063![]() |
1.22 |
6 | 0.023956–159.2651![]() |
0.02402–159.6573![]() |
1.04 |
7 | 0.011595–170.0997![]() |
0.0038932–167.4623![]() |
1.36 |
8 | 0.024778–193.3162![]() |
0.024943–194.127![]() |
1.10 |
time, s | 1.52 | 1.45 | — |
The tables also display the relative accuracy of each method. From 1 and 2, we check that the relative accuracy is usually >1, which means that the classical approach is less accurate than the spline-based method.
At higher frequencies, the proposed approach still outperforms the classical algorithm. For instance, Table 3 depicts the modes for f = 2 GHZ and . The running time is nearly half the running time of the classical method, and the relative accuracy is >1.


Mode | ![]() ![]() |
![]() ![]() |
rel. acc. |
---|---|---|---|
1 | 60.5959–0.10659![]() |
60.5957–0.10659![]() |
1.01 |
2 | 49.1996–0.12058![]() |
50.4937–0.11398![]() |
1.08 |
3 | 30.5181–0.20903![]() |
30.48–0.20931![]() |
1.08 |
4 | 0.18716–31.5881![]() |
0.21699–25.1077![]() |
1.35 |
5 | 0.10645–61.8881![]() |
0.10623–62.0408![]() |
1.02 |
6 | 0.073677–79.8339![]() |
0.068221–75.9555![]() |
1.11 |
7 | 0.066933–103.3163![]() |
0.066789–103.6724![]() |
1.00 |
8 | 0.049918–117.0884![]() |
0.044129–113.8942![]() |
1.04 |
time, s | 2.11 | 1.87 | — |
Table 4 shows the relative accuracy for the first eight modes computed for . According to the results, the proposed technique is more accurate than the classical one. It happens because we used an optimisation approach to find the best grid of points, thus minimising the error.

Mode | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
---|---|---|---|---|---|---|
1 | 1.01 | 1.13 | 1.24 | 1.16 | 0.98 | 1.21 |
2 | 1.33 | 1.10 | 1.07 | 1.22 | 1.01 | 1.08 |
3 | 1.02 | 0.99 | 1.09 | 1.03 | 1.82 | 1.13 |
4 | 1.10 | 1.00 | 1.16 | 0.96 | 1.13 | 1.02 |
5 | 1.07 | 1.04 | 1.17 | 1.14 | 1.14 | 1.22 |
6 | 0.99 | 1.12 | 1.05 | 1.19 | 1.26 | 1.04 |
7 | 1.03 | 1.21 | 0.91 | 1.11 | 1.20 | 1.36 |
8 | 1.46 | 1.17 | 1.14 | 1.36 | 1.22 | 1.10 |
Therefore, we concluded that the proposed method is more accurate and faster than the classical method to compute the modes of this type of oil well.
3.1.2 Mode determination at ULF
At ULF, no modes propagate, because the chosen frequency is below the cut-off frequency of any mode. However, these modes are useful for mode matching and finding them demonstrates the power of the proposed model in comparison with the classical one.
Table 5 shows the first three modes computed using both the conventional model and the proposed model. The results are similar to the UHF case: the proposed method exhibits more accuracy and performs faster than the classical one.


Mode | ![]() ![]() |
![]() ![]() |
rel. acc. |
---|---|---|---|
1 | ![]() |
![]() |
1.77 |
2 | ![]() |
![]() |
1.82 |
3 | — | 8.6459–6.5313![]() |
— |
time, s | 7.01 | 5.91 | — |
3.2 Analysis of the non-conventional medium ‘oil well’
The next experiment aims to understand how the waves propagate in the inhomogeneous well. We consider a good length of 1000 m and we divided it into V small segments (see Fig. 2) of length 1000/V. The wave propagates from to
. Additionally, we assumed that the first segment (which contains
) had only the plane wave corresponding to the fundamental mode, which is the first mode having
. Moreover, we used a linear temperature profile with equation
and sampled it at the centre of each segment. Then, the conductivity of the segment was calculated using (59).








Fig. 3 shows the function for the fundamental mode having
, and a fixed
in the oil. This function was obtained using the spline-based model and
. The inclination of the curve increases slightly as the value of
increases. It happens because as
increases, the temperature of the oil increases and, consequently, the conductivity of the oil gets bigger. Moreover, the higher the conductivity, the higher the losses due to the Joule effect.

Attenuation of the first mode having azimuthal dependency . The well is inhomogeneous, and the proposed method divided the well into ten segments to account for the conductivity variation along the
-direction
Moreover, according to Fig. 3, the fundamental mode is highly attenuated in the well, reaching a 100 dB attenuation in 300 m. This happens due to the high equivalent conductivity of the oil: . At high frequencies, the value of
is non-negligible, thus paying an important burden in the total attenuation.
4 Conclusions
This work presented a new method to find the modes of unconventional waveguides based on spline functions and automatic grid building by Genetic programming. We applied our method to the problem of EM propagation within oil wells, comparing its results to the classical winding number approach. The proposed method featured higher accuracy and smaller running time than the conventional winding number method, both at high frequency (UHF range) and low frequency (ULF range). The results also showed that the typical oil well presents high attenuation. Therefore signal repeaters are required to build links within the oil having more than 300 m of length. Finally, we consider that the proposed method is useful for any radially layered waveguide problem, possibly inhomogeneous, and we recommend the proposed method over the classical winding number technique whenever a significant number of modes is required, especially in the ULF range.