Have got the following code so far:
class beam(object):
def __init__(self, E, I, L):
self.E = E
self.I = I
self.L = L
The only way that this could happen is if you pass a float
to derivative()
in place of a function:
>>> scipy.misc.derivative(1.0, 1.0)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib64/python2.7/site-packages/scipy/misc/common.py", line 195, in derivative
val += weights[k]*func(x0+(k-ho)*dx,*args)
TypeError: 'float' object is not callable
Are you absolutely sure that your code is as posted? Most likely your code is actually calling self.getTotalDeflection
and therefore passing its return value (a float) to derivative()
, e.g. your code might be:
return scipy.misc.derivative(self.getTotalDeflection(x), x)
or similar, when it should really be as you have posted, i.e.
return scipy.misc.derivative(self.getTotalDeflection, x)