From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a vi to minimize a non-analytical function?

The minimization vi's only work for an analytical function. I have a complex function that cannot be represented analytically. I have a vi that takes the adjustable parameters and calculates the fitting error.
0 Kudos
Message 1 of 3
(2,372 Views)
I am having a little trouble understanding what you want. I will assume that your complex function is not a complex valued function and that you need a VI with adjustable parameters that calculates fitting error.

I should explain what analytic means for those unfamiliar with the term. An analytic function is one that has a derivative at every point on its domain (the x in f(x)). An example of a non analytic function is f(x)=|x| because there exists no derivative at x=0 although it is piecewise differentiable.

I recommend doing the error fitting the old fashion way by doing calculations on the difference between the model and your function. If you are trying to find the least squares error, just square the difference of every point (or a whole lot of p
oints) and sum them.


Jeremy Braden
National Instruments
0 Kudos
Message 2 of 3
(2,372 Views)
Thanks Jeremy,
I have incorporated my error.vi into DownHill Simplex nD.vi in place of the vi that caluclated the fitting error. My error.vi takes the parameters and calculates the error value. This seems to work though for my problem with hundreds of observations and dozens of parameters is rather slow. Maybe one of the other optimization algorigthms would be better?
Kreg
0 Kudos
Message 3 of 3
(2,372 Views)