  //options for string s: "tdb_twb"  dry bulb temperature - wet bulb temperature
  //                      "tdb_rh"   dry bulb temperature - relative nem
  //                      "tdb_w"    dry bulb temperature - specific humidity
  //                      "tdb_tdew" dry bulb temperature - dew point temperature
  //                      "tdb_pv"   dry bulb temperature - water pressure
  //                      "tdb_dos"  dry bulb temperature - degree of saturation
  //                      "tdb_h"    dry bulb temperature - entalphy
  //                      "tdb_s"    dry bulb temperature - entrophy
  //                      "w_rh"     specific humidity    - relative humifdity
  //                      "w_h"      specific humidity    -  enthalpy
  /*
  aa[0]=P;
  aa[1]=t;
  aa[2]=v;
  aa[3]=pv;
  aa[4]=Pa;
  aa[5]=w;
  aa[6]=rh;
  aa[7]=dos;
  aa[8]=h;
  aa[9]=s;
  aa[10]=tdp;
  aa[11]=ha;
  aa[12]=hv;
  aa[13]=w*hv;
  */
  //steam options
  //sp[0] p
  //sp[1] t
  //sp[2] v
  //sp[3] h
  //sp[4] u
  //sp[5] s
//cases of String s
// tv tp th tu ts tx
// pv    pt ph pu ps px
// vp    vt
public class wetairprocess
{
wetair yh;
double P; //pressure
double A[][][]; //psychrometric table data
Plot pi;
double tmin,tmax;
String heading[];

public wetairprocess(double tmini,double tmaxi,double Pi)
{P=Pi;
yh=new wetair();
tmin=tmini;
tmax=tmaxi;
ps_plot_hazirla(tmin,tmax,P);
String heading1[]={"Pressure bar",
"Temperature degree C",
"v dry air specific volume m^3/kgkh",
"Pv_water partial pressure bar",
"Pa_dry air partial pressure bar",
"w,_specific humidity kg moist./kg dry air",
'\u03D5'+" relative humidity",
"dos,degree of saturation",
"h enthalpy KJ/kgkh",
"s, entrophy KJ/kgkh",
"dp ,dew point temperature degree C",
"ha,enthalpy of dry air KJ/kgkh",
"hv,enthalpy of steam KJ/kgkh",
"hv*w,sensible heat KJ/kgkh",
"tw wet air temperature C"};      
heading=heading1;
}

public void print(double a[][],String s)
{Text.print(a,heading,s);}

public void print(double a[][],String heading2[],String s)
{Text.print(a,heading2,s);}


//======== Plot psikometrik diyagram ===========

     public static double[][][] ps_verisi(double tmin,double tmax,double P)
     {
	 //prepare pyschrometric chart data for pressure P
     wetair w=new wetair();
	 double aa[]=new double[14];  
     double bb[]=new double[14];  
	 //f2 ff=new f2();
	 //double x1[][]=new double[62][51];
	 //double y1[][]=new double[62][51];
	 double A[][][]=new double[2][62][51];
     //initilise as a function plot
     int i,j;
     i=0;
     double h;
     for(double rh=0.1;rh<=1.0;rh+=0.1)
     {   j=0;
         for(double t=tmin;t<=tmax;t+=1.0)
         {
	     aa=w.property1("tdb_rh",t,rh,P);
	     h=aa[8];
	        if(rh>0.99) 
            { 
	        h=aa[8];
            A[0][11+j][0]=t;A[1][11+j][0]=aa[5];
            bb=w.property1("w_h",0.0,h,P);
            A[0][11+j][1]=bb[10];A[1][11+j][1]=0.0;
            }
	        A[0][i][j]=t;
            A[1][i][j]=aa[5];
	        j++;
            }
         i++;
     }	 
     return A;
     }
      
      public void ps_plot_hazirla(double tmin,double tmax,double P1)
      {
	  double x1[][]=new double[62][51];
	  double y1[][]=new double[62][51];
	  //double A[][][]=new double[2][62][51];
	  A=ps_verisi(tmin,tmax,P1);
	  for(int i=0;i<A[0].length;i++)
	   for(int j=0;j<A[0][0].length;j++)
	       {x1[i][j]=A[0][i][j];y1[i][j]=A[1][i][j];}
      pi=new Plot(x1,y1);
      String ss2="Psychrometric diagram "+P+" bar";
      pi.setPlabel(ss2);
      pi.setXlabel("T Dry bulb temperature degree C");
      pi.setYlabel("w specific humidity kg moisture/kg dry air");
      pi.setMinMax(tmin,tmax,0.0,0.05);
      pi.setXgrid(1);
      pi.setYgrid(1);
      }
      
      public void addData(double a1[][],int plottype,int red,int green,int blue)
      { double x1[]=new double[2];
        double y1[]=new double[2];
        x1[0]=a1[0][1];
        y1[0]=a1[0][5];
        x1[1]=a1[1][1];
        y1[1]=a1[1][5];
        pi.addData(x1,y1,plottype,red,green,blue);  
      }
      
      public void addData(double a1[],double a2[],int plottype,int red,int green,int blue)
      { double x1[]=new double[2];
        double y1[]=new double[2];
        x1[0]=a1[1];
        y1[0]=a1[5];
        x1[1]=a2[1];
        y1[1]=a2[5];
        pi.addData(x1,y1,plottype,red,green,blue);  
      }
      
      public void addData(double a1[],int plottype,int red,int green,int blue)
      { double x1[]=new double[1];
        double y1[]=new double[1];
        x1[0]=a1[1];
        y1[0]=a1[5];
        pi.addData(x1,y1,plottype,red,green,blue);  
      }
      
      public void ps_plot()
      {   pi.setMinMax(tmin,tmax,0,0.05);
	      pi.plot();
	  }
      
//=======================================

// PROSESES
      
public double[][] mixture_mass_based(double m1, double T1, double f1,
                          double m2, double T2, double f2)
{ // m1 mass flow rate,    birinci channel kg/s
  // T1 inlet temperature,  birinci channel derece C
  // f1 inlet relative humidity, birinci channel 0-1
  // m2 mass flow rate,    ikinci channel kg/s
  // T2 inlet temperature,  ikinci channel derece C
  // f2 inlet relative humidity, ikinci channel 0-1  
  //Birinci channel
  double a1[]=yh.property("tdb_rh",T1,f1,P);                       
  double h1=a1[8];
  double w1=a1[5];
  //İkinci channel
  double a2[]=yh.property("tdb_rh",T2,f2,P);                       
  double h2=a2[8];
  double w2=a2[5];
  //Çıkış channelı
  double h3=(h1*m1+h2*m2)/(m1+m2);
  double w3=(w1*m1+w2*m2)/(m1+m2);
  double a3[]=yh.property( "w_h",w3,h3,P);
  double a[][]=new double[3][a1.length];
  a[0]=a1;     
  a[1]=a2;
  a[2]=a3;
  // Plot çiz
  // Birinci ikinci nokta arasına kalın mavi çizgi
  addData(a1,a2,5,0,0,255);
  //Birinci ikinci noktaya üçgen
  addData(a1,a2,24,0,0,255);
  // Çıkış channelı
  addData(a3,30,255,0,0);
  ps_plot();
  print(a,"Mixing process thermodynamic properties");
  String heading2[]={"1. channel m kg/s","2. channel m kg/s","exit channel m kg/s","h, exit enthalpy KJ/kgkh","w, exit specific humidity kg moisture/kg dry air"};
  double b[][]={{m1,m2,(m1+m2),a3[8],a3[5]}};
  print(b,heading2,"Mixing process outputs");
  return a;
}

public double[][] mixture_volumetric(double V1, double T1, double f1,
                                   double V2, double T2, double f2)
{ // V1 hacimsel debi,    birinci channel m^3/saat
  // T1 inlet temperature,  birinci channel derece C
  // f1 inlet relative humidity, birinci channel 0-1
  // V2 hacimsel debi,    ikinci channel m^3/saat
  // T2 inlet temperature,  ikinci channel derece C
  // f2 inlet relative humidity, ikinci channel 0-1  
  // Birinci channel
  double a1[]=yh.property("tdb_rh",T1,f1,P);                       
  double h1=a1[8];
  double w1=a1[5];
  double m1=V1/a1[2]/3600.0;
  // İkinci channel
  double a2[]=yh.property("tdb_rh",T2,f2,P);                       
  double h2=a2[8];
  double w2=a2[5];
  double m2=V2/a2[2]/3600.0;
  //Çıkış channelı
  double h3=(h1*m1+h2*m2)/(m1+m2);
  double w3=(w1*m1+w2*m2)/(m1+m2);
  double a3[]=yh.property( "w_h",w3,h3,P);
  double a[][]=new double[3][a1.length];
  a[0]=a1;     
  a[1]=a2;
  a[2]=a3;
  // Plot çiz
  // Birinci ikinci nokta arasına kalın mavi çizgi
  addData(a1,a2,5,0,0,255);
  //Birinci ikinci noktaya üçgen
  addData(a1,a2,24,0,0,255);
  // Çıkış channelı
  addData(a3,30,255,0,0);
  ps_plot();
  double V3=(m1+m2)*a3[2]*3600;
  print(a,"Mixing process thermodynamic properties");
  String heading2[]={"1. channel m kg/s","1. channel V m^3/h","2. channel m kg/s","2. channel V m^3/h","exit channel m kg/s","exit channel V m^3/h","h, exit enthalpysi KJ/kgkh","w, exit specific humidityi kgnem/kgkh"};
  double b[][]={{m1,V1,m2,V2,(m1+m2),V3,a3[8],a3[5]}};
  print(b,heading2,"Mixing process outputs");
  return a;
}
      
public double[][] cooling(double m, double T1, double f1,double T2)
{ // m  mass flow rate,    kg/s
  // T1 inlet temperature,  derece C
  // f1 inlet relative humidity, 0-1
  // T2 exit temperature,  derece C  
 double Qsogutma=0;
 double myogusma=0;
 double a1[]=yh.property("tdb_rh",T1,f1,P);                       
 double h1=a1[8];
 double w1=a1[5];
 double a3[]=yh.property("w_rh",w1,1.0,P);
 double T3=a3[1];
 double h3=a3[8];
 double w3=a3[5];
 double h2;
 double a2[];
 double w2;
 if(T3<T2)
 {
 a2=yh.property("tdb_w",T2,w1,P);  
 addData(a1,a2,5,0,0,255);
 addData(a1,a2,24,0,0,255);                     
 h2=a2[8];
 w2=a2[5];
 }
 else
 {
 a2=yh.property("tdb_rh",T2,1.0,P); 
 addData(a1,a3,5,0,0,255); 
 addData(a2,a2,24,0,0,255);                   
 h2=a2[8];
 w2=a2[5]; 
 }
 Qsogutma=m*(h1-h2);
 myogusma=m*(w1-w2); 
 double a[][]=new double[3][a1.length];
 a[0]=a1;
 a[1]=a2;
 a[2]=a3;
  ps_plot();
  print(a,"Cooling process thermodynamic properties");
  String heading2[]={"m kg/s","Q cooling KW","m condensing kg/s"};
  double b[][]={{m,Qsogutma,myogusma}};
  print(b,heading2,"Cooling process outputs");
  return a;
}

public double[][] cooling_dehumidifying_heating(double m, double T1, double f1,double T2,double f2)
{ // m  mass flow rate,    kg/s
  // T1 inlet temperature,  derece C
  // f1 inlet relative humidity, 0-1
  // T2 exit temperature,  derece C
  // f2 exit relative nemi, 0-1  
 double Qsogutma=0;
 double Qheating=0;
 double myogusma=0;
 
 double a1[]=yh.property("tdb_rh",T1,f1,P);                       
 double h1=a1[8];
 double w1=a1[5];
 
 double a2[]=yh.property("tdb_rh",T2,f2,P);                       
 double h2=a2[8];
 double w2=a2[5];
 
 double a3[]=yh.property("w_rh",w1,1.0,P);
 double T3=a3[1];
 double h3=a3[8];
 double w3=a3[5];
 
 double a4[]=yh.property("w_rh",w2,1.0,P);
 double T4=a4[1];
 double h4=a4[8];
 double w4=a4[5];
 
 Qsogutma=m*(h1-h4);
 Qheating=m*(h2-h4);;
 myogusma=m*(w1-w2); 
 double a[][]=new double[4][a1.length];

 a[0]=a1;
 a[1]=a2;
 a[2]=a3;
 a[3]=a4;
 addData(a1,a3,5,0,0,255);
 addData(a1,a3,24,0,0,255);
 addData(a2,a4,5,0,0,255);
 addData(a2,a4,24,0,0,255); 
 ps_plot(); 
  print(a,"cooling-dehumidifying-heating proces thermodynamic values");
  String heading2[]={"m kg/s","Q cooling KW","Q heating KW","m condensing kg/s"};
  double b[][]={{m,Qsogutma,Qheating,myogusma}};
  print(b,heading2,"cooling-dehumidifying-heating process thermodynamic values");
  return a;
}

public double[][] cooling_dehumidifying_mixing(double m1, double T1, double f1,double m2,double T2)
{ // cooling - nem alma - karıştırma prosesi
  // m1  cooling mass flow rate, kg/s
  // T1  cooling process inlet temperature,  derece C
  // f1  cooling process inlet relative humidity, 0-1
  // m2  uncooled mixture mass flow rate, kg/s
  // T2  cooling process exit temperature,  derece C
  
 double Qsogutma=0;
 double Qheating=0;
 double myogusma=0;
 
 double a1[]=yh.property("tdb_rh",T1,f1,P);                       
 double h1=a1[8];
 double w1=a1[5];
 
 double a2[]=yh.property("tdb_rh",T2,1.0,P);                       
 double h2=a2[8];
 double w2=a2[5];
 
 double a3[]=yh.property("w_rh",w1,1.0,P);
 double T3=a3[1];
 double h3=a3[8];
 double w3=a3[5];
 
 double h4=(m1*h1+m2*h2)/(m1+m2);
 double w4=(m1*w1+m2*w2)/(m1+m2);
 
 double a4[]=yh.property("w_h",w4,h4,P);
 double T4=a4[1];
 Qsogutma=m1*(h1-h2);
 Qheating=m1*(h4-2);
 myogusma=m1*(w1-w4); 
 double a[][]=new double[4][a1.length];
 a[0]=a1;
 a[1]=a2;
 a[2]=a3;
 a[3]=a4;
 addData(a1,a3,5,0,0,255);
 addData(a1,a3,24,0,0,255);
 addData(a2,a4,5,0,0,255);
 addData(a2,a4,24,0,0,255); 
 addData(a4,a1,5,255,0,0); 
 ps_plot(); 
  print(a,"cooling-dehumidifying-mixing process thermodynamic values");
  String heading2[]={"m kg/s","m baypass havası kg/s","Q cooling KW","Q heating KW","m condensing kg/s"};
  double b[][]={{m1,m2,Qsogutma,Qheating,myogusma}};
  print(b,heading2,"cooling-dehumidifying-mixing process output values");
  return a;
}

public double[][] heating(double m, double T1, double f1,double T2)
{ // Isıtma prosesi
  // m  mass flow rate,    kg/s
  // T1 inlet temperature,  derece C
  // f1 inlet relative humidity, 0-1
  // T2 exit temperature,  derece C  
 double a1[]=yh.property("tdb_rh",T1,f1,P);                       
 double h1=a1[8];
 double w1=a1[5];
 double a2[]=yh.property("tdb_w",T2,w1,P);
 double h2=a2[8];
 double w2=a2[5];
 double Qheating=m*(h2-h1);
 double a[][]=new double[2][a1.length];
 addData(a1,a2,5,0,0,255);
 addData(a1,a2,24,0,0,255);
 ps_plot();
 a[0]=a1;
 a[1]=a2;
 print(a,"heating process thermodynamic values");
 String heading2[]={"m kg/s","Q heating KW"};
  double b[][]={{m,Qheating}};
  print(b,heading2,"heating process output values");
  return a;
}

public double[][] heating_humidifying(double m, double T1, double f1,double T2, double T3,double f3)
{ // Isıtma ve humidifying prosesi
  // m  mass flow rate,    kg/s
  // T1 inlet temperature,  derece C
  // f1 inlet relative humidity, 0-1
  // T2 heating prosesi exit derece C
  // T3 nemlendirma prosesi exit temperature,  derece C 
  // f3 humidifying prosesi exit relative nemi, 0-1
   
 double a1[]=yh.property("tdb_rh",T1,f1,P);                       
 double h1=a1[8];
 double w1=a1[5];
  
 double a2[]=yh.property("tdb_w",T2,w1,P);
 double h2=a2[8];
 double w2=a2[5];
 
 double a3[]=yh.property("tdb_rh",T3,f3,P);
 double h3=a3[8];
 double w3=a3[5];
   
 double Qheating1=m*(h2-h1);
 double Qheating2=m*(h3-h2);
 double Qheating=Qheating1+Qheating2;
 double humidifying=m*(w3-w2);
 
 double a[][]=new double[3][a1.length];
 addData(a1,a2,5,0,0,255);
 addData(a1,a2,24,0,0,255);
 addData(a2,a3,5,0,0,255);
 addData(a2,a3,24,0,0,255); 
 ps_plot();
 
 a[0]=a1;
 a[1]=a2;
 a[2]=a3;
 
  print(a,"heating and humidifying process thermodynamic properties");
  String heading2[]={"m kg/s","Q1 heating KW","Q2 humidifying prosesinde heating KW", "Q toplam heating","humidifying kg/s"};
  double b[][]={{m,Qheating1,Qheating2,Qheating,humidifying}};
  print(b,heading2,"heating and humidifying process output values");
  return a;
}

public double[][] heating_adiabatic_humidifying(double m, double T1, double f1,double T2, double T3)
{ // Isıtma ve humidifying prosesi
  // m  mass flow rate,    kg/s
  // T1 inlet temperature,  derece C
  // f1 inlet relative humidity, 0-1
  // T2 heating prosesi exit derece C
  // T3 adyabatik nemlendirma prosesi exit temperature,  derece C 

   
 double a1[]=yh.property("tdb_rh",T1,f1,P);                       
 double h1=a1[8];
 double w1=a1[5];
  
 double a2[]=yh.property("tdb_w",T2,w1,P);
 double h2=a2[8];
 double w2=a2[5];
 double Twb2=a2[14];
 
 double a3[]=yh.property("tdb_twb",T3,Twb2,P);
 double h3=a3[8];
 double h3a=a2[11];
 double w3=a3[5];
 double Twb3=a3[14];   
 double Qheating=m*(h2-h1);
 double humidifying=m*(w3-w2);
 
 double a[][]=new double[3][a1.length];
 addData(a1,a2,5,0,0,255);
 addData(a1,a2,24,0,0,255);
 addData(a2,a3,5,0,0,255);
 addData(a3,24,0,0,255);
 ps_plot();
 
 a[0]=a1;
 a[1]=a2;
 a[2]=a3;
 
  print(a,"heating and adiabatic moisturizing thermodynamic values");
  String heading2[]={"m kg/s","Q heating KW","humidifying kg/s"};
  double b[][]={{m,Qheating,humidifying}};
  print(b,heading2,"heating and adiabatic moisturizing output values");
  return a;
}
public double[][] adiabatic_cooling(double m, double T1, double f1,double T2)
{ // Adyabatik cooling
  // m  mass flow rate,    kg/s
  // T1 inlet temperature,  derece C
  // f1 inlet relative humidity, 0-1
  // T2 exit temperature,   derece C 
  // f2 exit relative nemi,  0-1  
 double a1[]=yh.property("tdb_rh",T1,f1,P);                       
 double h1=a1[8];
 double h1a=a1[11];
 double w1=a1[5];
 double Twb=a1[14]; 
 double a3[]=yh.property("tdb_rh",Twb,1.0,P);                       
 double h3=a1[8];
 double w3=a1[5];
 if(T2<Twb) T2=Twb;
 double a2[]=yh.property("tdb_twb",T2,Twb,P);
 double h2=a2[8];
 double h2a=a2[11];
 double w2=a2[5];
 double Qsogutma=m*(h1a-h2a);
 double humidifying=m*(w2-w1);
 double a[][]=new double[3][a1.length];
 a[0]=a1;
 a[1]=a2;
 a[2]=a3;
 addData(a1,a2,5,0,0,255);
 addData(a1,a2,24,0,0,255);
 addData(a2,a3,5,255,0,0);
 addData(a3,24,255,0,0);
 ps_plot();
 print(a,"adyabatic cooling process thermodynamic values");
 String heading2[]={"m kg/s","Q sensible heat KW","moisturising kg/s","exit temperature degree C","Tw wet bulb temperature"};
  double b[][]={{m,Qsogutma,humidifying,T2,Twb}};
  print(b,heading2,"adyabatic cooling process output values");
 return a;
}
public double[][] summer_air_conditioning(double m1, double m3,double T2, double f2,
                          double T4, double f4, double T6,double f6,double dQsensible,double dQlatent)
{ // m1 mass flow rate,    room girişi kg/s
  // m3 mass flow rate,    eksoz havası kg/s
  // T2 room temperature,    derece C
  // f2 room relative humidity,   0-1
  // T4 outside air temperature, derece C
  // f4 outside air relative humidity 0-1
  // T6 evaporator exit temperature
  // f6 evaporator exit relative humidity
  // f2 giriş relative humidity, ikinci kanal 0-1 
  // dQsensible sensible heat input kW
  // dQlatent   latent heat input kW
   
  //2 nd point room exit
  double a2[]=yh.property("tdb_rh",T2,f2,P);                       
  double h2=a2[8];
  double w2=a2[5];
  double ha2=a2[11];
  //6 th point evaporator exit
  double a6[]=yh.property("tdb_rh",T6,f6,P);                       
  double h6=a6[8];
  double w6=a6[5];
  double w1=w6;
  double ha1=ha2-dQsensible/m1;
  //15 degree room temperature evaluation
  // 1A noktası
  double a1A[]=yh.property("tdb_w",15.0,w1,P);
  double ha1A=a1A[11];
  double Cp1=(ha2-ha1A)/(T2-15.0);
  double T1=ha1/Cp1;
  double a1[]=yh.property("tdb_w",T1,w1,P);
  double h1=a1[8];
  double m2=m1-m3;
  double m4=m3;
  double m5=m1;
  // outside air entry
  double a4[]=yh.property("tdb_rh",T4,f4,P);                       
  double h4=a4[8];
  double w4=a4[5];
  
  double h5=(m4*h4+m2*h2)/m5;
  double w5=(m4*w4+m2*w2)/m5;
  double a5[]=yh.property("w_h",w5,h5,P);
  double T5=a5[1];
  double Q56=m5*(h5-h6);//KW 
  double Q67=m5*(h1-h6);//KW
  double dm=m5*(w5-w6);
  double a8[]=yh.property("w_rh",w6,1.0,P);
  double a9[]=yh.property("w_rh",w5,1.0,P);
  double a[][]=new double[8][a1.length];
  a[0]=a1;     
  a[1]=a2;
  a[2]=a2;
  a[3]=a4;     
  a[4]=a5;
  a[5]=a6;
  a[6]=a8;
  a[7]=a9;
  // Plot 
  // thick blue line
  addData(a9,a5,5,0,0,255);
  //triangle
  addData(a9,a5,24,0,0,255);
  addData(a8,a1,5,0,0,255);
  addData(a6,a1,24,0,0,255);
  addData(a1,a2,5,255,0,0);
  addData(a2,a4,5,255,0,0);
  addData(a2,a4,24,255,0,0);  
  ps_plot();
  print(a,"mixing process thermodynamic properties");
  String baslik2[]={"evaporator heat transfer kW","heater heat transfer kW","condansation mass flow rate kg/s"};
  double b[][]={{Q56,Q67,dm}};
  print(b,baslik2,"mixing process exit properties");
  return a;
}

public double[][] winter_air_conditioning(double T1,double T2,double f2,double T4,double f4,double T6,double Qsensible,double Qlatent)
{   
	// room air conditions
	double a2[]=yh.property("tdb_rh",T2,f2,P);
	double h2=a2[8];
	double w2=a2[5];
	double hv2=a2[12];	
	// outside air inlet
	double a4[]=yh.property("tdb_rh",T4,f4,P);
	double h4=a4[8];
	double w4=a4[5];	
	// pre heating inlet	
	double h5=h2*0.5+h4*0.5;
	double w5=w2*0.5+w4*0.5;
	double t5=0.5*T2+0.5*T4;		
	// pre heating exit
	double w6=w5;
	double a6[]=yh.property("tdb_w",T6,w6,P);
	double h6=a6[8];	
	// reheating entry
	
	double  m_supply_air=Qsensible/(1.0216*(T1-T2));
	//first guess w1
	double w1;
	double t7;
	double a1new[];
	double a7[];	
	double a7new[];
	double h7new;
	double a6guess[];
	double t6guess;
	double titer=0.001;	
	double  w1new=w2+titer;
	 a1new=yh.property("tdb_w",T1,w1new,P);
	double hv1=a1new[12];
	double hort=(hv1+hv2)*0.5;
	w1=w2+(Qlatent/(m_supply_air*hort));	
	a7new=yh.property("w_h",w1,h6,P);
	t7=a7new[1];
	double w7=w1;
	double mw=m_supply_air*(w7-w6);	
	double a1[]=yh.property("tdb_w",T1,w1,P);
	double h1=a1[8];	
	double Q56=m_supply_air*(h6-h5); // pre heater heating kW
	double Q78=(m_supply_air+mw)*(h1-h6);// re_heater heating kW	
	// last evaluation
	double a1yeni[]=yh.property("tdb_w",T1,w1,P);
	double a2yeni[]=yh.property("tdb_rh",T2,f2,P);
	double a3yeni[]=a2yeni;
	double a4yeni[]=yh.property("tdb_rh",T4,f4,P);
	double a5yeni[]=yh.property("tdb_w",t5,w5,P);
	double a6yeni[]=yh.property("tdb_w",T6,w6,P);
	double a7yeni[]=yh.property("tdb_w",t7,w7,P);
	
	
	double a[][]=new double[8][a1yeni.length];
    a[0]=a1yeni;     
    a[1]=a2yeni;
    a[2]=a[1];
    a[3]=a4yeni;     
    a[4]=a5yeni;
    a[5]=a6yeni;
    a[6]=a7yeni;
    a[7]=a[6];
	addData(a4yeni,a5yeni,5,0,0,255);
    addData(a5yeni,a2yeni,5,0,0,255);
	addData(a2yeni,a1yeni,5,0,0,255);
	addData(a1yeni,a7yeni,5,0,0,255);
	addData(a7yeni,a6yeni,5,0,0,255);
	addData(a6yeni,a5yeni,5,0,0,255);
    ps_plot();
	print(a,"mixing process thermodynamic properties");
	String baslik2[]={"pre heater heat transfer kW","Reheater heat transfer kW","Nemlendiricide eklenen su debi kg/s"};
	double b[][]={{Q56,Q78,mw}};
	print(b,baslik2,"mixing process calculated properties");
	
	return a;
}
}