Error while simulating attached FMU on FMI 0.8.6. Code:
julia> include("test.jl")
[ Info: Precompiling FMI [14a09403-18e3-468f-ad8a-74f8dda2d9ac]
[ Info: Precompiling Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80]
[ Info: fmi2Unzip(...): Written file `binaries/win64/Modelica_Electrical_Analog_Examples_SimpleTriacCircuit_FMU.libs`, but file is empty.
[ Info: fmi2Unzip(...): Successfully unzipped 7 files at `C:\Users\RANJAN~1\AppData\Local\Temp\fmijl_Ok1TCj\SimpleTriacCircuit`.
[ Info: fmi2Load(...): FMU resources location is `file:///C:/Users/RANJAN~1/AppData/Local/Temp/fmijl_Ok1TCj/SimpleTriacCircuit/resources`
[ Info: fmi2Load(...): FMU supports both CS and ME, using CS as default if nothing specified.
Simulating ME-FMU ... 0%|█ | ETA: N/Aassert | debug | Solving non-linear system 101 failed at time=3e-05.
| | | | For more information please use -lv LOG_NLS.
assert | debug | Solving non-linear system 101 failed at time=3e-05.
| | | | For more information please use -lv LOG_NLS.
assert | debug | Solving non-linear system 101 failed at time=3e-05.
| | | | For more information please use -lv LOG_NLS.
assert | debug | Solving non-linear system 101 failed at time=3e-05.
| | | | For more information please use -lv LOG_NLS.
ERROR: LoadError: AssertionError: condition(...): Must be called in mode continuous time.
Stacktrace:
[1] condition
@ C:\Users\Ranjan Anantharaman\.julia\packages\FMI\iS1K4\src\FMI2_sim.jl:89 [inlined]
[2] #87
@ C:\Users\Ranjan Anantharaman\.julia\packages\FMI\iS1K4\src\FMI2_sim.jl:739 [inlined]
[3] determine_event_occurance
@ C:\Users\Ranjan Anantharaman\.julia\packages\DiffEqBase\ydAoL\src\callbacks.jl:183 [inlined]
[4] find_callback_time(integrator::Sundials.CVODEIntegrator{Vector{Float64}, Vector{Any}, Sundials.Handle{Sundials.CVODEMem}, ODESolution{Float64, 2, Vector{Vector{Float64}}, Nothing, Nothing, Vector{Float64}, Nothing, ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, Vector{Any}, ODEFunction{true, FMI.var"#84#92"{FMU2Component}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, CVODE_BDF{:Newton, :Dense, Nothing, Nothing}, SciMLBase.HermiteInterpolation{Vector{Float64}, Vector{Vector{Float64}}, Vector{Vector{Float64}}}, DiffEqBase.DEStats}, CVODE_BDF{:Newton, :Dense, Nothing, Nothing}, ODEFunction{true, FMI.var"#84#92"{FMU2Component}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Sundials.FunJac{ODEFunction{true, FMI.var"#84#92"{FMU2Component}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Nothing, Nothing, Vector{Any}, Nothing, Nothing, Vector{Float64}, Nothing, Nothing, Nothing}, Nothing, Sundials.DEOptions{DataStructures.BinaryMinHeap{Any}, DataStructures.BinaryMinHeap{Float64}, Vector{Any}, Vector{Float64}, Nothing, CallbackSet{Tuple{VectorContinuousCallback{FMI.var"#87#95"{Vector{UInt32}, Nothing, FMU2Component}, FMI.var"#88#96"{Vector{UInt32}, Nothing, FMU2Component, FMICore.FMU2Solution}, FMI.var"#88#96"{Vector{UInt32}, Nothing, FMU2Component, FMICore.FMU2Solution}, typeof(SciMLBase.INITIALIZE_DEFAULT), typeof(SciMLBase.FINALIZE_DEFAULT), Float64, Int64, Rational{Int64}, Nothing, Int64}}, Tuple{DiscreteCallback{DiffEqCallbacks.var"#27#28", DiffEqCallbacks.FunctionCallingAffect{FMI.var"#89#97"{Vector{UInt32}, Nothing, FMU2Component, FMICore.FMU2Solution}, DataStructures.BinaryMinHeap{Float64}, Vector{Float64}}, typeof(DiffEqCallbacks.functioncalling_initialize), typeof(SciMLBase.FINALIZE_DEFAULT)}}}, Float64, Float64, typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE)}, Vector{Float64}, Tuple{Int64}, Vector{Float64}, Sundials.LinSolHandle{Sundials.Dense}, Sundials.MatrixHandle{Sundials.DenseMatrix}, DiffEqBase.CallbackCache{Vector{Float64}, Vector{Float64}}}, callback::VectorContinuousCallback{FMI.var"#87#95"{Vector{UInt32}, Nothing, FMU2Component}, FMI.var"#88#96"{Vector{UInt32}, Nothing, FMU2Component, FMICore.FMU2Solution}, FMI.var"#88#96"{Vector{UInt32}, Nothing, FMU2Component, FMICore.FMU2Solution}, typeof(SciMLBase.INITIALIZE_DEFAULT), typeof(SciMLBase.FINALIZE_DEFAULT), Float64, Int64, Rational{Int64}, Nothing, Int64}, counter::Int64)
@ DiffEqBase C:\Users\Ranjan Anantharaman\.julia\packages\DiffEqBase\ydAoL\src\callbacks.jl:455
[5] find_first_continuous_callback
@ C:\Users\Ranjan Anantharaman\.julia\packages\DiffEqBase\ydAoL\src\callbacks.jl:123 [inlined]
[6] handle_callbacks!(integrator::Sundials.CVODEIntegrator{Vector{Float64}, Vector{Any}, Sundials.Handle{Sundials.CVODEMem}, ODESolution{Float64, 2, Vector{Vector{Float64}}, Nothing, Nothing, Vector{Float64}, Nothing, ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, Vector{Any}, ODEFunction{true, FMI.var"#84#92"{FMU2Component}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, CVODE_BDF{:Newton, :Dense, Nothing, Nothing}, SciMLBase.HermiteInterpolation{Vector{Float64}, Vector{Vector{Float64}}, Vector{Vector{Float64}}}, DiffEqBase.DEStats}, CVODE_BDF{:Newton, :Dense, Nothing, Nothing}, ODEFunction{true, FMI.var"#84#92"{FMU2Component}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Sundials.FunJac{ODEFunction{true, FMI.var"#84#92"{FMU2Component}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Nothing, Nothing, Vector{Any}, Nothing, Nothing, Vector{Float64}, Nothing, Nothing, Nothing}, Nothing, Sundials.DEOptions{DataStructures.BinaryMinHeap{Any}, DataStructures.BinaryMinHeap{Float64}, Vector{Any}, Vector{Float64}, Nothing, CallbackSet{Tuple{VectorContinuousCallback{FMI.var"#87#95"{Vector{UInt32}, Nothing, FMU2Component}, FMI.var"#88#96"{Vector{UInt32}, Nothing, FMU2Component, FMICore.FMU2Solution}, FMI.var"#88#96"{Vector{UInt32}, Nothing, FMU2Component, FMICore.FMU2Solution}, typeof(SciMLBase.INITIALIZE_DEFAULT), typeof(SciMLBase.FINALIZE_DEFAULT), Float64, Int64, Rational{Int64}, Nothing, Int64}}, Tuple{DiscreteCallback{DiffEqCallbacks.var"#27#28", DiffEqCallbacks.FunctionCallingAffect{FMI.var"#89#97"{Vector{UInt32}, Nothing, FMU2Component, FMICore.FMU2Solution}, DataStructures.BinaryMinHeap{Float64}, Vector{Float64}}, typeof(DiffEqCallbacks.functioncalling_initialize), typeof(SciMLBase.FINALIZE_DEFAULT)}}}, Float64, Float64, typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE)}, Vector{Float64}, Tuple{Int64}, Vector{Float64}, Sundials.LinSolHandle{Sundials.Dense}, Sundials.MatrixHandle{Sundials.DenseMatrix}, DiffEqBase.CallbackCache{Vector{Float64}, Vector{Float64}}})
@ Sundials C:\Users\Ranjan Anantharaman\.julia\packages\Sundials\k9hc3\src\common_interface\integrator_utils.jl:10
[7] solve!(integrator::Sundials.CVODEIntegrator{Vector{Float64}, Vector{Any}, Sundials.Handle{Sundials.CVODEMem}, ODESolution{Float64, 2, Vector{Vector{Float64}}, Nothing, Nothing, Vector{Float64}, Nothing, ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, Vector{Any}, ODEFunction{true, FMI.var"#84#92"{FMU2Component}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, CVODE_BDF{:Newton, :Dense, Nothing, Nothing}, SciMLBase.HermiteInterpolation{Vector{Float64}, Vector{Vector{Float64}}, Vector{Vector{Float64}}}, DiffEqBase.DEStats}, CVODE_BDF{:Newton, :Dense, Nothing, Nothing}, ODEFunction{true, FMI.var"#84#92"{FMU2Component}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Sundials.FunJac{ODEFunction{true, FMI.var"#84#92"{FMU2Component}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Nothing, Nothing, Vector{Any}, Nothing, Nothing, Vector{Float64}, Nothing, Nothing, Nothing}, Nothing, Sundials.DEOptions{DataStructures.BinaryMinHeap{Any}, DataStructures.BinaryMinHeap{Float64}, Vector{Any}, Vector{Float64}, Nothing, CallbackSet{Tuple{VectorContinuousCallback{FMI.var"#87#95"{Vector{UInt32}, Nothing, FMU2Component}, FMI.var"#88#96"{Vector{UInt32}, Nothing, FMU2Component, FMICore.FMU2Solution}, FMI.var"#88#96"{Vector{UInt32}, Nothing, FMU2Component, FMICore.FMU2Solution}, typeof(SciMLBase.INITIALIZE_DEFAULT), typeof(SciMLBase.FINALIZE_DEFAULT), Float64, Int64, Rational{Int64}, Nothing, Int64}}, Tuple{DiscreteCallback{DiffEqCallbacks.var"#27#28", DiffEqCallbacks.FunctionCallingAffect{FMI.var"#89#97"{Vector{UInt32}, Nothing, FMU2Component, FMICore.FMU2Solution}, DataStructures.BinaryMinHeap{Float64}, Vector{Float64}}, typeof(DiffEqCallbacks.functioncalling_initialize), typeof(SciMLBase.FINALIZE_DEFAULT)}}}, Float64, Float64, typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE)}, Vector{Float64}, Tuple{Int64}, Vector{Float64}, Sundials.LinSolHandle{Sundials.Dense}, Sundials.MatrixHandle{Sundials.DenseMatrix}, DiffEqBase.CallbackCache{Vector{Float64}, Vector{Float64}}}; early_free::Bool, calculate_error::Bool)
@ Sundials C:\Users\Ranjan Anantharaman\.julia\packages\Sundials\k9hc3\src\common_interface\solve.jl:1576
[8] __solve(prob::ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, Vector{Any}, ODEFunction{true, FMI.var"#84#92"{FMU2Component}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, alg::CVODE_BDF{:Newton, :Dense, Nothing, Nothing}, timeseries::Vector{Any}, ts::Vector{Any}, ks::Vector{Any}, recompile::Type{Val{true}}; calculate_error::Bool, kwargs::Base.Pairs{Symbol, Any, NTuple{5, Symbol}, NamedTuple{(:callback, :saveat, :reltol, :dt, :dtmax), Tuple{CallbackSet{Tuple{VectorContinuousCallback{FMI.var"#87#95"{Vector{UInt32}, Nothing, FMU2Component}, FMI.var"#88#96"{Vector{UInt32}, Nothing, FMU2Component, FMICore.FMU2Solution}, FMI.var"#88#96"{Vector{UInt32}, Nothing, FMU2Component, FMICore.FMU2Solution}, typeof(SciMLBase.INITIALIZE_DEFAULT), typeof(SciMLBase.FINALIZE_DEFAULT), Float64, Int64, Rational{Int64}, Nothing, Int64}}, Tuple{DiscreteCallback{DiffEqCallbacks.var"#27#28", DiffEqCallbacks.FunctionCallingAffect{FMI.var"#89#97"{Vector{UInt32}, Nothing, FMU2Component, FMICore.FMU2Solution}, DataStructures.BinaryMinHeap{Float64}, Vector{Float64}}, typeof(DiffEqCallbacks.functioncalling_initialize), typeof(SciMLBase.FINALIZE_DEFAULT)}}}, Vector{Any}, Float64, Float64, Float64}}})
@ Sundials C:\Users\Ranjan Anantharaman\.julia\packages\Sundials\k9hc3\src\common_interface\solve.jl:16
[9] solve_call(_prob::ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, Vector{Any}, ODEFunction{true, FMI.var"#84#92"{FMU2Component}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, args::CVODE_BDF{:Newton, :Dense, Nothing, Nothing}; merge_callbacks::Bool, kwargshandle::KeywordArgError, kwargs::Base.Pairs{Symbol, Any, NTuple{5, Symbol}, NamedTuple{(:callback, :saveat, :reltol, :dt, :dtmax), Tuple{CallbackSet{Tuple{VectorContinuousCallback{FMI.var"#87#95"{Vector{UInt32}, Nothing, FMU2Component}, FMI.var"#88#96"{Vector{UInt32}, Nothing, FMU2Component, FMICore.FMU2Solution}, FMI.var"#88#96"{Vector{UInt32}, Nothing, FMU2Component, FMICore.FMU2Solution}, typeof(SciMLBase.INITIALIZE_DEFAULT), typeof(SciMLBase.FINALIZE_DEFAULT), Float64, Int64, Rational{Int64}, Nothing, Int64}}, Tuple{DiscreteCallback{DiffEqCallbacks.var"#27#28", DiffEqCallbacks.FunctionCallingAffect{FMI.var"#89#97"{Vector{UInt32}, Nothing, FMU2Component, FMICore.FMU2Solution}, DataStructures.BinaryMinHeap{Float64}, Vector{Float64}}, typeof(DiffEqCallbacks.functioncalling_initialize), typeof(SciMLBase.FINALIZE_DEFAULT)}}}, Vector{Any}, Float64, Float64, Float64}}})
@ DiffEqBase C:\Users\Ranjan Anantharaman\.julia\packages\DiffEqBase\ydAoL\src\solve.jl:422
[10] solve_up(prob::ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, Vector{Any}, ODEFunction{true, FMI.var"#84#92"{FMU2Component}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, sensealg::Nothing, u0::Vector{Float64}, p::Vector{Any}, args::CVODE_BDF{:Newton, :Dense, Nothing, Nothing}; kwargs::Base.Pairs{Symbol, Any, NTuple{5, Symbol}, NamedTuple{(:callback, :saveat, :reltol, :dt, :dtmax), Tuple{CallbackSet{Tuple{VectorContinuousCallback{FMI.var"#87#95"{Vector{UInt32}, Nothing, FMU2Component}, FMI.var"#88#96"{Vector{UInt32}, Nothing, FMU2Component, FMICore.FMU2Solution}, FMI.var"#88#96"{Vector{UInt32}, Nothing, FMU2Component, FMICore.FMU2Solution}, typeof(SciMLBase.INITIALIZE_DEFAULT), typeof(SciMLBase.FINALIZE_DEFAULT), Float64, Int64, Rational{Int64}, Nothing, Int64}}, Tuple{DiscreteCallback{DiffEqCallbacks.var"#27#28", DiffEqCallbacks.FunctionCallingAffect{FMI.var"#89#97"{Vector{UInt32}, Nothing, FMU2Component, FMICore.FMU2Solution}, DataStructures.BinaryMinHeap{Float64}, Vector{Float64}}, typeof(DiffEqCallbacks.functioncalling_initialize), typeof(SciMLBase.FINALIZE_DEFAULT)}}}, Vector{Any}, Float64, Float64, Float64}}})
@ DiffEqBase C:\Users\Ranjan Anantharaman\.julia\packages\DiffEqBase\ydAoL\src\solve.jl:719
[11] #solve#29
@ C:\Users\Ranjan Anantharaman\.julia\packages\DiffEqBase\ydAoL\src\solve.jl:704 [inlined]
[12] fmi2SimulateME(fmu::FMU2, c::Nothing, t_start::Nothing, t_stop::Nothing; tolerance::Nothing, dt::Nothing, solver::CVODE_BDF{:Newton, :Dense, Nothing, Nothing}, customFx::Nothing, recordValues::Nothing, saveat::Vector{Any}, x0::Nothing, setup::Nothing, reset::Nothing, instantiate::Nothing, freeInstance::Nothing, terminate::Nothing, inputValueReferences::Nothing, inputFunction::Nothing, parameters::Nothing, dtmax::Nothing, callbacks::Vector{Any}, showProgress::Bool, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ FMI C:\Users\Ranjan Anantharaman\.julia\packages\FMI\iS1K4\src\FMI2_sim.jl:768