I am trying to formulate te the following functions in python and I want to plot them
import matplotlib.pyplot as plt
import numpy as np
ss = np.linspace(300, 1000, 15)
def PT3000(ss):
if ss < 318.842719019854:
PT3 = 4.602 + 37440.0/ss
else :
PT3 =-0.3 + 3600.0/ss
return PT3
def PT2000(ss):
if ss < 318.842719019854:
PT2 = 4.602 + 37440.0/ss
elif ss > 945.33959:
PT2 =-0.3 + 3600.0/ss
else:
PT2 = 6.87109574235995e-6*ss**0.5*(-1 + 96000.0/ss) + 62.144
return PT2
fig= plt.figure()
plt.plot(ss,PT2000(ss))
plt.plot(ss,PT3000(ss))
plt.title('Productietijd [24x12]')
plt.xlabel('Verstijverafstand [mm]')
plt.ylabel('Productijd van een paneel [uur]')
plt.grid(visible=True)
plt.legend()
plt.show()
I run into an error but I don't understand what to do with it
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()