%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                                                
% Name: LP_SetupPlasma.m                                                         
% Author: Reine Gill  
% Modified by: Kristoffer Hultgren
%
% Description:                                                                   
%         Set up assumptions and empty place holders for plasma parameters.                                                                       
%
% Input:
%         dist: Heliocentric distance (AU)
%         ni:   Proton density
%         nhi:  Heavy ion density
%
% Output:                                                                        
%         P:    Plasma structure, with plasma information                                                                               
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function P=LP_SetupPlasma(dist,ni,nhi,Te,Ti,vi,vhi)

% Plasma Structure
P=[];

% Plasma Parameters
P.Tf  = 1.5;               % Temperature of photo electrons

if nhi == 0
    P.nsp = 1;             % Number of ion species
else
    P.nsp = 2;             
end

P.Zi = [1 1];              % Ion charges
P.mi = [1 18];             % Approximate ion masses H+ H2O+
P.jf0 = 40e-6*1/(dist^2);  % Photo saturation current [A/m^2]
P.v = [vi vhi];            % Spacecraft ram speed [km/s]
P.dn = 0;                  % dn/n noise [%]

P.ni = [ni nhi];           % Ion densities [H+ H2O+] (cm-3)

P.ne = ni + nhi;           %Electron density
P.Te = Te;                 %Electron temperature
P.Ti = [Ti Ti];            %Ion temperature

P.meff = 1/(sum(P.ni./(P.ne.*P.mi)));   % Effective mass;

