function [T1,T2,T3,T4,T5,T6]=p5_32_linear_solution
  dx=.03; sigma=5.67e-8; Tsurr=295; To=95; k=15.1; h=13; Tinf=25; epsilon=.6;
  p=.01*2+.002*2; a=.01*.002;
  D=p*dx^2/(k*a);
  Told=[1 1 1 1 1 1];%intial guesses
  error=1; n=0;
  while error>1e-9
      n=n+1;
      for i=1:6
         hr_old(i)=epsilon*sigma.*((Told(i)+273).^2+Tsurr^2).*(Told(i)+273+Tsurr);
      end
  
      coeff_Matrix=[-(2+h*D+hr_old(1).*D) 1 0 0 0 0;
          1 -(2+h*D+hr_old(2).*D) 1 0 0 0;
          0 1 -(2+h*D+hr_old(3).*D) 1 0 0;
          0 0 1 -(2+h*D+hr_old(4).*D) 1 0;
          0 0 0 1 -(2+h*D+hr_old(5).*D) 1;
          0 0 0 0 2 -(2+(2*h*dx/k)+h*D+hr_old(6)*D)];
                     
      Solution_matrix=[(-To-h*D*Tinf)+hr_old(1).*D*(273-Tsurr);
          -h*D*Tinf+hr_old(2).*D*(273-Tsurr);
          -h*D*Tinf+hr_old(3).*D*(273-Tsurr);       
          -h*D*Tinf+hr_old(4).*D*(273-Tsurr);
          -h*D*Tinf+hr_old(5).*D*(273-Tsurr);
          hr_old(6).*D*(273-Tsurr)-((2*h*dx/k)+h*D)*Tinf];
      Tnew=coeff_Matrix\Solution_matrix;
      for i=1:6
          e(i)=abs(Tnew(i)-Told(i))./Tnew(i).*100;
      end
      error=sum(e);
      Told=Tnew;
  end
  T1=Tnew(1); T2=Tnew(2); T3=Tnew(3); T4=Tnew(4); T5=Tnew(5); T6=Tnew(6);
  T=[To T1 T2 T3 T4 T5 T6];
  %disp([T1 T2 T3 T4 T5 T6])
  n
  
  A_surface=[p*dx/2 p*dx p*dx p*dx p*dx p*dx (p*dx/2+a)]; 
  for i=1:7
      Q(i)=h*A_surface(i)*(T(i)-Tinf)+epsilon*sigma*A_surface(i)*((T(i)+273)^4-Tsurr^4);
  end
  disp('heat transfer (watts)')
  Qt=sum(Q)
