Mathematical modeling and simulation of complex physical systems is emerging as a key technology in engineering. Modern approaches to physical system simulation allow users to specify simulation models with the help of equation-based languages. Such languages have been designed to allow automatic generation of efficient simulation code from declarative specifications. Complex simulation models are created by combining available model components from user-defined libraries. The resulted models are compiled in a simulation environment for efficient execution.
The main objective of this thesis work is to develop significantly improved declarative debugging techniques for equation-based languages. Both static and dynamic debugging methods have been considered in this context.
A typical problem which often appears in physical system modeling and simulation is when too many/few equations are specified in a systems of equations. This leads to a situation where the simulation model is inconsistent and therefore cannot be compiled and executed. The user should deal with over- and under-constrained situation by identifying the minimal set of equations or variables that should be removed/added from the equation system in order to make the remaining set of equations solvable.
In this context, this thesis proposes new methods for debugging over- and under-constrained systems of equations. We propose a methodology for detecting and repairing over- and underconstrained situations based on graph theoretical methods. Components and equations that cause the irregularities are automatically isolated, and meaningful error messages for the user are presented. A major contribution of the thesis is our approach to reduce the potentially large number of error fixing alternatives by applying filtering rules extracted from the modeling language semantics.
The thesis illustrates that it is possible to localize and repair a significant number of errors during static analysis of an object-oriented equation-based model without having to execute the simulation model. In this way certain numerical failures can be avoided later during the execution process. The thesis proves that the result of structural static analysis performed on the underlying system of equations can effectively be used to statically debug real models.
A semi-automated algorithmic debugging framework is proposed for dynamic fault localization and behavior verification of simulation models. The run-time debugger is automatically invoked when an assertion generated from a formal specification of the simulation model behavior is violated. Analysis of the execution trace decorated with data dependency graph in the form of the Block Lower Triangular Dependency Graph (BLTDG) extracted from the language compiler is the basis of the debugging algorithm proposed in the thesis. We show how program slicing and dicing performed at the intermediate code level combined with assertion checking techniques to a large extent can automate the error finding process and behavior verification for physical system simulation models. Via an interactive session, the user is able to repair errors caused by incorrectly specified equations and incorrect parameter values.
The run-time algorithmic debugger described in the thesis represents the first major effort in adapting automated debugging techniques to equation-based languages. To our knowledge none of the existing simulation environments associated with such languages provides support for run-time declarative automatic debugging.
This thesis makes novel contributions to the structure and design of easy-to-use equation-based modeling and simulation environments and illustrates the role of structural static analysis and algorithmic automated debugging in this setting. The scope and feasibility of the approach is demonstrated by a prototype environment