Thanks for the reply. I corrected the ub and lb portion of my code.
I have not set the 'AlwaysHonorConstraints' option. It is probably set to the default value.
Some constraints of c(i) are off by as large AS 10 or 2000 ! So, it's not coming from the round-off error, I guess.
Your help will be very appreciated.
"Matt J" wrote in message <email@example.com>... > "Nazmul Islam" wrote in message <firstname.lastname@example.org>... > > > > > > After I run the code, one of the W value comes out to be negative !!! However, I explicitly set a bound for W (between 0 and 900). So, it should not happen ! > =================== > > You've set ub and lb to scalars, which means only W(1) will be bounded. > You need > > lb=[0,0,0]; > ub=[900,900,900]; > > Aside from that, have you set the 'AlwaysHonorConstraints' option? We can't tell from the code you've shown. > > > > Beside, one of the inequality constraint does not get satisfied, too ! I want all entries in the c vector to be negative. But some of them come out to be negative ! > ======================= > > Could the non-negative c(i) simply be due to round-off error or incomplete convergence. How large are those values?