% Convective plate network relations expressed in Table 4-2
function [Rcond, Rconv, Vol, Bi] = CondConv1D(plate)
  [id, k, Acond, Pconv, h]=plate{1:5};
  r=plate{end};
  havg=sum(h)/length(h);
  if id=='Num'
    [Rcond, Rconv, l, Bi, Aconv] = CondConv1DNum(plate);
  else
    l=Acond/Pconv;
    Bi=havg*l/k;
    if Bi > 0.1  warning = 'CondConv: Bi > 0.1'
    end
    if id=='Rec' | id=='Bar'
      L=abs(r(2)-r(1));
      lam=sqrt(Bi).*L./l;
      Aconv=L*Pconv;
      Rcond=L*sinh(lam)/lam/k/Acond;
      Rconv=Rcond/(cosh(lam)-1)*[1,1];
    elseif id=='Cyl'
      lam=sqrt(Bi).*r./l;
      w=Acond/(2*pi*r(2));
      Aconv=pi*w./l.*(r(2).^2-r(1).^2);
      if r(1)==0
        Rconv(2)=besseli(0,lam(2))/besseli(1,lam(2))/2/pi/k/w/lam(2);
        Rconv(1)=1e9*Rconv(2);
        Rcond=Rconv(1)*(besseli(0,lam(2))-1);
      else
        E=besseli(0,lam(2)).*besselk(0,lam(1))-besseli(0,lam(1)).*besselk(0,lam(2));
        Rcond=E./(2*pi*w*k);
        G=@(a,b)a.*(besseli(1,a).*besselk(0,b)+besselk(1,a).*besseli(0,b));
        Rconv(1)=Rcond./(G(lam(1),lam(2))-1);
        Rconv(2)=Rcond./(G(lam(2),lam(1))-1);
      end
      if 0 % r1->0 limit
        RcondLim=besseli(0,lam(2))*besselk(0,lam(1))/(2*pi*w)/k
        Rconv2Lim=besseli(0,lam(2))/besseli(1,lam(2))/(2*pi*w*lam(2))/k
        RcondRconv1Lim=besseli(0,lam(2))-1
        Rconv1Lim=RcondLim/RcondRconv1Lim
      end
    elseif id=='Sph'
      R=plate{6};
      B=Bi*(R/l)^2
      w=Acond/(2*pi*R*sin(r(2)/R));
      x=(1-cos(r/R))/2
      Aconv=4*pi*R^2*w/l*(x(2)-x(1));
      [iFx2, Fx2]=Fsph(B,x(2))
      [iF1_x2,F1_x2]=Fsph(B,1-x(2));
      if r(1)==0
        Rconv(2)=Fx2/x(2)/4/pi/k/w/B/iFx2;
        Rconv(1)=1e9*Rconv(2);
        Rcond=Rconv(1)*(Fx2-1);
      else
        iF1=Fsph(B,1);
        [iFx1, Fx1]=Fsph(B,x(1));
        [iF1_x1, F1_x1]=Fsph(B,1-x(1));
        Rcond=(Fx2*F1_x1-Fx1*F1_x2)/4/pi/k/w/B/iF1;
        G12=(x(1)*iFx1*F1_x2+(1-x(1))*iF1_x1*Fx2)/iF1;
        G21=(x(2)*iFx2*F1_x1+(1-x(2))*iF1_x2*Fx1)/iF1;
        Rconv=Rcond./([G12,G21]-1);
      end
      if 0 % r1->0 limit
        RcondLim=Fx2*F1_x1/4/pi/k/w/B/iF1
        RcondRconv1Lim=Fx2-1
        Rconv1Lim=RcondLim/RcondRconv1Lim
        Rconv2Lim=Fx2/x(2)/4/pi/k/w/B/iFx2
      end
    else
      error('plate id must = ''Rec'', ''Bar'', ''Cyl'' or ''Sph''');
    end
  end
  if Bi > 0.1  warning = 'CondConv: Bi > 0.1'
  end

  Phi(1)=1/Rconv(1)/Aconv/havg;
  Phi(2)=1/Rconv(2)/Aconv/havg;
  Phi(3)=1-sum(Phi(1:2));
  Vol=Aconv*l*Phi;

  if length(h)==2
    Rconv=2*[havg/h(1)*Rconv,havg/h(2)*Rconv,sum(1./h)/Phi(3)/Aconv];
    Vol(3:4)=Vol(3)/sum(h)*h;
  end
end
