Skip to content

adding parameters with indices in the path #430

Description

@tboiger

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions