%%%%%%%%%%%%%%%%%%%% Primemover_settings %%%%%%%%%%%%%%%%%%%%%%%  
TURB_dash=~(TURB);
TURB_sm=TURB_dash(gen(:,1));
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
%%%%%%%%%%%%%%%%%%%%%%%REHEAT TURBINE%%%%%%%%%%%%%%%%%%%%%%%%%%%%
H_rht_tur = zeros(1,nb);
H_rht_tur(gen(:,1)) = H;
H_rht_tur = H_rht_tur(turb_rhst(:,1));
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  
SL_RHST_dash=~(SL_RHST);
SL_RHST_sm=SL_RHST_dash(gen(:,1));
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
RHST_Ag211=zeros(1,nb);
RHST_Ag211(turb_rhst(:,1))=(FHP_rht)*(0.5)./H_rht_tur;
RHST_Ag211=RHST_Ag211(gen(:,1));
RHST_dAg211=SL_RHST_sm.*RHST_Ag211.*TURB_sm;
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
RHST_Ag212=zeros(1,nb);
RHST_Ag212(turb_rhst(:,1))=(FIP_rht)*(0.5)./H_rht_tur;
RHST_Ag212=RHST_Ag212(gen(:,1));
RHST_dAg212=SL_RHST_sm.*RHST_Ag212.*TURB_sm;
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
RHST_Ag213=zeros(1,nb);
RHST_Ag213(turb_rhst(:,1))=(FLP_rht)*(0.5)./H_rht_tur;
RHST_Ag213=RHST_Ag213(gen(:,1));
RHST_dAg213=SL_RHST_sm.*RHST_Ag213.*TURB_sm;
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
RHST_Ag1111=zeros(1,nb);
RHST_Ag1111(turb_rhst(:,1))=-1./TCH_rht;
RHST_Ag1111=RHST_Ag1111(gen(:,1));
RHST_dAg1111=SL_RHST_sm.*RHST_Ag1111.*TURB_sm;
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
RHST_Ag1115=zeros(1,nb);
RHST_Ag1115(turb_rhst(:,1))=1./TCH_rht;
RHST_Ag1115=RHST_Ag1115(gen(:,1));
RHST_dAg1115=SL_RHST_sm.*RHST_Ag1115.*TURB_sm;
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
RHST_Ag1211=zeros(1,nb);
RHST_Ag1211(turb_rhst(:,1))=1./TRH_rht;
RHST_Ag1211=RHST_Ag1211(gen(:,1));
RHST_dAg1211=SL_RHST_sm.*RHST_Ag1211.*TURB_sm;
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
RHST_Ag1212=zeros(1,nb);
RHST_Ag1212(turb_rhst(:,1))=-1./TRH_rht;
RHST_Ag1212=RHST_Ag1212(gen(:,1));
RHST_dAg1212=SL_RHST_sm.*RHST_Ag1212.*TURB_sm;
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
RHST_Ag1312=zeros(1,nb);
RHST_Ag1312(turb_rhst(:,1))=1./TCO_rht;
RHST_Ag1312=RHST_Ag1312(gen(:,1));
RHST_dAg1312=SL_RHST_sm.*RHST_Ag1312.*TURB_sm;
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
RHST_Ag1313=zeros(1,nb);
RHST_Ag1313(turb_rhst(:,1))=-1./TCO_rht;
RHST_Ag1313=RHST_Ag1313(gen(:,1));
RHST_dAg1313=SL_RHST_sm.*RHST_Ag1313.*TURB_sm;
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
RHST_Ag142=zeros(1,nb);
RHST_Ag142(turb_rhst(:,1))=K_rht.*(1-T2_rht./T1_rht)./T1_rht;
RHST_Ag142=RHST_Ag142(gen(:,1));
RHST_dAg142=SL_RHST_sm.*RHST_Ag142.*TURB_sm;
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
RHST_Ag1414=zeros(1,nb);
RHST_Ag1414(turb_rhst(:,1))=-1./T1_rht;
RHST_Ag1414=RHST_Ag1414(gen(:,1));
RHST_dAg1414=SL_RHST_sm.*RHST_Ag1414.*TURB_sm;
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
RHST_Ag152=zeros(1,nb);
RHST_Ag152(turb_rhst(:,1))=-K_rht.*T2_rht./T1_rht./T3_rht;
RHST_Ag152=RHST_Ag152(gen(:,1));
RHST_dAg152=SL_RHST_sm.*RHST_Ag152.*TURB_sm;
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
RHST_Ag1514=zeros(1,nb);
RHST_Ag1514(turb_rhst(:,1))=-1./T3_rht;
RHST_Ag1514=RHST_Ag1514(gen(:,1));
RHST_dAg1514=SL_RHST_sm.*RHST_Ag1514.*TURB_sm;
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
RHST_Ag1515=zeros(1,nb);
RHST_Ag1515(turb_rhst(:,1))=-1./T3_rht;
RHST_Ag1515=RHST_Ag1515(gen(:,1));
RHST_dAg1515=SL_RHST_sm.*RHST_Ag1515.*TURB_sm;
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

%%%%%%%%%%%%%%%%%HYDRO TURBINE%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
H_hyd_tur = zeros(1,nb);
H_hyd_tur(gen(:,1)) = H;
H_hyd_tur = H_hyd_tur(turb_hydro(:,1));
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
SL_HYDRO_dash=~(SL_HYDRO);
SL_HYDRO_sm=SL_HYDRO_dash(gen(:,1));
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HYDRO_Ag215=zeros(1,nb);
HYDRO_Ag215(turb_hydro(:,1))=-1./H_hyd_tur;
HYDRO_Ag215=HYDRO_Ag215(gen(:,1));
HYDRO_dAg215=SL_HYDRO_sm.*HYDRO_Ag215.*TURB_sm;
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HYDRO_Ag216=zeros(1,nb);
HYDRO_Ag216(turb_hydro(:,1))=(0.5)./H_hyd_tur;
HYDRO_Ag216=HYDRO_Ag216(gen(:,1));
HYDRO_dAg216=SL_HYDRO_sm.*HYDRO_Ag216.*TURB_sm;
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HYDRO_Ag142=zeros(1,nb);
HYDRO_Ag142(turb_hydro(:,1))=K_ht.*(1-T2_ht./T1_ht)./T1_ht;
HYDRO_Ag142=HYDRO_Ag142(gen(:,1));
HYDRO_dAg142=SL_HYDRO_sm.*HYDRO_Ag142.*TURB_sm;
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HYDRO_Ag1414=zeros(1,nb);
HYDRO_Ag1414(turb_hydro(:,1))=-1./T1_ht;
HYDRO_Ag1414=HYDRO_Ag1414(gen(:,1));
HYDRO_dAg1414=SL_HYDRO_sm.*HYDRO_Ag1414.*TURB_sm;
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HYDRO_Ag152=zeros(1,nb);
HYDRO_Ag152(turb_hydro(:,1))=-K_ht.*T2_ht./T1_ht./T3_ht;
HYDRO_Ag152=HYDRO_Ag152(gen(:,1));
HYDRO_dAg152=SL_HYDRO_sm.*HYDRO_Ag152.*TURB_sm;
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HYDRO_Ag1514=zeros(1,nb);
HYDRO_Ag1514(turb_hydro(:,1))=-1./T3_ht;
HYDRO_Ag1514=HYDRO_Ag1514(gen(:,1));
HYDRO_dAg1514=SL_HYDRO_sm.*HYDRO_Ag1514.*TURB_sm;
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HYDRO_Ag1515=zeros(1,nb);
HYDRO_Ag1515(turb_hydro(:,1))=-1./T3_ht;
HYDRO_Ag1515=HYDRO_Ag1515(gen(:,1));
HYDRO_dAg1515=SL_HYDRO_sm.*HYDRO_Ag1515.*TURB_sm;
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HYDRO_Ag1615=zeros(1,nb);
HYDRO_Ag1615(turb_hydro(:,1))=6./T_wht;
HYDRO_Ag1615=HYDRO_Ag1615(gen(:,1));
HYDRO_dAg1615=SL_HYDRO_sm.*HYDRO_Ag1615.*TURB_sm;
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HYDRO_Ag1616=zeros(1,nb);
HYDRO_Ag1616(turb_hydro(:,1))=-2./T_wht;
HYDRO_Ag1616=HYDRO_Ag1616(gen(:,1));
HYDRO_dAg1616=SL_HYDRO_sm.*HYDRO_Ag1616.*TURB_sm;
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
