#MIN 500XFA+600XFB+1200XFC+1000XFD+800XCA+750XCB+1800XCC+800XCD #XF=son tableros fabricados, XC= tableros comprados #!Estampado #0.05XFA+0.05XFB+0.05XFC+0.05XFD<1200 #!Armado #0.10XFA+0.12XFB+0.14XFC+0.18XFD<3600 #!Cableado #020XFA+0.25XFB+0.30XFC+0.25XFD<5000 #!Ajuste ( Entre producción ppal + rechazado 10% , divido los valores de ajuste por 0.90 ) #0.08888XFA+0.1111XFB+0.066666XFC+0.11111XFD<3000 #Control de calidad (comprados/0.8 + fabricados/0.9) - #20% de comprados vuelven a pasar por calidad, y 10% de fabricados también # 0.08888XFA+0.1111XFB+0.066666XFC+0.11111XFD+ 0.0375XCA+0.0625XCB+0.05XCC+0.05XCD<3000 #!Demanda #XFA+XCA=4000 #XFB+XCB=3000 #XFC+XCC=8000 #XFD+XCD=5000 OBJ<-c(500,600,1200,1000,800,750,1800,800) A<-matrix(ncol=8,nrow = 9) A[1, ]<-c(0.05,0.05,0.05,0.05,0,0,0,0) A[2, ]<-c(0.10,0.12,0.14,0.18,0,0,0,0) A[3, ]<-c(0.20,0.25,0.30,0.25,0,0,0,0) A[4, ]<-c(0.0888,0.111,0.0666,0.111,0,0,0,0) A[5, ]<-c(0.02222,0.03333,0.03333,0.03333,0.0375,0.0625,0.05,0.05) A[6, ]<-c(1,0,0,0,1,0,0,0) A[7, ]<-c(0,1,0,0,0,1,0,0) A[8, ]<-c(0,0,1,0,0,0,1,0) A[9,]<-c(0,0,0,1,0,0,0,1) print(A) DIR<-c("<=","<=","<=","<=","<=","=","=","=","=") rhs<-c(1200,3600,5000,3000,3000,4000,3000,8000,5000) library(lpSolve) EJER2.5<-lp("min", OBJ, A, DIR, rhs) print(EJER2.5) TABLEROS<-EJER2.5$solution print(TABLEROS)