import javax.swing.*;

class fa extends f_xir
{	public double a[][]={{2.343258042317096,0.8820615877704385,1.2911045628377356,-0.017866152290354063},
{2.468630990978144,0.8068234655552395,1.3180534002356878,0.005583961337656004},
{2.7622762518524793,0.8515230792265603,1.3281049160404539,-0.016864403932969785},
{3.037906217865137,0.8208537131380701,1.343547497508343,-0.02186049426133758}};
    double H[]={0.3,0.6,0.9};
    double func(double x[],int i)
	{//a general surface curve fitting model	
    double xx=0.0;
    //density function 		
    if(i==0)       {xx=1.0;} //logKT
    else if (i==1) {xx=Math.log(x[0]);} //logH
    else if (i==2) {xx=Math.log(x[1]);}  //logdT
    else if (i==3) {xx=x[0]*Math.log(x[1]);} //Hlogdt
    else if (i==4) {Math.log(x[2]);}
    return xx;
	}

public double Q(int j,double x[])
{ double e[]=a[j];
int n=e.length;
double ff=0;
if(n!=0.0)
  { 
  for(int i=n-1;i>=0;i--)
   {ff+=e[i]*func(x,i);}
  } 
return Math.exp(ff);
}

public double[] Qi(double dT,double H)
{    //same H for each type R11,R21,R22 and R33
	 double Q[]=new double[4];
     double x[]={H,dT};
     for(int i=0;i<4;i++)
       {Q[i]=Q(i,x);}
     return Q;  	
}

public double[][] Qi(double dT)
{    //same H for each type R11,R21,R22 and R33
	 double Q[][]=new double[3][4];
     for(int j=0;j<3;j++)
     {
     for(int i=0;i<4;i++)
       {double x[]={H[j],dT};
       Q[j][i]=Q(i,x);
       }
     }  
     return Q;  	
}
public double[][] HQi(double dT)
{    //same H for each type R11,R21,R22 and R33
	 double Q[][]=new double[3][5];
     for(int j=0;j<3;j++)
     { Q[j][0]=H[j];
     for(int i=1;i<5;i++)
       {double x[]={H[j],dT};
       Q[j][i]=Q((i-1),x);
       }
     }  
     return Q;  	
}
public void print(double dT)
{String s[]={"H yükseklik m","ECA Tip 11","ECA Tip 21","ECA Tip 22","ECA Tip 33"};
 Text.print(HQi(dT),s,"Radyatör ısı transferi Q Watt boy L=1 m "+'\u0394'+"T = "+dT+'\u00B0'+"C");
}

}

public class ELBA_radyator
{    public static void main(String arg[])
     {
     double dT=Double.parseDouble(JOptionPane.showInputDialog(" dT"));
     double H=Double.parseDouble(JOptionPane.showInputDialog(" H:"));
     fa f=new fa();
     String s[]={"R11","R21","R22","R33"};
     f.print(dT);

     }
}