TypeError: cannot determine truth value of Relational when using sympy piecewise
问题 In my researches, I couldn't find any examples related to a relational value in piecewise functions. Although I received the lower and upper values with the uni_dis method, i'm stuck in the process of transferring these values to the piecewise function. What's the reason? from sympy import Symbol, Piecewise import sympy as sym import sympy.plotting as syp import math a = Symbol('a') b = Symbol('b') x = Symbol('x') function = 1 / abs(a-b) def uni_dis(lower, upper): if lower > upper: lower,