function [ys,check] = cycle_steadystate(junk,ys)

global BETTA SIG ALPA DELTA0 DELTA1 MUA MUY MUI;
global DELTA2 THETA_C THETA_L RHO_Z RHO_G RHO_XG RHO_X RHO_A KAPA CHI;
%% steady state of growth rate : 4
MU_A = MUA;
MU_Y = MUY;
MU_K = MUY/MUA;
MU_X = MUY*MUA^(-ALPA/(ALPA-1));

%% steady state of endogenous variables other then growth rate and observable variable: 13
X_G = (1/MU_Y)^(1/(1-RHO_XG));
Z = 1;
U = 1;
Q = 1;
KH = (Q*(1/BETTA/MU_A*(MU_Y)^(SIG)-(1-DELTA0))/(Z*U*ALPA*(U/MU_K)^(ALPA-1)))^(1/(ALPA-1));            % steady value of k/h
YH = Z*(U*KH/MU_K)^(ALPA);                          % steady value of y/h
IK = (1-(1-DELTA0)/MU_K);                           % steady value of i/k
CH = 0.8*YH - IK*KH;                                % steady value of c/h
F = ((1-THETA_C/MU_Y)^(-SIG)-THETA_C*BETTA*(MU_Y-THETA_C)^(-SIG))*Z*(1-ALPA)*(U/MU_K*KH)^(ALPA)*(1-THETA_L);
G = CHI*CH*((1-THETA_C/MU_Y)^(1-SIG)-THETA_L*BETTA*(MU_Y-THETA_C)^(1-SIG))+(1-THETA_L)*Z*(1-ALPA)*(U/MU_K*KH)^ALPA*((1-THETA_C/MU_Y)^(-SIG)-THETA_C*BETTA*(MUY-THETA_C)^(-SIG));
H = F/G;
K = KH*H;
Y = YH*H;
C = CH*H;
L = 1 - H;
I = IK*K;
LAMDA = (C-THETA_C*C/MU_Y)^(-SIG)*(L-THETA_L*L)^(CHI*(1-SIG))-THETA_C*BETTA*(C*MU_Y-THETA_C*C)^(-SIG)*(L-THETA_L*L)^(CHI*(1-SIG));
% Q_A = (ALPA*Y/K - IK)*(1-BETTA*(MU_Y)^(1-SIG));
G = 0.2*Y*MU_Y^(1/(1-RHO_XG));

%% steady state of anticipated shocks: 12
ex1 = 1;
ex2 = 1;
ex3 = 1;
ea1 = 1;
ea2 = 1;
ea3 = 1;
ez1 = 1;
ez2 = 1;
ez3 = 1;
eg1 = 1;
eg2 = 1;
eg3 = 1;

%% steady state of observable variable: 6
y_obs = 1;
c_obs = 1;
ai_obs = 1;
g_obs = 1;
h_obs = H;
a_obs = 1;

%% Return SS values of 35 variables
% 4 steady state of growth rate
% 6 steady state of observable variable
% 13 steady state of other endogenous variable
% ys = [C ea1 ea2 ea3 eg1 eg2 eg3 ex1 ex2 ex3 ez1 ez2 ez3 G ga_obs gai_obs gc_obs gg_obs gy_obs H h_obs I K L LAMDA MU_A MU_K MU_X MU_Y Q Q_A U X_G Y Z]';
ys = [a_obs ai_obs C c_obs ea1 ea2 ea3 eg1 eg2 eg3 ex1 ex2 ex3 ez1 ez2 ez3 G g_obs H h_obs I K L LAMDA MU_A MU_K MU_X MU_Y Q U X_G Y y_obs Z]';
check = 0;
