import javax.swing.*;

public class absorbtion_water_ammonia 
{ double T[]=new double[12];
  double P[]=new double[12];
  double h[]=new double[12];
  double s[]=new double[12];
  double x[]=new double[12];
  double v[]=new double[12];
  double m[]=new double[12];
public absorbtion_water_ammonia(double mcondenser,double P_condenser,double t_condenser,double P_evaporator,double t_absorber, double t_generator)
{
water_ammonia_mix wlb=new water_ammonia_mix();
m[3]=mcondenser;
T[3]=t_condenser;
P[3]=P_condenser;
double a[]=wlb.amn.property("tp",T[3],P[3]);

h[3]=a[3];
s[3]=a[5];
P[4]=P[3];
x[4]=0.0;
a=wlb.amn.property("px",P[4],x[4]);
T[4]=a[1];
h[4]=a[3];
s[4]=a[5];
h[5]=h[4];
P[5]=P_evaporator;
a=wlb.amn.property("ph",P[5],h[5]);
h[5]=a[3];
s[5]=a[5];
x[5]=a[6];
System.out.println("T3="+T[3]+"P3="+P[3]+"h3="+h[3]+"kJ/kg");
System.out.println("T4="+T[4]+"P4="+P[4]+"h4="+h[4]+"kJ/kg");
System.out.println("T5="+T[5]+"P5="+P[5]+"h5="+h[5]+"kJ/kg");
System.out.println("T6="+T[6]+"P6="+P[6]+"h6="+h[6]+"kJ/kg");
}
public String toString()
{String s="";

return s;
}

public static void main(String arg[])
{double mcondenser=0.022; //kg/s
double P_condenser=250.0;//kPa
double t_condenser=60.0;
double P_evaporator=15.0;//kPa
double t_absorber=50.0;
double t_generator=100.0;
absorbtion_water_ammonia awa=new absorbtion_water_ammonia(mcondenser,P_condenser,t_condenser,P_evaporator,t_absorber,t_generator); 
}
}