03-20-2016 11:14 PM
I have a function Z, dependent on two variables Xand Y, and i need to find the values of X and Y for which Z is a minimum. Could anyone please provide me some optimization tool and clealy communicated steps on how to do this. I have looked at some of the optimization tools but dont quite understand how to achieve this task using them. Basically I am expecting something similar to a basic excel solver where a certain "goal" is achieved by "changing cells". in essence my VI has a number of operators involving X and Y wired to achieve Z. What i need is to wire the points X, Y and Z to some terminals of a Vi which will yield the optimal values of X and Y required to achieve a minimum of Z.
03-21-2016 08:25 AM
Can you write type of your function?
You have equation or set of values?
03-21-2016 08:34 AM - edited 03-21-2016 08:36 AM
Wont be easy to specify the equation but I clearly have 3 points on the Vi that represent or correspond respectively to X, Y, Z. so i am looking for an optimization VI which wil take in X and Y, produce a minimum Z and then tell me which combination of values of X and Y yielded that minimum value of Z
03-21-2016 08:59 AM
03-21-2016 09:48 AM
03-21-2016 10:09 AM
Artem's code provides the single element where the Z value is the least. Now all you need to do is unbundle that cluster to get the X, Y, and Z values.
03-21-2016 10:33 AM
use unbundle
03-21-2016 11:01 AM
Either you don't understand what it means to minimize a function Z dependent on two variables X and Y or else you haven't clearly defined the question you are asking of us. It usually help us (to help you) if you post some LabVIEW code so we know what you've tried, or in this case, tell us how to get Z if we give you X and Y.
Some of the suggestions mentioned take you at your word that you don't have a real "function", but rather a set of X, Y, Z triples and want to find X and Y that minimize Z. In "minimization theory" (a term I just invented), this is related to the method called "Grid Search" -- you simply check all of the (X, Y, Z) triples, find the one with the smallest Z, and return the associated X and Y.
When dealing with mathematical functions, however, it is often not so easy. What is meant by a "minimum"? What happens if there are several "minimums"? How do you efficiently find the minimum (without testing every point that there is, and there are really a lot of them on the X-Y Plane)?
Note that if you really do have the function as f(x, y) = z, you can always use Calculus to try to come up with a formula for the minimum ...
Bob Schor
03-21-2016 11:26 AM
Bob, Thanks very much. I believe you have a firm grasp of the problem here. I have successfully used calculus for some single variable problem but since this is two variables I am not sure it is quite possible. I believe this requires an iterative approach. Calculus offers faster results so that would naturally be my approach if Z were dependent on only one variable.