A multi-rate collaborative simulation method based on time domain decoupling
By adopting a multi-rate collaborative simulation method based on time domain decoupling in multi-system collaborative simulation, the global simulation step size is dynamically adjusted, and the error control and simulation efficiency problems caused by the differences in dynamic response characteristics of different subsystems are solved, and a more efficient simulation process is achieved.
Patent Information
- Application Number
- CN202210596551.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-30
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2042-05-30
AI Technical Summary
In multi-system collaborative simulation, due to the obvious differences in the dynamic response characteristics of different subsystems, it is difficult to control errors and maintain simulation efficiency during the collaborative simulation process. Especially when real-time simulation is required, the iterative coupling method may take too much time and cannot meet the time constraints.
The multi-rate co-simulation method based on time domain decoupling is adopted, and the initial global simulation advance step size is determined through the coordinator, and the global simulation step size is dynamically adjusted according to the error estimation of each subsystem to realize time domain decoupling and multi-rate co-simulation.
The error control accuracy is improved, the global simulation step size is dynamically controlled, the number of synchronizations is reduced, the simulation efficiency is improved, and the problem of inefficient simulation under the fixed small step size method is avoided.
Smart Images

Figure CN114816677B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the application field of modeling and simulation technology, and in particular relates to a model time domain decoupling and multi-rate collaborative simulation method in multi-system collaborative simulation. Background Art
[0002] During the co-simulation process, each subsystem is integrated into the entire simulation scenario in a black box form. These subsystems exchange input and output quantities at certain synchronization points or communication points for coupling to coordinate the entire system to move forward stably and orderly. Through co-simulation, it is easy to achieve customized subsystem modeling and parallel execution of solvers, which can effectively shorten the simulation wall clock time and improve simulation efficiency. However, an important feature of complex systems or products is that there are usually components with different time scales inside them, which leads to significantly different dynamic response characteristics in terms of frequency, and objectively requires each submodule or system to adopt a step granularity that is suitable for itself. Since information can only be exchanged at the synchronization points of the co-simulation process, coupling errors and discontinuities will inevitably be introduced, and sometimes it is even difficult to ensure that the integration is advanced in an accurate or stable manner. The use of iterative coupling can alleviate this problem, but for some types of applications (such as those requiring real-time simulation), this iteration may become too time-consuming and unable to meet time constraints; compared with this, non-iterative multi-rate integration methods have greater advantages.
[0003] The basic idea of multi-rate co-simulation is to use two or more time grids: a coarse-grained time grid for slow components and a fine-grained time grid for fast components. The coupling terms (input, output) between slow and fast components are estimated by extrapolation or interpolation. However, the mainstream time grid division method currently used is equidistant and synchronous, which means that the global integration step H is an integer multiple of the local integration step h and remains unchanged throughout the simulation cycle. This method of fixed integration step has two disadvantages: on the one hand, the subsystem must extrapolate or interpolate the output according to its local integration step. Since different subsystems use different valuation methods, the error estimation is inaccurate; on the other hand, the use of a fixed global integration step is also not conducive to error control. In order to keep the coupling process stable and the simulation results accurate, a smaller time granularity must be used, which reduces the simulation efficiency. Summary of the invention
[0004] In order to solve the above technical problems, the main purpose of the present invention is to provide a multi-rate collaborative simulation method based on time domain decoupling, which can improve the error control accuracy, dynamically control the global simulation step size, and improve the simulation efficiency.
[0005] The multi-rate collaborative simulation method based on time domain decoupling provided by the present invention comprises:
[0006] S1, the coordinator determines the initial global simulation advancement step size and determines the next synchronization point accordingly;
[0007] S2, variable step-size integration is used inside each subsystem, starting from the current moment, and the simulation advances to the moment closest to the synchronization point;
[0008] S3, each subsystem transmits the internal integral sub-step sequence and output sequence completed between the previous synchronization point and the current synchronization point to the coordinator;
[0009] S4, the coordinator calculates the next global simulation advancement step and the next synchronization point according to the data generated by each subsystem within the current global step;
[0010] S5, the coordinator calculates the input of each subsystem at the next moment and transmits it to each subsystem;
[0011] S6. If the current synchronization point reaches the preset time point, the collaborative simulation ends; otherwise, jump to step S2 to continue processing the next round of collaborative simulation advancement.
[0012] Furthermore, in step S1, the coordinator sets the relative error and global error of each subsystem, and determines the initial global simulation advancement step length H according to the user setting. 0 ; The coordinator is based on the initial simulation time T 0 Calculate the next synchronization point T 1 =T 0 +H 0 and sends it to each subsystem; the coordinator sets the current clock t of each subsystem 0 =T 0 .
[0013] Furthermore, the method for obtaining the initial global simulation advancement step size includes: the coordinator retrieves the maximum integration step size h that can be adopted by each subsystem according to the error setting k,max ; Use the maximum value or half of the maximum value as the initial global simulation step size.
[0014] Further, step S2 includes:
[0015] S201: Initialize j=0,
[0016] S202: Call subsystem k to perform single-step integration:
[0017]
[0018] S203: Get the output of the current integration step of subsystem k:
[0019]
[0020] S204: Accumulate integral time
[0021] S205: let j=j+1;
[0022] S206: If t satisfies The subsystem records the current simulation clock Stop the integration advancement; otherwise, jump to S202 and continue the next single-step integration;
[0023] Further, step S3 includes:
[0024] The local integration step sequence generated by multiple integrations of subsystem k in step S2 and the corresponding output sequence The coordinator retains the last m elements of the two sequences and stores them in h k ,y k In; if If the length l is less than m, the coordinator will k ,y k The last ml elements in are moved to the front and then stored in and m is used to specify the order of the difference polynomial in the subsequent steps. The step size sequence and output sequence are used for global step size estimation and input calculation of each subsystem.
[0025] Further, step S4 includes:
[0026] S401: The coordinator traverses each subsystem in turn and calculates the error estimate ∈ k , 1≤k≤n;
[0027] S402: Traverse ∈ k , take the maximum value ∈ i ;
[0028] S403: Judgment∈ i Is it greater than 1? If it is less than 1, let H i+1 =H i ; Otherwise, re-estimate the new global step size:
[0029]
[0030] S404: Calculate the next synchronization point T i+2 =T i+1 +H i+1 ;
[0031] Among them, k I , k p is the integral gain and proportional gain, αs is the safety factor.
[0032] Furthermore, in step S401, the step of calculating the error estimate includes:
[0033] S40101: According to The first m-1 terms of the sequence, constructing an m-1 order polynomial, and calculating by extrapolation Estimated value of time
[0034] S40102: The last item in the sequence is assigned to And compute the error estimate:
[0035]
[0036] Where: ρ is the error weight specified by the user, and TOL is the error tolerance specified by the user.
[0037] Furthermore, α s ∈[0.8,0.9] is the safety factor, k I =0.3 / (m+1), k P =0.4 / (m+1).
[0038] Further, step S5 includes: for subsystem k, the coordinator performs the following operations:
[0039] S501: According to The first m terms of the sequence, constructing an m-order polynomial
[0040] S502: Traverse all subsystems l that use the output of the current subsystem as input, and use the polynomial Extrapolation calculation Estimation of time As input Passed to subsystem l.
[0041] Compared with the existing methods, the multi-rate collaborative simulation method based on time domain decoupling provided by the present invention has the following beneficial effects:
[0042] (1) The present invention provides a unified control method for extrapolating or interpolating the input and output of each subsystem participating in the collaborative simulation, which is more conducive to the estimation and control of the global error;
[0043] (2) The present invention can dynamically adjust the global simulation step size according to the error estimation, avoiding the coordination method of fixed small step size, effectively reducing the number of synchronizations and improving the simulation efficiency;
[0044] (3) The present invention is not limited by the existing commercial simulation environment and does not require the mandatory setting of equidistant and synchronous communication time grids. It can easily integrate the units derived from the commercial simulation environment as a subsystem into a larger collaborative simulation environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0046] Figure 1 Schematic diagram of a multi-rate collaborative simulation method according to an embodiment of the present invention;
[0047] Figure 2 A schematic diagram of the topology and coupling relationship between the subsystem and the coordinator in steps S1 and S5 of an embodiment of the present invention;
[0048] Figure 3 Schematic diagram of the global simulation step length and the local integration step length within each subsystem in step S2 of an embodiment of the present invention. DETAILED DESCRIPTION
[0049] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0050] In order to improve the execution efficiency of collaborative simulation, the present invention proposes a multi-rate collaborative simulation method based on time domain decoupling. The basic idea of the present invention is to control the simulation advancement time of each subsystem according to the global synchronization point, and to estimate the error of each subsystem at the synchronization point to determine the next global synchronization point time, so that the entire system can be stably advanced with a better adaptation step size, while reasonably controlling the error and avoiding the problem of too frequent global synchronization points.
[0051] The present invention provides a multi-rate collaborative simulation method based on time domain decoupling, such as Figure 1 As shown, including:
[0052] S1, the coordinator determines the initial global simulation advancement step size and determines the next synchronization point accordingly;
[0053] S2, variable step-size integration is used inside each subsystem, starting from the current moment, and the simulation advances to the moment closest to the synchronization point;
[0054] S3, each subsystem transmits the internal integral sub-step sequence and output sequence completed between the previous synchronization point and the current synchronization point to the coordinator;
[0055] S4, the coordinator calculates the next global simulation advancement step and the next synchronization point according to the data generated by each subsystem within the current global step;
[0056] S5, the coordinator calculates the input of each subsystem at the next moment and transmits it to each subsystem;
[0057] S6. If the current synchronization point reaches the preset time point, the collaborative simulation ends; otherwise, jump to step S2 to continue processing the next round of collaborative simulation advancement.
[0058] In step S1, the topological relationship between the coordinator and each subsystem adopts the master-slave mode, such as Figure 2 As shown, there is no direct connection between the subsystems. All communication and control are completed through the coordinator. Specifically:
[0059] For the n subsystem units that constitute the collaborative simulation system, the coordinator allocates n vectors u k , 1≤k≤n, corresponding to the input of each subsystem; allocate n scalar queues h k , used to record the local step size of each subsystem for multiple integrations between two synchronization points; allocate n vector queues y k , used to record the corresponding output of each subsystem after multiple integrations between two synchronization points.
[0060] In step S1, the coordinator sets the relative error and global error of each subsystem and determines the initial global simulation advancement step size H according to the user setting. 0 ; The coordinator is based on the initial simulation time T 0 Calculate the next synchronization point T 1 =T 0 +H 0 and sends it to each subsystem; the coordinator sets the current clock t of each subsystem 0 =T 0 .
[0061] Optionally, the coordinator can retrieve the maximum integration step size h that each subsystem can adopt based on the error setting. k,max ; Coordinator traverses h k,max ,1≤k≤n, determine the maximum value h max or max / 2 is used as the initial global simulation step size.
[0062] In step S1, the coordinator sets an initial value i=0.
[0063] In step S2, each subsystem uses variable step-size integration to start from the current moment Start by simulating each time point until the moment closest to the synchronization point. The integration step length of each subsystem between two synchronization points is as follows: Figure 3 As shown, specifically including:
[0064] The coordinator traverses each subsystem in turn. For subsystem k, 1≤k≤n:
[0065] S201: Initialize j=0,
[0066] S202: Call subsystem k to perform single-step integration:
[0067]
[0068] S203: Get the output of the current integration step of subsystem k:
[0069]
[0070] S204: Accumulate integral time
[0071] S205: let j=j+1;
[0072] S206: If t satisfies The subsystem records the current simulation clock Stop the integration advancement; otherwise, jump to S202 and continue the next single-step integration;
[0073] Optionally, the coordinator creates multiple subtasks, one for each subsystem, so that multiple subsystems can execute steps S201 to S206 in parallel, thereby improving the simulation advancement speed.
[0074] In step S3, each subsystem will To current sync point The internal integral sub-step sequence and output sequence completed between them are passed to the coordinator, including:
[0075] Each subsystem k generates a local integration step sequence generated by multiple integrations in step S2 and the corresponding output sequence The coordinator retains the last m elements of the two sequences and stores them in h k ,y k In; if If the length l is less than m, the coordinator will k ,y k The last ml elements in are moved to the front and then stored in and m is used to specify the order of the difference polynomial in subsequent steps and can be passed in through simulation parameters.
[0076] The step length sequence and output sequence stored in this step are used for subsequent global step length estimation and input calculation of each subsystem.
[0077] In step S4, the coordinator calculates the next global simulation advancement step and the next synchronization point according to the data generated by each subsystem in the current global step, which specifically includes:
[0078] S401: The coordinator traverses each subsystem in turn and performs the following operations for subsystem k, 1≤k≤n:
[0079] S40101: According to The first m-1 terms of the sequence, constructing an m-1 order polynomial and calculating it by interpolation or extrapolation Estimated value of time
[0080] S40102: The last item in the sequence is assigned to And compute the error estimate:
[0081]
[0082] Where: ρ is the error weight specified by the user, TOL is the error tolerance specified by the user;
[0083] S402: Traverse ∈ k ,1≤k≤n, take the maximum value∈ i ∈ i Represents the synchronization point T i and T i+1 Between, the maximum error estimate among all subsystems;
[0084] S403: Judgment∈ i Is it greater than 1? If it is less than 1, let H i+1 =H i ; Otherwise, re-estimate the new global step size:
[0085]
[0086] Among them, k I , k p is the integral gain and proportional gain, α s is the safety factor. Preferably, αs ∈[0.8,0.9], k I =0.3 / (m+1), k P =0.4 / (m+1).
[0087] S404: Calculate the next synchronization point T i+2 =T i+1 +H i+1 .
[0088] In step S5, the coordinator calculates the input of each subsystem at the next moment and transmits it to each subsystem, specifically including:
[0089] The coordinator traverses each subsystem in turn and performs the following operations for subsystem k, 1≤k≤n:
[0090] S501: According to The first m terms of the sequence, constructing an m-order polynomial
[0091] S502: Traverse all other subsystems l that use the output of the current subsystem as input, and pass the polynomial Extrapolation calculation Estimation of time As input Transfer to subsystem l; the input and output dependency coupling relationship between subsystems is as follows Figure 2 As shown;
[0092] In step S6, if the current synchronization point reaches the preset time point, the collaborative simulation ends; otherwise, let i=i+1, jump to step S2, and continue to process the next round of collaborative simulation advancement.
[0093] The present invention realizes a non-iterative collaborative simulation method by dynamically controlling the global simulation step length according to the error through the prediction / estimation method in step S4, avoiding the state rollback and repeated integration operations of the subsystem in each global integration step, greatly reducing the amount of calculation, and effectively shortening the simulation wall clock time; at the same time, this method is not limited by the equidistant and synchronous communication time grid of the existing commercial simulation environment, and has better adaptability. Therefore, the method of the present invention can reduce the system solution cost and improve the simulation efficiency.
[0094] Those skilled in the art will appreciate that the foregoing embodiments are merely intended to illustrate the technical solutions of the present invention rather than to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art will appreciate that the technical solutions described in the foregoing embodiments may be modified or some or all of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope defined by the claims of the present invention.
Claims
1. A multi-rate collaborative simulation method based on time domain decoupling, characterized in that: include: S1, the coordinator determines the initial global simulation advancement step size and determines the next synchronization point accordingly; S2, variable step-size integration is used inside each subsystem, starting from the current moment, and the simulation advances to the moment closest to the synchronization point; S3, each subsystem transmits the internal integral sub-step sequence and output sequence completed between the previous synchronization point and the current synchronization point to the coordinator; S4, the coordinator calculates the next global simulation advancement step and the next synchronization point according to the data generated by each subsystem within the current global step; S5, the coordinator calculates the input of each subsystem at the next moment and transmits it to each subsystem; S6. If the current synchronization point reaches a preset time point, the collaborative simulation ends; Otherwise, jump to step S2 to continue processing the next round of collaborative simulation advancement; Step S2 includes: S201: Initialize j=0, S202: Call subsystem k to perform single-step integration: S203: Get the output of the current integration step of subsystem k: S204: Accumulate integral time S205: let j=j+1; S206: If t satisfies The subsystem records the current simulation clock Stop the integration process; otherwise, jump to S202 and continue the next single-step integration.
2. The multi-rate collaborative simulation method according to claim 1, characterized in that: In step S1, the coordinator sets the relative error and global error of each subsystem and determines the initial global simulation advancement step size H according to the user setting. 0 ; The coordinator uses the initial simulation time T 0 Calculate the next synchronization point T 1 =T 0 +H 0 and sends it to each subsystem; the coordinator sets the current clock t of each subsystem 0 =T 0 .
3. The multi-rate collaborative simulation method according to claim 2, characterized in that: The method for obtaining the initial global simulation advancement step size includes: the coordinator retrieves the maximum integration step size h that can be adopted by each subsystem according to the error setting k,max ; Use the maximum value or half of the maximum value as the initial global simulation step size.
4. The multi-rate collaborative simulation method according to claim 1, characterized in that: Step S3 includes: The local integration step sequence generated by multiple integrations of subsystem k in step S2 and the corresponding output sequence The coordinator retains the last m elements of the two sequences and stores them in h k ,y k In; if If the length l is less than m, the coordinator will k ,y k The last ml elements in are moved to the front and then stored in and m is used to specify the order of the difference polynomial in the subsequent steps. The step size sequence and output sequence are used for global step size estimation and input calculation of each subsystem.
5. The multi-rate collaborative simulation method according to claim 4, characterized in that: Step S4 includes: S401: The coordinator traverses each subsystem in turn and calculates the error estimate ∈ k , 1≤k≤n; S402: Traverse ∈ k , take the maximum value ∈ i ; S403: Judgment∈ i Is it greater than 1? If it is less than 1, let H i+1 =H i ; Otherwise, re-estimate the new global step size: S404: Calculate the next synchronization point T i+2 =T i+1 +H i+1 ; Among them, k I , k p is the integral gain and proportional gain, α s is the safety factor.
6. The multi-rate collaborative simulation method according to claim 5, characterized in that: In step S401, the step of calculating the error estimate includes: S40101: According to The first m-1 terms of the sequence, constructing an m-1 order polynomial, and calculating by extrapolation Estimated value of time S40102: The last item in the sequence is assigned to And compute the error estimate: Where: ρ is the error weight specified by the user, and TOL is the error tolerance specified by the user.
7. The multi-rate collaborative simulation method according to claim 5, characterized in that: α s ∈[0.8,0.9] is the safety factor, k I =0.3 / (m+1), k P =0.4 / (m+1).
8. The multi-rate collaborative simulation method according to claim 1, characterized in that: Step S5 includes: for subsystem k, the coordinator performs the following operations: S501: According to The first m terms of the sequence, constructing an m-order polynomial S502: Traverse all subsystems l that use the output of the current subsystem as input, and use the polynomial Extrapolation calculation Estimation of time As input Passed to subsystem l.
Citation Information
Patent Citations
Decentralized industrial process simulation system
CN102081358A
Dynamics coupling simulation method of high-speed train system
CN102880758A