import javax.swing.*;
public class wetairtest5
{
public static void main(String arg[])
{
wetair wa=new wetair();
double m=1.0;//  kg/s
double p=1.01325;//  bar
double t1=32.0;//  degree C
double rh1=0.7;
double a[]=wa.property("tdb_rh",t1,rh1,p);
double h1=a[8];
double w1=a[5];
double twb1=a[14];

double w2=w1;
double rh2=1.0;
a=wa.property("w_rh",w2,rh2,p);
double t2=a[1];//   degree C
double twb2=a[14];
double h2=a[8];

double t4=22.0;//  degree C
double rh4=0.45;
a=wa.property("tdb_rh",t4,rh4,p);
double h4=a[8];
double w4=a[5];
double twb4=a[14];

double w3=w4;
double rh3=1.0;
a=wa.property("w_rh",w3,rh3,p);
double t3=a[1]; 
double h3=a[8];
double twb3=a[14];
double Qcooling=m*(h1-h3);
double Qheating=m*(h4-h3);
double dm=m*(w2-w3);

String s="m="+m+" kg/s\n";
s+="T1="+t1+" degree C h1="+h1+" kJ/kg  "+'\u00D8'+"1 ="+rh1*100+" % w1 = "+w1+" twb1 = "+twb1+" degree C\n";
s+="T2="+t2+" degree C h1="+h2+" kJ/kg  "+'\u00D8'+"2 ="+rh2*100+" % w1 = "+w2+" twb2 = "+twb2+" degree C\n";
s+="T3="+t3+" degree C h1="+h3+" kJ/kg  "+'\u00D8'+"3 ="+rh3*100+" % w1 = "+w3+" twb3 = "+twb3+" degree C\n";
s+="T4="+t3+" degree C h4="+h4+" kJ/kg  "+'\u00D8'+"4 ="+rh4*100+" % w1 = "+w3+" twb3 = "+twb4+" degree C\n";

s+="Qcooling = "+Qcooling+" kW\n";
s+="Qheating = "+Qheating+" kW\n";
s+="de-moisturizing dm = "+dm+" kg/s";
JOptionPane.showMessageDialog(null,s);
}
}