import java.io.*;
import javax.swing.*;

class f3 extends f_x
{
double m;
double r1,r2;
double tetab;
double tb,tinf;

public f3(double h,double k, double t,double r1i, double r2i,double tbi,double tinfi)
{m=Math.sqrt(2.0*h/(k*t));
r1=r1i;
r2=r2i;
tb=tbi;
tinf=tinfi;
tetab=tb-tinf;
}

public double func(double r) 
{
//çözümü istenen fonksiyon	
double ff=tinf+tetab*(Mathd.bessi0(m*r)*Mathd.bessk1(m*r2)+Mathd.bessk0(m*r)*Mathd.bessi1(m*r2))/(Mathd.bessi0(m*r1)*Mathd.bessk1(m*r2)+Mathd.bessk0(m*r1)*Mathd.bessi1(m*r2));
return ff; //maksimum testi
}
}

class circularfin
{
public static void main (String args[]) throws IOException
  {  double h=30.0; //W/m^2K
     double k=220.0; //W/^mK
     double t=3e-3; //m
     double r1=2.0e-2; //m
     double r2=10.0e-2; //m
     double tb=100.0;  //derece C
     double tinf=20.0; //derece C
     f3 ff=new f3(h,k,t,r1,r2,tb,tinf);  
	 Plot.func(ff,r1,r2);
     double eff=Mathd.fin_efficiency("Circular",ff.m,r1,r2);
     double A=2.0*Mathd.PI*(r2*r2-r1*r1);
     double qmax=A*h*ff.tetab;
     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);     
  }
}
			