1. Introduction
Electromagnetic transients occur in electrical systems because of switching and impulse actions. This leads to dangerous current surges and overvoltages representing a significant danger to the equipment, and also reduces the reliability of the protection system. This leads to dangerous current surges and overvoltages, which pose a significant danger to equipment, and also reduce the reliability of used protection. Until now, the development and improvement of methods for studying transients have not lost their relevance. A number of well-known commercial software systems, such as EMTP [
1], PSpice [
2], Simulink [
3], and others are currently used for modeling transients in electrical circuits. The equations of state in these software systems are compiled automatically based on the circuit diagram. These equations are integro-differential algebraic equations. The investigated electrical circuits of real devices usually contain a great number of elements. The duration of transients in complex circuits can be large. As a result, the simulation time of such processes can be long, which is undesirable. Modern requests of design engineers are required to increase the speed of calculations for realizing a real-time simulation. Therefore, the actual scientific task is the development of improved numerical methods for calculating electromagnetic transients that are faster than existing methods.
Analysis of publications. Multi-step methods of numerical integration of differential equations are widely used to solve systems of equations of state in well-known software complexes. As a result, various difference schemes [
4,
5] have been obtained that make it possible to calculate the value of the desired function at one time point from the known values of the function (or its derivatives) at several previous points. The problem of increasing the speed of simulation of transients in electrical equivalent circuits has led to the search for new methods for the numerical calculations of integro-differential equations of state.
The perspective of using orthogonal polynomials for integrating differential equations is shown in [
6]. Orthogonal functions are a set of functions for which the scalar product of each pair is zero. The set of orthogonal functions constitutes the basis over which an arbitrary continuous function can be decomposed. The method of decomposing functions into a series of orthogonal polynomials is called the spectral method in this work. This is due to the analogy of the function’s expansion into Fourier series of trigonometric functions, where the set of expansion coefficients is the frequency spectrum. The investigation of the convergence speed of the series is presented in this paper. The author considers the terms “interpolation” and “collocation” to be identical, but the term “interpolation” is used to represent a known function, and the term “collocation” is used for expansion into the series of a function resulting from solving a differential equation. The fundamentals of the spectral method using the Chebyshev polynomials for integrating differential equations are given, and the advantages of this method over the finite difference method are shown in [
5]. The bases of the spectral method for the solution of differential equations in partial derivatives for the problems of hydrodynamics are investigated in [
7]. The best effectiveness of this method, compared to the methods of finite differences, was noted. The fundamentals of the spectral method are briefly outlined in [
8]. The Chebyshev and Legendre polynomials are considered basic functions. The application of the method to the solution of equations in partial derivatives is shown. The bases of the spectral method for solving partial differential equations are also outlined in [
9]. The presentation is presented without unnecessary abstract mathematics and trifles. The author tried to show that spectral methods are not as difficult as some experts believe. Work [
10] is one of a few books on spectral methods based on MATLAB programs. This practical introduction is built around forty short and powerful MATLAB programs that a reader can download from the World Wide Web. The author argues that if one wants to solve ordinary differential equations with high accuracy, and if the data defining the problem is smooth, then spectral methods are usually the best tools. In this case, ten-digit accuracy can be achieved when the finite difference or finite element method gives two or three digits. Spectral methods require less computer memory than alternative methods. The approximation of the solution of transients for the current function in an electric circuit by series in the Chebyshev polynomials was used in [
11]. It is shown by the transformation of the integro-differential equation of state into an algebraic equation for images of current. Kirchhoff’s rules for images of current have been proven. As a result, a method has been obtained that can significantly increase the speed of modeling. However, this work does not address the use of other orthogonal polynomials. The convergence of series in the Chebyshev polynomials and other orthogonal polynomials was compared in [
12]. In many cases, though not always, the Chebyshev polynomials are preferred. The systematic presentation of the properties of the Chebyshev polynomials is devoted to [
13]. The paper [
13] is devoted to a systematic presentation of the properties of the Chebyshev polynomials. Methods for solving differential and integral equations are considered in this work.
In work [
14], the approximation of transient solutions is used for current and magnetic flux functions in magneto-electric equivalent circuits of transformers by a series of Chebyshev polynomials. In [
15], this method is used to model transients in asynchronous motors. The multi-step Gere method was used for comparison, as well as the Dommel method, and the efficiency of using the Chebyshev polynomials was shown in these works. However, these papers do not address the application of other orthogonal polynomials. In work [
16], the approximation of the solution of transient processes for the derivative of the current function in the electric circuit by the Chebyshev polynomials is used. This is done in order to reduce the error in the approximation of the solution. However, these papers do not address the use of other orthogonal polynomials.
Conclusion. Orthogonal polynomials are successfully used to integrate differential and integral equations. However, there are few publications showing the application of spectral methods for calculating transients in electrical circuits. Until now, a comparative analysis of the effectiveness of using various orthogonal polynomials for modeling transients in electrical circuits has not been carried out.
The purpose of the work is
development of a unified method for calculating electromagnetic transients in electrical circuits based on the representation of solution functions in different polynomials;
development of a circuit model of the spectral method leading to the visibility of engineering calculation methods;
study of a method using algebraic polynomials, the Chebyshev, Hermite and Legendre polynomials.
2. Materials and Methods
Let us consider, as in [
11], a simple linear electrical circuit containing series-connected resistive
R, inductive
L and capacitive
C elements.
Let us suppose that before switching, the capacitor is charged to the voltage value
uc(
t0). If at the moment
t = t0, the alternating voltage source
u(t) is switching on, then the transient of
i(t) occurs in the circuit. This process is described by a linear integro-differential equation:
Let us set the condition that equation (1), compiled according to Kirchhoff’s voltages rule, is observed exactly in a given series of n time reference points t0, t1, …, tN−1 for the function i(t), which describes the dependence of current on time. These points are called collocation points. Kirchhoff’s voltages rule is approximated with some error at other points. The function i(t) is not known in advance.
It seems relevant to fulfill research and compare the features of the use of various orthogonal polynomials for calculating transients. The most popular polynomials of the Chebyshev, Hermite, Legendre, as well as algebraic polynomials, were selected for research.
The Weierstrass theorem states: “A function that is continuous on a finite closed interval can be approximated with a given accuracy by polynomials” [
17]. Thus, the functions of varying current of time can be expanded into a series in terms of polynomials:
where the argument is
t ∈ [
a,
b],
—basis functions that can be orthogonal polynomials or members of an algebraic polynomial.
The Chebyshev and Legendre polynomials have the range of the argument . In this case, for convenience, argument t ∈ [a, b] is replaced by a dimensionless argument for convenience, where x = ((2t − (a + b)))/((b − a)). Algebraic polynomials have the domain of the argument t ∈ [0, ∞], and Hermite’s polynomials have t ∈ [−∞, ∞]. To improve the accuracy of calculations, it is advisable to normalize the values of the argument in real time: x = t·Kn, Normalization factor is , τ = b − a.
Then the expansion series takes the form:
A series on orthogonal polynomials can be differentiated
where
, and is also integrated.
2.1. Formation of Matrix Equations
We select, on the time interval [a, b], a number of reference points of collocation
tm (m = 0,
1,
2,
…,
N − 1), which corresponds to the points
xm of the variable
x on the normalized interval. If the condition (2) is written for each reference point, then we get a system of linear algebraic equations:
where
P is a basis function (polynomial of any type).
Subtract the first equation from the equations of system (5) and obtain the following system, in which the number of unknown coefficients and the number of equations are the same:
This system does not have zero determination, because for the considered polynomials P0 = 1 and does not depend on x.
Let us introduce a one-dimensional matrix of polynomials as a function of x.
The reduced system (6) in matrix form takes the view as:
where
C = [
c1 c2 … cN−1]
T is a one-dimensional matrix of values of the coefficients of the approximating polynomial (2) without the coefficient
c0;
I = [i(x1) i(x2) … i(xN−1)]T is a one-dimensional matrix of values of current at reference points 1, 2, …, N − 1;
I0 = [i(x0) i(x0) … i(x0)]T—is a one-dimensional matrix of values of current at reference point 0, matrix size n − 1.
If Equation (3) is written for each reference point x0, x1, …, xN−1, we get a system of linear equations similar to (5).
Add the first equation to the rest of the equations of the system (9). (It is impossible to subtract as in (6), since the full first column of matrix D will be equal to zero). Obtain a reduced system in which the number of unknowns and the number of equations are the same. Let us take into account that
P′0 = 0. This system in matrix form is as follows:
where
D is the quadratic matrix of the reduced system of linear Equation (10):
I′ = [i′(x1) i′(x2) … i′(xN−1)]T is the one-dimensional matrix of values of current derivatives for points with the number k = 1, 2, …, N − 1,
Iʹ0 = [i′(x0) i′(x0) … i′(x0)]T is a one-dimensional matrix of values of derivatives for zero time point, matrix size N − 1.
Integrals from polynomials are expressed by Equation (4). The integral with the upper limit
xm has the form as:
The values of the given argument
xm (
m = 1 …
N − 1) at the reference points correspond to the values of a function (12) which are the rows of the matrix
J:
The coefficient
c0 is determined from the first equation of the system (5) by the following expression:
Here, it is taken into account that P0 = 1.
Let us consider the features of the matrices V, D, J constructed for the system.
The Legendre polynomials are defined in the segment of varying of the argument
x ∈ [−1, 1] and are calculated by recurrent formulas [
17]:
We use the vector (7) of the Legendre polynomials as a function of
x. Then the expansion of the current function into a series (2) takes the form (16):
If Equation (16) is written for each point x1, x2, …, xN−1, we obtain a system of linear equations, which has the matrix form (9).
The derivatives of the Legendre polynomials are calculated by recursion [
14]:
From expressions (3) and (16) we have got:
If Equation (17) is written for each point x1, x2, …, xN−1, we obtain a system of linear equations, which has the matrix form (11).
Integrals of the Legendre polynomials are defined by formulas [
17]:
As a result, using property (18), we get from expression (13)
The expression (14) for calculating c
0 is substituted into (19) and has got:
Let us express Equation (20) in terms of matrix
V:
Let us introduce a one-dimensional matrix of all addendums (except the first one) included in expression (21) as a function of the argument
x:The expression (21) takes the form:
where
For the reference points
m = 1,
2,
…,
N − 1, the integral (23) has the form:
In the matrix form, for all reference points, these equations have the form:
or
where
2.2. Algebraic Polynomials
The one-dimensional matrix of algebraic polynomials (7) has the form:
The function of current approximated by the polynomial is:
If Equation (29) is written for each point x1, x2, …, xN−1 then we get a system of linear equations, which has the matrix form (9).
Let us differentiate the expression (28). The row-vector of derivatives of algebraic polynomials has the form as:
If equation (3) for the derivatives is written for each point x1, x2, …, xN−1, we obtain a system of linear equations, which has the matrix form (11).
Integrals from algebraic polynomials (4) have the form:
For each reference point with the value of the time argument tm, which corresponds to the moments xm of the given argument x, we have equation (23). Then, for all N − 1 referent points, we obtain the matrix system of Equation (25).
The Chebyshev polynomials of the 1st type [
13,
17] are defined in the segment of varying in the argument
x ∈ [−1, 1] as
and calculated by recursion
taking into account that
The Hermite polynomials are defined in the segment
t ∈ [−∞, ∞] of the argument variation and are calculated by recursion [
17]:
Matrices V, D, J are constructed in the same way both for Legendre polynomials and for Chebyshev and Hermit algebraic polynomials.
2.3. Recording the Equation of State of an Electrical Circuit through Polynomials
Let us write the integro-differential Equation (1) for the specific values of the argument at the reference points by varying the point numbers
m = 1,
2,
…,
N − 1. We get a system of equations, which has the matrix form [
11]:
where
B = 1/C is the inverse value of condenser capacitance,
U is the vector of voltage source values at points
1,
2,
…,
N − 1 of the time segment;
I,
I′,
J are vectors of current values (9), current derivative values (11) and current integral values (13) at reference points,
uC0 is voltage value across the capacitor at the initial moment of time
t0.
If we substitute vectors
I (9),
I′ (11),
J (25) into expression (43), then we obtain the expression
or
or
where
Equation (39) is an expression of the Kirchhoff voltages rule for image C.
The solution of equation (45) is determined by the formula (42):
where
denotes the operation of taking the inverse matrix is denoted.
As a result of the solution (39), the one-dimensional matrix C of polynomial collocation coefficients of the current is determined. In the case of orthogonal polynomials, this one-dimensional matrix can be called a spectrum. This is due to the analogy of the Fourier series decomposition of functions by trigonometric functions, where the set of decomposition coefficients is the frequency spectrum.
Then, with the known initial current value i0 and its derivative in zero point and the initial voltage value across the capacitor uC0, the current values can be determined at all arbitrary points of the time segment τ according to (2).
Circuit interpretation of the method of the numerical calculation of transients in electrical circuits.
Equation (39) can be interpreted using a special equivalent scheme. Let current
i(
t) flow in the R-L-C-e branch of the original circuit (
Figure 1). In a special equivalent scheme (
Figure 2) the original current
i(
t) after switching is represented by its image
C. Image
C is the one-dimensional matrix of extensional coefficients in a series by polynomials of the function of current
i(
t).
The role of total resistance plays .
The right side of Equation (44) contains 4 terms, which can be interpreted as voltage sources.
The resistive element has an image in the form of resistance
R·V in the substitution branch. Direct voltage source having
R·i0 value is joined to this element in series and in opposite direction concerning to the current (see
Figure 2). The inductive element has an image in the form of some resistance
L·D. A DC voltage source having a
L∙i’o value is connected in series with this element in the current direction.
The capacitive element has an image in the form of resistance B·S. The source of direct voltage with value B·∆·i0 + uC0 is joined to this resistive element in series and in the opposite direction concerning to the current.
It has been proven in [
11] that the current Kirchhoff rule is also observed for images of
Ck branches converging to the node
(k = 1,
2,
…,
b):Conclusions. The one-dimensional matrix image
C corresponds to the real current
i(t) in the equivalent scheme shown in
Figure 2. All images of currents
C in the equivalent circuit satisfy Kirchhoff’s rule for a DC circuit if the circuit is composed according to the following rules:
the voltage source is replaced by the one-dimensional matrix source U containing the voltage value at all N − 1 reference points;
the resistive element R, inductive element L and capacitive element B = 1/C in the equivalent circuit are replaced by operator resistances and additional sources of direct voltage.
Therefore, with the known initial values of the branch currents
i0k values of derivatives of the branch currents
I’0k and the voltages across the capacitors
uC0k at the point
t0 of the segment [
a,
b], the system of equations compiled according to Kirchhoff’s rules for images of currents
C for all nodes without one and for all main contours has a single solution. As a result of solving a system of linear algebraic equations compiled according to Kirchhoff’s rules for images of currents, we obtain a one-dimensional matrix
C consisting of submatrix
Ck containing the values of the coefficients of the expansion in polynomials of the functions of current
ik(t) for all branches. Knowing the polynomial expansion coefficients of the current
ik(t) and the value of
ik0 for branch
k, we can obtain the current values
Ik at all reference points in the time interval [
a,
b]:
Error estimation and its minimization. If the positions of the reference points in the segment [−1, 1] are not chosen evenly, but in the zeros of the Chebyshev polynomials
;
interpolation error can be significantly reduced. In this case, the density of the reference points thickens at the edges of the segment. These points are called the Chebyshev–Gauss (CG) ones. The interpolation error of the time function of the current, derivative and time integral of the current is estimated in [
11]. In this work, it is shown that the derivative of the solution function has the largest approximation error. We also encounter an approximation of the current derivative in the analysis of transients. To reduce this error, it is advisable to choose the locations of the reference points not in the zeros of the Chebyshev polynomials, but in the maxima. These points are called the Gauss–Lobatto (GL) ones. Thus, the optimal choice of the location of the reference points for different tasks is not clear.
In [
11], the multiplier τ
N = (b − a)
n is included in the formulas for estimating the error, therefore the error largely depends on the dimension of the time segment. At large intervals of variation of the independent variable
t >> τ, the entire modeling interval should be divided into several segments N
u, and Equation (39) should be solved sequentially on each segment by a cyclic run increasing the value of the current time by τ.
2.4. Studies of Transient Modeling Methods
A computer program for the calculation of transients in an AC electric circuit containing the resistive R, inductive L and capacitive C elements connected in series has been developed for researching the considered methods. The capacitor is charged up to the voltage value uc0 before a switching. The voltage source contains the first, fifth, tenth and twentieth harmonics. The calculation according to the program developed on the basis of considered methods has been compared with the exact calculation obtained analytically. The program is compiled in MATLAB.
The equivalent circuit for images of current is shown in
Figure 2. The block-diagram is shown in
Figure 3. The program starts by entering the initial data
R,
L,
C, specifying the interval of simulation
tend − tbegin and the dimension of the one-time segment
Segm. Then, the initial conditions
i0 and
uC0 are given for the first time segment. The number of segments is defined as the whole part of
Nu= (tend − tbegin)/Segm. The program provides a selection of the type of polynomials. For each type, there are features of the formation of matrices
V, D, S. There is also a choice of the method of distribution of reference points
t: at zeros, at the in maxima of the Chebyshev polynomials, as well as a uniform distribution of points.
The operator resistance is calculated. Then cyclic changing of segment number ku from 1 up to Nu is carried out. The calculation error depends on the dimension of the time segment. Choosing a segment dimension for different tasks is done in a trial way. As the segment dimension decreases, the error decreases too.
In each cycle voltage source values are calculated at reference points (vector U), the right-hand side F of Equation (41) is calculated, vector C, the vectors of current values , current derivative , the voltage across the capacitor are calculated. The values of vector elements I, I′, Uc with maximal numbers of nodes of the current segment are determined and they are taken as initial values for the next segment. Calculated values for the current cycle are written to arrays for output. When Nu cycles should be executed, program execution is terminated.
The calculation according to the proposed method was compared with the exact calculation analytically obtained analytically. The program with accompanying subroutines can be freely downloaded from the link [
18] and tested in the MATLAB system. The script program is called RLC_ALCH_1_5_10_20_NU.
4. Discussion
The comparison of the errors obtained in calculations by different methods showed the following results. The method using algebraic polynomials is the most accurate. The mean relative quadratic deviations of the current errors were less than 5 × 10−5%. Errors when using other polynomials were more than 1000 times higher. The lowest accuracy was when using the Hermite polynomials The method of distributing the reference points influenced the accuracy of the calculation. The least errors are in the following distribution methods: algebraic polynomials—in maxima; the Chebyshev and the Legendre polynomials—in zeros; the Hermite polynomials—with a uniform distribution of points.
An increase in the accuracy of calculation can be achieved by reducing the segment size. However, by how many times the segment size decreases, the calculation time increases by the same factor. Increasing the number of reference points n > 7 does not improve the accuracy, but increases the calculation time.
It is possible to provide a simplified explanation of the obtained results. When using other orthogonal polynomials, in comparison with algebraic ones, the coefficients in the expressions representing derivatives and integrals of the currents change significantly. With the equality of the right and left parts of the system of Equation (44), this leads to an increase in errors in the calculation of voltages across each circuit element and the current in the circuit, accordingly.
The calculation time was compared according to the program based on the proposed method and according to the program based on the implicit Euler method of numerical integration of differential equations. The solution of the problem under consideration by the Euler method and its comparison with the solution by the analytical method is given in [
19]. This program can be freely downloaded from the specified link and tested in the MATLAB system. The processor time for calculating this program in the MATLAB system (estimated using the built-in function tic, toc) is 6.8 times greater than when using orthogonal polynomials.
The relative mean quadratic current error is 0.85%, that is, it is much larger when orthogonal polynomials are applied. It can be explained as so: Methods for the numerical integration of differential equations calculate sequentially the values at the current step, based on values at the previous steps. In this case, quite a large number of points are used. When using polynomials, the type of solution function is known—polynomial. In the current segment, N − 1 value is calculated at the reference points, and this reduces the calculation time.
The proposed method was also tested to calculate the transient in a more complex circuit. The computer program can be downloaded from the link [
20]. The calculation results for this program were verified by comparing the calculations obtained using the multistep Geer method as well as the popular Dommel method.
In conclusion, we note that the development and study of the proposed method for calculating complex nonlinear electrical and magneto-electric circuits of arbitrary complexity will be presented in subsequent publications.