{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# pd2 - Find affine scaling search...

This preview shows page 1. Sign up to view the full content.

%%% This m file uses the Primal Dual Affine Scaling Algorithm to solve %%% linear programming problems. % %%% Author: Henry Wolkowicz %%% Modified by: Steven Furino 20051212 % %%% Assumptions %%% The user has already created the matrices A, b and c and has provided %%% feasible vectors x, y, s. % clear all c %% Provide data. As an alternative, this section can be deleted and data %% taken from the command window or imported from an m file. % A = [1 2 1 1 0; 3 1 -1 0 1; 0 1 1 1 0] b = [5 8 3]' c = [4 2 1 1 -3]' x = [1 1 1 1 5]' y = [5 1 0]' s = [4 9 3 4 4]' s toler=1e-4; t while sum(x.*s) > toler
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: %% Find affine scaling search direction [dx,dy,ds]=intpt(A,b,c,x,y,s); %% Backtrack if necessary alpha=1; while min( min(x+alpha*dx),min(s+alpha*ds) ) <= 0, alpha = .5*alpha; end %% update x=x+alpha*dx;s=s+alpha*ds; y=y+alpha*dy; %% display dg = sum(x.*s); disp(['The current duality gap is: ', num2str(dg)]) disp('The search direction for x and the new x are:') [dx x] disp('The search direction for y and the new y are:') [dy y] disp('The search direction for s and the new s are:') [ds s] end disp('The optimal x and s are: ') [x s]...
View Full Document

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern