LeastSquaresFit usage for Foster Model parameters
- February 25, 2025
- 4 replies
- 896 views
Hello all,
I'm trying to do a fit for the transient thermal impedance of a transistor based on a set of points that I extracted from a datasheet. At first, I tried to do a simple polyfit, but it seems that the fit can diverge to very high numbers or even go negative, which may not be acceptable in this case, since the thermal impedance is strictly positive.
I tried to do a fit similar to the Foster thermal model, based on R and C couples of values, that is usually used in the thermal models of electronic components. For that, I tried to use the LeastSquaresFit function, but it doesn't converge in my case, script attached below.
Could anyone explain the reason for the divergence ? Is it the input data or the way it is used ?
In the case I try to separate R and C values to 2 vectors, should the guess vector be the stack of the R and C vectors ? The documentation of the function doesn't explain it in a clear way.

Alternatively, in the case of a logarithmic regression, is it possible to unassign the units from variables when using linfit ? With t_pulse in seconds and Zth in °C/W, linfit says that the units are not compatible.

I'm using Mathcad Prime 9.

