%   Shape of a Pendant, Axisymmetric Drop
%   Only parameter is the dimensionless radius of curvature at the apex of the drop, B.
%   Dependent variables are the angle of the interface, ang, 
%       dimensionless radius, x, and  dimensionless elevation, z.
%   y=[ang,z,x]
%   Independent variable is the dimensionless arc length from the apex, s.
%   Variables are dimensionless with respect to the characteristic length sqrt(sigma/delta rho g).
%   Computation starts at apex and stop when slope approaches zero.
%   Function drivfun computes the derivatives of the dependent variables.
    clear all
    clf reset
    global B
    B=1  ;
%    B=logspace(-.4,.2,8);
    iang=0;
    iz=0;
    ix=0;
    Vinit=[iang; iz; ix];
    range=[0, 6];
    oldopts=odeset;
%    options=oldopts;
    options=odeset(oldopts,'Events',@events,'RelTol',1.e-5);
    fhandle=@drivfun;
    for ipram=1:length(B)
        [Vs,Vy]=ode15s(fhandle,range,Vinit,options,ipram);
        plot(Vy(:,3),Vy(:,2))
        hold on
    end
    xlabel('Dimensionless Radius')
    ylabel('Dimensionless Elevation')
    title(['B = ',num2str(B)])
    axis equal
    axis([0 3.5 0 3.5])
    save profile.dat Vy -ascii