function [new_oxy,Soc,Voffset,Boc,tcor,pcor,p1,tau]=...
    oxy_fit_linearp(volt,OXSAT,temp,press,sta,bot_oxy, ...
	Soc,Voffset,Boc,tcor,pcor,p1,tau);
%OXY_FIT_LINEARP - oxygen coeffs from volt and botOx (linear and press trend)

% $Revision: 1.4 $
% $Date: 2008/01/19 13:52:11 $
% $Id: oxy_fit_linearp.m,v 1.4 2008/01/19 13:52:11 duncombe Exp duncombe $

x=[volt OXSAT temp press sta];
beta(1,1)=Soc;
beta(1,2)=Voffset;
beta(1,3)=Boc;
beta(1,4)=tcor;
beta(1,5)=pcor;
beta(1,6)=p1;
beta(1,7)=tau;
beta0=non_lin_fit(x,bot_oxy,'oxygen_fit_linearp',beta);
Soc=beta0(1);
Voffset=beta0(2);
Boc=beta0(3);
tcor=beta0(4);
pcor=beta0(5);
p1=beta0(6);
tau=beta0(7);
new_oxy=((Soc.*(volt+Voffset))+(Boc.*exp(-0.03.*temp))+(p1.*sta)+(tau*press)).*exp(tcor.*temp).*OXSAT.*exp(pcor.*press);
return;

