function [T1,T2,T3,T4,T5,T6]=p5_32_Newton_Method
  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);
  T1old=1; T2old=1; T3old=1; T4old=1; T5old=1; T6old=1; %intial guesses
  error=1; n=0;
  while error>1e-9
      n=n+1;
  
      F1=T2old-2*T1old+To-h*D*(T1old-Tinf)-epsilon*sigma*D*((T1old+273).^4-Tsurr^4);
      dF1_T1=-2-h*D-4*epsilon*sigma*D*(T1old+273)^3;
      dF1_T2=1;
  
      F2=T3old-2*T2old+T1old-h*D*(T2old-Tinf)-epsilon*sigma*D*((T2old+273).^4-Tsurr^4);
      dF2_T1=1;
      dF2_T2=-2-h*D-4*epsilon*sigma*D*(T2old+273)^3;
      dF2_T3=1;
  
      F3=T4old-2*T3old+T2old-h*D*(T3old-Tinf)-epsilon*sigma*D*((T3old+273).^4-Tsurr^4);
      dF3_T2=1;
      dF3_T3=-2-h*D-4*epsilon*sigma*D*(T3old+273)^3;
      dF3_T4=1;
  
      F4=T5old-2*T4old+T3old-h*D*(T4old-Tinf)-epsilon*sigma*D*((T4old+273).^4-Tsurr^4);
      dF4_T3=1;
      dF4_T4=-2-h*D-4*epsilon*sigma*D*(T4old+273)^3;
      dF4_T5=1;
  
      F5=T6old-2*T5old+T4old-h*D*(T5old-Tinf)-epsilon*sigma*D*((T5old+273).^4-Tsurr^4);
      dF5_T4=1;
      dF5_T5=-2-h*D-4*epsilon*sigma*D*(T5old+273)^3;
      dF5_T6=1;
      
      F6=-(2+2*h*dx/k+h*D)*T6old+2*T5old-epsilon*sigma*D*((T6old+273).^4-Tsurr^4)+(2*h*dx/k+h*D)*Tinf;
      dF6_T5=2;
      dF6_T6=-2-2*h*dx/k-h*D-4*epsilon*sigma*D*(T6old+273)^3;
      
      A=[dF1_T1 dF1_T2 0 0 0 0;
          dF2_T1 dF2_T2 dF2_T3 0 0 0;
          0 dF3_T2 dF3_T3 dF3_T4 0 0;
          0 0 dF4_T3 dF4_T4 dF4_T5 0;
          0 0 0 dF5_T4 dF5_T5 dF5_T6;
          0 0 0 0 dF6_T5 dF6_T6];
      
      b=[T1old*dF1_T1+T2old*dF1_T2-F1;
          T1old*dF2_T1+T2old*dF2_T2+T3old*dF2_T3-F2;
          T2old*dF3_T2+T3old*dF3_T3+T4old*dF3_T4-F3;
          T3old*dF4_T3+T4old*dF4_T4+T5old*dF4_T5-F4;
          T4old*dF5_T4+T5old*dF5_T5+T6old*dF5_T6-F5;
          T5old*dF6_T5+T6old*dF6_T6-F6];
      Tnew=A\b;
      T1=Tnew(1); T2=Tnew(2); T3=Tnew(3); T4=Tnew(4); T5=Tnew(5); T6=Tnew(6);
      error=abs(T1old-T1)*100+abs(T2old-T2)*100+abs(T3old-T3)*100+abs(T4old-T4)*100+abs(T5old-T5)*100+abs(T6old-T6)*100;
      T1old=Tnew(1); T2old=Tnew(2); T3old=Tnew(3); 
      T4old=Tnew(4); T5old=Tnew(5); T6old=Tnew(6);
  end
  T1=T1old; T2=T2old; T3=T3old; T4=T4old; T5=T5old; T6=T6old;
  T=[To T1 T2 T3 T4 T5 T6];
  %disp([T1 T2 T3 T4 T5 T6])
  n