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

DimensionMismatch for OpenModelica Modelica.Blocks.Examples.RealNetwork1 2.0.4 FMU #210

Open
AnHeuermann opened this issue Nov 20, 2023 · 0 comments

Comments

@AnHeuermann
Copy link

AnHeuermann commented Nov 20, 2023

Issue

I'm in the process of adding regression tests for OpenModelica via OMJulia.jl using FMI.jl as FMU importing tool, see OpenModelica/OMJulia.jl#111. But FMI.jl is failing to import some of the FMUs.

The FMU is simulating with FMPy and OMSimulator.

How to reproduce

Export FMU with OpenModelica for Modelica model Modelica.Blocks.Examples.RealNetwork1 from the Modelica standard library.

Export FMU:

using OMJulia

omc = OMJulia.OMCSession()
OMJulia.API.loadModel(omc, "Modelica"; priorityVersion = ["4.0.0"], requireExactVersion = true)
fmuPath = OMJulia.API.buildModelFMU(omc, "Modelica.Blocks.Examples.RealNetwork1")
OMJulia.quit(omc)

or download pre-build FMUs (remove .zip from the filename):
Linux Modelica.Blocks.Examples.RealNetwork1.fmu
Windows Modelica.Blocks.Examples.RealNetwork1.fmu

Simulate with FMI.jl:

import FMI

recordValues = ["add.u[1]", "linearDependency1.y", "minMax.u[1]", "minMax.u[2]", "minMax.yMax", "minMax.yMin", "multiSwitch.expr[1]", "multiSwitch.expr[2]", "product.u[1]", "showValue3.number", "multiSwitch.u[1]", "multiSwitch.u[2]", "add.u[2]", "add.y", "integerStep.y", "linearDependency1.u1", "linearDependency1.u2", "multiSwitch.y", "product.y", "showValue.showNumber", "showValue1.showNumber", "showValue3.showNumber", "sine.y", "booleanPulse1.y", "booleanPulse2.y"]
fmu = FMI.fmiLoad(fmuPath)
FMI.fmiSimulate(fmu; recordValues = recordValues, showProgress=false)

Error message

I'm getting different error messages on different platforms, here is the Windows error message:

ERROR: DimensionMismatch: all inputs to eachindex must have the same indices, got Base.OneTo(1), Base.OneTo(1), Base.OneTo(1) and Base.OneTo(0)

Stacktrace:
error.log

Versions 'n stuff

  • OS: Windows 11
  • Julia v1.9.3
  • FMI.jl v0.13.0
  • OMJulia.jl v0.3.0
  • OpenModelica v1.23.0-dev-149-g0b8ad21918-cmake
@AnHeuermann AnHeuermann changed the title AssertionError for OpenModelica Modelica.Blocks.Examples.RealNetwork1 2.0.4 FMU DimensionMismatch for OpenModelica Modelica.Blocks.Examples.RealNetwork1 2.0.4 FMU Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant