%solution of heat conduction equation with fixed temp b.c. and convective b.c. 
  %fin cooling problem
  clear;
  nn=20;n=nn-1;h=1000;k=20;l=1;dx=l/n;
  th=.1;w=1;p=2*(th+w);area=th*w;m2=h*p/(k*area);
  %tri-diagonal coeffients
  a=diag(eye(n));
  b=(-2-m2*dx*dx)*diag(eye(n));
  c=diag(eye(n));
  d=diag(zeros(n));
  a(1)=0; c(n)=0;
  %modify coeffts for fictitious pt. b.c. 
  t(1)=100; 
  d(1)=-t(1); 
  a(n)=2;b(n)=b(n)-2*h*dx/k;
  %call tri-diagonal solver
  t(2:nn)=trid(a,b,c,d)
