LeastSquaresFit usage for Foster Model parameters
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
LeastSquaresFit usage for Foster Model parameters
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.
- Labels:
-
Electrical_Engineering
-
Physics
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Maybe you should first do a transformation: take the log of Zth and tpulse and try to fit that.
Success!
Luc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Can't answer your questions, but "out-of-the-box" Prime genfit() seems to fit your data.
Prime 9 file attached.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Genfit with the proper function creates a reasonable fit:
plot the results:
Note, the array a contains R0, C0, R1, C1,...
Success!
Luc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
A small improvement (especially for the lower part of the graph) can be obtained by adding another section:
Success!
Luc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Have added some comments in the attached file - maybe it helps.
basically you can't take the natural logarithm of a time quantity. The argument of the logarithm function must be dimensionless. The same applies to the exp function as well as sin or cos (apart from the pseudo-units rad or deg, which are dimensionless anyway).
I can't say why the built-in function "LeastSquareFit" fails - I have never used it myself.
In the attached file you find a fit using a solve block with "minerr", a fit using "genfit" and also a fit using "minize" on a user written sum of squared errors function.
I also tried a Weibull model as suggested by CurveExpert Pro, but the fit is worse.
I also found something what looks like a bug in Prime
The last three values definitely are wrong. But after a recalculation (F9) Prime shows the correct values. Strange!
