02-26-2009
07:14 AM
- last edited on
03-02-2009
09:17 AM
by
Support
Hi,
In my measurements I would like to estimate temperature from the spectra of emitted light by means of Planck's law of black-body radiation distribution. I was trying to fit my data with Nonlinear Curve Fit, but I met with couple of problems:
1.) Function is not fitting properly, because of different fitted data distribution shape and values from data input.
2.) When plotting Planck's distribution using best fit parameter, plot is different from theoretical distribution of given temperature. (My data are from source of temperature 3100K, best fit parameter is 1130K, but fit is different from theoretical distribution of 1130K)
When I fit some simple equations, everything works, so I'm not sure what could be a problem.
Thanks a lot for any advice.
Ivan
Solved! Go to Solution.
02-27-2009 05:23 PM
Hi wacker!
Could you possibly clarify what you mean by "different fitted data distribution shape and values from data input?"
Also, is the smaller picture showing the theoretical distribution?
How different are the simple equations that you got to work for you? Can you isolate the issue to one particular aspect of the code?
Kristen H.
02-27-2009 10:58 PM - edited 02-27-2009 11:02 PM
You have a serious dataflow issues and race conditions due to overuse of value properties. You also have a wild mix of EXT, DBL, and SGL. You should do everything in DBL. (You don't want any red dots, so fix the representations, incl. the diagram constants).
As a first step, you should eliminate ALL value properties and wire everything together. You have 5 code "islands" with no data depedency and there is this no guarantee that A and B will get correct values before their value property are read inside the inner loop.
So, as a first step fix all that (e.g. as in the attached image) and let's go from there. 🙂
03-01-2009 09:50 PM - edited 03-01-2009 09:55 PM
Quickly looking once more over this, it seems to me that one of your constants if four orders of magnitude off.
You get a pretty good fit with 3.74177E-16 instead of 3.74177E-12, see image. (You divide your theoretical curves by 10000, but you don't do so in your formula!)
03-02-2009 02:54 AM
Hi Kristen,
I'm sorry..as soon as I posted my question, I realized that there is a mistake in my model equation, so now it looks all right. Thanks for the promt answer.
Ivan
03-02-2009 02:57 AM
03-02-2009 03:02 AM
08-23-2015 09:54 PM
Thanks for sharing the code - I've had a use for it and wanted to mention a few things - the factor of 10000 probably results from expressing the speed of light in cm/s instead of m/s. Notice that the the formula and the code are different - the formula is 2hc^2 while the code is 2pihc^2. Adding the pi to the expression converts it from spectral radiance to spectral radiant exitance. The latter is the more common form.