2.1. A General Framework for Individual Subsystem Models
General ISMs give rise to a system of implicit Differential Algebraic Equations (DAEs) for each subsystem [
47] of the form:
where
is time,
are the differential variables,
are the subsystem output algebraic variables,
is the subsystem input vector (that is, inputs whose values are equal to outputs of other subsystems in the ISM),
is the ISM external inputs vector (that is, the inputs, if any, coming from the outside environment), and
is the subsystem internal constant parameters vector. In DAEs, some of the equations could be purely algebraic, leading to more difficulties when combined with differential equations [
48]. The interconnection of subsystems is achieved by connecting subsystem outputs to the inputs of other subsystems. Precisely, the
i-th subsystem is connected to the
j-th subsystem if there is a directed connection from one of the scalar components
of the output vector
of the
i-th subsystem to a scalar component
of the input vector
of the
j-th subsystem. Without loss of generality, we can neglect self-loops (i.e., we neglect the case
) using the identity function as an intermediate auxiliary subsystem.
Appending vectors , and the same can be done  .
Therefore, combining all the subsystem equations, the result is a fully implicit system of DAEs that is generally solved with different available methods, including symbolic manipulation and numerical solvers:
On the other hand, without loss of generality, we can describe our method using the Ordinary Differential Equations ODE representation for better readability and using a suitable graphical representation. DAEs can be easily introduced without any change in the method. Moreover, if the Jacobian of
with respect to
is non-singular, all the following forms are equivalent to (2) [
47]. In particular, for each subsystem
we have:
All the algebraic variables disappear and the
are all differential ones. Sometimes ODEs can be written in the explicit form:
Such an interconnected ISM formed by all the subsystems
can be represented as shown in
Figure 1. As said above, appending vectors
allows to form a single column vector
:
where
is the
scalar component of
; the same can be conducted with outputs
:
where each element
of the connection matrix,
is
or
.
Last condition, represents a connection from the scalar output to the internal scalar input . If no self-loops are allowed, all the diagonal elements are null: this hypothesis can be accepted as it simplifies the calculations below without losing generality. Finally, we can assume that each scalar component of a subsystem output vector is connected to the one and only one scalar component of another subsystem internal input vector (multiple connections can be modelled with multiple identical scalar outputs). To this end, it helps in explaining the new approach in the next section. With this condition, each component of a subsystem output vector is connected to an input, meaning that each row and column of the matrix have one and only one non-zero entry: matrix is a permutation matrix.
As for any other method, numerical simulation of continuous ISMs systems first requires approximating each subsystem by a discrete model even if it is conducted only locally (i.e., only when the solution of each subsystem is required) and not for the whole DAEs system simultaneously. The numerical approximation of the dynamical evolution of an ISM of the form shown in
Figure 1 is calculated at a sequence of
discrete time points,
. Each step size
may be fixed or variable depending on the type of numerical method used due to the stiffness variability of the system requiring the change of
during simulation.
On the other hand, solving fully implicit DAEs is a popular method, but it requires a tremendous computational expense [
49].
The main methods used to reduce DAES computational expense [
50] are
Generally, they are carried out by means of symbolic processing. These methods essentially hide the algebraic variables from the numerical solver as much as possible, exposing only a minimal set of equations and variables: the state variables. The state is a minimal set of ISM variables. If their current values are known, and all future external ISM input values are known, then the future behaviour of the ISM is uniquely determined. Of course, the same definition of a state is also valid for each subsystem. If in the system of equations there are also pure ODEs (see (4)) in addition to the DAEs, then the vector of differential variables
appearing in each ODE naturally represents a suitable set of state variables for each ODE. On the other hand, for most DAEs, a subset of both differential and algebraic variables in Formulation (1) could still be used as a suitable state [
49].
The first procedure described above, casualization, uses symbolical manipulation to obtain the state variables and convert a DAE model like Equation (1) into an iterative numerical model. The state derivatives are calculated for all the differential algebraical variables in proper sequential order. Casualization is divided into two steps: Matching and Subsystem-Lower Triangular (BLT) ordering. The most popular and widely used method is Tarjan’s algorithm [
21], still considered one of the most efficient. On the other hand, one of the most significant drawbacks is symbolic manipulation: the computational cost moves from direct heavy numerical solving to heavy symbolic computation.
The second procedure, tearing [
22,
51,
52], is a method for solving sparse systems of equations without any particular structure (e.g., banded or block-diagonal), and it is less computationally expensive than casualization. This is achieved by ordering variables and equations to divide the system into two partitions. The first one is highly structured, can be solved efficiently, and then utilized in the solution of the whole system by subsystem elimination.
While BLT ordering guarantees numerical stability, tearing does not. This well-known drawback of tearing is challenging to address when no reliable a priori information about the system structure is available or, if known, not used. However, when dealing with structured systems where each subsystem can be solved individually by calculating outputs from inputs and parameters (implicitly or explicitly does not matter), it might be tractable using numerical algorithms that guarantee numerical stability, under the assumption that the initial guess is sufficiently close to the solution; this is a relatively old result, although not as used as it should [
53,
54].
In both cases, numerical solving applied after casualization or tearing becomes less expensive as it accounts for computational complexity.
The discussion above derives that there are many available methods to model even large systems. However, each has its own: no global and comprehensive approach has been developed after the report of R.A. Di Perna [
41]. Moreover, as said, some tools solve the system of DAEs as a whole. Other tools have a different approach to a preliminary determining of an ordering in the subsystem’s execution. However, they are mainly based on each subsystem’s nature rather than on the structure of the graph representing the ISM as a collection of subsystems interconnected with each other as described above. Therefore, the proposed method follows the paradigm of the co-simulation approach but with a new perspective, including graph theory methods for efficiently solving general ISM.
2.2. The New Approach to Individual Subsystems Models: General Aspects
As briefly inferred in the previous section, when dealing with ISMs, the structure of the problem can be directly defined by its model graph where the i-th subsystem,
, can be described by a subset of DAEs as in (7), here repeated for readability:
All the subsystems are interconnected to each other by connecting their outputs to corresponding inputs of other subsystems. A graph represents this structure where is the vertex set of the nodes, and is the edge set (directed edges). Each node () corresponds to a single subsystem. A directed edge exists if a scalar output of the subsystem is connected to a scalar input of subsystem . As said above, in this study, without loss of generality, we do not consider self-loops; that is, every subsystem is assumed not to be connected to itself, i.e., . Each subsystem is assumed to admit a DAEs representation as in Equation (7). Thus, the graph incidence matrix can be considered the incidence matrix of the system of DAEs. The subset of DAEs (7) of each subsystem can be solved using the previously described methods applied directly to the subsystem’s definition. This method allows joining different methods according to the context (e.g., causal or acausal methods, general numerical methods, etc.) to which each subsystem belongs.
This way, we describe each subsystem as representing independently of any other subsystem in the ISMs. The great advantage is that we can substitute it whenever needed with a different representation (i.e., different DAEs for that subsystem and different solution methods), making maintenance and evolution of the whole ISM easy to implement. Another advantage is that we do not need to know the content of each subsystem. It is sufficient to have a black box with known inputs and outputs: this becomes particularly helpful when we ask an external firm to model a particular component without necessarily asking for open access to its complete content. This representation belongs to the ISM framework more generally than previously conducted, as each subsystem is modelled and solved individually and independently on other models. The graph structure coordinates all these solvers to determine the whole ISM’s dynamical evolution efficiently. Therefore, one of the main novelties of our approach is that each subsystem (or a subgroup of them as shown below) could be solved separately in a proper order based on the structure of the graph, making it possible for the following procedure that simplifies ISM simulation. Precisely, each output of a subsystem (or group of them: T. Xu et al. [
55]) becomes the input of the next subsystem in the chosen ordering. Matrix
can be structured as a block matrix to better describe what just said, each block representing a node (subsystem) and corresponding connections of the subsystem to another one, then represented as the sum of a strictly block lower triangular matrix
, and a strictly block upper triangular matrix
. This way, if no self-loops are considered then it is the diagonal blocks that are null and not the individual diagonal elements of
. The same obviously occurs for both
and
:
represents all the feed-forward block connections in the considered node ordering, while
represents all feedback block connections. This approach leads to a scheme middle way between pure explicit and pure implicit ones: using only known values (at time step
) of the subsystems output variables, i.e.,
, for feed-forward edges (matrix
) and
for feedback edges (i.e., outputs not yet calculated at time step
: matrix
), the discretized version of the matrix Equation (3b) becomes:
Therefore, it is desired to partition the subsystems (i.e., the nodes of the graph representing the ISM) into sequential groups [
56], each group containing the minimum number of subsystems. Only feed forward of information exists from each group to the groups that follow (or as many as possible whenever a not empty minimum feedback arc set exists, see discussion below). With this partitioning, the equations of each group can be easily solved simultaneously. The result is used to solve the equations of the following groups in the selected ordering. A minimum number of subsystems is desired in each group because this minimizes the number of equations that must be solved simultaneously. For complex ISM, an algorithm [
57,
58] is necessary to accomplish the partitioning. No symbolic or other type of manipulation is required.
The partitioning process is only the first step toward a solution and remains to solve each partitioned group’s coupled equations. If feedbacks are not altogether cancelled, the corresponding variables are such that it is possible to execute all the subsystems of the group in the selected order if these variables had known values (e.g., from previous time steps or from measured variables in the case of mixed simulation–measurement real-time system). If a group contains non-linear subsystem, then a definitive solution is not generally possible, and iteration procedures must be used separately for each group to reduce the computational effort. These groups can be considered the proper subsystems, while their sub-subsystems become auxiliary ones (see the second example in
Section 3.2). Solving ISM without taking advantage of the structure of the equations of such interconnected systems would become highly computationally inefficient. On the other hand, the smallest possible set of variables should be chosen for each partitioned group to reduce the computational effort. The choice of a minimum number of such variables can be shown as equivalent to a common problem in the theory of directed graphs, determining a minimum feedback arc set for each group graph. The following definitions, taken from D.H. Younger [
59], will help to make this identification:
A feedback arc set is a set of arcs that leave the resultant graph circuit free if removed for a directed graph.
A feedback arc set is a minimum if no other feedback arc set for that graph consists of a smaller number of arcs.
A sequential ordering R of a graph of N nodes is a permutation of the sequence 1 … N
In general, a pure sequential evaluation of the above type (i.e., empty feedback arc set) is possible only if the graph is free of directed loops. The sorting procedure should act in two steps.
The first step is to partition the system graph nodes into groups as outlined above whenever possible. A preliminary simplification of the system graph is possible, reducing the complexity of the partitioning process: the source nodes and the arcs which leave them (external inputs ) can never be iteration variables, as they represent known quantities. Therefore, the source nodes can be considered as the first group of the partition. Similarly, external outputs (e.g., “measured” outputs) can be considered the last group (sink nodes). If possible, the partitioning procedure is applied to the subgraph, called the Reduced ISM (RISM), obtained by deleting source and sink nodes from the original graph.
The second step consists of finding a minimum feedback arc set for each group (sources and sinks not included) which determines a set of iteration variables for each group of equations. Finally, if no partitioning is possible (i.e., there is only one group coincident with the whole ISMs), the node ordering procedure outlined below is applied directly to the RISM.
In regards to nodes ordering, D.H. Younger [
59] shows that for any sequential ordering
of the nodes of the graph, the removal of those arcs
for which
must eliminate all directed loops, and if all these arcs are selected as iteration variables, then, since no directed loops remain, the RISM can be evaluated in the order determined by
. Hence, the chosen ordering determines the set of iteration variables. To find a minimum number of such variables, it is therefore desired to find a sequential ordering R which minimizes the number of arcs
for which
. This is precisely the problem of determining a minimum feedback arc set. Details can be found in D.H. Younger, 1963, but also other and more efficient algorithms can be found in the literature (e.g., Ref. [
60]), giving sometimes optimal but often suboptimal ordering. The general problem is an NP-hard problem [
61]. Many suboptimal ordering algorithms have the great advantage of fast execution even only directly proportional to
. The proposed method is analysed in detail for LTI systems in the next paragraph.
2.3. The New Approach to Individual Subsystems Models: Linear Time-Invariant Systems and State-Space Representation
The partitioning method outlined in the previous paragraph is now applied to LTI systems; Equations (3a), (3b) and (4) can be written explicitly. To distinguish vectors from matrices, we use uppercase letters for latter and lowercase letters for the former (e.g.,
instead of the
symbol used in the previous paragraph):
where matrices
,
, and
are block diagonal, each block representing each subsystem in the ISM: they can also depend on time and in this case the system is not autonomous, making the discussion only more complicated. Matrix
represents the dependence of the status vector
on the external input vector
. Moreover, the explicit dependence of internal outputs
on internal inputs
and external inputs
has been neglected to simplify the following calculations without loss of generality, but it can be easily reintroduced (for example for subsystems without ODEs but only algebraic input—output blocks:
for the i-th subsystem). Regarding external outputs, they can be chosen without loss of generality among the components of the internal output vector
.
Substituting the last two Equations (9b) and (9c), into the first one (9a) we obtain the following system of equations that can be solved by calculating
as all the matrices and external inputs
are known
where the matrix
corresponds to the state transition matrix (precisely for LTI systems, the state transition matrix is
). The system in Equation (10) is said asymptotically stable (AS) if for each
there is
so that for
and a suitable norm
we have
The system is AS if and only if the real parts of the eigenvalues
of matrix
are all negative:
. If the sequence of discrete-time points
is equally spaced (
) the discrete version of system 10 can be obtained approximating
as follows
where
. With no loss of generality, other approximations may be used to improve convergence, especially when dealing with stiff problems. Moreover, variable time steps can also be used. There are different ways of treating 10: explicitly or implicitly [
49]. Using the Euler’s scheme, in the first case, we calculate the right side at time
obtaining
This scheme is stable if the most significant absolute value
of the eigenvalues of the matrix
(the spectral radius) is less than one for AS systems when
In the second case (implicit scheme), we calculate the right side of system (10) at time
obtaining:
Setting , the one-step discrete-time transition matrix, the stability condition becomes and it is valid for any matrix having ; therefore, the scheme is unconditionally stable for AS systems. The above schemes do not directly consider the structure of the system, and different procedures are generally used to reduce the computational effort as described in the second paragraph of this paper. The scheme sketched in the previous paragraph for non-linear systems that take advantage of the sorting procedure is now considered. As said in the previous section about general non-linear ISMs, Matrix is the sum of a strictly block lower triangular matrix , and a strictly block upper triangular matrix : for all feed-forward connections in the considered node ordering and all feedback connections.
When optimal (or sub optimal) ordering is obtained,
is as sparse as possible (or close enough), and a scheme middle way between pure explicit and pure implicit ones can be outlined, this time starting from system (9). Matrix Equation (8) is repeated here specialized for system (9)
Therefore, Equation (9b) can be written at time
using
, and at time
using
. Substituting these two conditions into (16), it becomes
Finally, the discrete version of Equation (9a) (Implicit Euler’s scheme as regards the proper terms):
becomes
which is solved to obtain
with
and
.