10-14-2009 06:05 PM
Hi everybody!
I was wondering if you migth help me with an issue.
I want to perform an exponential fit, but my curve has, approximately, this form y=a*exp(-b*x), which is a temperature vs time graph.
I need to calculate a and b, i tried with the exponential fit .vi, but the form of the curve is a decreasing exponential curve, while mine is an increasing exponential curve approximating up to a max level.
I attached an image for a better understanding.
Thanks in advance
p/ working with labview 8.2
10-14-2009 06:08 PM
10-14-2009 07:48 PM
You could invert your curve first to make it a decreasing exp before applying the curve fitting function.
Cheers,
Battler.
10-14-2009 08:08 PM
10-14-2009 11:32 PM
Thanks for all your help.
In fact, you´re rigth, my curve has the 1- [exp(-b*x)] form.
About using the non-linear curve fit .vi; seems complex to me, i'm not familiar with this .vi
By the way, which coefficients should i use, is there any other thing that i should consider?
Inverting the signal did not give me the results i expected.
Thanks for your ideas, wating for your next comments
10-15-2009 10:40 PM
It really isn't too hard to use the nonlinear fit VI. Here are the steps.
Write a VI to generate the function values (and I like to calculate the derivates when possible). There is a template VI to make this easier, or just use the example I post below as a starting point for future fits. In harder problems, you can use the output control to only calculate derivatives when required and pass parameters using the variant data. Don't even worry about that now.
Place the LM VI on a block diagram and select f(x,a) is a VI. Open a reference to the VI you wrote for f(x,a) and pass it to the LM VI along with the X and Y data. Create some initial guesses and fit away. In this case, a is the value approached for large x and 1/b is roughly the distance required to reach 2/3 of the final value. Your guesses don't need to be very precise.
That is all there is to it. I assume the f(x,a) VI is in the same directory as the FitExponentialExample2.vi.
10-16-2009 08:24 PM
Thanks Darin.K.
Can you post it for Labview 8.2, couldn't open the vi's
I want to give it a try
10-16-2009 10:34 PM
11-30-2012 06:04 PM
I think there is an error in the ExponentialFunction.vi. The partial derivative of the function f(x,a,b)=a(1-exp(-bx)) with respect to b is a*x*exp(-b*x). The wire into the compound arithmetic function should origin in X instead of b (=a(1). I hope I have understood correctly partial derivatives and that is what is expected into f'(A,a).
11-30-2012 06:21 PM
You are correct.