Skip to content

About

Modeling and simulation tool for continuous and hybrid systems.

Topics

Resources

Stars

37 stars

Watchers

6 watching

Forks

Latest commit

 

History

998 Commits

Folders and files

Repository files navigation

QSS Solver 6.2.3

The QSS Solver is a modeling and simulation environment for continuous and hybrid systems and it's optimized for large scale model simulation. The solver is implemented as a set of modules coded in plain C language, simulations can be performed using one of the following integration methods:

  • QSS methods (the entire family is supported)
  • DASSL
  • DOPRI
  • CVODE
  • IDA

Models are described using a subset of the standard Modelica language called μ–Modelica (the language specification can be found here), the compiler extracts all the structural information needed and automatically generates the plain C code that contains an appropiate model definition needed by the QSS Solver engine together with all the configuration files (makefiles, config, etc.).

The QSS Solver has a simple GUI interface that allows the end-user to access all the developed tools in a unified way.

The GUI has the following features:

  • It has a text editor, where models in μ-Modelica can be defined.
  • It invokes the corresponding tools to compile and run simulations.
  • It provides debug information in case of errors during the model generation.
  • It invokes GnuPlot to plot the simulation output trajectories.
  • It shows statistics about simulations (number of steps, simulation time, etc.).

Related Publications

[8] Ernesto Kofman, Joaquin Fernandez, Denise Marzorati. Compact sparse symbolic Jacobian computation in large systems of ODEs Applied Mathematics and Computation

[7] Franco Di Pietro, Joaquin Fernandez, Gustavo Migoni, Ernesto Kofman. Mixed-mode state–time discretization in ODE numerical integration Journal of Computational and Applied Mathematics

[6] Gustavo Migoni, Ernesto Kofman, Federico Bergero, Joaquin Fernandez. Quantization-based simulation of switched mode power supplies Simulation

[5] Federico Bergero, Joaquin Fernandez, Ernesto Kofman, Margarita Portapila. Time discretization versus state quantization in the simulation of a one-dimensional advection–diffusion–reaction equation Simulation

[4] Federico Bergero, Francesco Casella, Ernesto Kofman, Joaquin Fernandez. On the efficiency of quantization-based integration methods for building simulation Building Simulation

[3] Joaquin Fernandez, Ernesto Kofman, Federico Bergero. A parallel Quantized State System Solver for ODEs Journal of Parallel and Distributed Computing

[2] Federico Bergero, Xenofon Floros, Joaquin Fernandez, Ernesto Kofman, Francois Cellier. Simulating Modelica models with a Stand–Alone Quantized State Systems Solver Proceedings of the 9th International Modelica Conference

[1] Joaquin Fernandez, Ernesto Kofman. A stand-alone quantized state system solver for continuous system simulation Simulation

Components

MicroModelica Compiler

The MicroModelica compiler allows the user to describe models using a subset of the standard Modelica language called μ–Modelica (the language specification can be found here), the compiler extracts all the structural information needed and automatically generates the plain C code that contains an appropiate model definition needed by the QSS Solver engine together with all the configuration files (makefiles, config, etc.). The compiler documentation can be found here

QSS Engine

The QSS Engine is a library that allows the simulation of continuous and hybrid systems and it's optimized for large scale model simulation. The solver is implemented as a set of modules coded in plain C language, where the simulated models can contain time and state discontinuities. Simulations can be performed using one of the following integration methods:

  • QSS methods (the entire family is supported)
  • DASSL
  • DOPRI
  • CVODE
  • IDA

In order to obtain an executable model, a plain C file that contains the following functions must be provided:

  • Model definition.
  • Model settings.
  • Model dependencies (for QSS methods).
  • Model Jacobian.
  • Model zero-crossing function.
  • Model event handlers.
  • A function in charge of the simulator data structure initialization.

The signature of these functions and the data structures that are used depends on the integration method used and they can ve viewed here

Finally, the file containing the model has to be compiled and linked with the engine library.

QSS Solver GUI

The QSS Solver GUI is a simple interface that allows the end-user of the QSS Solver to access all the developed tools in a unified way.

The GUI has the following features:

  • It has a text editor, where models in μ-Modelica can be defined.
  • It invokes the corresponding tools to compile and run simulations.
  • It provides debug information in case of errors during the model generation.
  • It invokes GnuPlot to plot the simulation output trajectories.
  • It shows statistics about simulations (number of steps, simulation time, etc.).

The GUI documentation can be found here

Distributed MicroModelica User Packages

MicroModelica packages with math helper functions and file manipulation functions that uses the C user libraries described bellow.

These packages are included in qss-solver, so that in order to use them no aditional annotation has to be used (such as package location, include paths, etc), just import the package into the corresponding model.

Available packages:

  • math.mo: That contains math utility functions.
  • file.mo: That contains file manipulation functions.

Both files are located in the packages folder in the root install location.

C User Libraries

C libraries that contains helper functions used in MicroModelica packages. The Makefile included compiles the source files and generates the static library in the lib folder of the qss-solver. To compile a new user library, follow these steps:

  1. Put the header file in the include directory.

  2. Put the source file in the src directory.

  3. Add the source file and the target library name in the Makefile.

  4. Finally, run make to generate the corresponding static lib.

The generated lib is stored in the default path that the MMOC looks for, so the lib can be directly accesed from MicroModelica functions.

Installation

These are generic installation instructions.

Dependences

In order to be able to install and compile the QSS Solver, the following dependencies must be installed (Ubuntu 24.04):

  • bison++
  • cmake
  • g++
  • gfortran
  • gnuplot
  • libatlas-base-dev
  • libboost1.83-dev
  • libcln-dev
  • libconfig-dev
  • libginac-dev
  • libgsl-dev
  • libmetis-dev
  • libsbml5-dev
  • libscotch-dev
  • libsuitesparse-dev
  • pkgconf
  • python3
  • qtbase5-dev
  • qtbase5-dev-tools
  • rapidjson-dev

Additionally, flex-old must be installed: sudo apt install ${QSS_SOLVER_ROOT}/src/mmoc/3rd-party/flex/flex-old.deb

Basic Installation

The simplest way to compile this package is:

  1. cd to the directory containing the package's source code (src) and create build directory to compile the binaries and libraries.

  2. cd to the build directory and run cmake .. to install all the binary files and the libraries.

  3. Type make to build the libraries and binary files.

  4. Type make install to install the package, the binaries are located in the bin folder and the libraries are located in the lib folder.

Makefile options and targets

  • Type make help to check the available targets and compile options.

Running on Windows (WSL)

QSS Solver runs on Windows 11 inside Ubuntu under the Windows Subsystem for Linux (WSL). The GUI is displayed through WSLg, which is included in Windows 11, so no X server is needed.

Prerequisites

  1. Ubuntu must run under WSL2 (WSL1 cannot display the GUI). In PowerShell, run wsl -l -v and check that the VERSION column says 2. If it does not, run wsl --set-version Ubuntu 2.
  2. Update WSL once, so that the GUI support is current: wsl --update, then wsl --shutdown, and reopen Ubuntu.

Installation

  1. Check your Ubuntu version with lsb_release -d and download the matching package:

    • Ubuntu 24.04: qss-solver-X.Y.Z.deb
    • Ubuntu 22.04: qss-solver-X.Y.Z-u22.deb
  2. Copy the package into your Linux home folder and install it with apt, which also installs the required dependencies (dpkg -i does not):

    cp /mnt/c/Users/<windows-user>/Downloads/qss-solver-X.Y.Z.deb ~/
    sudo apt install ~/qss-solver-X.Y.Z.deb
  3. Start QSS Solver from an Ubuntu terminal. run.sh must be run from its own folder:

    cd /opt/CIFASIS-CONICET/qss-solver/bin && ./run.sh

    On the first run, the application is copied to ~/qss-solver.

Working with models

No folder mapping is needed. Keep your models inside Ubuntu, under ~/qss-solver/models:

  • To open them from Windows, go to \\wsl$\Ubuntu\home\<linux-user>\qss-solver in File Explorer.
  • Windows drives are available inside Ubuntu under /mnt (for example, C: is /mnt/c). To bring existing models in, copy them: cp -r /mnt/c/path/to/models ~/qss-solver/models/.

Do not install, build or simulate from /mnt/c. On Windows drives, symbolic links and file permissions do not work as on Linux, and compiling is much slower.

Troubleshooting

  • error while loading shared libraries: libqtermwidget5.so.0: the package is not installed inside Ubuntu, qss-solver was started directly instead of through run.sh, or the files were copied or extracted from Windows and their symbolic links were lost. Install the .deb as described above and start the application with run.sh.
  • The window does not appear: check that Ubuntu runs under WSL2 and update WSL (see Prerequisites).

Changelog

[6.2.3] - 20-11-2026

Added

  • Generate algebraic loop code for variable arrays definition.

Fixed

  • Code generation for multi-loop 2D array equations .
  • Code generation for array variable start modifier.

[6.2.2] - 14-10-2026

Added

  • New VS code extension that can be used instead of the GUI.

Fixed

  • Solve loop variable assignment segfault is fixed.
  • Code Scanning alerts from GitHub fixed.

[6.2.1] - 03-08-2026

Changed

  • Differential-mode single-phase PWM inverters closed loop models.

Licensing

Please see the file called LICENSE.

Bug Reporting

Report bugs to: fernandez@cifasis-conicet.gov.ar

About

Modeling and simulation tool for continuous and hybrid systems.

Topics

Resources

Stars

37 stars

Watchers

6 watching

Forks

Releases

Used by

Contributors

Languages