This preview shows page 1. Sign up to view the full content.
Unformatted text preview: Let the number of components be denoted as c1, c2 and c3. Then we can get an approximate solution by solving. 15c1 + 17c2 + 19c3 = 3890 0.3c1 + 0.4c2 + 0.55c3 = 95 c1 + 1.2c2 + 1.5c3 = 282 With Matlab a=[15 17 19; 0.3 0.4 0.55; 1.0 1.2 1.5]; >> b=[3890 95 282]'; >> a\b ans = 90.0000 60.0000 80.0000 The solution, though, is sensitive to the data. If we change the 0.55 to 0.555, for example: >> a=[15 17 19; 0.3 0.4 0.555; 1.0 1.2 1.5]; >> a\b ans = 120.8571 20.0000 91.4286 In real life, it would not make sense for us to select the number of components just so we used exactly the available materials. Instead let us assume that we make one dollar profit on component 1, $2 on component 2 and $3 on component 3. Then we can define the following optimization problem to maximize our profit: Maximize c1 + 2c2 + 3c3 Such that 15c1 + 17c2 + 19c3 3890 0.3c1 + 0.4c2 + 0.55c3 95 c1 + 1.2c2 + 1.5c3 282 and c1 , c2 , c3 0 We will now use fmincon to maximize the profit. We first need to define a function that is the negative of the profit (why the negative?) profit=@(c) c(1)2*c(2)3*c(3) profit = @(c) c(1)2*c(2)3*c(3) Next we need to define a vector of lower bounds LB=zeros(3,1) LB = 0 0 0 And finally, we need to define an initial guess c0=50*ones(3,1) c0 = 50 50 50 We now call fmincon >> csol=fmincon(profit,c0,a,b,,,LB,) Warning: Largescale (trust region) method does not currently solve this type of problem, switching to mediumscale (line search). > In fmincon at 260 Optimization terminated: firstorder optimality measure less than options.TolFun and maximum constraint violation is less than options.TolCon. Active inequalities (to within options.TolCon = 1e006): lower upper ineqlin ineqnonlin 1 2 2 csol = 0.0000 0 172.7273 So that the solution is to make only component 3. We have to round down the solution because otherwise we will use more materials than we have. We compare the profits of the original solution and the optimum one. >> profit([90 60 80]') ans = 450 >> profit([0 0 172]') ans = 516 So that the profit increased by about 15%. We can now check the material utilization. >> a*csol ans = 1.0e+003 * 3.2818 0.0950 0.2591 We find that it is the plastic that is limiting the profit, while we actually need much less metal and a bit less rubber. ...
View
Full
Document
This note was uploaded on 03/27/2012 for the course EGM 3344 taught by Professor Raphaelhaftka during the Spring '09 term at University of Florida.
 Spring '09
 RAPHAELHAFTKA

Click to edit the document details