Hi guys,

I try to set up a piecewise function in the following manner:


using SymPy
x, y, z = Sym("x y z") 
k1, k2 = Sym("k_1 k_2")
p = piecewise( (x, x<k1), (y, x<=k2), (z, true))

But I get the following error code:

*`isless` has no method matching isless(::Sym, ::Sym) while loading In[69], in 
expression starting on line 5 *


It is working as soon as I define k1 or k2 explicitly (which I don't want 
to do), e.g.

x, y, z = Sym("x y z") 
k1, k2 = Sym("k_1 k_2")
k1 = 100
p = piecewise( (x, x<k1), (y, x<=k2), (z, true))

Is there any possibility to use the piecewise function without explicitly 
defining the boundary values?

Thanks

Reply via email to