packageBenchmarksForResizeableArrays

Library with benchmark models to evaluate that arrays can be resized after translation

Uses Modelica 4.1.0.

Information

Library BenchmarksForResizeableArrays is a free package providing benchmark models with arrays. The goal is that the arrays can be resized after translation of the models (and before simulation starts).

These benchmarks shall help Modelica tools to support this desireable feature. Furthermore, users can check in a simple way, whether a Modelica tool supports array resizing after translation (just translate and after translation you should be able to change array dimensions). This is especially valuable when exporting a model as Functional Mock-up Unit (FMU), because the FMU need no longer be regenerated when array sizes shall be changed.

The models in this library are presented and discussed in the following publication:

Martin Otter, Hilding Elmqvist (2025): Resizable Arrays in Object-Oriented Modeling. International Modelica & FMI Conference 2025.

This paper describes modest enhancements of standard algorithms to avoid scalarization. As a result, generated code is independent of array sizes, arrays can be resized both after translation and during simulation. The new technique does, however, impose certain restrictions on the way models are written. In subpackage ErrorsIfArraysNotExpanded models are provided that cannot be processed with the algorithm of this paper, because array equations and arrays must be expanded (at least internally) for these models. In ErrorsIfArraysNotExpandedCorrected it is shown, how these models need to be (slightly) modified, in order that this algorithm can be applied.

The algorithm is integrated into the Modiator web app, which can be accessed directly in your browser without installation or registration. All the examples from this package simulate in Modiator (version from beginning of Nov. 2026), with exception of the models from subpackage ErrorsIfArraysNotExpanded.

An alternative, more general and more involved algorithm is provided in the following publications:

Karim Abdelhak, Francesco Casella, Bernhard Bachmann (2023): Pseudo Array Causalization. International Modelica Conference 2023.
Karim Abdelhak, Bernhard Bachmann (2025): Constant Time Causalization using Resizable Arrays. International Modelica & FMI Conference 2025.
Karim Abdelhak (2026): Symbolic Methods for Systems of Array-Based Differential-Algebraic Equations. Dissertation, Universität Bielefeld.

The proposed algorithm has not the limitations of (Otter, Elmqvist 2025), in particular the models from subpackage ErrorsIfArraysNotExpanded can be translated such that array sizes can be changed after translation. The algorithm is available in a prototype of OpenModelica and all models of this benchmark package are translated so that array sizes can be resized after translation. It is planned that this extension of OpenModelica becomes publicly available in Dec. 2026.

Contents

NameDescription
ArrayEquationsModels with array equations
ArrayEquationsWithIndexReductionModels with array equations that need to be differentiated
ForLoopsModels with arrays and for-loops
ComponentArraysModels with component arrays and for-loops
ErrorsIfArraysNotExpandedModels that are correct, but might lead to errors if arrays are not expanded (depending on used symbolic algorithm)
ErrorsIfArraysNotExpandedCorrectedRewritten models of package ErrorsIfArraysNotExpanded, so that processing is possible without array expansion

Revisions

  • 2025-05-31 by Martin Otter, Hilding Elmqvist, Clément Coïc: Initial version.

Copyright © 2025 Deutsches Zentrum für Luft- und Raumfahr e.V. - Institute of Vehicle Concepts .(DLR-FK), Mogram AB, Clément Coïc.

This Modelica package is free software and the use is completely at your own risk; it can be redistributed with or without modification under the terms of the 2-Clause BSD license, that is reproduced here:

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Some of the models have been derived from other sources, as documented at the respective model, and summarized here:

This library was developed in the European ITEA4 project OpenSCALING - Open Standards for SCALable virtual engineerING and operation. The work of Martin Otter from DLR-FK to develop this library was funded by the German Federal Ministry of Education and Research (BMBF, grant number 01IS23062C).