| Line 223: |
Line 223: |
| | m4: 58.82352941, | | m4: 58.82352941, |
| | m2: 1500 }</source> | | m2: 1500 }</source> |
| | + | |
| | + | |
| | + | '''ExampleLP5: Manufacturing Problem<br>''' |
| | + | 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.<br> |
| | + | |
| | + | <div id="z3lp5" style="font-size:16px">'''z3 code: Manufacturing Problem'''</div> |
| | + | <source lang="cpp"> |
| | + | var solver = require('javascript-lp-solver'), |
| | + | results, |
| | + | model = { |
| | + | "name": "Manufacturing Problem", |
| | + | "optimize": "profit", |
| | + | "opType": "max", |
| | + | "constraints": { |
| | + | "time": { |
| | + | "max": 8*60 |
| | + | }, |
| | + | "resources": { |
| | + | "max": 1800 |
| | + | } |
| | + | }, |
| | + | "variables": { |
| | + | "ma": { |
| | + | "resources": 20, |
| | + | "time": 4, |
| | + | "profit": 25 |
| | + | }, |
| | + | "mb": { |
| | + | "resources": 12, |
| | + | "time": 4, |
| | + | "profit": 20 |
| | + | } |
| | + | }, |
| | + | }; |
| | + | console.log(solver.Solve(model));</source> |
| | + | |
| | + | <div style="font-size:18px">'''Solution:'''</div> |
| | + | <source lang="cpp"> |
| | + | { feasible: true, result: 2625, bounded: true, mb: 75, ma: 45 }</source> |