LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

custom curve fit

Hello,

I have an equation that I would like to use to fit a curve to data.  It is a specific function I need to use, its pretty close to the Gaussian Peak Fit.vi but not exact.  The equation is:

(A/U)*exp[-((B-C)/U^2)^2], where A is the amplitude, C is the center, and U is the standard deviation.  Any ideas on how to implement this?  Thank you for the help!


Cheers
0 Kudos
Message 1 of 7
(5,093 Views)
Easiest would be to use the "curve fitting" express VI from the express palette. Select "non-linear" and enter your formula, parameters, and guesses. See how far you get. 🙂
 
Alternatively, you can use the "nonlinear curve fit" from the "mathematics..fitting" palette.
Message 2 of 7
(5,081 Views)
I have been playing with the curve fitting express vi with no luck.  I keep getting an error message stating "Input parameters has at least one element that is Inf, NaN, DBL_MAX, or DBL_MIN"

I am using the following array for my location data "180,175,170,165,167,163,160,150,140,130,111"
I am using the following array for my signal data    "59,97,152,160,157,155,152,144,134,48,1"

And I am using the above function as my model.  Any ideas on how to get this thing working?

Cheers!
0 Kudos
Message 3 of 7
(5,064 Views)
I have been trying to use the nonlinear curve fit.vi on this problem, attached is a vi i have been tinkering with.  There is a gaussian curve fit for reference, I still am unable to get the nonlinear curve fit to function.  Any thoughts will be appreciated.

Cheers!
0 Kudos
Message 4 of 7
(5,057 Views)
I cannot see any of your images, but usually it is easiest of you could attach your VI.
 
Most likely, you did not specify reasonable starting values for the parameters.
 
It took me one minute to wire the attached VI. Seems to work just fine with your data. 🙂
 

Message Edited by altenbach on 09-24-2007 02:50 PM

Download All
Message 5 of 7
(5,055 Views)
Altenbach,

I do appreciate your response.  At first glance what you did in your vi and what I was doing look similar.  I am going to take a closer look so that I can see where I made my mistake.  I agree that it is a trivial problem and that fact was driving me crazy.  Thank you again.


Cheers!
0 Kudos
Message 6 of 7
(5,052 Views)
You should use a forward slash "/" for divisions in the model formula (instead of "\").
0 Kudos
Message 7 of 7
(5,047 Views)