import math
import numpy as np
import matplotlib.pyplot as plt
def BREAK(x,volume,spread):
return (math.erf((x/volume-1)/spread)+1)/2
Vc=150 #threshold volume for breakage
x=np.linspace(0,300,100)
y1= [BREAK(u,Vc,0.01) for u in x]
y2= [BREAK(u,Vc,0.1) for u in x]
y3= [BREAK(u,Vc,0.3) for u in x]
y4= [BREAK(u,Vc,1) for u in x]
y5= [BREAK(u,Vc,10) for u in x]
fig = plt.figure()
plt.plot(x,y1,label='0.01')
plt.plot(x,y2,label='0.1')
plt.plot(x,y3,label='0.3')
plt.plot(x,y4,label='1')
plt.plot(x,y5,label='10')
plt.ylabel('breakage probability',size= 18)
plt.xlabel('droplet volume (pL)',size=18)
plt.legend(loc=4,ncol=2,fontsize=12)
#plt.title(r'1M C1, 0.2M C2',size=15)
plt.savefig('Pbreakage.eps',dpi=1000,bbox_inches='tight')
The PostScript backend does not support transparency; partially transparent artists will be rendered opaque. The PostScript backend does not support transparency; partially transparent artists will be rendered opaque.
V0=71
tinc = 60
g005nocomp = 1.5
g02nocomp = 2.4
g005comp = 0.2
g02comp = 2.9
#growth and division of 0.05 M C2 droplets and 0.2 M C2 droplets, without interdroplet competition
V1=V0+g005nocomp*tinc #initial volume * growth rate * incubation time in hours
V2=V0+g02nocomp*tinc #initial volume * growth rate * incubation time in hours
s=np.logspace(-2,2,100)
F1= [BREAK(V1,Vc,u) for u in s]
F2= [BREAK(V2,Vc,u) for u in s]
R=np.subtract(F2,F1)
plt.subplots_adjust(left=None, bottom=None, right=1.9, top=0.8, wspace=0.3, hspace=0.5)
fig = plt.subplot(121)
plt.semilogx(s,F1,label='0.05 C2')
plt.semilogx(s,F2,label='0.2 C2')
plt.ylabel('absolute fitness',size=14)
plt.xlabel('smoothness of the breakage probability function',size=14)
plt.legend(loc=1,ncol=1,fontsize=12)
fig = plt.subplot(122)
plt.semilogx(s,R)
plt.ylabel('relative fitness',size=14)
plt.xlabel('smoothness of the breakage probability function',size=14)
plt.savefig('FitnessWithoutCompetition.eps',dpi=1000,bbox_inches='tight')
The PostScript backend does not support transparency; partially transparent artists will be rendered opaque. The PostScript backend does not support transparency; partially transparent artists will be rendered opaque.
#growth and division of 0.05 M C2 droplets and 0.2 M C2 droplets, without interdroplet competition
V1=V0+g005comp*tinc #initial volume * growth rate * incubation time in hours
V2=V0+g02comp*tinc #initial volume * growth rate * incubation time in hours
s=np.logspace(-2,2,100)
F1= [BREAK(V1,Vc,u) for u in s]
F2= [BREAK(V2,Vc,u) for u in s]
R=np.subtract(F2,F1)
plt.subplots_adjust(left=None, bottom=None, right=1.9, top=0.8, wspace=0.3, hspace=0.5)
fig = plt.subplot(121)
plt.semilogx(s,F1,label='0.05 C2')
plt.semilogx(s,F2,label='0.2 C2')
plt.ylabel('absolute fitness',size=14)
plt.xlabel('smoothness of the breakage probability function',size=14)
plt.legend(loc=1,ncol=1,fontsize=12)
fig = plt.subplot(122)
plt.semilogx(s,R)
plt.ylabel('relative fitness',size=14)
plt.xlabel('smoothness of the breakage probability function',size=14)
plt.savefig('FitnessWithCompetition.eps',dpi=1000,bbox_inches='tight')
The PostScript backend does not support transparency; partially transparent artists will be rendered opaque. The PostScript backend does not support transparency; partially transparent artists will be rendered opaque.