ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

optimization - where to start

Afternoon Gurus,

 

I have inherited some Excel code which I want to convert to Labview. it uses the Solver function to optimize a system.

 

I have some input parameters which are passed to a process which is non-linear and cannot be described by a single function. The process outputs a couple of values which I compare with measurement. I want to optimise the input parameters so the output matches the measured, ideally of course! In excel, Solver looks to minimize the fraction error between the measured and modelled  ((Modelled - measured)/measured)^2. It doesn't know that, it is just minimising a value in a cell by varying the input cells.


Which set of VI's do I need to replicate this system?

 

Many thanks,

 

Paul

"When I read about the horrors of drinking, I gave up reading"
0 Kudos
Message 1 of 6
(4,373 Views)

On the Mathematics Block Diagram Palette, there is an Optimization sub-Palette.  Optimization is a somewhat complex topic -- you should "know what you are doing" before blindly jumping in and choosing a method and options, particularly if dealing with non-linear problems.

 

Bob Schor

0 Kudos
Message 2 of 6
(4,354 Views)

Thanks for that. This is indeed - complex.

 

For my application, I have a function f(x), which is bounded between upper and lower limits, and has a single peak at X0. I process the function in a non-linear way and end up with a modified function. I then sum that modified function up over the bounds and end up with a single value, which I can compare with a measured value. I want to mininize the relative error between the measured and modelled by optimising X0.

 

I shall carry on thinking and Googling.

 

Paul

"When I read about the horrors of drinking, I gave up reading"
0 Kudos
Message 3 of 6
(4,202 Views)

I have had a lot of success using the "Constrained Non-Linear Curve Fit" and "Non-Linear Curve Fit" VI's located under Mathematics->Fitting. You will create a VI that is used as the non-linear function and outputs your error value, so it should translate very nicely from the Excel method.

0 Kudos
Message 4 of 6
(4,141 Views)

Thanks,

 

I will have a look, but the issue is that I am not actually curve fitting. But I will see if I can use them.

 

Paul

"When I read about the horrors of drinking, I gave up reading"
0 Kudos
Message 5 of 6
(4,125 Views)

Hi All,

 

Decided not to give up on this. Noticing a minor wiring error from a few days ago (max and min the wrong way around.....) I got this working. Attached is a ppt of the wiring diagram. Key is to: 1) use the template for the objective and constrains vi; 2) don't delete the unused items in the objective and constrains vi;

 

One note of caution. When I set the start point near to or at the max value, it did not find the minimum

"When I read about the horrors of drinking, I gave up reading"
0 Kudos
Message 6 of 6
(4,100 Views)