# Software Tool for Acausal Physical Modelling and Simulation

^{1}

^{2}

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Background

#### 2.1. Differential-Algebraic Equation Systems

#### 2.2. Partition Generation

#### 2.3. Algebraic Loops

^{-1}), the system (7) on unknowns z

_{n+1}can be solved as an alternative.

#### 2.4. Higher Index DAEs

#### 2.5. Events

## 3. Developed Tool

^{th}or 5

^{th}order Runge-Kutta integration method, and its simulation results can be viewed graphically (plots of variables selected by the user) or its data saved into a file.

#### 3.1. Object-Oriented Modelling Features in OOMUCO

Source code 1. Connector class “Pin” |

connector PinReal v “pin voltage”; flow Real I “pin current”; end Pin; |

Source code 2. Partial model of a two-connector component |

partial model TwoPinsPin p, n; Real v, I; equationsi = p.i; v = p.v - n.v; p.i + n.i = 0; end Pin; |

Source code 3. Component Resistor, an example of inheritance |

partial model Resistor extends TwoPinsparameter Real R = 1e3 “Units Ohm”;equationsv = R * i; end Resistor; |

#### 3.2. Graphical User Interface

## 4. Examples

#### 4.1. Index-0 DAE System

_{cc}.

Source code 4. Model of electrical circuit (index-0 DAE example) |

model circuit// Declarations of model constants and parameters constant Real PI = 3.1415926;parameter Real A = 5;parameter Real Freq = 50;parameter Real C = 4.7e-6;parameter Real L = 1e-3;parameter Real R = 1e3;parameter Real I0 = 0.05;// Declarations of model variables Real vcc, vR, vL, vC(start=0), v0, v1, v2; Real i0, i1, i2, i3(start=0); equations// Equations from Kirchhoff’s laws v1 = A*sin(2*PI*Freq*TIME); v1 = vcc; vR = R*i1; vR = v1-v2; vL = L*der(i3); “Dynamic equation” vL = v2; der(vC) = i2/C; “Dynamic equation” vC = v2; v1 = v0; i1 = i0+I0; i1 = i2+i3; end circuit; |

#### 4.2. Algebraic Loop

#### 4.3. Higher Index System

_{C1}and V

_{C2}, but from Equation (37) (singular equation), it is clear that both are equivalent, and therefore, they are not independent. Thus, DAE (32−38) is an overdetermined system.

_{C1}or V

_{C2}is preserved. In fact, when OOMUCO compiles the model, V

_{C2}does not even appear in the initial incidence matrix (Figure 17) since it has been substituted by V

_{C1}in all equations. Hence, in this case, index reduction has been carried out through alias removal, and the sorted incidence matrix (Figure 18) only shows an algebraic loop.

#### 4.4. Events

Source code 5. OOMUCO’s code for bouncing ball example |

model reboundparameter Real x0 = 0 “Left wall”;parameter Real x1 = 10 “Right wall”;Real x(start=8) “Initial ball position”; Real vx(start=2) “Initial ball speed”; equations// Model dynamic equations (two state variables) der(x) = vx; der(vx) = 0; // Events when x < x0 thenreinit(x,x0); reinit(vx,-vx); elsewhen x > x1 thenreinit(x,x1); reinit(vx,-vx); end when;end rebound; |

## 5. Evaluation

- Modelling of each case applying the OOM paradigm and the built-in OOM language included in the tool. It was encouraged to use typical features such as ports, abstract or generic components, inheritance, etc.
- Partition generation, noticing the different incidence matrices and equation sets obtained in each step and how the algorithms automatically solve the computational causality assignment and the potential issues that may arise.
- Simulation of the final executable model, testing different parameter values and state variables’ initial conditions.

#### 5.1. Student Survey of the Tool

- Improvement in learning questions consider the students’ opinions as to whether the tool has helped them to learn the OOM’s theoretical concepts and to create models using OOM languages.
- Teaching support questions evaluate if the tool is useful as a complement to lecture classes.
- Usability of the tool questions allow to know, from the student’s point of view, if the tool’s GUI is clear and easy to use and if the workflow is intuitive and the information provided by the tool is easy to interpret.

#### 5.2. Student Assessment

## 6. Conclusions

## Author Contributions

## Funding

## Conflicts of Interest

## References

- Cellier, F.E. Continuous System Modeling; Springer Science & Business Media: New York, USA, 1991; pp. 1–756. [Google Scholar]
- Elmqvist, H.; Cellier, F.E.; Otter, M. Object-oriented modeling of hybrid systems,
**1993**; pp. 31–41. - Cellier, F.E. Object-oriented modeling: Means for dealing with system complexity. In Proceedings of the 15th Benelux Meeting on Systems and Control, Mierlo, The Netherlands, 6–8 March 1996; pp. 53–64. [Google Scholar]
- Fritzson, P. Principles of Object-Oriented Modeling and Simulation with Modelica 3.3: A Cyber-Physical Approach; John Wiley & Sons: Hoboken, NJ, USA, 2014. [Google Scholar]
- Cellier, F.E.; Elmqvist, H. Automated formula manipulation supports object-oriented continuous-system modeling. IEEE Control Syst. Mag.
**1993**, 13, 28–38. [Google Scholar] [Green Version] - Cellier, F.E.; Kofman, E. Continuous System Simulation; Springer Science & Business Media: New York, USA, 2006; pp. 1–644. [Google Scholar]
- The Modelica Association—Modelica Association. Available online: https://www.modelica.org/ (accessed on 3 August 2019).
- Dymola-Dassault Systèmes®. Available online: https://www.3ds.com/products-services/catia/products/dymola/ (accessed on 3 August 2019).
- Modeling and Simulation of Technical Systems ESI ITI. Available online: https://www.simulationx.com/ (accessed on 3 August 2019).
- Welcome to Open Modelica. Available online: https://openmodelica.org/ (accessed on 3 August 2019).
- MapleSim-Advanced System-Level Modeling & Simulation-Maplesoft. Available online: https://www.maplesoft.com/products/maplesim/ (accessed on 3 August 2019).
- PSE: Products-gPROMS-Home. Available online: https://www.psenterprise.com/products/gproms (accessed on 3 August 2019).
- E.A. International. EcosimPro, Modelling and Simulation Software. Available online: https://www.ecosimpro.com/products/ecosimpro/ (accessed on 3 August 2019).
- Vázquez, F.; Jiménez, J.; Garrido, J.; Belmonte, A. Introduction to Modelling and Simulation with EcosimPro; Prentice Hall: Madrid, Spain, 2010; pp. 1–260. [Google Scholar]
- Zhao, L.; Coplien, J. Understanding symmetry in object-oriented languages. J. Object Technol.
**2003**, 2, 123–134. [Google Scholar] [CrossRef] - Hamza, G.; Hammadi, M.; Barkallah, M.; Choley, J.-Y.; Riviere, A.; Louati, J.; Haddar, M. Analytical based approach for vibration analysis in modelica: Application to the bridge crane system. Appl. Cond. Monit.
**2019**, 13, 83–91. [Google Scholar] - Al Ashi, M.M.; Elaydi, H.; Abu Hadrous, I. Modelica Based Object-Oriented Modeling and PD-Computed Torque Control of a 2-DOF Robotic Arm. In Proceedings of the International Conference on Promising Electronic Technologies (ICPET), Deir El-Balah, Palestinian Authority, 3–4 October 2018; pp. 13–18. [Google Scholar]
- Meinel, D.; Rast, S.; Franke, J. A simulation framework for theoretical analysis and virtual testing of longitudinal vibrations of trains. In Proceedings of the 2nd International Conference on Mechatronics Systems and Control Engineering, New York, NY, USA, 21–23 February 2018; Volume 2018, pp. 38–44. [Google Scholar]
- Dominguez-Jimenez, J.A.; Campillo, J. Object-oriented mathematical modeling for estimating electric vehicle’s range using modelica. Commun. Comput. Inf. Sci.
**2018**, 885, 444–458. [Google Scholar] - Casella, F.; Bartolini, A.G.; Leva, A. Equation-Based Object-Oriented modelling and simulation of large-scale Smart Grids with Modelica. IFAC-PapersOnLine
**2017**, 50, 5542–5547. [Google Scholar] [CrossRef] - Tillmanns, D.; Gertig, C.; Schilling, J.; Gibelhaus, A.; Bau, U.; Lanzerath, F.; Bardow, A. Integrated design of ORC process and working fluid using PC-SAFT and Modelica. Energy Procedia
**2017**, 129, 97–104. [Google Scholar] [CrossRef] - Fu, Y.; Zuo, W.; Wetter, M.; VanGilder, J.W.; Yang, P. Equation-based object-oriented modeling and simulation of data center cooling systems. Energy Build.
**2019**, 198, 503–519. [Google Scholar] [CrossRef] [Green Version] - Carballo, J.A.; Bonilla, J.; Berenguel, M.; Palenzuela, P. Parabolic trough collector field dynamic model: Validation, energetic and exergetic analyses. Appl. Therm. Eng.
**2019**, 148, 777–786. [Google Scholar] [CrossRef] - Zhou, G.; Ye, Y.; Zuo, W.; Zhou, X.; Wu, X. Fast and efficient prediction of finned-tube heat exchanger performance using wet-dry transformation method with nominal data. Appl. Therm. Eng.
**2018**, 145, 133–146. [Google Scholar] [CrossRef] - Ali, M.; Vukovic, V.; Muhammad Ali, H.; Ahmed Sheikh, N. Performance Analysis of Solar-Assisted Desiccant Cooling System Cycles in World Climate Zones. J. Sol. Energy Eng. Trans. ASME
**2018**, 140, 041009. [Google Scholar] [CrossRef] - Dong, X.; Ma, R. Simulation of the solar cell production amorphous silicon thin-film solar cell production system. AIP Conf. Proc.
**2019**, 2122, 020051. [Google Scholar] - Müller, R.; Kiam, J.J.; Mothes, F. Multiphysical simulation of a semi-autonomous solar powered high altitude pseudo-satellite. In Proceedings of the IEEE Aerospace Conference, Big Sky, MT, USA, 3–10 March 2018; Volume 2018, pp. 1–16. [Google Scholar]
- Casella, F.; Parini, P. Optimal Control of Power Generation Systems using Realistic Object-Oriented Modelica Models. IFAC-PapersOnLine
**2017**, 50, 11100–11106. [Google Scholar] [CrossRef] - Garrido, J.; Zafra, A.; Vázquez, F. Object oriented modelling and simulation of hydropower plants with run-of-river scheme: A new simulation tool. Simul. Model. Pract. Theory
**2009**, 17, 1748–1767. [Google Scholar] [CrossRef] - Martin-Villalba, C.; Urquia, A.; Shao, G. Implementations of the Tennessee Eastman Process in Modelica. IFAC-PapersOnLine
**2018**, 51, 619–624. [Google Scholar] [CrossRef] - Carballo, J.A.; Bonilla, J.; Roca, L.; de la Calle, A.; Palenzuela, P.; Berenguel, M. Optimal operating conditions analysis of a multi-effect distillation plant. Desalin. Water Treat.
**2017**, 69, 229–235. [Google Scholar] [CrossRef] - Garrido, J.; Ruz, M.; Morilla, F.; Vázquez, F. Interactive Tool for Frequency Domain Tuning of PID Controllers. Processes
**2018**, 6, 197. [Google Scholar] [CrossRef] - Ruz, M.; Garrido, J.; Vazquez, F.; Morilla, F. Interactive Tuning Tool of Proportional-Integral Controllers for First Order Plus Time Delay Processes. Symmetry
**2018**, 10, 569. [Google Scholar] [CrossRef] - Morales, D.C.; Jimenez-Hornero, J.E.; Vazquez, F.; Morilla, F. Educational tool for optimal controller tuning using evolutionary strategies. IEEE Trans. Educ.
**2011**, 55, 48–57. [Google Scholar] [CrossRef] - Guzmán, J.L.; Hägglund, T.; Aström, K.J.; Dormido, S.; Berenguel, M.; Piguet, Y. Understanding PID design through interactive tools. IFAC Proc. Vol.
**2014**, 47, 12243–12248. [Google Scholar] [CrossRef] [Green Version] - Ruiz, Á.; Jiménez, J.E.; Sánchez, J.; Dormido, S. Design of event-based PI-P controllers using interactive tools. Control Eng. Pract.
**2014**, 32, 183–202. [Google Scholar] [CrossRef] - Prada, M.A.; Reguera, P.; Alonso, S.; Morán, A.; Fuertes, J.J.; Domínguez, M. Communication with resource-constrained devices through MQTT for control education. IFAC-PapersOnLine
**2016**, 49, 150–155. [Google Scholar] [CrossRef] - Meegahapola, L.G.; Thilakarathne, C. Dynamic Learner-Assisted Interactive Learning Tools for Power Systems Engineering Courses. IEEE Trans. Educ.
**2019**, 62, 149–156. [Google Scholar] [CrossRef] - de Prado, R.P.; García-Cárdenas, M.; García-Galán, S.; Muñoz-Expósito, J.E. Interactive tool for learning propagation in single-mode optical fibers in telecommunication engineering. Comput. Appl. Eng. Educ.
**2019**, 27, 789–813. [Google Scholar] [CrossRef] - Notaroš, B.M.; McCullough, R.; Manić, S.B.; Maciejewski, A.A. Computer-assisted learning of electromagnetics through MATLAB programming of electromagnetic fields in the creativity thread of an integrated approach to electrical engineering education. Comput. Appl. Eng. Educ.
**2019**, 27, 271–287. [Google Scholar] [CrossRef] - Huang, J.; Ong, S.K.; Nee, A.Y.-C. An approach for augmented learning of finite element analysis. Comput. Appl. Eng. Educ.
**2019**, 27, 921–933. [Google Scholar] [CrossRef] - Rangel, R.L.; Martha, L.F. LESM—An object-oriented MATLAB program for structural analysis of linear element models. Comput. Appl. Eng. Educ.
**2019**, 27, 553–571. [Google Scholar] [CrossRef] - García-Oliver, J.M.; García, A.; de la Morena, J.; Monsalve-Serrano, J. Teaching combustion thermochemistry with an interactive Matlab application. Comput. Appl. Eng. Educ.
**2019**, 27, 642–652. [Google Scholar] [CrossRef] - Gamo, J. Assessing a Virtual Laboratory in Optics as a Complement to On-Site Teaching. IEEE Trans. Educ.
**2019**, 62, 119–126. [Google Scholar] [CrossRef] - Dogmus, Z.; Erdem, E.; Patoglu, V. ReAct!: An interactive educational tool for AI planning for robotics. IEEE Trans. Educ.
**2015**, 58, 15–24. [Google Scholar] [CrossRef] - Biegler, L.T. Differential-algebraic equations (DAEs). Lect. Notes
**2000**, 1–40. [Google Scholar] - Brenan, K.E.; Campbell, S.L.; Petzold, L.R. Numerical Solution of Initial-Value Problems in Differential-Algebraic Equations; SIAM: Philadelphia, PA, USA, 1996; Volume 14. [Google Scholar]
- Belmonte, A.; Garrido, J.; Jiménez, J.E.; Vázquez, F. Recomputing causality assignments on lumped process models when adding new simplification assumptions. Symmetry
**2018**, 10, 102. [Google Scholar] [CrossRef] - Duff, I.S.; Erisman, A.M.; Reid, J.K. Direct Methods for Sparse Matrices; Oxford University Press: Oxford, UK, 2017. [Google Scholar]
- Dulmage, A.L.; Mendelsohn, N.S. Coverings of bipartite graphs. Can. J. Math.
**1958**, 10, 517–534. [Google Scholar] [CrossRef] - Duff, I.S. On algorithms for obtaining a maximum transversal. ACM Trans. Math. Softw.
**1981**, 7, 315–330. [Google Scholar] [CrossRef] - 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] - Elmqvist, H.; Otter, M. Methods for tearing systems of equations in object-oriented modeling. In Proceedings of the European Simulation and Modelling Conference, Barcelona, Spain, 1–3 June 1994; Volume 94, pp. 1–3. [Google Scholar]
- Shampine, L.F.; Reichelt, M.W.; Kierzenka, J.A. Solving index-1 DAEs in MATLAB and Simulink. SIAM Rev.
**1999**, 41, 538–552. [Google Scholar] [CrossRef] - Bujakiewicz, P.; van den Bosch, P.P.J. Determination of perturbation index of a DAE with maximum weighted matching algorithm. In Proceedings of the IEEE Symposium on Computer-Aided Control Systems Design (CACSD), Tucson, AZ, USA, 7–9 March 1994; pp. 129–136. [Google Scholar]
- Petzold, L.R. Description of DASSL: A Differential/Algebraic System Solver; Sandia National Labs: Livermore, CA, USA, 1982. [Google Scholar]
- 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] - Pantelides, C.C. The consistent initialization of differential-algebraic systems. SIAM J. Sci. Stat. Comput.
**1988**, 9, 213–231. [Google Scholar] [CrossRef] - Mattsson, S.E.; Soderlind, G. A new technique for solving high-index differential-algebraic equations using dummy derivatives. In Proceedings of the IEEE Symposium on Computer-Aided Control System Design, Napa, CA, USA, 17–19 March 1992; pp. 218–224. [Google Scholar]
- Mattsson, S.E.; Olsson, H.; Elmqvist, H. Dynamic selection of states in Dymola. In Proceedings of the Modelica Workshop, Lund, Sweden, 23–24 October 2000; pp. 61–67. [Google Scholar]
- MATLAB-MathWorks. Available online: https://www.mathworks.com/products/matlab.html (accessed on 3 August 2019).
- Elmqvist, H.; Mattsson, S.E.; Otter, M. Modelica—A language for physical system modeling, visualization and interaction. In Proceedings of the IEEE International Symposium on Computer Aided Control System Design, Kohala Coast, HI, USA, 27 August 1999; pp. 630–639. [Google Scholar]
- Dormido, R.; Vargas, H.; Duro, N.; Sánchez, J.; Dormido-Canto, S.; Farias, G.; Esquembre, F.; Dormido, S. Development of a web-based control laboratory for automation technicians: The three-tank system. IEEE Trans. Educ.
**2008**, 51, 35–44. [Google Scholar] [CrossRef] - Fragoso, S.; Ruz, M.L.; Garrido, J.; Vázquez, F.; Morilla, F. Educational software tool for decoupling control in wind turbines applied to a lab-scale system. Computer Applications in Engineering Education
**2016**, 24, 400–411. [Google Scholar] [CrossRef] [Green Version] - Moodle Map—Universidad de Córdoba. Available online: http://moodle.uco.es/moodlemap/ (accessed on 5 August 2019).

**Figure 1.**(

**a**) OOMUCO components (editor, compiler and simulator) and tool workflow; (

**b**) simulation steps.

**Figure 19.**First sorted incidence matrix (two capacitors in parallel example modelled with the OOM paradigm).

**Figure 20.**OOMUCO’s higher index problem assistant (two capacitors in parallel example modelled with the OOM paradigm).

**Figure 26.**(

**a**) Rate of passing and failing students in the current academic year and (

**b**) in the previous one.

Improvement in Learning | |

Q1 | Did the tool help you to understand and learn the OOM paradigm’s key concepts? |

Q2 | Do you think the tool has improved your skills to create mathematical models using OOM languages? |

Q3 | Did the tool make it easy for you to remember the theoretical concepts taught in lectures? |

Q4 | Rate if using the tool has motivated you in learning the OOM paradigm |

Teaching Support | |

Q5 | Did the tool help you to understand how the partition generation algorithms work? |

Q6 | Have tool examples used in lectures been helpful to improve your learning? |

Q7 | Rate the additional examples included in the tool |

Q8 | Were homework exercises using the tool useful to strengthen your ability to create and simulate models according to OOM paradigm? |

Usability and Easy Understanding of the Tool | |

Q9 | Do you think the tool is easy to understand and use? |

Q10 | Do you think the tool’s GUI is intuitive and user-friendly? |

Q11 | Are the workflow and the concepts presented in the tool clear and easy to follow? |

Categories | Strongly Agree | Agree | Neutral | Disagree | Strongly Disagree |
---|---|---|---|---|---|

Learning value (Q1–Q4) | 33% | 53% | 11% | 2% | 1% |

Teaching Support (Q5–Q8) | 23% | 41% | 27% | 6% | 3% |

Usability and easy understanding of the tool (Q9–Q11) | 10% | 35% | 35% | 15% | 4% |

© 2019 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 (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Jimenez, J.; Belmonte, A.; Garrido, J.; Ruz, M.L.; Vazquez, F.
Software Tool for Acausal Physical Modelling and Simulation. *Symmetry* **2019**, *11*, 1199.
https://doi.org/10.3390/sym11101199

**AMA Style**

Jimenez J, Belmonte A, Garrido J, Ruz ML, Vazquez F.
Software Tool for Acausal Physical Modelling and Simulation. *Symmetry*. 2019; 11(10):1199.
https://doi.org/10.3390/sym11101199

**Chicago/Turabian Style**

Jimenez, Jorge, Antonio Belmonte, Juan Garrido, Mario L. Ruz, and Francisco Vazquez.
2019. "Software Tool for Acausal Physical Modelling and Simulation" *Symmetry* 11, no. 10: 1199.
https://doi.org/10.3390/sym11101199