0

I'm running a Dymola model by interfacing with the dymosim.exe file that gets generated when translating a model. I need to run different test cases using the same model, which I do by adjusting the values in the second column of the initialValue matrix within dsin.txt for the parameters of interest. I've found that if the value of the fifth column of initialValue for the parameter of interest is 6 though, then dymosim ignores the value that I set in the second column and uses the default value set in the model.

Based on this description within dsin.txt, I can see why overwriting the value of an auxiliary variable doesn't affect the simulation result. But it's not obvious to me when Dymola chooses to make a parameter an auxiliary variable in a translated model and when it does, it's also not clear what the tunable parameter it's linked to is called. dsin.txt initialValue description

Is there a way to force Dymola to make a model parameter always appear as a parameter in dsin.txt (i.e., column 5 = 1, not 6)?

UPDATE:

I was having this issue with two parameters. I found that one parameter (of type Boolean) changes the model equations/structure depending on how it's set. So I think Dymola fixes the value of it when the model is compiled. I use the same model in two configurations by setting the value of this Boolean parameter so I think I'll have to translate it for each configuration. I was trying to avoid this but from what I understand now, I don't think there's a way around it for this model.

For the other parameter (of type Modelica.SIunits.Position), I found that giving it the annotation "Evaluate=false" changed the category to 1 in dsin.txt. It previously had no annotations so I thought false would be the default value because I have the below options unchecked. Are there other settings to check?

Dymola parameter evaluation options

On a side note, I found the option Advanced.Translation.LogParameters in Dymola to be very helpful for checking if a parameter in a compiled model is tunable, fixed, or dependent. It's a bit easier than generating and looking through the dsin.txt file although it is less detailed.

kmaan
  • 23
  • 5
  • If dymola has to evaluate a parameter (e.g. to compute vector sizes) it will not be tunable anymore and it will be moved to category 6. If this can be prevented depends on the application. Do you have a minimal example? – marco Mar 20 '23 at 17:17
  • @marco I added an update to my original post explaining what I've found so far. Unfortunately I couldn't replicate the behavior with a minimal example (the model parameters appeared as category 1 in dsin.txt as I'd expect). And I can't share the my troublesome model due to its dependency on commercial libraries and company IP. – kmaan Mar 20 '23 at 18:17

0 Answers0