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

New User Questions

New User Questions

I am fairly new to OpenModelica, so I am just trying things out to get things going.  I have run into two different problems, and I decided to just put them together into one message, to see if anyone has any suggestions.

1) I have OMEdit running fine, and I am trying to work with some of the examples.  The problem is that I can't change any values for any of the parameters.  I am guessing that it is because the examples are installed without write permission.  So, I tried copying one of the examples over to a user directory, and then importing it.  But that didn't work, since the original example was already loaded, so I got an error.  So, my main question is how can I edit the examples to help understand them better?  Is there a way to just duplicate an example, so I can make edits?  I also tried just selecting all the blocks, doing a copy, then creating a new model and pasting.  But that didn't work either.  I just would like a version of the examples, that I can easily modify, to help learn from them.


2)  I am running on a Mac.  I was able to install fine using Macports to get the openmodelica_devel working.  I have even done an upgrade, or two that were successfull.  But, for the last few days, the nightly releases have failed to update successfully.  Perhaps it is just something that is wrong in the newest few nightlys, but I wanted to just see if anyone else is having this problem, or has any suggestions?

Thanks,

Re: New User Questions

Maybe try?

Code:

model M extends Modelica...Examples.XXX; end M;

Re: New User Questions

Hi,
I'm also trying to edit/change examples in OMEdit.

Code:

//within Modelica.Fluid.Examples;

model HeatingSystem "Simple model of a heating system"
//extends Modelica;
extends Modelica.Icons.Example;
   replaceable package Medium =
      Modelica.Media.Water.StandardWater
     constrainedby Modelica.Media.Interfaces.PartialMedium;

I commented out "within Modelica.Fluid.Examples"
Now the parameters in the graphic-window are able to be looked at and can be documented via screenshot.
But the Icons are partially incomplete. Some kind of library is missing - but which one.
Inserting the recommended "extends Modelica;" spoils the code completely.

I read elsewhere, that for building and executing Fluid.examples the installation of a recent nightlybuild would be  necessary?
THX

Re: New User Questions

That helps a lot, although it doesn't copy everything, or solve the problem.  For example I created a file m.mo that contains just the line:
model M extends Modelica.Fluid.Examples.PumpingSystem;end M;
I then opened the file in OMEdit.  What I see has all the blocks, but no connections and no parameters assigned, just default values.  Even stranger, if I try to change any parameters, the new values don't seem to "stick".  So, for example, when I open the above, I see the same layout of items form the PumpingSystem example.  But,under valveOpening it says startTime=0.  If I right click on that, I can see Parameters, and there I can change startTime to 200 (to match the example).  But, if I then click OK, the diagram still shows startTime=0 and if I open the parameter dialog again, it still shows 0. 
So, I still can't really edit the example.

Re: New User Questions

Hi,

I tried it and got the same result. It looks like a bug. Can you report it https://trac.openmodelica.org/OpenModelica/?

Adeel.

Re: New User Questions

OK.  I created the ticket. 
In the mean time is there any work around that can be suggested?  It seems like the examples are not very useful for understanding, if all that a new user can do is run them as is. 

Thanks,

There are 0 guests and 0 other users also viewing this topic