-
Notifications
You must be signed in to change notification settings - Fork 3
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
FMU tool-wrapper and FMU source-code generate different simulations in INTO-CPS #73
Comments
Just an update about this issue: Looking at csv file generated by the simulation, it seems that (maybe) the issue is from the COE: The first value of each row represents the current time-step for a simulation with step-size equal to 0.01. |
Hi @tfabbri , thank you for all the information, I'll take a look at it soon. |
Hi @bandurvp , I've done some tests and one of the issue is generated during the computation of -
into |
Hi @tfabbri , nice detective work, thank you for looking into it. Floating point always underflows like this, and the problem is especially bad on embedded MCUs, especially 8-bit ones... How about some sort of rounding function that can be called instead of the |
Hi @tfabbri , I was actually going to implement a threshold-based addition and difference mechanism, so if you want to look into this maybe this is a good avenue to try. I decided not to do it in the initial implementation because the formulas were getting very awkward to write in single lines. The idea is something like |
Just documenting ideas, a good threshold value might be a fraction of the step size, something like |
…tions calculations. - Addresses #73.
Hi @tfabbri , I have just pushed a fix that takes care of the kink in the graph generated by the source code FMU, but the problem now is that the slope of the line is too high, please see below. I'll work on this further. |
Hi @tfabbri , I noticed another thing that i wanted to confirm with you whether it is a difference between the two FMU types. Does the tool-wrapper look like the following between 0 and 1? |
… equal with threshold epsilon. - Addresses #73.
Hi @tfabbri , I'm going to re-design |
Hi @bandurvp, I did not have the opportunity to look at the code of your solution, but from the output generated it seems that it is not behaving as discrete time system. The output of each FMU is a function of the input at the previous tstep (roughly speaking, there must be a delay of a tstep). Written in a mathematical form (where x is the internal state of the fmu, u is the input and y is the output) :
I do not know where to put those steps, but I think you have to do something like:
Does it make sense? |
Hi @tfabbri , that seems about right. From your description and from the tool-wrapper graph you provided, it seems that the correct value for |
I'm testing the simulation in INTO-CPS of a system composed of two systems connected.
The output generated by the simulation of the system using the FMUs exported with tool-wrapper and source-code are different as depicted below in these images.
The fist image refers FMUs with tool-wrapper (with the overture interpreter operating with it) and the second image refers to the FMUs with generated source code. In the first 2 seconds of simulation the behavior is different.
The text was updated successfully, but these errors were encountered: