Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
LpSolver Example with Constraints
#A company wants to maximize the profit for two products A and B which are sold at $ 25 and $ 20 respectively. There are 1800 resource units available #every day and product A requires 20 units while B requires 12 units. Both of these products require a production time of 4 minutes and total #available working hours are 8 in a day. What should be the production quantity for each of the products to maximize profits? # max(Sales) = max(25 y1 + 20 y2) library(lpSolve) objective.in = c(25,20) objective.in const = matrix (c(20,12,4,4), nrow = 2, byrow = TRUE) const time_constraints = 480 resource_contraints = 1800 rhs = c(resource_contraints,time_constraints) direction = c("<=","<=") optimum = lp(direction = "max", objective.in, const, direction, rhs) optimum$solution optimum$objval
run
|
edit
|
history
|
help
0
2q
ExDecaiEulerMin23-02-21
Controle-22-03-2021
jessray
practica 4
2
Not able to install packages
Fractal Fourier
Graph
Basic Programming