Real-time solution method, system, device and medium for circuit equations based on micro-motion
Through the real-time solution method of circuit equations based on micro-momentum, the problem of the incompatibility between accuracy and speed in the circuit equation solution algorithm is solved, and efficient circuit simulation within the allowable error range is achieved, which is suitable for real-time simulation of complex power electronic circuits.
Patent Information
- Application Number
- CN202510558943.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-30
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2045-04-30
AI Technical Summary
The accuracy and speed of circuit equation solving algorithms in existing real-time simulation fields cannot be coordinated and controlled, and the circuit scale is limited. Users need to frequently switch algorithms to balance accuracy and speed.
A real-time solution method for circuit equations based on micro-momentum is adopted. Through numbering operation, micro-momentum weighting coefficient setting, maximum simulation step number and maximum allowable error setting, a real-time solver is established, and the circuit coefficient matrix is updated in real time to achieve the coordination between accuracy and speed.
Within the allowable error range, the storage of subtle effects on switching events is reduced, resources are saved, and simulation speed and accuracy are improved, making it suitable for real-time simulation of complex circuits.
Smart Images

Figure CN120068481B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of real-time simulation, and relates to a method, system, equipment and medium for solving circuit equations in real time. Background Art
[0002] In recent years, real-time simulation has been widely used in industries such as aerospace, new energy vehicles, power systems, and automation. It plays an indispensable role in every process, from R&D and design to verification and testing. Compared to physical systems, real-time simulation requires computation time less than or equal to the actual step size of discrete digital systems. It also offers hardware-in-the-loop (HIL) simulation, or semi-physical simulation capabilities, which improves R&D efficiency while reducing the cost and risk of experimentation or testing.
[0003] In current applications centered around power electronic converters, the operating frequencies of semiconductor-based switching power electronic circuits are increasing. To ensure simulation accuracy, the sampling speed for simulations involving switching circuits is typically required to be at least 20 times the switching frequency. For general simulation objects, a smaller simulation step size not only allows for more accurate detection of switching events but also helps characterize the dynamic characteristics of power electronic circuits, resulting in higher simulation accuracy. However, for complex simulation objects, a smaller step size inevitably increases the computational effort. Choosing a solution algorithm to ensure simulation accuracy and real-time computation poses a significant challenge to simulation platform development.
[0004] For solving circuit equations in real-time simulation, the most common algorithms currently used are mainly node-based and state-space algorithms. However, these methods still suffer from two drawbacks: first, the algorithm's accuracy and speed cannot be balanced and controlled; second, the applicable circuit scale is limited. Currently, simulation algorithm design only considers improving either accuracy or speed. For users, once a simulation algorithm is selected, there is no way to control its accuracy or speed. For different simulation objects, users must constantly switch simulation algorithms, choosing between accuracy and speed. This means that accuracy and speed cannot be balanced and controlled. Summary of the Invention
[0005] In order to solve the problem described in the background technology that the solution accuracy and solution speed of the circuit equation solving algorithm in the current real-time simulation field cannot be coordinated and controlled, the present invention provides a real-time solution method, system, device and medium for circuit equations based on micro-momentum.
[0006] The method of the present invention comprises:
[0007] According to the target circuit and switch combination to be solved in real time, the target circuit is numbered, and the matrix and matrix change amount under each target circuit number are listed;
[0008] According to the influence of each variable element in the matrix and matrix variation under each target circuit number on the accurate solution of the circuit equation, the weighted coefficient of the micro-momentum is set;
[0009] According to the matrix and matrix variation under each target circuit number, the maximum number of simulation steps and the maximum allowable error that allow the matrix to remain unchanged are set;
[0010] According to the matrix and matrix variation under each target circuit number, micro-motion weighting coefficient, maximum simulation steps and maximum allowable error, a real-time solver based on micro-motion is established;
[0011] The circuit equations of the target circuit are solved in real time by a real-time solver based on micro-momentum.
[0012] Furthermore, in the switch combination, the switch state can take any value in the value range {0, 1}, and all state combinations or state combinations with restricted conditions are considered;
[0013] The matrix is a circuit coefficient matrix, and the circuit coefficient matrix is an adjoint matrix or a transfer matrix;
[0014] The matrix variation is the variation between the two circuit coefficient matrices. The variation is stored in a table using the switch state numbers corresponding to the two matrices as indexes and is directly called during real-time simulation.
[0015] Furthermore, the method for setting the micro-momentum weighting coefficient is as follows:
[0016] Disconnect all switches in the circuit to obtain the initial circuit coefficient matrix A 0 ;
[0017] Turn on in sequence n switches, record the corresponding coefficient matrix A 1 ~A n ;
[0018] contrast A 1 ~A n and A 0 ,statistics n The number of times each element changes when the switch is turned on k ij ;
[0019] Set the weighted coefficient of the micro-momentum of each position element in the matrix α ij , the calculation formula is:
[0020] αij =k ij / n 2 ,in i,j=1,2,…,n .
[0021] Furthermore, the maximum number of simulation steps k max and the maximum allowable error δ max Manual setting is used to avoid occasional errors, that is, after multiple consecutive switching of the switch, the state quantity of the circuit has changed significantly, but the corresponding series of matrix changes have not exceeded the threshold and no matrix switching has been triggered.
[0022] Furthermore, the process of establishing the real-time solver based on micro-momentum includes:
[0023] In the offline processing part, manually set the maximum number of simulation steps that allow the matrix to remain unchanged k max and the maximum allowable error δ max , according to the weighted coefficient of micro-momentum α ij The correspondence between switch state switching and coefficient matrix update is calculated offline in advance with the matrix change amount;
[0024] During the real-time simulation process, the input content includes: circuit equations under each target circuit number, the corresponding relationship table between switch state switching and coefficient matrix update, simulation step size and simulation time, and the output content includes: observation signal sequence.
[0025] Furthermore, the following steps are looped during the simulation duration:
[0026] S1. Determine whether a state change of the switch device occurs at the sampling moment. If not, go to step S5.
[0027] S2. If the state of the switch device changes, query the corresponding relationship table between the switch state switching and the coefficient matrix update;
[0028] S3, determine whether the circuit coefficient matrix needs to be updated, if not, go to step S5;
[0029] S4. If the circuit coefficient matrix needs to be updated, update the circuit coefficient matrix;
[0030] S5. Calculate the observed signal value using the circuit coefficient matrix.
[0031] Furthermore, the process of solving the circuit equation of the target circuit in real time by the real-time solver based on micro-momentum includes:
[0032] First, the real-time solver based on micro-momentum is initialized, and the circuit equations, the corresponding relationship table between switch state switching and coefficient matrix update, simulation step size and simulation time under each target circuit number are processed offline;
[0033] Then loop the following steps within the simulation duration:
[0034] S1. Determine whether a state change of the switch device occurs at the sampling moment. If not, go to step S5.
[0035] S2. If the state of the switch device changes, query the corresponding relationship table between the switch state switching and the coefficient matrix update;
[0036] S3, determine whether the circuit coefficient matrix needs to be updated, if not, go to step S5;
[0037] S4. If the circuit coefficient matrix needs to be updated, update the circuit coefficient matrix;
[0038] S5. Calculate the observed signal value using the circuit coefficient matrix;
[0039] Finally, determine whether the simulation time has been reached. If not, execute step S1 above and enter the next sampling step. If the simulation time has been reached, the solution ends.
[0040] To implement the above-mentioned method, the present invention proposes a real-time circuit equation solving system based on micro-momentum, including a matrix and matrix variation column writing module, a micro-momentum weighting coefficient setting module, a simulation parameter setting module, a real-time solver establishment module, and a circuit equation real-time solving module.
[0041] The matrix and matrix variation writing module is used to perform target circuit numbering operations according to the target circuit and switch combination to be solved in real time, and write the matrix and matrix variation under each target circuit number.
[0042] The micro-momentum weighted coefficient setting module is used to set the micro-momentum weighted coefficient according to the influence of each variable element in the matrix and matrix variation under each target circuit number on the accurate solution of the circuit equation.
[0043] The simulation parameter setting module is used to set the maximum number of simulation steps and the maximum allowable error of the matrix that is allowed to remain unchanged according to the matrix and the matrix change amount under each target circuit number.
[0044] The real-time solver establishment module is used to establish a real-time solver based on micro-motion according to the matrix and matrix variation under each target circuit number, micro-motion weighting coefficient, maximum simulation steps and maximum allowable error.
[0045] The circuit equation real-time solving module is used to solve the circuit equation of the target circuit in real time by using a real-time solver based on micro-momentum.
[0046] The present invention also proposes an electronic device, comprising: a memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to implement the real-time solution method of circuit equations based on micro-momentum as described above.
[0047] The present invention also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the real-time solution method for circuit equations based on micro-momentum as described above is implemented.
[0048] Compared with the prior art, the present invention is based on the concept of "small changes and no changes". According to the characteristics of actual power electronic systems with many switches, different influence weights of each switch, and the rapid decrease in the influence of a single switch as the number of system switches increases, the influence of switch switching on the circuit equation and its solution is analyzed. The maximum number of simulation steps and the maximum allowable error can be set. The relationship between accuracy and speed is established through the maximum number of simulation steps and the maximum allowable error, thereby obtaining a standard for selecting accuracy and speed, so that the solution accuracy and solution speed of the circuit equation solution algorithm are coordinated and controllable. The present invention can be widely applied to circuits using ADC switch models, variable resistor switch models, ideal switch models, etc. Within the allowable error range, it is not necessary to consider the slight influence of all switching events on the circuit, and the solutions under some switch states within the allowable error range only need to store the same inverse matrix, saving a large amount of storage resources and computing time, and realizing real-time simulation of circuit equations with a balance between speed, accuracy and resource consumption. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 Flow chart of the method of the present invention.
[0050] Figure 2 Flowchart for the use of the real-time solver based on micro-momentum.
[0051] Figure 3 This is a system architecture diagram of the present invention. DETAILED DESCRIPTION
[0052] In order to make the technical problems, technical solutions and beneficial effects to be solved by this application more clearly understood, this application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0053] Real-time solution method of circuit equation based on micro-motion, the flow chart is as follows Figure 1 The specific steps are as follows.
[0054] First, according to the target circuit and switch combination to be solved in real time, the target circuit is numbered, and the matrix and matrix change under each target circuit number are listed.
[0055] Among them, in the switch combination, the switch state can take any value in the value range {0, 1}, considering all state combinations or state combinations with restricted conditions; the matrix is the circuit coefficient matrix, and the circuit coefficient matrix is an adjoint matrix or a transfer matrix; the matrix variation is the variation between the above circuit coefficient matrices, and the variation is stored in a table with the switch state numbers corresponding to the two matrices as indexes, and is directly called during real-time simulation.
[0056] Then, the weighted coefficient of the micro-momentum is set according to the influence of each variable element in the matrix and matrix variation under each target circuit number on the accurate solution of the circuit equation.
[0057] Specifically, the method for setting the micro-momentum weighting coefficient is:
[0058] Disconnect all switches in the circuit to get the initial circuit coefficient matrix A 0 ;
[0059] Turn on in sequence n switches, record the corresponding coefficient matrix A 1 ~A n ;
[0060] contrast A 1 ~A n and A 0 ,statistics n The number of times each element changes when the switch is turned on k ij ;
[0061] Set the weighted coefficient of the micro-momentum of each position element in the matrix α ij , the calculation formula is:
[0062] α ij =k ij / n 2 ,in i,j=1,2,…,n .
[0063] Then, according to the matrix and matrix change amount under each target circuit number, the maximum number of simulation steps and the maximum allowable error that allow the matrix to remain unchanged are set.
[0064] Maximum number of simulation steps k max and the maximum allowable error δ max Manual setting is used to avoid occasional errors, that is, after multiple consecutive switching of the switch, the state quantity of the circuit has changed significantly, but the corresponding series of matrix changes have not exceeded the threshold and no matrix switching has been triggered.
[0065] Then, a real-time solver based on micro-motion is established according to the matrix and matrix variation under each target circuit number, micro-motion weighting coefficient, maximum simulation steps and maximum allowable error.
[0066] Specifically, the process of establishing a real-time solver based on micro-momentum includes:
[0067] In the offline processing part, manually set the maximum number of simulation steps that allow the matrix to remain unchanged k max and the maximum allowable error δ max , according to the weighted coefficient of micro-momentum α ij The correspondence between switch state switching and coefficient matrix update is calculated offline in advance with the matrix change amount;
[0068] During the real-time simulation process, the input content includes: circuit equations under each target circuit number, the corresponding relationship table between switch state switching and coefficient matrix update, simulation step size and simulation time, and the output content includes: observation signal sequence.
[0069] More specifically, the following steps are looped within the simulation duration:
[0070] S1. Determine whether a state change of the switch device occurs at the sampling moment. If not, go to step S5.
[0071] S2. If the state of the switch device changes, query the corresponding relationship table between the switch state switching and the coefficient matrix update;
[0072] S3, determine whether the circuit coefficient matrix needs to be updated, if not, go to step S5;
[0073] S4. If the circuit coefficient matrix needs to be updated, update the circuit coefficient matrix;
[0074] S5. Calculate the observed signal value using the circuit coefficient matrix.
[0075] Finally, the circuit equations of the target circuit are solved in real time by a real-time solver based on micro-momentum.
[0076] The flowchart of using the real-time solver based on micro-momentum is as follows: Figure 2As shown, firstly, the real-time solver based on micro-momentum is initialized, and the circuit equations, the corresponding relationship table between switch state switching and coefficient matrix update, the simulation step size and the simulation time under each target circuit number are processed offline;
[0077] Then loop the following steps within the simulation duration:
[0078] S1. Determine whether a state change of the switch device occurs at the sampling moment. If not, go to step S5.
[0079] S2. If the state of the switch device changes, query the corresponding relationship table between the switch state switching and the coefficient matrix update;
[0080] S3, determine whether the circuit coefficient matrix needs to be updated, if not, go to step S5;
[0081] S4. If the circuit coefficient matrix needs to be updated, update the circuit coefficient matrix;
[0082] S5. Calculate the observed signal value using the circuit coefficient matrix.
[0083] Finally, determine whether the simulation time has been reached. If not, execute step S1 above and enter the next sampling step. If the simulation time has been reached, the solution ends.
[0084] In order to realize the above-mentioned method, a real-time circuit equation solving system based on micro-motion is proposed, and its architecture is shown in the figure below. Figure 3 As shown, it consists of a matrix and matrix variation column writing module, a micro-motion weighting coefficient setting module, a simulation parameter setting module, a real-time solver establishment module, and a circuit equation real-time solving module.
[0085] The matrix and matrix variation writing module is used to perform target circuit numbering operations according to the target circuit and switch combination to be solved in real time, and write the matrix and matrix variation under each target circuit number.
[0086] The micro-momentum weighting coefficient setting module is used to set the micro-momentum weighting coefficient according to the influence of each change element in the matrix and matrix change under each target circuit number on the accurate solution of the circuit equation.
[0087] The simulation parameter setting module is used to set the maximum number of simulation steps and the maximum allowable error of the matrix that can remain unchanged according to the matrix and matrix change amount under each target circuit number.
[0088] The real-time solver establishment module is used to establish a real-time solver based on micro-motion according to the matrix and matrix variation under each target circuit number, micro-motion weighting coefficient, maximum simulation steps and maximum allowable error.
[0089] The circuit equation real-time solving module is used to solve the circuit equation of the target circuit in real time through a real-time solver based on micro-momentum.
[0090] An electronic device includes: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to implement the above-mentioned method for solving circuit equations in real time based on micro-momentum and the system for solving circuit equations in real time based on micro-momentum.
[0091] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the above-mentioned method for solving circuit equations in real time based on micro-momentum and the system for solving circuit equations in real time based on micro-momentum.
[0092] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The solutions in the embodiments of the present application may be implemented in various computer languages, such as object-oriented programming languages Java, C++, Python, and interpreted scripting languages like JavaScript.
[0093] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0094] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1The function specified in one or more boxes.
[0095] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 The steps for the function specified in one or more boxes.
[0096] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present application.
[0097] Obviously, those skilled in the art may make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalents, this application is intended to include these modifications and variations.
Claims
1. A real-time solution method for circuit equations based on micro-motion, characterized in that: include: According to the target circuit and switch combination to be solved in real time, the target circuit is numbered, and the matrix and matrix variation under each target circuit number are listed; in the switch combination, the switch state can take any value in the value range {0, 1}, and all state combinations or state combinations with restricted conditions are considered; the matrix is a circuit coefficient matrix, and the circuit coefficient matrix is an adjoint matrix or a transfer matrix; the matrix variation is the variation between the above circuit coefficient matrices, and the variation is stored in a table using the switch state numbers corresponding to the two matrices as indexes, and is directly called during real-time simulation; According to the influence of each variable element in the matrix and matrix variation under each target circuit number on the accurate solution of the circuit equation, the weighted coefficient of the micro-momentum is set; According to the matrix and matrix variation under each target circuit number, the maximum number of simulation steps and the maximum allowable error that allow the matrix to remain unchanged are set; According to the matrix and matrix variation under each target circuit number, micro-motion weighting coefficient, maximum simulation steps and maximum allowable error, a real-time solver based on micro-motion is established; The circuit equations of the target circuit are solved in real time by a real-time solver based on micro-momentum.
2. The method for solving circuit equations in real time based on micro-motion according to claim 1, characterized in that: The method for setting the micro-momentum weighting coefficient is: Disconnect all switches in the circuit to obtain the initial circuit coefficient matrix A0; Turn on n switches in sequence and record the corresponding coefficient matrix A1~A n ; Comparison of A1~A n With A0, count the number of times each element changes when the switch is turned on n times k ij ; Set the weighted coefficient α of the micro-momentum of each position element in the matrix ij , the calculation formula is: a ij =k ij / n 2 , among them i,j=1,2,…,n。 3. The method for solving circuit equations in real time based on micro-motion according to claim 1, characterized in that: The maximum number of simulation steps k max and the maximum allowable error δ max Manual setting is used to avoid occasional errors, that is, after multiple consecutive switching of the switch, the state quantity of the circuit has changed significantly, but the corresponding series of matrix changes have not exceeded the threshold and no matrix switching has been triggered.
4. The method for solving circuit equations in real time based on micro-motion according to claim 3, characterized in that: The process of establishing the real-time solver based on micro-momentum includes: In the offline processing part, manually set the maximum number of simulation steps k that allows the matrix to remain unchanged max and the maximum allowable error δ max , according to the micro-momentum weighting coefficient α ij The correspondence between switch state switching and coefficient matrix update is calculated offline in advance with the matrix change amount; During the real-time simulation process, the input content includes: circuit equations under each target circuit number, the corresponding relationship table between switch state switching and coefficient matrix update, simulation step size and simulation time, and the output content includes: observation signal sequence.
5. The method for solving circuit equations in real time based on micro-motion according to claim 4, characterized in that: The real-time solver based on micro-momentum solves the circuit equations of the target circuit in real time, including the following steps: First, the real-time solver based on micro-momentum is initialized, and the circuit equations, the corresponding relationship table between switch state switching and coefficient matrix update, simulation step size and simulation time under each target circuit number are processed offline; Then loop the following steps within the simulation duration: S1. Determine whether a state change of the switch device occurs at the sampling moment. If not, go to step S5. S2. If the state of the switch device changes, query the corresponding relationship table between the switch state switching and the coefficient matrix update; S3, determine whether the circuit coefficient matrix needs to be updated, if not, go to step S5; S4. If the circuit coefficient matrix needs to be updated, update the circuit coefficient matrix; S5. Calculate the observed signal value using the circuit coefficient matrix; Finally, determine whether the simulation time has been reached. If not, execute step S1 above and enter the next sampling step. If the simulation time has been reached, the solution ends.
6. A system for solving circuit equations in real time based on micro-motion quantity, which implements the method according to any one of claims 1 to 5, characterized in that: It includes a module for writing matrices and matrix variation, a module for setting micro-motion weighting coefficients, a module for setting simulation parameters, a module for establishing a real-time solver, and a module for solving circuit equations in real time. The matrix and matrix variation writing module is used to perform target circuit numbering operations according to the target circuit and switch combination to be solved in real time, and write the matrix and matrix variation under each target circuit number; The micro-momentum weighting coefficient setting module is used to set the micro-momentum weighting coefficient according to the influence of each variable element in the matrix and matrix variation under each target circuit number on the accurate solution of the circuit equation; The simulation parameter setting module is used to set the maximum number of simulation steps and the maximum allowable error of the matrix that can remain unchanged according to the matrix and the matrix change amount under each target circuit number; The real-time solver establishment module is used to establish a real-time solver based on micro-motion according to the matrix and matrix variation under each target circuit number, micro-motion weighting coefficient, maximum simulation steps and maximum allowable error; The circuit equation real-time solving module is used to solve the circuit equation of the target circuit in real time by using a real-time solver based on micro-momentum.
7. An electronic device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor implements the real-time method for solving circuit equations based on micro-momentum as described in any one of claims 1 to 5 by executing the computer instructions.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the real-time method for solving circuit equations based on micro-momentum according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Optimal selection method for simulation step size of power electronic system
CN117574680A
Power electronic converter non-delay decoupling parallel simulation method
CN118839642A