modelica-tools / FMUComplianceChecker

FMI Compliance Checker for validation of FMUs 1.0 and 2.0
BSD 3-Clause "New" or "Revised" License
43 stars 31 forks source link

Simulation both for ME and CS #13

Open modelica-trac-importer opened 6 years ago

modelica-trac-importer commented 6 years ago

Reported by andreas.pfeiffer on 30 Jan 2015 07:27 UTC If an FMU contains both ME and CS models, then the FMU compliance checker simulates ME and CS, but there is only one result file. Please could you clarify?

Would it be possible to add an option to specify if the simulation for ME or CS or both should be run?


Migrated-From: https://trac.fmi-standard.org/ticket/315

modelica-trac-importer commented 6 years ago

Comment by andreas.junghanns on 30 Jan 2015 07:31 UTC Run fmuCheck.PLATFORM.exe without arguments and a help screen dumps:

...
-k xml           Check XML only.
-k me            Check XML and ME simulation.
-k cs            Check XML and CS simulation.
                 Multiple -k options add up.
                 No -k option: test XML, simulate ME and CS respectively if supported.
...

That should help. If you don't see this, you are running an old checker, this is a recent addition.

modelica-trac-importer commented 6 years ago

Comment by andreas.pfeiffer on 30 Jan 2015 07:38 UTC Thanks for the hint. Sorry, I have overlooked this option.

But when simulating both ME and CS (this is the default) there is only one result file and it is unclear what the meaning is of it.

If I do the following for an FMU 2.0 containing ME and CS:

D:\FMUChecker-2.0.2b1-win32>fmuCheck.win32.exe -o out.csv -s 1e-7 -h 1e-8 Modelica_Electrical_Analog_Examples_Rectifier.fmu
D:\FMUChecker-2.0.2b1-win32>fmuCheck.win32.exe -k me -o out_me.csv -s 1e-7 -h 1e-8 Modelica_Electrical_Analog_Examples_Rectifier.fmu

then I get the following files:

out.csv:

"time","uDC","iAC[1]","iAC[2]","iAC[3]" ...
0,5.6568542494923804E+002,-0.0000000000
1e-008,5.6568509105021928E+002,1.387778
2e-008,5.6568475715120087E+002,1.710066
3e-008,5.6568442325218280E+002,4.987693
4e-008,5.6568408935316506E+002,9.702251
5e-008,5.6568375545414767E+002,1.573399
6e-008,5.6568342155513062E+002,2.297316
7e-008,5.6568308765611391E+002,3.131913
9e-008,5.6568241985808140E+002,5.097022
1e-007,5.6568208595906560E+002,6.211330
1e-007,5.6568208595906560E+002,6.211330
1e-007,5.6568208595906697E+002,2.330492

csv_me.out:

"time","uDC","iAC[1]","iAC[2]","iAC[3]" ...
0,5.6568542494923804E+002,-0.0000000000
1e-008,5.6568509105021928E+002,1.387778
2e-008,5.6568475715120087E+002,1.710066
3e-008,5.6568442325218280E+002,4.987693
4e-008,5.6568408935316506E+002,9.702251
5e-008,5.6568375545414767E+002,1.573399
6e-008,5.6568342155513062E+002,2.297316
7e-008,5.6568308765611391E+002,3.131913
9e-008,5.6568241985808140E+002,5.097022
1e-007,5.6568208595906560E+002,6.211330
1e-007,5.6568208595906560E+002,6.211330

The only difference is the added last line in out.csv.

Is this a bug and would it make sense to generate two files (e.g. *_me.csv and *_cs.csv)?

modelica-trac-importer commented 6 years ago

Modified by andreas.pfeiffer on 30 Jan 2015 08:17 UTC

modelica-trac-importer commented 6 years ago

Modified by andreas.pfeiffer on 30 Jan 2015 08:56 UTC

modelica-trac-importer commented 6 years ago

Comment by andreas.junghanns on 12 Nov 2015 12:48 UTC This is no major issue as the user has good control over which variant (ME or CS) is run and thus ends up in the file.

Proposal: will not fix -- Andreas Pfeiffer - are you ok with that?

modelica-trac-importer commented 6 years ago

Comment by andreas.pfeiffer on 16 Nov 2015 09:04 UTC I am ok, if only one result file is generated under the assumption that it is clear what this result file represents, but currently there is something going wrong. I try to explain it in more detail.

If I do the following for an FMU 2.0 containing both ME and CS:

D:\FMUChecker-2.0.2b1-win32>fmuCheck.win32.exe -o out.csv -s 1e-7 -h 1e-8 Modelica_Electrical_Analog_Examples_Rectifier.fmu
D:\FMUChecker-2.0.2b1-win32>fmuCheck.win32.exe -k me -o out_me.csv -s 1e-7 -h 1e-8 Modelica_Electrical_Analog_Examples_Rectifier.fmu
D:\FMUChecker-2.0.2b1-win32>fmuCheck.win32.exe -k cs -o out_cs.csv -s 1e-7 -h 1e-8 Modelica_Electrical_Analog_Examples_Rectifier.fmu

then I get the following files:

out.csv:

"time","uDC","iAC[1]","iAC[2]","iAC[3]" ...
0,5.6568542494923804E+002,-0.0000000000
1e-008,5.6568509105021928E+002,1.387778
2e-008,5.6568475715120087E+002,1.710066
3e-008,5.6568442325218280E+002,4.987693
4e-008,5.6568408935316506E+002,9.702251
5e-008,5.6568375545414767E+002,1.573399
6e-008,5.6568342155513062E+002,2.297316
7e-008,5.6568308765611391E+002,3.131913
9e-008,5.6568241985808140E+002,5.097022
1e-007,5.6568208595906560E+002,6.211330
1e-007,5.6568208595906560E+002,6.211330
1e-007,5.6568208595906697E+002,2.330492

csv_me.out:

"time","uDC","iAC[1]","iAC[2]","iAC[3]" ...
0,5.6568542494923804E+002,-0.0000000000
1e-008,5.6568509105021928E+002,1.387778
2e-008,5.6568475715120087E+002,1.710066
3e-008,5.6568442325218280E+002,4.987693
4e-008,5.6568408935316506E+002,9.702251
5e-008,5.6568375545414767E+002,1.573399
6e-008,5.6568342155513062E+002,2.297316
7e-008,5.6568308765611391E+002,3.131913
9e-008,5.6568241985808140E+002,5.097022
1e-007,5.6568208595906560E+002,6.211330
1e-007,5.6568208595906560E+002,6.211330

csv_cs.out:

"time","uDC","iAC[1]","iAC[2]","iAC[3]"
0,5.6568542494923804E+002,-0.0000000000
1e-008,5.6568509105021928E+002,-1.43523
2e-008,5.6568475715120110E+002,4.932922
3e-008,5.6568442325218325E+002,2.546945
4e-008,5.6568408935316552E+002,6.758146
5e-008,5.6568375545414835E+002,9.960004
6e-008,5.6568342155513142E+002,1.150945
7e-008,5.6568308765611482E+002,1.547199
9e-008,5.6568241985808265E+002,2.255509
1e-007,5.6568208595906697E+002,2.330492

We see three files with different contents - especially compare the results for time=1e-007. It seems, that the file out.csv has the same content as out_me.csv, but there is the last line of out_cs.csv added in out.csv.

There is no documentation, that this is intended, therefore I guess it is a bug that should be corrected. Also, I tested the procedure with another FMU - same issue.