Python-based power transmission line electromagnetic field finite element automatic modeling and analysis method

By using Python to parse GIM files and perform 3D geometric modeling and simulation, the problem of automating electromagnetic field modeling of transmission lines was solved, improving modeling efficiency and calculation accuracy, and realizing the intelligentization and standardization of electromagnetic field simulation.

CN121562291APending Publication Date: 2026-02-24YANGZHOU HAOCHEN POWER DESIGN CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511744831.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-25
Publication Date
2026-02-24

AI Technical Summary

Technical Problem

In existing technologies, electromagnetic field modeling of transmission lines relies on manual operation, resulting in low modeling efficiency, high error rates, and difficulty in automation. The calculation process also lacks intelligence and standardization.

Method used

Python is used to parse GIM files, realize the transformation from local coordinates to global coordinates, perform three-dimensional geometric modeling based on the catenary mathematical model, and generate material properties and boundary conditions. Simulation is performed through interaction between Python scripts and finite element software to achieve automated processing.

Benefits of technology

It improves modeling efficiency and computational accuracy, reduces human error, ensures the repeatability and reliability of electromagnetic simulation results, and supports batch operations and flexible solution domain settings.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121562291A_ABST
    Figure CN121562291A_ABST
Patent Text Reader

Abstract

The invention discloses a Python-based power transmission line electromagnetic field finite element automatic modeling and analysis method in the field of electromagnetic field finite element simulation and power system analysis. A Python script language is combined with a finite element calculation engine, information is analyzed through programming, and the precise spatial position of each hanging point of the power transmission line in a global coordinate system is obtained through automatic conversion of coordinates; based on the obtained parameters, script programming is used for completing three-dimensional geometric modeling of the wire, and then automatic modeling and parameterized definition are achieved; then, script programming is used for achieving calculation domain setting, boundary condition setting, voltage and current giving, phase sequence setting and other setting of a line section to be calculated, and three-dimensional finite element simulation calculation of an alternating current electric field and a magnetic field of the designated line section is completed; and performing multi-dimensional visual display on the electric field and magnetic induction intensity in combination with a Python visual library. According to the system, automatic processing from GIM data to an electromagnetic field calculation result is achieved, electromagnetic field calculation of complex lines such as mixed voltage and cross crossing can be completed, modeling efficiency and calculation precision are remarkably improved, and an efficient simulation means is provided for electromagnetic environment evaluation and equipment optimization arrangement of the power transmission line.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of electromagnetic field finite element simulation and power system analysis, and in particular to a Python-based automatic finite element modeling and analysis method for electromagnetic fields of transmission lines, which can be applied to electromagnetic field modeling, simulation calculation and visualization analysis of transmission lines. Background Technology

[0002] Currently, electromagnetic field calculations for transmission lines primarily rely on numerical analysis techniques such as the Finite Element Method (FEM). The FEM is capable of solving for the distribution patterns of electric and magnetic field strengths under complex geometric conditions and is the mainstream method for electromagnetic field simulation. However, in practical engineering applications, the modeling process for transmission lines often depends on manual operation: engineers need to manually create geometric structures such as towers, conductors, insulators, and ground in finite element software (such as ANSYS Maxwell and COMSOL), set boundary conditions and physical properties, and then perform mesh generation and solution. This traditional method is not only inefficient and error-prone, but also difficult to automate. In recent years, Python has been widely used in automated finite element modeling due to its superior scripting capabilities and excellent software interface. If GIM file data can be automatically parsed and processed by Python scripts to generate finite element models, simulation efficiency and calculation accuracy can be improved, promoting the intelligent and standardized development of electromagnetic environment analysis for transmission lines. Summary of the Invention

[0003] To address the shortcomings of existing technologies, this invention provides a Python-based automatic finite element method for modeling and analyzing the electromagnetic field of transmission lines. This system can parse tower and conductor suspension point data from GIM files, complete the conversion from local to global coordinates, realize three-dimensional geometric modeling of the conductor based on the catenary mathematical model, and generate material properties, boundary conditions, and simulation solution settings. It automates the process from importing GIM data to outputting electromagnetic field simulation results, thereby significantly improving modeling efficiency and computational accuracy.

[0004] The objective of this invention is achieved as follows: a Python-based finite element automatic modeling and analysis method for electromagnetic fields of transmission lines, comprising the following steps:

[0005] Step 1) Parsing the Power Grid Information Model (GIM) file: Read and parse the relevant parameters of the transmission line in the GIM file, including the latitude and longitude coordinates of the tower location, the coordinates of the suspension points of the conductor and ground wire, the conductor split type, cross-sectional parameters, weight, tension and phase sequence information;

[0006] Step 2) Coordinate Transformation: Based on the transmission line parameters read in Step 1), coordinate transformation is used to automatically convert the local coordinate system of the hanging point to the global coordinate system;

[0007] Step 3) 3D geometric modeling: Based on the coordinates of the hanging point obtained in Step 2), a 3D geometric model of the catenary is established in the finite element software using a Python script;

[0008] Step 4) Physical property configuration: Based on the 3D geometric model, configure the electrical and physical properties of the conductors, tower materials, and boundary areas;

[0009] Step 5) Finite element electromagnetic field calculation: Interact with the finite element calculation engine through Python scripts to realize the calculation domain division, mesh generation and solver settings, and complete the three-dimensional finite element solution of AC electric field and magnetic field;

[0010] Step 6) Data visualization and analysis: Use Python visualization libraries to perform multi-dimensional visualization and interactive operation of the calculated electric field intensity and magnetic induction intensity distribution results.

[0011] Furthermore, the specific operations for coordinate transformation in step 2) are as follows:

[0012] 2-1) Tower coordinate transformation: Using a geographic coordinate transformation algorithm, latitude and longitude are first converted from degrees to radians, and then the three-dimensional Cartesian coordinates of the tower in Maxwell are calculated based on the Earth ellipsoid model.

[0013] 2-2) Global coordinate calculation of the hanging point: By calculating the spatial transformation matrix of the hanging point of the tower corresponding to the conductor, the relative coordinates P of the hanging point are obtained. rel Then, the standard ZYZ Euler angle rotation matrix R is used to rotate the coordinates of the hanging point, and the position O of the relative coordinate system origin in the global coordinate system is used to achieve translation, thus completing the transformation of the hanging point from the relative coordinates to the global coordinates P. global The transformation is calculated using the following formula:

[0014] ;

[0015] .

[0016] Furthermore, the specific operations for three-dimensional geometric modeling in step 3) are as follows:

[0017] 3-1) Based on the three-dimensional coordinates of the two suspension points and the conductor parameters, construct the three-dimensional geometry of the conductor. Solve for the catenary sag s and the sequence of curve coordinate points using Python. After interpolation and smoothing, the obtained coordinate points form a three-dimensional curve model. The catenary parametric equation is:

[0018] ;

[0019] The formula for conductor sag is: , For line weight, For gear distance, For horizontal tension, For the parameters of the parametric equation, ∈[0,1];

[0020] 3-2) Use Python to call the finite element modeling software Maxwell to generate the geometric solid of the conductor, thereby achieving automated modeling.

[0021] Furthermore, the specific operations for configuring physical attributes in step 4) are as follows:

[0022] 4-1) Define material properties: After modeling is completed, define material properties for each object in the system interface, including the material properties and other physical properties of conductors, tower materials, and air medium;

[0023] 4-2) Configure boundary conditions: Based on the global coordinates of the towers, establish a relative coordinate system with the direction of the conductors of the two towers as the x-axis. Set the boundary domain of the transmission line based on this relative coordinate system, and accurately scale and adjust the range of the boundary domain in the interactive interface according to the actual calculation requirements, so as to ensure the accuracy of the finite element analysis within the required spatial range.

[0024] Furthermore, the finite element electromagnetic field calculation method in step 5) is as follows:

[0025] Finite element electric field calculation: The Maxwell finite element software engine is driven by a Python script. The solver is configured as an AC electric field in the interactive interface, and boundary conditions are set. Voltage excitation is set for each conductor according to the voltage level and phase sequence information of the transmission line in the GIM file. Then, the model is meshed and the electric field finite element simulation calculation is performed to obtain the electric field distribution and related analysis results of the transmission line.

[0026] Finite element magnetic field calculation: The Maxwell finite element software engine is driven by a Python script. In the interactive interface, the solver is set to eddy current field and the boundary conditions are set to be tangent to the conductor cross section. The current excitation is configured according to the actual current value and phase sequence information of the transmission line. Then, the model is meshed and the magnetic field finite element simulation calculation is performed to obtain the magnetic field distribution and related analysis results of the transmission line.

[0027] Furthermore, the boundary conditions for the finite element electric and magnetic fields are as follows:

[0028] Finite element electric field boundary conditions: In the finite element electric field calculation, the center coordinates of the six faces of the boundary region are extracted. By comparing the z-axis coordinates of the center points of each face, the face with the smallest z-coordinate is determined as the zero potential reference face.

[0029] Finite element magnetic field boundary conditions: In finite element electric field calculations, Boolean operations are used to cut the portion of the conductor that extends beyond the boundary region, so that the cross-sections at both ends of the conductor are precisely tangent to the boundary surface.

[0030] Furthermore, the finite element electric field voltage excitation and magnetic field current excitation are as follows:

[0031] Electric field calculation configuration of voltage excitation method: Apply the rated voltage amplitude obtained by voltage level calculation to the entire conductor and configure the phase sequence;

[0032] Electromagnetic calculation configuration current excitation method: Apply the rated current amplitude in the inflow direction to one end of the conductor, and apply the rated current amplitude in the outflow direction to the other end.

[0033] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0034] (1) The interface supports importing coordinate information from GIM data, realizing automatic conversion of transmission line data to Maxwell model and improving data utilization. Only the endpoint coordinates, line weight, tension and cross-sectional diameter of the transmission conductor need to be input to automatically generate a three-dimensional catenary, without the need for complex manual modeling, which improves the convenience of model building and reduces human error.

[0035] (2) The interface uses a unified algorithm to generate catenary, eliminating the uncertainty caused by manual adjustment, and keeping the conductor model under various working conditions in a uniform accuracy, which is conducive to ensuring the repeatability and reliability of electromagnetic simulation results.

[0036] (3) The interface supports batch assignment of voltage amplitude, phase and material to catenary, which is convenient for users to perform batch operations.

[0037] (4) In addition, users can change the boundary range of the solution domain in the text box in the solution domain setting module, and flexibly change the solution area to adapt to transmission lines with different structures and lengths. Attached Figure Description

[0038] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0039] Figure 1 This is a flowchart of the present invention.

[0040] Figure 2 This is a schematic diagram of the electric field boundary setting of the present invention.

[0041] Figure 3 This is a schematic diagram illustrating the setting of the magnetic field boundary and the application of excitation according to the present invention.

[0042] Figure 4 This is a view of the electric field distribution region results of the present invention.

[0043] Figure 5 This is a view of the magnetic field distribution area results of the present invention. Detailed Implementation

[0044] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0045] Example 1

[0046] like Figure 1 The method shown is a Python-based finite element automatic modeling and analysis method for electromagnetic fields of transmission lines. The conversion relationship between the modules is as follows: the data parsing module reads the data → the latitude and longitude information of the tower and conductor suspension points obtained from the parsing is sent to the coordinate transformation module for spatial transformation → the transformed suspension point coordinates are sent to the geometric modeling module to generate a 3D model of the transmission line → the model geometric information is sent to the physical property configuration module to complete the material and boundary settings → the complete model is input into the finite element simulation module for electromagnetic field solving → the solution results are finally output and analyzed by the visualization module. The specific operation includes the following steps:

[0047] Step 1) Parsing the Power Grid Information Model (GIM) file: Import the GIM file into the Daoheng viewer and extract the basic information of the transmission lines at each engineering level from the attribute list, including the latitude and longitude and height of the towers, the rotation matrix of the hanging points, the conductor cross-section, weight, tension, voltage level, phase sequence and other parameters.

[0048] Step 2) Coordinate transformation is divided into tower coordinates and hanging point global coordinates. The specific operation steps are as follows:

[0049] 2-1) Tower Coordinate Transformation: A geographic coordinate transformation algorithm is used. Based on the extracted latitude, longitude, and height information of the tower, a Python program converts latitude and longitude from degrees to radians. Then, based on the Earth ellipsoid model, the three-dimensional Cartesian coordinates of the tower in Maxwell are calculated. Partial Python core code is shown below:

[0050] #Given a latitude (in degrees), calculate the surface distance (in meters) corresponding to each 1° change in longitude and latitude at that latitude.

[0051] "def deg2m_factors(lat_deg)";

[0052] #Convert latitude from degrees to radians

[0053] "phi = math.radians(lat_deg)";

[0054] #Calculate the length (in meters) corresponding to each degree of latitude based on the empirical fitting formula of the Earth ellipsoid model.

[0055] "m_per_deg_lat=111132.954-559.822*math.cos(2.0*phi)+1.175*math.cos(4.0*phi)";

[0056] #Length per degree along the longitude direction (unit: meters)

[0057] "m_per_deg_lon = 111132.954*math.cos(phi)";

[0058] # Calculate the number of meters corresponding to each degree of longitude and latitude on the reference latitude lat_ref

[0059] "fac_lon, fac_lat = deg2m_factors(lat_ref)";

[0060] #Calculate the difference between plane coordinates

[0061] "E = (lon - lon_ref) * fac_lon; N = (lat - lat_ref) * fac_lat";

[0062] # Planar coordinates of the target point relative to the reference point (E, N) (unit: meters)

[0063] “return (E, N)”

[0064] 2-2) Global coordinate calculation of the hanging point: By calculating the spatial transformation matrix of the hanging point of the tower corresponding to the conductor, the relative coordinates P of the hanging point are obtained. rel Then, the standard ZYZ Euler angle rotation matrix R is used to rotate the coordinates of the hanging point, and the position O of the relative coordinate system origin in the global coordinate system is used to achieve translation, thus completing the transformation of the hanging point from the relative coordinates to the global coordinates P. global The transformation. Part of the core Python code is as follows:

[0065] This function rotates a 2D vector (x, y) counterclockwise around the origin (0,0) by a specified angle (in degrees), and then returns the new coordinates.

[0066] "def rotate_vector_ccw(x, y, angle_deg)";

[0067] #Convert angles to radians

[0068] "a = math.radians(angle_deg)";

[0069] #Calculate the cosine and sine of the rotation angle

[0070] "ca, sa = math.cos(a), math.sin(a)";

[0071] #Using the rotation formula

[0072] "return (x*ca - y*sa, x*sa + y*ca)";

[0073] # Convert local coordinates to intermediate coordinates that conform to the global axis direction

[0074] “e_local = -y_local

[0075] n_local = x_local”;

[0076] #Counterclockwise rotation function, negative angle correction

[0077] "dx, dy = rotate_vector_ccw(e_local, n_local, -heading_deg)";

[0078] #Add the offset to the reference point to obtain the global absolute coordinates.

[0079] "return (e_base + dx, n_base + dy, z_base + z_local)".

[0080] Step 3) 3D Geometric Modeling: In Ansys Maxwell, a parabolic conductor considering sag is automatically drawn based on the physical parameters of the transmission line. Using the converted global coordinates of the suspension points and the conductor parameters, the spatial shape of the conductor is calculated using a catenary mathematical model. This ensures consistent accuracy of the conductor model under various operating conditions, which is beneficial for guaranteeing the repeatability and reliability of electromagnetic simulation results. The system calls the finite element platform Maxwell through a Python script interface to automatically generate 3D geometric models of the conductor, towers, and ground wire, achieving automatic line modeling without the need for complex manual modeling. This improves the convenience of model building and reduces human error. Part of the core Python code is as follows:

[0081] #Conversion between gravity and tension

[0082] g = 9.80665

[0083] w_Nm = w_kgkm * g / 1000.0 # kg / km → N / m

[0084] T_N = T_kN * 1000.0 # kN → N”

[0085] # Calculate the horizontal span (L) and sag (s)

[0086] "L = math.hypot(x2 - x1, y2 - y1)

[0087] sag_m = (w_Nm * L**2) / (8 * T_N) if (w_Nm > 0 and T_N > 0) else 0.0

[0088] A = 4.0 * sag_m”

[0089] #Calculate the equivalent radius of the split conductor

[0090] "Req=(split*diameter_mm / 2*(splitdistance*1000 / 2+diameter_mm)**(split-1))**(1 / split)"

[0091] # Generate points on the parabola proportionally

[0092] “pts = []

[0093] for i in range(npts):

[0094] t = float(i) / (npts - 1)

[0095] xt = (1.0-t)*x1 + t*x2

[0096] yt = (1.0-t)*y1 + t*y2

[0097] zt = (1.0-t)*z1 + t*z2 - float(A)*t*(1.0-t)”

[0098] # Assemble the Maxwell polyline data to form the point list required by Maxwell.

[0099] "pts.append(["NAME:PLPoint","X:=","%s%s"%(xt,units),"Y:=","%s%s"%(yt,units),"Z:=","%s%s"%(zt,units)])points_block = ["NAME:PolylinePoints"]+pts";

[0100] #Define line segment type: Indicates that this polyline is smoothly connected by a spline through all points.

[0101] "segs=["NAME:PolylineSegments",["NAME:PLSegment","SegmentType:=","Spline","StartIndex:=",0,"NoOfPoints:=",npts]]";

[0102] #Define the cross-section (wire cross-section)

[0103] "dia = "%s%s" % (Req*2, "mm")

[0104] xsec = ["NAME:PolylineXSection",

[0105] "XSectionType:=","Circle","XSectionOrient:=","Auto",

[0106] "XSectionWidth:=",dia,

[0107] "XSectionTopWidth:=","0","XSectionHeight:=","0",

[0108] "XSectionNumSegments:=",0,"XSectionBendType:=","Curved"]";

[0109] #Use Maxwell's drawing commands to officially generate this 3D guide with sag.

[0110] "pblock=["NAME:PolylineParameters","IsPolylineCovered:=",True,"IsPolylineClosed:=",False,points_block,segs,xsec]oEditor.CreatePolyline(pblock, attrs)".

[0111] Step 4) Physical Property Configuration: Based on the geometric model, assign material properties to each object, such as the conductivity, dielectric constant, and magnetic permeability of conductors, tower materials, and air. Configure voltage, current, boundary conditions, and phase sequence according to the line voltage level to achieve model parameterization and reusability. The interface supports batch assignment of catenary voltage amplitude, phase, and material properties, facilitating batch operations for users. Partial Python core code is shown below:

[0112] 4-1) Define material properties

[0113] #Assign copper as the material for the previously generated 3D catenary conductor, set its display color and other attributes, and define it as a geometric entity type "model".

[0114] attrs = ["NAME:Attributes","Name:=",name_hint,"Color:=","(143 175143)",

[0115] "MaterialValue:=","\"copper\"","SolveInside:=", False,];

[0116] 4-2) Configure boundary conditions

[0117] 4-1-1) Obtain the local coordinate system of the selected transmission line

[0118] "idx = self.lb_cs_list.SelectedIndex

[0119] if idx < 0:

[0120] MessageBox.Show("Please select a local coordinate system from the list first.", "Not selected", MessageBoxButtons.OK, MessageBoxIcon.Information)

[0121] return

[0122] cs_name = self.cs_names[idx]";

[0123] 4-1-2) Switching the working coordinate system

[0124] oEditor.SetWCS([

[0125] "NAME:SetWCS Parameter",

[0126] "Working Coordinate System:=", cs_name,

[0127] "RegionDepCSOk:=", False])"

[0128] oEditor is the 3D editor interface object of Maxwell / HFSS; the SetWCS command is used to set the current working coordinate system; "Working Coordinate System:=" is specified as cs_name, which is the coordinate system selected in the previous step; "RegionDepCSOk:=", False indicates that this operation does not depend on the region coordinate system, ensuring that the created air region is aligned with the local coordinate system, rather than the global coordinate system;

[0129] 4-1-3) Create the solution domain (air box)

[0130] oEditor.CreateRegion( [

[0132] "NAME:RegionParameters",

[0133] "+XPaddingType:=", "Absolute Offset",

[0134] "+XPadding:=", "10meter",

[0135] "-XPaddingType:=", "Absolute Offset",

[0136] "-XPadding:=", "10meter",

[0137] "+YPaddingType:=", "Absolute Offset",

[0138] "+YPadding:=", "10meter",

[0139] "-YPaddingType:=", "Absolute Offset",

[0140] "-YPadding:=", "10meter",

[0141] "+ZPaddingType:=", "Absolute Offset",

[0142] "+ZPadding:=", "10meter",

[0143] "-ZPaddingType:=", "Absolute Position",

[0144] "-ZPadding:=", "0meter"

[0145] ,

[0147] "NAME:Attributes",

[0148] "Name:=", "AirRegion",

[0149] "Color:=", "(143 175 143)",

[0150] "Transparency:=", 0.7,

[0151] "PartCoordinateSystem:=", cs_name,

[0152] "MaterialValue:=", "\"air\"",

[0153] "SolveInside:=", True )

[0156] 4-1-4) Adjust the size of the solution domain

[0157] ​​def on_resize_region(self, sender, args):

[0158] # Read the offset value

[0159] posX = self.tb_posX.Text.strip() or "10"

[0160] negX = self.tb_negX.Text.strip() or "10"

[0161] posY = self.tb_posY.Text.strip() or "10"

[0162] negY = self.tb_negY.Text.strip() or "10"

[0163] # Modify the solution domain properties

[0164] oEditor.ChangeProperty(

[0166] "NAME:AllTabs",

[0168] "NAME:Geometry3DCmdTab",

[0169] ["NAME:PropServers", "AirRegion:CreateRegion:1"],

[0170] ["NAME:ChangedProps",

[0171] ["NAME:+X Padding Data", "Value:=", posX + "meter"],

[0172] ["NAME:-X Padding Data", "Value:=", negX + "meter"],

[0173] ["NAME:+Y Padding Data", "Value:=", posY + "meter"],

[0174] ["NAME:-Y Padding Data", "Value:=", negY + "meter"] ​​] ] )

[0179] The program reads the selected local coordinate system from the interface, switches the editor's working coordinate system to that system, and creates an air solution domain named AirRegion within it. It reads the positive and negative offsets in the X and Y directions from the interface input boxes and modifies the geometric properties of the solution domain using the ChangeProperty method, causing the air region to expand or contract in the specified directions by the input distance.

[0180] Step 5) Finite Element Electromagnetic Field Calculation: Through interaction with the finite element calculation engine using a Python script, the computational domain is divided, mesh generated, and solver settings are configured to complete the three-dimensional finite element solution of the AC electric and magnetic fields. The operator can change the solution domain boundary range in the text box of the solution domain settings module, flexibly changing the solution region to adapt to transmission lines of different structures and lengths. Specific operation steps are as follows:

[0181] 5-1) Finite element electric field calculation: Set as follows Figure 2 The zero-potential surface shown is obtained by extracting the center coordinates of the six faces in the boundary region. By comparing the z-axis coordinates of each face, the face with the smallest z-coordinate is determined as the zero-potential reference surface. The Python code is as follows:

[0182] “face_ids = list(oEditor.GetFaceIDs("AirRegion"))”: Retrieves all face IDs of the air region;

[0183] “min_z = None

[0184] bottom_face_id = None

[0185] for fid in face_ids:

[0186] try:

[0187] cx, cy, cz = [float(v) for v in oEditor.GetFaceCenter(fid)]

[0188] if (min_z is None) or (cz < min_z):

[0189] min_z = cz

[0190] bottom_face_id = fid

[0191] except:

[0192] "pass": Find the smallest Z-shaped surface, i.e., the ground.

[0193] oModule.AssignVoltage( [

[0195] "NAME:" + v_name,

[0196] "Faces:=" , [bottom_face_id],

[0197] "Voltage:=" , "0kV",

[0198] "CoordinateSystem:=" , "",

[0199] "Phase:=" , "0deg

[0200] ]: Apply a voltage boundary to the bottom surface.

[0201] 5-2) Finite Element Magnetic Field Calculation: Through the interaction between Python and the finite element solver interface, the computational domain is generated, mesh is generated, and three-dimensional finite element solutions for AC electric and magnetic fields are obtained. The system can perform three-dimensional simulation calculations of AC electric and magnetic fields and supports complex structural analysis of multi-loop, mixed-voltage, and crossing lines.

[0202] 5-3) Setting up finite element electromagnetic field voltage and current excitation: The electric field calculation and configuration of voltage excitation is as follows... Figure 2 The diagram shows the application of the rated voltage amplitude calculated based on the voltage level to the entire conductor and the configuration of the phase sequence; the electromagnetic calculation and configuration of the current excitation are as follows. Figure 3 The diagram illustrates applying the rated current amplitude in the inflow direction to one end of a conductor and the rated current amplitude in the outflow direction to the other end. Taking electric field analysis as an example, the Python program is as follows:

[0203] “def assign_voltage_to_object(obj_name, voltage_value, phase_deg):

[0204] # ---- Automatically generate unique boundary names ----

[0205] safe_name = re.sub(r'[^A-Za-z0-9_]', '_', obj_name)

[0206] v_name = "Voltage_" + safe_name

[0207] oBound = oDesign.GetModule("BoundarySetup")

[0208] # ========== Apply voltage directly to the object ==========

[0209] obj_trials = [

[0210] (["NAME:" + v_name, "Objects:=", [obj_name], "Voltage:=", v_str, "Phase:=", p_str]),

[0211] (["NAME:" + v_name, "Objects:=", obj_name, "Voltage:=", v_str, "Phase:=", p_str]),

[0212] (["NAME:" + v_name, "Objects:=", [obj_name], "Value:=", v_str, "Phase:=", p_str]),

[0213] (["NAME:" + v_name, "Objects:=", obj_name, "Value:=", v_str, "Phase:=", p_str]), ]

[0215] for blk in obj_trials:

[0216] try:

[0217] oBound.AssignVoltage(blk)

[0218] return

[0219] except:

[0220] pass

[0221] Step 6) Data Visualization and Analysis: After exporting the simulation results, use a Python visualization library to perform multi-dimensional visualization and interactive operation of the calculated electric field intensity and magnetic induction intensity distribution results, such as... Figure 4 Figure 5 As shown.

[0222] The above description of the embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. It should be noted that those skilled in the art can make several improvements and modifications to the present invention without departing from the principles of the present invention, and these improvements and modifications also fall within the protection scope of the claims of the present invention.

Claims

1. A Python-based finite element automatic modeling and analysis method for electromagnetic fields of transmission lines, characterized in that, Includes the following steps: Step 1) Parsing the Power Grid Information Model (GIM) file: Read and parse the relevant parameters of the transmission line in the GIM file, including the latitude and longitude coordinates of the tower location, the coordinates of the suspension points of the conductor and ground wire, the conductor split type, cross-sectional parameters, weight, tension and phase sequence information; Step 2) Coordinate Transformation: Based on the transmission line parameters read in Step 1), coordinate transformation is used to automatically convert the local coordinate system of the hanging point to the global coordinate system; Step 3) 3D geometric modeling: Based on the coordinates of the hanging point obtained in Step 2), a 3D geometric model of the catenary is established in the finite element software using a Python script; Step 4) Physical property configuration: Based on the 3D geometric model, configure the electrical and physical properties of the conductors, tower materials, and boundary areas; Step 5) Finite element electromagnetic field calculation: Interact with the finite element calculation engine through Python scripts to realize the calculation domain division, mesh generation and solver settings, and complete the three-dimensional finite element solution of AC electric field and magnetic field; Step 6) Data visualization and analysis: Use Python visualization libraries to perform multi-dimensional visualization and interactive operation of the calculated electric field intensity and magnetic induction intensity distribution results.

2. The automatic finite element modeling and analysis method for electromagnetic fields of transmission lines based on Python as described in claim 1, characterized in that, The specific operations for coordinate transformation in step 2) are as follows: 2-1) Tower coordinate transformation: Using a geographic coordinate transformation algorithm, latitude and longitude are first converted from degrees to radians, and then the three-dimensional Cartesian coordinates of the tower in Maxwell are calculated based on the Earth ellipsoid model. 2-2) Global coordinate calculation of the hanging point: By calculating the spatial transformation matrix of the hanging point of the tower corresponding to the conductor, the relative coordinates P of the hanging point are obtained. rel Then, the standard ZYZ Euler angle rotation matrix R is used to rotate the coordinates of the hanging point, and the position O of the relative coordinate system origin in the global coordinate system is used to achieve translation, thus completing the transformation of the hanging point from the relative coordinates to the global coordinates P. global The transformation is calculated using the following formula: ; 。 3. The automatic finite element modeling and analysis method for electromagnetic fields of transmission lines based on Python according to claim 1, characterized in that, The specific operations for 3D geometric modeling in step 3) are as follows: 3-1) Based on the three-dimensional coordinates of the two suspension points and the conductor parameters, construct the three-dimensional geometry of the conductor. Solve for the catenary sag s and the sequence of curve coordinate points using Python. After interpolation and smoothing, the obtained coordinate points form a three-dimensional curve model. The catenary parametric equation is: ; The formula for conductor sag is: , For line weight, For gear distance, For horizontal tension, For the parameters of the parametric equation, ∈[0,1]; 3-2) Use Python to call the finite element modeling software Maxwell to generate the geometric solid of the conductor, thereby achieving automated modeling.

4. The automatic finite element modeling and analysis method for electromagnetic fields of transmission lines based on Python according to claim 1, characterized in that, The specific steps for configuring physical attributes in step 4) are as follows: 4-1) Define material properties: After modeling is completed, define material properties for each object in the system interface, including the material properties and other physical properties of conductors, tower materials, and air medium; 4-2) Configure boundary conditions: Based on the global coordinates of the towers, establish a relative coordinate system with the direction of the conductors of the two towers as the x-axis. Set the boundary domain of the transmission line based on this relative coordinate system, and accurately scale and adjust the range of the boundary domain in the interactive interface according to the actual calculation requirements, so as to ensure the accuracy of the finite element analysis within the required spatial range.

5. The method for automatic finite element modeling and analysis of electromagnetic fields in transmission lines based on Python, as described in claim 1, is characterized in that... The finite element electromagnetic field calculation method in step 5) is as follows: Finite element electric field calculation: The Maxwell finite element software engine is driven by a Python script. The solver is configured as an AC electric field in the interactive interface, and boundary conditions are set. Voltage excitation is set for each conductor according to the voltage level and phase sequence information of the transmission line in the GIM file. Then, the model is meshed and the electric field finite element simulation calculation is performed to obtain the electric field distribution and related analysis results of the transmission line. Finite element magnetic field calculation: The Maxwell finite element software engine is driven by a Python script. In the interactive interface, the solver is set to eddy current field and the boundary conditions are set to be tangent to the conductor cross section. The current excitation is configured according to the actual current value and phase sequence information of the transmission line. Then, the model is meshed and the magnetic field finite element simulation calculation is performed to obtain the magnetic field distribution and related analysis results of the transmission line.

6. The automatic finite element modeling and analysis method for electromagnetic fields of transmission lines based on Python, as described in claim 1 or 5, is characterized in that... The finite element electric and magnetic field boundary conditions are as follows: Finite element electric field boundary conditions: In the finite element electric field calculation, the center coordinates of the six faces of the boundary region are extracted. By comparing the z-axis coordinates of the center points of each face, the face with the smallest z-coordinate is determined as the zero potential reference face. Finite element magnetic field boundary conditions: In finite element electric field calculations, Boolean operations are used to cut the portion of the conductor that extends beyond the boundary region, so that the cross-sections at both ends of the conductor are precisely tangent to the boundary surface.

7. The automatic finite element modeling and analysis method for electromagnetic fields of transmission lines based on Python, as described in claim 1 or 5, is characterized in that... The finite element electric field voltage excitation and magnetic field current excitation are as follows: Electric field calculation configuration of voltage excitation method: Apply the rated voltage amplitude obtained by voltage level calculation to the entire conductor and configure the phase sequence; Electromagnetic calculation configuration current excitation method: Apply the rated current amplitude in the inflow direction to one end of the conductor, and apply the rated current amplitude in the outflow direction to the other end.