Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Modelica Parameter studies with python

I want to run parameter studies in different modelica building libraries (buildings, IDEAS) with python: For example: change the infiltration rate.

I tried: simulateModel and simulateExtendedModel(..."zone.n50", [value]) My questions:Why is it not possible to translate the model and then change the parameter: Warning: Setting zone.n50 has no effect in model. After translation you can only set literal start-values and non-evaluated parameters.

It is also not possible to run: simulateExtendedModel. When i go to command line in dymola and write for zone.n50, then i get the actual value (that i have defined in python), but in the result file (and the plotted variable) it is always the standard n50 value.So my question: How can I change values ( befor running (and translating?) the simulation? The value for the parameter is also not visible in the variable browser.

Kind regards

like image 702
Math_reald Avatar asked Mar 17 '26 07:03

Math_reald


2 Answers

It might be a strcutrual parameter, these are evaluated also. It should work if you explicitly set Evaluate=False for the parameter that you want to study. Is it not visible in the variable browser or is it just greyed out and constant? If it is not visible at all you should check if it is protected.

like image 196
matth Avatar answered Mar 18 '26 20:03

matth


Some parameters cannot be changed after compilation, even with Evaluate=False. This is the case for parameters that influence the structure of the model, for example parameters that influence a discretization scheme and therefore influence the number of equations.

Changing such parameters requires to recompile the model. You can still do this in a parametric study though, I think you can use Modelicares to achieve this (http://kdavies4.github.io/ModelicaRes/modelicares.exps.html)

like image 37
saroele Avatar answered Mar 18 '26 20:03

saroele



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!