
function [ys,check]=sm1_steadystate(junk,ys);

global M_

paramfile_sm1

nparams = size(M_.param_names,1);
for icount = 1:nparams
    eval(['M_.params(icount) = ',M_.param_names(icount,:),';'])
end


check=0;

ASS = 1;
YSS = (ckappa_KY)^(calpha/(1-calpha));
CSS = (1-cdelta_0*ckappa_KY-cg_bar)*YSS;
GSS=cg_bar*YSS; 
IhatSS = cdelta_0*((ckappa_KY)^(1/1-calpha)); 
ISS =cdelta_0*(ckappa_KY)*YSS;
KSS = (ckappa_KY)^(1/1-calpha);
L_sub_DSS = 1;
LSS = 1;
M_sub_1SS = 1;
M_sub_2SS = 1;
Q_sub_BSS = 1/(((1/cbeta) + 0.01) - ckappa);
QSS = 1/(((1/cbeta) + 0.03) - ckappa);
R_sup_BSS = (1/cbeta) + 0.01;
R_sup_FSS = (1/cbeta) + 0.03;
R_sup_DSS =  1/cbeta;
R_sup_RESS = 1/cbeta;
R_sup_TRSS = 1/cbeta;
T_sub_CBSS = (1+ckappa*(1/(((1/cbeta) + 0.03) - ckappa)))*0 + (1+ckappa*(1/(((1/cbeta) + 0.01) - ckappa)))*0.06 - (1/cbeta)*((1/(((1/cbeta) + 0.03) - ckappa))*0 + Q_sub_BSS*(1/(((1/cbeta) + 0.01) - ckappa)));
TSS = (cg_bar/((ckappa_KY)^(calpha/(1-calpha))))+cb_bar_G - ((1+ckappa*(1/(((1/cbeta) + 0.03) - ckappa)))*0 + (1+ckappa*(1/(((1/cbeta) + 0.01) - ckappa)))*0.06 - (1/cbeta)*((1/(((1/cbeta) + 0.03) - ckappa))*0 + Q_sub_BSS*(1/(((1/cbeta) + 0.01) - ckappa)))) - (1/(((1/cbeta) + 0.01) - ckappa))*cb_bar_G*(1-ckappa);
Y_sub_MSS = (ckappa_KY)^(calpha/(1-calpha));
b_sub_CBSS = 0.06;
bSS = cb_bar_G - 0.06;
mrsSS = (cchi*(((1-cdelta_0*ckappa_KY-cg_bar)*((ckappa_KY)^(calpha/(1-calpha))))*(1-cb)))/(1-cbeta*cb);
thetaSS = 0.58;
phiSS = 1/thetaSS;
wSS = (1-calpha)*(cdelta_1/calpha)*KSS;
f_sub_1SS = (1/(1 - cphi_w*cbeta))*(mrsSS*(wSS)^cepsilon_w);
f_sub_2SS = (1/(1 - cphi_w*cbeta))*((wSS)^cepsilon_w);
f_sub_CBSS = 0;
p_starSS = (cepsilon_p/(cepsilon_p - 1))*((cdelta_1*ckappa_KY)/calpha);
p_sup_KSS = 1;
p_sub_MSS = (cdelta_1*ckappa_KY)/calpha;
reSS = QSS*f_sub_CBSS+ Q_sub_BSS*b_sub_CBSS;
uSS =1;
w_starSS = (cepsilon_w/(cepsilon_w - 1))*mrsSS;
x_sub_1SS = (1/(1-cphi_p)*cbeta)*((cdelta_1*ckappa_KY)/calpha)*YSS;
x_sub_2SS = (1/(1-cphi_p)*cbeta)*YSS;
LambdaSS = cbeta;
PiSS = 1;
OmegaSS = 1;
lambdaSS = 1;
muSS = (1-cbeta*cb)/(CSS*(1-cb));
upsilon_sup_PSS =1;
upsilon_sup_WSS = (w_starSS/wSS)^(-cepsilon_w);
omegaSS = 0;
nSS = (((1-csigma*R_sup_DSS)*(R_sup_DSS-1))/((1-csigma*R_sup_DSS)*(R_sup_DSS-1))-csigma*(R_sup_FSS-R_sup_DSS)*(R_sup_DSS-1-thetaSS*phiSS))*((1/(1-csigma*R_sup_DSS))*(csigma*((R_sup_FSS-R_sup_DSS)*((1/(R_sup_DSS-1))*(CSS-mrsSS-cX+TSS)-Q_sub_BSS*bSS-reSS)+(R_sup_BSS-R_sup_DSS)*(Q_sub_BSS*bSS)+(R_sup_RESS-R_sup_DSS)*(reSS))+cX));
dSS = (1/(R_sup_DSS - 1))*(CSS - mrsSS - thetaSS*phiSS*nSS +cX + TSS);
fSS = (1/QSS)*(dSS + nSS -Q_sub_BSS*bSS - reSS);
f_sub_MSS = fSS;

ys = [ ASS
CSS  
GSS
IhatSS
ISS
KSS
L_sub_DSS
LSS
M_sub_1SS
M_sub_2SS
Q_sub_BSS
QSS
R_sup_BSS
R_sup_FSS 
R_sup_DSS
R_sup_RESS 
R_sup_TRSS 
T_sub_CBSS 
TSS
Y_sub_MSS 
YSS 
b_sub_CBSS 
bSS 
mrsSS 
thetaSS 
phiSS 
wSS 
f_sub_1SS 
f_sub_2SS 
f_sub_CBSS 
p_starSS 
p_sup_KSS 
p_sub_MSS 
reSS 
uSS 
w_starSS 
x_sub_1SS 
x_sub_2SS 
LambdaSS 
PiSS 
OmegaSS 
lambdaSS 
muSS 
upsilon_sup_PSS
upsilon_sup_WSS 
omegaSS 
nSS 
dSS
fSS 
f_sub_MSS 
] ;

save ys ASS CSS GSS IhatSS ISS KSS L_sub_DSS LSS M_sub_1SS M_sub_2SS Q_sub_BSS QSS R_sup_BSS R_sup_FSS R_sup_DSS R_sup_RESS R_sup_TRSS T_sub_CBSS TSS Y_sub_MSS b_sub_CBSS bSS mrsSS thetaSS phiSS wSS f_sub_1SS f_sub_2SS f_sub_CBSS p_starSS p_sup_KSS p_sub_MSS reSS uSS w_starSS w_starSS x_sub_1SS x_sub_2SS LambdaSS PiSS OmegaSS lambdaSS muSS upsilon_sup_PSS upsilon_sup_WSS omegaSS nSS dSS fSS f_sub_MSS

