Git Product home page Git Product logo

Comments (5)

ThummeTo avatar ThummeTo commented on June 28, 2024

What solver is used? If you don't provide a specific solver, DifferentialEquations is using one based on a heuristic. Can you please check the simulation with a robust solver like e.g. CVODE_BDF from Sundials package? Question is if this is a bug in FMI.jl or if the (automatically determined) solver is not sufficient for the ODE inside the ME FMU.

from fmi.jl.

AnHeuermann avatar AnHeuermann commented on June 28, 2024

That's a good idea.

I changed the solver to CVODE:

using FMI
using DifferentialEquations
using Sundials
fmu = fmiLoad("ScalableTranslationStatistics.Examples.ScaledNLEquations.NLEquations_5.fmu")
simData = fmiSimulate(fmu, (0.0, 10.0); solver=CVODE_BDF, recordValues=["outputs[1]"])

Now the solver seems to be stuck. Even interrupting the Julia process (Ctrl+C) doesn't stop it 😆
I had to kill the process and shell.

I tried explicit Euler as well, but it got stuck as well. I can't see where the program is stuck.

When using OMSimulator the ME FMU simulates in around 15 seconds. It uses CVODE as well.

$ time OMSimulator ScalableTranslationStatistics.Examples.ScaledNLEquations.NLEquations_5.fmu --stopTime=10
info:    maximum step size for 'model.root': 0.001000
info:    Result file: model_res.mat (bufferSize=10)
info:    Final Statistics for 'model.root':
         NumSteps = 1 NumRhsEvals  = 2 NumLinSolvSetups = 1
         NumNonlinSolvIters = 1 NumNonlinSolvConvFails = 0 NumErrTestFails = 0

real    0m15.567s
user    0m15.435s
sys     0m0.121s

@ThummeTo I can send you the Linux FMU if you want to investigate more.

from fmi.jl.

ThummeTo avatar ThummeTo commented on June 28, 2024

you can try showProgress=true (to show a progress bar to see where the solver stucks) and try the max_iters keyword to give a maximum number of solver steps before termination. Using the progress bar you further should be able to kill the solution process, because the background process checks for interrupts every time the progress bar is updated (this is not the default for the Julia REPL, thats why it sometimes freezes during long computations without periodic GUI interrupts).

of course you can also send me the FMU for debugging purpose.

from fmi.jl.

AnHeuermann avatar AnHeuermann commented on June 28, 2024

Well, that did something, but I'll send you the FMU via mail.

julia> simData = fmiSimulate(fmu, (0.0, 10.0); showProgress=true, recordValues=["outputs[1]"])
ERROR: StackOverflowError:
Stacktrace:
 [1] fmi2Simulate(::FMU2, ::Nothing, ::Vararg{Any}; kwargs::Base.Pairs{Symbol, Any, Tuple{Symbol, Symbol}, NamedTuple{(:showProgress, :recordValues), Tuple{Bool, Vector{String}}}}) (repeats 4799 times)
   @ FMI ~/.julia/packages/FMI/C5VcZ/src/FMI2_comp_wraps.jl:17
 [2] #fmiSimulate#158
   @ ~/.julia/packages/FMI/C5VcZ/src/FMI.jl:527 [inlined]
 [3] top-level scope
   @ REPL[4]:1

from fmi.jl.

adribrune avatar adribrune commented on June 28, 2024

i will approach the issue

from fmi.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.