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
  • Index
  • » Users
  • » lapingarou
  • » Profile

Posts

Posts

Hi Esko,

   I gave a solution in this topic:      http://www.openmodelica.org/index.php/f … pic?id=214

Feb-18-11 04:47:37
Sources block only gives default value

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!

Feb-14-11 21:22:39
I would like to know how a modelica library cab be made?

Hello Jainabrm,

To go for a new library is a hard task wich need a deep knowledge of physic and modelica. Here are my obervsation about the subject:

   1) To generate a new library package::

You can't do it with OMEdit and need to use another software. In OpenModelica documentation they say to use the software Eclipse with some pluggins (MDT, Papyrus...). Unfortunately, even if the installion is well describe, there is no tutorial to explain how to generate the package-file and use it with OMEdit. So my solution is to create the new library and build the package with Dymola (quite easy). 


   2) To use the new library with OMEdit::

If you want to use the new package, you'll have to put it in the main modelica library. To do so:

    - Prepare a new folder wich name is the name of your new library (say "Devellop") and put your new package file (devellop.om) into it.
    - Change the name of the package file and call it "package"
    - Copy your new folder and its content to the modelica standart library folder:  C:\OpenModelica1.6.0\lib\omc\omlibrary\msl31\Modelica  (you'll see all the other library)
    - modify the order file called package in the the same folder to include the name of your library.
    - Launch OMedit and look if it works!


This manipulation is also true for some already prepare package  https://www.modelica.org/libraries  (TecThermo should interest you...).  Unfortunately there is some compatibility problem and you'll have to explore each specific case (for example with ThermoBondLib you have to deleted the two first lines...). But the most important you have to know for your application (thermodynamic as I understood) is that  all libraries that rely on modelica.fluid don't work with OMEdit  (Thermopower for example); but it will change in few months!

Tell me if my english is not understandable and good luck!

For all, don't hesitate to give your tips and opinion because i am a new user.

Feb-14-11 02:41:34
Sources block only gives default value

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!

  • Index
  • » Users
  • » lapingarou
  • » Profile
You are here: