Matrix solving method for electromagnetic simulation and computer equipment
The matrix pair is simplified through the Lanczos algorithm and iterative method, and the problems of high computational complexity and memory usage in large-scale problems are solved, and efficient solution of two-dimensional wave port propagation constant and field distribution are realized, which improves the computational efficiency of electromagnetic simulation and Accuracy.
Patent Information
- Application Number
- CN202411773752.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2044-12-05
AI Technical Summary
When calculating the propagation constant and field distribution of two-dimensional wave ports, the calculation complexity and memory usage of large-scale problems are relatively high, making it difficult to achieve efficient solutions.
The Lanczos algorithm combined with iterative methods is used to simplify the matrix pair formed by the stiffness matrix and the mass matrix. By constructing diagonal matrices and tridiagonal matrices with smaller dimensions, the propagation constant and field distribution are approximately solved, which reduces memory usage and improves the solution efficiency.
It significantly reduces memory usage, improves the efficiency of matrix solution, enhances the stability and accuracy of numerical calculations, and is suitable for large-scale problems.
Smart Images

Figure CN119227472A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of electromagnetic simulation technology, and in particular to a matrix solving method and computer equipment for electromagnetic simulation. Background Art
[0002] In the field of electromagnetic simulation, for example, when using the finite element method (FEM) for full-wave electromagnetic analysis, the calculation of the port propagation constant is a key step. The port propagation constant is used to describe the propagation characteristics of electromagnetic waves in a specific medium, and its calculation involves solving a generalized eigenvalue problem. In the field of electromagnetic simulation, the eigenvalues and eigenvectors obtained by solving the generalized eigenvalue problem correspond to the propagation constant of the two-dimensional wave port and the field distribution matching the propagation constant, respectively. These results can be used, for example, for waveguide and transmission line design, device optimization and manufacturing, or device optimization and manufacturing. Existing technologies such as QR decomposition and Cholesky decomposition have higher accuracy when facing small-scale problems, but their computational complexity is , the storage complexity is , which means that the processing time is long and it occupies more memory, so it is not suitable for large-scale problems.
[0003] Therefore, how to accurately and efficiently determine the propagation constant of a two-dimensional wave port and the field distribution that matches the propagation constant is a technical problem that needs to be solved urgently. Summary of the invention
[0004] In view of this, the present application discloses a matrix solving method and computer device for electromagnetic simulation, which can accurately and efficiently determine the propagation constant of a two-dimensional wave port and the field distribution matching the propagation constant, reduce the memory usage in the matrix solving process, and increase the matrix solving efficiency.
[0005] In the first aspect, the present application discloses a matrix solving method for electromagnetic simulation, which determines the propagation constant of the two-dimensional wave port and the field distribution matching the propagation constant by simplifying and solving the generalized eigenvalue problem formed by the stiffness matrix and mass matrix of the two-dimensional wave port, wherein the dimensions of the stiffness matrix and the mass matrix are the same, and the method comprises: initializing a first matrix and a second matrix based on a preset number of propagation constants, wherein the first matrix is used to store eigenvalue information related to the mass matrix, and the second matrix is used to store eigenvalue information related to the stiffness matrix and related information obtained when calculating the residual of the mass matrix; determining a first parameter based on an initial vector and a stiffness matrix, wherein the dimension of the initial vector matches the dimension of the stiffness matrix or the mass matrix and each element in the initial vector is 1, and the first parameter is used to characterize the projection value of the initial vector on the stiffness matrix; and The first parameter is determined by the initial vector and the mass matrix, and the second parameter is used to characterize the projection value of the initial vector on the mass matrix; the residual vector is determined based on the initial vector, the stiffness matrix, the mass matrix, the first parameter and the second parameter, and the third parameter is determined based on the residual vector and the second parameter; the first iteration is performed based on a preset number of iterations and the Lanczos algorithm, and the first iteration is used to update the initial vector, the first parameter, the second parameter and the third parameter; the second iteration is performed based on a preset number of propagation constants, and the second iteration is used to update the first matrix and the second matrix, and the matrix pair formed by the updated first matrix and the updated second matrix is a simplified model of the matrix pair formed by the stiffness matrix and the mass matrix; the matrix pair formed by the updated first matrix and the updated second matrix is solved to obtain the propagation constant of the two-dimensional wave port and the field distribution matching the propagation constant.
[0006] Optionally, the stiffness matrix and the mass matrix are symmetric sparse matrices, the first matrix is a diagonal matrix, and the second matrix is a tridiagonal matrix.
[0007] Optionally, the first parameter is the Rayleigh quotient of the initial vector relative to the stiffness matrix, and the second parameter is the Rayleigh quotient of the initial vector relative to the mass matrix.
[0008] Optionally, the matrix solution method for electromagnetic simulation also includes: normalizing the initial vector to make the lengths of multiple field distributions consistent; wherein the number of field distributions is equal to a preset number of propagation constants, and the length of the field distribution is used to characterize the number of degrees of freedom of the two-dimensional wave port.
[0009] Optionally, when normalizing the initial vector, the initial vector is divided by the L2 norm of the initial vector.
[0010] Optionally, the residual vector is determined based on the initial vector, the stiffness matrix, the mass matrix, the first parameter and the second parameter, and the calculation formula is as follows: ; ; in, is the residual vector, A is the stiffness matrix, B is the mass matrix, is the first parameter, is the second parameter, is the initial vector, =0, =1, is the zero vector.
[0011] Optionally, the matrix solving method for electromagnetic simulation further includes: Normalize the residual vector and update the initial vector based on the normalized residual vector. The calculation formula is as follows: ; ; in, is the residual vector, is the L2 norm of the residual vector, is the updated initial vector.
[0012] Optionally, the matrix solution method for electromagnetic simulation further includes: updating the first parameter and the second parameter based on the updated initial vector; and multiplying the L2 norm of the residual vector by the updated second parameter to obtain a third parameter.
[0013] Optionally, a second iteration is performed based on a preset number of propagation constants, and the second iteration is used to update the first matrix and the second matrix, including: inserting the second parameter and the iterative value of the second parameter in sequence into the main diagonal of the first matrix to update the first matrix; inserting the first parameter, the iterative value of the first parameter, the third parameter, and the iterative value of the third parameter in sequence into the main diagonal of the second matrix and the diagonal adjacent to the main diagonal.
[0014] In a second aspect, the present application discloses a computer device for electromagnetic simulation, comprising a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the matrix solution method for electromagnetic simulation in the first aspect above.
[0015] In summary, the matrix solving method and computer device for electromagnetic simulation disclosed in the present application have at least the following beneficial effects: by introducing the Lanczos algorithm, combining the iterative method to screen out suitable initial values and initial vectors, based on the above initial values and initial vectors, construct diagonal matrices and tridiagonal matrices with smaller dimensions, that is, by means of simplification, the matrix pair formed by the stiffness matrix and the mass matrix with higher dimensions is simplified to a matrix pair formed by the first matrix and the second matrix with lower dimensions. By solving the eigenvalues (corresponding to the propagation constants) and eigenvectors (corresponding to the field distribution) of the matrix pair formed by the first matrix and the second matrix with lower dimensions to approximate the original characteristic problem, the memory usage is significantly reduced, and the solution efficiency is greatly increased; at the same time, in the process of iteration and orthogonalization, Gram-Schmidt orthogonalization can be used to ensure that the generated vectors are linearly independent, reduce the accumulation of numerical errors, and thus improve the stability and accuracy of numerical calculations. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The following is a brief introduction to the drawings used in describing the embodiments of the present application: Figure 1 An example flowchart of a matrix solution method for electromagnetic simulation disclosed in some embodiments of the present application is shown.
[0017] Figure 2 The diagram shows the distribution of non-zero elements of various matrices disclosed in some embodiments of the present application.
[0018] Figure 3 The diagram shows the distribution of non-zero elements of various matrices disclosed in some embodiments of the present application.
[0019] Figure 4 A grid diagram disclosed in some embodiments of the present application is shown.
[0020] Figure 5 The electric field distribution diagram of the port disclosed in some embodiments of the present application is shown. DETAILED DESCRIPTION
[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the specific implementation methods of the present application will be described below with reference to the accompanying drawings. The accompanying drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other accompanying drawings and other implementation methods can be obtained based on these drawings without creative work. Adjustments and improvements made without departing from the concept of the present application are all within the scope of protection of the present application.
[0022] In order to simplify the drawings, only the parts related to the corresponding embodiments are schematically shown in each figure, and they do not represent the actual structure of the product. In addition, in order to simplify the drawings and facilitate understanding, only part of the components with the same structure or function in some figures are schematically drawn, and there may be more or fewer components with the same structure or function in reality.
[0023] In this application, unless otherwise clearly specified and limited, ordinal numbers, such as "first", "second", etc., are only used to distinguish and describe associated objects, and cannot be understood as indicating or implying the relative importance or order between associated objects; in addition, they do not represent the number of associated objects. "Multiple" includes two or more, and other quantifiers are similar. " / " is used to describe the relationship between associated objects, which indicates the "or" relationship between associated objects. "And / or" is used to describe the relationship between associated objects, which includes any combination relationship between associated objects, such as "a and / or b" includes: "alone a", "alone b", or "a and b". "One or more" or "at least one" in multiple objects refers to any object or any combination of multiple objects, such as "one or more of a1, a2, a3" or "at least one of a1, a2, a3" includes: "alone a1", "alone a2", "alone a3", "a1 and a2", "a1 and a3", "a2 and a3", or "a1, a2 and a3".
[0024] In scientific and engineering computing, generalized eigenvalue problems are widely used. For example, given two symmetric matrices, represented by A and B, the goal of the generalized eigenvalue problem is to find The eigenvalue of and its corresponding eigenvector x. The calculation of eigenvalues and eigenvectors plays a vital role in many applications, such as structural analysis, vibration analysis, stability analysis, quantum mechanics, etc. In different fields, the meanings of various parameters in the generalized eigenvalue problem are different.
[0025] In the field of electromagnetic simulation, for example, when using the finite element method for full-wave electromagnetic analysis, the calculation of port propagation constants is a key step. Port propagation constants are used to describe the propagation characteristics of electromagnetic waves in a specific medium, and their calculation involves solving generalized eigenvalue problems. Accurately and efficiently solving these eigenvalue problems is crucial to improving simulation accuracy and efficiency. In the field of electromagnetic simulation, generalized eigenvalue problems The meanings of the various parameters in are as follows. Among them, A is the stiffness matrix, which can also be called the left matrix. The stiffness matrix describes the spatial distribution characteristics of the electromagnetic field in the system, which is specifically reflected in the divergence and curl of the electric or magnetic field, and reflects the constraints of material properties (such as dielectric constant, magnetic permeability) and geometric characteristics on the field distribution. In the finite element method, the stiffness matrix can be obtained by discretizing Maxwell's equations and introducing boundary conditions; or it can be determined by the geometric shape of the waveguide area, material parameters and the division of the finite element mesh. B is the mass matrix, which can also be called the right matrix. The mass matrix describes the distribution characteristics of the field energy, reflects the inertial properties of the system in frequency or propagation direction; and corresponds to the influence of the dielectric constant distribution or magnetic permeability distribution of the material on the field energy. In the finite element discretization, the mass matrix can be formed by the inner product integral of the basis function, for example, to represent the energy coupling relationship of the field in space. Eigenvalue It represents the intrinsic parameters of the system, for example, it is related to the square of the propagation constant in a waveguide and to the square of the resonant frequency in a resonant cavity; different eigenvalues represent different propagation modes or resonant modes. For the obtained eigenvalues, they are expressed in complex form: the real part is related to the propagation speed or frequency, and the imaginary part is related to the loss or attenuation. The eigenvector x represents the spatial distribution of the electromagnetic field, that is, the vector components of the electric field or magnetic field at discrete nodes; different eigenvectors correspond to field distributions of different modes, such as TE mode, TM mode or mixed mode in a waveguide. The length of the eigenvector is equal to the number of degrees of freedom, that is, the total number of unknowns after finite element discretization.
[0026] Field distribution is actually a mathematical expression of a physical phenomenon, and in the finite element method, field distribution is described by "edge basis function coefficient vector (weight)", and the two are closely related. The "edge basis function" in the finite element is the basis function used to approximate the electromagnetic field, and the "coefficient vector" is the weighted value of these basis functions, which determines the contribution of each basis function in the actual field distribution. In other words, the field distribution is composed of multiple basis functions superimposed according to weights, and the weights directly reflect the importance of each basis function in the field distribution. Therefore, there is a direct connection between the field distribution and these weights (coefficient vectors): different weight values will correspond to different field distribution forms.
[0027] In the field of electromagnetic simulation, a two-dimensional wave port is a boundary condition used to excite and analyze the distribution of electromagnetic fields. It can be used in electromagnetic simulation methods such as finite element and finite difference time domain to describe the propagation characteristics of electromagnetic waves in waveguides, transmission lines or other waveguide structures. By definition, a two-dimensional wave port is an imaginary plane (usually coincident with the cross section of a waveguide or transmission line) used to describe the field distribution and its propagation characteristics in the transverse direction. In addition, a two-dimensional wave port can also be used to analyze the modes (such as TE mode and TM mode) and the corresponding propagation constants of electromagnetic waves when they propagate longitudinally along a waveguide.
[0028] The finite element method is a powerful tool for solving complex engineering problems: by discretizing the continuous domain into a finite number of subdomains, the finite element method transforms partial differential equations into a set of algebraic equations that can be solved on a computer. However, this process generates a very large matrix, especially when the grid is very dense. The solution of such a large matrix is not only computationally intensive, but also consumes a lot of memory, becoming a bottleneck problem in numerical calculations.
[0029] Traditional methods for solving generalized eigenvalue problems include direct methods and iterative methods. Direct methods such as QR decomposition and Cholesky decomposition have higher accuracy when facing small-scale problems, but their computational complexity is , the storage complexity is , which is not suitable for large-scale problems. Iterative methods such as the Jacobi-Davidson method, the Arnoldi method, and the Lanczos algorithm can approximate eigenvalues and eigenvectors through iteration, and have good computational efficiency and storage efficiency. Existing generalized eigenvalue solution methods, such as the Jacobi-Davidson method and the Arnoldi method, can solve large-scale problems to a certain extent, but there is still room for improvement in solution speed and memory usage.
[0030] The Lanczos algorithm is an efficient iterative algorithm for large symmetric eigenvalue problems. It approximates the eigenvalues and eigenvectors of the original problem by constructing an eigenvalue problem of a tridiagonal matrix, thereby greatly reducing the computational complexity and storage requirements. However, for generalized eigenvalue problems, the classic Lanczos algorithm needs to be appropriately adjusted to handle the characteristics of the matrix pair (A, B).
[0031] Therefore, the idea of the present application is to design a matrix solution method for electromagnetic simulation based on the Lanczos algorithm, and to determine the propagation constant of the two-dimensional wave port and the field distribution matching the propagation constant by simplifying and solving the generalized eigenvalue problem formed by the stiffness matrix and mass matrix of the two-dimensional wave port. In other words, compared with directly solving high-dimensional matrix pairs, the present application improves the efficiency of matrix solution by simplifying high-dimensional matrix pairs into low-dimensional matrix pairs; because the resources spent on solving matrices with smaller dimensions are also smaller, the propagation constant of the two-dimensional wave port and the field distribution matching the propagation constant can be accurately and efficiently determined.
[0032] Figure 1 FIG. 1 shows an example flow chart of a matrix solution method for electromagnetic simulation disclosed in some embodiments of the present application. Figure 1 As shown in FIG. 1 , the matrix solution method for electromagnetic simulation determines the propagation constant of the two-dimensional wave port and the field distribution matching the propagation constant by simplifying and solving the generalized eigenvalue problem formed by the stiffness matrix and the mass matrix of the two-dimensional wave port. The dimensions of the stiffness matrix and the mass matrix are the same. The method includes: S100, initializing a first matrix and a second matrix based on a preset number of propagation constants, the first matrix being used to store eigenvalue information related to a mass matrix, and the second matrix being used to store eigenvalue information related to a stiffness matrix and related information obtained when calculating a residual error of the mass matrix; S200, determining a first parameter based on an initial vector and a stiffness matrix, wherein the dimension of the initial vector matches the dimension of the stiffness matrix or the mass matrix and each element in the initial vector is 1, and the first parameter is used to characterize a projection value of the initial vector on the stiffness matrix; S300, determining a second parameter based on the initial vector and the mass matrix, where the second parameter is used to characterize a projection value of the initial vector on the mass matrix; S400, determining a residual vector based on the initial vector, the stiffness matrix, the mass matrix, the first parameter and the second parameter, and determining a third parameter based on the residual vector and the second parameter; S500, performing a first iteration based on a preset number of iterations and a Lanczos algorithm, where the first iteration is used to update an initial vector, a first parameter, a second parameter, and a third parameter; S600, performing a second iteration based on a preset number of propagation constants, the second iteration being used to update the first matrix and the second matrix, wherein a matrix pair formed by the updated first matrix and the updated second matrix is a simplified model of a matrix pair formed by a stiffness matrix and a mass matrix; S700, solving a matrix pair formed by an updated first matrix and an updated second matrix to obtain a propagation constant of a two-dimensional wave port and a field distribution matching the propagation constant.
[0033] By introducing the Lanczos algorithm and combining iterative methods to select suitable initial values and initial vectors, based on the above initial values and initial vectors, diagonal matrices and tridiagonal matrices with smaller dimensions are constructed, that is, by simplifying the matrix pair formed by the stiffness matrix and mass matrix with higher dimensions, it is simplified to a matrix pair formed by the first matrix and the second matrix with lower dimensions. By solving the eigenvalues (corresponding to propagation constants) and eigenvectors (corresponding to field distribution) of the matrix pair formed by the first matrix and the second matrix with lower dimensions to approximate the original characteristic problem, the memory usage is significantly reduced and the solution efficiency is greatly increased; at the same time, in the process of iteration and orthogonalization, Gram-Schmidt orthogonalization can be used to ensure that the generated vectors are linearly independent, reduce the accumulation of numerical errors, and thus improve the stability and accuracy of numerical calculations.
[0034] For the sake of distinction, the stiffness matrix is called A and the mass matrix is called B. The stiffness matrix A and the mass matrix B form a matrix pair. The dimension of a matrix is related to the number of rows and columns of the matrix. The stiffness matrix A and the mass matrix B have the same dimension, that is, they have the same number of rows and the same number of columns. When dealing with large-scale problems, the dimensions of the matrices are relatively large. For example, the dimensions of the stiffness matrix A and the mass matrix B can be (5251, 5251). Figure 2 and Figure 3 1 and 2 show the distribution diagrams of non-zero elements of various matrices disclosed in some embodiments of the present application. Figure 2 is the distribution diagram of the non-zero elements of the stiffness matrix A above, Figure 3 is the distribution diagram of the non-zero elements of the mass matrix B above. Figure 4 Graphs of the meshes disclosed in some embodiments of the present application are shown. The stiffness matrix A and the mass matrix B can be represented by Figure 4 The mesh shown is generated by combining the finite element method. In this application, the propagation constant of the two-dimensional wave port has the following corresponding relationship with the eigenvalue in the generalized eigenvalue problem: , , ;in, is the characteristic value, is the propagation constant, is the maximum magnetic permeability in the two-dimensional wave port, is the maximum dielectric constant in the 2D wave port, is the vacuum permeability, is the dielectric constant of vacuum, and f is the frequency.
[0035] In many practical applications, such as physics or engineering problems, the largest eigenvalues and their corresponding eigenvectors often contain the most important information. For example, in applications such as vibration analysis, energy distribution, and modal analysis, the largest eigenvalue can represent the main mode or main dynamic behavior of the system. Moreover, computing resources and time are key issues in solving large-scale matrices. If all eigenvalues are calculated (especially for matrices with larger dimensions), it will be very time-consuming. Therefore, by only solving the first few important eigenvalues, the amount of calculation and time can be significantly reduced. By solving several important eigenvalues, the computational efficiency can be greatly improved while ensuring accuracy, and resources are no longer wasted to solve all eigenvalues. It can be seen that for matrices (especially matrices with larger dimensions), there can be several eigenvalues and corresponding eigenvectors, but only the important values (such as the maximum value) can be solved, so as to take into account both accuracy and efficiency. In this application, the propagation constant of the two-dimensional wave port and the field distribution matching the propagation constant are determined by solving the maximum eigenvalue and the corresponding eigenvector of the generalized eigenvalue problem. Exemplarily, the preset number m of the propagation constant can be set to 2, that is, the maximum eigenvalue and the eigenvalues near it are calculated. By solving two eigenvalues, a more accurate description of the feature space can be obtained, the algorithm stability and accuracy can be improved, the multimodal characteristics of the system can be captured, and better error analysis and verification can be provided. After obtaining two eigenvalues, the larger eigenvalue is selected as the target value of this matrix solution.
[0036] The first matrix and the second matrix are initialized based on a preset number of propagation constants. For the sake of distinction, the first matrix is referred to as D and the second matrix is referred to as T. During initialization, all elements in the first matrix D and the second matrix T are 0. The dimension of the first matrix D is set to (m+1, m+1), and the dimension of the second matrix T is set to (m, m); in the present embodiment, since m=2, the dimension of the first matrix D is (3, 3), and the dimension of the second matrix T is (2, 2). Among them, the first matrix D is used to store eigenvalue information related to the mass matrix B, and the second matrix T is used to store eigenvalue information related to the stiffness matrix A and the related information obtained when calculating the residual of the mass matrix B. The eigenvalue information related to the stiffness matrix A may include, for example, an initial vector (for the sake of distinction, the initial vector is referred to as ) is the projection value of the stiffness matrix A, which can be called the first parameter (for the sake of distinction, the first parameter is called ), the eigenvalue information related to the mass matrix B may include, for example, the initial vector The projection value of the mass matrix B can be called the second parameter (for the sake of distinction, the second parameter is called ); where the initial vector The dimension of matches the dimension of the stiffness matrix A or the mass matrix B. In this embodiment, since the dimensions of the stiffness matrix A and the mass matrix B are (5251, 5251), the initial vector Set to a vector of all 1s with a dimension of (5251, 1), i.e. the initial vector All elements in are 1.
[0037] In some embodiments of the present application, the matrix solution method for electromagnetic simulation also includes: normalizing the initial vector to make the lengths of multiple field distributions consistent; wherein the number of field distributions is equal to the preset number of propagation constants, and the length of the field distribution is used to characterize the number of degrees of freedom of the two-dimensional wave port. Since in the generalized eigenvalue problem, the solved eigenvalues and eigenvectors appear in pairs, the number of field distributions in the present application is equal to the preset number of propagation constants. The above normalization operation can simplify the calculation while taking into account the accuracy of the calculation process. For example, in the normalized initial vector When the initial vector Divide by the initial vector The L2 norm of . The calculation formula is as follows:
[0038] in, is the initial vector The L2 norm of . After normalization, the final element size is 0.0138. Normalization can suppress the numerical expansion or contraction of the vector size during the iteration process, thereby improving numerical stability. Normalization is performed. As the number of iterations increases, the value of the vector may become too large or too small, resulting in unstable numerical calculations, which in turn affects the convergence and accuracy of the algorithm. In addition, normalization can keep the length of the eigenvector consistent at each iteration, which is beneficial to the consistency and predictability of the algorithm. This can reduce the inconsistency of the algorithm caused by changes in vector length, especially when solving large-scale sparse matrices. At the same time, the normalized vector can simplify subsequent calculation steps. For example, when calculating the Rayleigh quotient, the normalized vector can simplify the formula and reduce the complex vector length calculation.
[0039] In some embodiments of the present application, the first parameter is the initial vector The second parameter is the Rayleigh quotient relative to the stiffness matrix A. is the initial vector The Rayleigh quotient with respect to the mass matrix B. The first parameter and the second parameter The initial vector can be measured separately The projection value under the stiffness matrix A and the mass matrix B. The calculation formula is as follows:
[0040] Among them, the initial vector It can be the normalized initial vector, so as to eliminate the denominator of the Rayleigh quotient and reduce the amount of calculation. In this embodiment, the first parameter can be calculated as The value is 1.68517+1.64031i, the second parameter The value is 1.68749+1.64121i.
[0041] In some embodiments of the present application, the stiffness matrix A and the mass matrix B are symmetric sparse matrices, the first matrix D is a diagonal matrix, and the second matrix T is a tridiagonal matrix. That is, only the elements of the first matrix D on its main diagonal may not be 0, and only the elements of the second matrix T on its main diagonal and the diagonals adjacent to the main diagonal may not be 0.
[0042] In some embodiments of the present application, based on the initial vector , stiffness matrix A, mass matrix B, first parameter and the second parameter Determine the residual vector (for ease of distinction, the residual vector is called ), the calculation formula is as follows:
[0043] in, is the residual vector, A is the stiffness matrix, B is the mass matrix, is the first parameter, is the second parameter, is the initial vector, =0, =1, is the zero vector.
[0044] In this embodiment, the residual vector is calculated The subsequent first iteration based on the preset number of iterations and the Lanczos algorithm is to iteratively update the initial vector , thereby increasing the initial vector The quality of the initial vector To calculate the first parameter of high quality , the second parameter and the third parameter (for ease of distinction, the third parameter is called ); In this way, a reasonable first matrix D and second matrix T can be constructed, and the eigenvalues and eigenvectors of the first matrix D and the second matrix T can be solved to better fit the eigenvalues and eigenvectors of the matrix pair (A, B), and obtain the required propagation constant of the two-dimensional wave port and the field distribution matching the propagation constant. Therefore, before constructing the submatrix (i.e., the first matrix D and the second matrix T), the matrix solving method disclosed in the present application combines the Lanczos algorithm to construct a loop module (the loop module is used for the first iteration) for the initial vector at a preset iteration step k. For example, at the i-th iteration, formula (2) and formula (3) are used to calculate the value of as well as , where i<=k; Substitute into formula (4) to calculate the linear equation system and calculate the residual vector under this number of iteration steps: ; then , Substitute into formula 5, An orthogonalization operation is performed, which may be a Gram-Schmidt orthogonalization operation, for example, to reduce numerical errors and error accumulation; the residual vector is normalized, and the initial vector is updated based on the normalized residual vector, and the calculation formula is as follows:
[0045] in, is the residual vector, is the L2 norm of the residual vector, is the updated initial vector. In the subsequent operation, the updated initial vector obtained in formula (7) is used. Calculate as the initial vector. Based on the updated initial vector , update the first parameter and the second parameter ; The L2 norm of the residual vector Multiply by the updated second parameter , get the third parameter The calculation formula is as follows:
[0046] in, Is the third parameter.
[0047] Subsequently, a second iteration is performed based on a preset number m of propagation constants to update the first matrix D and the second matrix T. Exemplarily, when updating the first matrix D and the second matrix T, the second parameter and the iterative value of the second parameter may be sequentially inserted into the main diagonal of the first matrix D to update the first matrix D; the first parameter, the iterative value of the first parameter, the third parameter, and the iterative value of the third parameter may be sequentially inserted into the main diagonal of the second matrix and the diagonal adjacent to the main diagonal. The calculation formula is as follows:
[0048] Among them, since the first matrix D is a diagonal matrix, For the elements on its main diagonal, for example is the first element, For the second element, is the third element. The purpose of this step is to construct the first matrix D and the second matrix T. Iterate at the preset number m=2 to be solved, and the iteration step starts from j=1 and ends when j=m-1. Each iteration updates the element values of the second matrix T with indexes (j-1, j-1), (j-1, j), (j, j-1), (j, j). When the number of iterations is j: First, use formula (11) to calculate the residual vector at each iteration ; Then use formula (12) to calculate the residual vector Perform Gram-Schmidt orthogonalization to reduce numerical errors and error accumulation; use formula (13) to calculate the residual vector The L2 norm of ; Through the residual vector The normalization of formula (14) is the update vector ; Combine formulas (15), (16) and (17) to update the elements corresponding to the j+1 position in the first and second parameters, and update the diagonal element values at the position (j+1, j+1) in the first matrix D. Finally, using the relationship in formulas (18), (19) and (20), update the element values at the positions (j-1, j-1), (j-1, j), (j, j-1), and (j, j) in the second matrix T, respectively. , , and The second iteration is thus completed, and the elements in the first matrix D and the second matrix T are updated.
[0049] Since the dimension of the first matrix D is (3, 3), which does not match the dimension of the second matrix T (2, 2), the first row and the first column of the first matrix D are deleted to make the dimensions of the first matrix D and the second matrix T consistent. In this embodiment, the updated values of the first matrix D and the second matrix T are as follows: ; .
[0050] Solve the matrix pair formed by the updated first matrix D and the updated second matrix T to obtain the propagation constant of the two-dimensional wave port and the field distribution matching the propagation constant. Compared with the matrix pair formed by the stiffness matrix A and the mass matrix B with dimensions (5251, 5251), the matrix pair formed by the updated first matrix D and the second matrix T with dimensions (2, 2) obtained after the above series of operations is obviously easier to solve, and because the eigenvalues and eigenvectors of the first matrix D and the second matrix T can highly fit the target eigenvalues and target eigenvectors of the stiffness matrix A and the mass matrix B, the required target eigenvalues and target eigenvectors can be obtained by solving the eigenvalues and eigenvectors of the first matrix D and the second matrix T. Exemplarily, the generalized eigenvalues and eigenvectors can be solved in combination with the open source matrix solver Lapack, where the obtained eigenvalues are the m eigenvalues of the matrix pair (A, B).
[0051] The final eigenvalues obtained are: 2.54543e-5 - 113821e-5i, 5.69401-0.000247311i. At this time, the larger value, that is, 5.69401-0.000247311i, is selected as the target value to determine the propagation constant of the two-dimensional wave port. The maximum eigenvalue of the commercial matrix solver is 5.694005-0.0002473105i. It can be seen that the maximum eigenvalue obtained by the present application is similar to the maximum eigenvalue obtained by the commercial matrix solver through conventional means, which proves the reliability of the matrix solution method for electromagnetic simulation of the present application. The corresponding eigenvector L2 norm scaling factor ratio is 0.16234. Figure 5 The port electric field distribution diagram disclosed in some embodiments of the present application is shown. The rationality of the characteristic vector is tested by combining the finite element method and the characteristic vector to draw the port electric field distribution. Figure 5It can be seen that the electric field is the largest at the port, the magnitude of the electric field vector decays from the port to the outside, and the vector field distribution is reasonable, which indirectly verifies the rationality of the eigenvector calculation in the finite element port. Since the commercial solver solves all eigenvalues and eigenvectors, it takes 1002s. When performing finite element calculations, under this mode drive, it is not necessary to calculate all eigenvalues. Only the maximum eigenvalue and its nearby eigenvalues and corresponding eigenvectors need to be calculated. Therefore, the time spent by this method to solve the maximum eigenvalue under the main mode drive is 11.606s. In summary, in the finite element simulation under mode excitation, this method is used to solve the eigenvalues of the port finite element sparse matrix, and several required eigenvalues and their corresponding eigenvectors can be solved in a targeted manner. Under the premise of ensuring the calculation accuracy, the calculation efficiency has been significantly improved compared to solving all eigenvalues.
[0052] Based on similar technical concepts, the present application discloses a computer device for electromagnetic simulation, including a memory, a processor and a computer program stored in the memory, and the processor executes the computer program to implement the steps of the matrix solution method for electromagnetic simulation disclosed in the above embodiments.
[0053] Exemplarily, the computer device used for electromagnetic simulation can be a two-dimensional wave port solver. The two-dimensional wave port solver can obtain the propagation constant of each propagation mode by solving the generalized eigenvalue problem on the waveguide cross section. The real part of the propagation constant can be used to characterize the attenuation rate of the wave, and the imaginary part can be used to characterize the phase constant of the wave. In practical applications, the two-dimensional wave port solver can be used to determine the working mode and cutoff frequency of the waveguide or transmission line based on the above characteristics, analyze the dispersion characteristics of each mode in the multimode waveguide, and provide a basis for transmission line design, waveguide coupler and filter optimization. In addition, the two-dimensional wave port solver can calculate the transverse field distribution of each propagation mode, including the transverse electric field and the transverse magnetic field. This field distribution intuitively shows the energy distribution characteristics of the electromagnetic wave on the waveguide cross section. In practical applications, the two-dimensional wave port solver can be used for mode matching analysis based on the above characteristics to optimize the coupling efficiency between different waveguide structures or feeding systems.
[0054] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments. In addition, the above embodiments can be freely combined as needed.
Claims
1. A matrix solving method for electromagnetic simulation, characterized in that: The propagation constant of the two-dimensional wave port and the field distribution matching the propagation constant are determined by simplifying and solving a generalized eigenvalue problem formed by a stiffness matrix and a mass matrix of the two-dimensional wave port, wherein the stiffness matrix and the mass matrix have the same dimension, and the method includes: Initializing a first matrix and a second matrix based on a preset number of the propagation constants, the first matrix being used to store eigenvalue information related to the mass matrix, and the second matrix being used to store eigenvalue information related to the stiffness matrix and related information obtained when calculating the residual of the mass matrix; Determine a first parameter based on an initial vector and the stiffness matrix, wherein the dimension of the initial vector matches the dimension of the stiffness matrix or the mass matrix and each element in the initial vector is 1, and the first parameter is used to characterize a projection value of the initial vector on the stiffness matrix; Determine a second parameter based on the initial vector and the mass matrix, where the second parameter is used to characterize a projection value of the initial vector on the mass matrix; Determine a residual vector based on the initial vector, the stiffness matrix, the mass matrix, the first parameter, and the second parameter, and determine a third parameter based on the residual vector and the second parameter; Perform a first iteration based on a preset number of iterations and a Lanczos algorithm, wherein the first iteration is used to update the initial vector, the first parameter, the second parameter, and the third parameter; Performing a second iteration based on a preset number of the propagation constants, the second iteration being used to update the first matrix and the second matrix, wherein a matrix pair formed by the updated first matrix and the updated second matrix is a simplified model of a matrix pair formed by the stiffness matrix and the mass matrix; A matrix pair formed by the updated first matrix and the updated second matrix is solved to obtain the propagation constant of the two-dimensional wave port and a field distribution matching the propagation constant.
2. The matrix solving method for electromagnetic simulation according to claim 1, characterized in that: The stiffness matrix and the mass matrix are symmetric sparse matrices, the first matrix is a diagonal matrix, and the second matrix is a tridiagonal matrix.
3. The matrix solving method for electromagnetic simulation according to claim 1 or 2, characterized in that: The first parameter is the Rayleigh quotient of the initial vector relative to the stiffness matrix, and the second parameter is the Rayleigh quotient of the initial vector relative to the mass matrix.
4. The matrix solving method for electromagnetic simulation according to claim 1, characterized in that: Also includes: Normalizing the initial vector to make the lengths of the plurality of field distributions consistent; The number of the field distributions is equal to the preset number of the propagation constants, and the length of the field distribution is used to characterize the number of degrees of freedom of the two-dimensional wave port.
5. The matrix solving method for electromagnetic simulation according to claim 4, characterized in that: When normalizing the initial vector, the initial vector is divided by the L2 norm of the initial vector.
6. The matrix solving method for electromagnetic simulation according to claim 1, characterized in that: The residual vector is determined based on the initial vector, the stiffness matrix, the mass matrix, the first parameter and the second parameter, and the calculation formula is as follows: ; ; in, is the residual vector, A is the stiffness matrix, B is the mass matrix, is the first parameter, is the second parameter, is the initial vector, =0, =1, is the zero vector.
7. The matrix solving method for electromagnetic simulation according to claim 6, characterized in that: Also includes: Normalize the residual vector, and update the initial vector based on the normalized residual vector. The calculation formula is as follows: ; ; in, is the residual vector, is the L2 norm of the residual vector, is the updated initial vector.
8. The matrix solving method for electromagnetic simulation according to claim 7, characterized in that: Also includes: Based on the updated initial vector, updating the first parameter and the second parameter; The L2 norm of the residual vector is multiplied by the updated second parameter to obtain the third parameter.
9. The matrix solving method for electromagnetic simulation according to claim 2, characterized in that: The performing a second iteration based on a preset number of the propagation constants, wherein the second iteration is used to update the first matrix and the second matrix, comprises: inserting the second parameter and the iterated value of the second parameter into the main diagonal of the first matrix in sequence to update the first matrix; The first parameter, the iterated value of the first parameter, the third parameter, and the iterated value of the third parameter are sequentially inserted into the main diagonal of the second matrix and a diagonal adjacent to the main diagonal.
10. A computer device for electromagnetic simulation, comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the steps of the matrix solving method for electromagnetic simulation according to any one of claims 1 to 9.
Citation Information
Patent Citations
Integrated circuit three-dimensional full-wave electromagnetic simulation direct-current component extraction method and system
CN113591431A
Rectangular waveguide litter mode electromagnetic characteristic solving method
CN116992730A
Efficient automatic multi-substructure out-of-core parallel computing method
CN118606063A
Transmission line electromagnetic simulation method, computer equipment and storage medium
CN118734776A
Cited By
Data processing method for solving local feature pair of generalized feature equation
CN120407996A
