From: bcoss COSS on
I am trying to fit diode data to a model that contains all four components of current conduction across a diode, namely: Thermionic emission, Tunneling, generation-recombination, and leakage. (if you are a very interested reader please see: doi:10.1016/0038-1101(91)90031-S)

There are several papers that successful use this model, yet I am unable to fit my data using Matlab.

The main issue is the appearance of the total current on both the lhs and rhs of the equation:

Itotal = Ite*exp[ (x-Itotal*Rs) / kT] + Igr*exp[ (x-Itotal*Rs) / 2*kT] + Itun*exp[ (x-Itotal*Rs) / E0 ] + (x - Itotal*Rs) / Rshunt

Where x is voltage, Itotal is the experimentally measured current, k is the boltzmans constant in eV and T is temperature in kelvin. Ite, Igr, Itun, E0, Rs, and Rshunt are my parameters I want to extract.

I was using lsqnonlin and lsqcurvefit to no great effect:

function nlcft_V = full_current_fit(P,x,y)
% This function is called by LSQNONLIN.
% P is a vector which contains the coefficients of the
% equation. x and y are the option data sets that were
% passed to lsqnonlin.
global T;

q = 1.602e-19;
k = 1.38e-23;

nlcft_V = P(1).*(exp(((q/k).*(x-(P(2).*y)))./T)-1)...
+ P(4).*(exp(((q/(2*k)).*(x-(P(2).*y)))./T)-1)...
+ P(5).*(exp((q*(x-(P(2).*y)))./P(6))-1)...
+ (x-(P(2).*y))./P(7);

Function call:

[result, resnorm,residual,exitflag]=lsqnonlin(@full_current_fit,x0,[], [], options, xdata,ydata);

I am totally stuck and have tried every trick I know. Anybody solve a similar problem and would care to share some insight? Mad internet karma to the kind soul who can help me 0 : - )