Circuit simulation method
By causal correction of frequency response and building an equivalent circuit model, the problems of causality and poor platform adaptability in existing circuit modeling are solved, and high-precision time domain analysis and system-level simulation are realized, which are suitable for complex circuit systems.
Patent Information
- Application Number
- CN202510486487.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-18
- Publication Date
- 2025-07-22
AI Technical Summary
The existing circuit modeling and simulation methods have obvious shortcomings in terms of lack of causality in response, inability to combine structures, insufficient modeling accuracy and poor platform adaptability, and it is difficult to achieve high-precision time domain analysis in complex scenarios such as power systems, radio frequency systems and high-speed signal links.
By causally correcting the frequency response, an equivalent circuit model with a clear structure is constructed, and module replacement modeling and system combination simulation are carried out under multiple simulation platforms. It is suitable for high-precision time domain analysis in complex scenarios such as electronic systems, power electronic systems and power systems.
It improves modeling accuracy and numerical stability, enhances system-level modeling capabilities, supports multi-platform adaptation, and has good engineering achievement and practicality.
Smart Images

Figure CN120354811A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of circuit system modeling and simulation, and particularly to a method, a computer-readable storage medium, and a circuit simulation device for establishing an equivalent model to implement circuit simulation. Background Art
[0002] Circuit simulation is a key technology for numerically analyzing the electrical behavior of a circuit under different operating conditions by using mathematical models and calculation methods. According to the data types and solution methods adopted, circuit simulation is usually divided into two categories: frequency-domain simulation and time-domain simulation. Among them, time-domain simulation reveals the transient and steady-state characteristics of the system by solving physical quantities such as node voltages and branch currents that change with time, and is widely used in complex engineering scenarios such as power system dynamic analysis, radio frequency system modeling, and high-speed signal link verification.
[0003] In the existing circuit modeling technology, the mainstream method usually approximately models the dynamic behavior of the circuit by constructing an equivalent circuit network including resistors, inductors, capacitors, controlled sources, and behavioral models, etc., and relies on methods such as nodal analysis or state-space modeling for time-domain simulation. This type of method is widely integrated in SPICE and its derivative software, and is the basic means of current engineering simulation. However, when facing a system with complex structure, sudden change in frequency-domain characteristics, or strong coupling dynamics, this type of modeling method often has problems such as low model accuracy, poor numerical stability, and difficulty in handling interface coupling between modules. Especially in scenarios such as power system transients, large-scale radio frequency module links, and high-speed interconnections, this type of method is difficult to accurately describe the true behavior of the system, and often appears phenomena such as convergence difficulties, simulation divergence, or result distortion. In addition, this type of method lacks the ability to directly reuse existing response data, and cannot make full use of measurement or simulation prior information such as frequency response, which limits its flexibility and computational efficiency.
[0004] The applicant previously proposed an alternative modeling approach and has obtained relevant authorized patents in China, Canada, and the United States, including Chinese Patent CN106326509B (publication date: January 11, 2017), Canadian Patents CA2988865 (publication date: June 14, 2019) and CA3108477 (publication date: June 14, 2019), and US Patent US10445448B2 (publication date: June 20, 2019). This technical approach divides the target circuit into multiple sub-modules, obtains the frequency response or impulse response of a part of them, and performs a convolution operation with the port voltage or current, thereby constructing an equivalent circuit model with a clear structure and controllable parameters, achieving alternative modeling and interface combination of the subsystem in system simulation. However, in the above existing solutions, the frequency response usually has not been processed for causality correction. In cases where the spectrum sampling range is limited, the data is asymmetric, or the bandwidth is truncated, directly inverse-transforming the frequency response to the time domain is likely to introduce non-physical forward interference or mirror errors, resulting in non-causal characteristics in the obtained system time-domain response, thereby affecting the modeling accuracy and simulation stability.
[0005] In addition, there is also a class of methods in the prior art that do not construct a circuit model but directly use the impulse response or frequency response to convolve with the input port signal to obtain the output response. Most of these methods are based on numerical algorithms, lack a structured circuit model and port interfaces, and are difficult to perform topological combination with other modules of the system, restricting their practicality and reuse ability.
[0006] Furthermore, the existing solutions also have limitations in terms of platform adaptation ability. Most rely on specific simulation engines or interface standards and are difficult to be flexibly embedded into heterogeneous simulation platforms such as SPICE, Simulink, PSCAD, and RTDS, reducing the engineering portability and integration efficiency.
[0007] Therefore, the existing circuit modeling and simulation methods still have obvious deficiencies in aspects such as ensuring response causality, generating a structural model, system combination ability, and platform adaptability, and there is an urgent need to propose a modeling and simulation solution with higher accuracy, stronger integration, and wider adaptation ability. Summary of the Invention
[0008] The present invention proposes a circuit modeling and combined simulation method based on response correction, aiming to solve the problems existing in the prior modeling techniques, such as the lack of response causality, non-combinable structure, insufficient modeling accuracy, and poor platform adaptability. This method performs causality correction processing on the frequency response and constructs an equivalent circuit model with a clear structure, realizing module alternative modeling and system combined simulation under multiple simulation platforms, and is applicable to high-precision time-domain analysis in complex scenarios such as electronic systems, power electronic systems, and power systems.
[0009] The method of the present invention includes the following core steps: First, divide the circuit to be simulated into a first part and a second part, where the first part is a linear and time-invariant sub-circuit; Subsequently, obtain the frequency response of the first part at a set of discrete frequency points; On this basis, perform causal correction processing on the frequency response data, such as through Hilbert transform, mirror symmetry superposition, amplitude weighting correction, etc., to construct a complete complex frequency spectrum that satisfies the physical causal characteristics of the system; Furthermore, convert the corrected frequency spectrum data into the system time-domain response function through inverse Fourier transform; Finally, use the obtained time-domain response to construct an equivalent circuit structure in which a voltage source is in series with a resistor or a current source is in parallel with a conductance, and connect it to the second part of the circuit at the port to form a combined circuit to participate in system-level simulation.
[0010] This method is applicable to multiple high-precision modeling and simulation scenarios, including but not limited to: power system transient simulation (such as modeling the interface behavior of transmission lines, transformers, converters and power grids), electronic circuit simulation (such as high-speed signal channels, analog front-end modules), radio frequency system modeling and dynamic characteristic evaluation, and module-level modeling and system-level verification in integrated circuits.
[0011] To improve the engineering applicability of the method, the equivalent circuit model constructed by the present invention has good platform transplantation ability. This model can be encapsulated as a sub-module supported by various simulation platforms. For example, it can be described by a netlist in SPICE-like tools (HSPICE, PSpice, LTspice, etc.), implemented as a custom function module in the Simulink environment, and embedded as a user-defined model into the overall system simulation process in power system simulation platforms such as PSCAD and RTDS. The present invention does not depend on a specific platform interface or solution engine, and its modeling logic has generality and cross-platform compatibility.
[0012] Compared with a series of modeling schemes previously proposed and authorized by the applicant (such as Chinese Patent CN106326509B, Canadian Patents CA2988865 and CA3108477, and US Patent US10445448B2), the present invention introduces a causal correction step for frequency response in the modeling process, which can effectively eliminate the non-physical components caused by response truncation, thereby greatly improving the accuracy and modeling stability of the time-domain response. At the same time, the proposed equivalent modeling structure has better port combination ability and is suitable for integration into the system-level modeling framework.
[0013] Compared with existing numerical schemes that only generate outputs through impulse response or frequency response convolution, the present invention not only provides a response correction mechanism, but also constructs a circuit model with clear structure and accessible ports, which has topological expression ability and module reusability, and is suitable for flexible configuration and simulation integration in multi-module systems.
[0014] The present invention has the following beneficial technical effects: First, through the causality correction of the frequency response, a system time-domain response that meets physical consistency is obtained, avoiding forward interference and mirror error, and improving the modeling accuracy and numerical stability; Second, the constructed equivalent circuit model has a clear structure, controllable parameters, and can be combined and simulated with other modules, enhancing the system-level modeling ability; Third, the present invention provides a complete technical process from circuit partitioning, response acquisition, spectrum correction, structure modeling to system combined simulation, supports multi-platform adaptation, and has good engineering feasibility; Finally, the present invention proposes multiple frequency response correction methods, which are adapted to different data forms and accuracy requirements, enhancing the adaptability and practicality of the method.
[0015] In summary, in view of the deficiencies of the existing solutions in aspects such as precision control, response consistency, model integration, and platform adaptation, the present invention provides a structured, combinable, and cross-platform circuit modeling and simulation solution, which has significant technical progress and industrial application value. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained according to the provided drawings without creative efforts.
[0017] Figure 1 It is a flowchart corresponding to an implementation manner of the method of the present invention.
[0018] Figure 2 It is a schematic diagram of the circuit partitioning structure before simulation, showing the connection relationship between the first part and the second part in the circuit to be simulated.
[0019] Figure 3 It is a schematic diagram of the equivalent circuit structure formed by combining the first part, when it is equivalent to the form of a voltage source in series with a resistor, with the second part.
[0020] Figure 4 It is a schematic diagram of the equivalent circuit structure formed by combining the first part, when it is equivalent to the form of a current source in parallel with a conductance, with the second part.
[0021] Figure 5 It is a schematic diagram of the system structure of the simulation function module involved in the method of the present invention.
[0022] Figure 6 It is a schematic diagram of the structure implemented by the method of the present invention in a computer system. Detailed Implementation Manner
[0023] The following presents the detailed implementation manner of a circuit simulation method proposed by the present invention to further illustrate the technical principle of the present invention. It should be understood that the following implementation manner is only for illustration and not a limitation on the protection scope of the present invention.
[0024] As Figure 1 shown, the present invention provides a circuit simulation method, including the following steps.
[0025] Step 101: Circuit partitioning.
[0026] The circuit to be simulated refers to the complete target circuit as the simulation object, which usually contains multiple sub-modules or functional units. Its structure may be relatively complex, making it difficult to model as a whole or having low simulation efficiency. In actual engineering, this circuit can be described by means of a netlist file (such as in SPICE format), a hardware description language, a data file generated by a structural modeling platform, etc., which contains device information, network connection relationships, etc., and can be used as the input for the subsequent modeling process.
[0027] To improve the simulation efficiency and model flexibility, the present invention partitions the circuit to be simulated into two parts, respectively called the first part and the second part. Among them, the first part is the sub-circuit to be modeled by substitution, and its behavior will be described by an algorithm model that conforms to a fixed response; the second part is the other circuit that retains the original structure and directly participates in the system simulation.
[0028] After the partitioning is completed, one or more logical ports will be formed between the first part and the second part to connect the physical quantities of the model interface and the actual circuit. This port is essentially the voltage and current interaction interface determined for facilitating the access of the model after the partitioning operation, rather than the original structure of the circuit to be simulated itself.
[0029] Figure 2 Illustrates the structure after the circuit partitioning, where the left side is the first part and the right side is the second part, and the two are connected to each other through connection ports.
[0030] Preferably, the first part should be selected as a linear time-invariant circuit. The input-output relationship of such a circuit satisfies linear superposition and time invariance, is suitable for describing the behavior by frequency response or time-domain response, and is easy to establish an interfaceable substitution model.
[0031] If the first part contains non-linear elements (such as the iron core of a magnetic saturation transformer) or time-varying elements (such as switching elements in a power system), it is usually not suitable for precise algorithm substitution by this method.
[0032] The present invention does not limit the circuit partitioning strategy, which can be flexibly determined according to engineering requirements. For example, in power system applications, the network-side circuit can be taken as the first part, and the circuits such as the access controller, converter, and positive and negative processing unit can be taken as the second part; in integrated circuit applications, the Internet or high-speed bus can be taken as the first part, and other functional modules can be taken as the second part to establish an overall simulation structure.
[0033] Step 102: Obtain the frequency response.
[0034] After completing the circuit partitioning, it is necessary to obtain the frequency response of the first part to provide a basis for subsequent equivalent modeling. The frequency response described in the present invention specifically refers to the frequency-domain transfer characteristics obtained by applying an excitation at the port and observing the response, specifically including: the frequency response with the port current as the input and the voltage as the output, or the frequency response with the port voltage as the input and the current as the output. This form of response is used to characterize the causal relationship between the voltage and current at both ends of the port and is the basis for constructing a modeling structure of a voltage source in series with a resistor or a current source in parallel with a conductance.
[0035] According to the different construction forms of the subsequent equivalent circuit model, the input-output definitions of the required frequency response are also different. If the modeling method of a voltage source in series with a resistor is to be adopted in step 104, the frequency response with the port current as the input and the voltage as the output should be obtained; if the modeling method of a current source in parallel with a conductance is adopted, the frequency response with the port voltage as the input and the current as the output should be obtained. Although the two form dual descriptions from the perspective of signal processing, their modeling entry variables are different, so the direction of the required frequency-domain data should be consistent with the selected modeling method.
[0036] The frequency response adopted by the present invention is usually represented by complex response values at predetermined discrete frequency points, which is convenient for storage and processing in a computer. The selection of discrete frequencies should cover the main working frequency band of the target system, and the density of frequency sampling should meet the requirements of the sampling theorem and actual modeling accuracy to avoid numerical leakage or distortion.
[0037] For a linear sub-circuit with a known structure, its frequency response can be calculated by means of symbolic analysis, AC small-signal simulation, or frequency scanning. For a black-box module with an unknown structure or whose behavior cannot be modeled, the frequency response data can also be obtained by means of frequency-domain testing or port data extraction. In some engineering applications, the response data can also be sourced from a third-party simulation platform or a measured data file.
[0038] The accuracy of the frequency response directly determines the physical reliability of the response function in the subsequent model. To ensure the accuracy of equivalent modeling, measurement errors or numerical artifacts should be avoided as much as possible when obtaining the frequency response data, and the response should be ensured to have physical consistency and sufficient frequency-domain bandwidth.
[0039] Step 103: Obtain the corrected system time-domain response.
[0040] Since the frequency response usually comes from discrete sampling with a limited bandwidth, if the inverse Fourier transform (IFFT) is directly performed on it to obtain the time-domain response, non-ideal time-domain behavior is often caused by spectrum truncation, such as oscillation or tail wave phenomena, that is, the so-called "Gibbs phenomenon". In addition, spectrum missing may also lead to the obtained time-domain response not satisfying the system causality, thus affecting the accuracy of equivalent modeling and the stability of system simulation. To solve the above problems, based on the structural characteristics of the frequency response and the principle of system causality, the present invention introduces a series of optional correction methods for constructing a more accurate and physically consistent system time-domain response.
[0041] In multiple embodiments, the time-domain response is given in the form of a discrete sequence. In a response of length N, usually, half of the indices from 1 to N / 2 are regarded as the positive time interval, the indices from N / 2 + 1 to N correspond to the negative time interval, and the index at 0 is the zero time point. In the present invention, various correction methods perform enhancement or filtering processing in the positive time direction based on the spectrum structure or time symmetry, and ensure the system causality by setting the negative time interval to zero.
[0042] The following lists various time-domain response correction methods that can be adopted by the present invention.
[0043] Correction method 1: Reconstruct the imaginary part through the real part Extract the real part data of the frequency response, calculate its corresponding imaginary part through the Hilbert transform, and combine it with the real part to construct a complex frequency response. Then perform the inverse Fourier transform to obtain the time-domain response of the system.
[0044] Correction method 2: Weighting and truncation after the inverse transform of the real part Directly perform the inverse Fourier transform on the real part of the frequency response to obtain the initial time-domain response. Multiply the positive time interval by a predetermined coefficient (such as 2), and at the same time set the negative time interval to zero, keeping the zero time unchanged; the obtained complete response is the time-domain response of the system.
[0045] Correction method 3: Symmetric point superposition processing Perform the inverse frequency-domain transform on the frequency response to obtain the initial time-domain response; in the positive time interval, add the signal value at each time point to its mirror point in the negative time interval to obtain a new positive time sequence; set the negative time interval to zero, keeping the zero time unchanged; the obtained result is used as the time-domain response of the system.
[0046] For example, denote the time-domain response sequence of length N obtained by the inverse transform as x[0] to x[N - 1]. For each i from 1 to N / 2 - 1, define the new response value y[i] as: y[i] = x[i] + x[N - i] Obtain the time-domain response of the system.
[0047] Calibration method 4: Reconstruct the real part through the imaginary part Extract the imaginary part data of the frequency response, perform the Hilbert transform to restore its corresponding real part, and combine it with the original imaginary part to form a complex frequency response. Subsequently, perform the inverse Fourier transform. Then, assign the average value of the original frequency response to the zero-time point of the time-domain response to form the final time-domain response of the system.
[0048] Calibration method 5: Weighting and truncation after inverse transform of the imaginary part Directly perform the inverse Fourier transform on the imaginary part of the frequency response to obtain the initial time-domain response. Multiply the positive time part by a predetermined coefficient (such as 2), set the negative time part to zero, and assign the average value of the frequency response to the zero-time point; the final result is used as the time-domain response of the system.
[0049] Calibration method 6: Symmetric point difference processing Perform the inverse frequency-domain transform on the frequency response to obtain the time-domain response data; in the positive time interval, subtract the signal value at the symmetric point in its negative time interval from the signal value at each moment to obtain a new positive time series; set the negative time interval to zero and keep the zero-time point unchanged; finally, form the time-domain response of the system.
[0050] For example, denote the time-domain response sequence of length N obtained by the inverse transform as x[0] to x[N-1]. For each i from 1 to N / 2 - 1, define the new response value y[i] as: y[i] = x[i] - x[N - i] Obtain the time-domain response of the system.
[0051] Calibration method 7: Reconstruct the phase through the logarithmic magnitude Extract the logarithmic magnitude data in the frequency response, perform the Hilbert transform to estimate its phase response. Combine the logarithmic magnitude and the phase to form a complex frequency response, and perform the inverse Fourier transform to obtain the time-domain response of the system.
[0052] Calibration method 8: Reconstruct the logarithmic magnitude through the phase Extract the phase information in the frequency response, perform the Hilbert transform to restore the corresponding logarithmic magnitude data, and then convert it to a linear magnitude through exponential operation. Combine the magnitude with the original phase to form a complex frequency response; perform the inverse transform on this frequency response to obtain the time-domain response, and assign the average value of the frequency response to the zero-time point, and finally construct the time-domain response of the system.
[0053] In practical implementation, calibration methods 1, 2, and 3 are substantially equivalent. This is because for an ideal causal system, the real and imaginary parts of its frequency response form a pair of Hilbert transform pairs, corresponding to even-symmetric terms and odd-symmetric terms in the time domain respectively. Since the response of a causal system is zero in the negative time interval, it means that the even-symmetric and odd-symmetric parts completely coincide in the positive time interval. Therefore, only the positive time part needs to be retained and multiplied by a predetermined coefficient (such as 2) to equivalently reconstruct the original causal response.
[0054] Similarly, calibration methods 4, 5, and 6 also form a set of dual methods, constructing the causal time-domain structure from the perspective of the imaginary part or odd symmetry respectively.
[0055] Calibration methods 7 and 8 rely on the Hilbert transform relationship between the logarithmic magnitude and phase of the frequency response, and are preferably applicable to scenarios where the system frequency response satisfies the minimum-phase condition. In a minimum-phase system, there is a strict mathematical mapping relationship between the magnitude and phase of the complex frequency response. Therefore, one part can be accurately derived from the other through the Hilbert transform; if the system does not satisfy the minimum-phase condition, this method may introduce magnitude or phase deviations, and it is recommended to adopt it according to the actual system properties as appropriate.
[0056] The above calibration methods can be flexibly selected according to the source of the frequency response, data form, accuracy requirements, and system structure characteristics. The present invention does not limit the specific use of a certain calibration method. Any method that can construct the time-domain response of a system with physical causality characteristics belongs to the optional implementation modes of the present invention.
[0057] In addition, it should be further pointed out that in some calibration methods, there may be differences in the sign convention of the Hilbert transform in actual engineering implementation. For example, in some frequency sampling structures or filter implementation methods, the sign direction of the transformation result may be opposite to the theoretical expression. Therefore, after restoring the complex frequency spectrum, it may be necessary to multiply the transformation result by negative one for correction. To adapt to different computing platforms or algorithm structures, the present invention allows a positive-negative correction coefficient to be added after the Hilbert transform result, and its adjustment does not affect the modeling principle.
[0058] Similarly, in the weighting and truncation method, if the data being processed is the imaginary part, phase, or other odd-function components, to maintain the consistency of the causal structure, the predetermined weighting coefficient can be set to a negative value (such as negative two) in some implementations. The flexible adjustment of the above coefficient signs belongs to the equivalent technical means of the method of the present invention and should also be included in the protection scope of the present invention.
[0059] It should be noted that the Hilbert transform mentioned in the present invention is an important signal processing tool and plays a key role in the causal reconstruction process of the system frequency response. Mathematically, the Hilbert transform H[f(t)] of the function f(t) is defined as: H\left [ {f\left ( {t} \right )} \right ]=\frac {1} {\pi}\int ^{\infty}_{-\infty} {\frac {f\left ( {\tau} \right )} {t-\tau}}d\tau where the integral sign represents the Cauchy principal value integral. In the frequency domain, the Hilbert transform is equivalent to applying a phase shift of ±90 degrees (π / 2 radians) to the frequency components: multiplying the positive frequency components by -j and the negative frequency components by +j, thereby generating the orthogonal component of the original signal.
[0060] In the discrete implementation, the Hilbert transform is usually completed through the following steps: first, perform a Fourier transform on the real signal to obtain the frequency domain representation; then, implement the phase shift by multiplying by ±j according to the frequency sign respectively; finally, perform an inverse Fourier transform to obtain the result of the Hilbert transform in the time domain.
[0061] For a real signal f(t) and its Hilbert transform H[f(t)], the two can jointly form a complex analytic signal, whose frequency response satisfies the Kramers–Kronig relation, which is one of the necessary and sufficient conditions for the response of a linear system to satisfy causality. Based on this mathematical basis, the present invention reconstructs the complete frequency response structure through the Hilbert transform of the real part or the imaginary part in multiple calibration methods, ensuring that the generated system time domain response has physical realizability.
[0062] For the detailed mathematical properties and engineering applications of the Hilbert transform, reference can be made to the literature "Discrete-Time Signal Processing" (written by A. V. Oppenheim and R. W. Schafer) and "Applications of Hilbert Transforms in Signal Processing" (written by S. L. Hahn).
[0063] It should be noted that the value of the system time domain response at zero time is always equal to the average value of the original frequency response in the frequency domain, that is, the DC component of the spectrum over the entire sampling bandwidth. Since all calibration methods adopted in the present invention are based on the phase or symmetry adjustment of the spectrum, do not involve the overall amplitude shift of the frequency response, and do not change the DC component of the spectrum, they will not affect the value of the time domain response at zero time. In other words, regardless of the calibration method adopted, the value of the obtained time domain response at zero time is always equal to the result before calibration and can be stably used to determine the resistance or conductance parameters in the equivalent circuit modeling. This characteristic also provides good parameter consistency and model repeatability for the present invention.
[0064] Step 104: Construct an equivalent circuit model.
[0065] After obtaining the corrected system time-domain response, an equivalent circuit model can be constructed based on this response to replace the first part of the circuit, so as to be combined with the second part of the circuit to form a complete combined circuit and participate in the overall simulation. As Figure 3 and Figure 4 shown, the present invention provides two specific forms of equivalent circuit models, which are respectively the structure of a voltage source in series with a resistor ( Figure 3 ) and a current source in parallel with a conductance ( Figure 4 ). During the simulation process, the values of the voltage source or current source in these equivalent circuit models usually need to be updated in real time at each simulation time step, while the parameters of the passive components in the model (such as resistors, conductances) usually remain unchanged throughout the simulation process.
[0066] According to different simulation requirements, the equivalent circuit model can adopt one of the following two specific forms. These specific forms are only one possible embodiment of the present invention and do not limit the protection scope of the present invention.
[0067] In the first possible embodiment, as Figure 3 shown, the first part is equivalent to the equivalent circuit 300, which is composed of a voltage source 310 in series with a resistor 320. Specifically, let the current simulation time step be n, the corrected system time-domain response sequence be h[k] (where k = 0, 1, 2,...), and the port current historical data be i[k]. Then the voltage value v[n] of the voltage source 310 can be calculated as follows: v[n] = v_oc[n] + Σ(i[k] × h[n - k]), where v_oc[n] is the voltage value of the first part of the circuit under the condition of open circuit at the port, and the summation term represents the convolution between the port current historical data and the system time-domain response. The value R of the resistor 320 depends on the value of the system time-domain response at time zero, that is: R = h[0]. This resistor is used to keep the DC characteristics of the equivalent model consistent with the actual circuit.
[0068] In the second possible embodiment, as Figure 4 shown, the first part is equivalent to the equivalent circuit 400, which is composed of a current source 410 in parallel with a conductance 420. Specifically, let the current simulation time step be n, and the corrected system time-domain response sequence is still h[k] (where k = 0, 1, 2,...), and the port voltage historical data be v[k]. Then the current value i[n] of the current source 410 can be calculated as follows: i[n] = i_sc[n] + Σ(v[k] × h[n - k]), Among them, i_sc[n] is the current value of the first part of the circuit under the condition of port short circuit, and the summation term represents the convolution between the port voltage historical data and the system time-domain response. The value G of the conductance 420 depends on the value of the system time-domain response at time zero, that is: G = h[0]. This conductance is used to keep the DC characteristics of the model consistent with the actual circuit.
[0069] For the first part of the circuit with multiple ports, the corresponding equivalent circuit model should adopt multiple sets of voltage sources or current sources, and be connected in parallel with multiple sets of ports. Correspondingly, the port voltage or current should be represented as a vector, and the system time-domain response should be represented as a matrix, where the element in the i-th row and j-th column represents the influence of the j-th port signal on the i-th port signal. During the simulation process, the convolution calculation should be extended to a matrix-vector product to maintain the consistency of the transmission relationship between ports.
[0070] It should be noted that in actual simulation, due to the possible differences in the reference directions of the port voltage and port current in the circuit definition, and the possible differences in the direction conventions of port variables in different simulation platforms or netlist systems, therefore, the calculation formulas of the constructed voltage sources or current sources may need to introduce sign adjustments in specific implementations. For example, when the reference direction of the port current is opposite to the direction in the modeling formula, the voltage value of the voltage source can be multiplied by -1 as a whole to keep the power relationship consistent; similarly, if the direction of the current source is inconsistent with the equivalent convolution relationship, it can also be matched through sign transformation. Such sign processing does not affect the basic modeling method and its technical essence of the present invention, and belongs to the adjustments that can be adapted by users according to the simulation platform definition in actual engineering implementation.
[0071] In actual simulation, it should be particularly noted that since the historical data of port variables are usually zero in the negative time part, there is generally no problem that the convolution cannot be calculated due to insufficient historical data. At the initial time step of the simulation, the port variables can be regarded as zero or stable initial values, so no additional data filling measures are required.
[0072] In addition, in some actual simulation scenarios, especially when using a variable time step simulation strategy, the simulation time step may be inconsistent with the sampling time step of the system time-domain response data obtained after calibration. To ensure the accuracy of the convolution calculation and the accuracy of the model, appropriate resampling processing (such as interpolation or decimation) can be performed on the calibrated time-domain response sequence to make its sampling time step consistent with the simulation time step. Through such resampling operations, the problem of mismatch between the response sequence and the simulation time step caused by the time step difference can be effectively avoided, thus ensuring the stability and consistency of modeling and simulation.
[0073] It should be further noted that after constructing the equivalent circuit model, some simple topological transformations may be performed on the circuit model according to the requirements of the actual simulation tool or application scenario. For example, the model of a voltage source in series with a resistor is converted into a model of a current source in parallel with a conductance, or vice versa. Such topological structure transformations belong to the basic equivalent transformations in circuit theory and essentially do not change the modeling method proposed by the present invention, nor do they exceed the protection scope of the present invention.
[0074] Step 105: Combine to form a complete circuit model.
[0075] After constructing the equivalent circuit model for replacing the first part of the circuit, it is necessary to connect this model with the second part of the circuit to form a complete combined circuit for system-level analysis. The core objective of this combination operation is to ensure the voltage and current continuity at the connection interface between the first part and the second part, that is, to achieve an integrated connection with equivalent behavior at the physical level.
[0076] Specifically, as Figure 3 and Figure 4 shown, the equivalent model of the first part is connected to the second part of the circuit through ports. The combination should ensure that the node voltages at the port positions are consistent and at the same time meet the current conservation condition required by Kirchhoff's current law, so as to avoid electrical discontinuity or energy non-conservation phenomena that do not conform to physical laws during the simulation process. The above connection can be implemented in various ways, and the specific way can be flexibly determined according to the simulation platform used and the model construction mechanism.
[0077] In some simulation environments, the combination process can be completed manually by the user. For example, by modifying the netlist file, directly splicing and connecting the nodes in the equivalent model with the corresponding nodes of the second part; or through a graphical interface, docking the modular circuit components on the modeling platform. However, in other simulation tools, the combination process can also be automatically completed by the simulation software during operation. For example, when the equivalent circuit model is encapsulated in the form of a module function or an interface module, the simulation system can automatically incorporate it into the system equations of the overall circuit according to the port definition during the solver initialization phase. Common methods include admittance matrix merging, state space splicing, algebraic constraint addition and other technical means. Therefore, the present invention does not limit the implementation manner of the combination operation. Any process that can achieve the coupling of the equivalent circuit and the original circuit at the port level and is used for system simulation belongs to the content covered by the protection scope of the present invention.
[0078] When applied to a multi-port system, the source elements (such as voltage sources or current sources) included in the equivalent model will form a vector group, corresponding to the independent variables of each port respectively; correspondingly, the time-domain response of the system will be characterized in matrix form to represent the coupling characteristics between ports. The combination process still follows the principle of one-to-one port connection and continuous variable transfer in this case, and the formed combined circuit can be used to describe the multi-node interaction behavior in more complex power systems, electromagnetic systems or communication subsystems.
[0079] Step 106: Perform system simulation and obtain simulation results.
[0080] After the combined circuit is constructed, a circuit simulation tool can be used to perform time-domain simulation on the combined overall system. During the simulation process, the constructed equivalent circuit model will be dynamically updated according to the current input conditions at each simulation time step to accurately reflect the time-domain behavior of the first part of the circuit.
[0081] Specifically, at each simulation time step, the values of the voltage sources or current sources in the equivalent circuit model will be updated according to the convolution result between the historical data of the port variables (voltage or current) and the corrected time-domain response of the system. This update process ensures that the equivalent behavior of the first part is always in consistent response with the external system throughout the simulation period.
[0082] The updated combined circuit will be handed over to a time-domain numerical solver for overall circuit simulation analysis. The time-domain numerical solution techniques adopted include but are not limited to discrete-time approximation methods, numerical integration methods, matrix iteration methods, state equation solution methods, nodal analysis methods, mesh analysis methods, or any combination of the above methods. These methods can be flexibly selected and combined according to the specific simulation platform, solver structure and circuit scale to achieve efficient and accurate solution of the system dynamic behavior.
[0083] Through the above solution process, the main electrical response results of the combined circuit in the target time interval can be obtained, including port voltage, current waveforms, node voltage distributions, device current changes, and the overall dynamic characteristics of the system, etc. These simulation outputs can not only be used for circuit performance verification and behavior evaluation, but also provide basic data support for system-level design optimization, stability analysis or protection strategy evaluation.
[0084] When adopting a fixed-step simulation strategy, the update period of the equivalent model strictly corresponds to the system time axis, and the constructed response can directly participate in the convolution calculation. However, in practical engineering, especially when simulating large-scale circuit systems, fast-changing processes, or multi-time-scale coupled systems, a variable-step strategy is usually adopted to improve efficiency. In this case, the present invention provides a corresponding supporting processing method, that is, resampling the time-domain response data to make its sampling timing match the simulation time step, so as to avoid accuracy loss or response drift caused by data alignment errors. The resampling method can be implemented by using common numerical techniques such as linear interpolation, polynomial fitting, or local smoothing filtering, without affecting the physical meaning of the original response structure.
[0085] The equivalent model constructed by the method of the present invention has good port connectivity and system combinability, and can be implemented in engineering on various simulation platforms. It is applicable to mainstream environments including SPICE, PSCAD, RTDS, Simulink, etc., and can be extended to self-developed simulation frameworks, edge deployment platforms, and cloud simulation systems.
[0086] The method described in the present invention can be implemented in the form of a computer program or software module. These computer programs can be stored on a non-temporary computer-readable storage medium, where the non-temporary computer-readable storage medium includes but is not limited to magnetic storage devices (such as hard disks), optical storage media (such as CD-ROMs, DVDs), flash memory devices (such as solid-state drives, USB flash drives), and other storage technologies that may be developed in the future. The computer system executing the program generally includes but is not limited to a processor (CPU), a memory (RAM), a permanent memory (ROM or hard disk), an input / output interface, and peripheral devices connected thereto (such as a keyboard, a mouse, a display, a communication interface, etc.). This computer system can run independently or be networked to obtain higher computing power. It should be noted that the protection scope of the present invention covers all computer programs, software modules, and computer hardware environments capable of implementing the method, and is not limited to any specific hardware architecture or operating system environment.
[0087] Please refer to Figure 5 , which is a schematic structural diagram of the simulation function module system 500 of the method of the present invention. This module system includes a circuit partitioning module 501, a frequency response acquisition module 502, a system time-domain response correction module 503, an equivalent circuit modeling module 504, and a combined simulation module 505. The modules are sequentially connected through a data stream. Module 501 is used to partition the structure of the circuit to be simulated, and its output result is used by module 502 to obtain the frequency response, and then enters module 503, module 504, and module 505 in sequence. The above modules can be sequentially executed by a software program or can cooperate in a multi-threaded or multi-tasking manner in a system supporting parallel computing.Figure 5 The module structure shown is a possible implementation form of the present invention. The specific implementation manner can be flexibly adjusted according to the actual system architecture, and the protection scope of the present invention is not limited to this module division method.
[0088] Please refer to Figure 6 , which shows a schematic structural diagram of the implementation of the method of the present invention in a computer system 600. The computer system 600 can be a general-purpose computing device, a server, an embedded processor, an industrial control device, an edge computing platform, a cloud simulation system, etc., and has the ability to control, calculate, and execute the method of the present invention. The computer system 600 includes a central processing unit 601, a system bus 602, a memory 603, a storage medium 604, and a program module 605. The central processing unit 601 usually includes one or more processing cores, which are used to load and execute program instructions stored in the storage medium 604 and control the operation of each functional module. The system bus 602 is used to transmit data and control information between the central processing unit 601, the memory 603, the storage medium 604, and the program module 605 to realize information interconnection between modules. The memory 603 is a high-speed, readable and writable storage device required for computer operation, and usually includes a random access memory (RAM), which is used to temporarily store intermediate data, parameter status, calculation cache, etc. during the simulation process. The storage medium 604 is a non-temporary computer-readable storage device, including but not limited to hard disks, solid-state drives (SSDs), flash devices, optical discs, magnetic tapes, etc., which are used to store the computer program code and required data sets for implementing the method of the present invention for a long time. The program module 605 refers to the executable software code stored in the non-temporary computer-readable storage medium 604, which is used to implement each step in the circuit simulation method of the present invention, including but not limited to circuit division, frequency response processing, system response correction, equivalent modeling, and system simulation. The central processing unit 601 can call this program module to control and calculate the combinational circuit to realize the full-process automatic simulation.
[0089] It should be understood that Figure 6 the structure shown is only a possible implementation form of the present invention, which is used to illustrate the computer implementation environment of the method of the present invention and does not limit the protection scope of the present invention. The method of the present invention can also be implemented on other software and hardware platforms with computing and storage functions, and can also be run through cluster computing, cloud computing platforms, distributed systems, or edge node cooperation methods. The protection scope of the present invention shall be subject to the claims.
[0090] Those skilled in the art should understand that the above-provided embodiments and specific implementation methods are only used to better illustrate and understand the technical solutions of the present invention, and are not used to limit the protection scope of the present invention. In fact, without departing from the basic idea and spirit of the present invention, the methods of the present invention can have various variations and modifications, such as using different data processing methods, model construction strategies, mathematical transformation techniques, numerical solution schemes, etc. These variations and modifications are within the reasonable deduction and understanding scope of those skilled in the art, and should all be considered to fall within the protection scope determined by the appended claims of the present invention. Specifically, the protection scope of the present invention is only limited by the appended claims and their reasonable equivalent scope, and should not be limited by the specific examples or descriptions in the specification.
Claims
1. A circuit simulation method, characterized in that Including the following steps: 1) Divide the circuit to be simulated into a first part and a second part, where the first part and the second part are connected through at least one port in the original circuit; 2) Obtain the frequency response of the first part, which is used to characterize the transfer relationship between the voltage and current of the at least one port; 3) Correct the frequency response based on the principle of system causality to obtain the corrected system time-domain response; 4) Based on the corrected system time-domain response, establish an equivalent circuit model of the first part, and the equivalent circuit model is one of the following two modeling methods: - The first modeling method: The equivalent circuit model is composed of a voltage source in series with a resistor. Among them, the voltage value of the voltage source is the convolution result of the port current and the corrected system time-domain response, plus the port open-circuit voltage; the resistance value of the resistor is determined by the value of the time-domain response at zero time; - The second modeling method: The equivalent circuit model is composed of a current source in parallel with a conductance. Among them, the current value of the current source is the convolution result of the port voltage and the corrected system time-domain response, plus the port short-circuit current; the conductance value of the conductance is determined by the value of the time-domain response at zero time; 5) Combine the equivalent circuit model with the second part to form a combined circuit, and connect the port of the equivalent circuit model to the corresponding port of the second part to meet the continuity conditions of voltage and current; 6) Simulate the combined circuit.
2. The circuit simulation method according to claim 1, wherein The corrected system time-domain response is obtained through the following steps: Extract the real part of the frequency response; Perform a Hilbert transform on the real part to reconstruct its imaginary part; Combine the real part and the imaginary part into a complex frequency response; Transform the complex frequency response from the frequency domain to the time domain to obtain the system time-domain response.
3. The circuit simulation method according to claim 1, wherein The method for obtaining the corrected system time-domain response includes: Transform the real part of the frequency response from the frequency domain to the time domain to obtain an initial time-domain response; Multiply its positive time interval by a predetermined coefficient; Set the negative time interval to zero, and keep the value at zero time unchanged; Use the processed entire response as the system time-domain response.
4. The circuit simulation method according to claim 1, characterized in that The corrected system time-domain response is obtained through the following steps: Perform an inverse Fourier transform on the frequency response to obtain time-domain response data; In the positive time interval, add the signal value at each moment to the signal value at the corresponding symmetric position in the negative time interval to obtain a new positive time series; Set the negative time interval to zero, and keep the value at zero time unchanged; Use the processed entire response as the system time-domain response.
5. The circuit simulation method according to claim 1, characterized in that The corrected system time-domain response is obtained through the following steps: Extract the imaginary part of the frequency response; Perform a Hilbert transform on the imaginary part to reconstruct its real part; Combine the imaginary part and the real part into a complex frequency response; Transform the complex frequency response from the frequency domain to the time domain; Calculate the average value of the original frequency response and assign this average value to the value at zero time of the time-domain response; Use the finally processed response as the system time-domain response.
6. The circuit simulation method according to claim 1, wherein The corrected system time-domain response is obtained through the following steps: Transform the imaginary part of the frequency response from the frequency domain to the time domain to obtain an initial time-domain response; Multiply its positive time interval by a predetermined coefficient; Set the negative time interval to zero; Calculate the average value of the original frequency response and assign this average value to the value at the zero moment of the time-domain response; Take the finally processed response as the time-domain response of the system.
7. The circuit simulation method according to claim 1, wherein The corrected time-domain response of the system is obtained through the following steps: Perform an inverse frequency-domain transform on the frequency response to obtain time-domain response data; In the positive time interval, subtract the signal value at each moment from the signal value at the corresponding symmetric position in the negative time interval to obtain a new positive time series; Set the negative time interval to zero and keep the zero moment unchanged; Take the processed entire response as the time-domain response of the system.
8. The circuit simulation method according to claim 1, wherein The corrected time-domain response of the system is obtained through the following steps: Extract the logarithmic magnitude of the frequency response; Perform a Hilbert transform on the logarithmic magnitude to reconstruct the phase; Combine the logarithmic magnitude and the phase into a complex frequency response; Transform the complex frequency response from the frequency domain to the time domain to obtain the time-domain response of the system.
9. The circuit simulation method according to claim 1, wherein The corrected time-domain response of the system is obtained through the following steps: Extract the phase of the frequency response; Perform a Hilbert transform on the phase to reconstruct the corresponding logarithmic magnitude; Transform the logarithmic magnitude into a linear magnitude through exponentiation; Combine the linear magnitude and the original phase into a complex frequency response; Transform the complex frequency response from the frequency domain to the time domain; Calculate the average value of the original frequency response and assign this average value to the value at the zero moment of the time-domain response; Take the finally processed response as the time-domain response of the system.
10. The circuit simulation method according to claim 1, wherein The simulation of the combined circuit includes the following steps: At each simulation time step, update the value of the voltage source or current source in the equivalent circuit model according to the convolution result of the historical data of the port variables and the time-domain response of the system; Process the combined circuit using time-domain numerical solution techniques, which include but are not limited to discrete-time approximation methods, numerical integration methods, matrix iteration methods, state equation solutions, nodal analysis methods, mesh analysis methods, or combinations thereof; Obtain the port voltage, current, or other electrical response characteristics of the combined circuit within the target time interval.
11. A non-transitory computer-readable storage medium, on which a computer program is stored, the computer program being configured to be executed on a processor so that the computer implements the circuit simulation method according to any one of claims 1 to 10.
12. A circuit simulation device, including a processor and a memory, wherein a computer program that can run on the processor is stored in the memory, and the computer program is configured to cause the circuit simulation device to execute the circuit simulation method according to any one of claims 1 to 10 when executed.
Citation Information
Patent Citations
A circuit simulation method and apparatus
CN106326509B
Method and system for circuit simulation
US10445448B2
