Electromagnetic field visualization teaching simulation platform based on COMSOL

Through the COMSOL-based electromagnetic field visual teaching simulation platform, the problem of insufficient intuitiveness and interactivity in traditional electromagnetic field teaching is solved, and three-dimensional display and personalized learning paths are realized, and learning efficiency and effect are improved.

CN120340347APending Publication Date: 2025-07-18GUANGXI TEACHERS EDUCATION UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510429514.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-08
Publication Date
2025-07-18

AI Technical Summary

Technical Problem

Traditional electromagnetic field teaching is difficult to visually present three-dimensional distribution and dynamic changes, lacks interactive and personalized learning paths, and has low learning efficiency.

Method used

Develop an electromagnetic field visual teaching simulation platform based on COMSOL, including system architecture modules, visual modules and simulation computing interaction modules, providing three-dimensional electromagnetic field display, real-time feedback and personalized learning paths, and supporting collaborative operation of multiple users.

Benefits of technology

It improves the intuitiveness and learning efficiency of electromagnetic field teaching, provides personalized learning paths and real-time feedback, and enhances users' understanding and mastery of electromagnetic field knowledge.

✦ Generated by Eureka AI based on patent content.
Patent Text Reader

Abstract

The invention discloses an electromagnetic field visualization teaching simulation platform based on COMSOL, and the platform comprises a system architecture module, a visualization module, and a simulation calculation interaction module. And the simulation case module comprises an independent display window and five functional partitions of the independent display window: a parameter input area, a functional interaction area, a basic principle and model display area, a grid construction area and a calculation result display area. According to the COMSOL-based electromagnetic field visualization teaching simulation platform, through cooperative work of the system architecture module, the visualization module and the interactive teaching module, a visual visualization interface and rich simulation functions are provided for a user. A user can freely construct a model through the parameter configuration unit, the visualization engine can visually present electromagnetic field distribution in a three-dimensional form, and the interactive teaching module provides real-time feedback and learning path recommendation, so that the user can better understand and master electromagnetic field knowledge, and learning efficiency and learning quality are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of virtual simulation-assisted experimental teaching, and particularly relates to an electromagnetic field visualization teaching simulation platform based on COMSOL. Background Art

[0002] In the process of traditional electromagnetic field teaching, there are many problems to be solved urgently. The concept of electromagnetic field is abstract and complex. Traditional teaching relies on blackboard writing and two-dimensional graphic display, which is difficult to intuitively present the three-dimensional distribution and dynamic change characteristics of the electromagnetic field. Users can only construct models through imagination and lack practical perceptual knowledge. For example, when explaining the electromagnetic fields generated by structures such as toroidal coils and parallel plate capacitors, it is difficult for users to imagine the actual field distribution through book texts and two-dimensional graphics. For complex situations such as frequency-varying boundary conditions and the coupling of multiple physical fields, traditional teaching is even more difficult to effectively demonstrate and explain, resulting in users not mastering the knowledge points deeply enough.

[0003] In the process of teaching, traditional teaching lacks effective teaching aids and interaction mechanisms. Teachers are difficult to understand the learning situation and existing problems of users in real time during the teaching process and cannot give targeted guidance in time. When users encounter errors and problems during the learning process, it is also difficult to obtain correct feedback and explanations in time, resulting in low learning efficiency. Moreover, traditional teaching does not provide users with personalized learning paths and cases and cannot meet the learning needs of different users.

[0004] Therefore, it is urgent to develop a new teaching simulation platform to solve these problems and improve the quality and effect of electromagnetic field-related experimental teaching. Summary of the Invention

[0005] The purpose of the present invention is to solve at least the above-mentioned defects and provide the advantages to be described later.

[0006] To achieve these purposes and other advantages of the present invention, there is provided an electromagnetic field visualization teaching simulation platform based on COMSOL, including: a system architecture module, a visualization module, and a simulation calculation interaction module.

[0007] The system architecture module includes an application main interface built by PYQT5 and an electromagnetic field simulation case module built based on COMSOL APP; the application main interface includes a case selection control and a parameter input control.

[0008] The visualization module includes three independent functional partitions: an electric field area, a magnetic field area, and a comprehensive area. Each partition is configured with a corresponding three-dimensional coordinate system display window, and there is at least one preset simulation case in each area.

[0009] The simulation calculation interaction module, which includes a parameter verification unit, a calculation scheduling unit, and a result parsing unit, is used to receive the simulation parameters input by the user, generate COMSOL calculation instructions, and convert the calculation results into a visual data format.

[0010] Among them, the simulation case module includes an independent display window and its five functional areas: a parameter input area, a function interaction area, a basic principle and model display area, a mesh construction area, and a calculation result display area, the parameter input area; the parameter input area is configured with a numerical input box and a slider control for receiving material property parameters and excitation conditions; the function interaction area includes a case-driven learning framework, an intelligent association system integrating preset teaching scenarios and simulation experiments, and provides an interactive interface including knowledge point annotation, real-time error operation prompt, and learning path recommendation; the basic principle and model display area has a parameterized geometric model library built-in, supporting 3D model rotation and cross-section display; the mesh construction area provides an automatic mesh generation control and local refinement parameter setting; the calculation result display area integrates function components for starting calculation, pausing calculation, and progress display, and deploys an OpenGL visualization engine for rendering the distribution and changes of electric field lines and equipotential surfaces.

[0011] Preferably, the system architecture module adopts a layered architecture design, specifically including: the interface layer is built using the PYQT5 framework, including menu bar, toolbar, and status bar components; the logic layer implements parameter verification and task scheduling algorithms through C++; the data layer uses an SQLite database to store case configuration parameters and calculation results; among them, the simulation case module is built through COMSOL APP, and only the COMSOL Runtime component needs to be installed for the runtime environment.

[0012] Preferably, the visualization module further includes: a number of simulation sub-modules, which are placed in the electric field area, magnetic field area, or comprehensive area according to the content of experimental teaching and different physical principles; an image rendering function for rendering the three-dimensional electromagnetic field distribution image to obtain three-dimensional images of electric field intensity, electric field lines, magnetic field intensity, and magnetic induction lines, etc.; the observation position and direction in the three-dimensional space can be modified through keyboard and mouse operations.

[0013] Preferably, the simulation case module further includes: a case template library, which is divided into three categories according to the teaching syllabus: basic cases, advanced cases, and actual design cases, and each case has a corresponding preset configuration, including parameterized model files, theoretical analytical solution data, etc.; users can customize and modify the default parameters, construct a new simulation model, calculate and generate new model analytical solution data and display it.

[0014] Preferably, it further includes: an adaptive feedback module, which includes a behavior perception module, a feedback execution module, and an error prompt layer; the behavior perception module collects multi-modal data such as the user's operation frequency, parameter modification trajectory, and error repetition rate in real time and constructs a dynamic behavior portrait; the feedback execution module dynamically hides invalid parameter input boxes through the COMSOL API, superimposes a skin depth heat map on the 3D model to mark the contradiction area, and pushes associated teaching videos; the error prompt layer integrates TTS and NLP to generate explanatory text, combines image recognition to locate the hot spots of the field distribution, and superimposes three-dimensional arrows to mark the direction; the adaptive feedback module and the simulation calculation interaction module adjust the verification rules of the phased guidance system in real time through the dynamic behavior portrait, and combine the difference merging algorithm of the real-time collaboration unit to achieve personalized error prompts in multi-user collaborative operations.

[0015] Preferably, the simulation calculation interaction module further includes: a phased guidance system, which forcibly enables geometric verification in the modeling stage, limits the maximum number of meshes to 500,000 in the calculation stage, and presets 10 standard views in the post-processing stage; a real-time feedback unit, which dynamically generates formulas by calling the SymPy symbolic calculation library; an evaluation subsystem, which uses the Hausdorff distance algorithm to compare the simulation field distribution with the analytical solution, and sets the error threshold to 5%; when the phased guidance system enables geometric verification in the modeling stage, if the user inputs parameters that cause the model to be invalid, it pushes associated teaching videos through the adaptive feedback module and automatically rolls back to the nearest valid parameter configuration.

[0016] Preferably, the system architecture module further includes: a multi-terminal adaptation layer, which uses CSS3 media queries and Flex layout technology to support adaptive rendering of Web browsers, mobile terminals, and desktop clients. The Web side is connected to the backend WebSocket through WebGL 2.0, and the mobile side encapsulates native components using the React Native framework.

[0017] Preferably, the system architecture module further includes: a real-time collaboration unit, which is based on the WebRTC protocol, deploys a STUN / TURN server cluster, and uses the difference merging algorithm for operation synchronization to achieve multi-user collaborative simulation operations.

[0018] Preferably, the system architecture module further includes: a user behavior analyzer, which collects mouse trajectory, keyboard events, and gaze hot spot data by implanting 30 data points in the front end, performs community analysis using Gephi, records the operation trajectory, and generates a learning behavior map.

[0019] Preferably, the visualization module further includes: a behavior portrait analysis sub-module, which integrates eye movement tracking data and automatically enables field strength gradient LOD rendering when the perspective switching frequency exceeds 2 times per second; for field regions where the stay exceeds 5 seconds, multi-resolution analysis is used for micro-macro synchronous comparison, and the resolution difference of wavelet transform reconstruction is controlled within 10%.

[0020] Advantages of the present invention: First of all, the COMSOL-based electromagnetic field visualization teaching simulation platform of the present invention provides users with an intuitive visualization interface and rich simulation functions through the collaborative work of the system architecture module, the visualization module, and the interactive teaching module. Users can freely build models through the parameter configuration unit, and the visualization engine can intuitively present the electromagnetic field distribution in three dimensions. The interactive teaching module provides real-time feedback and learning path recommendations, which helps users better understand and master electromagnetic field knowledge and improve learning efficiency and learning quality.

[0021] Secondly, the COMSOL-based electromagnetic field visualization teaching simulation platform of the present invention realizes adaptive rendering on different terminal devices through the COMSOL Runtime component. Users only need to download this component to run simulation cases, which is convenient for users to learn and conduct simulation experiments at any time.

[0022] In addition, the COMSOL-based electromagnetic field visualization teaching simulation platform of the present invention designs three major sections: electric field, magnetic field, and comprehensive application, which is convenient for users to search and use. The case template library is classified according to knowledge points, providing suitable cases for users at different learning stages. At the same time, the typical error configuration set can help users avoid common errors. The user portrait library is constructed through knowledge graph technology and can provide personalized learning recommendations for users. Specific implementation manners

[0023] The following further elaborates on the present invention in detail in conjunction with embodiments, so that those skilled in the art can implement it according to the description in the specification.

[0024] It should be understood that terms such as "having", "comprising", and "including" as used herein do not exclude the presence or addition of one or more other elements or their combinations.

[0025] It should be noted that the experimental methods described in the following embodiments are all conventional methods unless otherwise specified, and the reagents and materials can be obtained from commercial channels unless otherwise specified.

[0026] In the description of the present invention, unless otherwise clearly defined and limited, the terms "installation", "connection", and "setting" should be understood in a broad sense. For example, it can be fixedly connected and set, or detachably connected and set, or integrally connected and set. Embodiment

[0027] The electromagnetic field visualization teaching simulation platform based on COMSOL includes: a system architecture module, a visualization module, and a simulation calculation interaction module.

[0028] The system architecture module includes an application main interface built with PYQT5 and an electromagnetic field simulation case module built based on COMSOL APP; the application main interface includes a case selection control and a parameter input control.

[0029] The visualization module includes three independent functional partitions: an electric field area, a magnetic field area, and a comprehensive area. Each partition is configured with a corresponding three-dimensional coordinate system display window, and there is at least one preset simulation case in each area.

[0030] The simulation calculation interaction module includes a parameter verification unit, a calculation scheduling unit, and a result analysis unit, which are used to receive the simulation parameters input by the user, generate COMSOL calculation instructions, and convert the calculation results into a visualization data format.

[0031] Among them, the simulation case module includes an independent display window and its five functional partitions: a parameter input area, a function interaction area, a basic principle and model display area, a mesh construction area, and a calculation result display area, the parameter input area; the parameter input area is configured with a numerical input box and a slider control for receiving material property parameters and excitation conditions; the function interaction area includes a case-driven learning framework, an intelligent association system integrating preset teaching scenarios and simulation experiments, and provides an interactive interface including knowledge point annotation, real-time error operation prompt, and learning path recommendation; the basic principle and model display area has a built-in parameterized geometric model library, supporting three-dimensional model rotation and cross-section display; the mesh construction area provides an automatic mesh generation control and local refinement parameter settings; the calculation result display area integrates function components for starting calculation, pausing calculation, and progress display, and deploys an OpenGL visualization engine for rendering the distribution and changes of electric field lines and equipotential surfaces.

[0032] In this implementation, the main program and the COMSOL Server use the TCP / IP protocol to transmit JSON format instructions. The electric field / magnetic field data is stored in a float32 array, compressed and transmitted through zlib, and the spatial sampling interval is set to 0.1 times the working wavelength. The main interface of the system architecture module is built with PYQT5, integrating a drop-down menu for case selection and a parameter input panel. Connect to the COMSOL Server through the COM interface, and encapsulate the electromagnetic field simulation cases into independent APP modules. Each case corresponds to an mph file with a pre-set geometric model, material parameters, and boundary conditions. The electromagnetic field simulation case module is developed based on COMSOL APP. Parameter input area: Configure numeric input boxes and sliders to support the input of material properties and excitation conditions; Functional interaction area: Integrate a knowledge graph to associate teaching scenarios, and real-time detect incorrect operations such as abnormal dielectric loss and give prompts; Model display area: Load parametric geometric models, support 3D rotation and cross-section display; Mesh construction area: Provide automatic meshing and local refinement functions, and the element size of the refinement area can be set; Calculation result area: Dynamically render electric field lines and equipotential surfaces through the OpenGL engine, and support monitoring and pausing operations of the calculation progress.

[0033] In the visualization module, the 3D display window is developed based on OpenGL. The electric field area displays the field strength distribution in wireframe mode, and the equipotential surface step size is default 5V and adjustable; the magnetic field area uses vector arrows to represent the magnetic induction intensity, and the color mapping uses the HSV color spectrum from 1T to 0.1T; the comprehensive area supports the superposition display of the electromagnetic field and provides a transparency adjustment function. The coordinate system uses the right-hand rule, and the display range adapts to the simulation scale, ±1m can be extended to ±10m.

[0034] In the simulation calculation interaction module, parameter verification uses double verification of the front and back ends: the front end checks the data type, and the back end verifies the physical rationality through the COMSOL API. The calculation scheduling module supports 3 parallel tasks, submits calculations in COMSOL Batch mode, polls the log every 5 seconds to update the progress bar, with an accuracy of 1%. The result parsing unit converts the data into VTK format for the visualization module to call.

[0035] Furthermore, the system architecture module adopts a layered architecture design, specifically including: The interface layer is built using the PYQT5 framework, including menu bar, toolbar and status bar components; The logic layer implements parameter verification and task scheduling algorithms through C++. The parameter verification algorithm is encapsulated in a dynamic link library (DLL) written in C++. The PyQt5 interface layer calls the DLL interface through the ctypes module of Python to achieve cross-language communication. Key parameters are serialized and transmitted in JSON format to ensure data type consistency; The data layer uses an SQLite database to store case configuration parameters and calculation results; Among them, the simulation case module is built through COMSOL APP, and only the COMSOL Runtime component needs to be installed in the running environment.

[0036] In this implementation, the interface layer uses PyQt5 to build the main interface, integrating the menu bar, toolbar and status bar. The case selection dropdown menu queries the pre-stored case list through the SQLite3 interface. The parameter input panel uses the QGridLayout layout, and the control linkage is achieved through the signal-slot mechanism, supporting the synchronous response of the numeric input box and the slider. The logic layer develops a dynamic link library based on C++17, and the parameter verification module integrates regular expressions and numerical boundary detection. The task scheduling algorithm uses multi-threaded queue management and conducts IPC communication with the PyQt5 main process through the COM interface, supporting the asynchronous call of the COMSOL solver. The data layer uses the SQLite3 database to store case configuration parameters (and calculation results). A composite index is established to optimize the multi-condition query efficiency, and a lightweight ORM framework is used to achieve bidirectional data mapping between the C++ logic layer and the Python interface layer.

[0037] Furthermore, the visualization module also includes: several simulation sub-modules, which are placed in the electric field area, magnetic field area or comprehensive area according to the content of experimental teaching and different physical principles; An image rendering function that renders the three-dimensional electromagnetic field distribution image to obtain three-dimensional images such as electric field strength, electric field lines, magnetic field strength and magnetic induction lines; The observation position and direction in the three-dimensional space can be modified through keyboard and mouse operations.

[0038] In this implementation, the electrostatic field and time-harmonic field cases are deployed in the electric field region; the steady magnetic field and eddy current field cases are included in the magnetic field region; and the electromagnetic coupling cases are integrated in the comprehensive region. Parametric models are preset for each sub-module, and the corresponding physical equations are loaded through the SQLite database; the image rendering constructs the rendering core based on VTK 9.2. The electric field intensity uses a GLSL shader for color mapping of the blue-red gradient corresponding to 0-10 kV / m, and the electric field lines use a fourth-order Runge-Kutta streamline tracing algorithm. The magnetic field intensity is encoded with a color scale of purple-yellow spectrum corresponding to 0-1 T through HoloLens, and the magnetic induction lines are drawn using the Biot-Savart integral calculation. The equipotential surface is generated using the Marching Cubes algorithm, and the length of the vector arrow is dynamically scaled according to the field strength modulus value.

[0039] Furthermore, the simulation case module further includes: a case template library, which is divided into three categories according to the teaching syllabus: basic cases, advanced cases, and actual design cases. Each case is preset with corresponding configurations, including parametric model files, theoretical analytical solution data, etc.; users can customize and modify the default parameters, construct a new simulation model, calculate and generate new model analytical solution data and display it.

[0040] In this implementation, the case template library stores the three categories of cases classified based on the SQLite3 database: Basic cases: electrostatic field, steady magnetic field, etc., with parametric COMSOL mph models and analytical solution data preset, such as the electric field intensity analytical formula E = V / d; Advanced cases: time-harmonic field, coupled field, etc., including the theoretical solutions of multi-physics field coupling equations; Actual design cases: antenna radiation, electromagnetic sensors, etc., integrating industrial-grade geometric models and measured data comparison interfaces.

[0041] Adjustable parameter variables such as geometric dimensions and material properties are defined in the COMSOL mph file, and the parameter ranges are bound through PyQt5 input controls, such as the plate spacing of 1-100 mm. After the user modifies the parameters, the COMSOL API is called to dynamically update the model, and the finite element method is used to solve and generate new simulation data. The theoretical analytical solution is derived in real time through SymPy symbolic calculation, and the relative error is displayed in comparison with the simulation result. The error threshold is set to 5%.

[0042] The newly created model is saved as an independent mph file and a verification code is generated. The analytical solution and simulation solution data are stored in the HDF5 format, and the field distribution comparison graph is drawn through Matplotlib. The user-defined parameter history is recorded in the database, including timestamp, parameter set, and key result fields.

[0043] Furthermore, it further includes: an adaptive feedback module, which includes a behavior perception module, a feedback execution module, and an error prompt layer; the behavior perception module collects multi-modal data such as the user's operation frequency, parameter modification trajectory, and error repetition rate in real time and constructs a dynamic behavior portrait; the feedback execution module dynamically hides invalid parameter input boxes through the COMSOL API, superimposes a skin depth heat map on the 3D model to mark the contradiction area, and pushes the associated teaching video; the error prompt layer integrates TTS and NLP to generate explanatory text, combines image recognition to locate the hot spot area of the field distribution, and superimposes three-dimensional arrows to mark the direction; the adaptive feedback module and the simulation calculation interaction module adjust the verification rules of the phased guidance system in real time through the dynamic behavior portrait, and combine the difference merging algorithm of the real-time collaboration unit to achieve personalized error prompts in multi-user collaborative operations.

[0044] In this implementation scheme, specifically, the dynamic behavior portrait constructs a behavior vector containing 12 dimensions of features - operation frequency, error type entropy value, field strength attention weight by collecting the user's operation frequency, parameter modification sequence, error repetition rate, and gaze hot spot data. The feature weights are dynamically optimized through principal component analysis. The training data comes from the historical operation logs of more than 1000 users, is stored in the Hadoop cluster through the Flume log collection system, and features are extracted using a 5-minute sliding time window. The input layer of the LSTM network is a 12-dimensional feature vector, the number of hidden layer nodes is 64, the output layer is the prediction of the probability of incorrect operation (Softmax activation), and the ratio of the training set to the test set is 8:2.

[0045] The behavior perception module captures user operation events in real time based on the Qt signal-slot mechanism, records the parameter modification trajectory such as time stamp, parameter ID, and operation type into the InfluxDB time series database. Construct a dynamic behavior portrait: The operation frequency statistics use a sliding time window, which is preset to a 5-minute window, and the error repetition rate matches the historical error pattern through the Levenshtein distance. The behavior feature vector is input into the LSTM network to predict potential incorrect operations.

[0046] The feedback execution module dynamically hides invalid parameters through the setParam() interface of the COMSOL API. For example, in the electrostatic field case, it hides the frequency input box. The skin depth heat map is mapped using the ColorTransferFunction of VTK. According to the current frequency and material conductivity, δ = √(2 / (ωμσ)) is calculated and superimposed on the 3D model surface with a semi - transparent color scale. The teaching video push is based on the pre - stored knowledge association table in SQLite, and matching error codes trigger the call of the ffmpeg player. Specifically, the determination process of invalid parameters includes: Front - end verification - when it is detected that the "frequency" field is activated, but the current case label is "electrostatic field", a warning is triggered: "The electrostatic field does not require a frequency parameter". Back - end verification - check the case configuration through the COMSOL API to confirm that the physical field type is "Electrostatics" and force - hide the frequency input box. Feedback execution - superimpose a prompt text on the 3D model surface: "Invalid parameter: Frequency is not applicable to the electrostatic field", and push the associated teaching video.

[0047] The error prompt layer integrates the open - source library pyttsx3 through the TTS engine, and the voice synthesis delay is <200ms. The NLP module uses NLTK to extract keywords from the error log to generate explanatory text such as "The excitation frequency exceeds the applicable conditions of the skin depth". The hot - spot positioning of the field distribution uses threshold segmentation of OpenCV. For the area where the field strength > 85% of the maximum value, the direction is marked in three - dimensional space through vtkArrowSource, and the marking accuracy reaches 0.1mm.

[0048] Furthermore, the simulation calculation interaction module also includes: a phased guidance system, which forcibly enables geometric verification in the modeling stage, limits the maximum number of meshes to 500,000 in the calculation stage, and presets 10 standard views in the post - processing stage; a real - time feedback unit, which calls the SymPy symbolic calculation library to dynamically generate formulas; an evaluation subsystem, which uses the Hausdorff distance algorithm to compare the simulated field distribution with the analytical solution, and the error threshold is set to 5%. When the phased guidance system enables geometric verification in the modeling stage, if the user - input parameters cause the model to be invalid, an associated teaching video is pushed through the adaptive feedback module, and the system automatically rolls back to the nearest valid parameter configuration.

[0049] In this implementation, specifically, the phased guidance system calls the COMSOL Geometry API during the modeling phase to perform geometric checks such as checking the model's enclosure and non-zero volume. An invalid model triggers a QT warning pop-up window. During the calculation phase, the maximum number of elements is restricted through the COMSOL Mesh API, and the global mesh size is automatically adjusted to a node count ≤ 500,000. When the limit is exceeded, curvature adaptive refinement is forced. During the post-processing phase, 10 sets of standard view parameters such as viewing angle coordinates and scaling ratios are preset, and the orthographic / perspective projection mode is switched through vtkCamera. After testing, with a regular teaching computer configuration (CPU: i5-1135G7, RAM: 16GB), a 500,000-mesh can ensure a single-case calculation time ≤ 3 minutes, meeting the real-time requirements of the classroom. The mesh limit value is determined through optimization with multiple experiments.

[0050] The real-time feedback unit integrates the SymPy 1.12 symbolic calculation engine. When the user modifies the parameters, it dynamically parses the Maxwell equations and renders LaTeX formulas. The formula update delay ≤ 150 ms, and it supports substituting numerical values into formula parameters for verification, such as deriving the skin depth formula δ = √(2 / (ωμσ)) when inputting σ > 1e6 S / m).

[0051] The evaluation subsystem calculates the Hausdorff distance between the simulation results and the analytical solution field distribution data.

[0052] Furthermore, the system architecture module also includes: a multi-terminal adaptation layer, which uses CSS3 media queries and Flex layout technology to support adaptive rendering for web browsers, mobile terminals, and desktop clients. The web end connects to the backend WebSocket through WebGL 2.0, and the mobile end encapsulates native components using the React Native framework.

[0053] Specifically, in this implementation plan, the Web end builds a WebGL 2.0 rendering core based on Three.js, communicates with the backend service through WebSocket, has a frame rate of 30Hz, and a data compression rate of ≥70%. CSS3 media queries are used to detect the viewport size, with a resolution threshold of: PC ≥1024px, tablet ≥768px, and automatically switches to Flex layout mode. The three-dimensional control is encapsulated as a Web component, supports touch screen gesture zooming, and the two-finger distance recognition accuracy is ±2px. The mobile terminal uses the React Native 0.72 framework to encapsulate the VTK.js component, and the native module bridges the OpenGL ES 3.0 rendering pipeline through JSI. The touch event processing integrates the PanResponder gesture library to support model rotation. The adaptive layout uses the Yoga engine to dynamically adjust the control size according to the device DPI, with a base ratio of 375×667pt. The desktop client maintains the PyQt5 main framework and embeds the WebGL view through QWebEngineWidget. Multi-window collaboration uses LocalStorage to synchronize scene data, CSS3 media queries match window zoom events, and Flex layout responsively adjusts the proportion of function panels. Cross-end state management uses the JSON Patch protocol, and operation records are transmitted through Protobuf serialization. The WebSocket service deploys Socket.IO 4.7, with a heartbeat packet interval of 15 seconds, and an exponential backoff strategy for disconnection and reconnection, with a maximum of 5 retries.

[0054] Furthermore, the system architecture module also includes: a real-time collaboration unit, which is based on the WebRTC protocol, deploys a STUN / TURN server cluster, and uses a difference merging algorithm for operation synchronization to achieve multi-user collaborative simulation operations.

[0055] In this implementation, a STUN / TURN server cluster is deployed, and 3 nodes are configured to achieve load balancing (single-node bandwidth ≥ 1Gbps). The client exchanges SDP / ICE candidate addresses through the WebSocket signaling service, and the NAT penetration success rate ≥ 98%. The media channel uses VP8 encoding, and the bit rate is adaptively adjusted between 512Kbps and 8Mbps. The data channel enables SRTP encrypted transmission; an atomic instruction set for operations is defined, including 18 types of operations such as model rotation and parameter modification, and the differences are described in the JSON Patch format. The server deploys the Operational Transformation algorithm, and conflict resolution is based on timestamp priority at the millisecond level of UTC. The synchronization delay is controlled within 150ms, and the packet loss retransmission strategy uses forward error correction with an FEC redundancy of 20%. The client maintains a local operation log and achieves eventual consistency through CRDT. The collaborative focus uses cursor following technology, and the user operation area is marked with a semi-transparent color block, RGBα = 0.2. Historical operations support 10 levels of undo / redo, and the status snapshot interval is 30 seconds. The network quality monitoring module calculates the RTT in real time, with a 50ms sampling window and an EMA smoothing coefficient of 0.25 for the packet loss rate, and dynamically switches the TURN relay path. In a weak network environment, the rendering accuracy is automatically degraded, with a mesh simplification rate of 30% - 70%, and critical operation instructions are preferentially transmitted, and the QoS level is marked as DSCP 46. The user's parameter modifications are transmitted to the server through WebRTC. The server calls the COMSOL API to update the model and calculate, generates a difference data packet (in JSON Patch format), and broadcasts it to other users. The client receives the data through WebSocket, and uses the Operational Transformation algorithm to merge operations to ensure multi-user view consistency. The difference merging algorithm uses a conflict resolution strategy that prioritizes timestamp priority and supplements it with the weight of the operation type. When operation conflicts occur, the server preferentially retains the operation with the latest timestamp; if the time difference is less than the threshold, the final operation is determined according to the weight of the operation type - geometric check > parameter modification > view adjustment. The server implements difference merging based on the Operational Transformation (OT) algorithm, and the operation instructions are encoded in the JSON Patch format. Conflict detection uses vector clocks to mark the operation sequence, and the client ensures eventual consistency through CRDT (Conflict-Free Replicated Data Type), and recovers data through forward error correction (FEC) redundant packets in the case of packet loss.

[0056] Furthermore, the system architecture module also includes: a user behavior analyzer, which collects mouse trajectory, keyboard event, and gaze hotspot data by implanting 30 data points at the front end, conducts community analysis using Gephi, records the operation trajectory, and generates a learning behavior map.

[0057] In this embodiment, data points are implanted in 30 key interaction areas at the front end, such as parameter input boxes and model rotation controls, and the DOM changes are monitored through MutationObserver. The mouse trajectory sampling rate is set to 50 ms / time, and the coordinates, stay duration, and movement speed are recorded. The keyboard event captures the KeyDown / Up status, and the visual focus area of the fixation hot spot is calculated through Element.getBoundingClientRect(). The collected data is compressed and stored in the Protobuf format, including timestamps, event types, and context parameters. The behavior logs are transmitted to the Kafka cluster in real time through WebSocket, and the Flink stream processing engine performs window statistics. A 5-minute sliding window is preset to calculate 12-dimensional features such as operation frequency and path entropy value; Gephi 0.10 is used to construct a user behavior graph: the nodes represent operation events (weight = occurrence frequency), and the edge weights are calculated by the co-occurrence rate of event sequences. The ForceAtlas2 layout algorithm is adopted, the repulsive force intensity = 1000, and the gravity = 5. The modularity analysis identifies 6 typical operation modes. The critical path is extracted based on the PageRank algorithm, and the damping coefficient is 0.85. The learned behavior graph is stored in the GraphML format, and the node attributes include fields such as average time consumption and error rate. The Sankey diagram is rendered through D3.js to display the operation path migration, and the heat map is overlaid on the 3D view to annotate the fixation hot spot, with a Gaussian kernel radius of 5px. The data anonymization process complies with the GDPR specification, and the privacy fields are encrypted with AES-256.

[0058] Furthermore, the visualization module further includes: a behavior portrait analysis sub-module, which integrates eye movement tracking data. When the perspective switching frequency exceeds 2 times / second, the field strength gradient LOD rendering is automatically enabled; for the field area where the stay exceeds 5 seconds, multi-resolution analysis is used for microscopic-macroscopic synchronous comparison, and the resolution difference of wavelet transform reconstruction is controlled within 10%.

[0059] In this implementation, the Tobii Pro SDK is integrated to collect eye movement data with a sampling rate of 60 Hz. The perspective switching frequency is calculated by timestamp difference, and the window length is 1 second. When the frequency > 2 Hz, the field strength gradient LOD rendering is activated: the full-precision grid is retained in the area where the gradient threshold > 1 kV / m², and mesh simplification is enabled in the remaining areas with a simplification rate of 30% - 70%. The equipotential surface of the field strength is drawn in layers using an octree, and the rendering frame rate is stable ≥ 25 FPS. For the area where the fixation stays ≥ 5 seconds, three-layer Haar wavelet decomposition is performed: the low-frequency component maintains the macroscopic structure with a resolution of 0.5 mm, and the high-frequency component reconstructs the microscopic details. The resolution difference is truncated by a threshold, and the energy retention is ≥ 90% with a control error < 10%. The comparison view uses a split-screen technique, with the macroscopic field distribution shown on the left and the heat map of the detail difference superimposed on the right. The eye movement data and the rendering instructions are interacted through shared memory with a latency < 15 ms, and the double-buffer strategy is used for LOD parameter update to avoid screen tearing. The wavelet coefficient calculation is accelerated by CUDA 11.6, and the single-frame processing time is ≤ 8 ms. The viewpoint historical data is stored in a circular queue, supporting retrospective analysis with a time window ≥ 30 seconds. For users without an eye-tracking device, the system defaults to trigger LOD rendering optimization through the mouse stay time (≥ 5 seconds) and the perspective switching frequency (manual operation).

[0060] Although the embodiments of the present invention have been disclosed as above, they are not limited to only the applications listed in the specification and the embodiments. It can be fully applied to various fields suitable for the present invention. For those familiar with the field, additional modifications can be easily implemented.

Claims

1. An electromagnetic field visualization teaching simulation platform based on COMSOL, characterized in that, Including: A system architecture module, which includes an application main interface built with PYQT5 and an electromagnetic field simulation case module built based on COMSOL APP; the application main interface includes a case selection control and a parameter input control; A visualization module, which includes three independent functional partitions: an electric field area, a magnetic field area, and a comprehensive area. Each partition is configured with a corresponding three-dimensional coordinate system display window, and there is at least one preset simulation case in each area; A simulation calculation interaction module, which includes a parameter verification unit, a calculation scheduling unit, and a result analysis unit, for receiving simulation parameters input by the user, generating COMSOL calculation instructions, and converting the calculation results into a visualization data format; Among them, the simulation case module includes an independent display window and its five functional partitions: a parameter input area, a function interaction area, a basic principle and model display area, a mesh construction area, and a calculation result display area, a parameter input area; the parameter input area is configured with a numerical input box and a slider control for receiving material property parameters and excitation conditions; the function interaction area includes a case-driven learning framework, an intelligent association system integrating preset teaching scenarios and simulation experiments, and provides an interactive interface including knowledge point annotation, real-time error operation prompt, and learning path recommendation; the basic principle and model display area has a built-in parametric geometric model library, supporting three-dimensional model rotation and cross-section display; the mesh construction area provides an automatic mesh generation control and local refinement parameter settings; the calculation result display area integrates function components for starting calculation, pausing calculation, and progress display, and deploys an OpenGL visualization engine for rendering the distribution and changes of electric field lines and equipotential surfaces.

2. The electromagnetic field visualization teaching simulation platform based on COMSOL according to claim 1, wherein The system architecture module adopts a layered architecture design, specifically including: The interface layer is built with the PYQT5 framework and includes menu bar, toolbar, and status bar components; The logic layer implements parameter verification and task scheduling algorithms through C++; The data layer uses an SQLite database to store case configuration parameters and calculation results; Among them, the simulation case module is built through COMSOL APP, and only the COMSOL Runtime component needs to be installed in the running environment.

3. The electromagnetic field visualization teaching simulation platform based on COMSOL according to claim 1, characterized in that, The visualization module also includes: A number of simulation sub-modules, which are placed in the electric field area, magnetic field area, or comprehensive area according to the content of experimental teaching and different physical principles; An image rendering function, which renders the three-dimensional electromagnetic field distribution image to obtain three-dimensional images of electric field strength, electric field lines, magnetic field strength, magnetic induction lines, etc.; the observation position and direction in three-dimensional space can be modified through keyboard and mouse operations.

4. The electromagnetic field visualization teaching simulation platform based on COMSOL according to claim 1, characterized in that, The simulation case module also includes: A case template library, which is divided into three categories according to the teaching syllabus: basic cases, advanced cases, and actual design cases. Each case has a corresponding preset configuration, including parametric model files, theoretical analytical solution data, etc.; users can customize and modify the default parameters, build a new simulation model, calculate and generate new model analytical solution data and display it.

5. The electromagnetic field visualization teaching simulation platform based on COMSOL as claimed in claim 1, wherein Also including: An adaptive feedback module, which includes a behavior perception module, a feedback execution module, and an error prompt layer; The behavior perception module collects the user's operation frequency, parameter modification trajectory, error repetition rate multi-modal data in real time and constructs a dynamic behavior portrait; The feedback execution module dynamically hides the invalid parameter input box through the COMSOL API, superimposes the skin depth thermodynamic diagram on the 3D model to mark the conflicting area, and pushes the related teaching video; the error prompt layer integrates TTS and NLP to generate explanatory text, combines image recognition to locate the hot spot area of the field distribution and superimposes the three-dimensional arrow to mark the direction; The adaptive feedback module and the simulation calculation interaction module adjust the verification rules of the phased guidance system in real time through dynamic behavior profiling, and combine the difference merging algorithm of the real-time collaboration unit to realize personalized error prompts in multi-user collaborative operations.

6. The electromagnetic field visualization teaching simulation platform based on COMSOL according to claim 1, characterized in that, The simulation computing interaction module also includes: A phased guidance system that forces geometry validation during the modeling phase, limits the maximum number of meshes to 500,000 during the calculation phase, and presets 10 standard views during the post-processing phase; A real-time feedback unit that calls the SymPy symbolic computation library to dynamically generate formulas; The evaluation subsystem uses the Hausdorff distance algorithm to compare the simulated field distribution with the analytical solution, with the error threshold set to 5%; When the staged guidance system enables geometric verification in the modeling stage, if the user input parameters cause the model to be invalid, the associated teaching video is pushed through the adaptive feedback module and automatically rolls back to the most recent valid parameter configuration.

7. The electromagnetic field visualization teaching simulation platform based on COMSOL according to claim 1, characterized in that The system architecture module also includes: The multi-terminal adaptation layer uses CSS3 media query and Flex layout technology to support adaptive rendering of web browsers, mobile terminals and desktop clients. The web terminal connects to the back-end WebSocket through WebGL 2.0, and the mobile terminal uses the React Native framework to encapsulate native components.

8. The electromagnetic field visualization teaching simulation platform based on COMSOL according to claim 1, characterized in that The system architecture module also includes: The real-time collaboration unit is based on the WebRTC protocol, deploys a STUN / TURN server cluster, and uses a difference merging algorithm for operation synchronization to achieve multi-user collaborative simulation operations.

9. The electromagnetic field visualization teaching simulation platform based on COMSOL according to claim 1, characterized in that, The system architecture module also includes: The user behavior analyzer implants 30 tracking points on the front end to collect mouse tracks, keyboard events, and gaze hotspot data, uses Gephi for community analysis, records operation tracks, and generates learning behavior maps.

10. The electromagnetic field visualization teaching simulation platform based on COMSOL according to claim 1, characterized in that, The visualization module also includes: The behavior profile analysis submodule integrates eye tracking data and automatically enables field intensity gradient LOD rendering when the viewing angle switching frequency exceeds 2 times per second; For the field areas that stayed for more than 5 seconds, multi-resolution analysis was used for micro-macro synchronization comparison, and the difference in resolution of wavelet transform reconstruction was controlled within 10%.

Citation Information

Cited By

  • Camera for capturing three-dimensional stress field of structure

    CN121072335A