01-31-2011 04:41 AM - edited 01-31-2011 04:42 AM
Hey there
I've got a problem with a Lev-Mar-Fit. But I'm neither a very experienced LabVIEW-user nor a good mathematician, so please don't tear me appart, if the solution should be obvious
What my programm should do:
I'm using [ function generator => LED => Fluorophor => photodiode => oscilloscope ] to identify the lifetime of the fluorophor. The programm scans with a sinus-function through a variety of frequencies (log scale) and calculates the phase-shift form the led-source to the photodiode-input. This value is than substracted from a referencefile (which includes the complete setup, but without the fluorophor).
The result is the pure shift within the phase angle, which is connected to the lifetime by the following equation:
What my program does at the moment and what my problem is:
Well, actually almost everything works fine (as you can see on the image below). But right now, I can only calculate the lifetime for each frequency independently, using the phase shift and the corresponding frequency. In order to receive a better result, I would like to make a Lev-Mar fit on this curve, and then calculate one precise life-time from the fit-result...
Could you please tell me, how to implement my formula, as the Lev-Mar-VI seems quite tricky to me...
Thanks in adavance for any helpful input...
cheers, Reepicheep
my current LabVIEW-Version: 2010
02-01-2011 09:45 AM
Hi,
thanks for your question! As I understood you correctly you want to use the Lev-Mar fit?
As you can see in the example from the LabView examples (see below) you need a function to estimate your curve. Is there any chance you can make this estimation?
Feel free to ask again if there is something unclear.
Cheers
02-01-2011 11:01 AM
Could you simplify and isolate the relevant code as follows:
02-01-2011 02:02 PM
Here's a quick draft that simulate the curve with noise and tries to fit it. Works fine....
Unzip them main code and the model into the same folder, run the main program. Let me know if you have questions.
02-17-2011 01:43 AM
Can anyone do me the favour and convert my original file to one, that will work on LabVIEW 9.0?!?
I didn't have access to the necessary equipment during the last weeks. And althoug I do now, I can't start the programm cause I wrote it on my Version 10 Trial, which expired last week And my company only has the full licence for labVIEW 9.0 (of course, I also forgot the save it somewhere in a compatible file)...
Would be great
02-17-2011 02:28 AM
Hi, I hope that is what you want?
02-17-2011 04:28 AM
@niceday: thanks for the converting!
@altenbach
I attached the file with the saved constants.
My initial estimate for tau would be 3 microseconds, i.e. 0.003ms (as the programm works with milliseconds). And sorry, the frequency-unit is kHz.
greetings, reepicheep
P.S: thanks also for you simulation. I played around with it a bit, but as I had no access to my instruments at that time, I couldn't really test it... And now that I do have access, I can't open them because they are from LabVIEW 2010 as well...
03-03-2011 03:13 AM
Nothing?!? Nobody?!?
03-03-2011 04:19 AM
Attached is the Liftime with constants.vi which I have converted to LabVIEW 2009. Is that what you need?
03-03-2011 01:04 PM - edited 03-03-2011 01:04 PM
Here is my version in LabVIEW 2009, but now with your real data plugged in. See if it helps.
(Of course the loop only needs to spin when the guess changes, so modify as needed).