- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Passing multiple values with .mos script
Passing multiple values with .mos script
Passing multiple values with .mos script
 package HePackage
package Systems
model Syslam_Q5
  HePackage.Components.Hlam hlam(
    UCfile=
        "C:/Users/Pikachu/Docs/i_v2/H50.txt",
         A_HS_mod1 =0.0786
         CSize_flag=false,
         A_HS_mod2 = {0.0914,3.01,3.01,3.01,1.38,1.38,1.62,1.62,1.62}
         A_HS_mod3 = {0.0223,3.01,3.01,3.01,1.38,1.38,1.62,1.62,1.62}
         A_HS_mod4 = {0.0245,3.01,3.01,3.01,1.38,1.38,1.62,1.62,1.62});
end Syslam_Q5;
end Systems;
package Components
 model Hlam
   parameter String UCfile = "";
   parameter Real A_HS_mod1 = 1.0
   parameter Real A_HS_mod2 = {1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0}
   parameter Real A_HS_mod3 = {1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.0}
   parameter Real A_HS_mod4 = {0.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0}
   parameter Boolean CSize_flag = false;
 end Hlam; 
end Components;
end HePackage;
while creating .mos file for this modelica model with python i'm able to do it for single value.
but when I do it for multiple values i'm getting error as "failed to build model package".
File : modifiers.mos
loadFile("HePackage.mo"); getErrorString();
list(HePackage.Systems.Syslam_Q5); getErrorString();
setElementModifierValue(HePackage.Systems.Syslam_Q5, hlam.A_HS_mod1, $Code(=1.0)); getErrorString();
setElementModifierValue(HePackage.Systems.Syslam_Q5, hlam.CSize_flag, $Code(=true)); getErrorString();
setElementModifierValue(HePackage.Systems.Syslam_Q5, hlam.A_HS_mod2, $Code(={2.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0})); getErrorString(); #This cause failure during model building
setElementModifierValue(HePackage.Systems.Syslam_Q5, hlam.A_HS_mod3, $Code(={3.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0})); getErrorString(); #This cause failure during model building
setElementModifierValue(HePackage.Systems.Syslam_Q5, hlam.A_HS_mod4, $Code(={4.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0})); getErrorString(); #This cause failure during model building
list(HePackage.Systems.Syslam_Q5); getErrorString();
How to create a .mos file which takes input multiple values for sngle variable ? 
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Passing multiple values with .mos script

 
 
 Thank you
						 Thank you 
						 

