function [ys,params,check] = RBCSIMS_steadystate(ys,exo,M_,options_)
% function [ys,params,check] = RBCSIMS_steadystate(ys,exo,M_,options_)
% computes the steady state for the NK_baseline.mod and uses a numerical
% solver to do so
% Inputs: 
%   - ys        [vector] vector of initial values for the steady state of
%                   the endogenous variables
%   - exo       [vector] vector of values for the exogenous variables
%   - M_        [structure] Dynare model structure
%   - options   [structure] Dynare options structure
%
% Output: 
%   - ys        [vector] vector of steady state values for the the endogenous variables
%   - params    [vector] vector of parameter values
%   - check     [scalar] set to 0 if steady state computation worked and to
%                    1 of not (allows to impose restrictions on parameters)

alpha=0;
beta=0;

% read out parameters to access them with their name
NumberOfParameters = M_.param_nbr;
for ii = 1:NumberOfParameters
  paramname = M_.param_names{ii};
  eval([ paramname ' = M_.params(' int2str(ii) ');']);
end
% initialize indicator
check = 0;


%% Enter model equations here

q = 1;
%mu_ss = 0;
mu_ss = ((1-alpha)/psiss)*((1/beta)- (1-delta))-alpha;
kn_ss = (alpha/(1/beta -(1-delta)-mu_ss*psiss))^(1/(1-alpha));
n = ((1/theta)*(1/(1+mu_ss))*((1-alpha)*(kn_ss)^(alpha))/((kn_ss)^(alpha) - delta*(kn_ss)))^(1/(1+chi));
k = n*(alpha/(1/beta - (1-delta) - mu_ss*psiss))^(1/(1-alpha));
psi = psiss;
A = 0;
r = (1/beta) - 1;
y = k^alpha*n^(1-alpha);
i = delta*k;
c = y - i;
lambda = 1/c;
w = psiss*kn_ss;
mu = mu_ss;
%w = c*theta*n^chi;


c=log(c);
y=log(y);
k=log(k);
n=log(n);
i=log(i);

%% end own model equations

params=NaN(NumberOfParameters,1);
for iter = 1:length(M_.params) %update parameters set in the file
  eval([ 'params(' num2str(iter) ') = ' M_.param_names{iter} ';' ])
end

NumberOfEndogenousVariables = M_.orig_endo_nbr; %auxiliary variables are set automatically
for ii = 1:NumberOfEndogenousVariables
  varname = M_.endo_names{ii};
  eval(['ys(' int2str(ii) ') = ' varname ';']);
end