function [ys,params,check] = new4_ramsey_steadystate(ys,exo,M_,options_)
bet=NaN; %make parameter known to Matlab function, prevents crashes due to Matlab function with same name;
          %will be overwritten next
          
NumberOfParameters = M_.param_nbr;
for ii = 1:NumberOfParameters
  paramname = M_.param_names{ii};
  eval([ paramname ' = M_.params(' int2str(ii) ');']);
end

% read in instrument values
for ii = 1:size(options_.instruments,1)
  eval([options_.instruments{ii} ' = ys(strmatch(options_.instruments{ii},M_.endo_names,''exact'')) ;']);
end
% initialize indicator
check = 0;


%% Enter model equations here
r = 1 / bet; 

P=1;
P_N=1;
P_D=1;
varphi_d=1;

MS_N=1;
MS_D=1;

l = 1/3;             

pi_N = 1;

pi_D = 1;
pi=1;

MC_N = (eps_N - 1) / eps_N;
MC_D = (eps_d - 1) / eps_d;


mu_N = (1-omega)/((omega/delta)*(1-bet*(1-delta))+(1-omega));

l_N = (1-omega) * l;
l_D = l-l_N; 
y_N = l_N;
y_D = l_D;
c_N = y_N;
d = y_D/delta;
w = MC_N*y_N/l_N;

yy=c_N+y_D;

H = (c_N) ^ mu_N*d^(1 - mu_N);
lambda = mu_N*H^(1 - sig)/c_N;

chi = w * lambda / (1 * l ^ varrho);
f1_N = y_N / (1 - bet * vartheta_N);
f1_d = y_D / (1 - bet * vartheta_d);
f2_N = y_N * MC_N / (1 - bet * vartheta_N);
f2_d = y_D*MC_D / (varphi_d * (1 - bet * vartheta_d));
ptil_N = 1;
ptil_d = 1;

r_real=r/pi;

chat = log(c_N);
yhat_D = log(y_D);
yhat_N =log(y_N);
yyhat = log(yy);
lhat_N = log(l_N);
lhat_D = log(l_D);
what = log(w);
rhat = log(r);
vp_hat = log(varphi_d);
pi_N_hat = log(pi_N);
pi_D_hat = log(pi_D);
r_realhat=log(r_real);
pi_hat=log(pi);

U = -0.5*((sig-1)*((mu_N)*(c_N)+((1-mu_N)*d))^2+varrho*(mu_N/(1-omega))*yy^2+(mu_N)*y_N^2+(1-mu_N)*(delta/(1-bet*(1-delta)))*y_D^2+(eps_N/chi_N)*(mu_N)*pi_N^2+(eps_d/chi_D)*(1-mu_N)*(delta/(1-bet*(1-delta)))*pi_D^2);
%U =((H^(1-sig))/(1-sig))-((l^(1+varrho))/(1+varrho)); %


%% 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
