Opened 10 years ago

Last modified 8 years ago

#3015 assigned defect

OMEdit Plots are not correct

Reported by: Adam Dershowitz <dersh@…> Owned by: adeas31
Priority: high Milestone: Future
Component: *unknown* Version: trunk
Keywords: Cc: sjoelund.se

Description

It seems that something is strange with plotting data in some cases.
I am running 23640.
To recreate:
Run ThermoPower->Test->TestTurboJetInertia it seems to compile and simulate just fine.
Then, for example, plot Inertia1->w and the vertical scale is just 523 repeated, and the plot shows multiple steps. But, this should show an exponential decay when there is a fuel reduction at 1 sec.
If I do the same thing with release 1.9.1 it does show an exponential decay at 1 sec, although the vertical scale still just shows 523 repeated, so the vertical scale appears to be wrong in 1.9.1 as well.

Attachments (4)

Inertia_plot.png (23.3 KB) - added by dersh 8 years ago.
TestTurboJetInertia_edit_OK.mo (6.3 KB) - added by dersh 8 years ago.
TestTurboJetInertia_edit.mo (5.9 KB) - added by dersh 8 years ago.
SanityCheckFail.mo (6.4 KB) - added by adeas31 8 years ago.

Download all attachments as: .zip

Change History (12)

comment:1 Changed 10 years ago by Adam Dershowitz <dersh@…>

After digging around some, I see that this bug is different then I had thought. And, that there are actually a couple of miner bugs showing up together
1) It seems that there is a bug in the test example. So, the step to change the fuel flow, doesn't actually get used by the fuel source. It seems that the first bug is just that TestTurboJetInertia->SourceW1 should have use_in_w0 set to true.
2) Even in a copy of TestTurboJetInertia, where I can write to it, if I try to change this from true to false using the parameters window, the change doesn't do anything.
But, if I set it to true by editing the text file, then this example works as expected, and the plots do show up.
3) Most of the variables don't change at all, in the default example. So, it is strange that the plot shows changes values in time, but that the y-axis has the same values up and down it. It is also strange that the plot looks so different between the 1.9.1 and 23640. Perhaps they are handling rounding differently, and what is shown is small variations rounding to the same value? It seems to me that plots that have too little variance to be shown should show as a straight line, and not as a strange curve with identical values along the y axis.
So, finally, it seems like there are three different minor issues here.
1) A bug in TestTurboJetInertia. 2) A bug in OMEdit's handling of the setting of boolean variables, that made 1) harder to figure out. 3) and bug in how OMEdit plots variables that have extremely small variance.

comment:2 Changed 10 years ago by lochel

  • Owner changed from somebody to adeas31
  • Status changed from new to assigned

comment:3 Changed 10 years ago by lochel

I also saw issue 3 some time ago. It would be good to change it somehow to make the plot less confusing.

comment:4 Changed 8 years ago by adeas31

Can you check the status of this ticket with latest version? At least issue 2 shouldn't be there any more.

comment:5 Changed 8 years ago by dersh

I just tried it out again with a build I did yesterday (1.10.0~dev-356-g8f3e728_0).
If I just run ThermoPower->Test->GasComponents->TestGasTurbine it does run, but has the bug that I had mentioned before where there is a step input that is not used, since use_in_w0 is set to false, so there is no step change.
2) If a make a copy of this model, so I can edit, then I can use the dialog box to change use_in_w0 to true.
3) If I run it without making this change (so just the default settings, not making the change in 2) I still get a plot that makes little sense. I have attached it.
4) Now, if I do make the change in 2, I get an error:

[1] 10:55:25 Translation Notification
[ThermoPower.Gas: 245:17-246:44]: From here:

[2] 10:55:25 Translation Error
[ThermoPower.Test: 1319:7-1319:180]: component SourceW1 contains the definition of a partial class Medium.
Please redeclare it to any package compatible with Modelica.Media.Interfaces.PartialMedium.

So, it seems that I now can use the dialog box to change that value to true, but that the model no longer runs when it is set to true, as it apparently should be, since there is a step that is otherwise ignored.

So, 2) the ability to change the value to true with a dialog, has been fixed. But, 1) the wrong setting in the example is still there 3) the unclear plot is still there and 4) a new bug shows up in the example, so it will no longer run due to a media issue.

Changed 8 years ago by dersh

comment:6 Changed 8 years ago by dersh

A bit more detail:
4) is actually not a bug in the package, but is a file storage/editing problem. If I edit the file in a text editor, I can get it to run with use_in_w0 not there, set to true or false. But, as soon as I edit that file in OMEdit graphically by using the dialog box, it causes the error that I listed as 4).
So, somehow using the dialog box to change that value is screwing up the formatting of the file. But, editing with the text mode, seems to work OK.

comment:7 Changed 8 years ago by dersh

I have attached two files. TestTurboJetInertia_edit_OK.mo works fine for me. While TestTurboJetInertia_edit.mo is the broken version. If I just open the OK version in OMEdit, and double click on SourceW1 and change use_in_w0 to false (or true) and save, then I see this error:

[21] 12:39:03 Syntax Error
No viable alternative near token: ,

[22] 12:39:03 Translation Error
[/opt/local/var/macports/build/_opt_local_var_macports_sources_build.openmodelica.org_macports_lang_openmodelica-devel/openmodelica-devel/work/openmodelica_1.10.0~dev-356-g8f3e728/OMCompiler/Compiler/Script/CevalScriptBackend.mo: 912:13-912:124]: Internal error Failed to parse merged string (see generated file SanityCheckFail.mo)

and if I try to then run the model I get the error I listed as 4) above. So, editing the file graphically, "breaks" the file.
So, the two versions I have attached should only be different by opening in OMEdit, and making that one change from nothing to false, but this edit makes the whole file not parse properly.

Changed 8 years ago by dersh

Changed 8 years ago by dersh

Changed 8 years ago by adeas31

comment:8 Changed 8 years ago by adeas31

  • Cc sjoelund.se added

Martin the merging is failing. I have attached the SanityCheckFail.mo file.

Note: See TracTickets for help on using tickets.