## Author: M Turhan ÇOBAN
## Created: 2021-10-28

## HT_plane_wall_1
  h=600.0;
  k=43;
  alpha=1.2e-5;
  L=0.05;
  t=478.8;
  Tinf=40;
  Ti=240;
  T=Ti-Tinf;
  Bi=h/k*L
  Fo=alpha*t/(L*L)
  f=@(x)x*sin(x)-Bi*cos(x);
  a=0.0;
  b=30.0;
  x=0;
  m=100;
  dx=L/(m-1);
  ksi=roots_bisection(f,0.0,30.0);
  ksi'
  n=length(ksi);
  for i=1:n ;
    Cn(i)=(Ti-Tinf)*4.0*sin(ksi(i))/(2.0*ksi(i)+sin(2.0*ksi(i)));
  endfor
  Cn'  
  theta=0.0;
  for j=1:m;
    theta=0.0;
     x=j*dx;
     for i=1:n
       theta+=Cn(i)*exp(-ksi(i)*ksi(i)*Fo)*cos(ksi(i)*x/L);
     endfor
     TT(j)=theta+Tinf;
     xx(j)=x;
   endfor
   plot(xx,TT);