import javax.swing.*;
public class circular_fin
{
public static double eta_circular_fin(double r1,double r2,double k,double h,double t)
{ double m=Math.sqrt(2.0*h/(k*t));
double K=(Mathd.K(1,(m*r1))*Mathd.I(1,(m*r2))-Mathd.I(1,(m*r1)*Mathd.K(1,(m*r2))))/
(Mathd.K(0,(m*r1))*Mathd.I(1,(m*r2))+Mathd.I(0,(m*r1))*Mathd.K(1,(m*r2)));
  double etaf=2.0*r1/(m*(r2*r2-r1*r1))*K;
  return etaf;
}
public static void main (String args[]) 
  {  double h=80.0; //W/m^2K
     double k=200.0; //W/^mK
     double t=1e-3; //m
     double r1=1.25e-2; //m
     double r2=0.0275; //m
     double tb=190.0;  //derece C
     double tinf=40.0; //derece C
     double eff=eta_circular_fin(r1,r2,k,h,t);
     double A=2.0*Mathd.PI*(r2*r2-r1*r1);
     double qmax=A*h*(tb-tinf);
     double q=eff*qmax;
     String s="reactangular profile circular (round) fin\n"; 
     s+="h = "+h+" W/m^2K\n";
     s+="k = "+k+"W/m K\n";
     s+="t = "+t+" m \n";
     s+="r1 = "+r1+" m \n";
     s+="r2 = "+r2+" m \n";
     s+="tinfinity = "+tinf+" derece C \n";
     s+="tbase = "+tb+" derece C \n";
     s+="fin efficiency = "+eff+"  \n";
     s+="qmax = "+qmax+" W  \n";
     s+="q = "+q+" W \n";
     JOptionPane.showMessageDialog(null,s);     
  }
}