
%Model G=sigma*(4L/(pi*d^2) + K* (1/d))^-1
%calculates G(open pore) vs delta G blockage for various values of pore
%diameter d

dopen=2.2:0.001:20; %open pore diameter / nm
sigma=10; % electrolyte conductivity S/m
dDNA=2.2; %DNA diameter
db=((dopen.^2)-(dDNA^2));
dblocked=db.^0.5;  %blocked pore diameter
L=1; %membrane thickness / nm
A=4*L./(pi*(dopen.^2));

K=1; %prefactor related to geometry and probably pore surface charge 
B=K./dopen;
Gopen=sigma*(A+K./dopen).^(-1);
C=4*L./(pi*(dblocked.^2));
Gblocked1=sigma*(C+K./dblocked).^(-1);

dSiN=70; %open pore diameter/ nm

dbS=((dSiN.^2)-(dDNA^2));
dblockedS=dbS.^0.5;  %blocked pore diameter
LS=20; %membrane thickness / nm
V=4*LS./(pi*(dSiN.^2));
 
W=K./dSiN;
GS=sigma*(V+K./dSiN).^(-1);
U=4*LS./(pi*(dblockedS.^2));

Gblocked2=sigma*(U+K./dblockedS).^(-1);

Gtot=(GS*Gopen)./(GS+Gopen);
%DGtot= DeltaG+DeltaGS;
%DGtot= (DeltaG*DeltaGS)./(DeltaG+DeltaGS);
Gbltot= (Gblocked1*Gblocked2)./(Gblocked1+Gblocked2);
DGtot=Gtot-Gbltot;
DGT=DGtot./Gtot;

%figure 
plot(Gtot, DGT)
hold on

ylabel('deltaG / nS');
xlabel('G / nS');

