You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if s.addParameters is used, it is something like
simulateModel('modelname(multizone.VAir=30000)', ...)
or
simulateModel('modelname(multizone.zoneParam[1].gWin=0.6)', ...)
the problem is that writing the parameters in parenthesis after the model works as long as the parameter is accessible with dots only, but if there is an index, it doesn't work anymore, because Dymola obviously can't handle indices inside the parenthesis.
Our solution so far is to use the Python Interface of Dymola to access the parameters:
We use the function 'simulateExtendedModel' from the Interface, where parameters can be given extra this way
Here it works with indices too. We save the file to a given path and then import the results with buildingspy.
A solution for buildingspy would be to give the option to either generate a mos run-file with simulateModel or a mos run-file with simulateExtendedModel depending on if parameters are added or not
The text was updated successfully, but these errors were encountered:
Another issue with using simulateExtendedModel is that some parameter are already evaluated during translation and then cannot be modified. For example,
simulateExtendedModel(problem="IBPSA.Fluid.FixedResistances.Validation.PressureDropsSeries", initialNames={"res[1].dp_nominal"}, initialValues={10}, tolerance=1e-06, resultFile="PressureDropsSeries");
Warning: Setting res[1].dp_nominal has no effect in model.
After translation you can only set literal start-values and non-evaluated parameters.
in buildingspy the function "s.simulate" generates a mos run-file and runs the file;
in the mos-file there is written something like
simulateModel(modelname, startTime=0, stopTime=31536000, method="Cvode - variable order", tolerance=0.0001, resultFile="Inffeldgasse13_1", numberOfIntervals=8760);
if s.addParameters is used, it is something like
simulateModel('modelname(multizone.VAir=30000)', ...)
or
simulateModel('modelname(multizone.zoneParam[1].gWin=0.6)', ...)
the problem is that writing the parameters in parenthesis after the model works as long as the parameter is accessible with dots only, but if there is an index, it doesn't work anymore, because Dymola obviously can't handle indices inside the parenthesis.
Our solution so far is to use the Python Interface of Dymola to access the parameters:
We use the function 'simulateExtendedModel' from the Interface, where parameters can be given extra this way
simulateExtendedModel(modelname, ..., initialNames=['multizone.zoneParam[1].gWin'], initialValues=[0.6], resultFile=path)
Here it works with indices too. We save the file to a given path and then import the results with buildingspy.
A solution for buildingspy would be to give the option to either generate a mos run-file with simulateModel or a mos run-file with simulateExtendedModel depending on if parameters are added or not
The text was updated successfully, but these errors were encountered: