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

Exported FMU returns wrong results

Exported FMU returns wrong results

Hello,

I'm testing a simulation tool for FMI Models. I created multiple Models via OpenModelica to test basic functionality.
Somehow the exported FMU returns invalid results

The Model calculates the sum and product of the current time.

Code:


model OpenModelica_Simple_Add_Mult_Auto
  output Real sum(start = 0);
  output Real prod(start = 0);
algorithm
  sum:=time + time;
  prod:=time * time;
end OpenModelica_Simple_Add_Mult_Auto;

The Results (FMU exported by OpenModelica, version 1.8.1 r11643 AND 1.9.0 r12942)

Code:


Step 0000: sum: 0.000000; prod: 0.000000
Step 0001: sum: 0.000000; prod: 0.000000
Step 0002: sum: 0.000000; prod: 0.000000
Step 0003: sum: 0.020000; prod: 0.000100
Step 0004: sum: 0.040000; prod: 0.000400
Step 0005: sum: 0.060000; prod: 0.000900
Step 0006: sum: 0.080000; prod: 0.001600
Step 0007: sum: 0.100000; prod: 0.002500
Step 0008: sum: 0.120000; prod: 0.003600
Step 0009: sum: 0.140000; prod: 0.004900
Step 0010: sum: 0.160000; prod: 0.006400

The results using Dymola 2013 to export

Code:


Step 0000: sum: 0.000000; prod: 0.000000
Step 0001: sum: 0.020000; prod: 0.000100
Step 0002: sum: 0.040000; prod: 0.000400
Step 0003: sum: 0.060000; prod: 0.000900
Step 0004: sum: 0.080000; prod: 0.001600
Step 0005: sum: 0.100000; prod: 0.002500
Step 0006: sum: 0.120000; prod: 0.003600
Step 0007: sum: 0.140000; prod: 0.004900
Step 0008: sum: 0.160000; prod: 0.006400
Step 0009: sum: 0.180000; prod: 0.008100
Step 0010: sum: 0.200000; prod: 0.010000

The results using OpenModelica somehow lags behind.

Does anyone have the same problem?

Re: Exported FMU returns wrong results

Is this really an error?

Counting the number of evaluations of the system, which you seem to be doing, is not they way to extract your data from the FMU. You'd rather want to match the time series with the variable time.

For more complex FMUs you'll notice that Dymola also will evaluate the system at "intermediate" steps.

/patrik

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