Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chp4 Tutorial: Prob 4.25 Solution

Similar presentations


Presentation on theme: "Chp4 Tutorial: Prob 4.25 Solution"— Presentation transcript:

1 Chp4 Tutorial: Prob 4.25 Solution
Engineering 25 Chp4 Tutorial: Prob 4.25 Solution Bruce Mayer, PE Licensed Electrical & Mechanical Engineer

2 The Situation Optimize Distribution Center Location for Customers:  

3

4

5

6 The Final Hand Notes

7 GamePlan Illustrated Set x-value (m-index) Test 31 y-values (n-index)
Increment x-value (m = m+1) Test 31 new y-values Repeat

8 The Function File Prob4_25_Dense_Road.m % Bruce Mayer, PE * 21Feb06
% ENGR25 * Problem 4-25 % file = Prob4_25_Dense_Road.m % Find Optimum Location for Shipping Distribution Center % % INPUT SECTION - Data For Six Shipping Destinations xloc = [1,7,8,17,22,27]; % X-CoOrd in Miles yloc = [28,18,16,2,10,8]; % Y-CoOrd in Miles V = [3,7,4,5,2,6]; % Shipping Volume in Tons/Week % Initialize Low-Cost Location & CoOrds Collection Vectors %% Units for Collection Vectors: [$-Cost, X-miles, Y-Miles] C_Lo = [1e6, 31, 31]; C_L1 = [1e6, 31, 31]; C_L2 = [1e6, 31, 31]; % CALCULATION SECTION % vary X&Y for Dist Cntr; calc cost at each location for m = 1:30 % vary X-CoOrd for n = 1:30 % vary Y-CoOrd for k = 1:6 % Calc Dist & Cost for 6 Destinations d(k) = sqrt((m-xloc(k)).^2 + (n-yloc(k)).^2); cost(k) = 0.5*d(k)*V(k); end % Sum the 6 costs for location (m,n) Cmn = sum(cost); % Compare to Previous value for Low-Cost if Cmn < C_Lo(1) % replace previous if true C_L2 = C_L1; C_L1 = C_Lo; C_Lo = [Cmn, m, n]; % REPORT RESULTS display('The LOWEST-Cost Option in [$-cost, X-miles, y-miles]') disp(C_Lo) display('The 2nd Lowest-Cost Option in [$-cost, X-miles, y-miles]') disp(C_L1) display('The 3rd Lowest-Cost Option in [$-cost, X-miles, y-miles]') disp(C_L2)

9 The Command Session >> run Prob4_25_Dense_Road
The LOWEST-Cost Option in [$-cost, X-miles, y-miles] The 2nd Lowest-Cost Option in [$-cost, X-miles, y-miles] The 3rd Lowest-Cost Option in [$-cost, X-miles, y-miles]


Download ppt "Chp4 Tutorial: Prob 4.25 Solution"

Similar presentations


Ads by Google