Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Real value inputs and the compliance checker #32

Closed
daviddecobee opened this issue Aug 7, 2020 · 7 comments
Closed

Real value inputs and the compliance checker #32

daviddecobee opened this issue Aug 7, 2020 · 7 comments
Labels
bug Something isn't working

Comments

@daviddecobee
Copy link

Thanks for contributing this tool, it's really made my entry into the world of building an FMU straight forward.

I've run across a problem using Real's as input into my FMU and I'm not sure where the issue lies. I'm using the compliance checker 2.0.4 and when I turn on the -f flag I see that my first Real input on a given line of the input file is copied to all real variables. If I convert the model to use integers for the same field I don't see the problem. It's easy to suspect the problem lies with the compliance checker but I thought I'd ask here before posting there.

To be clear, here is what I see. Take a model with inputs A, B, C all reals and using the compliance checker with an input similar to:

"time","A","B","C"
0,1.0,2.0,3.0

The output file will show:

"time","A","B","C"
0,1.0,1.0,1.0

Print statements in my FMU confirm what I see in the output file. Again, if I use integers no issue, it really feels like a problem with the compliance checker but any insight you can provide is much appreciated.

@ghorwin ghorwin added the bug Something isn't working label Aug 8, 2020
@ghorwin
Copy link
Owner

ghorwin commented Aug 8, 2020

Hi, looks like this could be a bug. I'll check the generated code to make sure (though this will take a few days). Thanks for pointing this out.

@ghorwin
Copy link
Owner

ghorwin commented Aug 8, 2020

Tested it with:

  • three real input variables, all with automatically given variable id number (-1)
  • code looks ok

Now I suspect an error in the compliance checker.. I'll try with the newest version.

@ghorwin
Copy link
Owner

ghorwin commented Aug 8, 2020

Strange, in my test, everything checks out ok. Here's my input again:

test.zip

Command line for testing:

./fmuCheck.linux64 -f -i input.tsv -o output.tsv ../RealInputTest/build/RealInputTest.fmu

Seems to work.

@ghorwin ghorwin closed this as completed Aug 8, 2020
@daviddecobee
Copy link
Author

Your example was just what I needed to find the key issue. If I change the real inputs to variability "discrete" instead of continuous I am able to "break" the example you've provided.

I'm not sure I understand the difference between the "discrete" and "continuous" variability. It's quite possible I should not be using "discrete".

@daviddecobee
Copy link
Author

@ghorwin , I'm realizing now that I definitely do not want continuous for my model, when I run it through the checker it does a linear interpolation. I definitely want the step inputs provided by the "discrete" variability.

Also I should state that I'm using co-simulation not model exchange.

@ghorwin ghorwin reopened this Aug 13, 2020
@ghorwin
Copy link
Owner

ghorwin commented Aug 13, 2020

If I understand correctly, the problem arises when an FMU generated with the code generator is processed by the compliance checker.
The information whether values change continuously or discretely should not have any effect on the FMU behavior - only on how a master handles the variables. Thus, I feel there is nothing that can be improved in the code generator, right?

Please close the ticket if this is resolved (and possible post a bug ticket for the compliance checker).

@daviddecobee
Copy link
Author

Agreed I've raised the issue there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants