2009) 4 (22مجلة ابن الھیثم للعلوم الصرفة والتطبیقیة المجلد من شهر الى شهر حتىالتنبؤ N من السنین لتخطیط مصنع انتاجي سمیر عبد الوهاب فهد جامعة بغداد، ابن الهیثم -كلیة التربیة ،قسم الحاسبات الخالصة تخطیط االنتاج، الخزین، القوى العاملة، المبیعات واالسعار حتى نبؤ هذا البحث یوفر طریقة ت من N شهري ل . ات الطالب المستقبلير السابق مع األخذ باألعتبار تنبؤكل القرارات الشهریة سوف تعتمد على القرارات للشه. السنین تقنیة برمجة الحاسوب لتعظیم مدیر المصنع یستطیع تشغیل البرنامج في أي شهر من السنة، هذه الطریقة انجزت ب االرباح IBN AL- HAITHAM J. FOR PURE & APPL. SCI. VOL.22 (4) 2009 Month – to – Month Until N Years Prediction for Planning a Productive Firm S.A.Fahad Department of Computer , Ibn-Al-Haitham College of Education , University of Baghdad Abstract This paper offers a monthly prediction method for planning production, inventory, work- force, sales and prices until N years. Each monthly decision will depend on last month, decisions and take in consideration the future forecasted demand. The manager can run the program in any month within a year. This method is executed by computer programming technique to maximize profits. 1. Introduction In the field of production, inventory and man power control, H.M.M.S. in their text [1] developed a dynamic model to p lan aggregate production rate of a firm and setting the size of its work-force which frequently both complex and difficult. The quality of these decisions can be of great importance to the profitability of an individual company, and when viewed on a national scale these decisions have a significant influence on the efficiency of the economy as a whole. They formalized a quadratic function cost as summation of the following costs: a. a. Regular payroll cost = c1Wt + c13 (1.1) b. Hiring and Layoff costs = c2(Wt – Wt – 1 – c11) 2 (1.2) c. Over time and Idle time costs = c3 (Pt – c4 Wt) 2 + c5Pt – c6Wt + c12 PtWt (1.3) d. Inventory related costs = c7 [It – (c8 + c9 St)] 2 (1.4) the function subject to the following restriction It  It – 1 + Pt – St (1.5) where Pt = production rate required in period t. It = level of inventory at the end of period t. Wt = level of work-force required during period t. St = shipment in month t. c1 - c13 numerical constants which must be evaluated from historical costs. By using partial drivitive with this function they have got a linear decision rule for Pt and It. 2.Prediction Model Recently, the model of H.M.M.S. was developed by introducing price variable to influence on the ordering pattern (see [2]), hopefully to move heavy demand away from peak periods and smoothing Pt, It and Wt and reducing costs. He used the following inverse price- demand. Ot = a – bt p t (2.1) IBN AL- HAITHAM J. FOR PURE & APPL. SCI. VOL.22 (4) 2009 where Ot = the forecasted order. a = maximum productive capacity . bt = the measure of change in demand per unit change in price. a = optimal value of labour productivity x initial level of work-force x possible maximum shift ratio x v i.e. a = c4 W0 x N x v where number of shiftspossiblePerday N numberof shiftsworked Perday  v = a factor to compensete for unknown components in the productive capacity and for any large forecasted demands in the interval t = 1 to t = 12. So equation (2.1) becomes: Ot = c4 W0 x N x v – bt p t (2.2) By substituting equation (2.2) in equation (1.4) above yield to Inventory connected costs = c7 [ It – c8 – c9 (c4W0 x N x v – bt p t)] 2 (2.3) As a result of using price variable (pt) the manufacturer bears the following cost Opportunity cost = Q·Pc – T t t 1 p   (c4 W0 x N x v – bt p t) (2.4) where Pc = the (constant) selling price. Q = the total quantity that would have been sold during the period t = 1 to t = T. The total cost function is a summation of the equations (1.1), (1.2), (1.3), (2.3) and (2.4) T T t 1 c    {(c1– c6)Wt + c13 + c2(Wt – Wt – 1 – c11) 2 + c3 (Pt – c4 Wt) 2 + c5 Pt + c12 Pt Wt +c7 [It –c8 – c9 (c4 W0 x N x v – bt p t)] 2 – pt (c4 W0 x N x v – bt p t)} + Q·Pc (2.5) subject to the following restriction It = It – 1 + Pt – c4W0 x N x v + bt p t (2.6) By differentiating CT with respect to Wr, Ir and pr result a linear decision rules as follows: Pt = g1 – g2 Wt – 1 + g3 Wt – g2 Wt + 1 (2.7) It = C26(t) + C27(t) Wt – 1 – C28(t) Wt + C29(t) Wt + 1 – C30(t) Wt + 2 (2.8) pt = C36(t) – C37(t) Wt – 1 + C38(t) Wt – C39(t) Wt + 1 + C40(t) Wt + 2 (2.9) By substituting the decision variables Pt, It and pt above in equation (2.6) obtain for t > 1 C27(t) Wt – 2 – C41(t) Wt – 1 + C42(t) Wt – C43(t) Wt + 1 + C44(t) Wt + 2 = c4W0 x N x v – C45(t) (2.10) and for t = 1 C47(1) W1 – C48(1) W2 + C49(1) W3 = c4W0 x N x v – I0 + C46(1) W0 – C50(1) (2.11) From equations 2.10 and 2.11, we have got 12-period of simultaneous linear equations to be solved for optimizing values of Wt and by adding two more unknowns in the end of 12- periods W10 = W11 = W12 and applying the Gauss-Jordan method y ields to obtain Wt, t = 1 to 14. The researcher designed his program (pred.) to compute decision variables for one year from month 1 to 12 as well as cost and profit. This program is very useful to manager or the planner for a short-time when use it in the end of a year for preparation of budgets for next year as well as offer an indications about the size of a decision variables rules. IBN AL- HAITHAM J. FOR PURE & APPL. SCI. VOL.22 (4) 2009 3.Month-to-Month until N Years Prediction: 3.1 Long-Term Prediction As there is an short-term prediction, there is a long term prediction. Harvey, M.Wagner (3,p.383) goes farther than that and says: Unquestionably most, if not all, decision-making is part of an unending history of actions. Earlier choices have affected the present, current decisions will influence the future, and so on. In this light, all models must be viewed as imbedded in an unbounded horizon. According to that the cost function (2.5) above becomes N 12 t T 1 t 1 C    (3. 1.1) where N = number of years Also, for the time-series decision quantitative variables Pt, It defined in equations (2.7) and [2.8] respectively which were applicable for any t, become N 12 t T 1 t 1 P    (3. 1.2) N 12 t T 1 t 1 I    (3. 1.3) 3.2 Month-to-Month until N Years Prediction: The best prediction is when the present prediction is very close to immediately preceding period and predecessor periods. The shorter the interval between successive reviews and the greater the detail, the more likely are forecasts made by judgment and intuition to be unduly influenced by recent events, [4]. a.The preceding period became real decisions which include inventory (It – 1) and work- force size (Wt – 1) and these variables would sharluded in present time (t) to predict the decision variables according to the equations (2.6), (2.7), (2.8), (2.9), (2.10), (2.11). b.For the predecessor periods would share in present period (t) to predict the decision variables when the system of equations (2.10) and (2.11) requires values of forecasted demand for periods (months) t to t + 11, (values of bt in equation (2.2)). So, to obtain values for the decision variables for one month we would need 12 monthly values of forecasted demand for: 12 months predicted values we would need 23 values of forecasted monthly demand: for 24 months predicted values we would need 35 values of forecasted demand, and so on. This method will let the decision variables keep up with forecasted demand throughout planning horizon. 3.3Running the Program in any Month: The planner knows the prediction is prediction and not always compatible with changes in the market such as actual sales greater than or less than predicted sales yield to actual inventory less than or greater than predicted inventory and influence the work-force size. The It and Wt becomes initial inventory and initial work-force respectively for period t + 1. So rerun the program from period t + 1 and provide it with new values for I0 and W0. In this case the variable II represents the difference between t = 1 and the new period (month) for example the new period = 7 then II = 7 – 1 = 6. This variable will be an input variable, in the normal case will be equal to zero, see table (3-3- 1). The program was written which was referred to as the (Pred.1) which was designed to execute the three cases (3-1, 3-2 and 3-3) above. Details of this program are given in section 5 below. IBN AL- HAITHAM J. FOR PURE & APPL. SCI. VOL.22 (4) 2009 If we give the two programs Pred. and Pred.1 the same input data the results will be compatible in the first period (month) only. 4.Results and Comparisons with H.M.M.S. Model: To execute the program Pred.1, we need data of H.M.M.S. paint factory which are available in [1] and [2]. But the factor v in equation (2.2) is not available, [2] specified the relationship between this factor and the decision variables as well as with costs and profit. He proved that the increase in value of v yields to the increase in the revenue and profits. So it is easy to let the methods used in this research better than the results of H.M.M.S. but it is not fair to do so. One of the main purposes of H.M.M.S., pred. and this model is to smooth out the time-series representing fluctuations in work-force, production, inventory levels. Work-force smoothing yields to smooth out the other decision variables according to the formulation of equations (2.7), (2.8), (2.9). Therefore the value of v will be chosen after many running of the program until we get the best smooth for work-force and year after year until N years. Thus the preferred set of v for five years are (0.9,0.9,1,1,1). The output of program is as follows: a. Three tables for each year, first table for decision variables (Pt,It,Wt,pt) for each month and yearly total of Pt and I t. Second table is for monthly basic costs and then total for each month and total for each of them in a year. This table is not important to be listed in this research while the second table in b below is a good breviary for the costs. The third table contains the sales, revenue, other cost and profit for each month and their total for a year. These tables will be repeated each year until N years, see tables from (4-1) to (4-10) below. b. Final results in the end of N years will be three tables, first table is listing the yearly total of inventory, production and sales and their summation in the N years. Second table is listing the yearly total of each kind of cost and their summation in the end of N years. Third table is listing the yearly total of revenue, other cost and profit and their summation in the end of N years, see tables (4-11) to (4-13). The other cost = production rate  OC where OC = the other cost per unit of production. c. Comparison with H.M.M.S. Model. Table (4-14) shows the maximum and minimum for work-force, production rate, inventory rate and sales and also the variation for both models. It is clearly that variation in our model is considerably less than H.M.M.S. model. And this smooting is effective in increasing the profit and reducing costs. In the real life, the decision maker will choose value for v factor to spcify his productive copacity according to his experience and knowledge in the market, (5,p .400) say, Predictions require skill, experience, and judgment, not all time series can be successfully predicted. 5.Main Steps of the Program The program (Pred.1) is written in general to accept any number of years by changing the input variable I R and provde the program monthly historical demand MSL = (I R + 1)  12. Execution time is 13 seconds for 5 years planning and consist of 435 programming instructions and statements. 1. variables declaration. 2. Read I R, Alpha, crival, forca. 3. MSL = (I R + 1)  12. 4. Declaration of dimensions. IBN AL- HAITHAM J. FOR PURE & APPL. SCI. VOL.22 (4) 2009 5. Read I0, W0 and II. 6. From I = 1 to MSL read SL(I). 7. compute G1, G2 to G6 and common terms. 8. K= 1, M = 12 and IYLO = 0. 9. print c1 to c13, I0 and W0. 10. Test for forecasting method to be used = 1 12month moving average forecasting subroutine forca = 2 exponential weighted average subroutine = 3 forecosted sales equal to actual demands see [6], [7], [8] and [9]. 11. Read PC and SHN(N in equation (2.2)). 12. Yearly loop IY = 1 to I R. 13. Read v. 14. Monthly computations, bt must be > 0 from equation (2.2). 15. N = 14 and Jmax = N + 1 to book area in the memory for the matrix to build up simultaneous linear equations according to equations (2.10) and (2.11) and applying the Gauss-Jordan method to get Wt, t = 1 to 14 and we select Wt, Wt + 1 and Wt + 2 which are required in equations (2.7), (2.8) and (2.9). This step will be executed 60 times for 5 years, see [10], [11], and [12]. 16. From I = K + II to M – 11 + II compute c26 – c40 and for I > 1 + II compute Pt, It and pt else for I = 1 + II compute Pt, It and pt. 17. From I = K +II to m – 11 + II compute costs for t = 1 and t > 1. 18. From I = K + II to M – 11 + II compute sales, other cost, revenue and profit. Also compute check from equation (2.6) which must equal to zero otherwise there is an error in mathematical operations of this model or in programming of the model. 19. If the reminder of 12  = zero step 20 Otherwise K = K + 1 M = M + 1 Go back to step 14 20. print out monthly results within each year KS = K – 11 + II MS = M – 11 From I = KS to MS print out the three tables explained in 4.a above. 21. K = K + 1 M = M + 1 II = 0 Go back to step 12 to compute another year. 22. From IY = 1 to IR print table of yearly total for Pt, It and St. And the same for costs and another for revenue, other cost and profit. References 1. Holt, C.; Modigiliani, F.; Muth, J. and Simon, H.A. (1960), Planning, Production, Inventories and Work-Force Prentice-Hall, Englewood Cliffs, N.J. 2. Fahad, S.A., (2008). Mathematical Model for One Year Planning of a Manufactory , Ibn- Al-Haitham Journal for Pure and Applied Sciences, Baghdad University, 21(4). IBN AL- HAITHAM J. FOR PURE & APPL. SCI. VOL.22 (4) 2009 3. Harvey, M.Wagner, (1975), Principles of Operations Research with Applications to Managerial Decisions, Prentice-Hall, International, Inc., London, 2 nd Edition. 4. Coutie, G.A.; Davies, O.L.; and Hossell, C.H. (1964), Mathematical and Statistical Techniques for Industry, Monograph, No.2, Short Term Forecasting, Oliver &Boyd, Edinburgh. 5. Lynwood, A.;Johnson, Douglas, C.Montgomery, (1973), Operations Research in Production Planning, Scheduling and Inventory Control, Johnwiley & Sons, INC; New York, London. 6. Lewis, C.D. (1970), Scientific Inventory Control, Butterworth Press. 7. Pindyck, R.S. and Rubinfeld, D.L., (1976). Econometric Models and Economic Forecasts, M c GRAW-Hill Book Company, 4 th . Edi.. 8. Brown, R.G. (1959), Statistical Forecasting for Inventory Control, Mc Graw-Hill, New York. 9. Trigg, D.W. (1964), Monitoring a Forecating System, Op. Res. Qtly, 15. 10. Philips and Taylor, (1973), Theory and Applications of Numerical Analysis, Academic Press, London and New York. 11. Fox, L. (1964), An Introduction to Numerical Linear Algebra, New York:Oxford University Press. 12. Forsuthe, G. and Moler, C.B. (1967), Computer Solution of Linear Algebraic Systems, Englewood, N.J., Prentice-Hill. Table:( 3-3-1)Decision Variables when II= 6 and v = 0.9 and the same thing for cost table and profit table while the following years would be as calendar years C1 = 340.0, C2 = 64.3, C3 = 0.20, C4 = 5.67, C5 = 51.2, C6 = 281.0, C7 = 0.0825, C8 = 320.0, C9 = C11 = C12 = 0 W0 = 81 men, I0 = 275 units, Pc = 100. Month Production Inventory Work-Force Prices 7 453 296 83 94.85 8 453 307 85 91.55 9 456 311 86 92.17 10 459 312 87 91.87 11 461 313 88 90.84 12 463 315 88 88.91 2751.6 1847.7 IBN AL- HAITHAM J. FOR PURE & APPL. SCI. VOL.22 (4) 2009 Year 1 Table :(4-1)when v = 0.9 Table:( 4-2) when v = 0.9 Month Production Inventory Work-Force Prices 1 452. 301 81 96.5 2 443. 314 81 95.6 3 440 319 81 96.1 4 438 319 81 96.6 5 437 320 80 94.9 6 436 319 80 94.9 7 435 319 80 94.4 8 434 321 80 92.7 9 435 320 80 94.2 10 435 318 80 94.4 11 436 318 81 93.6 12 437 320 81 91.9 Tot. 5256 3807 Month Sales Revenue Oth.cost Profit Check 1 414 39973.6 2873.435 18776.96 0 2 429 41075.4 2817.999 20654.84 0 3 436 41867.89 2796.725 21261.13 0 4 438 42333.13 2786.251 21546.68 0 5 435 41322.93 2776.146 21357.3 0 6 436 41379.92 2770.126 21434.87 0 7 435 41099.93 2764.673 21424.47 0 8 432 40062.01 2759.876 21277.02 0 9 436 41023.98 2763.275 21423.31 0 10 437 41206.88 2767.50 21491.12 0 11 437 40884.56 2771.607 21449.65 0 12 435 39935.58 2777.427 21314.12 0 Tot. 5200 492165.8 33425.04 253441.5 0 IBN AL- HAITHAM J. FOR PURE & APPL. SCI. VOL.22 (4) 2009 Year 2 Table :(4-3) when v = 0.9 Table :(4-4) when v = 0.9 Month Production Inventory Work-Force Prices 13 439 321 81 92.9 14 443 321 82 94.9 15 446 320 83 97.1 16 451 321 83 98.6 17 456 324 84 99.4 18 462 334 85 101.3 19 474 330 86 122.4 20 483 322 87 135.9 21 488 319 88 138.2 22 491 313 88 143.7 23 491 312 89 135.2 24 490 318 89 124.9 Tot. 5615 3856 Month Sales Revenue Oth.cost Profit Check 13 438 40690.25 2792.539 21359.43 0 14 443 42032.51 2814.231 21516.23 0 15 447 43379.31 2839.153 21768.89 0 16 450 44415.98 2866.012 21987.49 0 17 452 44896.22 2896.898 21953.22 0 18 452 45826.44 2940.874 21961.52 0 19 479 58572.75 3013.166 21504.37 0 20 490 66637.63 3071.028 40126.72 0 21 491 67926.71 3105.166 41447.71 0 22 498 71515.66 3125.387 45976.2 0 23 492 66518.3 3123.501 39683.23 0 24 484 60402.02 3114.966 32769.11 0 Tot. 5616 652813.8 35702.92 362054.1 0 IBN AL- HAITHAM J. FOR PURE & APPL. SCI. VOL.22 (4) 2009 Year 3 Table : (4-5)when v = 1 Table : (4-6) when v = 1 Month Production Inventory Work-Force Prices 25 509 320 91 118.4 26 516 319 92 123.7 27 520 319 93 125.7 28 524 317 93 128.6 29 525 315 94 127.8 30 524 317 94 122.6 31 524 313 94 125.6 32 521 311 94 118.6 33 516 312 94 110.3 34 512 314 94 104.9 35 509 318 94 100.8 36 508 323 94 98.6 Tot. 6208 3798 Month Sales Revenue Oth.cost Profit Check 25 507 60034.6 3235.868 30126.08 0 26 517 63931.66 3278.793 33668.24 0 27 521 65442.37 3309.639 35077.97 0 28 526 67627.47 3331.249 37360.88 0 29 527 67364.36 3339.015 37100.73 0 30 522 63999.07 3334.758 33667.88 0 31 529 66436.77 3331.434 36348.96 0 32 523 61970.68 3310.569 32129.32 0 33 515 56748.36 3281.667 28072.88 0 34 510 53520.22 3256.184 26179.1 0 35 506 50955.2 3237.153 24955.89 0 36 503 49538.37 3229.369 24388.34 0 Tot. 6203 727569.1 39475.7 379076.3 0 IBN AL- HAITHAM J. FOR PURE & APPL. SCI. VOL.22 (4) 2009 Year 4 Table: (4-7) when v = 1 Table:(4-8) when v = 1 Month Production Inventory Work-Force Prices 37 509 322 94 102.8 38 511 323 94 104. 39 513 326 94 105.1 40 516 326 94 110.1 41 519 324 94 115.8 42 521 317 94 121.5 43 520 318 94 114.4 44 519 314 94 115.6 45 516 318 94 107.8 46 515 319 94 107.2 47 514 319 94 107.6 48 513 324 94 103.9 Tot. 6186 3848 Month Sales Revenue Oth.cost Profit Check 37 510 52418.7 3238.215 25750.64 0 38 510 53085.52 3247.866 26025.76 0 39 510 53589.44 3260.601 26182.69 0 40 516 56902.75 3281.733 28256.71 0 41 522 60372.86 3302.816 30857.41 0 42 529 64207.63 3316.141 34361.96 0 43 519 59354.84 3307.677 29900.3 0 44 523 60429.01 3300.306 30984.11 0 45 512 55260.47 3281.509 27081.95 0 46 513 54977.12 3271.919 27012.84 0 47 514 55325.92 3266.683 27316.17 0 48 508 52729.62 3260.28 25649.91 0 Tot. 6185 678653.9 39335.75 339380.5 0 IBN AL- HAITHAM J. FOR PURE & APPL. SCI. VOL.22 (4) 2009 Year 5 Table :( 4-9)when v = 1 Table :(4-10) when v = 1 Month Production Inventory Work-Force Prices 49 514 323 94 108.6 50 515 319 94 112.1 51 514 320 94 109.2 52 514 312 94 109.1 53 513 318 94 108.9 54 511 320 93 106.3 55 511 320 93 107. 56 510 318 93 107.5 57 508 319 93 104.5 58 507 323 93 102.6 59 508 320 93 107.8 60 507 320 93 105.5 Tot. 6132 3841 Month Sales Revenue Oth.cost Profit Check 49 515 55889.1 3268.135 27671.69 0 50 519 58168.63 3274.49 29322.01 0 51 514 56083.59 3269.85 27721.54 0 52 514 56068.57 3265.72 27750.21 0 53 514 55920.2 3260.1 27698.5 0 54 509 54136.96 3251.245 26542.92 0 55 511 54668.93 3246.956 26933.41 0 56 512 55012.54 3241.982 27213.82 0 57 507 53011.87 3231.969 25986.69 0 58 503 51601.76 3225.632 25201.28 0 59 512 55159.48 3230.654 27379.03 0 60 507 53462.98 3225.837 2625.11 0 Tot. 6135 659184.6 38992.58 325672.2 0 IBN AL- HAITHAM J. FOR PURE & APPL. SCI. VOL.22 (4) 2009 Table :(4-11)Yearly Total of Inventory, Production and Sales Table: (4-12)Yearly Total of Each Basic Cost (Regular Payroll, Hiring and Layoff, Overtime. Inventory Related and Opportunity Cost) Table: ( 4-13)Yearly Total of Revenue, Other Cost and Profit Table :(4-14)Comparison with H.M.M.S. for 5 Years Year Y.Inv. Y.Prod. Y. Sal. 1 3807 5256 5200 2 3856 5615 5616 3 3798 6208 6203 4 3848 6186 6185 5 3841 6132 6135 Tot. 19150 29397 29339 Year Y.RPAC. Y.HLC. Y.OTC. Y.INCC Y.OPC. Y.TOTC. 1 231873.3 24.76 376.40 34.33 - 27009.5 205299.3 2 246227.5 386.58 1429.44 36.23 6976.99 255056.7 3 268562.9 319.91 4259.14 24.21 35850.24 309017.1 4 270916.2 8.48 742.17 13.80 28257 299937.7 5 268669.9 10.11 229.04 2.37 25608.43 294519.8 Tot. 1286250 749.86 7036.2 110.94 69683.87 1363831 Year Y.Re v. Y.OTHC. Y. Prof. 1 492165.8 33425.04 253441.5 2 652813.8 35702.92 362054.1 3 727569.1 39475.7 379076.3 4 678653.9 39335.75 339380.5 5 659184.6 38992.58 325672.2 Tot. 3210387 186932 1659624.6 Work-force Production Inventory Sales Total Cost Profit H.M. M.S. Pred .1 H.M. M.S. Pred .1 H.M. M.S. Pred .1 H.M. M.S. Pred .1 H.M.M .S. Pred.1 H.M.M.S. Pred.1 Max . 111 94 736 525 492 334 841 529 2,290,8 50 1,550,763 1,039,573 1,659,624 Min. 66 80 359 434 117 301 289 414 ar. 45 14 377 91 375 33 552 115