I wrote code that returns this in the console:
The truth value of an array with more than one element is ambiguous. Use a.any() or a.all().
This is my code.
import numpy as np
import matplotlib.pyplot as plt
lambd= np.linspace(0.0,15000.0, 100) #lambda in angstroms
alpha0=1.0449*10.0**(-26.0) #For lambda in angstroms
R=1.0968*10.0**(-3.0) #angstroms^-1
def g_bf(lambd,n):
return 1.0-((0.3456/(lambd*R)**(1./3.))*((lambd*R / (n**2.0))- (0.5)))
def alpha_bf(lambd,n):
lamb_0=912.0 #angstroms
if lambd >= lamb_0:
return 0.0
else:
return alpha0*g_bf(lambd,n)*((lambd**3.0)/(n**5.0))
a_bf= alpha_bf(lambd,1.0)
plt.plot(lambd, a_bf)
What do I have to do?