{5} Accepted, Active Tickets by Owner (Full Description) (110 matches)

List tickets accepted, group by ticket owner. This report demonstrates the use of full-row display.

Results (1 - 100 of 110)

1 2

Adeel Asghar (10 matches)

Ticket Summary Component Milestone Type Created
Description
#2894 Summary of improvements for OMEdit GUI usability OMEdit 2.0.0 enhancement 10 years ago

This ticket is meant to collect and prioritize the improvements that need to be done to the OMEdit GUI in order to make it usable with the MSL and with most modern Modelica 3.4 compliant libraries. Each item is covered by a specific ticket.

Features requiring the new front end to be in place

All the features listed here depend on the front-end to provide correct information to OMEdit, and to do so rapidly. This is now possible by using the new front-end (see #4138), which is exploited by new API functions which are much faster than previously. Version 1.14.0 will use these features by default.

  • #2079 Replaceable classes and replaceable objects (e.g. the Medium package in all Modelica.Fluid models, or the HeatTransfer model in the Modelica.Fluid.Vessels.ClosedVolume) should show up in the parameter window, with a drop-down menu filled in based on the choices or choicesAllMatching annotations. Once a specific choice is made, it should be possible to change the parameters and/or replaceable classes/models of the redeclared model/component, e.g. by clicking on a button. This feature is essential for the Modelica.Fluid library, as well as for many user libraries such as ThermoPower.
  • #2081 Conditional connectors should be displayed correctly. This feature is used extensively in the Modelica.Mechanics and Modelica.Electrical libraries. It requires that the API functions return the correct visibility attribute.
  • #2661 Update parameter-dependent Dialog annotations correctly
  • #2132 Display conditional connectors correctly by evaluating the corresponding parameters
  • #2891 Hierarchical editing of systems for graphical modification of parameters and replaceable classes in sub-models. Requires substantial work to implement some API function, as well as in OMEdit to display the information properly.
  • #3915 Rename feature missing

Other features

  • #6417 Keyboard shortcuts for frequent actions such as simulate, switch view
  • #5529 Insufficient precision when storing sine phases
  • #4449 Allow several curves in the same parametric plot window
  • #4645 and #4839 Use blank pixels around lines to enhance readability
  • #3776 Allow copying/pasting models across diagrams
  • #3287 Allow input of common parameters and replaceable classes in a multiple component selection. This can shorten the time to set up a model dramatically
  • #2166 See exact simulation values through snap to curve feature

Past improvements

  • #4508 Reduce the installation time under Windows by making the installation of contributed open source libraries optional
  • #2909, #3788 Drastically reduce the waste of HD space by eliminating useless intermediate output files and reducing the number of useful files
  • #3054 Clarify "Revert from previous" button
  • #2908 Changes in sub-models should be reflected in models using them immediately, not only when changes to the latter models are made.
  • #2906 Drop-down choices for enumeration (and possibly boolean) parameters
  • #2845 Consistent view between textual view and library browser view of packages should be always guaranteed. Requires to update the views in OMEdit whenever the focus is changed between the different sub-windows.
  • #2391 Improved handling of custom modifers (e.g. start attributes) from the GUI. Modifers, once applied, should still show up when the parameter window is re-opened later.
  • #2390 Fully support the showStartAttribute annotation, which is widely used in Modelica.Mechanics.
  • #2190 Copy class feature within the same package.
  • #2903 Add option to output protected variables to simulation setup window, output tag.
  • #2477 Better snap-to-grid features when using blocks from the MSL
  • #2506 Keep connecting lines manhattanized and allow no-nonsense editing of models copied from the MSL (e.g. it should be possible to move one component without weird side-effects on the diagram)
  • #2611 Zoom issue should be fixed.
  • #2988 Zoom In/Out with MouseWheel.
  • #2392 Show default values differently in the Component Parameters window.
  • #2956 Moving a complete model disassembles everything
  • #2596 Re-simulate with changed options. Currently if we want to make a new simulation with different simulations options, e.g. a different final time we have to re-build the whole executable, that is a waste of time.
  • #2985 Updating submodel icons where they are used. This ticket is not really urgent. But it is related to #2908, that has already been fixed, so fixing this one is sort of completion of the job. In case it is difficult to fix it could be postponed.
  • #1900 Handle connections to expandable connectors in OMEdit
  • #2250 Support DisplayUnit and unit conversion for parameter input in OMEdit
  • #3558: Flip icons with text boxes correctly
  • #2676 Handle models in separate files
  • #2905 Comment- and formatting-preserving parsing and unparsing is required to avoid that OMEdit scrambles up the code of existing Modelica classes when saving them on file.
  • #2892 Undo/Redo feature in the Diagram view of the model editor.
  • #2190 Copy class to a different package.
  • #2696: Display enhancement of very large and very small numbers on vertical axis
  • #2960 Speed up the exploration of the package tree and the drag-n-drop actions.
  • #4504 Allow to install OpenModelica anywhere in the file system, including the default installation directories (such as C:\Program Files) that include spaces
  • #2395 - Support the connectorSizing annotation. Required by many libraries including Modelica.Fluid, PNLib, iPSL, OpenIPSL

#3626 Parameter records are not displayed correctly in OMEdit OMEdit Future defect 9 years ago

Please consider the attached example of a DC Machine model, which modifies two parameter records:

...brushParameters(V = 0.617), 
frictionParameters(PRef = 0.7162, power_w = 2, wRef = 723.4)...

Make a double click on the DC machine model and chose the Losses tab:

In the brushParameters field only the number 0.617 appears but it is not clear whether this is "V" or "ILinear"

The frictionParameters filed again shows only one value (723.4) but it is not clear to which element of the record the value belongs to.


#6438 A lookup issue Interactive Environment defect 4 years ago

Steps to reproduce: 1) load TestPackage.mo, and open Test: we have a red box because MyModel is missing 2) load Test1.mo and duplicate its model MyModel into TestPackage. Look at model Test inside TestPackage: the red box should disappear, but it does not. 3) save, unload and re-load TestPackage again 4) open Test inside TextPackage: the red box has disappared and now myModel is displayed.

So the issue is in point 2.

Tested with 1.17.0-dev.beta3.


#3652 Unable to modify parameters inside components. OMEdit Future enhancement 9 years ago

As of 1.9.4~dev-695-g5815c70 OMEdit is not capable of changing parameters further down the hierarchy of a model. It only allows you to use view class in order to open a class in its original location. Which means changing a parameter there will change it in the original location (if it is not write protected). But you can not add any modifiers to any of the components of the sub-layer. This is quite cumbersome.


#3964 MetaModelica support in OMEdit OMEdit Future enhancement 8 years ago

We now have some basic support for MetaModelica in OMEdit but there are still several things missing. Following are the list of features,

  1. Code folding.
  2. Auto complete.
  3. Single & multi-line commenting.
  4. Pressing enter should open the selected file in ModelWidget.
  5. Shift-Home should not select trailing spaces.
  6. Show only name in ctrl-tab window.
  7. Find in files.
  8. Function Outline.
  9. Toggle comment selection for C/C++ Editor.
  10. Code folding for C/C++ Editor.

#4294 OMEdit: Icon Editor - Bring to Front/forward and Send to Back/Backward OMEdit Future defect 8 years ago

Issue 1: I just wondered why all z-order alignment options (Bring to Front/forward and Send to Back/Backward) are disabled. Is the feature still in development? In 1f6c73/OMEdit support for this feature was added.

Issue 2: I think in Modelica there is no dedicated z-order property. Instead, the order of the annotations is deciding. So I realized when deleting a component which is in the back and then doing an "UNDO", the order is not restored, so the deleted component comes to the front.

I know that the IconEditor is not the most critical component, but it would be really nice, if this works properly. As we now have this wonderful UNDO-feature which makes OMEdit totally usable!


#4344 OMEdit: keep UNDO stack after text view changes OMEdit Future defect 8 years ago

Even if it seems to be a more time-consuming task, I recommend merging the UNDO stack of the Text View with the stack of the Diagram View as discussed in #4334#comment:13.

It is just a strange behavior that you must go the to correct view to undo things. People how use OMEdit assume that the content in Text View and Diagram View is a different representation of the SAME thing and expect a coherent behavior especially for undo/redo.


#4322 OMEdit: Improve commenting of folded lines - but how? OMEdit enhancement 8 years ago

Commenting out folded lines in a hurry will result in syntax errors, as only the first line is commented out. It would be convenient if all lines are commented automatically. One possibility is to add a // at the beginning of every other line. Another possibility is to replace the just typed // into a /* and to add a */ at the end of the folded part.

Removing the comments should follow the same automatic behavior.

What do you think? Or is it only me, who noticed that? - This is a discussion ticket!


#5958 Filter and export partial result files from OMEdit OMEdit enhancement 5 years ago

It would be handy to make filterSimulationResults available from OMEdit to export and filter partial result files.


#4309 OMEdit: Status bar: Improve display of component coordinates OMEdit enhancement 8 years ago

Sorry to bother you with another minor-issue ticket.

I noticed that in the bottom status bar ("X: ~ | Y: ~") the X and Y values are odd and not helpful. The values where probably correct back in the days, when we did not have a snap-to-grid feature. Today it is not possible to move icons to these odd positions and consequently, rounded values should be displayed instead.

Also, one can think of displaying the origin of the component which is dragged at the moment and not the mouse position. Furthermore, a delta-display and an extent-display could be added, showing how many (integer) units are moved towards right or top and showing the width/height of the object.

A good example for an excellent status bar is paint.net http://www.getpaint.net/index.html in the shape-editing mode. Paint.net is a free improved version of MS paint.


Adrian Pop (40 matches)

#4372 model replaceable path changes when the model icon is moved and the model becomes no more replaceable OMEdit 1.19.0 defect 8 years ago

Please consider the following models (also attached):

package P1
  model M1
    extends Modelica.Blocks.Interfaces.SISO;
    Boolean Flag = false;
    Real x = if Flag then u else 0;
  equation
    y = 0.5*x;
  end M1;

  model M2
    extends Modelica.Blocks.Interfaces.SISO;
    replaceable model Mx = P1.M1;
    Mx mx annotation(Placement(visible = true, transformation(origin = {-2, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  equation
  connect(u, mx.u) annotation(Line(points = {{-120, 0}, {-14, 0}}, color = {0, 0, 127}));
  connect(mx.y, y) annotation(Line(points = {{9, 0}, {110, 0}}, color = {0, 0, 127}));
  end M2;

  model M3
    P1.M2 m2(redeclare model Mx=P1.M1(Flag=true)) annotation(Placement(visible = true, transformation(origin = {-2, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
    Modelica.Blocks.Sources.Step step1(startTime = 0.5)  annotation(Placement(visible = true, transformation(origin = {-36, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  equation
    connect(step1.y, m2.u) annotation(Line(points = {{-24, 0}, {-14, 0}}, color = {0, 0, 127}));
  end M3;
end P1;

The model M2 defines the model Mx as replaceable and the model M3 uses M2 redeclaring the model Mx in order to change the Flag parameter value from false to true.

Simulating the model M3 the results is according I expect, the Flag parameter value is changed (from false to true) and the step is propagated to the model m2 output.

Now open the model M2 and simply move the model mx

the line:

    Mx mx annotation(Placement(visible = true, transformation(origin = {-2, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));

is changed by OmEdit in:

P1.M2.Mx mx annotation(Placement(visible = true, transformation(origin = {-2, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));

and the model Mx now seems to be no more replaceable, in fact, re-simulating the model M3 the Flag parameter value now is not propagated and the output y of model m2 stays fixed to 0.

Attached are: package P1, output before M1 moving, output after M1 moving.

OMEdit 1.12.0~dev-250-g0f5c07d Connected to OpenModelica 1.12.0~dev-561-gc489db1 sysop: Ubunti 14.04 - 34 bit


#5489 Allow setting each and final prefixes via the API Interactive Environment 2.0.0 defect 6 years ago

Currently setComponentModifierValue only allows to set the modifier value. Extend it to make it possible to include each and final prefixes. There is also an example available in #5395.


#6129 choicesAllMatching doesn't return the appropriate class references Interactive Environment 1.19.0 defect 4 years ago

Please check the attached simple model, I just dragged a pressure source component boundary in it.

When I double-click on boundary, and then click on the Medium drop-down menu, I get about 30 possible classes for redeclarations. However, there are several issues there

  • some are partial packages, which obviously cannot be used, e.g., Modelica.Media.Interfaces.TemplateMedium
  • some are found within models but are not encapsulated, so according to Section 5.3.2 of the specification, they shouldn't even be looked up, e.g. Modelica.Media.Examples.Tests.Components.ShortPipe.Medium
  • some are even found inside partial models, e.g. Modelica.Media.Examples.Tests.Components.PartialTestModel.Medium

On the other hand, not even one of the actually usable models, e.g. Modelica.Media.Air.SimpleAir or Modelica.Media.Water.StandardWater actually show up.

This issue makes OMEdit actually unusable with Modelica Media/Fluid


#2173 simulate API function does not complain on wrong parameters Interactive Environment 2.0.0 defect 12 years ago

Consider the following simple test case:

model Test
  Real x = sin(1000*time);
end Test;

if I call the following API function from OMShell (or OMEdit)

simulate(Test, stopTime = 1, numberOfIntervales=5000)

the compiler silently accepts numberOfIntervales (which is mis-spelled), and still uses the default number of intervals (i.e., 500).

IMHO, API function calls with nonexisting input arguments should generate an error.


#3857 Error in Generated XML from Modelica Code Generation Future defect 9 years ago

Hi there,

I am using the XML file generated by Modelica for modeling. I am getting the following error in the format each time-

In bouncing ball, line 162 of generated xml file, <eq: Equation> is generated within the <when>, whereas it should be <equ: Equation> as per the schema.

Please let me know how/ when this can be resolved. I have attached the modelica model and the generated xml file.


#4410 moving a replaceable object in the block diagram duplicates the graphical annotation in text view OMEdit defect 8 years ago

consider the following model (also attached):

package test
  partial model A
    annotation(
      Diagram,
      Icon(graphics = {Rectangle(extent = {{-100, 100}, {100, -100}}), Text(origin = {2, -1}, extent = {{-32, 41}, {32, -41}}, textString = "A")}));
  end A;

  model B
    extends A;
  end B;

model C
  replaceable B b1 constrainedby A annotation(
    Placement(visible = true, transformation(origin = {0, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
end C;

end test;

now open the model C and move the model B in the block diagram, the graphical annotation in the text view is duplicated as follows:

model C
  replaceable test.B b1 annotation(
      Placement(visible = true, transformation(origin = {-24, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0))) constrainedby A annotation(
    Placement(visible = true, transformation(origin = {0, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
end C; 

this behavior seems depend from the presence of the clause "constrainedby"

OMEdit 1.12.0~dev-290-g1b6ac20 Connected to OpenModelica 1.12.0~dev-703-g46bfb1f

sysop: linux Ubuntu 16.04


#2367 Record with vectors, zeros(), size() New Instantiation Future defect 11 years ago
model emptyVector2
  record R
    parameter Real x[:]=zeros(size(x,1));
  end R;
  R r;
end emptyVector2;

here omc.exe freezes. (r15030)


#2471 Add check if variable can be changed via -override* Run-time Future defect 11 years ago

Currently we do not check if a variable can be changed via -override* functionality in the simulation executable. We should add a check for this (see if isValueChangeable attribute in XML is set to true).


#2849 Wrong flattening of "inner outer output" Frontend Future defect 10 years ago

In the following model (also attached) the inner variable v declared in model Test is assigned to in model B where it is declared as outer output. B is instantiated in A and A is instantiated in Test. In model A variable v is declared as inner outer output.

package Bug

  model B
    outer output Real v;
  equation
    v = time;
  end B;

  model A
    inner outer output Real v;
    Real y2;
    B b;
  equation
    y2 = v;
  end A;

  model Test
    inner Real v;
    Real y1;
    A a;
  equation
    y1 = v;
  end Test;
  
end Bug;

The model flattens, but the generated system of equations is wrong (therefore, it doesn't simulate). The flattened Modelica is:

class Bug.Test
  Real v;
  Real y1;
  Real a.v;
  Real a.y2;
equation
  a.v = time;
  a.y2 = v;
  y1 = v;
end Bug.Test;

Note that the equality constraint between v and a.v is lost.

Adding an additional constraint, e.g., Real a.v = v would make the flattened code valid. Alternatively, a.v could be substituted by v everywhere.


#2924 Extending a model fails Frontend Future defect 10 years ago

I have a model (unfortunately, proprietary, so i can't put it here) that I have been working with that is now causing me some difficulties. The base model is working fine. I then extended that model, with some additions, and it is also working fine. The strange difficulty that I am running into, is that if I extend that model, I run into errors. And, the occur, even if I do nothing but this: model Model3 extends Model2; end Model3;

If I check Model2, I see that it is balanced with 894 equations and 894 variables. And it runs just fine. If I check Model3 (created with nothing but extends, as above, and no actual additions or changes) it shows 1264 equations and 1571 variables (!?!?). If I try to run this model, I see a bunch of "Model is structurally singular, error found sorting equations", "Internal error pre-optimization model clockPartioning failed", "Too many equations, over-determined system. The model has 1264 equations and 894 variables"

I don't see how extending a model, with no changes, or even just a minor addition, can cause the addi4tion of hundreds of equations and variables.


#3067 Memory leak in FMI 2.0 (20 MB/min) FMI Future defect 10 years ago

Thanks to the solution of a couple of tickets during the last weeks the optimization basing on FMI is working quite well now!

A remaining problem is a memory leak that can be seen in all examples to some extend. Here is an extreme case that leaks about 20 MB/min (depending on the speed of your processor).

The problem can be reproduced by repeatedly running an optimization with HQP. On a machine with omc (r23977), git, gcc and tcl-dev:

$ git clone https://github.com/omuses/hqp.git
$ cd hqp
$ ./configure
$ make
$ cd odc
$ ./odc
% while true {source drumboiler_sp.tcl}

#3070 Noise package does not work (replaceable package + function objects) Frontend Future defect 10 years ago

DLR is currently restructuring the Noise package that is planned to be included in MSL 3.2.2. The package shall be very flexible ((a) the uniform random number generator to be used can be selected globally, (b) the random number according to a specific distribution can be selected for every instance and (c) this instance uses the globally selected uniform random number generator. Unfortunately, OpenModelica 1.9.1 (r22929) is not able to handle it.

Find attached several different variants in order to find a version that runs in OpenModelica. Neither of them runs in OpenModelica:

  • TestRandomFeatures.Version2 is the desired one with the desired flexibility. OpenModelica complains during flattening.
  • TestRandomFeatures.Version1,Version3,Version are simplified versions (not as flexible as desired), but still OpenModelica complains during flattening.
  • TestRandomFeatures.Version4 is a very simplified version and OpenModelica generates C-Code. However, the C-compiler reports errors (incompatible type for argument 1 of 'sub_alloc_integer_array').

Please, fix OpenModelica that at least Version5 is running. Even better, please try to generalize OpenModelica so that Version2 is running


#3133 Uncertainties and OpenTURNS support is broken Backend Future defect 10 years ago

The support for uncertainties (and implicit the connection to OpenTURNS) got broken a while back. We should bring it back as people in MODRIO project need it.


#3172 Reorganize the /build layout for Windows to better support +target=msvc for CPP runtime Cpp Run-time Future defect 10 years ago

Currently runtimeCPPmsvcinstall and runtimeCPPinstall puts the build/include and build/lib files in the same place which means that we only support gcc for the CPP runtime (or whichever target is ran last).

I propose to have build/include/msvc/cpp and build/lib/msvc/cpp. Maybe even have the same for the C runtime (build/include|lib/msvc/c) as currently is directly in build/include/msvc and build/lib/msvc.


#3439 Make 3rdParty includes more homogeneous Build Environment Future defect 9 years ago

We don't seem to have a clear picture on where to install 3rdParty includes. We seem to push them into one of these places:

  • build/include/omc/c
  • build/include/omc/cpp

sometimes in their own directory sometimes not.

We should come up with a clear structure on where to put these includes especially of those libraries that are used by both C and CPP runtimes.

For example for ticket #3426 we need sundials but is not clear where to put the includes. If ones looks into the OpenModelica windows installation we seem to have sundials includes twice inside:

  • build/include/omc/cpp
  • build/include/omc/cpp/includes

#3540 Improve support for exporting FMI for co-simulation FMI Future defect 9 years ago

FMI for co-simulation support is missing.


#3676 Do some sanity checks on the Windows PATH when building omc Build Environment Future defect 9 years ago

Sometimes if the user changes their Windows PATH the build will get to some programs it shouldn't and the build process has issues. Make sure we do some checks on the PATH in the Makefile.omdev.mingw.


#3696 Add an OMC API to get and set the redeclare modifiers in extends and components Interactive Environment Future defect 9 years ago

Currently we don't support the redeclare modifiers in the query/set API. We need to implement an API for that.


#3725 loadString merge=true create duplicate elements Interactive Environment Future defect 9 years ago

Run the attached script.


#3790 Simulation and FMU build using C runtime and MSVC is broken Run-time Future defect 9 years ago

It seems we have a broken MSVC C runtime.

See also: https://www.openmodelica.org/forum/default-topic/1894-fmi-co-simulation-1-0


#3821 FMU generation - dependend dlls FMI Future defect 9 years ago

Currently we put all the dependent dlls in the binary folder but the FMI standard says that it should be only one dlls which has no dependencies. It should be possible to generate this via source code FMUs.


#3823 Store less information in ElementSource Frontend Future defect 9 years ago

We store too much information in ElementSource for components and equations and it takes up a lot of memory. We should be able to disable parts of that depending on a flag.

Partial work has been already done here: https://github.com/OpenModelica/OMCompiler/pull/657


#3849 Wrong constant evaluation of final parameter arrays in the back-end Backend Future defect 9 years ago

I have a non-public wind power model that sends an array of zeros to a function instead the of the correct array. The model works with +d=evalparam which forces the evaluation in the front-end.

I'm opening this bug so we don't forget about it.


#3911 Internal compiler error: Segmentation fault Code Generation Future defect 9 years ago

Below is the text I saw when the compiling failed. This is a fairly large model (took 5 minutes to translate, 3 more to get to this failure point). I cannot provide the model.

WebModel_06inz.c: In function 'WebModel_eqFunction_93667': WebModel_06inz.c:1299806:1: internal compiler error: Segmentation fault

}

libbacktrace could not find executable to open Please submit a full bug report, with preprocessed source if appropriate. See <https://sourceforge.net/projects/msys2> for instructions. <builtin>: recipe for target 'WebModel_06inz.o' failed \tools\msys\mingw64\bin\mingw32-make: * [WebModel_06inz.o] Error 1 Compilation process failed. Exited with code 2.


#3965 Support giving alarm time at the command line for rtest and runtests.pl Testing Framework Future defect 8 years ago

Currently we impose a hardcoded 900 seconds alarm time for tests. To be able to use the same testing framework for big tests this limit should be configurable.


#3976 Setting the locale via scripting does not work Interactive Environment Future defect 8 years ago

Running test.mos:

setCommandLineOptions("+locale=en_US"); getErrorString();
loadModel(Modelica); getErrorString();
getInheritedClasses(Modelica.Mechanics.MultiBody.Visualizers.Advanced.Shape); getErrorString();

on a computer with a Swedish locale gives:

IDA-LIU050+adrpo@ida-liu050 MINGW32 ~/dev/OpenModelica/build/bin
$ ./omc.exe test.mos
true
""
true
""
{ModelicaServices.Animation.Shape,Modelica.Utilities.Internal.PartialModelicaServices.Animation.PartialShape}
"[c:/bin/cygwin/home/adrpo/dev/OpenModelica/build/lib/omlibrary/Modelica 3.2.2/Mechanics/MultiBody/Visualizers.mo:1979:8-1980:83:writable] Error: PartialModelicaServices ▒r partiell, namnuppslagning ▒r inte till▒tet i partiella klasser.
"

Running omc +locale=en_US gives me messages in English.


#4448 ExternData library is not working in OpenModelica Code Generation Future defect 7 years ago

The ExternData library works in Dymola and SimulationX, unfortunately, it is currently not working in OpenModelica. The library developed mentioned this in the documentation and suggest a quick fix (https://github.com/tbeu/ExternData). However, the fix does not work in OpenModelica. (please check this discussion board https://github.com/tbeu/ExternData/issues/9#issuecomment-308656184). By using a stand-alone function as suggested by the library developer-

package Test

extends Modelica.Icons.Package; function OpenModelica_getReal "Get scalar Real value from XML file"

extends Modelica.Icons.Function; input String fileName="" "File where external data is stored"; input String varName "Key"; output Real y "Real value"; protected

ExternData.Types.ExternXMLFile xml = ExternData.Types.ExternXMLFile(fileName) "External XML file object";

algorithm

y := ExternData.Functions.XML.getReal(xml=xml, varName=varName);

annotation(Inline=false);

end OpenModelica_getReal;

model XMLTest "XML file read test"

extends Modelica.Icons.Example; parameter String fileName = Modelica.Utilities.Files.loadResource("modelica://ExternData/Resources/Examples/test.xml"); Real test = OpenModelica_getReal(fileName, "set1.gain.k"); annotation(experiment(StopTime=1));

end XMLTest; annotation(uses(ExternData(version="2.2.0"), Modelica(version="3.2.2")));

end Test;

XML test compiles without any error but when I try to run it gives following errors.

[1] 10:44:56 Translation Notification [ExternData: 512:7-520:18]: Created directory C:\Users\mrn04\AppData\Local\Temp\/omc_compile_ED_XMLFile_422688

[2] 10:44:56 Translation Notification [ExternData: 512:7-520:18]: cp -a "C:/OpenModelica1.12.0-dev-64bit/lib/omlibrary/ExternData 2.2.0/Resources"/* "C:\Users\mrn04\AppData\Local\Temp\/omc_compile_ED_XMLFile_422688"

[3] 10:44:56 Translation Notification [ExternData: 512:7-520:18]: Changed directory to C:/Users/mrn04/AppData/Local/Temp/omc_compile_ED_XMLFile_422688/BuildProjects/autotools

[4] 10:44:56 Scripting Error Error opening file: log: No such file or directory.

[5] 10:44:56 Translation Error [C:/dev/OpenModelica64bit/OMCompiler/Compiler/SimCode/SimCodeFunctionUtil.mo: 742:9-742:129]: Internal error function elaborateFunction failed for function: function ExternData.Functions.XML.getReal"Inline never" "Get scalar Real value from XML file" input String varName "Key"; output Real y "Real value"; input ExternalObject ExternData.Types.ExternXMLFile xml "External XML file object"; external "C" y = ED_getDoubleFromXML(xml, varName); end ExternData.Functions.XML.getReal;

[6] 10:44:56 Translation Error [C:/dev/OpenModelica64bit/OMCompiler/Compiler/SimCode/SimCodeUtil.mo: 603:5-603:83]: Internal error Creation of Modelica functions failed.

Any kind of help on this issue will be very helpful. Thanks.


#4738 Add support for MSVC 64bit FMI Future defect 7 years ago

Currently for MSVC we only compile using the 32bit compiler. We should do that only for 32bit OM and for the 64bit OM we should compile using the 64bit CL compiler.


#5358 Switch windows installer from SVN to GIT Installation program defect 6 years ago

For Windows release use scripts from: https://github.com/OpenModelica/OpenModelicaSetup instead of old SVN: https://openmodelica.org/svn/OpenModelica/installers/windows/OpenModelicaSetup


#5932 DLL needs to be in working directory Run-time defect 5 years ago

I have been working on creating a library for internal use at my company and we need to have some functions written in C/C++ that interface with the Modelica code.

After reading through the language specifications and some examples I was perfectly able to use the method where you just use the Include statement to add a .c file.

However, I had issues getting the exact same file to work when compiled into a .dll. It would compile just fine, but I would get the following error during the simulation step:

Process crashed
Simulation process failed. Exited with code -1073741515.

The .h file is in LibraryName/External/Resources/Include and the .dll is in LibraryName/External/Resources/Library/win64. The code block for the external function is as follows:

  function External_Lib "External function in a library to generate signal"
    input Real t;
    output Real x;
  
    external "C" x = External_Lib(t) annotation(
      LibraryDirectory = "modelica://LibraryName/External/Resources/Library",
      Library = "External_Lib",
      IncludeDirectory = "modelica://LibraryName/External/Resources/Include",
      Include = "#include \"External_Lib.h\"");
  end External_Lib;

After trying many different things I found that it will work if I also put the .dll in the working directory of OMEdit. My guess is that the issue is either that found libraries are not properly added to the PATH, or that the DLL dependencies are not properly being included.


#6161 [FMI] FMU with string parameters will crash if a memory pool collection happens FMI defect 4 years ago

The memory pool frees the string parameters which it shouldn't do. We need a way to alloc and save the string parameters so that we can free them properly, but only when the FMU is terminated.


#6306 OpenModelica fails to build on MacOS Build Environment 1.16.5 defect 4 years ago

This ticket is to document issues on MacOS and try to keep it to build with help from other people.


#3227 Make possible to change the csv file delimiter char and quote char (for input file and output file) Run-time Future enhancement 10 years ago

Currently there seems to be 4 separate implementations for the csv files:

  1. input file externalInput.csv uses space as a delimiter
  2. input file for optimization uses space as a delimiter
  3. writing output results to the csv file is done using delimiter ","
  4. reading results from the results file uses comma as delimiter (libcsv.c)

All these 4 different implementations should be based on libcsv.c which is the most configurable and one should be able to set the csv delimiter char and the quote char from command line.


#3523 Add valFirst and valLast to retrieve the first and last value of a variable at given time Interactive Environment Future enhancement 9 years ago

When we have events we have several values in the result file. We need an API like val but which returns the first value or the last value.


#5751 Add a flag to dump the Flat Modelica to a file during model translation or checking Interactive Environment enhancement 5 years ago

At the moment one needs to call instantiateModel to get the flat Modelica output. A flag to dump the flat Modelica during the model checking or model build for simulation is desirable as the instantiation can take some time for large models so is not preferable to be repeated.

Previous ticket text


I used to generate flat modelica outputs and dae dumps directly form OMEdit by the following compiler flags assigned as "Additional Translation Flags" in the Options Dialog:

-m +d=evalOutputOnly --postOptModules+=dumpDAE

Currently there are no additional files created.

Maybe I'm missing something, but at least it used work.


#4194 Severe bug in unit conversion OMEdit defect 8 years ago

Please consider the following simple example:

model Test
  Modelica.SIunits.AngularAcceleration a=10*exp(-10*time);
  Modelica.SIunits.AngularVelocity w(displayUnit="1/min", start=0, fixed=true);
  Modelica.SIunits.Angle phi(displayUnit="deg", start=0, fixed=true);
equation
  der(w)=a;
  der(phi)=w;
end Test;

The results are horribly wrong! If I remove the "displayUnit", the absolete value of the results is correct, but the sign of phi is the opposite of the obvious solution! I'd prefer OpenModelica for my lectures, but how should I use that for teaching? I'm really upset.


#4356 netCDF reader works on Linux, not on Windows *unknown* Future defect 8 years ago

More or less a copy of this issue: https://github.com/tbeu/netCDF-DataReader/issues/6 Not sure whether this has to be fixed on OM side or in the library, one of the two issues can be closed.

The netCDF library comes with three examples, all three work on Linux, but fail on Windows. Tested with Windows 10 64 bit, OM 1.11 32 bit release and OM 1.12 64 bit nightly.

For the Simple example the error is:

[3] 10:30:07 Fehler
Failed to write to file (not open)

[4] 10:30:07 Übersetzung Fehler
Template error: A template call failed (a call with 0 parameters: dladdr failed: not available on Windows). One possible reason could be that a template imported function call failed (which should not happen for functions called from within template code; templates preserve pure 'match'/non-failing semantics).

For the other two examples, the error is:

NMAKE : fatal error U1077: "cl": R�ckgabe-Code "0x2"
Stop.
Compilation process failed. Exited with code 2.

The full log is pasted here: http://pastebin.com/3k3e7LMB

Side note: There seems to be some encoding wrong with the word R�ckgabe


#2838 ExternalMedia library, OMEdit crash with Test.fluidProp.WaterIF95.TestBasePropertiesDynamic Frontend Future discussion 10 years ago

Hi, I try to work with the ExternalMedia and CoolProp2Modelica-library but I have some trouble. For example, OMEdit crash when i try to simulate ExternalMedia.Test.fluidProp.WaterIF95.TestBasePropertiesDynamic.

Does these libraries really work on OpenModelica?

https://github.com/modelica/ExternalMedia https://github.com/thermocycle/CoolProp2Modelica-library


#5118 OMC should generate debug information and PDB files for debugging with Visual Studio Code Generation Future enhancement 6 years ago

I had several issues with co-simulation FMUs to be run under Vector CANoe. Debugging them was not that easy, because I was not able to use Visual Studio, but had to resort to the gdb binary, which I found in the OpenModelica directory. Even when working with this, I first had to modify the FMU's Makefile to generate debug information. It would be helpful, if there would be a switch to generate debugging information and eventually generating mixed source and (dis)assembler listings. The debug information should also be made available as PDB files. https://github.com/rainers/cv2pdb might be helpful for this.


#2937 Bootstrapped compiler - check for cases that are exactly the same (on some flag) MetaModelica Future enhancement 10 years ago

Seems that (incredibly) we have cases in matchcontinue that are exactly the same (probably some copy paste error). We should probably detect these.


John Tinnerholm (1 match)

#5472 Allow to re-simulate a failed simulation OMEdit enhancement 6 years ago

If a simulation fails, it is not possible to change the solver parameters and re-simulate, one has to recompile the model from scratch every time.

It would be nice if one could re-simulate without re-compiling also in this case.

@adeas31, would this be easy to implement?


Lennart Ochel (20 matches)

#4222 Previously simulating models do not work any more Initialization Future defect 8 years ago

We are currently developing the PhotoVoltaics Modelica library on GitHub. Please consider https://github.com/christiankral/PhotoVoltaics/tree/c79bd0d93cfc9b5b2eae2a6f2ea991d781419195

The model PhotoVoltaics.Examples.SimpleModuleShadow was compiling in a previous model of the OpenModelcia but it does not work any more in the actual Nightly Build

OMEdit 1.12.0~dev-129-g0ee4ed0 Connected to OpenModelica 1.12.0~dev-242-g7d151a2 Linux Mint 18.1

The actual error message after compiling the model is

stdout | OMEditInfo | <p>/tmp/OpenModelica_christian/OMEdit/PhotoVoltaics.Examples.SimpleModuleShadow -port=46358 -logFormat=xmltcp -override=startTime=0,stopTime=1,stepSize=0.001,tolerance=1e-06,solver=dassl,outputFormat=mat,variableFilter=.* -r=PhotoVoltaics.Examples.SimpleModuleShadow_res.mat -jacobian=coloredNumerical -w -lv=LOG_STATS</p>
LOG_NLS | warning | <p>nonlinear system 1329 fails: at t=0</p>
LOG_NLS_V | warning | <p>proper start-values for some of the following iteration variables might help</p>
LOG_NLS_V | warning | <p>[1] Real module.cell[46].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[2] Real module.cell[45].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[3] Real module.cell[44].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[4] Real module.cell[43].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[5] Real module.cell[42].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[6] Real module.cell[41].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[7] Real module.cell[40].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[8] Real module.cell[39].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[9] Real module.cell[38].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[10] Real module.cell[37].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[11] Real module.cell[36].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[12] Real module.cell[35].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[13] Real module.cell[34].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[14] Real module.cell[33].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[15] Real module.diode[3].v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[16] Real module.cell[31].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[17] Real module.cell[30].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[18] Real module.cell[29].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[19] Real module.cell[28].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[20] Real module.cell[27].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[21] Real module.cell[26].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[22] Real module.cell[25].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[23] Real module.cell[24].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[24] Real module.cell[23].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[25] Real module.cell[22].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[26] Real module.cell[21].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[27] Real module.cell[20].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[28] Real module.cell[19].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[29] Real module.cell[18].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[30] Real module.cell[17].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[31] Real module.cell[16].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[32] Real module.cell[15].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[33] Real module.cell[14].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[34] Real module.cell[13].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[35] Real module.cell[12].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[36] Real module.cell[11].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[37] Real module.cell[10].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[38] Real module.cell[9].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[39] Real module.cell[8].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[40] Real module.cell[7].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[41] Real module.cell[6].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[42] Real module.cell[5].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[43] Real module.cell[4].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[44] Real module.cell[3].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[45] Real module.cell[2].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[46] Real module.cell[1].diode.v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[47] Real module.cell[48].v(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[48] Real module.diode[1].i(start=1e-11, nominal=1)</p>
LOG_NLS_V | warning | <p>[49] Real module.cell[1].diode.i(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[50] Real module.cell[37].diode.i(start=0, nominal=1)</p>
LOG_NLS_V | warning | <p>[51] Real module.cell[22].diode.i(start=0, nominal=1)</p>
assert | debug | <p>Solving non-linear system 1329 failed at time=0.<br>
For more information please use -lv LOG_NLS.</p>
assert | info | <p>simulation terminated by an assertion at initialization</p>
stdout | error | <p>Simulation process failed. Exited with code 255.</p>

I tried to propose more "exact" start values to the model, especially for module.cell[#].diode.v(start=0, nominal=1), but this did not help either.


#3792 Variable override not working with restart Run-time Future defect 9 years ago

I tried this on an old version and it used to work, but got broken at some point. I haven't tried it with -overrideFile, but it may have the same issue.

loadString("
model restartOverrideBug
  parameter Real a = 1;
  Real x(start=1);
  Real y;
equation
  y = der(x);
  der(y) = a * x;
end restartOverrideBug;
");
getErrorString();

// Standard run: returns a=1
simulate(restartOverrideBug, simflags="-output a,y");

// Restart without override: returns a=1
simulate(restartOverrideBug, simflags="-r=tmp.mat -iit=1.0 -iif=restartOverrideBug_res.mat -iim=none -output a,y");

// Restart with override gives the same answer: returns a=1 (incorrect)
simulate(restartOverrideBug, simflags="-r=tmp.mat -iit=1.0 -iif=restartOverrideBug_res.mat -iim=none -output a,y -override a=2");

// No restart, but with override: returns a=2 (correct override)
simulate(restartOverrideBug, simflags="-r=tmp.mat -output a,y -override a=2");


#3105 Parameters and variables available in FMI FMI enhancement 10 years ago

Hello,

I would like to create a FMU of a model where parameters and variables don't appear in the text description, or at least where i could chose which ones will appear. I would also like to be able to chose wich parameters will appear in the result file. For instance, in Dymola, user has the possibility to chose to include all variables (or not) during FMU export.

It's critical to for us to hide some parameters when exchanging the models and to provide clear result files with only interesting variables.


#2820 initialization of discrete states Backend Future defect 10 years ago

The initialization problem of the following model is not handled correctly:

model PreMatrix
  Integer x[2,2] = integer(time*fill(1,2,2));
  Integer y[2,2];
algorithm 
  for i in 1:size(x,1),j in 1:size(x,2) loop
    y[i,j] := pre(x[i,j]);
  end for;
end PreMatrix;

The initialization passes without any message, but there should be some warnings about missing fixed start attribute for discrete states:

Warning: Assuming fixed start value for the following 4 variables:
         x[2,2]:DISCRETE(fixed = false ) .PreMatrix, .Integer type: Integer 
         x[2,1]:DISCRETE(fixed = false ) .PreMatrix, .Integer type: Integer 
         x[1,2]:DISCRETE(fixed = false ) .PreMatrix, .Integer type: Integer 
         x[1,1]:DISCRETE(fixed = false ) .PreMatrix, .Integer type: Integer

#3230 Initialization handles when-clauses within algorithms wrong Backend Future defect 10 years ago

See the following example:

model Test
  Real r[2];
algorithm
  r[1] := 2;
  when time > 0.5 then
    r := zeros(2);
  end when;
end Test;

Output:

Notification: The given system is mixed-determined.   [index > 0]
Notification: The given system is mixed-determined.   [index > 1]
Notification: The given system is mixed-determined.   [index > 2]
Notification: The given system is mixed-determined.   [index > 3]
Error: No system for the symbolic initialization was generated.

#3478 Performance issue for Chemical.Examples.AcidBase.AlbuminTitration Backend Future defect 9 years ago

https://test.openmodelica.org/libraries/Chemical_Experimental/BuildModelRecursive.html says that Chemical.Examples.AcidBase.AlbuminTitration takes 5400 seconds for the backend, which is incredibly much. The C-code also does not compile due to going beyond the pre-defined 256 level bracket nesting depth.


#3570 homotopy solution is ignored after initialization Run-time Future defect 9 years ago

The following minimalistic homotopy example should guide x and y explicitly to the converse solutions of a^2-9=0.

model homotopy1
  Real x; // 3
  Real y; // -3
equation
  homotopy(x^2, x) = 9;
   homotopy(y^2, -y) = 9;
end homotopy1;

Initialization determined the expected solution for x and y, however the simulation don't care that the equations are already solved and start to iterating from zero-start value.


#3572 Clarifications in the Compiler Flag Documentation *unknown* defect 9 years ago

The web page https://openmodelica.org/doc/OpenModelicaUsersGuide/latest/omchelptext.html lists all compiler flags, and is automatically generated from omc help info.

The situation has improved dramatically once #2913 was addressed. However, there are four things that still need to be fixed.

  1. The documentation gives -d and --debug as debug flags. However, in the page there are still three references to +d, which are very confusing because it is not clear whether that is a separate flag with different effects or not. Please always use the same notation -d everywhere. You may also mention in the documentation that the +d notation is deprecated but can still be found in existing code
  1. The documentation https://openmodelica.org/doc/OpenModelicaUsersGuide/latest/omchelptext.html#omcflag-debug-section explains how to set up the -d flag. However, there are no examples. I would suggest to add one or two, and at least one where multiple flags are set and some are reset, for better clarity.
  1. The documentation of --preOptModules, --initOptModules and --postOptModules does not contain any example, so it is not clear how one can actually set the options that are listed there. I would suggest to add a couple of examples from which it is clear what the syntax is.
  1. The new flags introduced in https://github.com/OpenModelica/OMCompiler/pull/282 are not documented at all, please add the documentation of --forceRecommendedOrdering and also add the documentation about += and -= to --preOptModules, and --postOptModules. BTW, can this also be used with --initOptModules, or should a special section dedicated to flags used in initOptModules be also introduced in the documentation?

#3810 New runtime flag -overrideSettings Run-time Future defect 9 years ago

The two flags –override and -overrideFile are currently used to override settings and parameters/start values. This lead to conflicts if a variable/parameter has the same name as a setting option. Hence, these flags should only be used to override parameters/start values and a new flag, e.g. –overrideSettings, should be introduced to handle setting overrides.

This would break some existing OpenModelica scripts. How should we deal with backwards compatibility?


#3886 Identically unit information for states and state derivatives Backend Future defect 9 years ago

It is really weird that states and their derivatives have the same unit information in OMEdit/OMPlot. Because time is always in seconds, it should be rather easy to determine state derivative unit information by dividing the state unit information by seconds.


#4412 Error with Protected Elements Backend defect 8 years ago

In the following model

model ProtectedError
  Real var1;
protected
  Real var2 = 1;
equation
  var1 = var2;
end ProtectedError;

should be prevented by the keyword protected that the variable var2 is displayed in the output of OMEdit.

However, both variables var1 and var2 are displayed.


#6336 Error when loading a simple Dymola FMU in an SSP model OMSimulator defect 4 years ago

I try to load a very light and simple Dymola FMU in an SSP model and I get these errors: [4] 11:19:43 Ecriture Erreur [loadSnapshot] loading snapshot failed

[5] 11:21:35 Ecriture Erreur [initializeDependencyGraph_initialUnknowns] tankwin3264: erroneous dependencies detected in modelDescription.xml

[6] 11:21:35 Ecriture Erreur [NewComponent] tankwin3264: Couldn't initialize dependency graph for initial unknowns.

[7] 11:21:35 Ecriture Erreur [loadSnapshot] loading snapshot failed

When doing this a second time, a new error comes like this: [8] 11:26:19 Ecriture Erreur [addSubModel] "tankYPipeDym.Root.tankwin3264" already exists in the scope

Then I save the .ssp file and reopen it with an external browser. The FMU appears. There should not be dependencies troubles in Dymola FMUs. The FMU is attached to this ticket.


#4272 Simulation Process Failed Run-time Future discussion 8 years ago

Hello,

When simulating a model that passed the "Check Model" I received a "Simulation Process Failed. Exited with code 255." error. The model consists of a couple of continuous blocks (pulse train & filter) and then a sampler and digital filter using the Modelica_Synchronous library.

So, I'm wondering if anyone has any idea what might have caused this?


#6344 How to reopen the .csv file of a SSP model run? OMSimulator discussion 4 years ago

This thread of discussion is related to SSP runs (OMSimulator). I'm not able to identify the .csv file containing all variables after the run of s SSP model. I see the results in the viewer but where is the .csv file (name, location) for post-morten visualization?

Second question: is there somewhere some information related to a SSP model run (simulation time, time for FMU loading, etc.)?


#4037 Unification of command line options among multiple runtimes Run-time enhancement 8 years ago

The C runtime has a lot of command line options. The Cpp runtime has less command line options. Typically the names and the syntax are different. C options are long names that start with one dash and lower case character; Cpp options are either long names that start with two dashes or short (one character) that starts with one dash.

Since OpenModelica 1.9.4 the short Cpp options were changed to upper case letters. This way they are unique, because the C runtime uses no upper case letters.

This proposal is that the C runtime introduces short versions of the most important command line options as well. The short versions should be the same among all runtimes, while the long versions may be specific.

The proposed short options are:

-S arg simulation start time
-E arg simulation end time
-H arg simulation step size
-G arg number of intervals in equidistant grid
-I arg integration solver method
-L arg linear solver method
-N arg nonlinear solver method
-C continue if nonlinear solver does not converge
-T arg integration solver tolerance
-V arg log settings (all, events, ls, nls, states, warning, discard, error, fatal, pending -- cf. FMI 2 spec)
-O arg output writing (all, step, none) for all steps and events or only steps or nothing
-P arg simulation results output format (mat or csv)
-A arg abort after arg seconds
-F arg name of results file
-M arg path to Modelica Standard Library
-R arg path to simulation runtime libs

#4301 Feature to break the simulation when the steady state has been reached Backend Future enhancement 8 years ago

Proposed here: http://stackoverflow.com/questions/42673420/global-measure-to-test-when-steady-state-of-system-is-reached

The first point sounds like a good to have feature and doesn't seem that hard to implement, basically a terminate when all the ders are 0 (within an epsilon) for a number of steps.

For the second point we would need a global operator (that returns true when all ders are within an epsilon interval) that one can use in equations to enable / disable parts of the system.


#6354 Result file from OMSimulator contains all lines in double OMSimulator defect 4 years ago

Result file from OMSimulator contains all lines in double. As an example I attach a .csv from a run of a SSP model and each line are doubled. For optimization purpose, a single line should be anough, should'nt it?


#6356 After a SSP model run, the model is taggued as modified and should not OMSimulator defect 4 years ago

I run a SSP model, and after the successful execution, the model is taggued as modified in the browser. This is not undertandable as nothing has been changed in the ssp file due to the run.

Refer to the enclosed video.


#3138 Eliminate missleading warnings concerning [min, max]-asserts Run-time Future enhancement 10 years ago
model testInit
  Real x(start=1.0, fixed=true);
  parameter Real b(min=0.5,fixed=false);
initial equation
  b = 2;
equation
  der(x) = b;
end testInit;

A warning is issued, although the parameter b is initialized in the corresponding [min, max]-interval. Seems that the check is performed too early! Similar warnings are issued throughout most of the Modelica.Fluid.Examples.


#3555 Add option to save intermediate values at event iterations to result files? Run-time Future enhancement 9 years ago

There already exists the option to save values at events. If one has event iterations it also would be interesting to see the values at intermediate events in an event iteration. E.g., the model below starts an event iteration at time > 2 that results in the output

D x: 2
A x: 5
B x: 6

but in the (csv) result file at t=2 there are only two entries (x=2 and x=6).

model WhenPriority
 import S = Modelica.Utilities.Streams;
 Integer x(start=0,fixed=true);
equation
  when pre(x) == 2 then
    S.print("A x: "+String(x));
    x = pre(x) + 3;
  elsewhen pre(x) > 4 then
    S.print("B x: "+String(x));
    x = pre(x) + 1;
  elsewhen pre(x) > 3 then
    S.print("C x: "+String(x));
    x = pre(x) + 2;
  elsewhen time > 2 then
    S.print("D x: "+String(x));
    x = 2;
  end when;
end WhenPriority;

Of course that doesn't improve the insight to the model if plotting the variable with current OMPlot, but "customized" visualization solutions could profit from it and even try to visualize the event order.


Mahder Alemseged Gebremedhin (14 matches)

#6098 (possibly) wrong type mapping for bool in record passed to external object Code Generation 1.19.0 defect 4 years ago

Summary: A boolean in a record, passed to a external object will result in a wrong C struct for the record. Boolean will be translated to "signed char" instead of "int". See https://modelica.org/documents/ModelicaSpec34.pdf#page=169

Given a record

record MyRecord

Real MyReal; Boolean MyBoolean;

end MyRecord;

that will be passed to a function:

function bmaxxAufladung "Aufladung"

output MyRecord mRecord; external "C" externalCFunction(mRecord);

end bmaxxAufladung;

will result in "MyModelName_functions.h" typedef struct {

modelica_real _MyReal; modelica_boolean _MyReal; } ModelName_MyRecord;

modelica_boolean is defined as "typedef signed char modelica_boolean;" in include/omc/c/openmodelica_types.h


#6135 Support of Visual Studio in OMEdit on Windows Run-time 2.0.0 enhancement 4 years ago

The VS compiler is extremely fast, because it is specifically optimized for the Windows/Intel combination. We should enable the possiblity of using it to compile simulation executables, to reduce the lag from the pressing of the simulation button to the start of the actual simulation.

I tentatively assign this to mahge930, since he's already been working with CMAKE and has some experience on this topic.


#5814 for loop in algorithm section gets wrong values Code Generation defect 5 years ago

The following example is a simple demonstration of the bug.

connector AgentInPort
    input Real Temp;
    input Real MassFlow;
end AgentInPort;

connector AgentOutPort
    output Real Temp;
    output Real MassFlow;
end AgentOutPort;


model MyAgentAcc
    parameter Integer nports;
    AgentInPort[nports] In;
    AgentOutPort Out;
    Real sumTemp, sumMassFlow;
    Real mf[nports], te[nports];
algorithm

    for i in 1:nports loop
        te[i] := In[i].Temp;
        sumTemp := sumTemp + In[i].Temp;
        mf[i] := In[i].MassFlow;
        sumMassFlow := sumMassFlow + In[i].MassFlow;
    end for;
equation
    Out.MassFlow = sumMassFlow;
    Out.Temp = sumTemp;
end MyAgentAcc;


model Tester
    MyAgentAcc TestAcc(nports=2);
    AgentOutPort VL1, VL2;
equation
    VL1.Temp = 14;
    VL1.MassFlow = 1;
    VL2.Temp = 28;
    VL2.MassFlow = 2;
    connect(VL1, TestAcc.In[1]);
    connect(VL2, TestAcc.In[2]);
end Tester;

The expected output is: TestAcc.Out.MassFlow = 3 TestAcc.Out.Temp = 42 TestAcc.mf[1] = 1 TestAcc.mf[2] = 2 TestAcc.te[1] = 14 TestAcc.te[2] = 28

But the output is: TestAcc.Out.MassFlow = 15 TestAcc.Out.Temp = 16 TestAcc.mf[1] = 1 TestAcc.mf[2] = 14 TestAcc.te[1] = 14 TestAcc.te[2] = 2

In the for loop i=1 is working as expected, but with i=2 we get wrong values!


#2756 OM reports an error in the C code it creates Code Generation Future defect 10 years ago

If I run (using OM r20199) "gridTest21" of the enclosed package "AutoCreateBug" I get the following message:

"C:\Programmi\OpenModelica1.9.1Nightly\\MinGW\bin\mingw32-make.exe" -f AutoCreateBug.gridTest21.makefile
gcc   -falign-functions -msse2 -mfpmath=sse     -I"C:/Programmi/OpenModelica1.9.1Nightly//include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME  -c -o AutoCreateBug.gridTest21.o AutoCreateBug.gridTest21.c
AutoCreateBug.gridTest21.c: In function 'AutoCreateBug_gridTest21_eqFunction_27':
AutoCreateBug.gridTest21.c:458: error: expected expression before 'modelica_integer'
AutoCreateBug.gridTest21.c:458: error: expected ')' before '$Pi$rB$Pv'
AutoCreateBug.gridTest21.c:460: error: expected expression before 'modelica_integer'
AutoCreateBug.gridTest21.c:460: error: expected ')' before '$Pi$rB$Pv'
mingw32-make: *** [AutoCreateBug.gridTest21.o] Error 1
Compilation process exited with code 2

It seems that OM creates for this model a C file that is invalid.


#3164 Code generation error for tuple calls with array slices Code Generation Future defect 10 years ago

Code generation fails with UNKNOWN_SUBSCRIPT for the following code:

function f
  input Real r;
  output Real y = r;
  output Real o[3] = {r,r,r};
end f;

function g
  input Real r;
  input Integer i;
  output Real o[4];
algorithm
  o[1] := f(r);
  (,o[i:i+2]) := f(r);
  (o[1],o[i:i+2]) := f(r);
end g;

model M
  Real r[4] = g(time,1);
end M;

#3217 Wrong equation counting Code Generation Future defect 10 years ago

OM counts just 2 equations for following model, but it should be 4.

model TestSimpleEqu
 record foo
   Real a;
   Real b;
 end foo;

 function foofoo2
   input foo x[2];
   output foo y[2];
 algorithm
   y[1].a := x[2].b;
   y[1].b := x[2].a;
   y[2].a := x[1].b;
   y[2].b := x[1].a;
 end foofoo2;
 
 foo g1[2];
equation
  //{foo(g1[1].a, g1[1].b), foo(g1[2].a, g1[2].b)} = foofoo2({foo(1.0, 2.0),foo(1.0, 2.0)});
  g1 = foofoo2({foo(1.0, 2.0),foo(1.0, 2.0)});
end TestSimpleEqu;

#3299 Array of records containing array get compilation errors when updated Code Generation Future defect 10 years ago

If putting arrays into records (to get some kind of abstraction), and then putting those records into an array, the generated code will fail to build due to unknown components in array.

loadString("
package ArrayRecordArrayAssign
  record AR
    Integer a[2,3];
  end AR;
  
  function UpdateAR
    input AR ar;
    output AR result;
  algorithm
    result.a := 10*ar.a;
  end UpdateAR;

  function Test
    input Integer n;
    output AR result;
  protected
    AR a;
  algorithm
    for i in 1:n loop
      a := UpdateAR(a);
    end for;
    result := a;
  end Test;

  function Test2
    input Integer n;
    output AR[2] result;
  protected
    AR ara[2];
  algorithm
    for i in 1:n loop
      ara[1] := ara[2];
      ara[2] := UpdateAR(ara[2]);
    end for;
    result := ara;
  end Test2;
end ArrayRecordArrayAssign;
");

// This works fine
x := ArrayRecordArrayAssign.Test(3);

// This gives compilation errors in generated code
y := ArrayRecordArrayAssign.Test2(3);

The assignment to a record works fine, but the assignment to a record within an array will fail.

Error: Error building simulator. Build log: gcc -I"/home/gustaf/src/openmodelica/build/include/omc/c"   -fPIC -O0 -falign-functions -march=native   -c -o ArrayRecordArrayAssign_Test2.o ArrayRecordArrayAssign_Test2.c
ArrayRecordArrayAssign_Test2.c: In function ‘omc_ArrayRecordArrayAssign_Test2’:
ArrayRecordArrayAssign_Test2.c:24:31: error: ‘ArrayRecordArrayAssign_AR_array’ has no member named ‘_a’
   alloc_integer_array(&_result._a, 2, 2, 3);alloc_generic_array(&_result, sizeof(ArrayRecordArrayAssign_AR), 1, (modelica_integer) 2);
                               ^
ArrayRecordArrayAssign_Test2.c:25:28: error: ‘ArrayRecordArrayAssign_AR_array’ has no member named ‘_a’
   alloc_integer_array(&_ara._a, 2, 2, 3);alloc_generic_array(&_ara, sizeof(ArrayRecordArrayAssign_AR), 1, (modelica_integer) 2);
.
.
.

#3495 Issue with array indices in generated code Code Generation Future defect 9 years ago

I get the following output by the simulation of a Petri net model:

C:/Users/TKLEIN~1/AppData/Local/Temp/OpenModelica/OMEdit/PNlib2.Examples.TestWkeit.exe -port=51187 -logFormat=xml -override=startTime=0,stopTime=5,stepSize=0.01,tolerance=1e-6,solver=dassl,outputFormat=mat,variableFilter=.* -r=PNlib2.Examples.TestWkeit_res.mat -dasslJacobian=coloredNumerical -w -lv=LOG_STATS

scalar s->index[0][0] == 2456744 incorrect, a->dim_size[0] == 2

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

Simulation process failed. Exited with code 255.

#4336 Problem with code generation involving arrays of components containing arrays of Real variables Code Generation defect 8 years ago

Please consider the model DEMOSimple.Test.Helium.TestCP from the attached package. The model is accepted by the front-end, and it actually simulates successfully in Dymola.

However, when compiling the C code generating by OMC, the following error message pops up:

DEMOsimple.Test.Helium.TestCP_02nls.c: In function 'residualFunc53':
DEMOsimple.Test.Helium.TestCP_02nls.c:53:3: error: '$OLD_$PheliumCP$PchB$lB2$rB$PTm$lBtmp3$rB' undeclared (first use in this function)
   $OLD_$PheliumCP$PchB$lB2$rB$PTm$lBtmp3$rB = $PheliumCP$PchB$lB2$rB$PTm$lBtmp4$rB;
   ^

The involved variable is an element of a Real array inside an array of models.

Can you please have a look and fix it?


#5886 Use of undeclared identifier and undefined reference to *_array_get function Code Generation defect 5 years ago

The following model (Top in the Bug package) fails compilation. For some reason, if z is 1, omc produces C code including calls to a nonexistent function Bug_Component_array_get. The calls to this function also reference a parameter components which does not exist in the caller's context.

Setting z to anything greater than 1 produces working code, where the Bug_Component_array_get is not declared not used anywhere.


#5906 compilation error for curved bend Code Generation defect 5 years ago

I have build a model containing two boundary condition and two static pipes with one curved bend in between. The model is built without any error (as the number of variables = number of the equations). But during compiling model throws error given below for cured bend in the model.

  • I have attached error in the file and the model is given below.

I appreciate your help regarding solving my problem.

model LBendtest1
replaceable package Medium = Modelica.Media.Water.StandardWater;

  inner Modelica.Fluid.System system(energyDynamics = Modelica.Fluid.Types.Dynamics.FixedInitial)  annotation(
    Placement(visible = true, transformation(origin = {-76, 82}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Fluid.Pipes.StaticPipe pipe(redeclare package Medium = Medium, diameter = 0.02, length = 50, p_a_start = 100000, p_b_start = 100000)  annotation(
    Placement(visible = true, transformation(origin = {-42, -16}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Fluid.Pipes.StaticPipe pipe1(redeclare package Medium = Medium, diameter = 0.02, length = 50, p_a_start = 100000, p_b_start = 100000)  annotation(
    Placement(visible = true, transformation(origin = {42, 42}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Fluid.Sources.MassFlowSource_T boundary(redeclare package Medium = Medium, T = 293.15, m_flow = 0.1, nPorts = 1)  annotation(
    Placement(visible = true, transformation(origin = {-88, -16}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Fluid.Sources.Boundary_pT boundary1(redeclare package Medium = Medium, T = 293.15, nPorts = 1, p = 100000)  annotation(
    Placement(visible = true, transformation(origin = {86, 42}, extent = {{-10, -10}, {10, 10}}, rotation = 180)));

 Modelica.Fluid.Fittings.Bends.CurvedBend curvedBend1(redeclare package Medium = Medium, geometry = Modelica.Fluid.Fittings.BaseClasses.Bends.CurvedBend.Geometry(d_hyd = 0.02, R_0 = 0.6)) annotation(
    Placement(visible = true, transformation(origin = {-2, 18}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
  connect(boundary.ports[1], pipe.port_a) annotation(
    Line(points = {{-78, -16}, {-52, -16}, {-52, -16}, {-52, -16}}, color = {0, 127, 255}));
 connect(pipe1.port_b, boundary1.ports[1]) annotation(
    Line(points = {{52, 42}, {76, 42}}, color = {0, 127, 255}));
 connect(pipe.port_b, curvedBend1.port_a) annotation(
    Line(points = {{-32, -16}, {-32, 18}, {-12, 18}}, color = {0, 127, 255}));
 connect(curvedBend1.port_b, pipe1.port_a) annotation(
    Line(points = {{8, 18}, {17, 18}, {17, 42}, {32, 42}}, color = {0, 127, 255}));
  annotation(
    uses(Modelica(version = "3.2.2")));
end LBendtest1;

#6172 Issue with for loop index variables in conditional expression within algorithm Code Generation defect 4 years ago

Consider the following test model

class matrixAdd
  parameter Real[3,2] m={{1,2},{2,3},{4,5}};
  parameter Real[3,2] a={{2,2},{2,2},{2,2}};
  Real[3,2] b;
  Real max;
algorithm
  max:=0;
  for i in 1:3 loop
    for j in 1:2 loop
      b[i,j]:=m[i,j]+a[i,j];
      if (max<b[i,j]) then
          max:=b[i,j];
      end if;
    end for;
  end for;
end matrixAdd;

It causes the C compilation to break with

matrixAdd_05evt.c: In function 'matrixAdd_function_ZeroCrossings':
matrixAdd_05evt.c:51:161: error: 'i' undeclared (first use in this function)
   tmp0 = LessZC(data->localData[0]->realVars[6] /* max variable */, (&data->localData[0]->realVars[0] /* b[1,1] variable */)[calc_base_index_dims_subs(2, 3, 2, i, ((modelica_integer) 1))], data->simulationInfo->storedRelations[0]);
                                                                                                                                                                 ^
matrixAdd_05evt.c:51:161: note: each undeclared identifier is reported only once for each function it appears in
matrixAdd_05evt.c: In function 'matrixAdd_function_updateRelations':
matrixAdd_05evt.c:78:163: error: 'i' undeclared (first use in this function)
     tmp2 = LessZC(data->localData[0]->realVars[6] /* max variable */, (&data->localData[0]->realVars[0] /* b[1,1] variable */)[calc_base_index_dims_subs(2, 3, 2, i, ((modelica_integer) 1))], data->simulationInfo->storedRelations[0]);

#6352 Function returning record with array fails Code Generation defect 4 years ago

Please consider this test model (also attached)

model TestFunctionRecordArray
  constant Integer c = 3;

  record R
    Real v;
    Real x[c];
  end R;

  function f
    input Real v;
    output R rout;
  algorithm
    rout.v := v;
    rout.x := {0.3, 0.4, 0.3};
  end f;

  Real x;
  R r;
equation
  x = time;
  r = f(x);
end TestFunctionRecordArray;

The model fails during compilation with

TestFunctionRecordArray_functions.c:33:3: error: 
use of undeclared identifier '_rout'
  _rout._x = _OMC_LIT0;
  ^

#2736 Final Constraints for Optimization missing Frontend Future discussion 10 years ago

Currently it's not possible to formulation final constraints in the optimization. In the moment we support path constraints with Otimica Extension.

 Real a,b,c,d,e;
.....
constraint
 a*b + c/d < e

In Optimica it's possible to write for final constraints.

 Real a,b,c,d,e;
.....
constraint
 a(finaTime)*b(finalTime) + c(1.0)*d(finalTime) < b(1.0)

where finalTime is a real parameter 1.0, which is unknown sometimes. Note: stopTime not equal finalTime!

There some issues with different time point and the case if finalTime is unknown.

It seem like the currently way in Modelica is to set marker via (Custom) annotations see e.g. http://www.ep.liu.se/ecp/096/018/ecp14096018.pdf

It's would be nice to have something like

 Real a,b,c,d,e;
.....
constraint
 a*b + c/d < e annotation(finalConstraint = true)

The issue is that a*b + c/d < e is an equation and the annotation going missing in the BackEnd. Alternative it should be possible to write

 Real a,b,c,d,e;
 Boolean f (finalConstraint = true);
.....
  equation
 f = a*b + c/d < e;

However custom annotations not really finished yet! Therefore, I prefer for the first prototype similar implementation like constraint with

 Real a,b,c,d,e;
.....
equation
....
final constraint
 a*b + c/d < e;
constraint
...

Oliver Lenord (1 match)

#4415 package.order file is cleared after duplicate OMEdit Future defect 8 years ago

When using the duplicate class command in a package structure various package.order files are modfied and all content removed.


Per Östlund (4 matches)

#1562 F77 functions sometimes overwrite input arguments Future defect 13 years ago

The model Modelica.Media.Incompressible.Examples.Glycol47 gets erroneous values for the poly_rho and poly_Cp constants, because the input array B to the Lapack function dgelsx is overwritten with the unassigned output argument x. This only happens when code generation is used to generate dgelsx.


#2785 Check of protected variables is not made when using replaceable/redeclare (again) Frontend Future defect 10 years ago

The erroneous model C2 in #1060 currently validates without any warning.

Repeating the code for ease of reference:

class C1
protected 
  replaceable parameter Real r=3.14;
end C1;

model C2
  replaceable parameter C1 x1(redeclare replaceable Integer r=3);
end C2;

(It is not obvious to me that the test flattening/modelica/redeclare/RedeclareVisibility2.mo is actually testing this properly; to me it looks like a flattening test with incorrect expected result, see #2784.)


#2807 Disallow illegal prefixes in records Frontend Future defect 10 years ago

The prefixes input, output, inner, outer, stream and flow are not allowed inside records, but we do not check this currently.


#6213 Lookup in wrong scope when redeclaring function field in a function New Instantiation defect 4 years ago

Modelica_LinearSystems2.Controller.Examples.DiscretizationSeries has some code with the same error as:

record R
  Real x[:];
end R;
function f
  input Integer n;
  output R r(redeclare Real x[n]);
end f;
model M
  Real x[:] = f(3);
end M;

Patrick Täuber (1 match)

#3069 Model needs very long simulation time with Cellier Tearing Backend Future defect 10 years ago

The MSL32 model Modelica.Electrical.Machines.Examples.AsynchronousInductionMachines.AIMC_YD takes over 100 minutes for simulation with Cellier Tearing because of way too much steps:

LOG_STATS         | info    | ### STATISTICS ###
|                 | |       | | timer
|                 | |       | | |    0.0322984s          reading init.xml
|                 | |       | | |     0.003696s          reading info.xml
|                 | |       | | |  0.000564877s          pre-initialization
|                 | |       | | |  0.000243327s [  0.0%] initialization
|                 | |       | | |   5.6153e-05s [  0.0%] steps
|                 | |       | | |    0.0105037s [  0.0%] creating output-file
|                 | |       | | |   0.00208371s [  0.0%] event-handling
|                 | |       | | |    0.0116676s [  0.0%] overhead
|                 | |       | | |      6586.88s [100.0%] simulation
|                 | |       | | |       6586.9s [100.0%] total
|                 | |       | | events
|                 | |       | | |     2 state events
|                 | |       | | |     0 time events
|                 | |       | | solver: DASSL
|                 | |       | | | 15358920 steps taken
|                 | |       | | | 30979010 calls of functionODE
|                 | |       | | | 23021038 evaluations of jacobian
|                 | |       | | |   217 error test failures
|                 | |       | | | 7673606 convergence test failures

With omcTearing:

LOG_STATS         | info    | ### STATISTICS ###
|                 | |       | | timer
|                 | |       | | |     0.031817s          reading init.xml
|                 | |       | | |   0.00360088s          reading info.xml
|                 | |       | | |  0.000564458s          pre-initialization
|                 | |       | | |  0.000215112s [  0.0%] initialization
|                 | |       | | |  0.000122851s [  0.0%] steps
|                 | |       | | |   0.00647291s [  0.7%] creating output-file
|                 | |       | | |   0.00109345s [  0.1%] event-handling
|                 | |       | | |   0.00640162s [  0.7%] overhead
|                 | |       | | |     0.849506s [ 98.3%] simulation
|                 | |       | | |     0.864376s [100.0%] total
|                 | |       | | events
|                 | |       | | |     2 state events
|                 | |       | | |     0 time events
|                 | |       | | solver: DASSL
|                 | |       | | |  8942 steps taken
|                 | |       | | | 12840 calls of functionODE
|                 | |       | | |   595 evaluations of jacobian
|                 | |       | | |   176 error test failures
|                 | |       | | |    83 convergence test failures

Martin Sjölund (8 matches)

#1667 OMEdit does not have an interface to add custom directories for libraries OMEdit defect 13 years ago

The default is given by getModelicaPath(), but a user should be able to set additional directories to search.


#2852 Use the same C-code for identical functions Code Generation Future defect 10 years ago

With calling of functions through components, identical functions are often generated. The C compiler will generate equivalent code for both, which is not desirable. We should figure out which functions are equivalent and replace calls to one with calls to another (or simply alias them via function pointer).

model N
  function f
    input Real r;
    output Real o := r;
  end f;
end N;

model M
  N n1,n2;
  Real r1 = n1.f(time), r2 = n2.f(time);
end M;

A Hash from DAE.Function to Absyn.Path should be sufficient (or String->Path and manually DAEDump the function to speed up any hash conflicts).


#3932 Dump DAE directly to stdout Frontend Future defect 9 years ago

We are able to dump Susan directly to file, so we should also be able to print flat Modelica directly to stdout and avoid using a ton of memory.


#3998 OMC does not search in the correct places for libs under Linux Backend Future defect 8 years ago

When working on Modelica_DeviceDrivers gh#114 I tried to run (on OpenModelica 1.11.0~dev-42-g1a73b84 under Ubuntu 16.04 64bit):

model Try4
  parameter String mem_name = "COM4";
  import Modelica_DeviceDrivers.Communication.SharedMemory;
  import Modelica_DeviceDrivers.Communication.SharedMemory_;
  import Modelica_DeviceDrivers.Packaging.SerialPackager;
  import Modelica_DeviceDrivers.Packaging.SerialPackager_;
protected
  SharedMemory sm = SharedMemory(mem_name, 16 * 1024);
  SerialPackager pkg = SerialPackager();
equation
  SharedMemory_.read(sm, pkg);
  annotation(uses(Modelica_DeviceDrivers(version="1.4.4")));
end Try4;

which compiles fine and even seems to execute but I got a translation warning:

[4] 09:08:37 Translation Warning
[Modelica_DeviceDrivers.Communication.SharedMemory: 17:3-25:17]: 
Could not find library pthread in either of:
  /usr/lib/x86_64-linux-gnu/omc/libpthread.a
  /usr/lib/x86_64-linux-gnu/omc/libpthread.so
  /usr/lib//libpthread.a
  /usr/lib//libpthread.so
 ...

the lib actually resides in:

$ locate libpthread.a
/usr/lib/x86_64-linux-gnu/libpthread.a
/usr/lib32/libpthread.a
/usr/libx32/libpthread.a

Same goes for librt.

So OMC should first search /usr/lib/x86_64-linux-gnu/ then /usr/lib/x86_64-linux-gnu/omc/


#4605 rpath issues in runtime libraries on Ubuntu 17.10 Run-time defect 7 years ago

Tests such as Crane_FMU2_CPP.mos currently fail on Ubuntu 17.10:

messages = "Simulation execution failed for model: cranes_crane_me_FMU
Cannot open library: libomcgc.so.1: cannot open shared object file: No such file or directory
Simulation stopped with error in model factory: Failed loading System library!
/home/marsj/OpenModelica/testsuite/openmodelica/cppruntime/fmu/modelExchange/2.0/OMCppcranes_crane_me_FMU.so

If simCodeTarget is changed to C when compiling the model generated by importFMU, the code works fine. There is something preventing the C++ runtime from working correctly using this code.


#4756 Clock partitioning should be skipped in systems without clock partitions Backend 2.0.0 defect 7 years ago

Please check the execstat log of the DistributionSystemModelicaActiveLoads_N_80_M_80 model. The preOpt clockPartitioning phase takes over 5 seconds and half a gigabye net memory to find out that the system has in fact no clocked partitions at all.

I guess it shouldn't be hard to check from NF data that there are no instances of clocks in the model, so as to skip this phase entirely. Is there any reason not to do that?


#3356 Improve Susan buffers Code Generation Future enhancement 9 years ago

Susan has performance issues with large strings sometimes. I think adding a new language element and changing a few buffers could be a possible solution:

let &buf = buffer ""
to
let &buffer = fileBuffer "someFile" ""

#2456 Change the garbage collector Code Generation Future defect 11 years ago

We need to change our data structures slightly in order to achieve a better performance and perhaps remove the need for boxptr-functions (marshalling, box/unbox).

(16:22:18) Martin Sjölund: I think in general the way we tag pointers is wrong (16:22:32) Martin Sjölund: we should tag integers instead (16:22:33) Adrian Pop: yes, probably tagging pointers is confusing the hell out of GC (16:22:49) Adrian Pop: we could probably not tag anything anymore (16:23:03) Martin Sjölund: maybe (16:23:11) Adrian Pop: as that is needed only for the previous RML gc (16:23:19) Adrian Pop: and have 32 bit integers (16:23:49) Martin Sjölund: !!! (16:23:55) Martin Sjölund: that would be great actually (16:24:19) Martin Sjölund: would probably be a good performance boost, too (16:24:23) Adrian Pop: the only problem i think it might be with debugging (16:24:40) Martin Sjölund: only problem is knowing what is integer and what is not (16:25:15) Martin Sjölund: or we box integers too (16:28:56) Martin Sjölund: I mean... allocating data could be as simple as: void*[2] = {header,double_word}; 64-bit void*[3] = {header,double_word1,double_word2}; 32-bit void*[2] = {header,word}; 32-bit, 64-bit char*[2] = {headerbyte1,headerbyte2,headerbyte3,headerbyte4,char1,...,charn}; 32-bit, 64-bit (16:30:28) Martin Sjölund: since GC is simplified, we need less bits for book-keeping too (16:31:22) Martin Sjölund: could just be a bitset for int|double|enum|string|list|option|record = 3 bits to tag what data it is (16:31:32) Adrian Pop: true (16:32:21) Martin Sjölund: runtime could be quite simple with that (16:32:47) Martin Sjölund: oh, I forgot array as type (of course) (16:33:14) Martin Sjölund: but still 3 bits... and arrays could have 3 bits to say what is stored in it (same 8 types) (16:33:51) Martin Sjölund: and same for lists (16:34:09) Martin Sjölund: lists of unboxed data could be cool (16:35:06) Martin Sjölund: and I guess 28-bit arrays still fine length (16:37:03) Martin Sjölund: and uniontypes with only atomic members (many of them) could be allocated atomic too... (16:37:10) Martin Sjölund: so many things that can be done... (16:37:20) Adrian Pop: :) (16:37:35) Martin Sjölund: do you think we should move in this direction? (16:38:09) Martin Sjölund: before we rely too much on the eclipse debugger :D (16:38:26) Adrian Pop: i think we should not do that yet (16:38:38) Adrian Pop: wait until we move to the bootstrapped compiler (16:38:46) Adrian Pop: and then we can do changes


Willi Braun (1 match)

#2648 wrong simulation results for pulsed voltage source Run-time Future defect 11 years ago

Hi, the model Modelica.Electrical.Spice3.Sources.V_pulse which occurs for example in the Spice3.Inverter model is simulated wrongly.

I put a tiny model in testsuite\simulation\modelica\functions_eval\pulseSource.mos

Actually, there should be 3 voltage pulses during 1e-11 sec simulationtime but the omc outputs a constant voltage of 0.

compareSimulationResults says "Files Equal" which is not true(maybe due to the very short pulses which occure in the tolerance of the event comparison)

In fact, the events for the pulses are triggered correctly somehow because values for the time step back(!) at the points where the pulses should be. So there happens at least something but the time should not move backwards and the voltage should rise to 5V.


1 2
Note: See TracReports for help on using and creating reports.