I have the following code:
def tau_r(u):
return (u_1 < u < u_2) * (T1 - T2) + T2
if __name__ == "__main__":
figure()
plot(u, tau_r(u))
show()
I get the following error when I run it:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
I suppose it's because it is seeing u as a list while it should perform the task on each element of the list separately. How can I fix this?