public class rankine2013
{
double T[];
double P[];
double v[];
double h[];
double s[];
double Wnet;
double Wturbin;
double Wpompa;
double Qin;
double Qout;
double etacevrim;
double m;
steam st;
 
public rankine2013(double mi,double T1,double P1,double P2,double etat,double etap)
{st=new steam();
 m=mi;
 T=new double[9];
 P=new double[9];
 v=new double[9];
 h=new double[9];
 s=new double[9];
 T[1]=T1;
 P[1]=P1;
 P[2]=P[3]=P2;
 double a1[]=st.property("tp",T[1],P[1]);
 h[1]=a1[3];
 s[1]=a1[5];
 v[1]=a1[2];
 // 2i=8 noktası
 s[8]=s[1];
 P[8]=P[2];
 double a8[]=st.property("ps",P[8],s[8]);
 T[8]=a8[1];
 h[8]=a8[3];
 v[8]=a8[2];
 //2 noktası
 h[2]=h[1]-etat*(h[1]-h[8]);
 double a2[]=st.property("ph",P[2],h[2]);
 T[2]=a2[1];
 v[2]=a2[2];
 s[2]=a2[5];
 //7 noktası yoğuşturucu doymuş buhar
 P[7]=P[2];
 double a7[]=st.property("px",P[7],1.0);
 T[7]=a7[1];
 v[7]=a7[2];
 h[7]=a7[3];
 s[7]=a7[5];
 //3 noktası doymuş sıvı
 P[3]=P[7];
 double a3[]=st.property("px",P[3],0.0);
 T[3]=a3[1];
 v[3]=a3[2];
 h[3]=a3[3];
 s[3]=a3[5];
 //4i=0 noktası
 P[0]=P[1];
 s[0]=s[3];
 double a0[]=st.property("ps",P[0],s[0]);
 T[0]=a0[1];
 v[0]=a0[2];
 h[0]=a0[3];
 //4 noktası
 P[4]=P[1];
 h[4]=h[3]+(h[0]-h[3])/etap;
 double a4[]=st.property("ph",P[4],h[4]);
 //5 noktası
 P[5]=P[1];
 double a5[]=st.property("px",P[5],0.0);
 T[5]=a5[1];
 v[5]=a5[2];
 h[5]=a5[3];
 s[5]=a5[5];
 Wturbin=m*(h[1]-h[2]);
 Wpompa=m*(h[4]-h[3]);
 Wnet=Wturbin-Wpompa;
 Qin=m*(h[1]-h[4]);
 Qout=m*(h[2]-h[3]);
 etacevrim=Wnet/Qin;
}
public String toString()
{String ss="Rankine çevrimei\n";
 for(int i=0;i<9;i++)
 {ss+="T["+i+"] = "+T[i]+"derece C\n";
  ss+="P["+i+"] = "+P[i]+"bar \n";
  ss+="v["+i+"] = "+v[i]+"m^3/kg \n"; 
  ss+="h["+i+"] = "+h[i]+"KJ/kg \n"; 
  ss+="s["+i+"] = "+s[i]+"kJ/kgK \n"; 
 }
 ss+="Wturbin="+Wturbin+"KW\n";
 ss+="Wpompa="+Wpompa+"KW\n";
 ss+="Wnet="+Wnet+"KW\n";
 ss+="Qin=Qkazan="+Qin+"KW\n";
 ss+="Qout=Qyoğuşturucu="+Qout+"KW\n";
 ss+="eta çevrim = "+etacevrim;
 return ss;
}
}