blob: bd38ed1063248afc37ce77b816a2fd924876a3ce (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
clear ;
clc;
// Example 3.17
printf('Example 3.17\n\n');
printf('Page No. 80\n\n');
// given
// C_T = 7*x + (40000/(x*y)) + 6*y + 10
//Differentiating C_T with respect to x and y:-
//dC_T/dx = 7 - (40000/(x^2*y))
//dC_T/dy = - (40000/(x*y^2)) + 6
//For optimum conditions :- dC_T/dx = dC_T/dy = 0
//dC_T/dx = 0 => 7 - (40000/(x^2*y)) = 0
//=> y = 40000/(7*x^2).......(1)
//dC_T/dy = 0 =>- (40000/(y^2*x)) +6 = 0
//=> y = (40000/(6*x))^0.5.......(2)
//From equation (1) and (2)
//=> 40000/(7*x^2) - (40000/(6*x))^0.5 = 0
function y=fsol1(x)
y = 40000/(7*x^2) - (40000/(6*x))^0.5 ;
endfunction
[xres]=fsolve(20,fsol1);
x = xres;
//from equation (1)
y = 40000/(7*x^2);
//a = d^2C_T/dx^2 = 80000/(x^3*y)
//b = d^2C_T/dy^2 = 80000/(x*y^3)
a = 80000/(x^3*y);
b = 80000/(x*y^3);
if a > 0
if b > 0
//The optimum conditions must occur at a point of minimum cost- C_T_m
C_T_m = 7*x + (40000/(x*y)) + 6*y + 10;// in Pound
printf('The minimum cost is %.1f Pound',C_T_m)
end
end
|