Home > final > bisection_temp06.m

bisection_temp06

PURPOSE ^

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 T = 50:1:120;
0002 K = 1:0.01:5;
0003 P = zeros(length(T),length(K));
0004 H = 0.1;
0005 threshold = 0.5;
0006 for i=1:length(T)
0007     target = T(i);
0008     for j=1:length(K)
0009         a = 0;
0010         b = 1;
0011         
0012         %find a b on the opposite side of the target
0013         while max(max(fin06(0,4,0,4,0.1,10,10,b,K(j),H))) < target
0014             b = b + 1;
0015         end
0016     
0017         [w_a,T_a] = fin06(0,4,0,4,0.1,10,10,a,K(j),H);
0018         [w_b,T_b] = fin06(0,4,0,4,0.1,10,10,b,K(j),H);
0019         %make sure that a and b are on opposite sides of the target
0020         if ( (T_a<target) && (T_b>target) )
0021             [w_c, T_c] = fin06(0,4,0,4,0.1,10,10,(a+b)/2.0,K(j),H);
0022             while abs(T_c - target)/2 > threshold
0023                 if T_c < target
0024                     a = (a+b)/2.0;
0025                 else
0026                     b = (a+b)/2.0;
0027                 end
0028                 [w_c, T_c] = fin06(0,4,0,4,0.1,10,10,(a+b)/2.0,K(j),H);
0029             end
0030         else
0031             disp('error: T_a and T_b on same side of target')
0032             K(j)
0033         end
0034         P(i,j) = (a+b)/2.0;
0035     end
0036 end
0037 mesh(K,T,P);
0038 title('Dependence of Power on Thermal Conductivity and Temperature');
0039 xlabel('Thermal Conductivity [W / cm*C]');
0040 ylabel('Max Temperature [C]');
0041 zlabel('Power [W]');

Generated on Mon 14-Apr-2014 16:57:11 by m2html © 2005