{'fraction_non_alphanumeric': 0.02256637168141593, 'fraction_numerical': 0.003982300884955752, 'mean_word_length': 5.333333333333333, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Static Dimensional Analysis in Modelica

Physical dimensions and units are normally used in science and engineering when modeling complex physical systems. When models are implemented in programming languages, physical quantities are typically implemented as real numbers with no notation of the units or dimensions. Due to the fact that programming languages generally lack this support, units and dimensional analysis cannot be used to detect potential errors caused by mismatch of dimensions. While such errors might seem insignificant, unit mismatches are not uncommon and can lead to catastrophic safety consequences. For example, in September 1999, the NASA Mars Climate Orbiter Mission lost contact with the spacecraft during the Mars orbit maneuver. This failure was eventually traced back to a software flaw when converting between English and metric units [4]. There are many attempts of formulating dimension checking in programming languages, such as Ada Package [2] and Template based C++ approaches [5]. However, these solutions have the characteristics of ad hoc language features, rather then being part of a language’s general type system. Recently, approaches have been investigated in how to incorporate dimension and unit analysis in object-oriented languages, such as Java and C#, based on nominal type systems [1]. Dimensions and units are today part of the Modelica language specification [3], which enables the engineer to specify units during modeling. However, it exists no sound strategy of how to analyze and verify dimensional integrity in arbitrary language construct of Modelica. The research problem is to investigate if and how dimension and unit checking can be enforced statically, i.e. before runtime, in a language such as Modelica, which has a structural type system with the unusual property of being a declarative equation based object oriented language that combines side-effect free functions with imperative algorithm sections. Our expected contribution is twofold: i) A sound design proposal of how the Modelica language can be extended to support full static checking of dimensions and units, and ii) a formal and proven type system which guarantees safety. In addition to theoretical investigations of the proposed