LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can LVs minimization functions minimize a function with a summation in it?

Solved!
Go to solution

Hello all,

 

I am trying to minimize U-X, where U is a n point array of measured data, and X=f(U), a n-point summation function of 7 variables:

 

ResponseFunction.png

 

I have made efficient sub-VI's to calculate this function, and normally would solve this using an amoeba like approach, however, LV's minimization routines appear to need analytic functions.  I can write this equation as above, but am not sure that I can provide this as an input to a minimization routine.

 

I am wondering:

 

1)  Can this function be entered analytically to LV, allowing me to use built in solvers?  If so, how?

2)  If not, how can I minimize this?  I have seen some very complicated and only modestly explained Lev-Mar examples, but can't make heads or tails of them.

 

A note: I am actually only trying to fit the baseline of the data, not the whole spectrum, but if someone can point the way on the minimization approach, I can figure out the rest (I may use a  minimum entropy approach, i.e. minimizing the derivative of the sum of the difference between the data and the results of the function call).

 

I include my function VI below, as well as an ascii string of typical data, 5000 points long.  Any ideas would be strongly appreciated!

 

Thanks,

 

RipRock

 

PS:  I know I am asking a lot here.  Serious thanks in advance. 

Download All
0 Kudos
Message 1 of 6
(3,809 Views)

Hi all,

 

One more thing - to help out a bit more, here is a simple VI to read in the data, calculate the correction, and plot the two.  I have provided default values that more or less work for this data (manual minimization!).

 

Thanks,

 

RipRock

 

PS:  Here is what the result looks like:

 

ExampleResult.png

0 Kudos
Message 2 of 6
(3,800 Views)

Which minimization functions were you looking at thus far?

Verne D. // Software R&D // National Instruments
0 Kudos
Message 3 of 6
(3,768 Views)

I looked at all of them - none appeared capable of iterating on a sub-vi, only on analytic functions (tho I could be very wrong on this!  Hence my post!)

 

Thanks,

 

S-

0 Kudos
Message 4 of 6
(3,763 Views)
Solution
Accepted by topic author RipRock99

I haven't actually done this, but doesn't the Unconstrained Optimization VI or the Constrained Nonlinear Optimization VI do what you want?  Both will accept a function to minimize, using a range of algorithms.

Constrained Nonlinear Optimization VI

0 Kudos
Message 5 of 6
(3,756 Views)

I think you are right!  When I first looked at them, I got caught up with the instances that use a formula string, but I see now that you can use a sub-VI call.  This looks great (though not trivial)!

 

Thanks,

 

S- 

0 Kudos
Message 6 of 6
(3,744 Views)