function chi=expfit(x0,concentration,year);
% cost function for input to fminsearch
% determines the difference between an exponential approximation and 
% measured data (`concentration'), given parameters x0(1), x0(2), x0(3)

chi=sum((x0(1)*ones(size(year)) + x0(2).*exp((year-1900)/x0(3))-concentration).^2);
end
