Matrix solution method and computer equipment for electromagnetic simulation
By simplifying the matrix problem of two-dimensional wave ports, using Lanczos algorithm and iterative method, the problems of high computational complexity and large memory usage in the existing technology are solved, and efficient and accurate matrix solution is achieved, which is suitable for large-scale electromagnetic simulation.
Patent Information
- Application Number
- CN202411773752.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2044-12-05
AI Technical Summary
When calculating the propagation constant and field distribution of two-dimensional wave ports, the prior art faces the problems of high computing complexity and large memory usage, and it is difficult to effectively solve large-scale problems.
By simplifying the generalized eigenvalue problem formed by the stiffness matrix and mass matrix of two-dimensional wave ports, the Lanczos algorithm and iterative method are used to construct diagonal and tridiagonal matrices with smaller dimensions, and approximately solve the propagation constant and field distribution.
It significantly reduces memory usage, improves the efficiency of matrix solution, ensures the stability and accuracy of calculations, and is suitable for solving large-scale problems.
Smart Images

Figure CN119227472B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electromagnetic simulation technology, and more particularly to a matrix solving method and computer equipment for electromagnetic simulation. Background Technology
[0002] In the field of electromagnetic simulation, such as when using the finite element method (FEM) for full-wave electromagnetic analysis, calculating the port propagation constant is a crucial step. The port propagation constant describes the propagation characteristics of electromagnetic waves in a specific medium, and its calculation involves solving a generalized eigenvalue problem. Furthermore, in electromagnetic simulation, the eigenvalues and eigenvectors obtained by solving the generalized eigenvalue problem correspond to solving the propagation constant of a two-dimensional wave port and the field distribution matching that 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 techniques such as QR decomposition and Cholesky decomposition offer high accuracy for small-scale problems, but their computational complexity is... The storage complexity is This means that the processing time is long and the memory consumption is high, making it unsuitable 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 urgently needs to be solved. Summary of the Invention
[0004] In view of this, this 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 a first aspect, this application discloses a matrix solving method for electromagnetic simulation. By simplifying and solving the generalized eigenvalue problem formed by the stiffness matrix and mass matrix of a two-dimensional waveport, the propagation constant of the two-dimensional waveport and the field distribution matching the propagation constant are determined. The stiffness matrix and mass matrix have the same dimension. The method includes: initializing a first matrix and a second matrix based on a preset number of propagation constants. The first matrix stores eigenvalue information related to the mass matrix, and the second matrix stores eigenvalue information related to the stiffness matrix and related information obtained during residual calculation of the mass matrix; determining a first parameter based on an initial vector and the stiffness matrix. The dimension of the initial vector matches the dimension of the stiffness matrix or the mass matrix, and all elements in the initial vector are 1. The first parameter characterizes the projection value of the initial vector onto the stiffness matrix; based on the initial... The initial vector and mass matrix determine the second parameter, which characterizes the projection of the initial vector onto the mass matrix. The residual vector is determined based on the initial vector, stiffness matrix, mass matrix, first parameter, and second parameter, and the third parameter is determined based on the residual vector and second parameter. A first iteration is performed based on a preset number of iterations and the Lanczos algorithm, updating the initial vector, first parameter, second parameter, and third parameter. A second iteration is performed based on a preset number of propagation constants, updating the first and second matrices. The matrix pair formed by the updated first and second matrices is a simplified model of the matrix pair formed by the stiffness matrix and mass matrix. Solving the matrix pair formed by the updated first and second matrices yields the propagation constant of the two-dimensional waveport and the field distribution matching the propagation constant.
[0006] Optionally, the stiffness matrix and 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 solving method for electromagnetic simulation further 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.
[0009] Optionally, when normalizing the initial vector, the initial vector is divided by its L2 norm.
[0010] Optionally, the residual vector is determined based on the initial vector, stiffness matrix, mass matrix, first parameter, and second parameter, and the calculation formula is as follows:
[0011] ;
[0012] ;
[0013] in, Let A be the residual vector, A be the stiffness matrix, and B be the mass matrix. As the first parameter, For the second parameter, As the initial vector, =0, =1, It is a zero vector.
[0014] Optionally, the matrix solution method for electromagnetic simulation also includes:
[0015] The normalized residual vector is used to update the initial vector, and the calculation formula is as follows:
[0016] ;
[0017] ;
[0018] in, For the residual vector, Let L2 norm be the residual vector. This is the updated initial vector.
[0019] Optionally, the matrix solving method for electromagnetic simulation further includes: updating the first and second parameters based on the updated initial vector; and multiplying the L2 norm of the residual vector by the updated second parameter to obtain the third parameter.
[0020] Optionally, a second iteration is performed based on a preset number of propagation constants. The second iteration is used to update the first matrix and the second matrix, including: inserting the iteration values of the second parameter and the second parameter into the main diagonal of the first matrix in sequence to update the first matrix; and inserting the first parameter, the iteration value of the first parameter, the third parameter, and the iteration value of the third parameter into the main diagonal of the second matrix and the diagonal adjacent to the main diagonal in sequence.
[0021] Secondly, this application discloses a computer device for electromagnetic simulation, including a memory, a processor, and a computer program stored in the memory. The processor executes the computer program to implement the steps of the matrix solving method for electromagnetic simulation described in the first aspect above.
[0022] In summary, the matrix solving method and computer equipment for electromagnetic simulation disclosed in this application have at least the following beneficial effects: By introducing the Lanczos algorithm and combining iterative methods to select suitable initial values and initial vectors, and based on these initial values and initial vectors, a diagonal matrix and a tridiagonal matrix with smaller dimensions are constructed. That is, through simplification, the matrix pair formed by the original high-dimensional stiffness matrix and mass matrix is simplified into a matrix pair formed by the lower-dimensional first matrix and second matrix. By solving the eigenvalues (corresponding to propagation constants) and eigenvectors (corresponding to field distributions) of the matrix pair formed by the lower-dimensional first matrix and second matrix, the original eigenvalue problem is approximated, significantly reducing memory usage and greatly increasing solution efficiency. At the same time, during the iteration and orthogonalization process, Gram-Schmidt orthogonalization can be used to ensure that the generated vectors are linearly independent, reducing the accumulation of numerical errors, thereby improving the stability and accuracy of numerical calculations. Attached Figure Description
[0023] The following is a brief introduction to the accompanying drawings used in the description of the embodiments of this application:
[0024] Figure 1 A flowchart illustrating a matrix solving method for electromagnetic simulation disclosed in some embodiments of this application is shown.
[0025] Figure 2 The diagram shows the distribution of non-zero elements of various matrices disclosed in some embodiments of this application.
[0026] Figure 3 The diagram shows the distribution of non-zero elements of various matrices disclosed in some embodiments of this application.
[0027] Figure 4 A mesh diagram disclosed in some embodiments of this application is shown.
[0028] Figure 5 The diagram shows the port electric field distribution disclosed in some embodiments of this application. Detailed Implementation
[0029] To more clearly illustrate the technical solutions of the embodiments of this application, the specific implementation methods of this application will be described below with reference to the accompanying drawings. The accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings and other implementation methods can be obtained based on these drawings without creative effort. Adjustments and improvements made without departing from the concept of this application are all within the protection scope of this application.
[0030] To keep the drawings simple, only the parts related to the corresponding embodiments are shown schematically in each figure, and they do not represent the actual structure of the product. In addition, to make the drawings simple and easy to understand, some parts with the same structure or function are only shown schematically in some figures, and there may actually be more or fewer parts with the same structure or function.
[0031] In this application, unless otherwise expressly specified and limited, ordinal numbers, such as "first," "second," etc., are used only to distinguish and describe related objects, and should not be construed as indicating or implying the relative importance or order between related objects; furthermore, they do not represent the quantity of related objects. "Multiple" includes two or more, and other quantifiers are similar. " / " is used to describe the relationship between related objects, indicating an "or" relationship between them. "And / or" is used to describe the relationship between related objects, including any combination relationship between them, such as "a and / or b" including: "a alone," "b alone," or "a and b." "One or more" or "at least one" of 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" including: "a1 alone," "a2 alone," "a3 alone," "a1 and a2," "a1 and a3," "a2 and a3," or "a1, a2 and a3."
[0032] In scientific and engineering computing, the generalized eigenvalue problem is widespread. For example, given two symmetric matrices, denoted by A and B, the goal of the generalized eigenvalue problem is to find the eigenvalues that satisfy... eigenvalues And its corresponding eigenvector x. The calculation of eigenvalues and eigenvectors plays a crucial role in many applications, such as structural analysis, vibration analysis, stability analysis, and quantum mechanics. The meaning of each parameter in the generalized eigenvalue problem differs across different fields.
[0033] In the field of electromagnetic simulation, such as when performing full-wave electromagnetic analysis using the finite element method, calculating the port propagation constant is a crucial step. The port propagation constant describes the propagation characteristics of electromagnetic waves in a specific medium, and its calculation involves solving generalized eigenvalue problems. Accurately and efficiently solving these eigenvalue problems is essential for improving simulation accuracy and efficiency. In the field of electromagnetic simulation, generalized eigenvalue problems... The parameters in the matrix are defined as follows: A is the stiffness matrix, also known as the left matrix. The stiffness matrix describes the spatial distribution characteristics of the electromagnetic field in the system, specifically manifested in operations such as divergence and curl of the electric or magnetic field, and reflects the constraints of material properties (e.g., dielectric constant, 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 geometry of the waveguide region, material parameters, and the mesh division of the finite element method. B is the mass matrix, also known as the right matrix. The mass matrix describes the distribution characteristics of the field energy, reflecting the inertial properties of the system at frequency or in the propagation direction; and corresponds to the influence of the material's dielectric constant or permeability distribution on the field energy. In finite element discretization, the mass matrix can, for example, be formed by the inner product integral of the basis functions, representing the energy coupling relationship of the field in space. Eigenvalues The eigenvalues represent the intrinsic parameters of the system, such as the square of the propagation constant in a waveguide and the square of the resonant frequency in a resonant cavity; different eigenvalues represent different propagation modes or resonant modes. The obtained eigenvalues are represented in complex form: the real part is related to the propagation velocity or frequency, and the imaginary part is related to loss or attenuation. The eigenvector x represents the spatial distribution of the electromagnetic field, i.e., the vector components of the electric or magnetic field at discrete nodes; different eigenvectors correspond to the field distribution of different modes, such as the TE mode, TM mode, or hybrid mode in a waveguide. The length of the eigenvector is equal to the number of degrees of freedom, i.e., the total number of unknowns after finite element discretization.
[0034] Field distribution is essentially a mathematical expression of a physical phenomenon. In the finite element method (FEM), field distribution is described by "edge basis function coefficient vectors (weights)," and the two are closely related. The "edge basis functions" in the FEM are basis functions used to approximate the electromagnetic field, while the "coefficient vector" is the weighted sum of these basis functions, determining the contribution of each basis function to the actual field distribution. In other words, the field distribution is formed by superimposing multiple basis functions according to their weights, and the weights directly reflect the importance of each basis function in the field distribution. Therefore, there is a direct relationship between the field distribution and these weights (coefficient vectors): different weight values result in different field distribution shapes.
[0035] In the field of electromagnetic simulation, a two-dimensional waveport is a boundary condition used to excite and analyze the distribution of electromagnetic fields. It can be used in electromagnetic simulation methods such as the finite element method and the finite-difference time-domain method to describe the propagation characteristics of electromagnetic waves in waveguides, transmission lines, or other waveguide structures. By definition, a two-dimensional waveport is an imaginary plane (usually coinciding with the cross-section of the waveguide or transmission line) used to describe the field distribution and propagation characteristics in the transverse direction. Furthermore, a two-dimensional waveport can also be used to analyze the modes (e.g., TE and TM modes) and corresponding propagation constants of electromagnetic waves propagating longitudinally along a waveguide.
[0036] The finite element method (FEM) is a powerful tool for solving complex engineering problems: by discretizing a continuous domain into a finite number of subdomains, the FEM transforms partial differential equations into a system of algebraic equations that can be solved on a computer. However, this process generates enormous matrices, especially when the mesh is very dense. Solving such large-scale matrices is not only computationally intensive but also consumes a significant amount of memory, becoming a bottleneck in numerical computation.
[0037] Traditional methods for solving the generalized eigenvalue problem include direct methods and iterative methods. Direct methods, such as QR decomposition and Cholesky decomposition, have high accuracy for small-scale problems, but their computational complexity is O(n log n). The storage complexity is However, it 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 better computational and storage efficiency. Among the existing generalized eigenvalue solving methods, such as the Jacobi-Davidson method and the Arnoldi method, although they can solve large-scale problems to a certain extent, there is still room for improvement in terms of solution speed and memory usage.
[0038] The Lanczos algorithm is an efficient iterative algorithm suitable for large symmetric eigenvalue problems. It approximates the eigenvalues and eigenvectors of the original problem by constructing an eigenvalue problem for a tridiagonal matrix, thus significantly reducing computational complexity and storage requirements. However, for generalized eigenvalue problems, the classic Lanczos algorithm requires appropriate adjustments to handle the properties of matrix pairs (A, B).
[0039] Therefore, the concept of this application is to design a matrix solving method for electromagnetic simulation based on the Lanczos algorithm. By simplifying and solving the generalized eigenvalue problem formed by the stiffness matrix and mass matrix of a two-dimensional waveport, the propagation constant of the two-dimensional waveport and the field distribution matching the propagation constant can be determined. In other words, compared with directly solving high-dimensional matrix pairs, this application improves the efficiency of matrix solving by simplifying high-dimensional matrix pairs into low-dimensional matrix pairs. Since solving smaller-dimensional matrices requires less resources, the propagation constant of the two-dimensional waveport and the field distribution matching the propagation constant can be determined accurately and efficiently.
[0040] Figure 1 A flowchart illustrating a matrix solving method for electromagnetic simulation disclosed in some embodiments of this application is shown. Figure 1 As shown, the matrix solution method for electromagnetic simulation simplifies and solves the generalized eigenvalue problem formed by the stiffness matrix and mass matrix of a two-dimensional waveport, determining the propagation constant of the two-dimensional waveport and the field distribution matching the propagation constant. The stiffness matrix and mass matrix have the same dimension. The method includes:
[0041] S100, initialize the first matrix and the second matrix based on a preset number of propagation constants. 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.
[0042] S200, the first parameter is determined based on the initial vector and the stiffness matrix. 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. The first parameter is used to characterize the projection value of the initial vector onto the stiffness matrix.
[0043] S300, the second parameter is determined based on the initial vector and the mass matrix. The second parameter is used to characterize the projection value of the initial vector onto the mass matrix.
[0044] S400 determines the residual vector based on the initial vector, stiffness matrix, mass matrix, first parameter, and second parameter, and determines the third parameter based on the residual vector and second parameter.
[0045] S500 performs the first iteration based on a preset number of iterations and the Lanczos algorithm. The first iteration is used to update the initial vector, the first parameter, the second parameter, and the third parameter.
[0046] S600, based on a preset number of propagation constants, performs a second iteration. The second iteration is used to update the first matrix and the second matrix. 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.
[0047] S700, solve for the matrix pair formed by the updated first matrix and the updated second matrix to obtain the propagation constant of the two-dimensional wave port and the field distribution matching the propagation constant.
[0048] By introducing the Lanczos algorithm and combining iterative methods to select suitable initial values and initial vectors, and based on these initial values and initial vectors, diagonal and tridiagonal matrices with smaller dimensions are constructed. In other words, the original matrix pair formed by the high-dimensional stiffness and mass matrices is simplified into a matrix pair formed by the lower-dimensional first and second matrices. The original eigenvalue problem is approximated by solving the eigenvalues (corresponding to propagation constants) and eigenvectors (corresponding to field distributions) of the lower-dimensional first and second matrix pairs. This significantly reduces memory usage and greatly increases solution efficiency. Furthermore, during iteration and orthogonalization, Gram-Schmidt orthogonalization ensures that the generated vectors are linearly independent, reducing the accumulation of numerical errors and thus improving the stability and accuracy of numerical computation.
[0049] For ease of distinction, let's call the stiffness matrix A and the mass matrix B. Stiffness matrix A and mass matrix B form a matrix pair. The dimension of a matrix depends on its number of rows and columns. Stiffness matrix A and mass matrix B have the same dimension, meaning they have the same number of rows and columns. When dealing with large-scale problems, the dimensions of the matrices are relatively large; for example, the dimensions of stiffness matrix A and mass matrix B could be (5251, 5251). Figure 2 and Figure 3 The diagrams shown illustrate the distribution of non-zero elements in various matrices disclosed in some embodiments of this application. Figure 2 This is a distribution diagram of the non-zero elements of the stiffness matrix A above. Figure 3 This is a distribution diagram of the non-zero elements of the quality matrix B above. Figure 4 The diagram illustrates a mesh diagram disclosed in some embodiments of this application. The stiffness matrix A and mass matrix B can be derived from... Figure 4 The mesh shown is generated using the finite element method. In this application, the propagation constant of the two-dimensional waveport has the following correspondence with the eigenvalues in the generalized eigenvalue problem: , , ;in, For eigenvalues, Let be the propagation constant. The maximum permeability within the two-dimensional waveport. The maximum dielectric constant within the two-dimensional waveport. The permeability of free space, is the vacuum permittivity, and f is the frequency.
[0050] 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 vibration analysis, energy distribution, and modal analysis, the largest eigenvalue can represent the dominant mode or main dynamic behavior of the system. Moreover, computational resources and time are critical issues in solving large-scale matrices. Calculating all eigenvalues (especially for high-dimensional matrices) is extremely time-consuming; therefore, solving only the first few important eigenvalues can significantly reduce computational load and time. By solving a few important eigenvalues, computational efficiency can be greatly improved while maintaining accuracy, avoiding the waste of resources in solving all eigenvalues. Thus, for matrices (especially high-dimensional matrices), there can be several eigenvalues and corresponding eigenvectors, but only the important values (e.g., the maximum value) can be solved, thereby balancing accuracy and efficiency. In this application, the propagation constant of a two-dimensional waveport and the field distribution matching the propagation constant are determined by solving the largest eigenvalue and its corresponding eigenvector in the generalized eigenvalue problem. For example, the preset number m of the propagation constant can be set to 2, i.e., calculating the largest eigenvalue and its nearby eigenvalues. By solving for two eigenvalues, a more accurate description of the feature space can be obtained, improving the stability and accuracy of the algorithm, capturing the multimodal characteristics of the system, and providing better error analysis and verification. After obtaining the two eigenvalues, the larger eigenvalue is selected as the target value for this matrix solution.
[0051] The first and second matrices are initialized based on a preset number of propagation constants. For ease of distinction, the first matrix is referred to as D, and the second matrix as T. During initialization, all elements in both matrix D and matrix T are 0. The dimensions of the first matrix D are set to (m+1, m+1), and the dimensions of the second matrix T are set to (m, m). In this embodiment, since m=2, the dimensions of the first matrix D are (3, 3), and the dimensions of the second matrix T are (2, 2). The first matrix D stores eigenvalue information related to the mass matrix B, and the second matrix T stores eigenvalue information related to the stiffness matrix A, as well as related information obtained during the residual calculation of the mass matrix B. The eigenvalue information related to the stiffness matrix A may include, for example, an initial vector (for ease of distinction, the initial vector is referred to as...). The projection value of the first parameter onto the stiffness matrix A is called the first parameter (for ease of distinction, the first parameter is referred to as...). Eigenvalue information related to the quality matrix B may include, for example, the initial vector. The projection value onto the mass matrix B, this projection value can be called the second parameter (for ease of distinction, the second parameter will be referred to as...). ); where the initial vector The dimension of the initial vector 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 can be... Set it to a vector of all 1s with dimensions (5251, 1), i.e., the initial vector. All elements in the expression are 1.
[0052] In some embodiments of this application, the matrix solving method for electromagnetic simulation further 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 degrees of freedom of the two-dimensional waveport. Since the eigenvalues and eigenvectors obtained in the generalized eigenvalue problem appear in pairs, the number of field distributions in this application is equal to a preset number of propagation constants. The above normalization operation can simplify the calculation while maintaining the accuracy of the calculation process. For example, in normalizing the initial vector... When, the initial vector Divide by the initial vector The L2 norm of [the variable / function]. The formula for calculation is as follows:
[0053]
[0054] in, Initial vector The L2 norm of the vector. After normalization, the final element size is 0.0138. Normalization can suppress the numerical expansion or contraction of the vector size during iteration, thereby improving numerical stability. If the initial vector is not... Normalization can lead to instability in numerical calculations as the number of iterations increases, as the vector values may become too large or too small, affecting the convergence and accuracy of the algorithm. Furthermore, normalization ensures that the eigenvector length remains consistent across iterations, improving the algorithm's consistency and predictability. This reduces inconsistencies caused by variations in vector length, especially when solving large-scale sparse matrices. Additionally, normalized vectors simplify subsequent computational steps. For example, in calculating the Rayleigh quotient, normalized vectors simplify the formula and reduce complex vector length calculations.
[0055] In some embodiments of this application, the first parameter Initial vector The second parameter is the Rayleigh quotient relative to the stiffness matrix A. Initial vector Rayleigh quotient relative to the mass matrix B. First parameter. Second parameter The initial vectors can be measured separately. The projection values under the stiffness matrix A and the mass matrix B. The calculation formula is as follows:
[0056]
[0057] Wherein, the initial vector The initial vector can be normalized, thereby eliminating the denominator of the Rayleigh quotient and reducing computational complexity. In this embodiment, the first parameter can be calculated. The value is 1.68517 + 1.64031i, the second parameter. The value is 1.68749 + 1.64121i.
[0058] In some embodiments of this 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, the first matrix D can be non-zero only on its main diagonal, and the second matrix T can be non-zero only on its main diagonal and on the diagonals adjacent to the main diagonal.
[0059] In some embodiments of this application, based on the initial vector Stiffness matrix A, mass matrix B, first parameter Second parameter Determine the residual vector (for ease of distinction, the residual vector is referred to as...). The calculation formula is as follows:
[0060]
[0061] in, Let A be the residual vector, A be the stiffness matrix, and B be the mass matrix. As the first parameter, For the second parameter, As the initial vector, =0, =1, It is a zero vector.
[0062] In this embodiment, the residual vector is calculated. The subsequent first iteration, based on a preset number of iterations and the Lanczos algorithm, is all for the purpose of iteratively updating the initial vector. This improves the initial vector. The quality of the initial vector can then be determined based on a high-quality initial vector. To calculate the first parameter of high quality Second parameter And the third parameter (for ease of distinction, the third parameter will be referred to as...) Thus, a reasonable first matrix D and second matrix T can be constructed. Solving for the eigenvalues and eigenvectors of the first matrix D and the second matrix T allows for a better fit to the eigenvalues and eigenvectors of the matrix pair (A, B), yielding the required propagation constant of the two-dimensional waveport and the field distribution matching the propagation constant. Therefore, the matrix solving method disclosed in this application, before constructing the sub-matrices (i.e., the first matrix D and the second matrix T), incorporates a loop module (used for the first iteration) based on the Lanczos algorithm. This loop module is used to iterate the initial vectors at a preset iteration number k. The second assignment. For example, at the i-th iteration step, the value at that iteration step is calculated using formulas (2) and (3). as well as Where i <= k; Substitute into formula (4) to calculate the linear equation system and obtain the residual vector at this iteration step. Then , Substituting into formula 5, for Perform orthogonalization, such as Gram-Schmidt orthogonalization, to reduce numerical errors and error accumulation; normalize the residual vector and update the initial vector based on the normalized residual vector, as calculated in the following formula:
[0063]
[0064] in, For the residual vector, Let L2 norm be the residual vector. This is the updated initial vector. In subsequent operations, the updated vector obtained from formula (7) will be used. The calculation is performed using the initial vector. Based on the updated initial vector... Update the first parameter Second parameter ; the L2 norm of the residual vector Multiply by the updated second parameter To obtain the third parameter The calculation formula is as follows:
[0065]
[0066] in, This is the third parameter.
[0067] 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. For example, when updating the first matrix D and the second matrix T, the iterative values of the second parameter and the second parameter can be inserted sequentially into the main diagonal of the first matrix D to update the first matrix D; the first parameter, its iterative value, the third parameter, and its iterative value are then inserted sequentially into the main diagonal of the second matrix and the diagonal adjacent to the main diagonal. The calculation formula is as follows:
[0068]
[0069] Since the first matrix D is a diagonal matrix, therefore For the elements on its main diagonal, such as For the first element, For the second element, The third element. The purpose of this step is to construct the first matrix D and the second matrix T. Iteration is performed with the preset number of solutions m=2. The iteration steps start from j=1 and end when j=m-1. In each iteration, the element values of the second matrix T with indices (j-1, j-1), (j-1, j), (j, j-1), and (j, j) are updated. When the iteration step is j: First, the residual vector under each iteration is calculated using formula (11). ;
[0070] Then, use formula (12) to process the residual vector. Perform Gram-Schmidt orthogonalization to reduce numerical errors and error accumulation; use formula (13) to calculate the residual vector. L2 norm ; through residual vector The normalization, i.e., formula (14), updates the vector. Combining formulas (15), (16), and (17), update the elements at position j+1 in the first and second parameters, and simultaneously update the diagonal element values at position (j+1, j+1) in the first matrix D. Finally, using the relationships in formulas (18), (19), and (20), update the element values at positions (j-1, j-1), (j-1, j), (j, j-1), and (j, j) in the second matrix T. , , and This completes the second iteration, updating the elements in the first matrix D and the second matrix T.
[0071] 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 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:
[0072] ;
[0073] .
[0074] Solving the matrix pair formed by the updated first matrix D and the updated second matrix T yields the propagation constant of the two-dimensional waveport and the field distribution matching the propagation constant. Compared to the matrix pair formed by the stiffness matrix A and the mass matrix B with dimensions of (5251, 5251), the matrix pair formed by the updated first matrix D and the second matrix T with dimensions of (2, 2) obtained after the above series of operations is obviously easier to solve. Moreover, 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. For example, the generalized eigenvalues and eigenvectors can be solved using the open-source matrix solver Lapack, where the obtained eigenvalues are the m eigenvalues of the matrix pair (A, B).
[0075] The final obtained eigenvalues are: 2.54543e-5 - 113821e-5i, 5.69401-0.000247311i. The larger value, 5.69401-0.000247311i, is selected as the target value to determine the propagation constant of the two-dimensional wave port. The largest eigenvalue of the commercial matrix solver is 5.694005-0.0002473105i. It can be seen that the largest eigenvalue obtained in this application is similar to the largest eigenvalue obtained by the commercial matrix solver through conventional methods, thus proving the reliability of the matrix solving method for electromagnetic simulation proposed in this application. The corresponding eigenvector L2 norm scaling factor is 0.16234. Figure 5 The diagram illustrates the port electric field distribution diagrams disclosed in some embodiments of this application. The port electric field distribution is plotted using the finite element method and eigenvectors to verify the rationality of the eigenvectors. The plotted port electric field distribution is shown in [reference needed]. Figure 5It can be seen that the electric field is maximum at the port, and the magnitude of the electric field vector decreases outward from the port, indicating a reasonable vector field distribution. This indirectly verifies the rationality of calculating the eigenvectors at the port in the finite element method. Since commercial solvers solve all eigenvalues and eigenvectors in 1002 seconds, under this mode-driven finite element method, it is unnecessary to calculate all eigenvalues; only the maximum eigenvalue and its nearby eigenvalues and corresponding eigenvectors need to be calculated. Therefore, the time required to solve the maximum eigenvalue under the master mode driving method is 11.606 seconds. In summary, in finite element simulations under mode excitation, this method for solving the eigenvalues of the sparse matrix of the port finite element method allows for the targeted solution of several required eigenvalues and their corresponding eigenvectors. While maintaining computational accuracy, the computational efficiency is significantly improved compared to solving all eigenvalues.
[0076] Based on a similar technical concept, this application discloses a computer device for electromagnetic simulation, including a memory, a processor, and a computer program stored in the memory. The processor executes the computer program to implement the steps of the matrix solving method for electromagnetic simulation disclosed in the above embodiments.
[0077] For example, a computer device used for electromagnetic simulation can be a two-dimensional waveport solver. A two-dimensional waveport solver can obtain the propagation constants of each propagation mode by solving a generalized eigenvalue problem on the waveguide cross-section. The real part of the propagation constant can be used to characterize the wave attenuation rate, and the imaginary part can be used to characterize the wave's phase constant. In practical applications, the two-dimensional waveport solver can be used based on these characteristics to determine the operating mode and cutoff frequency of a waveguide or transmission line, analyze the dispersion characteristics of each mode in a multimode waveguide, and provide a basis for transmission line design, waveguide coupler, and filter optimization. Furthermore, the two-dimensional waveport solver can calculate the transverse field distribution for each propagation mode, including the transverse electric field and transverse magnetic field. This field distribution visually demonstrates the energy distribution characteristics of the electromagnetic wave on the waveguide cross-section. In practical applications, the two-dimensional waveport solver can be used based on these characteristics for mode matching analysis to optimize the coupling efficiency between different waveguide structures or feeding systems.
[0078] In the above embodiments, the descriptions of each embodiment have their own emphasis. Parts not described in detail or in a particular embodiment can be referred to in the relevant descriptions of other embodiments. Furthermore, 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