I have got a set with experimental data of the voltage drop on a diode an its corresponding current. The general model of a diode is $$ I = I_s \left( e^{V/nV_T} - 1 \right)\ , $$ and I want to estimate parameters $I_s$ and $\beta = 1/nV_T$ to fit the model with my data.

My first attempt was making a least squared error approximation by defining an error function with my set of data $\{V_i,I_i\}$, $$ E(I_s,\beta) = \sum_i \left[ I_i - I_s \left( e^{V_i/nV_T} - 1 \right) \right]^2\ , $$ such that solving the system of equations $\partial E / \partial I_s = 0$ and $\partial E / \partial \beta = 0$. This approach leads to two non-linear equations that I tried to solve numerically with the Newton-Raphson method, but the system and its jacobian seems to not have a ''good behaviour'', and the solutions blow up.

I thought about doing the same but using a logarithmic scale to make a kind of linear regression, but if I try to remove the exponential term I get the following, $$ \ln(I+I_s) = \ln I_s + \beta V\ , $$ being not possible to isolate $I_s$ in a way that I can do a simple linear regression.

What could be a correct approach for fitting the diode model?

  • $\begingroup$ Can you share the data? $\endgroup$ May 7, 2021 at 17:38
  • $\begingroup$ @Jan I would like to but I'm not allowed to share it for the moment. Sorry $\endgroup$
    – SrJaimito
    May 7, 2021 at 17:40

2 Answers 2


If you have enough points with large voltages ($V\gg \beta^{-1}$), you can use the asymptote $\log I =\log I_s + \beta V$ to get (usually) a very good estimation of the parameters:

enter image description here


Well, you can use the following Mathematica-code to do it:

q = ((1602176634/(10^9)))*10^(-19);
k = ((1380649/(10^6)))*10^(-23);
Normal[NonlinearModelFit[{{}, {}, {}, {}}, 
  Is*(Exp[(q*V)/(\[Eta]*k*T)] - 1), {Is, \[Eta], T}, V]]

And the {{},{},{},{}} is the data.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.