- Index
- » Users
- » lhans
- » Profile
Posts
Posts
lhans,
Hello,
I try to simulate the medelica model by changing the values of model parameters. I am doing that in Matlab platform through OMMatlab, which is an interface between openmodelica and Matlab.
In order to cahge the parameter values, I put the new pararemeter value into a varaible and use the command of setParameters() as the followings;
=================================================================================================
New_Tsw = 5e-5;
New_Ind = 1e-5;
New_Cap = 4.7e-6;
%control signals
omc.setParameters(["booleanPulse1_period = New_Tsw","booleanPulse1_width = Duty"]);
omc.getParameters(["booleanPulse1_period","booleanPulse1_width"])
%passive component setting
omc.setParameters(["inductor1_L = New_Ind","capacitor1_C =New_Cap"]);
omc.getParameters(["inductor1_L","capacitor1_C"])
===================================================================================================
By using the command of getParameters(), I checked whether the parameter setting is done correctly or not.
But, I found that the parameter is set to be the string of the variable name, not the value of the variable. For example, booleanPulse1_period is set to be "New_Tsw", instead of 5e-5, its value. I think that setParameters() deals with the input as a string.
Could you tell me how to fix this problem and simulate the model by changing the model parameter values?
- Index
- » Users
- » lhans
- » Profile