11-15-2010 01:12 PM
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:
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.
Solved! Go to Solution.
11-15-2010 01:33 PM - edited 11-15-2010 01:35 PM
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:
11-16-2010 02:10 PM
Which minimization functions were you looking at thus far?
11-16-2010 02:31 PM
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-
11-16-2010 03:17 PM
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.
11-16-2010 04:54 PM
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-