Automatic Changing of Parameters in an Existing Model

Hello everyone,

For my master's thesis, I have created a parameterized model. I now want to conduct a parameter study using API2.

Is there a function in API2 that automatically changes the parameters of the model, for example, from an Excel table?
So far, I have only found this function in API1.

Thank you very much for the help.

Hi Fabian_Allgayer,

let's start with a big welcome to the community!

I really would like to help you, but to do so I need to have more informations about your project. What parameters do you want to change? You can of corse get a single object or a list of objects, modify them and then send them back to the model again. But as I said, I need to have mor infos about your project here.

Best redards
Robert Milrath

Hello,
Thank you for the quick response.

I would like to change the list of global parameters in my model, or partially change it. That is, the values which are then connected to my nodes etc. in the model, with which I have so far performed a "manual" parameterization of the model.

In API 1 the function was called: I also got the function running here.
class GlobalParameter():

@staticmethod  
def AddParameter(  
        no: int = 1,  
        name: str = '',  
        symbol: str = '',  
        unit_group=GlobalParameterUnitGroup.LENGTH,  
        definition_type=GlobalParameterDefinitionType.DEFINITION_TYPE_VALUE,  
        definition_parameter: list = None,  
        comment: str = '',  
        params: dict = None,  
        model = Model):

Thank you very much for the feedback

Hello Fabian_Allgayer,

To modify your global parameters or partially update them in your model using API gRPC, you can use following code snippet that shows how to add a new global parameter and then update its value:

rfem_app.create_object(
    rfem.global_parameters.GlobalParameter(
        no=1,
        name='length',
        symbol='l',
        unit_group=rfem.global_parameters.GlobalParameter.UNIT_GROUP_LENGTH,
        unit='m',
        definition_type=rfem.global_parameters.GlobalParameter.DEFINITION_TYPE_VALUE,
        value=5.0
    )
)

rfem_app.update_object(
    rfem.global_parameters.GlobalParameter(
        no=1,
        value=7.0
    )
)

Let me know if you need further clarification or help with anything else!

Best regards,

2 Likes