I have to define two separate functions z(x, mu, c) and landau(x, A, mu, c). z = (x-mu)/c and landau = 1.64872*A*np.exp(-0.5(z+np.exp(-z)))
As they share variables I have tried to define z inside the definition of landau as a function itself and not as a function. Also, I have tried to define z as a function outside the definition of landau. However, nothing I try seems to work. Either python tells me "'float' object is not callable" or "bad operant type for unary -: 'function'". Is there a quick fix for this?
landau(1,1,1,1) should give an answer that's roughly equal to 1
def landau(x, A, mu, c): # Functie Landau met variabelen x, A, c en mu # A = amplitude # c = schaalparameter # mu = positieparameter def z(x, mu, c): return (x-mu)/c return 1.64872*A*np.exp(-0.5(z(x, mu, c)+np.exp(-z(x, mu, c))))
-0.5and the open parenthesis in-0.5(z...