You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are a collection of these type branches in my model (including nested). In MATLAB, the solver is able to handle this, but MTK currently cannot and modelingtoolkitize will fail.
I started working on a macro but I didn't know how to handle the original case all that well. It handles the very most basic case but nothing more.
function_toifelse(ex::Expr)
args =map(_toifelse, ex.args)
ex.head ==:if?Expr(:call, :ifelse, args...) :Expr(ex.head, args...)
end_toifelse(x) = x
macroifelse(ex)
_toifelse(ex)
end