public class refData extends Object
{
//this class reads and store refrigerent data
public String refrigerantName;
public String openName;
public double R;
public double b;
public double A[];
public double B[];
public double C[];
public double K;
public double u;
public double CP;
public double aVP[][];
public double tl[];
public double th[];
public double G[];
public double E[];
public double F[];
public double Pc;
public double Vc;
public double Tc;
public double M;
public double X;
public double Y;

public refData(String refrigerantNamei,String openNamei,
 double Ri, double bi,
 double A1,double B1, double C1,
 double A2,double B2, double C2,
 double A3,double B3, double C3,
 double A4,double B4, double C4,
 double A5,double B5, double C5,
 double A6,double B6, double C6,
 double Ki,double ui,double CPi,
 double G1,double G2,double G3,double G4, double G5, double G6,
 double E1,double E2,double E3,double E4, double E5,
 double F1,double F2,double F3,double F4, double F5, double F6, double F7,double F8,double F9,double F10,
 double F11,double F12,double F13,double F14, double F15, double F16, double F17,double F18,double F19,double F20,
 double F21,double F22,double F23,double F24, double F25,
 double Pci,double Vci,double Tci,double Mi,double Yi,double Xi)
   {
   refrigerantName=refrigerantNamei;
   openName=openNamei;
   R=Ri;
   b=bi;
   A=new double[6];
   B=new double[6];
   C=new double[6];
   A[0]=A1;A[1]=A2;A[2]=A3;A[3]=A4;A[4]=A5;A[5]=A6;
   B[0]=B1;B[1]=B2;B[2]=B3;B[3]=B4;B[4]=B5;B[5]=B6;
   C[0]=C1;C[1]=C2;C[2]=C3;C[3]=C4;C[4]=C5;C[5]=C6;
   K=Ki;
   u=ui;
   CP=CPi;
   aVP=new double[6][9];
   tl=new double[6];
   th=new double[6];
   G=new double[6];
   E=new double[5];
   F=new double[25];
   Pc=Pci;
   Vc=Vci;
   Tc=Tci;
   M=Mi;
   X=Xi;
   Y=Yi;
   G[0]=G1;G[1]=G2;G[2]=G3;G[3]=G4;G[4]=G5;G[5]=G6;
   E[0]=E1;E[1]=E2;E[2]=E3;E[3]=E4;E[4]=E5;
   F[0]=F1;F[1]=F2;F[2]=F3;F[3]=F4;F[4]=F5;
   F[5]=F6;F[6]=F7;F[7]=F8;F[8]=F9;F[9]=F10;
   F[10]=F11;F[11]=F12;F[12]=F13;F[13]=F14;F[14]=F15;
   F[15]=F16;F[16]=F17;F[17]=F18;F[18]=F19;F[19]=F20;
   F[20]=F21;F[21]=F22;F[22]=F23;F[23]=F24;F[24]=F25;
   }
   
   public void vapor_pressure_in(
   double vp1_1, double vp2_1, double vp3_1, double vp4_1, double vp5_1, double vp6_1,double vp7_1,double vp8_1,double vp9_1,double tl_1,double th_1,
   double vp1_2, double vp2_2, double vp3_2, double vp4_2, double vp5_2, double vp6_2,double vp7_2,double vp8_2,double vp9_2,double tl_2,double th_2,
   double vp1_3, double vp2_3, double vp3_3, double vp4_3, double vp5_3, double vp6_3,double vp7_3,double vp8_3,double vp9_3,double tl_3,double th_3,
   double vp1_4, double vp2_4, double vp3_4, double vp4_4, double vp5_4, double vp6_4,double vp7_4,double vp8_4,double vp9_4,double tl_4,double th_4,
   double vp1_5, double vp2_5, double vp3_5, double vp4_5, double vp5_5, double vp6_5,double vp7_5,double vp8_5,double vp9_5,double tl_5,double th_5,
   double vp1_6, double vp2_6, double vp3_6, double vp4_6, double vp5_6, double vp6_6,double vp7_6,double vp8_6,double vp9_6,double tl_6,double th_6)
   {
   aVP[0][0]=vp1_1;aVP[0][1]=vp2_1;aVP[0][2]=vp3_1;aVP[0][3]=vp4_1;aVP[0][4]=vp5_1;aVP[0][5]=vp6_1;aVP[0][6]=vp7_1;aVP[0][7]=vp8_1;aVP[0][8]=vp9_1;
   aVP[1][0]=vp1_2;aVP[1][1]=vp2_2;aVP[1][2]=vp3_2;aVP[1][3]=vp4_2;aVP[1][4]=vp5_2;aVP[1][5]=vp6_2;aVP[1][6]=vp7_2;aVP[1][7]=vp8_2;aVP[1][8]=vp9_2;
   aVP[2][0]=vp1_3;aVP[2][1]=vp2_3;aVP[2][2]=vp3_3;aVP[2][3]=vp4_3;aVP[2][4]=vp5_3;aVP[2][5]=vp6_3;aVP[2][6]=vp7_3;aVP[2][7]=vp8_3;aVP[2][8]=vp9_3;
   aVP[3][0]=vp1_4;aVP[3][1]=vp2_4;aVP[3][2]=vp3_4;aVP[3][3]=vp4_4;aVP[3][4]=vp5_4;aVP[3][5]=vp6_4;aVP[3][6]=vp7_4;aVP[3][7]=vp8_4;aVP[3][8]=vp9_4;
   aVP[4][0]=vp1_5;aVP[4][1]=vp2_5;aVP[4][2]=vp3_5;aVP[4][3]=vp4_5;aVP[4][4]=vp5_5;aVP[4][5]=vp6_5;aVP[4][6]=vp7_5;aVP[4][7]=vp8_5;aVP[4][8]=vp9_5;
   aVP[5][0]=vp1_6;aVP[5][1]=vp2_6;aVP[5][2]=vp3_6;aVP[5][3]=vp4_6;aVP[5][4]=vp5_6;aVP[5][5]=vp6_6;aVP[5][6]=vp7_6;aVP[5][7]=vp8_6;aVP[5][8]=vp9_6;
   tl[0]=tl_1;th[0]=th_1;
   tl[1]=tl_2;th[1]=th_2;
   tl[2]=tl_3;th[2]=th_3;
   tl[3]=tl_4;th[3]=th_4;
   tl[4]=tl_5;th[4]=th_5;
   tl[5]=tl_6;th[5]=th_6;
   }

   public String toString()
   {
   int i;
   String s="";
   s+="RN = "+refrigerantName+"\n";
   s+="RN = "+openName+"\n";
   s+="EQUATION OF STATE\n";
   s+="R="+R+"\n";
   s+="b="+b+"\n";
   s+=" A B C\n";
   for(i=0;i<A.length;i++)
   {s+=(i+1)+" "+A[i]+"\n";}
   for(i=0;i<B.length;i++)
   {s+=(i+1)+" "+B[i]+"\n";}
   for(i=0;i<C.length;i++)
   {s+=(i+1)+" "+C[i]+"\n";}
   s+="K="+K+"\n";
   s+="u="+u+"\n";
   s+="CP="+CP+"\n";
   s+="Vapor pressure equation aVp\n";
    for(int j=0;j<aVP.length;j++)
     for(i=0;i<aVP[0].length;i++)
        {s+=(j+1)+" "+ (i+1)+" "+aVP[j][i]+"\n";}
   s+="Ideal gas heat capacity equation G\n";
   for(i=0;i<G.length;i++)
   {s+=(i+1)+" "+G[i]+"\n";}
   s+="Saturated liquid density equation E\n";
   for(i=0;i<E.length;i++)
   {s+=(i+1)+" "+E[i]+"\n";}
   s+="Saturated vapor density equation E\n";
   for(i=0;i<F.length;i++)
   {s+=(i+1)+" "+F[i]+"\n";}
   s+="critical Parameters \n";
   s+="Pc="+Pc+"\n";
   s+="Vc="+Vc+"\n";
   s+="Tc="+Tc+"\n";
   s+="M="+M+"\n";
   s+="X="+X+"\n";
   s+="Y="+Y+"\n";
   return s;
   }
}
