Appendix B
Simulation tool listing
B1. mainsurf.m file
clear all;close all;
R=0.513; %sphere radius [mm] mg=0.02; % sphere weight [mN]
%picking phase
alpha=14*pi/180; %[rad] %contact angles beta=30*pi/180;
gamma=.020; %[N/m] %surface tension of the picking liquid (oil) thetaEnd=(pi/2)-alpha; %the geometry is not defined with larger angles H=[0.00001:.01:.15]; %picking meniscus height range
sprintf('NB:le lunghezze sono in [mm], i volumi in [mm^3] e le forze in [mN] \n') sprintf('-PETROLIO-')
fprintf('alpha=%g beta=%g gamma=%g \n', alpha, beta, gamma); fprintf('---')
VolP=[.00001:0.005:0.065]; % picking meniscus volume range for j=1:length(VolP)
for i=1:length(H) Voldato=VolP(j); h=H(i);
[ra,xa,Ra,Vol,theta]=geom(alpha,beta,h,thetaEnd,R); %possible geometries [radato,FC]=forz(ra,xa,Ra,Vol,theta,Voldato,gamma,alpha); %geometry and force
%corresponding to Voldato value acca(i,j)=h; Volij(i,j)=Voldato; FCij(i,j)=abs(FC); if (abs(FC))>mg F(i,j)=abs(FC);
hpick(j)=H(i); %picking height else
F(i,j)=0; end end end
figure(1); %plot of the picking force xlabel('Alt.Menisco')
ylabel('Vol.Goccia') zlabel('F_Capillare')
surf(acca,Volij,FCij),xlabel('Alt.Menisco'),ylabel('Vol.Goccia'),zlabel('F Capillare'),grid on hpick %prints the picking height varying volume
Fpick2=max(F); %f1(h=0) if Fpick2= =0 sprintf('unpickable') return end fprintf('F_pick2=%g \n', Fpick2);
%here the previous commands are repeated to generate plot 2 clear H VolP Voldato h acca Volij FCij F hpick
H=[0.00001:.001:.03];%altezza menisco picking VolP=[.00001:0.0005:0.006]; for j=1:length(VolP) for i=1:length(H) Voldato=VolP(j); h=H(i); [ra,xa,Ra,Vol,theta]=geom(alpha,beta,h,thetaEnd,R); [radato,FC]=forz(ra,xa,Ra,Vol,theta,Voldato,gamma,alpha); acca(i,j)=h; Volij(i,j)=Voldato; FCij(i,j)=abs(FC); if (abs(FC))>mg F(i,j)=abs(FC); hpick(j)=H(i); else F(i,j)=0; end end end
figure(2); %plot of the picking force for small values of height and volume of the meniscus xlabel('Alt.Menisco')
ylabel('Vol.Goccia') zlabel('F_Capillare')
surf(acca,Volij,FCij),xlabel('Alt.Menisco'),ylabel('Vol.Goccia'),zlabel('F Capillare'),grid on
%releasing phase clear Vol2 beta2 q H2;
beta2=55*pi/180; sprintf('-ACQUA-')
fprintf('alpha=%g beta=%g gamma=%g \n', alpha2, beta2, gamma2); fprintf('---')
for k=1:length(Fpick2)
VolP2=[.00001:0.0025:0.05]; %releasing meniscus volume range FCij2=NaN(40,length(VolP2));
%calculus of the releasing drop height
q=VolP2*(3/pi)*((1-cos(beta2))/(2+cos(beta2))); H2=nthroot(q,3); % releasing drop height for j=1:length(VolP2)
H=[0.00001:.005:H2(j)]; % releasing meniscus height range for i=1:length(H) Voldato=VolP2(j); h=H(i); [ra,xa,Ra,Vol,theta]=geom(alpha,beta,h,thetaEnd,R); [radato,FC]=forz(ra,xa,Ra,Vol,theta,Voldato,gamma,alpha); acca2(i,j)=h; Volij2(i,j)=Voldato; FCij2(i,j)=abs(FC); if ((abs(FC))+mg)>Fpick2(k) Fr(i,j)=abs(FC);
hrel(k,j)=H(i); %releasing height else
Fr(i,j)=0; end end end
figure(3); %plot of the releasing force
surf(acca2,Volij2,FCij2),title('F Releasing'),xlabel('Alt.Menisco'),ylabel('Vol.Goccia'),zlabel('F Capillare'),grid on
figure(4); %plot of constant force curves contour3(acca2,Volij2,FCij2,10);
surface(acca2,Volij2,FCij2,'EdgeColor',[.8 .8 .8],'FaceColor','none') grid off
view(0,90) colormap cool
figure(5); %plot of constant force curves [c,p]=contour(acca2,Volij2,FCij2,10);
text_handle = clabel(c,p);
figure(6); %plot of constant force curves [c,p]=contour(acca2,Volij2,FCij2,10);
surface(acca2,Volij2,FCij2,'EdgeColor',[.8 .8 .8],'FaceColor','none') text_handle = clabel(c,p);
set(text_handle,'BackgroundColor',[1 1 .6],'Edgecolor',[.7 .7 .7]) figure(7); %plot of constant force curves
[c,p]=contour3(acca2,Volij2,FCij2,10); surface(acca2,Volij2,FCij2,'EdgeColor',[.8 .8 .8],'FaceColor','none') text_handle = clabel(c,p); set(text_handle,'BackgroundColor',[1 1 .6],'Edgecolor',[.7 .7 .7]) grid off view(0,90) colormap cool end for n=1:length(Fpick2)
fprintf('Forza picking=%g \n',Fpick2(n));
fprintf('h_releasing=%g \n',hrel(n,1:8)); %prints the releasing height varying f1(h=0) and
end %the releasing volume
B2. geom.m file
function [ra,xa,Ra,Vol,theta]=geom(alpha,beta,h,thetaEnd,R) %this routine calculates the geometry of the meniscus fixed h
%calculus of the minimum theta in order not to have degenerate meniscus thetaa=[.0000001:.001:thetaEnd]; for i=[1:length(thetaa)] A = [ sin(beta)-sin(thetaa(i)+alpha) 1 ; cos(beta)+cos(thetaa(i)+alpha) 0 ]; b = [ R*sin(thetaa(i)) ; h + R-R*cos(thetaa(i)) ]; res = A^-1 * b; ra(i) = res(1)*(1-sin(beta)); xa(i) = res(2); end [v,imin]=min (abs(ra-xa)); if (ra(imin)-xa(imin))>0 imin=imin+1; end thetamin=thetaa(imin);
clear theta ra xa;
theta=[thetamin:.001:thetaEnd]; %theta range %calculus of the parameters ra,xa and Ra
ra = [h+R-(R*cos(theta))]./[cos(theta+alpha)+cos(beta)]; xa = [R*sin(theta)]-[ra.*(sin(beta)-sin(theta+alpha))]; Ra = R*sin(theta);%raggio impronta sulla pallina
%calculus of the meniscus volume varying theta and fixed h %calculus of the rotation solid (refer to Appendix A)
epsilon=(pi-(alpha+theta+beta)); gam=(epsilon/2)+beta;
rG1=(ra*2/3).*((epsilon-((sin(epsilon)).*cos(epsilon)))./(epsilon-sin(epsilon))); xG1=xa+(ra*sin(beta))-(rG1.*sin(gam));
area1=(epsilon.*(ra.^2)/2)-((ra.^2).*(sin(epsilon))/2); Vol1=2*pi*xG1.*(area1); %Gouldino theorem %calculus of the frustum of cone
VolTC=(pi/3)*[h+(R*(1-cos(theta)))].*[(xa.^2)+((R*sin(theta)).^2)+(xa.*(R*sin(theta)))]; %calculus of the spherical cap
VolCS=(pi/3)*[(R*(1-cos(theta))).^2].*[(3*R)-(R*(1-cos(theta)))]; Vol=VolTC-VolCS-Vol1; %meniscus volume
B3. forz.m file
function [radato,FC]=forz(ra,xa,Ra,Vol,theta,Voldato,gamma,alpha)
%this routine calculates of the geometry of the meniscus and of the force fixed the volume Voldato %and the height h
xi = Voldato;
radato = interp1(Vol,ra,xi); %value of ra fixed the volume Voldato and the height h xadato = interp1(Vol,xa,xi % “ “ xa “ “ “ “ “ “ “ “ Radato = interp1(Vol,Ra,xi); % “ “ Ra “ “ “ “ “ “ “ “ thetadato = interp1(Vol,theta,xi); % “ “ theta “ “ “ “ “ “ “ “ curv = ((1/Radato)-(1/radato))/2; %mean surface curvature
FL = 2*gamma*curv*pi*((Radato)^2); %[mN]%Laplace force FT = -2*pi*gamma*Radato*sin(alpha+thetadato); %[mN] %tension force