11-25-2011 10:25 PM
I have a set of data that I am fitting to a sin function. I need to find the best fit constants for my data, so I am using the non linear curve fit VI. One of the necessary inputs for this VI is the function f(x,a) that I am fitting the data to [a, a2, a3... are the various parameters]. All of the documentation that I have come across is horrible. Could someone show me an example of how to define a function for this input? For my case, I just want a simple sine function with 3 variables to guess for, but any example function would be fine.
Thanks
11-25-2011 11:00 PM
Here is my code so far. The SineFunctioin referance vi is from when I was trying to use the Nonlinear Curve Fit VI by defining f(x,a) as a VI instead of as a formula string. However, I can not get either meathod to actually work.
11-25-2011
11:02 PM
- last edited on
11-07-2024
01:34 PM
by
Content Cleaner
The example finder has a few examples. Else you could also start here. Let me know if you have any questions.
Are you trying to use the formula model or the VI model version?
Of course to fit a sine, a FFT based approach might be simpler unless you have only a small fractional number of cycles. Have you tried "extract single tone", for example?
11-25-2011 11:27 PM
Try this ...
(Make sure you select the "VI model" polymorphic instance and also make the static VI reference strictly typed.)