%% kp2e0.m estimates the polarcap potential (E0) using the previous 3-hourly Kp.
%% The function used was derived from fits to kp vs E0 data provided by Mike
%% Liemohn. See Liemohn directory and datfit4.m. 
%%
%% Note - currently using coefficents which excludes storm 2 (June 1991) from 
%%        fitting. 

function e0=kp2e0(kp)

% kp = Kp from previous 3-houlry interval.
% e0 = polarcap potential (mV/m) 

%Fitted coefficents from datfit4.m (with storm 2 removed - 10/1/2003)
c=[1.318e-003 -4.589e-003 6.139e-002 8.418e-002];

%Estimate required E0
e0=polyval(c,kp);