In: Operations Management
Business Problem: A computer company produces laptop and desktop computers. The data analytics team in collaboration with the marketing team developed a predictive model that forecasts the expected demand for laptops to be at least 1,000, and for desktops to be at least 800 per day. (Assumption: production is in accordance with the demand) The production facility has a limited capacity of no more than 2,000 laptops and 1,700 desktops per day. The Sales Department indicates that contractual agreements of at most 2,000 computers per day must be satisfied. Each laptop computer generates $600 net profit and each desktop computer generates $300 net profit. The company wants to determine how many of each type should be made daily to maximize net profits.
2. Formulate a linear programming model that represents the preceding business challenge. b. Identify the decision variables. c. What is our objective function in terms of these decision variables, write down its mathematical equation) d. What are the constraints for this problem, write down their respective mathematical equations.
b) Decision Variables: X (laptop) & Y (desktop) # of units to produce for laptop & desktop a day
c) Objective function: Maximize the profit
Max profit Z = 600x + 300y
d) Constraints:
Expected demand x=>1000 and y=>800
Production capacity x<=2000, y<=1700
Contractual agreements x + y <=2000 non negative restrictions x=>0 and y=>0
NEED HELP WITH IpsolveAPI Library in R
3. Solve the problem using lpSolveAPI library in R to come up with the most optimum solution of this problem a. Write down R program to get the most optimal solution b. What is the optimal number of laptop and desktop computers to be made each day? c. What is the value of the objective function (total net profit) for the solution?
install.packages('lpSolveAPI')
library(lpSolveAPI)
lprec <- make.lp(0,2)
lp.control(lprec,sense="max")
set.objfn(lprec,c(600,300))
First, write the LP model is a good form. This will help us implement the R-code easily. We will not ignore any variable in that even if a variable is missing in a constraint, we will write it with '0' as the coefficient.
Max 600x + 300y
s.t.
1x + 0y >= 1000
0x + 1y >= 800
1x + 0y <= 2000
0x + 1y <= 1700
1x + 1y <= 2000
x, y >= 0
----------------------------
R-code (ignore the first line if the package is installed already):
install.packages('lpSolveAPI')
library (lpSolve)
#defining parameters
obj.fun <- c(600, 300)
constr <- matrix (c(1,0,0,1,1,0,0,1,1,1) , ncol = 2 , byrow =
TRUE)
constr.dir = c(">=", ">=", "<=", "<=","<=")
rhs <- c(1000,800,2000,1700,2000)
#solving the model
prod.sol <- lp ("max", obj.fun , constr , constr.dir , rhs)
#output
prod.sol
prod.sol$solution #decision variables values
--------------------------
Solution: