
function [ys,check] = dh_steadystate(ys,exe)
global M_

%% /!\ DO NOT CHANGE THIS PART /!\
%%
%% Here I load the values of the deep parameters in a loop.
%%
NumberOfParameters = M_.param_nbr;                            % Number of deep parameters.

for i = 1:NumberOfParameters                                  % Loop...
  
  paramname = deblank(M_.param_names(i,:));                   %    Get the name of parameter i. 

  eval([ paramname ' = M_.params(' int2str(i) ');']);         %    Get the value of parameter i.

end                                                           % End of the loop.  

check = 0;
%%
%% END OF THE FIRST MODEL INDEPENDENT BLOCK.
%%

%% THIS BLOCK IS MODEL SPECIFIC.
%%


  BETA = get_param_by_name('BETA');
  K = get_param_by_name('K');
  PSI = get_param_by_name('PSI');
  ETA = get_param_by_name('ETA');
  THETA_D = get_param_by_name('THETA_D');
  THETA_A = get_param_by_name('THETA_A');
  ZETAW = get_param_by_name('ZETAW');
  ZETAP = get_param_by_name('ZETAP');
  ALPHA_R = get_param_by_name('ALPHA_R');
  ALPHA_PI = get_param_by_name('ALPHA_PI');
  ALPHA_Y = get_param_by_name('ALPHA_Y');
  RHO_Z = get_param_by_name('RHO_Z');
  RHO_A = get_param_by_name('RHO_A');
  
 
 
  PI = 1;
  PIW = 1;
  BETA = 0.99;
  Z = 1;
  A = 1;
  R = 1 / BETA;
  NI = 1 / ( ETA * ( 1 - THETA_D ));
  MC = 1 - ( ( 1 - (BETA * THETA_D) ) * NI );
  LAMBDAH = PSI / (PSI - 1);
  
  
  
  


Options = optimset('MaxFunEvals',10000,'MaXIter',10000,'TolFun',1e-11,'TolX',1e-11);



F = @(xx)[ xx(1) - (1 / (1 - THETA_A) * xx(2));
    
        xx(2) - ( 1 - THETA_D ) * xx(3);
    
        xx(3) - ETA * NI * xx(2);
    
        xx(4)^K - (( xx(5) * (1 - PSI) ) / ( PSI * (1 - THETA_A) * xx(2) ));
        
        xx(5) - MC;
        
        xx(6) - xx(5);];
        
        
    
[xx] = fsolve(F,[1.0,0.8,0.5,1.0,1.0,1.0],Options);

  LAMBDA = xx(1);

  X = xx(2);

  C= xx(3);

  H = xx(4);

  W = xx(5);
  
  Y = xx(6);




x = log(X);
c = log(C);
lambda = log(LAMBDA);
h = log(H);
r = log(R);
ni = log(NI);
y = log(Y);
mc = log(MC);
w = log(W);
z = log(Z);
a = log(A);
lambdah = log(LAMBDAH);
piw = log(PIW);
pi = PI;

set_param_value('r_ss',r);
set_param_value('y_ss',y);



%%
%% END OF THE MODEL SPECIFIC BLOCK.
%%

%% DO NOT CHANGE THIS PART.
%%
%% Here I put the steady state levels in the vector ys 
%%
NumberOfEndogenousVariables = M_.endo_nbr;                    % Number of endogenous variables.
ys = zeros(NumberOfEndogenousVariables,1);                    % Initialization of ys (steady state).
for i = 1:NumberOfEndogenousVariables                         % Loop...
  varname = deblank(M_.endo_names(i,:));                      %    Get the name of endogenous variable i.                     
  eval(['ys(' int2str(i) ') = ' varname ';']);                %    Get the steady state value of this variable.
end                                                           % End of the loop.

%%
%% Finally I update parameters A and PSI in the global workspace  
%%
% id1 = strmatch('B',M_.param_names,'exact');                    % Get the index of B in M_.params
% M_.params(id1) = B;

%%
%% END OF THE SECOND MODEL INDEPENDENT BLOCK.
%%


