Electronics > Projects, Designs, and Technical Stuff
Curve fitting question
golden_labels:
Nice observation, mrflibble. I would not be surprised if 200V is the effect of n-and-a-half-digit DMMs having one of their voltage ranges ending at 199.9…V. Which brings us to a question I already wanted to ask earlier: what about the measurement errors? Perhaps what was achieved in that topic is producing a calibration curve for the multimeter itself?
rhb:
Try the curve fitting in gnuplot. The Marquardt-Levenberger solver in it is fantastic. I used that for all my professional work as a research scientist working for major and super major oil companies. It also gives you publication quality figures.
i was able to do accurate fits to y=a*exp(b*x + c*x**2 + d*x**3) and higher order polynomial exponents. It takes a bit of practice to do that, but it's easier than you'd think. The key is to only solve for one term at a time until you've got a fit for all of them. Then do fits for more than one.
It will blow up if you happen to choose the wrong combination of terms. But usually you can do a last solution for all the coefficients if you've gotten close enough. The higher the order, the closer you need to be. Gnuplot also has lots of other curve fitting algorithms available.
mrflibble:
--- Quote from: golden_labels on March 11, 2019, 12:00:48 pm ---Nice observation, mrflibble. I would not be surprised if 200V is the effect of n-and-a-half-digit DMMs having one of their voltage ranges ending at 199.9…V.
--- End quote ---
Agreed. That step at 200 Volt would suggest a ranging switch. If you check the graph then you can see that the zig-zag pattern is continuous ... except that at 200 V there is a different offset. So that step you see is the difference in offset of the two ranges used. Or at least, that would be my guess. And if this is indeed the case, it might be a good idea to redo the measurements with the DMM set to fixed range. That, and it would be interesting to see what influence temperature has on the result.
--- Quote ---Which brings us to a question I already wanted to ask earlier: what about the measurement errors? Perhaps what was achieved in that topic is producing a calibration curve for the multimeter itself?
--- End quote ---
Yeah, incorporating the measurement uncertainty of the DMM into the calibration would make sense. That way you'd get some idea of how much confidence you can have in the end result of your calibration procedure. Mainly it depends on how much effort the OP would want to put into this.
mrflibble:
--- Quote from: rhb on March 11, 2019, 01:19:51 pm ---Try the curve fitting in gnuplot. The Marquardt-Levenberger solver in it is fantastic. I used that for all my professional work as a research scientist working for major and super major oil companies.
--- End quote ---
Don't you think damped least squares is a tiny bit overkill for this? ;D The data would suggest either linear or piecewise linear, depending on required fit. If you check the plots a few posts back, you can see that the residue plot has a distinct sawtooth shape to it. Which to me would suggest using a piecewise linear function as curve fit.
Another reason for piecewise linear is that I'd guess that sawtooth shape is due to the hypothetical layout of the hypothetical ADC. To be fair, with this few datapoints this is a reasonably wild guess. At this point we're playing the "Guess my calibration procedure!" game, so could go either way. :-//
rhb:
Learning to use the tool is what's important. It makes it very easy to examine the residual error of the fit.
My preferred practice is to plot the data divided by the approximation. I started doing that when I was working on the equations of state of reservoir fluids. It's pretty much the standard way that thermodynamic properties are handled. It has the great virtue of making errors in your choice of approximation and data outliers obvious. The cost of making measurements over a wide range of temperatures and pressures make experimental data scarce in that field.
And it will generate publication quality EPS for inclusion in a document.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version