LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a LabVIEW vi that performs a minimization based on the Nelder-Mead simplex method or something similar?

My goal is to fit a sine function to an array of data.
0 Kudos
Message 1 of 5
(4,728 Views)
The short answer is yes, provided you have LabVIEW Full or Professional. The VI is located at:
...\LabVIEW *\vi.lib\gmath\opti.llb\Downhill Simplex nD.vi. Also available in the same location is Conjugate Gradient nD.vi. Both will require you to construct an appropriate cost function using formula string syntax. There is also Levenberg Marquardt.vi, which implements non-linear curve fitting to a user defined model.

However, you might consider using the ...\vi.lib\measure\matone.llb\Extract Single Tone.vi to do the job. It implements a curve fit in the frequency domain, and will return frequency, amplitude, and phase. This algorithm is quite robust and fast, and is used internally by other measurements (THD and Sinad).
Message 2 of 5
(4,728 Views)
I can not implement my cost function for constraints in the GMath syntax. Any plans for a "normal" Global Optimization (e.g. Nelder-Mead, Differential Evolution or Genetic Algorithm) VI interface coming out; an API that will allow me to define my cost and constraint functions in LV VIs)?
0 Kudos
Message 3 of 5
(4,054 Views)

Me too having a vi, substituting a cost function, looking for a similar solution. It is hard to describe my cost function analytically. But it is clear in this case, what are the input variables, and what is the calculated cost (scalar as output). What other method for minimizing a variable are available in LV, please? Cheers, M

 

edit: After some more searching on the INternet, I came to the conclusion that this is a limitation of LV. So much I learned, there is no way to pass a whole function (with inputs and outputs) to another function and recalulate the passed function several times (in MATLAb it would be called anynymous function, if I'm not wrong).

 

Instead, I found this: http://www.laurentkneip.de/DS.html Neat, and it also requires editing the core and substitution the cost function with the own one. I am going to try that out and report back...

0 Kudos
Message 4 of 5
(3,141 Views)

For all those weeks here and now, I was just searching for wrong terms:

 

http://zone.ni.com/reference/en-XX/help/371361J-01/gmath/mathematics/


"Constrained Nonlinear Optimization" is my friend 🙂 It is fricking hard to get it up and running, but it is done.

0 Kudos
Message 5 of 5
(3,121 Views)