function [ys,params,check] = trial1_steadystate(ys,exo,M_,options_);

global M_ 


NumberOfParameters = M_.param_nbr;
for ii = 1:NumberOfParameters
  paramname = M_.param_names{ii};
  eval([ paramname ' = M_.params(' int2str(ii) ');']);
end
% initialize indicator
check = 0;

x0 = [0.1,0.1,0.1,0.1,0.1,0.1,0.1,1,0.1,0.1,0,0,0,0];
x = fsolve(@(x)funn(x,betta, pssi, nu, siggma,phi,epsi,theta),x0)

NumberOFendog = M_.endo_nbr;

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


for ii = 1:NumberOFendog
    endname = M_.endo_names{ii};
    eval([ endname ' = ' num2str(x(ii)) ';']);  
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



end 



function F = funn(x,betta, pssi, nu, sigma,phi,eps,theta)



F(1) = exp(x(1))^(-sigma) -  betta* exp(x(1))^(-1)* (1+x(2)); 
F(2) = pssi*exp(x(3))^(nu) - exp(x(1))^(-sigma)*exp(x(4));
F(3) = exp(x(5)) - theta*(1+x(2))/x(2) *exp(x(1))^(sigma);
F(4) = exp(x(6)) - exp(x(4)) / exp(0);
F(5) = exp(x(1))- exp(x(7));
F(6) = exp(x(7)) - exp(0)*exp(x(3))/x(8);
F(7) = x(8)- 1;
F(8) = 1 - eps/(eps-1) * exp(x(9))/exp(x(10));
F(9) = exp(x(9)) - exp(x(1))^(-1) *exp(x(6)) *exp(x(7)) + phi*betta*exp(x(9)); 
F(10) = exp(x(10)) - exp(x(1))^(-1)  *exp(x(7)) + phi*betta*exp(x(10));
F(11) = exp(x(11)) - 1;
F(12) = x(12) - 0;
F(13) = x(13)-x(12);
F(14) = x(14) - 0; 

end