function [BufferCa0, BufferCa2, Calcium, R] = Get_ApproximantByName_ZeroRestingCa(Method, lambda2, nu2, eps, gamma, lineType)

% Compute an approximation for concentrations of
%        Ca2+ and 2:1 buffer near a point channel / source
%        Case of zero background / resting [Ca2+] at infinity
%
% Input variables: 
%  (1)   Method string: {'PadeA', 'PadeB', 'PadeExp', 'ExpPadeA', 'ExpPadeB', 'ExpExp'}
%  (2-5) Dimensional parameters: lambda2, nu2, eps, gamma
%  (7)   lineType: MATLAB plot linetype string, e.g. 'b--'
%
% Return arrays: BufferCa0 = [Free buffer]        vs. distance from channel 
%                BufferCa2 = [Fully bound buffer] vs. distance from channel 
%                Calcium   = [Ca2+]               vs. distance from channel
%                R         = Array of distances from channel see Eq. 28)
%
%        Victor Matveev and Yinbo Chen (NJIT) March 2021
%  (GPL) Free to use, share, modify, with appropriate attribution
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

R = logspace(-3, 2, 100);  % Array of distances from the Ca2+ channel

lambda1   = lambda2 * gamma;
q         = 1 / (1 + eps*nu2);

A         = q * eps + sqrt( (q*eps)^2 + q*lambda1 );
BufferCa0 = 1 - 2 * eps * q * ( 1 - exp(-R / A) ) ./ R;   

[BCa0_RBA, BCa2_RBA, Ca_RBA] = Get_RBA_AnyRestingCa(nu2, eps, gamma, 0, '');

switch Method    %  Compute Bound Buffer Variable b** = v = eps^2*V
    
    case {'RBA', 1}
        
    	BufferCa0 = BCa0_RBA;
		BufferCa2 = BCa2_RBA; 
    
    case {'ExpPadeA', 2}

        b1 = 2*q*(1 - q + eps*(2*q - 1));
        b2 = A*q*(1 + sqrt(1 + 16*lambda2*b1 / (q*A) )) / 4;
        BufferCa2 = eps * q^2 ./ (R.^2 + b1*R + b2);
        
    case {'ExpExp', 4}
       
        Y = 1 / (4*lambda2);
        E = Y^3 - 6*Y/(A*q);
        G = ((E^2 - Y^6)^(1/2) - E)^(1/3);
        s = real( G + Y^2/G - Y );  % Get rid of machine error imaginary part
        BufferCa2 = eps * q^2* (1 - exp(-s*R) .* (1 + s*R)) ./ R.^2;
        
    case {'ExpPadeB', 3}
        
        Y = ( 5*A +   lambda2*(3 - 2*q) ) / 18; 
        X  = A^2 *(q - 1 + 12*lambda2/q) / 24;
        W  = A^2 * (1 - 2*lambda2) / 12 ;
        F  = Y^2 - 2/3 * W;
        E  = Y^3 - W*Y + lambda2 * X;
        G  = (E + sqrt(E^2 - F^3))^(1/3);
        b2 =  q * real(G + F/G + Y);  % Get rid of machine error imaginary part
        b1 = b2 * (b2/(q*A) - 0.5) / lambda2;
        BufferCa2 = eps * q^2 ./ (R.^2 + b1*R + b2);
        
      otherwise
            disp([Method, 'Is an unknown method.']);
            return;
end

BufferCa1 = 1 - BufferCa2 - BufferCa0;
Calcium   = 1./R - nu2*(BufferCa1 + 2*BufferCa2)/2;

IND = (Calcium < Ca_RBA);
if numel(IND)
    Calcium(IND) = Ca_RBA(IND);
end

if ~isempty(lineType)
    
    subplot(411); hold on;
    set(gca, 'fontsize', 14);
    title(['[Free buffer] b (\lambda_2=', num2str(lambda2), ' \nu_2=', num2str(nu2), ' \epsilon=', num2str(eps), ' \gamma=', num2str(gamma), ')']);
    plot(R, BufferCa0, lineType, 'linewidth', 2);
    set(gca, 'xscale', 'log');
    xlabel('r'); ylabel('b');
    axis tight;

    subplot(412); hold on;
    set(gca, 'fontsize', 14);
    title(['[Single-bound buffer] b*']);
    plot(R, BufferCa1, lineType, 'linewidth', 2);
    set(gca, 'xscale', 'log');
    xlabel('r'); ylabel('b*');
    axis tight;
    
    subplot(413); hold on;
    set(gca, 'fontsize', 14);
    title(['[Fully-bound buffer] b**']);
    plot(R, BufferCa2, lineType, 'linewidth', 2);
    set(gca, 'xscale', 'log');
    xlabel('r'); ylabel('b**');
    axis tight;
    
    subplot(414); hold on;
    set(gca, 'fontsize', 14);
    title(['[Ca2+] Calcium']);
    plot(R, Calcium, lineType, 'linewidth', 2);
    set(gca, 'xscale', 'log', 'yscale', 'log');
    xlabel('r'); ylabel('Calcium');
    axis tight;
end