public class MBWRData extends Object
{
//this class reads and store Modified benedict Webb Rubin  data
public String refrigerantName;
public String openName;
public double mf,mf1;
public double M,R,BP,Tc,Pc,dc,vc;
public double B[];
public double acp[];
public double aVP[][];
public double adf[];
public double aa[];
public double Tr,hr,sr,hlgr,slgr;
public double tl[];
public double th[];
public double vg[];
   public MBWRData(String refrigerantNamei,String openNamei,double mfi,double mf1i,
   double Mi,double Ri,double BPi,
   double Tci,double Pci, double dci,double vci,
   double b1,double b2, double b3, double b4, double b5, double b6, double b7, double b8, double b9, double b10,
   double b11,double b12, double b13, double b14, double b15, double b16, double b17, double b18, double b19, double b20,
   double b21,double b22, double b23, double b24, double b25, double b26, double b27, double b28, double b29, double b30,
   double b31,double b32,
   double cp1, double cp2, double cp3,
   double vg0,double vg1,double vg2, double vg3, double vg4, double vg5,
   double df1,double df2, double df3, double df4, double df5,
   double a0,double a1,double a2,double a3,double a4,double a5,double a6,double a7,double a8,
   double tri,double hri,double sri,double hlgi,double slgi)
   {
   refrigerantName=refrigerantNamei;
   openName=openNamei;
   Tr=tri;hr=hri;sr=sri;hlgr=hlgi;slgr=slgi;
   mf=mfi;
   mf1=mf1i;
   M=Mi;
   R=Ri;
   BP=BPi;
   Tc=Tci;Pc=Pci;dc=dci;vc=vci;
   B=new double[32];
   acp=new double[3];
   aVP=new double[6][10];
   adf=new double[5];
   aa=new double[9];
   tl=new double[6];
   th=new double[6];
   vg=new double[6];
   B[0]=b1;B[1]=b2;B[2]=b3;B[3]=b4;B[4]=b5;B[5]=b6;B[6]= b7;B[7]= b8;B[8]=b9;B[9]=b10;
   B[10]=b11;B[11]=b12;B[12]=b13;B[13]=b14;B[14]=b15;B[15]=b16;B[16]= b17;B[17]= b18;B[18]=b19;B[19]=b20;
   B[20]=b21;B[21]=b22;B[22]=b23;B[23]=b24;B[24]=b25;B[25]=b26;B[26]= b27;B[27]= b28;B[28]=b29;B[29]=b30;
   B[30]=b31;B[31]=b32;
   acp[0]=cp1;acp[1]=cp2;acp[2]=cp3;
   adf[0]=df1;adf[1]=df2;adf[2]=df3;adf[3]=df4;adf[4]=df5;
   vg[0]=vg0;vg[1]=vg1;vg[2]=vg2;vg[3]=vg3;vg[4]=vg4;vg[5]=vg5;
   aa[0]=a0;aa[1]=a1;aa[2]=a2;aa[3]=a3;aa[4]=a4;aa[5]=a5;aa[6]=a6;aa[7]=a7;aa[8]=a8;
   }

   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 vp10_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 vp10_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 vp10_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 vp10_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 vp10_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 vp10_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[0][9]=vp10_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[1][9]=vp10_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[2][9]=vp10_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[3][9]=vp10_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[4][9]=vp10_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;aVP[5][9]=vp10_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+="M="+M+"\n";
   s+="R="+R+"\n";
   s+="BP="+BP+"\n";
   s+=" B \n";
   for(i=0;i<B.length;i++)
   {s+=(i+1)+" "+B[i]+"\n";}
   s+=" Cp \n";
   for(i=0;i<acp.length;i++)
   {s+=(i+1)+" "+acp[i]+"\n";}
   s+=" VP \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+=" df \n";
   for(i=0;i<adf.length;i++)
   {s+=(i+1)+" "+adf[i]+"\n";}
   s+=" vg \n";
   for(i=0;i<vg.length;i++)
   {s+=(i+1)+" "+vg[i]+"\n";}
   return s;
   }
}
