Ask Your Question

tzarfalcon's profile - activity

2016-11-15 09:00:48 +0200 asked a question TypeError: no canonical coercion from <type 'NoneType'> to Callable function ring with argument N

def eqDtm(eqn, nBelow, nAbove):#eqDtm is shortened for equilibrium determiner. eqn = f(N) if f(nBelow) >0 and f(nAbove) < 0: print "stable" elif f(nBelow) < 0 and f(nAbove) > 0: print "unstable" elif f(nBelow) > 0 and f(nAbove) > 0: print "semistable" elif f(nBelow) < 0 and f(nAbove) < 0: print "semistable" else: print "Not an equilibrium point" ---------- from random import uniform def randomGen(num,num2): uniform(num, num2) ---------- var("r,N,A,K") r= 0.1 A= 5. K= 100 eqn = (rN(1-(N/K))*((N/A)-1)) Eq = [0, 5, 100] for value in Eq: if value == max(Eq): eqDtm(eqn, randomGen(Eq[1],Eq[2]),randomGen(Eq[2],Eq[2]+1)) print "maximum equilibirum point" elif value == min(Eq): eqDtm(eqn, randomGen(Eq[0]-1, Eq[0]),randomGen(Eq[0],Eq[1])) print "minimum equilibirum point" else: eqDtm(eqn, randomGen(Eq[0],Eq[1]),randomGen(Eq[1],Eq[2])) print "neither"


I don't understand the error that's specified in the title. Can anyone explain this?

2016-11-15 09:00:47 +0200 asked a question TypeError: no canonical coercion from <type 'NoneType'> to Callable function ring with argument N

def eqDtm(eqn, nBelow, nAbove):#eqDtm is shortened for equilibrium determiner.
                eqn = f(N)
                if f(nBelow) >0 and f(nAbove) < 0:
                    print "stable"
                elif f(nBelow) < 0 and f(nAbove) > 0:
                    print "unstable"
                elif f(nBelow) > 0 and f(nAbove) > 0:
                    print "semistable"
                elif f(nBelow) < 0 and f(nAbove) < 0:
                    print "semistable"
                else:
                    print "Not an equilibrium point"

from random import uniform
def randomGen(num,num2):
    uniform(num, num2)

var("r,N,A,K")
r= 0.1
A= 5.
K= 100
eqn = (r*N*(1-(N/K))*((N/A)-1))
Eq = [0, 5, 100]
for value in Eq:
    if value == max(Eq):
        eqDtm(eqn, randomGen(Eq[1],Eq[2]),randomGen(Eq[2],Eq[2]+1))
        print "maximum equilibirum point"
    elif value == min(Eq):
        eqDtm(eqn, randomGen(Eq[0]-1, Eq[0]),randomGen(Eq[0],Eq[1]))
        print "minimum equilibirum point"
    else:
        eqDtm(eqn, randomGen(Eq[0],Eq[1]),randomGen(Eq[1],Eq[2]))
        print "neither"

I don't understand the error that's specified in the title. Can anyone explain this? Thank you.

2016-11-15 05:16:18 +0200 received badge  Organizer (source)