Is there a way to list of parameters of FMU (or of submodel in FMU) using the python libraries FMPy or pyFMI?

前端 未结 3 2000
遥遥无期
遥遥无期 2021-01-19 10:54

I have a FMU of a model and the use case is to change parameter values of the FMU to see the impact on the results. Is there a way to list top level parameters of the FMU us

3条回答
  •  清歌不尽
    2021-01-19 11:38

    For fmpy you can also inspect this jupyter notebook: https://notebooks.azure.com/t-sommer/projects/CoupledClutches, which contains the lines

    model_description = read_model_description(filename)  # read the model description
    
    for variable in model_description.modelVariables:            # iterate over the variables
        if variable.causality == 'parameter':                    # and print the names of all parameters
            print('%-25s %s' % (variable.name, variable.start))  # and the respective start values
    

提交回复
热议问题