
Question
Transcribed Text
Solution 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.