Symbolics: ERROR: TypeError: non-boolean (Num) used in boolean context

So what should one do if you want to evaluate a function symbolically and there may be things like boolean switches in it? Is there such a thing as switchable symbolic equations?

I had some functions like that may include a simple little boolean switch like below to limit an input. Wondering if there is julia magic that eventually would end up splitting up the boolean logic into different conditional functions. That would be cool. Having not done much with Symbolic’s in any language… I don’t know if this is a crazy question.

xminmax(x,xmin,xmax) = x > xmax ? xmax : ( x < xmin ? xmin : x ) # Check the min max and clip it

Is there a more Symbolic friendly way to do this?

Use IfElse.ifelse until we make the symbolic parsing use SymbolicTracing.jl

1 Like

Well that is interesting. Cool.