Mathematical Modeling Tran, Van Hoai Faculty of Computer Science & Engineering HCMC University of Technology 2012-2013 Tran Van Hoai 1 What is it ? MAXIMIZE 50D + 30C + 6M SUBJECT TO 7D + 3C + 1.5M ≤ 2000 D ≥ 100 C ≤ 500 D, C, M ≥0 D, C integers (Total profit) (Raw steel) (Contract) (Cushions) (Nonnegativity) (Discrete) Mathematical Modeling = process to translate observed or desired phenomena into mathematical expressions 2012-2013 Tran Van Hoai 2 Modeling profit • NetOffice: a company to produce – Desk (D = number of desks) – Chair (C = number of chairs) – Molded steel (M = pounds of molded steel) • Profit (net) – $50/a desk – $30/a chair – $6/a pound molded steel 50D + 30C + 6M 2012-2013 Tran Van Hoai 3 Modeling functional constraints • Raw steel – 7 pounds for a desk – 3 pounds for a chair – 1.5 pounds for a pound of molded steel 7D + 3C + 1.5M – Functional constraint 7D + 3C + 1.5M ≤ 2000 NewOffice only has 2000 pounds of raw steel 2012-2013 Tran Van Hoai 4 Modeling variable constraints • Limited number of cushions (lót nệm) C ≤ 500 • Contract commitments C ≥ 100 • Trivial constraints D, C, M ≥ 0 D, C integers 2012-2013 Tran Van Hoai 5 Solving the model is quite simple MAXIMIZE 50D + 30C + 6M SUBJECT TO 7D + 3C + 1.5M ≤ 2000 D ≥ 100 C ≤ 500 D, C, M ≥0 D, C integers Spreadsheet, WinQSB, Gurubi, COIN, ILOG,… D = 100 (desks) C = 433 (chairs) M = 2/3 (pound) 2012-2013 Tran Van Hoai 6 Mathematical models • Optimization model is to maximize/minimize a quantity that maybe restricted by a set of constraints • Prediction model is to describe/predict events given a certain conditions • Deterministic model is in which profit, cost,…assumed to be known with certainty • Stochastic model is in which (at least) one values of parameters determined by probability distributions 2012-2013 Tran Van Hoai 7 MS process – step 1: Defining the problem • General situation to apply MS/OR – Designing/implementing new operations – Evaluating ongoing set of operations – Determining/recommending corrective action for operations which producing unsatisfactory results Good principle wrong answer to right question is not fatal Right question to wrong answer is disastrous (thảm khốc) 2012-2013 Tran Van Hoai 8 Factors to be faced • • • • • • • “Fuzzy” (incomplete, conflicting) “Soft” constraints (goals or restrictions) Different opinions (worker/manager/owner) Limited budget for analyses Limited time for analyses/recommendations Political “turf wars” No idea on what is wanted (ask consultant to tell) 2012-2013 Tran Van Hoai 9 Suggested approach 1. Observe operations – Understanding at least as well as those directly involved 2. Ease into complexity 3. Recognize political realities 4. Decide what is really wanted Relate closely to models – Making company be sure of its objective 5. Identify constraints 6. Seek continuous feedback 2012-2013 Tran Van Hoai 10 Delta Hardware Store Problem statement • 3 warehouses • 1 production plant – Do not expand To find least cost distribution scheme production (from its plant, shipments from subcontractor) capacity – Subcontract To meet demands its warehouses other manufacturer (label product s by Delta) Google.com 2012-2013 Tran Van Hoai 11 MS process – step 2: Building mathematical model • “Put scattered thoughts, ideas, conflicting objectives/constraints into logical coherent decision framework” • “Mathematical modeling is an art” 2012-2013 Tran Van Hoai 12 Suggested approach 1. 2. 3. 4. Identify decision variables Quantify the objectives/constraints Construct a model shell Gather data – Consider time/cost issues 2012-2013 Tran Van Hoai 13 Decision variables & decision makers Inputs Manager PRODUCTION PROCESS $ Owner • “Controllable” or “uncontrollable” depend on who has control 2012-2013 Tran Van Hoai 14 Quick guide • Controllable input = decision variable • Uncontrollable input = parameter Hardest part to build mathematical model 1. Ask “Does the decision maker have the authority to decide the numerical value of the item?” – If answer = “yes”, it is decision variable 2. Be very precise in the units (& time frame) of each decision variable 2012-2013 Tran Van Hoai 15 Delta Hardware Store Variable definition Decision maker has no control over demand, production capacities, unit costs X1 X2 X3 X4 X5 X6 Amount of paint shipped from Phoenix to San Jose Amount of paint shipped from Phoenix to Fresno Amount of paint shipped from Phoenix to Azusa Amount of paint subcontracted for San Jose Amount of paint subcontracted for Fresno Amount of paint subcontracted for Azusa 2012-2013 Tran Van Hoai 16 Quantify objective/constraints Total profit = Total revenues – Total cost • Often, there is single objective function ≥2 objective functions → multicriteria decision problem • Constraints can be definitional in nature – Artificial constraints can be added to strengthen model 2012-2013 Tran Van Hoai 17 Quick guide • Create limiting condition in words as follows (amount of resource required) (Has some relation to) (Availability of the resource) • Translate to math expressions, using known, parameters, and variables • Move variables to left side, constants to right side • Construct model shell – Use generic symbols for parameters (until actual data determined) 2012-2013 Tran Van Hoai 18 Delta Hardware Store Additional observation • Additional information – Finite production capacity at Phoenix plant – Limited amount of paint available from subcontractor – Different requirements for 3 warehouses – Orders in unit of 1000 gallons of paints (=a truck delivery), cost = f( time, distance ) – Subcontractor charges fixed fee for a 1000-gallon order, a delivery charge for each city 2012-2013 Tran Van Hoai 19 Delta Hardware Store Informal model • Create a model in words Minimize overall monthly cost (manufacturing, transporting, subcontracting) Subject to 1. Phoenix plant cannot operate beyond its capacity 2. Amount order to subcontractor is not over a maximum limit 3. Orders at each warehouse will be fulfilled 2012-2013 Tran Van Hoai 20 Objective function M T1, T2 T3 C S1, S2 S3 Manufacturing cost at Phoenix plant Shipping cost from Phoenix to San Jose, Fresno, Azusa Fixed cost per 1000 gallons from subcontractor Shipping charge by subcontractor to San Jose, Fresno, Azusa MINIMIZE 2012-2013 (M+T1)X1+ (M+T2)X2+ (M+T3)X3+ (C+S1)X4+ (C+S2)X5+ (C+S3)X6 Tran Van Hoai 21 Constraints (1) Q1 Q2 R1 R 2 R3 Capacity of the Phoenix plant Maximum number of gallons available from subcontractor Respective orders at warehouses in San Jose, Fresno, Azusa 1. Number of truckloads shipped out from Phoenix cannot exceed plant capacity X1 + X2 + X3 ≤ Q1 2. Number of gallons ordered from subcontractor cannot exceed order limit X4 + X5 + X6 ≤ Q2 2012-2013 Tran Van Hoai 22 Constraints (2) 3. Number of gallons received at each warehouse equals to its total order X1 + X4 = R1 X2 + X5 = R2 X3 + X6 = R3 4. All shipments are nonnegative and integers X1, X2, X3, X4, X5, X6 ≥ 0 X1, X2, X3, X4, X5, X6 integer Need gathering (or approximating) data for parameters 2012-2013 Tran Van Hoai 23 Data gathering- time/cost issues • Time/cost of collecting, organizing, sorting relevant – “Hard” data >< “soft” data – Harder the data, moreOF costly/time RULE THUMBconsuming to obtaint “Pareto principle” or “80/20 rule” • Time/cost of generating solution approach – Simplifying solution technique can lead to unrealistic business client settles 80% of optimal solution • ATime/cost of using thefor model at 20% cost torapidly obtaintoitdynamic – Management mustofrespond business → impact on model selected 2012-2013 Tran Van Hoai 24 Delta Hardware Store Data gathering • Simplify the problem – Transportation problem with only cost for manufacturing, ordering, transportation – Partial truckload, wholesale pricing, timedependent cost,…are ignored R1 R2 R3 Q2 2012-2013 4 2 5 5 S1 S2 S3 C Tran Van Hoai $1200 $1400 $1100 $5000 25 Production limit • No plant runs continuously at full capacity – due to machine failure, partial staffing, limited resource • Two possibilities Q1 = AVG(production)past months = 7.9 (~8) – Theoretical production limit * reduction factor – Ask plant manager “what is best estimations?” – Make a forecast • E.g., compute an average production (except outlier) 2012-2013 Tran Van Hoai 26 Plant product/transportation costs • Production cost – Direct: $2.25 M = $3.00 * 1000 = $3000 – Indirect: $6000/8000 Q1 = $100 + $150 + $800 = $1050 • Transportation cost Q2 = $100 + $100 + $555 = $750 – LoadingQ(at=Phoenex): $100 $100 + $120 + $430 = $650 3 – Unloading: (San Jose) $150, (Fresno) $100, (Azusa) $120 – Mileage: (to San Jose) $800, (to Fresno) $550, (to Azusa) $430 2012-2013 Tran Van Hoai 27 Final model Minimize 4050X1 + 3750X2 + 3650X3 + 6200X4 + 6400X5 + 6100X6 S.t. X1 + X2 + X3 ≤ 8 X4 + X5 + X6 ≤ 5 X1 + X4 = 4 X2 + X5 = 2 X3 + X6 = 4 Xi ≥ 0, integer i=1,…,6 2012-2013 Tran Van Hoai 28 MS process – step 3: Solving mathematical model • • • • • Choose an appropriate solution techniques Generate model solutions Test/Validate model results Return to modeling step if unacceptable results Perform “what-if” analyses Cost/time must be considered Large classes of problems have efficient solution techniques 2012-2013 Tran Van Hoai 29 How to choose solution techniques? • Can apply observation of experts Woolsey’s Laws - Managers would rather live with a problem they can’t solve than use a technique they don’t trust - Managers don’t want the best solution, they simply want a better one - If the solution technique will cost you more than you will save, don’t use it 2012-2013 Tran Van Hoai 30 Test/Validate model results • Due to simplification, optimal/heuristical, simulated solutions Good solutions are not for real-life situation • We need test/validate to answer Testing/Validating time-consuming – Do the results makeissense ? Intuitive ? process Historical/Simulated (hypothetical) data can be used – Can solution be integrated in current conditions ? Changes needed ? – Does solution modify plans of the organization ? 2012-2013 Tran Van Hoai 31 Iterative development Analysist Manager MODEL – SOLVE – VERIFY • If one team not successful, other team comes with fresh mind 2012-2013 Tran Van Hoai 32 What-if analyses • Computer solution to a model is “an answer” for the model • Managers need anticipating more – Management concerns – Potential new opportunities – Possible changes What-if 2012-2013 Tran Van Hoai 33 Report Adjustable Cells Final Cell $B$13 $C$13 $D$13 $B$14 $C$14 $D$14 Name PHOENIX PLANT SAN JOSE PHOENIX PLANT FRESNO PHOENIX PLANT AZUSA SUBCONTRACTOR SAN JOSE SUBCONTRACTOR FRESNO SUBCONTRACTOR AZUSA 2012-2013 Value Reduced Objective Allowable Allowable Coefficie Cost nt Increase Decrease 1 0 4050 2150 300 2 0 3750 500 1E+30 5 0 3650 300 1E+30 3 0 6200 300 2150 0 500 6400 1E+30 500 0 300 6100 1E+30 300 Tran Van Hoai 34 MS process – step 4: Communicating/Implementing results • Prepare a business report/presentation • Monitor the progress of the implementation HOMEWORK Read textbook -1.5. Writing business report/memos -1.6 . Using speadsheets in management science models -2.5. Using Excel Solver to find an optimal solution and analyze results 2012-2013 Tran Van Hoai 35 Next • Linear Programming Models • Integer Linear Programming Models 2012-2013 Tran Van Hoai 36