Closed johhell closed 2 years ago
when using a Bool type parameter with the latest version of Modia, an error message is issues. was working ~ 1 week ago.
Bool
Modia
BoolPara.zip
Btest = Model( BoolPARA = true, equations = :[ der(y) = x x = sin(time) z = if BoolPARA; y; else; 0.0; end; ], )
ERROR: LoadError: TypeError: non-boolean (Float64) used in boolean context Stacktrace: [1] getDerivatives(_x::Vector{Float64}, _m::SimulationModel{Float64, Float64}, _time::Float64) @ Main ~/.julia/packages/Modia/XUrJM/src/CodeGeneration.jl:1673 [2] #invokelatest#2 ...
Parameter of type Bool is now converted to Float64
Float64
... z = if (Float64)(_p[:BoolPARA])::Float64 y else 0.0 end ...
latest versions of Modia, ModiaBase
Fixed in release v0.8.3
description
when using a
Bool
type parameter with the latest version ofModia
, an error message is issues. was working ~ 1 week ago.testcase
BoolPara.zip
error message
function getDerivatives
Parameter of type
Bool
is now converted toFloat64
used versions
latest versions of Modia, ModiaBase