
function diff = diodecomp_test(params,V,I)
% This function is called by LSQNONLIN.
% params is a vector which contains the coefficients of the
% equation. t and r are the option data sets that were
% passed to lsqnonlin.
f=1.602e-019/1.38e-023;

FY=params(2)*exp(-f*params(1)/296)*(exp(f*V/296)-1);

diff = FY - I;
end

