QuestionQuestion

Transcribed TextTranscribed Text

Using MATLAB. Problem 1 (reference book Anton & Rorres, chapter 10, page 535, section 10.2, technology exercises). Using MATLAB, solve the linear programming problem: Consider the feasible region consisting of 0≤x, 0≤y along with the set of inequalities x cos⁡((2k+1)π/4n)+y sin⁡((2k+1)π/4n)≤cos⁡(π/4n) for k=0,1,2,⋯,n-1 Maximize the objective function z=3x+4y assuming that (a) n=1, (b) n=2, (c) n=3, (d) n=4, (e) n=5, (f) n=6, (g) n=7, (h) n=8, (i) n=9, (j) n=10, and (k) n=11.

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

Solution 1

> n=1;
>> for i=0:n-1
f=[3;4];b=[cos(pi/(4*n))];A=[cos((2*i+1)*pi/(4*n)) sin((2*i+1)*pi/(4*n))];
end
>> [x,fopt]=linprog(f,A,b)
Exiting: One or more of the residuals, duality gap, or total relative error
has stalled:
         the dual appears to be infeasible (and the primal unbounded).      
         (The primal residual < TolFun=1.00e-008.)

x =

1.0e+012 *

   -0.0000
   -3.3538


fopt =

-1.3415e+013

>> n=2;
>> f=[3;4];b=[cos(pi/(4*n))];A=[cos((2*i+1)*pi/(4*n)) sin((2*i+1)*pi/(4*n))];
end
??? end
    |
Error: Illegal use of reserved keyword "end".

>> for i=0:n-1
f=[3;4];b=[cos(pi/(4*n))];A=[cos((2*i+1)*pi/(4*n)) sin((2*i+1)*pi/(4*n))];
end
>> [x,fopt]=linprog(f,A,b)
Exiting: One or more of the residuals, duality gap, or total relative error
has stalled:
         the dual appears to be infeasible (and the primal unbounded).      
         (The primal residual < TolFun=1.00e-008.)

x =

1.0e+010 *

   -2.3918
    0.0001


fopt =

-7.1750e+010

>> n=3;
>> for i=0:n-1
f=[3;4];b=[cos(pi/(4*n))];A=[cos((2*i+1)*pi/(4*n)) sin((2*i+1)*pi/(4*n))];
end
>> [x,fopt]=linprog(f,A,b)
Exiting: One or more of the residuals, duality gap, or total relative error
has stalled:
         the dual appears to be infeasible (and the primal unbounded).      
         (The primal residual < TolFun=1.00e-008.)

x =

1.0e+008 *

   -0.0019
   -1.4561


fopt =

-5.8301e+008

>> n=4;
>> for i=0:n-1
f=[3;4];b=[cos(pi/(4*n))];A=[cos((2*i+1)*pi/(4*n)) sin((2*i+1)*pi/(4*n))];
end
>> [x,fopt]=linprog(f,A,b)
Exiting: One or more of the residuals, duality gap, or total relative error
has stalled:
         the dual appears to be infeasible (and the primal unbounded).      
         (The primal residual < TolFun=1.00e-008.)

x =

1.0e+008 *

   -3.0227
   -0.6135


fopt =

-1.1522e+009...

By purchasing this solution you'll be able to access the following files:
Solution.docx.

50% discount

Hours
Minutes
Seconds
$50.00 $25.00
for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Linear Algebra Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats