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

Problem simulating via FMPy #45

Open
kosmylo opened this issue Jun 2, 2021 · 5 comments
Open

Problem simulating via FMPy #45

kosmylo opened this issue Jun 2, 2021 · 5 comments
Assignees
Labels

Comments

@kosmylo
Copy link

kosmylo commented Jun 2, 2021

I have exported the model PhotoVoltaics_TGM.TGM_Comax_Measurement_20160808 as fmu and when I am trying to simulate it in python through FMPy I am getting the following error:

assert | debug | Model error: Argument of sqrt(converter.iAC.re ^ 2.0 + converter.iAC.im ^ 2.0) was nan should be >= 0

Any idea of what is going on?

@christiankral christiankral self-assigned this Jun 26, 2021
@christiankral
Copy link
Owner

Could you possibly add your fmu file (for Linux) so that I can double check it.

@kosmylo
Copy link
Author

kosmylo commented Jul 13, 2021

Here it is:
FMU.zip

Just to mention that if I export it as FMU for ME it simulates fine. The problem appears when I export it as FMU for CS.

@christiankral
Copy link
Owner

christiankral commented Jul 18, 2021

I investigate this issue with the nightly build version OpenModelica 1.19.0~dev-47-gd4b39c9

Case 1

Investigated model: PhotoVoltaics_TGM.TGM_Trina_Measurement_20160808

  • The simulations model simulates directly in OpenModelca
  • Export of PhotoVoltaics_TGM.TGM_Trina_Measurement_20160808 as FMU for ME (model exchange)
    • Simulation of FMU works with OpenModelica (old frontend only)
    • Simulation starts but does not finish (hangs at 1%) with FMPy v0.3.0
    • Simulation does not work with Dymola 2022 for an unknown reason
  • Export of PhotoVoltaics_TGM.TGM_Trina_Measurement_20160808 as FMU for CS (co-simulation)
    • When I import the FMU in OpenModelica I get the following error message: `The FMU version is 2.0 and FMU type is ###
    • CoSimulation. Unsupported FMU type. Only FMI 2.0 ModelExchange is supported.`; so CS is obviously not yet supported in OpenModelica
    • Simulation starts but does not finish (hangs at 1%) with FMPy v0.3.0
    • Simulation causes an error in Dymola 2022
Error: The following error was detected at time: 0
/home/data/work/Resources/Library/FMU/PhotoVoltaics_TGM.TGM_Trina_Measurement_20160808/binaries/linux64/PhotoVoltaics_TGM_TGM_Trina_Measurement_20160808_FMU.libs: invalid ELF header
The stack of functions is:
PhotoVoltaics_TGM_TGM_Trina_Measurement_20160808_fmu.fmi_Functions.fmiModel
PhotoVoltaics_TGM_TGM_Trina_Measurement_20160808_fmu.fmi_Functions.fmiModel("PhotoVoltaics_TGM_TGM_Trina_Measurement_20160808_fmu", photoVoltaics_TGM_TGM_Trina_Measurement_20160808_fmu.fmi_loggingOn, "file:////home/data/work/Resources/Library/FMU/PhotoVoltaics_TGM.TGM_Trina_Measurement_20160808/resources", 0, 1)

Case 1 FMU_linux64.zip

Case 2

Investigated model: PhotoVoltaics_TGM.TGM_Comax_Measurement_20160808

  • The simulations model simulates directly in OpenModelca
  • Export of PhotoVoltaics_TGM.TGM_Comax_Measurement_20160808 as FMU for ME (model exchange)
    • Simulation of FMU works with OpenModelica (old frontend only)
    • Simulation starts but does not finish (hangs at 4%) with FMPy v0.3.0
    • Simulation does not work with Dymola 2022 for an unknown reason
  • Export of PhotoVoltaics_TGM.TGM_Comax_Measurement_20160808 as FMU for CS (co-simulation)
    • Simulation starts but does not finish (hangs at 4%) with FMPy v0.3.0; no error message is issued
    • Simulation in Dymola 2022 causes a similar error message as for Case 1

Case 2 FMU_linux64.zip

@christiankral
Copy link
Owner

So I cannot reproduce the FMPy error message for Case 2 processing the co-simulation FMU. Possible causes are:

  • There may be a difference between the Linux and the Windows FMU
  • You used OpenModelica 1.16.5 for Windows, so the FMU generated by this version may be different than the FMU generated by the actual nightly version of OpenModelica
  • You might use a different version of FMPy @kosmylo could you please comment on the version of FMPy you are using

@kosmylo
Copy link
Author

kosmylo commented Jul 19, 2021

I am getting the same error when I am trying to simulate the CS model at both fmpy 0.2.14 and fmpy 0.3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants