% % Written by: % -- % John L. Weatherwax 2006-05-12 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % %----- close all; % The amount of product #1 to produce: % p_1 = linspace( 0, 20000, 100 ); % % Part (b): % figure; % Plot the machine hours constraint: fh1=plot( p_1, (1/4)*(20000 - 3*p_1), '-r' ); hold on; % With a reinvestment strategy: fh2=plot( p_1, (1/0.38)*(4000 - 0.3*p_1), '-b' ); hold on; % Without a reinvestment strategy: %plot( p_1, (1/2)*(4000 - 3*p_1), '-b' ); hold on; % Plot contours of constant profit: P=10*10^3; fh3=plot( p_1, (1/3.78)*(P-3.9*p_1), '-g' ); xlabel( 'Amount of product #1 to produce' ); ylabel( 'Amount of product #2 to produce' ); title( '' ); legend( [ fh1 fh2 fh3 ], { 'Machine hours constraint', ... 'Production cost constraint', ... 'Example isoprofit line' }, ... 'location', 'northeast' ); axis( [ 0 Inf 0 Inf ] ); saveas( gcf, 'Graphics/ex_1_14_b.eps', 'psc2' ); p_1 = 20000/3; p_2 = 0; 0.65*6*p_1 + 0.7*5.4*p_2 p_1 = 0; p_2 = 5000; 0.65*6*p_1 + 0.7*5.4*p_2 % % Part (c): % % The amount of product #1 to produce: % p_1 = linspace( 0, 20000, 100 ); figure; % Plot the machine hours constraint: fh1=plot( p_1, (1/4)*(20200 - 3*p_1), '-xr' ); hold on; % With a reinvestment strategy: fh2=plot( p_1, (1/0.38)*(4000 - 0.3*p_1), '-xb' ); hold on; % Without a reinvestment strategy: %plot( p_1, (1/2)*(4000 - 3*p_1), '-b' ); hold on; % Plot conours of constant profit: P=10*10^3; fh3=plot( p_1, (1/3.78)*(P+400-3.9*p_1), '-xg' ); xlabel( 'Amount of product #1 to produce' ); ylabel( 'Amount of product #2 to produce' ); title( '' ); legend( [ fh1 fh2 fh3 ], { 'Machine hours constraint', ... 'Production cost constraint', ... 'Example isoprofit line' }, ... 'location', 'northeast' ); axis( [ 0 Inf 0 Inf ] ); saveas( gcf, 'Graphics/ex_1_14_c.eps', 'psc2' ); p_1 = 20200/3; p_2 = 0; 0.65*6*p_1 + 0.7*5.4*p_2 - 400 p_1 = 0; p_2 = 20200/4; 0.65*6*p_1 + 0.7*5.4*p_2 - 400