Are you ready to talk?

Wait, Dymola variable length array parameters at run-time!?

Table of contents

For years, one of the most frequent pieces of feedback we’ve received from customers about Dymola has been their frustration with the requirement for parameter array sizes to be known at compile-time. This previously written blog post talks a little about this long-standing limitation. Fortunately, starting in Dymola 2025x, this is a limitation of the past! Let’s take a look at variable length array setup.

Here is the snippet from the Dymola 2025x release notes:

Even though the list of limitations looks long, I don’t think they will hinder the user too much. I was pleasantly surprised at how simple it was to get working. After just a few minutes of fiddling, I had the following example which verifies the variable length array functionality.

Due to limitation number 2, I chose to print the values in my array into the log in an initial algorithm section.

Here is the initial input file:

Here’s the resulting log file for that simulation/input file:

And with just a simple change of the json file to this:

The same exe file yields this log:

 

Closing

In closing, we can now define parameter array sizes at run-time! The option to use variable length array parameters at run-time is a great improvement over all Dymola versions prior to 2025x!!

Nate Horn – Vice President

 

Need to talk to an expert?

Our engineering teams are on hand to provide tailored guidance and support with a deep knowledge of the full Dassault Systèmes portfolio.

Want to receive more content like this?

Sign up to receive a weekly roundup of Expert insights as they are published...

  • Related news & articles straight to your inbox
  • Hints, tips & how-tos
  • Thought leadership articles