This article is written by Gemini Deep Research.
DASSL: A Deep Dive into Implementation and Performance Variations in Dymola and OpenModelica
DASSL (Differential/Algebraic System Solver) is a numerical algorithm widely used for solving differential/algebraic equations (DAEs). These equations arise in various scientific and engineering domains, including modeling physical systems, chemical reactions, and control systems. DASSL’s ability to handle both ODEs and DAEs makes it a versatile tool for simulating complex systems. While DASSL’s core algorithm remains consistent, its implementation can differ significantly across software packages, leading to variations in stability and performance. This article delves into the implementation of DASSL in two popular modeling and simulation environments, Dymola and OpenModelica, investigating the potential reasons behind the observed performance differences.
History and Background of DASSL
DASSL was developed by Linda R. Petzold in the early 1980s to address the need for a robust solver for implicit systems of DAEs 1. Prior to DASSL, solving DAEs often required intricate mathematical manipulations to transform them into ordinary differential equations (ODEs), which could then be tackled by conventional ODE solvers. DASSL’s key innovation was its ability to directly handle DAEs in their implicit form, eliminating the need for these cumbersome transformations.
The algorithm’s core lies in employing backward differentiation formulas (BDFs) to approximate the derivatives in the DAE system. BDFs are implicit linear multi-step methods known for their stability when dealing with stiff systems, where solution components exhibit vastly different timescales. This characteristic makes DASSL particularly well-suited for simulating complex physical systems often encountered in engineering and scientific applications.
DASSL in Dymola
Dymola, a commercial modeling and simulation environment developed by Dassault Systèmes, has integrated DASSL as its default solver 4. Dymola leverages DASSL’s capabilities to handle both ODEs and DAEs 5. To solve these equations, Dymola employs a sophisticated approach involving symbolic preprocessing and numerical integration.
By default, Dymola uses an additional algebraic equation solver to handle the algebraic equations in a DAE system 6. This solver, often a Newton algorithm, iteratively computes the values of algebraic states, which are then passed to the ODE solver along with the differential equations. This process ensures a consistent solution for the coupled system of differential and algebraic equations.
One remarkable aspect of DASSL in Dymola is its flexibility in handling DAEs. DASSL offers two interfaces for simulation: it can work with an ODE description of the system (after symbolic transformation) or directly with a DAE description by setting Advance.Define.DAESolver=true 7. This dual-mode operation allows Dymola to adapt to different model structures and potentially optimize performance. When the DAE solver is enabled, the equations in the output and dynamics section of the model are not solved during calls to the model 7. This can be advantageous for models with large or numerous nonlinear equation systems, as it potentially reduces the number of nonlinear systems solved during the simulation.
In addition to the variable-step solvers like DASSL, Dymola also offers the possibility of using implicit solvers with a fixed step size 8. While fixed-step solvers might not be as adaptable to changing dynamics, they can be beneficial in specific scenarios where precise control over the time step is required.
DASSL in OpenModelica
OpenModelica, an open-source counterpart to Dymola, also incorporates DASSL as its default solver. The specific implementation used in OpenModelica is DASPK2.0, an advanced version of DASSL that has been automatically translated to C using the f2c tool 9. Like Dymola, OpenModelica typically transforms Modelica models into an ODE representation before applying numerical integration methods.
OpenModelica handles DAEs by employing index reduction techniques and introducing dummy variables 11. These techniques aim to simplify the mathematical structure of the DAE system and facilitate numerical solution. However, the automatic introduction of dummy variables can sometimes influence the convergence of the nonlinear equation system, potentially affecting the solver’s stability.
Similar to Dymola, OpenModelica can also use DASSL to directly handle DAEs by setting Advanced.Define.DAESolver=true 7. This allows for greater flexibility in handling different types of models.
OpenModelica provides several simulation flags to adjust the behavior of the DASSL solver 9. These flags offer fine-grained control over aspects such as Jacobian calculation (jacobian), root finding (noRootFinding), restarting (noRestart), initial step size (initialStepSize), maximum step size (maxStepSize), and maximum integration order (maxIntegrationOrder). This level of control allows users to tailor the solver’s behavior to specific simulation needs.
It’s worth noting that using a very short output interval in OpenModelica with DASSL can potentially lead to issues 13. This is because the output interval is used as a heuristic to determine some nominal step size and epsilon values, which might not be appropriate for all models.
Despite sharing the same underlying algorithm, DASSL’s implementation in OpenModelica has been reported to exhibit lower stability compared to Dymola, particularly for specific models and simulation scenarios 14. This discrepancy might stem from several factors, including differences in the symbolic preprocessing techniques, event handling mechanisms, and the specific modifications or optimizations applied to the solver code.
Comparing DASSL Implementations
While pinpointing the exact reasons for the performance variations between Dymola and OpenModelica requires further investigation and potentially access to the source code, several factors could contribute:
- Symbolic Preprocessing: Dymola and OpenModelica might employ different strategies for index reduction and symbolic manipulation of the equations. These variations could influence the structure and complexity of the resulting system, affecting the solver’s performance.
- Event Handling: Events, such as discrete changes in system parameters or state variables, can introduce discontinuities in the solution. The way events are detected and handled can significantly impact the solver’s stability. Dymola and OpenModelica might differ in their event detection algorithms or how they re-initialize the solver after an event.
- Solver Modifications: Both Dymola and OpenModelica might have incorporated specific modifications or optimizations to the original DASSL code to improve performance or address particular types of models. These modifications, while potentially beneficial in some cases, could introduce subtle differences in behavior and stability.
- Linear Algebra Routines: DASSL relies on linear algebra routines to solve systems of equations at each time step. The choice of these routines and their implementation can influence the solver’s efficiency and numerical stability. Dymola and OpenModelica might utilize different linear algebra libraries or have implemented these routines differently.
Insights from Developers and Research
Unfortunately, detailed insights from the developers of Dymola and OpenModelica regarding their DASSL implementation choices are limited 4. This lack of transparency from Dymola, in particular, makes it challenging to conduct a comprehensive comparison of the two implementations 5. However, some research papers and online discussions provide valuable clues. For instance, a study on simulation performance in Modelica environments highlights the importance of efficient code generation, event handling, and solver selection 17. Another study emphasizes the role of symbolic manipulation and index reduction in handling DAEs 12.
Conclusion
DASSL remains a powerful tool for solving DAEs in various scientific and engineering applications. While its core algorithm provides a solid foundation, the specific implementation details can significantly influence its performance and stability. The observed differences between Dymola and OpenModelica likely stem from variations in symbolic preprocessing, event handling, solver modifications, and linear algebra routines. Further research and analysis are needed to fully understand these differences and provide definitive guidance on choosing the most suitable solver for a given application. It is important to acknowledge that the limited information available about Dymola’s DASSL implementation restricts the depth of this analysis and may impact the conclusions drawn.
Further Research
To gain a deeper understanding of the performance variations of DASSL in Dymola and OpenModelica, the following research avenues could be explored:
- Comparative Analysis: Conduct a systematic comparison of the DASSL implementations in Dymola and OpenModelica using a benchmark suite of DAE problems with varying stiffness and complexity. This analysis could involve:
- Profiling the solver’s execution time for each problem in the suite.
- Analyzing the stability behavior of the solver, particularly in the presence of events or discontinuities.
- Assessing the accuracy of the solutions obtained by each implementation for different problem types and tolerances.
- Source Code Examination: If access to the source code is possible, a detailed examination of the DASSL implementations in both environments could reveal:
- Specific modifications or optimizations applied to the original DASSL code.
- The choice of linear algebra routines and their implementation details.
- Differences in the strategies for symbolic preprocessing and index reduction.
- Developer Interviews: Conducting interviews with the developers of Dymola and OpenModelica could provide valuable insights into:
- The rationale behind their design choices for the DASSL implementation.
- Any specific challenges they faced during the development process.
- Their perspectives on the observed performance differences between the two environments.
- Sensitivity Analysis: Perform a sensitivity analysis to investigate how DASSL’s performance is affected by various simulation parameters, such as:
- Solver tolerances: Analyze how changes in relative and absolute tolerances influence the accuracy, stability, and execution time of the solver.
- Step sizes: Investigate the impact of different initial and maximum step sizes on the solver’s ability to capture the system dynamics and maintain stability.
- Event detection thresholds: Determine how variations in event detection thresholds affect the accuracy and efficiency of event handling.
引用文献
1. Description of DASSL: A Differential/Algebraic System Solver - UNT Digital Library, 1月 12, 2025にアクセス、 https://digital.library.unt.edu/ark:/67531/metadc1096787/
2. 2*:A3vDescription of DASSL: A DifferentiaVAlgebraic System Solver - OSTI.GOV, 1月 12, 2025にアクセス、 https://www.osti.gov/servlets/purl/5882821
3. dassl - Computational Science and Engineering Research Group, 1月 12, 2025にアクセス、 https://cse.cs.ucsb.edu/sites/default/files/publications/DASSL.pdf
4. Quick guide to choosing a Solver (Integration Algorithm), Tolerance and Output Interval in Dymola - Claytex, 1月 12, 2025にアクセス、 https://www.claytex.com/tech-blog/quick-guide-to-choosing-a-solver-tolerance-and-output-interval-in-dymola/
5. In Dymola to solve DAEs, why use the DASSL algorithm after performing the Patelides algorithm? - Stack Overflow, 1月 12, 2025にアクセス、 https://stackoverflow.com/questions/66124437/in-dymola-to-solve-daes-why-use-the-dassl-algorithm-after-performing-the-pateli
6. Debugging in Dymola – Get the best out of your model - TLK Energy, 1月 12, 2025にアクセス、 https://tlk-energy.de/blog-en/debugging-dymola-nonlinear-equation-systems
7. Solving Modelica Models — OpenModelica User’s Guide v1.13.0-dev.beta1 documentation, 1月 12, 2025にアクセス、 https://openmodelica.org/doc/OpenModelicaUsersGuide/v1.13.0-dev.beta1/solving.html
8. Performance of inline integration in Dymola compared to normal calculation mode using DASSL - Stack Overflow, 1月 12, 2025にアクセス、 https://stackoverflow.com/questions/66178029/performance-of-inline-integration-in-dymola-compared-to-normal-calculation-mode
9. Solving Modelica Models - OpenModelica, 1月 12, 2025にアクセス、 https://openmodelica.org/doc/OpenModelicaUsersGuide/latest/solving.html
10. Solving Modelica Models — OpenModelica User’s Guide v1.16.0-dev.03 documentation, 1月 12, 2025にアクセス、 https://openmodelica.org/doc/OpenModelicaUsersGuide/beta1/solving.html
11. OpenModelica inconsistent initial condistions for DAEs - Stack Overflow, 1月 12, 2025にアクセス、 https://stackoverflow.com/questions/76500522/openmodelica-inconsistent-initial-condistions-for-daes
12. Event Handling in the OpenModelica Compiler and Runtime System - DiVA, 1月 12, 2025にアクセス、 http://liu.diva-portal.org/smash/get/diva2:67/FULLTEXT01.pdf
13. Integrator issue on DASSL solver #10698 - GitHub, 1月 12, 2025にアクセス、 https://github.com/OpenModelica/OpenModelica/issues/10698
14. DASSL solver in OpenModelica and Dymola - Stack Overflow, 1月 12, 2025にアクセス、 https://stackoverflow.com/questions/28632261/dassl-solver-in-openmodelica-and-dymola
15. Solving Modelica Models - OpenModelica, 1月 12, 2025にアクセス、 https://openmodelica.org/doc/OpenModelicaUsersGuide/v1.9.3/solving.html
16. OpenModelica User’s Guide, 1月 12, 2025にアクセス、 https://openmodelica.org/doc/OpenModelicaUsersGuide/OpenModelicaUsersGuide-1.21.pdf
17. Simulation Speed Analysis and Improvements of Modelica Models for Building Energy Simulation Filip Jorissen. Michael Wetter, Li - OSTI.GOV, 1月 12, 2025にアクセス、 https://www.osti.gov/servlets/purl/1249560