LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Excel solver or optimization problem in Labview

Hello,

My problems are either because I do not understand LabVIEW or because I cannot pose my problem correctly mathematically in order to use LabVIEW. Maybe someone can help.

I have in Excel an optimization problem which is working well. Essentially a shape is being minimized. I have three columns of data representing certain angles or distances. In Excel I use the solver to minimize an area found by calculating an equation which uses the maxima of two of the columns and the minima from the other column. Hence I find my best surface area and in Excel it seems to work well. When using the solver in this way and specifying cells which are the maxima or minima of columns as part of your equation to minimize what you are doing is like imposing constraints on the problem. In Excel this seems to work in a easily understandable way.

The data in all three columns are all dependent on one variable. Thus finding the optimum value of this variable to give the minimum surface area is what it all boils down to.

I have looked at the various VI's in LabVIEW and am convinced that the functionaility to do this is there but I simply do not know how. What I would like is a VI where I could put in the equation as one input and put in constraints (ie the maxima and minima of the column calculations) in another. I think my main problem is that I do not know how to put in a constraint that something needs to be a maximum (or minimum), rather than say >0 or something.

Perhaps having done this in Excel I am approaching it the wrong way in LabVIEW. I realise that I could get to Excel via an Activex but if the capability is there in LabVIEW I'd like to use it.

Regards

Kevin
0 Kudos
Message 1 of 3
(3,145 Views)
Hi Kevin

Does the structure of the equation that you derive actually change or is it simply the parameters that change ?
In other words could the equation be for example (a^3 + b^2 + c) for one scenario and (a+b+c)/2 for another ?
If the structure of the equation is constant then you should be able to pass parameters through to a formula node in which you place the equation.
I don't believe you can pass an equation as such through to a VI other than as a string.
You would then need to parse the string to determine its function.
0 Kudos
Message 2 of 3
(3,141 Views)
I have been thinking about the problem and how I could perhaps express it in a simpler way. What I have come up with may actually be incorrect but it would be a good approximation.

I have;

[(W + Yp)^2 - Yp^2] * atan (x/(Yp - y) = AREA

Where W is a known constant
x and y are a set of coordinates of points which need to be bounded by the area. Basically I have these as an array.
Yp is a distance along the Y axis which I need to find.

I want to find Yp that gives the maximum AREA. (I am actually looking for a minimum area but doing things this way round is like looking for the solution from the inside and growing to find a solution that just covers everything.

As I said this is actually an approximation to my original problem as in that I was unsure as to whether the first two YP's in the above equation were the same as the third Yp! Having looked at it I reckon I can assume they are for the time being.

Regards

Kevin
0 Kudos
Message 3 of 3
(3,134 Views)