The invention relates to a method and to a simulation device for the co-simulation of two subsystems of an overall system, which are reciprocally coupled by coupling variables.
To simulate an overall system, the overall system is often divided into subsystems, which are then individually simulated—this is then referred to as distributed simulation or co-simulation. This is done, for example, when the subsystems are simulated in different simulation tools, or when parallel computing on multiple kernels is strived for, or when a real-time simulation (for example, a hardware-in-the-loop (HiL) system) is to be connected to a real automation system for a test bench. A subsystem represents a submodel of the system to be simulated, including the associated numerical solving algorithm. The simulations of the subsystems, when linked to each other, then yield the simulation of the overall system. In the simulation, a certain operating point of the overall system is simulated, or operating points of the subsystems related thereto are simulated, in every simulation step. An operating point describes the behavior of the overall system at a particular point in time here. In the distributed simulation of an overall system, so called coupling variables are exchanged between the subsystems at certain, predefined points in time, and the subsystems are solved in defined time steps, referred to as coupling time steps, independently of other subsystems. At the end of a coupling time step, data is exchanged between the subsystems to synchronize to the subsystems.
In the case of reciprocal dependencies of subsystems, for example when a first subsystem requires an output of a second subsystem as the input, whereby the second subsystem requires an output of the first subsystem as the input, not all coupling variables needed are known at the beginning of the coupling time step and must be estimated by way of extrapolation. The temporal behavior of one or more systems (subsystems) is predicted by way of the extrapolation.
The coupling of submodels of the subsystems is typically carried out in co-simulation based on signal-based, polynomial extrapolation of the coupling variables. In general, zero order methods, and on rare occasions methods of a higher order (1st or 2nd), are used for this purpose. The output signal y is calculated based on the signal-based extrapolation as a function of the input signal x, which is to say y=f(x)—this is also referred to as a single-input, single-output (SISO) process. Extrapolating relevant coupling variables introduces what is known as a coupling error, which directly (negatively) impacts the quality of the results of the (co-)simulation. Since an extrapolation is carried out over coupling time steps, the introduced error corresponds to a “local discretization error.” Discontinuities at the coupling points in time (due to incremental extrapolation) thus also negatively impact the numerical solution of the subsystems. To keep the coupling error small, sampling steps or exchange intervals must be kept small, which results in high computing times and consequently is not desirable. However, the coupling error also causes a distortion of the coupling signal and results in an intrinsic time lag of the coupling signal (virtual dead time), which negatively influences the dynamic behavior of closed-loop systems (such as a control loop). However, the exchange of the coupling variables also results in additional, “real” dead times through the use of communication systems, for example, the exchange of data via bus systems such as FlexRay or CAN. These real dead times are typically considerably higher than the virtual dead times resulting from coupling.
EP 2 442 248 A1, for example, describes a signal-based coupling method for a co-simulation with error correction and coupling time step control. This allows the extrapolation errors to be considerably reduced by way of an error compensation method. Furthermore, (virtual and real) dead times which do not significantly exceed the coupling time step can thus be compensated for.
The problem with signal-based extrapolation methods is that they fail when the extrapolation is carried out over long time intervals, which is to say over multiple coupling time steps. This case occurs with real-time simulation of the overall system since typically large dead times (multiple coupling time steps) occur in this case due to measurement (ND conversion), signal processing, data transmission via communication media and so forth. In the real-time simulation, the coupling variables must be available at fixedly predefined points in time (coupling time step) since otherwise the real-time simulation aborts with an error. A real-time simulation is needed, for example, when at least one real-time system is coupled (with another real-time system or a non-real-time system), or when tasks are coupled on a real-time system.
It is therefore the object of the present invention to improve the extrapolation of coupling variables in co-simulation, in particular in such a way that an extrapolation is also made possible over long time intervals, which is to say also over multiple coupling time steps, so that real-time co-simulation also becomes possible.
This object is achieved by a method, and an associated simulation device, in which a mathematical model of the subsystems which is valid at the current operating point of the overall system is ascertained from input variables and/or measured variables of the subsystems based on a method of data-based model identification, and the coupling variables for a subsequent coupling time step are extrapolated from this model and made available to the subsystems. Since the time behavior of the subsystems for a certain time period (operating point) is known very well due to the model, extrapolation is thus also possible over multiple coupling time steps, which enables real-time co-simulation. However, this also allows real-time systems to continue to be operated error-free, even in the absence of measured values over multiple coupling time steps, since these can be reliably determined by the model-based extrapolation. In addition, the model-based extrapolation also allows noisy signals to be processed.
The real and the virtual dead time can very easily be compensated for by calculating coupling variables that lie further ahead in the future by the dead time from the model by way of the extrapolation.
Error diagnosis is important, notably in real-time systems, to be able to bring the real-time system in a safe state, if needed. This is made possible when a coupling error is ascertained in the extrapolation, and method steps for treating the coupling error are initiated in dependence thereof.
The accuracy of the determination of the coupling variables can be improved when, in addition, methods for error compensation are used in the extrapolation.
In particular at the beginning of the simulation, it is possible that no sufficiently accurate model is yet available. This time period can be easily bridged by way of signal-based coupling to ascertain the coupling variables.
The accuracy of the extrapolation can be increased when a real-time bus system is used between a subsystem and the extrapolation unit, since the communication dead time can be accurately ascertained and consequently be compensated for more purposefully.
The present invention will be described in more detail hereafter with reference to
For explanation,
The following exemplary embodiment mentions two input, coupling and measured variables, respectively; however, the invention of course also covers any arbitrary other number of such variables.
According to the invention, a model-based approach is now chosen, in which a mathematical model M of the subsystems TS1, TS2 is used to extrapolate the coupling variables y1, y2, as shown schematically in
From the model M, y1=f1(x1(t), x2(t), y2=f2(x1(t), x2(t), t) follows for the coupling variables. When using only measured variables, y1=f1(w1(t), w2(t), t), y2=f2(w1(t), w2(t), t) follows for the coupling variables from the model M in the exemplary embodiment shown. When input and measured variables are used according to the above-described definition, y1=f1(x1(t), x2(t), w1(t), w2(t), y2=f2(x1(t), x2(t), w1(t), w2(t), t) follows for the coupling variables from the model M.
Thus, a multiple-input, multiple-output (MIMO) system is present. Model M includes an identified model of the subsystems TS1, TS2 which is valid only locally, which is to say short-term for the current operating point of the overall system. By this model-based extrapolation the extrapolation is adaptively adapted to the system behavior or the system solution. However, the model-based extrapolation also allows noisy signals (coupling variables y1, y2, input variables x1, x2, measured variables w1, w2) to be processed since the extrapolation is carried out based on a model M, and is not based on the noisy measured variables themselves, which is not possible with signal-based extrapolation.
Sufficiently known methods of data-based model identification are resorted to for determining the model M. The model is ascertained from current and past input variables x1, x2 and/or measured values w1, w2 of the subsystems TS1, TS2. Such methods include, for example, recursive least squares methods (RLS, R Extended LS), (extended) Kalman filter methods, recursive instrumental variable methods, recursive subspace identification, projection algorithms, stochastic gradient algorithms, recursive pseudo-linear regressions, recursive prediction error methods, observer-based identification methods (sliding mode, unknown input observer, and the like), Fourier analysis, and correlation analysis. Such methods are used to determine and continuously optimize the parameters of the model M based on the current operating point of the overall system. The model structure can be arbitrarily predefined for this purpose, such as a second-order linear, time-invariant system, having two inputs and outputs. The measured variables w1, w2 used are advantageously measured variables w1, w2 offered by the subsystems, wherein current and past measured variables w1, w2 may be used.
An initial model may also be ascertained or predefined in advance at the beginning of the simulation using known quantities or external knowledge. So as to ascertain the initial model parameters, it is possible, for example, to backward calculate internal starting states for the subsystems and for the estimated model by way of inverse models, or to calculate the internal model states by way of a simpler method, until the model-based method has reached steady state, or it is possible to set correct starting values for the input signals. However, in principle, any arbitrary initial model may be used. It is also conceivable to provide signal-based coupling until the estimated model is available or valid.
Since the time behavior of the subsystems TS1 and TS2 for a certain time period (operating point) is known very well due to the model M, potential dead times can also be compensated for. In this way, the behavior of the respective other subsystem TS1, TS2 can be predicted without having to wait for the dynamic response of the system.
By using a model M to determine the coupling variables y1, y2, it is possible to continue to operate (at least temporarily) a real-time system error-free even in the case of absent measured variables w1, w2 over multiple coupling time steps, since these can be reliably determined by way of the model-based extrapolation.
The co-simulation of two subsystems TS1, TS2 can then take place as shown in
Optionally, it is also possible to ascertain the coupling error, for example an extrapolation error, a dead time, absence of data, and so forth (step 4) and, based thereon, method steps may be initiated, such as aborting the simulation, switching the system to a safe state, or outputting a warning (step 8).
The model-based extrapolation allows the real and virtual dead times that occur in the closed system to be compensated for. The real dead time, caused by the communication or the signal exchange, such as via a bus system, but also by computing times, or times for measuring and processing the signals, can be compensated for by using the model M to estimate further ahead into the future. Through the use of real-time bus systems 4 (indicated in
Based on the local model M, the coupling variables y1, y2 are calculated in a fifth step, which are then made available in a sixth step to the subsystems TS1, TS2 for the co-simulation in the next simulation step, whereby the method continues again with the second step. However, the coupling variables y1, y2 can also be further processed otherwise in the subsystems TS1, TS2, for example when a subsystem TS1, TS2 is not being simulated, but is really rigged up.
It is also possible to employ methods for additional error compensation in the ascertainment of the coupling variables y1, y2, such as a method as described in EP 2 442 248 A1. This would allow the accuracy of the ascertained coupling variables y1, y2 to be increased even further.
Number | Date | Country | Kind |
---|---|---|---|
A 50260/2013 | Apr 2013 | AT | national |
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/EP2014/057194 | 4/9/2014 | WO | 00 |