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: 

Linear programming

Solved!
Go to solution

Can Linear Programming Simplex Method VI solve the optimization problem with real value variables (x>=0 or x<0)? If yes, how?

0 Kudos
Message 1 of 6
(4,969 Views)

Hi, Thanks for your reply. But in the guidance you provided, Linear programming Simplex Method VI is only used for nonnegitive variables, i.e., x>=0. I am wondering whether the VI can be used for both negative and nonnegative varibales or not. Any suggestion with more details? Thanks a lot.

0 Kudos
Message 3 of 6
(4,878 Views)
Solution
Accepted by ZDX

Assuming your (potentially) negative variables have constraints (say -1000) you can offest them accordingly and adapt your input data correspondingly.

 

replace x0 >= -1000 with X0 = (x0 + 1000) >= 0

 

Don't use negative constraints unnecesseraly big as it may results in numerical issues.

Message 4 of 6
(4,859 Views)
Solution
Accepted by ZDX

I've created a quick example (Lv2014) that finds the minimax solution for three equations with two variables.

The solution has both variables negative so using the raw algorithm returns {0, 0}. If you increase the variables offset parameter, the actual solution { -4.86. -0.49} is found for any offset value >= 4.87.

 

I hope this works for you!

0 Kudos
Message 5 of 6
(4,840 Views)

Thanks for your help. It works for me! 

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