function Ptot = Model_AB(params, constants )
%KD1 Simple A<->B equilibrium equation
%   This function returns the total C(P)  of the simple equilibrium
% 
% Cp=[PL]+[P]
% CL=[PL]+[L]
% 
% [PL]=CL-[L]
% [P]=Cp-[PL]=Cp-CL-[L]
% 
% Kd=[p][L]/[PL]
% 

%--- this is what I need for K-matrix
Leq=params(1);


%-- these are constants for each titration point
Kd=constants(1);
Ltot=constants(2);



%-- equations
PLeq=Ltot-Leq;
Peq= Kd.*PLeq./Leq;

Ptot = PLeq + Peq;



