function [new_oxy,Soc,Boc,tcor,wt,pcor,p1,p2,tau]=...
        oxy_fit_poly2_beckman(curr,oxy_temp,OXSAT,temp,press,sta,bot_oxy,docdt,...
        Soc,Boc,tcor,pcor,wt,p1,p2,tau);
%OXY_FIT_POLY2_BECKMAN - oxygen coeffs from volt and botOx (2-d poly fit)

% 
%	$Revision: 1.3 $
%	$Date: 2008/04/09 14:31:39 $
%	$Id: oxy_fit_poly2_beckman.m,v 1.3 2008/04/09 14:31:39 duncombe Exp duncombe $
% 

x=[curr OXSAT temp press docdt oxy_temp sta];
beta(1,1)=Soc;
beta(1,2)=Boc;
beta(1,3)=wt;
beta(1,4)=tcor;
beta(1,5)=pcor;
beta(1,6)=p1;
beta(1,7)=p2;
beta(1,8)=tau;
beta0=non_lin_fit(x,bot_oxy,'oxygen_fit_poly2_beckman',beta);
Soc=beta0(1);
Boc=beta0(2);
wt=beta0(3);
tcor=beta0(4);
pcor=beta0(5);
p1=beta0(6);
p2=beta0(7);
tau=beta0(8);

new_oxy=((Soc.*(curr+(tau.*docdt)))+Boc+(p1.*sta+p2.*sta.^2)).* ...
	exp(tcor.*(temp+(wt*(oxy_temp-temp)))).*OXSAT.*exp(pcor.*press);

return;

