matlab

profileBobosky
04Homework04.pdf

Homework # 4

Due Oct 9

1. Solve a planning and scheduling cost/trade problem.

a) Model the problem as a linear programming problem

b) Using MATLAB. Use the “linprog” MATLAB function to solve the linear programing part.

a. The inputs for the function linprog(f,A,b) are

b. f= The coefficients of the decision variables of the objective function

c. A= the coefficients of the decision variables of the constraints

d. b= the rhs of the constraints

e. Consider the following minimization problem

Example: min 𝑥1 + 𝑥2 + 0𝑥3 + 0𝑥4

Subject to:

2 𝑥1 + 𝑥2 + 0𝑥3 + 0𝑥4 ≤ 8

0 𝑥1 + 2𝑥2 + 0𝑥3 + 𝑥4 ≤ 15

0 𝑥1 + 0𝑥2 + 2𝑥3 + 𝑥4 ≤ 7

𝑓 = [1 1 0 0 ]

𝐴 = [ 2 1 0 0 0 2 0 1 0 0 2 1

]

𝑏 = [ 8

15 7

]

The input in MATLAB is: “linprog (f,A,b)”

For more information about how to use linprog type “help linprog” in MATLAB

f. Use the data of the problem reviewed in class

2. Write a MATLAB Program for the Moore’s algorithm