Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a MATLAB program that implements phase II of the simplex method in matrix

ID: 3600848 • Letter: W

Question

Write a MATLAB program that implements phase II of the simplex method in matrix form (as presented in class) for the solution of general linear programs (with b 0) in standard form: max c T x s.t. Ax b x 0 Here, c R n , A R m×n , and b R m is such that b 0. Structure your program such that the following two pivoting rules can be used: • The largest-coefficient pivoting rule. Use your program to solve the following linear programs: (DO NOT USE linprog from matlab library!)

1) The linear program with data: A = [1 3 0 1 ; 2 1 0 0 ; 0 1 4 1 ];
b = [4;3;3];
c = [1;4;1;3];

Explanation / Answer

The requirement per day of starch, proteins and vitamins is 8, 15 and 3 respectively. The problem is to find how much of each food to consume per day so as to get the required amount per day of each nutrient at minimal cost. When trying to formulate a problem as a linear program, the first step is to decide which decision variables to use. These variables represent the unknowns in the problem. In the diet problem, a very natural choice of decision variables is: • x1: number of units of grain G1 to be consumed per day, • x2: number of units of grain G2 to be consumed per day. The next step is to write down the objective function. The objective function is the function to be minimized or maximized. In this case, the objective is to minimize the total cost per day which is given by z = 0.6x1 + 0.35x2 (the value of the objective function is often denoted by z). Finally, we need to describe the different constraints that need to be satisfied by x1 and x2. First of all, x1 and x2 must certainly satisfy x1 0 and x2 0. Only nonnegative amounts of LP-1 food can be eaten! These constraints are referred to as nonnegativity constraints. Nonnegativity constraints appear in most linear programs. Moreover, not all possible values for x1 and x2 give rise to a diet with the required amounts of nutrients per day. The amount of starch in x1 units of G1 and x2 units of G2 is 5x1 + 7x2 and this amount must be at least 8, the daily requirement of starch. Therefore, x1 and x2 must satisfy 5x1 + 7x2 8. Similarly, the requirements on the amount of proteins and vitamins imply the constraints 4x1 + 2x2 15 and 2x1 + x2 3. This diet problem can therefore be formulated by the following linear program: Minimize z = 0.6x1 + 0.35x2 subject to: 5x1 + 7x2 8 4x1 + 2x2 15 2x1 + x2 3 x1 0, x2 0. Some more terminology. A solution x = (x1, x2) is said to be feasible with respect to the above linear program if it satisfies all the above constraints. The set of feasible solutions is called the feasible space or feasible region. A feasible solution is optimal if its objective function value is equal to the smallest value z can take over the feasible region

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote