if DifFinalGoods==0
	O_CG		= O_Z;
	O_I		= O_Z;
	ETA_CG		= ETA_Z; 
	ETA_I		= ETA_Z;
end


%1-10 (for Search==1)
tauL_ss         = tauW_ss+tauUFA_ss;
aCo_ss          = a_ss;
aH_ss           = a_ss;
wedCo_ss        = 1;
wedH_ss         = 1;
ThetaR_ss 		= 1;
ThetaNR_ss 		= 1;
ptilH_ss        = 1;
ptilF_ss        = 1;
if Search==0
	wtil_ss     = 1;
	ThetaU_ss	= 1;
end 
DelH_ss         = ptilH_ss^-EPSILON_H;


%11-20
DelF_ss         = ptilF_ss^-EPSILON_F;
if Search==0
	DelW_ss     = wtil_ss^-EPSILON_W;
	hd_ss       = h_ss/DelW_ss;
end
mcH_ss          = (EPSILON_H-1)/EPSILON_H*ptilH_ss;
mcF_ss          = (EPSILON_F-1)/EPSILON_F*ptilF_ss;
pHtil_ss        = mcH_ss*pH_ss;
mcZtil_ss       = (((z_ss*pHtil_ss)^(1-ETA_O)-O_O*pO_ss^(1-ETA_O))/(1-O_O))^(1/(1-ETA_O));
if Search==0
	mcW_ss      = (EPSILON_W-1)/EPSILON_W*wtil_ss^(1+PHI*EPSILON_W);
	fW_ss       = wtil_ss^(-EPSILON_W*(1+PHI))*hd_ss*mcW_ss/(1-BETTA*a_ss^(1-SIGMA)*THETA_W);
end
pi_ss           = pibar_ss;
if Search==0
	gGamaW_ss   = pi_ss;
end
gGamaH_ss       = pi_ss;
gGamaF_ss       = pi_ss;
R_ss            = a_ss^SIGMA*pi_ss/BETTA;
ptilHstar_ss	= 1;


%21-30
DelHstar_ss     = ptilHstar_ss^-EPSILON_Hstar;
mcHstar_ss      = (EPSILON_Hstar-1)/EPSILON_Hstar*ptilHstar_ss;
KAPPA_O            = sOC*pO_ss^-ETA_C;
if pH_ss==1 && pO_ss==1   
    pA_ss		= 1;
else
    pA_implicit = @(pA) (1-KAPPA_O-KAPPA_A)																							...
					*((1-O_Z)*pH_ss^(1-ETA_Z)+O_Z*((pA^(1-ETA_A)-(1-O_A)*pH_ss^(1-ETA_A))/O_A)^((1-ETA_Z)/(1-ETA_A)))	...
					^((1-ETA_C)/(1-ETA_Z))+KAPPA_O*pO_ss^(1-ETA_C)+KAPPA_A*pA^(1-ETA_C)-1;
    pA_ss 		= fzero(pA_implicit,1);
end
pF_ss			= ((pA_ss^(1-ETA_A)-(1-O_A)*(pH_ss)^(1-ETA_A))/O_A)^(1/(1-ETA_A));
pZ_ss			= ((1-O_Z)*pH_ss^(1-ETA_Z)+O_Z*pF_ss^(1-ETA_Z))^(1/(1-ETA_Z));
rer_ss          = mcF_ss*pF_ss;
pHstar_ss       = pH_ss*mcH_ss/(rer_ss*mcHstar_ss);
pI_ss          	= ((1-O_I)*pH_ss^(1-ETA_I)+O_I*pF_ss^(1-ETA_I))^(1/(1-ETA_I));
pCG_ss         	= ((1-O_CG)*pH_ss^(1-ETA_CG)+O_CG*pF_ss^(1-ETA_CG))^(1/(1-ETA_CG));


%31-40
pIG_ss         	= ((1-O_IG)*pH_ss^(1-ETA_IG)+O_IG*pF_ss^(1-ETA_IG))^(1/(1-ETA_IG));
pICo_ss         = ((1-O_Co)*pH_ss^(1-ETA_Co)+O_Co*pF_ss^(1-ETA_Co))^(1/(1-ETA_Co));
fstar_ss        = (1/xistar_ss)^(1/GAMMA_star);
pOstar_ss       = pO_ss/rer_ss*xiO_ss^(1/(RHO_O-1));
pCostar_ss      = pCo_ss/rer_ss;
xiCostar_ss    	= (pCostar_ss/fstar_ss)^GAMMA_Costar;
xiOstar_ss     	= (pOstar_ss/fstar_ss)^GAMMA_Ostar;
lamCo_ss        = (1-tauCo_ss*(1-CHI_CO))*rer_ss*pCostar_ss;
ubar_ss         = 1-log(pI_ss)/PHI_UBAR;
q_ss            = pI_ss/varomega_ss;
rK_ss           = (q_ss*(a_ss^SIGMA/BETTA-1+DELTA)-pI_ss*tauK_ss*DELTA)/(ubar_ss*(1-tauK_ss)-pI_ss/PHI_UBAR*(exp(PHI_UBAR*(ubar_ss-1))-1)*(1-tauK_ss));


%41-50
phi_ubar_ss     = rK_ss/PHI_UBAR*(exp(PHI_UBAR*(ubar_ss-1))-1);
Rstar_ss        = a_ss^SIGMA*pi_ss/(BETTA*piS_ss*xi_ss);
pistar_ss       = pi_ss/piS_ss;
piFstar_ss      = pistar_ss;
piCostar_ss     = pistar_ss;
piOstar_ss     	= pistar_ss;
piMstar_ss      = pistar_ss;
pMstar_ss       = xiMstar_ss^(1/GAMMA_Mstar)*fstar_ss;
n_ss    		= 1-u_ss;
if Search==1
	rhox_ss		= rho_ss*srhox;
	rhon_ss 	= (rho_ss-rhox_ss)/(1-rhox_ss);
end


%51-60
if Search==1
	MU_CTIL		= log(hC_ss*(1-rhon_ss)/normcdf((norminv(1-rhon_ss)-SIGMA_CTIL))/wedH_ss)-SIGMA_CTIL^2/2;
	cbar_ss 	= exp(SIGMA_CTIL*norminv(1-rhon_ss)+MU_CTIL);
	v_ss    	= rho_ss*n_ss/(e_ss*(1-rho_ss));
	m_ss    	= e_ss*(v_ss/u_ss)^MU;
	s_ss    	= m_ss*(v_ss/u_ss)^(1-MU);
end
O_KG            = kG_ss/(kS_ss+kG_ss)*PubGoods+ZERO;
ktil_ss         = ((1-O_KG)^(1/ETA_KG)*kS_ss^(1-1/ETA_KG)+O_KG^(1/ETA_KG)*(kG_ss/a_ss)^(1-1/ETA_KG))^(ETA_KG/(ETA_KG-1));                      
if Search==0
	w_ss  		= (ALPHA^ALPHA*(1-ALPHA)^(1-ALPHA)*mcZtil_ss*a_ss^(1-ALPHA)/rKtil_ss^ALPHA)^(1/(1-ALPHA));
end
k_ss            = kS_ss*a_ss/ubar_ss;
i_ss            = k_ss*(1-(1-DELTA)/a_ss)/varomega_ss;
yZtil_ss 		= ktil_ss^ALPHA*(a_ss*wedH_ss*n_ss*h_ss)^(1-ALPHA);


%61-70
yHtil_ss        = z_ss*((1-O_O)^(1/ETA_O)*yZtil_ss^((ETA_O-1)/ETA_O)+O_O^(1/ETA_O)*xO_ss^((ETA_O-1)/ETA_O))^(ETA_O/(ETA_O-1));
if Search==1
	gammaW_ss   = a_ss*pi_ss;
	w_ss     	= h_ss^-1*(BETTA*a_ss^(1-SIGMA)*(1-rho_ss)*(wedH_ss*cbar_ss-hC_ss)+mcZtil_ss*(1-ALPHA)*yZtil_ss/n_ss-wedH_ss*cbar_ss);
	wn_ss    	= w_ss;
	OMEGA_V  	= e_ss/wedH_ss*(w_ss*h_ss+wedH_ss*cbar_ss-mcZtil_ss*(1-ALPHA)*yZtil_ss/n_ss);
	xL_ss 	 	= hC_ss*n_ss + wedH_ss*OMEGA_V*v_ss;
	psiU_kappa 	= (mcZtil_ss*(1-ALPHA)^2*yZtil_ss/n_ss)/(h_ss^(1+PHI)/(1-tauL_ss)*(wedH_ss)^(1-SIGMA));
	ub          = (1-tauL_ss)/(1-VARPHI_U)*																					...
				  (wn_ss*h_ss-VARPHI_U*(mcZtil_ss*(1-ALPHA)*yZtil_ss/n_ss-pH_ss*hC_ss+wedH_ss*s_ss*OMEGA_V/e_ss))	...
				  -psiU_kappa*(wedH_ss)^(1-SIGMA)*h_ss^(1+PHI)/(1+PHI);
else
	wn_ss    	= w_ss*((1-VARKAPPA_W*a_ss^(ALPHA_W-1))/(1-VARKAPPA_W));
	xL_ss 	 	= 0;
    ub		= 0;
end
o_ss            = oC_ss+xO_ss;


%71-80
if_ss			= i_ss+phi_ubar_ss*k_ss/a_ss;
pYy_ss          = (pH_ss*(yHtil_ss)+pO_ss*(oC_ss)-rer_ss*pOstar_ss*o_ss+yHstarVA_ss+pF_ss*(1-mcF_ss*DelF_ss)*(										...
                                               -O_Z*(pF_ss/pZ_ss)^-ETA_Z*(1-KAPPA_O-KAPPA_A)*pZ_ss^-ETA_C*(pI_ss*if_ss+pICo_ss*utCo_ss+pH_ss*xL_ss)	...
                                               -O_A*(pF_ss/pA_ss)^-ETA_A*(KAPPA_A)*pA_ss^-ETA_C*(pI_ss*if_ss+pICo_ss*utCo_ss+pH_ss*xL_ss)			...
                                               +O_I*(pF_ss/pI_ss)^-ETA_I*(pI_ss*if_ss)/pI_ss														...
											   +O_Co*(pF_ss/pICo_ss)^(-ETA_Co)*utCo_ss))															...
				  /																																	...
				 (1-sCo_ss-pF_ss*(1-mcF_ss*DelF_ss)*(																								...
                                                O_Z*(pF_ss/pZ_ss)^(-ETA_Z)*(1-KAPPA_O-KAPPA_A)*pZ_ss^-ETA_C*(1-stb_ss-scG_ss-siG_ss-siCo_ss)			...
                                               +O_A*(pF_ss/pA_ss)^(-ETA_A)*(KAPPA_A)*pA_ss^-ETA_C*(1-stb_ss-scG_ss-siG_ss-siCo_ss)					...
                                               +O_CG*(pF_ss/pCG_ss)^(-ETA_CG)*scG_ss/pCG_ss														...
                                               +O_IG*(pF_ss/pIG_ss)^(-ETA_IG)*(siG_ss)/pIG_ss														...
                                               +O_Co*(pF_ss/pICo_ss)^(-ETA_Co)*(siCo_ss)/pICo_ss));
tb_ss           = stb_ss*pYy_ss;
iG_ss           = siG_ss*pYy_ss/pIG_ss;
iCo_ss          = siCo_ss*pYy_ss/pICo_ss;
trG_ss          = str_ss*pYy_ss;
iAG_ss      	= iG_ss/VARPHI_0*(1-(RHO_VARPHI/a_ss))/(1-(RHO_VARPHI/a_ss)^N_G);
iACo_ss     	= iCo_ss/VARPHI_Co_0*(1-(RHO_VARPHI_Co/a_ss))/(1-(RHO_VARPHI_Co/a_ss)^N_Co);
cG_ss           = scG_ss*pYy_ss/pCG_ss;
qCo_ss          = pI_ss/(pi_ss/R_ss)^(N_Co-1)*VARPHI_Co_0*(1-(RHO_VARPHI_Co*pi_ss/R_ss)^(N_Co))/(1-RHO_VARPHI_Co*pi_ss/R_ss);


%81-90
yCo_ss          = sCo_ss*pYy_ss/(rer_ss*pCostar_ss);
kCo_ss          = kCo_yCo_ss*yCo_ss*(rer_ss*pCostar_ss)/qCo_ss;
DELTA_Co        = iACo_ss/a_ss^(N_Co-2)/kCo_ss-a_ss+1;
uCo_ss          = 1-log(pICo_ss)/PHI_UCo;
ALPHA_Co        = kCo_ss*qCo_ss*(R_ss/pi_ss-(1-DELTA_Co))/a_ss/lamCo_ss/yCo_ss/(1-pICo_ss/PHI_UCo/uCo_ss*(exp(PHI_UCo*(uCo_ss-1))-1));
rKCo_ss         = (1-tauCo_ss*(1-CHI_CO))*rer_ss*pCostar_ss*ALPHA_Co*yCo_ss/uCo_ss/kCo_ss*a_ss;
phi_uCo_ss      = rKCo_ss/PHI_UCo*(exp(PHI_UCo*(uCo_ss-1))-1);
iCof_ss         = iCo_ss+phi_uCo_ss*kCo_ss/a_ss;
zCo_ss         	= (uCo_ss*kCo_ss/a_ss)^-ALPHA_Co*(a_ss*wedCo_ss*L_BAR)^(ALPHA_Co-1)*yCo_ss;
cfCo_ss 		= rer_ss*pCostar_ss*yCo_ss-pICo_ss*iCof_ss;


%91-100
renRstar_ss		= pYy_ss/rer_ss/(1-OMEGA)*(sca_ss*(a_ss*pistar_ss-Rstar_ss*xi_ss)/(a_ss*pistar_ss-1)...
				  -stb_ss+(1-CHI_CO)*(cfCo_ss-tauCo_ss*(cfCo_ss+pICo_ss*iCof_ss))/pYy_ss);
renstar_ss		= (1-OMEGA)*renRstar_ss-(1-CHI_CO)*(cfCo_ss-tauCo_ss*(cfCo_ss+pICo_ss*iCo_ss))/rer_ss;
c_ss            = pYy_ss-pI_ss*if_ss-pICo_ss*iCof_ss-pCG_ss*cG_ss-pIG_ss*iG_ss-tb_ss-pH_ss*xL_ss;
cA_ss           = KAPPA_A*pA_ss^-ETA_C*c_ss;
xAH_ss          = zA_ss^(ETA_A-1)*(1-O_A)*(pH_ss/pA_ss)^-ETA_A*cA_ss;
xAF_ss          = zA_ss^(ETA_A-1)*O_A *(pF_ss/pA_ss)^-ETA_A*cA_ss;
cZ_ss           = (1-KAPPA_O-KAPPA_A)*(pZ_ss)^-ETA_C*c_ss;
yC_ss           = c_ss+pCG_ss*cG_ss+pI_ss*if_ss+pICo_ss*iCof_ss+pIG_ss*iG_ss+pH_ss*xL_ss;
xZH_ss          = (1-O_Z)*(pH_ss/pZ_ss)^-ETA_Z*cZ_ss;
xZF_ss          = O_Z*(pF_ss/pZ_ss)^-ETA_Z*cZ_ss;


%101-110
xIF_ss          = O_I *(pF_ss/pI_ss)^-ETA_I*if_ss;
xIH_ss          = (1-O_I)*(pH_ss/pI_ss)^-ETA_I*if_ss;
xCGH_ss         = (1-O_CG)*(pH_ss/pCG_ss)^-ETA_CG*cG_ss;
xCGF_ss         = O_CG *(pF_ss/pCG_ss)^-ETA_CG*cG_ss;
xIGH_ss         = (1-O_IG)*(pH_ss/pIG_ss)^-ETA_IG*iG_ss;
xIGF_ss         = O_IG *(pF_ss/pIG_ss)^-ETA_IG*iG_ss;
xCoH_ss         = (1-O_Co)*(pH_ss/pICo_ss)^-ETA_Co*iCof_ss;
xCoF_ss         = O_Co*(pF_ss/pICo_ss)^-ETA_Co*iCof_ss;
yH_ss       	= xZH_ss+xIH_ss+xCoH_ss+xCGH_ss+xIGH_ss+xAH_ss+xL_ss;
xH_ss           = yH_ss;
fH_ss           = ptilH_ss^-EPSILON_H*yH_ss*mcH_ss/(1-BETTA*a_ss^(1-SIGMA)*THETA_H);


%111-120
yHstar_ss 		= (yHtil_ss-yH_ss*DelH_ss)/DelHstar_ss;
xHstar_ss		= yHstar_ss;
yF_ss           = xZF_ss+xIF_ss+xCoF_ss+xCGF_ss+xIGF_ss+xAF_ss;
xF_ss           = yF_ss;
fF_ss           = ptilF_ss^-EPSILON_F*yF_ss*mcF_ss/(1-BETTA*a_ss^(1-SIGMA)*THETA_F);
imp_ss          = yF_ss*DelF_ss;
y_ss            = xL_ss+c_ss+if_ss+iCo_ss+cG_ss+iG_ss+yHstar_ss+yCo_ss-imp_ss-o_ss;
pY_ss           = (yC_ss+tb_ss)/y_ss;
if Search==1
	trUFAbar	= (1-n_ss)*ub-tauUFA_ss*w_ss*n_ss*h_ss;
	bUFA_ss     = (tauUFA_ss*w_ss*n_ss*h_ss-(1-n_ss)*ub+trUFAbar)/(1-R_ss/pi_ss/a_ss);
	trUFA_ss    = trUFAbar;
else
	bUFA_ss     = 0;
	trUFA_ss    = 0;
end


%121-130
trNR_ss         = OMEGA_G/OMEGA*(trG_ss-trUFA_ss);
trR_ss          = (1-OMEGA_G)/(1-OMEGA)*(trG_ss-trUFA_ss);
bstar_ss        = sca_ss*pYy_ss*a_ss*pistar_ss/rer_ss/(a_ss*pistar_ss-1);
ystar_ss        = a_ss*zstar_ss;
OSTAR           = (yHstar_ss/ystar_ss)*(pHstar_ss)^ETASTAR;
iR_ss           = (i_ss)/(1-OMEGA);
kR_ss           = (k_ss)/(1-OMEGA);
kSR_ss          = (kS_ss)/(1-OMEGA);
g_ss            = pCG_ss*cG_ss +trG_ss +pIG_ss*iG_ss;
gtilRule_ss     = g_ss;


%131-140           
gtilExo_ss      = g_ss;
gtil_ss         = g_ss;
ALPHA_CG        = pCG_ss*cG_ss/(g_ss*xiCG_ss);
ALPHA_IG        = pIG_ss*iG_ss/(g_ss*xiIG_ss);
d_ss            = pYy_ss-rer_ss*pCostar_ss*yCo_ss-rK_ss*kS_ss-w_ss*n_ss*h_ss-pH_ss*xL_ss;
bG_ss           = -sDEF_ss*pY_ss*y_ss/((1-1/(a_ss*pi_ss))+ALPHA_D/(1-ALPHA_D)*(1-1/(a_ss*pistar_ss)));
bPr_ss            = -bG_ss-bUFA_ss;
bGstar_ss 		= ALPHA_D/(1-ALPHA_D)*bG_ss/rer_ss;
bPrstar_ss 		= bstar_ss - bGstar_ss;
bR_ss           = (bPr_ss)/(1-OMEGA);
dR_ss           = (d_ss)/(1-OMEGA);
bRstar_ss       = (bPrstar_ss)/(1-OMEGA);


%141-150            
tauprime		= tauC_ss*c_ss+tauW_ss*w_ss*n_ss*h_ss+tauK_ss							...
				  *(rK_ss*ubar_ss-pI_ss*(DELTA+rK_ss/PHI_UBAR*(exp(PHI_UBAR*(ubar_ss-1))-1)))	...
				  *k_ss/a_ss+tauD_ss*d_ss+tauCo_ss*(1-CHI_CO)*(cfCo_ss+pICo_ss*iCof_ss);
t_ss            = (g_ss+bG_ss*(1-R_ss/(a_ss*pi_ss))+bGstar_ss*rer_ss*(1-xi_ss*Rstar_ss/(a_ss*pistar_ss))-tauprime-CHI_CO*cfCo_ss);
tNR_ss          = t_ss*OMEGA_G/OMEGA;
tR_ss           = t_ss*(1-OMEGA_G)/(1-OMEGA);
ALPHA_T         = t_ss/pYy_ss;
tau_ss         	= tauprime+t_ss;
tautil_ss       = tau_ss;
ptilCostar_ss   = pCostar_ss;
ptilCostar2_ss  = pCostar_ss;
sb              = -sDEF_ss;
gGamaHstar_ss	= pistar_ss;
cNR_ss  		= ((1-tauL_ss)*w_ss*n_ss*h_ss+ub*u_ss+trNR_ss-OMEGA_G/OMEGA*t_ss)/(1+tauC_ss);


%151-160
cR_ss           = (c_ss-OMEGA*cNR_ss)/(1-OMEGA);
O_CHAT          = cG_ss/(cR_ss-VARSIGMA*cR_ss/a_ss+cG_ss)*ValGovCons+ZERO;
chatR_ss        = ((1-O_CHAT)^(1/ETA_CHAT)*(cR_ss-VARSIGMA*cR_ss/a_ss)^(1-1/ETA_CHAT)...
				  +O_CHAT^(1/ETA_CHAT)*cG_ss^(1-1/ETA_CHAT))^(ETA_CHAT/(ETA_CHAT-1));
chatNR_ss       = ((1-O_CHAT)^(1/ETA_CHAT)*(cNR_ss-VARSIGMA*cNR_ss/a_ss)^(1-1/ETA_CHAT)...
				  +O_CHAT^(1/ETA_CHAT)*cG_ss^(1-1/ETA_CHAT))^(ETA_CHAT/(ETA_CHAT-1));
lamR_ss			= (chatR_ss)^(-SIGMA)*((1-O_CHAT)*chatR_ss/(cR_ss-VARSIGMA*cR_ss/a_ss))^(1/ETA_CHAT)/(1+tauC_ss);
lamNR_ss		= (chatNR_ss)^(-SIGMA)*((1-O_CHAT)*chatNR_ss/(cNR_ss-VARSIGMA*cNR_ss/a_ss))^(1/ETA_CHAT)/(1+tauC_ss);
chitilR_ss  	= (wedH_ss)^-SIGMA*(chatR_ss)^SIGMA;
chitilNR_ss		= (wedH_ss)^-SIGMA*(chatNR_ss)^SIGMA;
if Search==1
	psiU_ss     = (1-OMEGA)*ThetaR_ss/lamR_ss+OMEGA*ThetaNR_ss/lamNR_ss;
	kappa_ss 	= (mcZtil_ss*(1-ALPHA)^2*yZtil_ss/n_ss)/(psiU_ss/(1-tauL_ss)*h_ss^(1+PHI)*(wedH_ss)^(1-SIGMA));
    
else	
	lamU_ss     = OMEGA_U*lamNR_ss+(1-OMEGA_U)*lamR_ss;
	kappa_ss    = mcW_ss*lamU_ss*(1-tauW_ss)*w_ss/hd_ss^PHI;
end


%161-163
if Search==1
	sRU_ss 		= ((1-tauL_ss)*wn_ss*h_ss-ThetaR_ss*kappa_ss*wedH_ss^(1-SIGMA)*h_ss^(1+PHI)/(1+PHI)/lamR_ss-ub)...
				  /(1-(1-s_ss)*BETTA/a_ss^(SIGMA-1)*(1-rho_ss));
	sNRU_ss 	= ((1-tauL_ss)*wn_ss*h_ss-ThetaNR_ss*kappa_ss*wedH_ss^(1-SIGMA)*h_ss^(1+PHI)/(1+PHI)/lamNR_ss-ub)...
				  /(1-(1-s_ss)*BETTA/a_ss^(SIGMA-1)*(1-rho_ss));
	sigmaU_ss	= BETTA/a_ss^(SIGMA-1)*(1-rho_ss)*((1-OMEGA)*sRU_ss+OMEGA*sNRU_ss);
end
fHstar_ss       = ptilHstar_ss^-EPSILON_Hstar*yHstar_ss*mcHstar_ss/(1-BETTA*a_ss^(1-SIGMA)*THETA_Hstar);
tau_cyc_ss      = 0;
cfCo_cyc_ss     = 0;
cfCotil_ss      = rer_ss*pCostar_ss*yCo_ss-pICo_ss*iCof_ss;
yD_ss 			= y_ss-xL_ss-if_ss+i_ss-iCof_ss+iCo_ss;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%% Updating Equations %%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

UPD=1;

utCo_ss_upd     = phi_uCo_ss*kCo_ss/a_ss;
utCo_ss_upd     = utCo_ss_upd^UPD*utCo_ss^(1-UPD);

kG_ss_upd       = iAG_ss/a_ss^(N_G-1)/(1-(1-DELTA_G)/a_ss);
kG_ss_upd		= kG_ss_upd*UPD+kG_ss*(1-UPD);

if Search==1
	hC_ss_upd	= (ADM_COST_RAT*pYy_ss)/n_ss/pH_ss;
	hC_ss_upd   = hC_ss_upd^UPD*hC_ss^(1-UPD);
else
    hC_ss_upd=0;
end

if ETA_KG>1
    UPD             = 0.75-(ETA_KG<1.5)*(0.5-(ETA_KG-1))/2;
    kS_ss_upd       = (((ALPHA*(mcZtil_ss/rKtil_ss)*yZtil_ss)^((ETA_KG-1)/ETA_KG)...
					  -O_KG^(1/ETA_KG)*(kG_ss_upd/a_ss)^((ETA_KG-1)/ETA_KG))...
                      /(1-O_KG)^(1/ETA_KG))^(ETA_KG/(ETA_KG-1));
    kS_ss_upd       = kS_ss_upd^UPD*kS_ss^(1-UPD);
    rKtil_ss_upd    = rK_ss*(kS_ss_upd/(1-O_KG)/ktil_ss)^(1/ETA_KG); 
    kS_ss_upd       = kS_ss_upd^UPD*kS_ss^(1-UPD);
else
    UPD             = 1-(ETA_KG>0.5)*ETA_KG/2;
    rKtil_ss_upd 	= ALPHA*(mcZtil_ss/ktil_ss)*yZtil_ss;
    rKtil_ss_upd    = rKtil_ss_upd^UPD*rKtil_ss^(1-UPD);
    kS_ss_upd       = (rKtil_ss_upd/rK_ss)^(1/(1/ETA_KG))*ktil_ss*(1-O_KG);
    kS_ss_upd       = kS_ss_upd^UPD*kS_ss^(1-UPD);
end

UPD=1;

yHstarVA_ss_upd	= pHstar_ss*rer_ss*yHstar_ss-pH_ss*yHstar_ss;
yHstarVA_ss_upd	= yHstarVA_ss_upd*UPD+yHstarVA_ss*(1-UPD);

oC_ss_upd       = KAPPA_O*pO_ss^-ETA_C*c_ss;
oC_ss_upd		= oC_ss_upd*UPD+oC_ss*(1-UPD);

xO_ss_upd       = O_O*(pO_ss/pH_ss/mcH_ss)^-ETA_O*yHtil_ss;
xO_ss_upd       = xO_ss_upd*UPD+xO_ss*(1-UPD);


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%% Other SS Equations %%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

sbstar_ss       = rer_ss*bstar_ss/pYy_ss;
Rbar_ss         = R_ss;
bGstar_tot_ss   = bGstar_ss/bstar_ss;
bPrstar_tot_ss   = bPrstar_ss/bstar_ss;
bGtot_ss		= bG_ss+rer_ss*bGstar_ss;
gam_WN_ss       = a_ss*pi_ss;
yDr_ss 			= yD_ss-yCo_ss;
yr_ss 			= y_ss-yCo_ss;
itot_ss 		= i_ss+iCo_ss+iG_ss;
cPr_ss         	= OMEGA*cNR_ss+(1-OMEGA)*cR_ss;
if Search==1
	job_cr_ss		= (1-rho_ss)*(m_ss*v_ss^(1-MU)*u_ss^MU);
	job_des_tot_ss	= rho_ss*n_ss;
	job_des_endo_ss	= (1-rhox_ss)*rhon_ss*n_ss;
	job_des_exo_ss	= rhox_ss*n_ss;
else
	gam_LAM_ss		= 1/a_ss;
end
hn_ss           = h_ss*n_ss;

%%%%%%%% Balanced growth path variables
[gam_Y_ss,      gam_C_ss,       gam_CR_ss,      gam_CNR_ss,     ...	
 gam_I_ss,      gam_W_ss,       gam_K_ss,       gam_KG_ss,      ...
 gam_IAG_ss,    gam_YC_ss,      gam_YF_ss,      gam_YH_ss,      ...
 gam_M_ss,      gam_Gtil_ss,    gam_G_ss,       gam_XHstar_ss,  ...
 gam_OC_ss, 	gam_ICo_ss,     gam_IACo_ss,    gam_YCo_ss,     ...
 gam_KCo_ss,	gam_XO_ss,      gam_O_ss,       gam_BSTAR_ss,   ... 
 gam_Ystar_ss,  gam_BPRSTAR_ss,  gam_BGSTAR_ss,  gam_IG_ss,      ...
 gam_CG_ss,     gam_TRG_ss,     gam_YR_ss,      gam_YHstar_ss	]           = deal(a_ss);

[gam4_Y_ss      gam4_C_ss,    	gam4_CR_ss,   	gam4_CNR_ss,     ...	
 gam4_I_ss,   	gam4_W_ss,   	gam4_K_ss,    	gam4_KG_ss,      ...
 gam4_IAG_ss,  	gam4_YC_ss,   	gam4_YF_ss,  	gam4_YH_ss,      ...
 gam4_M_ss,    	gam4_Gtil_ss, 	gam4_G_ss,    	gam4_XHstar_ss,  ...
 gam4_OC_ss, 	gam4_ICo_ss,  	gam4_IACo_ss, 	gam4_YCo_ss,     ...
 gam4_KCo_ss,	gam4_XO_ss,   	gam4_O_ss,    	gam4_BSTAR_ss,   ... 
 gam4_Ystar_ss,	gam4_BPRSTAR_ss,gam4_BGSTAR_ss,	gam4_IG_ss,      ...
 gam4_CG_ss,   	gam4_TRG_ss, 	gam4_YR_ss,   	gam4_YHstar_ss	]           = deal(a_ss^4);

%%%%%%%% Inflation variables
[piH_ss,        piF_ss,         piZ_ss,         piA_ss,         ...
 piMtot_ss,     piO_ss,         piHX_ss,        pitil_ss        ]           = deal(pi_ss);

[pi4_ss,        pi4_E1_ss,      pi4_E2_ss,      pi4_E4_ss,                                                        ...
 piH4_ss,     	piF4_ss,      	piZ4_ss,      	piA4_ss,         ...
 piMtot4_ss,  	piO4_ss,      	piHX4_ss,   	pitil4_ss        ]          = deal(pi_ss^4);
