ModelingToolkit.jl
ModelingToolkit.jl copied to clipboard
_varmap_to_vars can lead to InexactError
The type inference of _varmap_to_vars
depends on the order of variables in the varmap
. If the example_val
happens to be real, but there are also complex values in the varmap
, an InexactError
is thrown. This can happen e.g. when having a complex u
, but passing in real parameters (at least that was my use-case).
using ModelingToolkit
using ModelingToolkit: _varmap_to_vars
@parameters t a b
@variables c(t)::Complex
varmap = Dict(a=>1,b=>1,c=>1im)
varlist = [c]
_varmap_to_vars(varmap, varlist)