function [ys,check] = simsgk_steadystate(ys,exo)

%  function [ys,check] = simsgk_steadystate(ys,exo) (In my case)
% Inputs: 
%   - ys        [vector] vector of initial values for the steady state of
%                   the endogenous variables
%   - exo       [vector] vector of values for the exogenous variables
%
% Output: 
%   - ys        [vector] vector of steady state values fpr the the endogenous variables
%   - check     [scalar] set to 0 if steady state computation worked and to
%                    1 of not (allows to impos restriction on parameters)

global M_
% read out parameters to access them with their name

NumberOfParameters = M_.param_nbr;
for ii = 1:NumberOfParameters
  paramname = deblank(M_.param_names(ii,:));
  eval([ paramname ' = M_.params(' int2str(ii) ');']);
end

% initialize indicator
check = 0;

options=optimset(); % set options for numerical solver

% the steady state computation 
A=0;
Z=0;
U=0;
xi=0;
infl=pistar;
pisharp= infl;
int=1/betta -1;
R=int;
N= log(0.5);
K=log(15);
vp=0;
Q=0;
omegag=0;
Y=log(15^(alppha)*0.5^(1-alppha));
C = log(0.6*15^(alppha)*0.5^(1-alppha));
G= log(0.15*15^(alppha)*0.5^(1-alppha));
lam = -log(0.6*15^(alppha)*0.5^(1-alppha))-log(1-b) + log(1-betta*b);
del=0.025;
f1=log(pssi*0.5^(1+etta)/(1-phiw*betta));
f2 = log((0.5/(0.6*15^(alppha)*0.5^(1-alppha)))/(1-phiw*betta));
Pm=log(epsp/(epsp-1));
w=log((epsp/(epsp-1))*(1-alppha)*15^alppha*0.5^(-alppha));
wsharp=w;
Rk=((epsp-1)/epsp)*alppha*15^(alppha-1)*0.5^(1-alppha)+1-delss-b1/(1+zetta);
x1=log(lam*Pm*Y/(1-phip*betta));
x2=log(lam*Y/(1-phip*betta));
I=log(del*15);
phi=log(4);
j=log((Rk-R)*phi+R);
m=j;
nu=log((1-thetta)*(Rk-R)/(1-betta*thetta*m));
H=log((1-thetta)*R/(1-betta*thetta*m));
E=log(15*phi^(-1));
Ee=log(thetta*j*E);
En=log(omegabig*15);


%set the parameter b1 and delss
b1=(epsp-1)/epsp*alppha*15^(alppha-1)*0.5^(1-alppha);% epsp and alpha are parameters. The ss value of N and K are already fixed to some level.
delss = 0.025 - (b1/(1+zetta));

dY = 0;
dC = 0;
dI = 0;
dN = 0;
% end of model


for iter = 1:length(M_.params) %update parameters set in the file
  eval([ 'M_.params(' num2str(iter) ') = ' M_.param_names(iter,:) ';' ])
end

NumberOfEndogenousVariables = M_.orig_endo_nbr; %auxiliary variables are set automatically
for ii = 1:NumberOfEndogenousVariables
  varname = deblank(M_.endo_names(ii,:));
  eval(['ys(' int2str(ii) ') = ' varname ';']);
end




