Hierarchical Structural Analysis Method for Complex Equation-Oriented Models
Abstract
:1. Introduction
- Rather than performing the structural analysis based on the flattened equation model, the proposed method analyzes a hierarchical EoM based on a dummy model constructed by parts of each component.
- The hierarchical analysis can be performed from the bottom up, layer by layer in the hierarchical model structure. This reduces the scale of equations in each step and enables the structural analysis of extremely complex EoMs.
- The proposed method is more effective for hierarchical EoMs in practical engineering. It can be adaptively applied to NLAE models and DAE models.
2. Preliminary
2.1. Abstraction of Hierarchical Equation-Oriented Models
- is a finite set of variables that represents the states;
- is a finite set of components, also named submodels, that represent subsystems at a specific abstraction level;
- is a finite set of equations that represent the relation between the variables in and the variables in each component . Note that the variable in may appear in the equations in .
2.2. Concepts in Graph-Represented Structural Analysis
3. Hierarchical Structural Analysis
4. Hierarchical Structural Analysis of NLAE and DAE Models
4.1. NLAE Models
4.1.1. Decomposition of Components
Algorithm 1. Decomposition of an NLAE component. | |
Input the bipartite graph of the component. | |
Output variables and equations in the under-constrained part. | |
1: | let be a maximum matching, set ; |
2: | let be a queue of exposed variables, ; |
3: | if , return , ; |
4: | let be the set of under-constrained variables, ; |
5: | let be the corresponding directed graph of , ; |
6: | while : |
7: | let be an element in and remove it from |
8: | let be the length-2 feasible paths from , ; |
9: | for each : |
10: | if , continue; |
11: | append into |
12: | append into , ; |
13: | let be the equation set in the under-constrained part, |
14: | return , |
- This algorithm assumes that the component has no over-constrained part.
- In line 3, the notation indicates an empty set. If the bipartite graph has no exposed variables, the sets of variables and equations in the under-constrained part are empty.
- In line 5, the function directs the edges to form a directed bipartite graph , where . The directions of the edges are used to state the searching process clearer. They are optional in the practical implementation.
- In line 8, the function begins from each exposed variable and finds length-2 feasible paths in . Searching of each feasible path needs to access two nodes. The time complexity of this function is , where is the average number of edges for each node.
- Lines 6–12 find all under-constrained variables from the exposed variables. Each under-constrained variable is appended in the queue and popped from the queue only once. Therefore, the time complexity is within .
4.1.2. Construction of the Dummy Model
- In line 3, the function constructs a bipartite graph for the component .
- In line 4, the function is an implementation of Algorithm 1. It decomposes a component and returns the variable set and the equation set in the under-constrained part.
- If the component set is empty, the dummy model is equivalent to the flattened model.
Algorithm 2. Construction of the dummy model . | |
Input a model ; output the dummy model . | |
1: | Let , ; |
2: | for each , do |
3: | |
4: | ; |
5: | let ; |
6: | let ; |
7: | let be the dummy model of , ; |
4.1.3. Hierarchical Structural Analysis Case of NLAE Models
4.2. DAE Models
4.2.1. Decomposition of Components
- In line 1, the function augments the bipartite graph and finds a maximum matching in the augmented bipartite graph . The SSMatching algorithm needs at most operations to find a maximum matching for a DAE system.
- The difference between Algorithm 3 and Algorithm 1 is that decomposing a DAE model is performed on the augmented bipartite graph rather than the bipartite graph of the original equation system.
Algorithm 3. Decomposition of a DAE component. | |
Input a bipartite graph . | |
Output the variables and equations in the under-constrained part. | |
1: | let be the bipartite graph of the augmented DAEs; let be a maximum matching, . |
2: | let be a queue of exposed variables, ; |
3: | if is empty, return , ; |
4: | set ; |
5: | let be the set of under-constrained variables, ; |
6: | while : |
7: | let be an element in and remove from ; |
8: | let be the length-2 feasible paths from , ; |
9: | for each : |
10: | if , continue; |
11: | append into |
12: | append into , ; |
13: | let be the equation set in the under-constrained part, |
14: | return , |
4.2.2. Construction of the Dummy Model
Algorithm 4. Construction of dummy model | |
Input a model ; output the dummy model . | |
1: | Let , ; |
2: | for each , do |
3: | |
4: | ; |
5: | let ; |
6: | let ; |
7: | let be the dummy model of , set ; |
4.2.3. Hierarchical Structural Analysis Case of the DAE Models
5. Complexity Analysis and Discussion
6. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Fitzgerald, J.; Gamble, C.; Larsen, P.G.; Pierce, K.; Woodcock, J. Cyber-physical Systems Design: Formal Foundations, Methods and Integrated Tool Chains. In Proceedings of the Third FME Workshop on Formal Methods in Software Engineering, Florence, Italy, 18 May 2015; IEEE Press: Piscataway, NJ, USA, 2015; pp. 40–46. [Google Scholar]
- Wang, C.; Wan, L.; Xiong, T.; Xie, Y.; Wang, S. A Relational Abstraction of Structure and Behavior for Cyber-Physical System Design. IEEE Access 2021, 9, 40388–40401. [Google Scholar] [CrossRef]
- Bernardeschi, C.; Dini, P.; Domenici, A.; Palmieri, M.; Saponara, S. Formal Verification and Co-Simulation in the Design of a Synchronous Motor Control Algorithm. Energies 2020, 13, 4057. [Google Scholar] [CrossRef]
- Alonso-González, C.J.; Pulido, B. Model-Based Diagnosis by the Artificial Intelligence Community: The DX Approach. In Fault Diagnosis of Dynamic Systems: Quantitative and Qualitative Approaches; Escobet, T., Bregon, A., Pulido, B., Puig, V., Eds.; Springer International Publishing: Cham, Switzerland, 2019; pp. 97–124. ISBN 978-3-030-17728-7. [Google Scholar]
- Ceballos, R.; Abreu, R.; Varela-Vaca, Á.J.; Gasca, R.M. Model-Based Software Debugging. In Fault Diagnosis of Dynamic Systems: Quantitative and Qualitative Approaches; Escobet, T., Bregon, A., Pulido, B., Puig, V., Eds.; Springer International Publishing: Cham, Switzerland, 2019; pp. 365–387. ISBN 978-3-030-17728-7. [Google Scholar]
- Zogopoulos-Papaliakos, G.; Kyriakopoulos, K.J. An Efficient Approach for Graph-Based Fault Diagnosis in UAVs. J. Intell. Robot. Syst. 2020, 97, 553–576. [Google Scholar] [CrossRef]
- Soares, R.d.P.; Secchi, A.R. Structural Analysis for Static and Dynamic Models. Math. Comput. Model. 2012, 55, 1051–1067. [Google Scholar] [CrossRef]
- Fritzson, P.; Bunus, P. Modelica—A General Object-Oriented Language for Continuous and Discrete-Event System Modeling and Simulation. In Proceedings of the 35th Annual Simulation Symposium (SS 2002), San Deigo, CA, USA, 14–18 April 2002; pp. 365–380. [Google Scholar]
- Oh, M.; Pantelides, C.C. A Modelling and Simulation Language for Combined Lumped and Distributed Parameter Systems. Comput. Chem. Eng. 1996, 20, 611–633. [Google Scholar] [CrossRef]
- Mattsson, S.E.; Olsson, H.; Elmqvist, H. Dynamic Selection of States in Dymola. In Proceedings of the Modelica Workshop 2000 Proceedings, Lund, Sweden, 23 October 2000; pp. 61–67. [Google Scholar]
- Zhou, F.L.; Chen, L.P.; Wu, Y.Z.; Ding, J.W.; Zhao, J.J. MWorks: A Modern IDE for Modeling and Simulation of Multi- domain Physical Systems Based on Modelica. In Proceedings of the 5th International Modelica Conference, Vienna, Austria, 4–5 September 2006; Volume 1, pp. 725–732. [Google Scholar]
- Bunus, P.; Fritzson, P. Automated static analysis of equation-based components. Simul. Trans. Soc. Model. Simul. Int. 2004, 80, 321–345. [Google Scholar] [CrossRef]
- Mattsson, S.E.; Söderlind, G. Index Reduction in Differential-Algebraic Equations Using Dummy Derivatives. SIAM J. Sci. Comput. 1993, 14, 677–692. [Google Scholar] [CrossRef]
- Steward, D.V. On an Approach to Techniques for the Analysis of the Structure of Large Systems of Equations. SIAM Rev. 1962, 4, 321–342. [Google Scholar] [CrossRef]
- Sargent, R.W.H. The Decomposition of Systems of Procedures and Algebraic Equations. In Proceedings of the Numerical Analysis; Watson, G.A., Ed.; Springer: Berlin, Heidelberg, Germany, 1978; pp. 158–178. [Google Scholar]
- Duff, I.S.; Reid, J.K. An Implementation of Tarjan’s Algorithm for the Block Triangularization of a Matrix. ACM Trans. Math. Softw. 1978, 4, 137–147. [Google Scholar] [CrossRef]
- Reissig, G.; Feldmann, U. A Simple and General Method for Detecting Structural Inconsistencies in Large Electrical Networks. IEEE Trans. Circuits Syst. I-Fundam. Theor. Appl. 2003, 50, 1482–1485. [Google Scholar] [CrossRef]
- Mattsson, S.E. Simulation of Object-Oriented Continuous Time Models. Math. Comput. Simul. 1995, 39, 513–518. [Google Scholar] [CrossRef]
- Pantelides, C.C. The Consistent Initialization of Differential-Algebraic Systems. SIAM J. Sci. Stat. Comput. 1988, 9, 213–231. [Google Scholar] [CrossRef]
- Gear, C.W. Differential-Algebraic Equation Index Transformations. SIAM J. Sci. Stat. Comput. 1988, 9, 39–47. [Google Scholar] [CrossRef]
- Unger, J.; Kröner, A.; Marquardt, W. Structural Analysis of Differential-Algebraic Equation Systems—Theory and Applications. Comput. Chem. Eng. 1995, 19, 867–882. [Google Scholar] [CrossRef]
- Pryce, J.D. A Simple Structural Analysis Method for DAEs. BIT Numer. Math. 2001, 41, 364–394. [Google Scholar] [CrossRef]
- McKenzie, R.; Pryce, J.D. Structural analysis based dummy derivative selection for differential algebraic equations. BIT Numer. Math. 2017, 57, 433–462. [Google Scholar] [CrossRef] [Green Version]
- Tan, G.; Nedialkov, N.S.; Pryce, J.D. Conversion Methods for Improving Structural Analysis of Differential-Algebraic Equation Systems. BIT Numer. Math. 2017, 57, 845–865. [Google Scholar] [CrossRef] [Green Version]
- Pryce, J.D.; Nedialkov, N.S.; Tan, G.; Li, X. How AD Can Help Solve Differential-Algebraic Equations. Optim. Method Softw. 2018, 33, 729–749. [Google Scholar] [CrossRef]
- Tang, J.; Rao, Y. A New Block Structural Index Reduction Approach for Large-Scale Differential Algebraic Equations. Mathematics 2020, 8, 2057. [Google Scholar] [CrossRef]
- Zolfaghari, R.; Nedialkov, N.S. Structural Analysis of Linear Integral-Algebraic Equations. J. Comput. Appl. Math. 2019, 353, 243–252. [Google Scholar] [CrossRef]
- Pryce, J.D.; Nedialkov, N.S.; Tan, G. DAESA-A Matlab Tool for Structural Analysis of Differential-Algebraic Equations: Theory. ACM Trans. Math. Softw. 2015, 41, 1–20. [Google Scholar] [CrossRef]
- Dulmage, A.L.; Mendelsohn, N.S. Coverings of Bipartite Graphs. Can. J. Math. 1958, 10, 517–534. [Google Scholar] [CrossRef]
- Dulmage, A.L.; Mendelsohn, N.S. A Structure Theory of Bipartite Graphs of Finite Exterior Dimension. Trans. Roy. Soc. Canada 1959, III, 1–13. [Google Scholar]
- Ding, J.-W.; Chen, L.-P.; Zhou, F.-L. A Component-Based Debugging Approach for Detecting Structural Inconsistencies in Declarative Equation Based Models. J. Comput. Sci. Technol. 2006, 21, 450–458. [Google Scholar] [CrossRef]
- Hopcroft, J.E.; Karp, R.M. A N5/2 Algorithm for Maximum Matchings in Bipartite. In Proceedings of the 12th Annual Symposium on Switching and Automata Theory (Swat 1971); IEEE Computer Society: Washington, DC, USA, 1971; pp. 122–125. [Google Scholar]
- Berge, C. Two Theorems in Graph Theory. Proc. Natl. Acad. Sci. USA 1957, 43, 842–844. [Google Scholar] [CrossRef] [PubMed] [Green Version]
- Kuhn, H.W. The Hungarian Method for the Assignment Problem. Nav. Res. Logist. 2005, 52, 7–21. [Google Scholar] [CrossRef] [Green Version]
- Uno, T. Algorithms for Enumerating All Perfect, Maximum and Maximal Matchings in Bipartite Graphs. In Proceedings of the Algorithms and Computation; Leong, H.W., Imai, H., Jain, S., Eds.; Springer: Berlin/Heidelberg, Germany, 1997; pp. 92–101. [Google Scholar]
- Uno, T. A fast algorithm for enumerating bipartite perfect matchings. In Algorithms and Computation, Proceedings; Eades, P., Takaoka, T., Eds.; Springer: Berlin, Germany, 2001; Volume 2223, pp. 367–379. ISBN 978-3-540-42985-2. [Google Scholar]
- Bérczi, K.; Iwata, S.; Kato, J.; Yamaguchi, Y. Making Bipartite Graphs DM-Irreducible. SIAM J. Discrete Math. 2018, 32, 560–590. [Google Scholar] [CrossRef] [Green Version]
- Hall, M., Jr. Distinct Representatives of Subsets. Bull. Amer. Math. Soc. 1948, 54, 922–927. [Google Scholar] [CrossRef] [Green Version]
- Mendeley Data—Hierarchical Structural Analysis Models. Available online: https://doi.org/10.17632/p59388zhzh.1 (accessed on 6 October 2021).
- Kroner, A.; Marquardt, W.; Gilles, E.D. Getting around Consistent Initialization of DAE Systems? Comput. Chem. Eng. 1997, 21, 145–158. [Google Scholar] [CrossRef]
- Wang, C.; Wan, L.; Xiong, T. CoModel: A Modelica-Based Collaborative Design Web Platform for CPS Products. In Proceedings of the Advances in Mechanical Design; Springer: Singapore, 2017; pp. 317–333. [Google Scholar]
Symbol | Meaning | |
---|---|---|
1 | An equation-oriented model. | |
2 | The flattened model of . | |
3 | The dummy model of . | |
4 | A kth-level component whose index is . | |
5 | The set of variables defined in a model. It inherits the symbol marks from the model. | |
6 | The set of equations defined in a model. It inherits the symbol marks from the model. | |
7 | The set of components in a model. It inherits the symbol marks from the model. | |
8 | The bipartite graph of an equation-oriented model . | |
9 | The bipartite graph of the augmented underlying ordinary differential equations of a DAE model. | |
10 | The over-constrained part of . It inherits the symbol marks from the bipartite graph. | |
11 | The under-constrained part of . It inherits the symbol marks from the bipartite graph. | |
12 | The well-constrained part of . It inherits the symbol marks from the bipartite graph. | |
13 | The set of variables in the over-constrained part. It inherits the symbol marks from the graph. | |
14 | The set of variables in the under-constrained part. It inherits the symbol marks from the graph. | |
15 | The set of variables in the well-constrained part. It inherits the symbol marks from the graph. | |
16 | The set of equations in the over-constrained part. It inherits the symbol marks from the graph. | |
17 | The set of equations in the under-constrained part. It inherits the symbol marks from the graph. | |
18 | The set of equations in the well-constrained part. It inherits the symbol marks from the graph. | |
19 | A matching of a bipartite graph. | |
20 | A maximum matching of a bipartite graph. |
Variables in the Under-Constrained Part | Variables in the Well-Constrained Part | |
---|---|---|
Flattened model | [v18, v19, v61′, v52′, v13, v10, v11, v17, v18″, v15, v1′, v21′, v19′, v8′, v60″, v35′, v29′, v11′, v65, v64, v63, v61, v60, v10″, v6′, v11″, v18′, v55′, v9′, v10′, v4″, v63′, v7′, v64″, v33′, v52″, v23′, v53″, v54′, v20″, v13′, v9″, v55″, v59, v64′, v47′, v15′, v51″, v31′, v4′, v47, v17′, v65′, v56′, v39′, v54″, v23, v21, v20, v29, v2′, v59′, v56, v54, v55, v52, v53, v51, v58, v51′, v31, v33, v35, v37, v39, v58′, v3′, v3″, v59″, v37′, v53′, v60′, v1, v2, v3, v4, v6, v7, v8, v9, v20′, v2″, v7″, v1″] | [v62″, v12, v16, v48′, v14, v46‴, v40′, v62′, v62, v49′, v48‴, v45″, v22′, v44″, v34′, v48″, v41′, v5′’, v49″, v26′, v46′, v12′, v42″, v46″, v41″, v32′, v24′, v40′’, v57′, v43″, v44′, v50″, v49‴, v44‴, v57″, v25′, v41, v40, v43, v42, v45, v44, v46, v49, v48, v22″, v45‴, v14′, v26, v45′, v24, v28, v25″, v5′, v30′, v28‴, v38″, v57, v50, v30, v32, v34, v36, v22, v38, v38′, v32″, v27, v36″, v28″, v12″, v24″, v25, v42′, v27′, v50′, v26″, v16′, v5, v14″, v30″, v16″, v36′, v43′, v34″, v28′, v25‴] |
Dummy model | [v18, v19, v61′, v52′, v13, v10, v11, v17, v18″, v15, v1′, v21′, v19′, v8′, v15′, v35′, v29′, v11′, v65, v64, v63, v61, v60, v10′’, v6′, v11″, v18′, v55′, v9′, v10′, v4″, v63′, v7′, v64″, v33′, v52″, v23′, v53′’, v54′, v20″, v13′, v9″, v51′, v64′, v47′, v60″, v55″, v51″, v31′, v4′, v47, v39, v65′, v56′, v39′, v54′’, v23, v21, v20, v29, v2′, v59′, v56, v54, v55, v52, v53, v51, v58, v59, v31, v33, v35, v37, v17′, v58′, v3′, v3″, v59″, v37′, v53′, v60′, v1, v2, v3, v4, v6, v7, v8, v9, v20′, v2″, v7″, v1″] | [v62″, v57, v62′, v62, v57″, v57′] |
Differences between variables in each part of the models | [] | [v12, v16, v48′, v14, v46‴, v40′, v49′, v48‴, v45″, v22′, v44″, v34′, v48″, v41′, v5″, v49″, v26′, v46′, v12′, v42″, v46″, v41″, v32′, v24′, v40″, v43″, v44′, v50″, v49‴, v44‴, v25′, v41, v40, v43, v42, v45, v44, v46, v49, v48, v22″, v45‴, v14′, v26, v45′, v24, v28, v25″, v5′, v30′, v28‴, v38″, v50, v30, v32, v34, v36, v22, v38, v38′, v32″, v27, v36″, v28″, v12″, v24″, v25, v42′, v27′, v50′, v26′’, v16′, v5, v14″, v30″, v16″, v36′, v43′, v34″, v28′, v25‴] |
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Wang, C.; Wan, L.; Xiong, T.; Xie, Y.; Wang, S.; Ding, J.; Chen, L. Hierarchical Structural Analysis Method for Complex Equation-Oriented Models. Mathematics 2021, 9, 2660. https://doi.org/10.3390/math9212660
Wang C, Wan L, Xiong T, Xie Y, Wang S, Ding J, Chen L. Hierarchical Structural Analysis Method for Complex Equation-Oriented Models. Mathematics. 2021; 9(21):2660. https://doi.org/10.3390/math9212660
Chicago/Turabian StyleWang, Chao, Li Wan, Tifan Xiong, Yuanlong Xie, Shuting Wang, Jianwan Ding, and Liping Chen. 2021. "Hierarchical Structural Analysis Method for Complex Equation-Oriented Models" Mathematics 9, no. 21: 2660. https://doi.org/10.3390/math9212660
APA StyleWang, C., Wan, L., Xiong, T., Xie, Y., Wang, S., Ding, J., & Chen, L. (2021). Hierarchical Structural Analysis Method for Complex Equation-Oriented Models. Mathematics, 9(21), 2660. https://doi.org/10.3390/math9212660