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
  • » Henkvw
  • » Profile

Posts

Posts

Dear All,

Related to the question below, I would like to ask if anybody knows a work-around to reduce the string displayed in a graphical annotation to just the last part of the complete name. The functionality I am looking for in OMEdit is the following ( copied from ModelicaSpec33.pdf):

%par replaced by the value of the parameter par. The intent is that the text is easily readable, thus if par is of an enumeration type, replace %par by the item name, not by the full name. [Example: if par="Modelica.Blocks.Types.Enumeration.Periodic", then %par should be displayed as "Periodic"]

Any suggestion on how to achieve this in the latest version of OMEdit (v1.11.0) would be most helpful.

Dear all,

I am trying to make a small library for cryogenic thermal analysis purposes. I created a ResistorPowerLaw  model which uses certain parameters from a material  record in the library:

package Material
   extends Modelica.Icons.MaterialPropertiesPackage;
 
   record BaseData       
      extends Modelica.Icons.Record;   
      parameter Real a=1 "Temperature proportionality coefficient";
      parameter Real b=1 "Temperature power coefficient";
   end BaseData;

   record Nb "Niobium"
      extends ThermalCryogenics.Material.BaseData(a=4, b=1);
   end Nb;
….


In OmEdit this is working now (without using the choicesAllMatching statement, the correct full material name + path just needs to be typed in).

However in the diagram view I could not find a way to display which material is selected for the model instance. I would like to include the selected material name (or any of the variables in the material record)  in the graphical annotation of the ResistorPowerLaw instance. For some reason the macro "%material.a" doesn't work (it doesn't display the value, just the literal text, for instance "ThermalCryogenics.Material.Nb().a" when I selected Nb). The variable material.a is however known within the ResistorPowerLaw model (used in the equation section), check model yields no errors and the model runs fine. I don't know how to modify or truncate the displayed string in the graphic annotation.

Any suggestions are welcome!

Sep-19-16 07:15:36
Library not functioning?

I am looking for a way to locally linearize my model and get access to commonly used analysis features used for such a linearized system from within OpenModelica. At first glance it looks like the Modelica_LinearSystems2 library provides all these functions. However for me the library fails to work. During opening I get a warning "classDirectory() is a non-standard operator that was replaced by Modelica .Utilities.Files.loadResource(uri) before it was added to the language specification." Since this is only a warning I expect that this is not the reason for the library to fail. However when I open "FirstExample" under Examples I get a Translation Error: "Only classes of type 'operator record' may contain elements of type 'operator function'; 'constructor' was found in a class that has restriction 'record'." All other examples I try to run all fail with this same message.

All help on how to correctly use the library or get it functional would be appreciated. I am working under Windows 7 64bit, OMEdit v1.11.0-dev-4-g7ed1ea5.

I have edited this post, since I now see that this question has been raised within this forum already several times:

-By mraimond Jul-15-16 15:01:17 "Modelica Linear System"
-By bjorn Jun-06-15 00:08:09 "Using Modelica_LinearSystems2"
-By pranjal.chaudhari Mar-05-15 06:23:39 "how to use Modelica_LinearSystems2 library"

None of these posts have been answered, so I should not expect too much...
I am wondering though, if this library is not supposed to work or still under development why is it included within OpenModellica?

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