import java.util.*;
import java.lang.*;
import java.io.*;

class sogut1Test{
  public static void main(String args[]) throws IOException
  {
    double t;
	double v=1.0/0.41224;
    //double P=100.0;
    sogut1 r1 = new sogut1("R12");
    System.out.println(r1.rd.toString());
    for(t=-100;t<100.0;t+=1.0)
        System.out.println(t+" "+r1.Ps(t)+"vls="+r1.vsl_t(t)+"vgs="+r1.vsg_t(t)+"hfg = "+r1.hslg_t(t)+"sfg = "+r1.sslg_t(t)+"hls="+r1.hsl_t(t)+"hgs="+r1.hsg_t(t)+"sls="+r1.ssl_t(t)+"sgs="+r1.ssg_t(t)+"vis_l="+r1.vis_liq(t)+"vis_v="+r1.vis_vap(t)+"k_liq="+r1.k_liq(t)+"k_v="+r1.k_vap(t)+"st="+r1.st(t)+"alpha_l="+r1.alpha_liq(t)+"alpha_v="+r1.alpha_vap(t)+"Pr_l="+r1.Pr_liq(t)+"Pr_v="+r1.Pr_vap(t)); 
    t=80.0;
    double P=r1.P(t, v);
    double v1=r1.v_tp(t,P);  
    double x=1.0/P;
    System.out.println("d="+x);
    //System.out.println(r1.rd.toString());
    System.out.println("P ="+P+"kPa");
    System.out.println("t ="+t+" deg C");
    System.out.println("v = "+v+"m^3/kg"+1.0/v+"kg/m^3");
    System.out.println("v1 = "+v1+"m^3/kg");
    double h1=r1.h1(t,v);
    System.out.println("h1 = "+h1);
    System.out.println("CpdT ideal="+r1.Cp(t)*t);
     System.out.println("hH0 ideal="+r1.dH0(t));
    double vsl=r1.vsl_t(t);
    double vsg=r1.vsg_t(t);
    double ha1=(t+273.15)*(vsg-vsl)*r1.dPsdT(t);
    double h2=(t+273.15)*(vsg-vsl)*r1.dPsdT1(t);
    double h3=(t+273.15)*(vsg-vsl)*r1.dPdT(t,r1.vsg_t(t));
    System.out.println("h1="+ha1+"h2="+h2+"h3="+h3);
    System.out.println("dPsdT = "+r1.dPsdT(t)+"dPsdT1 = "+r1.dPsdT1(t)+"dPsdT_EOS = "+r1.dPdT(t,r1.vsg_t(t)));
    double Ts1=r1.Ts(P);
    double Ts2=r1.Ts1(P);
    System.out.println("Ts1="+Ts1+"Ts2="+Ts2);
    P=r1.P(t,v);
    double Ps=r1.Ps(t);
    System.out.println("yeniden");
    System.out.println("P ="+P+"kPa");
    System.out.println("t ="+r1.t_pv(P,v)+"deg C");
    System.out.println("Ps ="+Ps);
    System.out.println("Ps from P equation ="+r1.P(t,r1.vsg_t(t)));
    System.out.println("v = "+v+"m^3/kg");
    System.out.println("vgs="+r1.vsg_t(t));
    System.out.println("vgs1   v_tp="+r1.v_tp(t,Ps)+"vtp2"+r1.v_tp2(t,Ps));
    System.out.println("dpdv="+r1.dPdV(t,v)+"dpdv1="+r1.dPdV1(t,v));
    System.out.println("dPdT = "+r1.dPdT(t,v)+"dPdT1 = "+r1.dPdT1(t,v));
    System.out.println("vgs_app="+r1.vg_app(t)+"zzz"+r1.vg_app(t)/r1.vsg_t(t));
    System.out.println("vlg="+r1.vsl_t(t));
    
    //for(t=-100;t<=183;t++)
    //   System.out.println(t+" "+r1.vls(t)+" "+r1.vgs(t)+" "+r1.rols(t)+" "+r1.rogs(t));
    //System.out.println("dPsdT="+r1.dPsdT(t));
    //System.out.println("dPsdTNUM="+r1.dPsdTNUM(t));
  }
}
