12.07.2015 Views

What Is Optimization Toolbox?

What Is Optimization Toolbox?

What Is Optimization Toolbox?

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

2 Tutorialload sc50bThis problem in sc50b.mat has 48 variables, 30 inequalities, and 20 equalities.You can use linprog to solve the problem:[x,fval,exitflag,output] = ...linprog(f,A,b,Aeq,beq,lb,[],[],optimset('Display','iter'));Because the iterative display was set using optimset, theresultsdisplayedareResiduals: Primal Dual Duality TotalInfeas Infeas Gap RelA*x-b A'*y+z-f x'*z Error---------------------------------------------------Iter 0: 1.50e+003 2.19e+001 1.91e+004 1.00e+002Iter 1: 1.15e+002 3.18e-015 3.62e+003 9.90e-001Iter 2: 8.32e-013 1.96e-015 4.32e+002 9.48e-001Iter 3: 3.47e-012 7.49e-015 7.78e+001 6.88e-001Iter 4: 5.66e-011 1.16e-015 2.38e+001 2.69e-001Iter 5: 1.13e-010 3.67e-015 5.05e+000 6.89e-002Iter 6: 5.03e-011 1.21e-016 1.64e-001 2.34e-003Iter 7: 5.75e-012 1.12e-016 1.09e-005 1.55e-007Iter 8: 8.08e-014 5.67e-013 1.09e-011 3.82e-012<strong>Optimization</strong> terminated.For this problem, the large-scale linear programming algorithm quicklyreduces the scaled residuals below the default tolerance of 1e-08.The exitflag value is positive, telling you linprog converged. You canalso get the final function value in fval and the number of iterations inoutput.iterations:exitflag =1fval =-70.0000output =iterations: 8algorithm: 'large-scale: interior point'2-74

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!