! University of Illinois at Urbana-Champaign ! MATH-484 - Fall 2013 ! Instructor Bernard Lidicky ! ! Better try version ! Paste this file to http://apmonitor.com/online/view_pass.php ! ! pipes problem ! 400pcs of 50cm pipes ! 100pcs of 65cm pipes ! ! How to cut the pipes if two 15 cm and one 20cm pipe is needed for ! manufacturing a final product? Maximize the number of final products. ! ! A ... # 15cm after cutting ! B ... # 30cm after cutting ! ! x[1] 15+15+20 2A+B ! x[2] 20+20 2B ! x[3] 15+15+15 3A ! ! y[1] 20+20+20 3B ! y[2] 15+15+15+15 4A ! y[3] 20+15+15+15 B+3A ! y[4] 20+20+15 2B+A ! Model pipes Parameters p[1] = 400 p[2] = 100 End Parameters Variables ! if name of a variable starts with int, it is treated as an integer variable in APMonitor intx[1:3] = 0, >= 0 inty[1:4] = 0, >= 0 a = 0, >= 0 b = 0, >= 0 c = 0, >= 0 End Variables Equations intx[1]+intx[2]+intx[3] <= p[1] inty[1]+inty[2]+inty[3]+inty[4] <= p[2] a = 2*intx[1]+3*intx[2]+4*inty[2]+3*inty[3]+inty[4] b = 2*intx[1]+2*intx[2]+3*inty[1]+inty[3]+2*inty[4] c <= 0.5*a c <= b maximize c End Equations End Model