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

FMU Export then Import --- Bug??? (solved)

FMU Export then Import --- Bug??? (solved)

Hi,

I would like to export an easy model (which just multiplies by two for the beginning) as an fmu and then import it. All im OMEdit. The export seems to work, but when I import the model with the gui and drag it into another model as a submodel the parameters of the fmu are not filled.

There are
gain1_k (the parameter of my gain, which I originally set to 2)
flowInstantiate
flowParamsStart

I dont know what to fill in for the flow* parameters so I'm stuck there. I googled them, but I didn't find sufficient anwers. I also don't understand why they aren't filled in the first place, why do I have to do it manually?

Do you have an idea what I do wrong? Is it a bug?

Cheers
T

Edited by: tgraeber - Jul-31-13 11:22:40

Re: FMU Export then Import --- Bug??? (solved)

Hi,

No, it is not a bug and you are not doing anything wrong here.

Your parameter value 2 for gain that you set in your original model will be picked up when you run the simulation. The value is stored in the fmu binary and is only read when you simulate the model. If it is a start value then you should be able to see it right after import.

flowInstantiate, flowParamsStart are used internally so you you don't need to fill a value for them.

Adeel.

Re: FMU Export then Import --- Bug??? (solved)

The problem is that the simulation doesn't work properly. The output of the fmu-model is always zero, even though the original model from which I exported worked. Any idea there?

Re: FMU Export then Import --- Bug??? (solved)

I need more info. Which revision you are using? The sample model etc...

Adeel.

Re: FMU Export then Import --- Bug??? (solved)

OMEdit version r16574

The Model I exported:
model EinfachesModell
  Modelica.Blocks.Interfaces.RealInput u annotation(Placement(visible = true, transformation(origin = {-97.9072,4.18562}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {-97.9072,4.18562}, extent = {{-10,-10},{10,10}}, rotation = 0)));
  Modelica.Blocks.Interfaces.RealOutput y annotation(Placement(visible = true, transformation(origin = {100.455,-4.73157}, extent = {{-10,-10},{10,10}}, rotation = 0), iconTransformation(origin = {100.455,-4.73157}, extent = {{-10,-10},{10,10}}, rotation = 0)));
  Modelica.Blocks.Math.Gain gain1(k = 2) annotation(Placement(visible = true, transformation(origin = {-4.73157,2.00182}, extent = {{-10,-10},{10,10}}, rotation = 0)));
equation
  connect(gain1.y,y) annotation(Line(points = {{6.26843,2.00182},{93.5396,2.00182},{93.5396,-3.63967},{93.5396,-3.63967}}));
  connect(u,gain1.u) annotation(Line(points = {{-97.9072,4.18562},{-18.0164,4.18562},{-18.0164,2.1838},{-18.0164,2.1838}}));
end EinfachesModell;

The model where I compare the original model with the FMU import:
model FMUimport
  Modelica.Blocks.Sources.Clock clock1 annotation(Placement(visible = true, transformation(origin = {-47.8617,17.8344}, extent = {{-10,-10},{10,10}}, rotation = 0)));
  TestFMU_EinfachesModell_me_FMU testfmu_einfachesmodell_me_fmu1 annotation(Placement(visible = true, transformation(origin = {2.76625,-5.80913}, extent = {{-10,-10},{10,10}}, rotation = 0)));
  TestFMU.EinfachesModell einfachesmodell1() annotation(Placement(visible = true, transformation(origin = {6.70445,37.2928}, extent = {{-10,-10},{10,10}}, rotation = 0)));
equation
  connect(clock1.y,einfachesmodell1.u) annotation(Line(points = {{-36.8617,17.8344},{-24.5678,17.8344},{-3.08627,17.6124},{-3.08627,37.7113}}));
  connect(clock1.y,testfmu_einfachesmodell_me_fmu1.u) annotation(Line(points = {{-36.8617,17.8344},{-23.2365,17.8344},{-23.2365,1.1065},{-8.57538,1.1065},{-8.57538,1.1065}}));
end FMUimport;

Re: FMU Export then Import --- Bug??? (solved)

Its a rather old revision. Try the latest the revision 16690.

What is TestFMU.EinfachesModell in your FMU import model?

Which values are you interested in?

Adeel.

Re: FMU Export then Import --- Bug??? (solved)

My structure is:
-----------------------
package TestFMU
     model EinfachesModell (which I exported as FMU)
     model FMUimport (where I want to use the FMU)
end ...

TestFMU_EinfachesModell_me_FMU (the imported FMU file from the work directionary)
-----------------------

I plotted the output values (y) of the submodels in FMUimport. The original model (TestFMU.EinfachesModell) shows the right behaviour, but the output of the FMU (testfmu_einfachesmodell_me_fmu1.y) is zero

And I'll ask our IT to install the new version, I don't have admin rights current/smile Thanks for the tip

T

Re: FMU Export then Import --- Bug??? (solved)

This is what i get with the latets version,

http://www.ida.liu.se/~adeas31/result.png

Adeel.

Re: FMU Export then Import --- Bug??? (solved)

Ok I guess it's the version ... thanks a lot, I'll try with the new one

Cheers

Re: FMU Export then Import --- Bug??? (solved)

version r16690 works fine, thx

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