Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

Problem with setting model parameters in OMEdit

Problem with setting model parameters in OMEdit

Regards All,

I know that this issue has already been related two times. But as it makes OpenModelica unsuable for me, I  open this new subject in order to better referencate, gives you my observations and temporary solutions.

            The configuration:   
Windows7-64 + OMEdit 1.6.0

              The problem: 
Drag and drop a "constant-source" from the block standard librairy and change the default constant parameter (rick-click -> properties->parameters->k=3). Run a simulation and look for the results. Unfortunately the new parameter has not been taken into account as the source send the default signal value (as if the value of k constant was still 1).

        The observations:
It looks like as if the OMEdit didnt save the parameters in model file. Here is the OMedit generated code (without annotation):

Code:

 model test


  Modelica.Blocks.Sources.Constant constant1

  Modelica.Blocks.Sources.Pulse pulse1

end test;

And here is the DYnamola generated code:

Code:

model test


  Modelica.Blocks.Sources.Constant const(k=3)
   
  Modelica.Blocks.Sources.Pulse pulse(amplitude=10, period=1)
   
end test;

Here is what is written by default in the OMEdit parameter box of pulse-signal-source:

Code:

[<interactive>:1:0-1:16:writable] Error: Parser error: Unexpected token near: getParameterValue (IDENT)

There is also probably a problem with a { symbol that appears before the word amplitude and that could maybe be related to the main problem.


        Temporary solution:

Finally to be able to move-on the solution is to manually change the paramaters directly in the model file (that is why i say temporary ^^)


     This is my first message here, hope it is in the convention!
     Thank for your great job!

Edited by: lapingarou - Feb-14-11 02:43:48

Re: Problem with setting model parameters in OMEdit

I am having the same issue on Windows XP.  The editor is not generating the parameter settings in the code.  It is a little frustrating because I am learning Modelica.

Buzz

Re: Problem with setting model parameters in OMEdit

I agree that it is a major problem. By the way if your are just learning Modelica (wich mean your model are small) you can just edit the code as I explained previously.

Speaking about editing the code, my descritpion was just for constante source. By the way you'll also need to specify initial conditions for state variable. Here is an example for one of my model, "VolumeAir", wich is located in the devellopeur package of main Modelica library. ("devellopeur" package is one of my custom package that i manualy put in Modelica standard library ).

So, if I just drag and drop the model, OMEdit will write this code:

Code:

Modelica.Devellopeur.VolumeAir  volumeair1 

Now, if i want to specify state variable (S_int; V_int; M_int) initial value, i have to write:

Code:

Modelica.Devellopeur.VolumeAir  volumeair1(S_int(start = 6.81010184), V_int(start = 0.001), M_int(start = 0.001072));

good luck!

Re: Problem with setting model parameters in OMEdit

Hi...

The problem has been fixed...  Download the current nightly build.

Thanks!
Bret

There are 0 guests and 0 other users also viewing this topic
You are here: