import javax.swing.*;
public class wetairtest4
{
public static void main(String arg[])
{
wetair wa=new wetair();
double m=1.0;//  kg/s
double p=1.01325;//  bar
double t1=8.0;//  degree C
double rh1=0.3;
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 t2=32.0;//   degree C
a=wa.property("tdb_w",t2,w2,p);
double h2=a[8];
double rh2=a[6];
double twb2=a[14];
double t3=20.0;
double twb3=twb2;
a=wa.property("tdb_twb",t3,twb3,p);
double h3=a[8];
double rh3=a[6];
double w3=a[5];
double Q1=m*(h2-h1);
double Q2=m*(h3-h2);
double dm=m*(w3-w2);

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'+"1 ="+rh2*100+" % w1 = "+w2+" twb2 = "+twb2+" degree C\n";
s+="T3="+t3+" degree C h1="+h3+" kJ/kg  "+'\u00D8'+"1 ="+rh3*100+" % w1 = "+w3+" twb3 = "+twb3+" degree C\n";
s+="Q1 = "+Q1+" kW\n";
s+="Q2 = "+Q2+" kW\n";
s+="moisturizing dm = "+dm+" kg/s";
JOptionPane.showMessageDialog(null,s);
}
}