%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                 
% Name: LP_Currf.m                                
% Author: Anders I. Eriksson
%
% Description:                                    
%                                                 
% Calculates the photoelectron current                                                
%                                                 
% Input:                                          
%   vp:  probe potential [V]
%   jf0: [uA/m2]
%   Tf:  [eV] 
%             
% Output:     
%   Photoelectron current [A]          
%             
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function iph = LP_Currf(vp,jf0,Tf)

global IN;

if0 = jf0 * pi * IN.probe_radius^2;  

pind = find(vp>0);

iph = -if0*ones(size(vp));

iph(pind) = -if0*(1+vp(pind)/Tf).*exp(-vp(pind)/Tf);
