%% polarmod.m calculates the polar H+ and He+ densities using the
%% lastest current model of my choosing.
%% 
%% 8/3/2002 - Assume the polar profile is equal to the midnight Carpenter
%%            and Anderson plasmatrough profile, where dismat/re is used 
%%            instead of L-shell.
%% 

function [hyden,heden]=polarmod(latmatm,dismat,kp)

% latmatm = magnetic latitude of point of interest (rads) (currently included for future expansion)
% dismat = radial distance of point of interest (km).
% kp = Kp magnetic index at point of interest. (currently included for future expansion)
%
% hyden = H+ density at point of interest (m^-3)
% heden = He+ density at point of interest (m^-3)

re=6371;                                                              %Earth radii (km)
edenpol=1e6*5800*(dismat/re).^(-4.5)+(1-exp(-((dismat/re)-2)/10));    %0 MLT plasma trough density (m^-3)
hyden=edenpol/(1+0.1);
heden=0.1*hyden;






