Asexual_Discrete_Replicator.py
def func(x, t, a2,b2,theta):
    """
    Discrete replicator dynamics
    x: array of the frequency of the three strategy
    t: time
    a2, b2, theta: defined in function Matrix
    Note the background fitness = 0 here
    """
    #x is array and A is matrix
    A=Matrix(a2,b2,theta)
    phi=np.dot(x,A)
    phi=np.dot(phi,x.T)#mean fitness in the population
    #calculate replicator dynamics
    f0=np.dot(A[0,:],x.T)/phi
    f1=np.dot(A[1,:],x.T)/phi
    f2=np.dot(A[2,:],x.T)/phi     
    f=np.array([x[0]*f0,x[1]*f1,x[2]*f2])
    return(f)

    Discrete replicator dynamics
    x: array of the frequency of the three strategy
    t: time
    a2, b2, theta: defined in function Matrix
    Note the background fitness = 0 here
    
Discrete replicator dynamics
x: array of the frequency of the three strategy
t: time
a2, b2, theta: defined in function Matrix
Note the background fitness = 0 here
Discrete replicator dynamics x : array of the frequency of the three strategy t : time a2 b2 theta : defined in function Matrix Note the background fitness = 0 here
def func(x, t, a2,b2,theta):
    A=Matrix(a2,b2,theta)
    phi=np.dot(x,A)
    phi=np.dot(phi,x.T)
    f0=np.dot(A[0,:],x.T)/phi
    f1=np.dot(A[1,:],x.T)/phi
    f2=np.dot(A[2,:],x.T)/phi     
    f=np.array([x[0]*f0,x[1]*f1,x[2]*f2])
    return(f)
def func ( x , t , a2 , b2 , theta ) : A = Matrix ( a2 , b2 , theta ) phi = np . dot ( x , A ) phi = np . dot ( phi , x . T ) f0 = np . dot ( A [ 0 , : ] , x . T ) / phi f1 = np . dot ( A [ 1 , : ] , x . T ) / phi f2 = np . dot ( A [ 2 , : ] , x . T ) / phi f = np . array ( [ x [ 0 ] * f0 , x [ 1 ] * f1 , x [ 2 ] * f2 ] ) return ( f )
Discrete replicator dynamics
x: array of the frequency of the three strategy
t: time
a2, b2, theta: defined in function Matrix
Note the background fitness = 0 here
Discrete replicator dynamics x : array of the frequency of the three strategy t : time a2 b2 theta : defined in function Matrix Note the background fitness = 0 here
"""
    Discrete replicator dynamics
    x: array of the frequency of the three strategy
    t: time
    a2, b2, theta: defined in function Matrix
    Note the background fitness = 0 here
    """ #x is array and A is matrix #mean fitness in the population #calculate replicator dynamics
x
t
a2
b2
theta