%compute the steady state of nontraded.mod 
function[ys,check]=guajardo2008_steadystate(ys,exe)
global M_
 
%% DO NOT CHANGE THIS PART.
%%
%% Here we 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;
%%


%% THIS BLOCK IS MODEL SPECIFIC.
%%
%% Here the user has to define the steady state.
%%

%Compute the Steady State
AX          = 1;
AN          = 1;
PX	    = 1;
R           = RST;
QN          = (g/bet) - 1 + del;
QX          = QN;
TT          = PX;
PN          = ((1-alpx)/(1-alpn))^(1-alpn) * alpx^(alpx*(1-alpn)/(1-alpx)) * 1/alpn^alpn * ((g/bet)-1+del)^((alpn-alpx)/(1-alpx));
H           = 0.27;
HN          = ((alp*(1-ome)*(1-alpn)*(1-H)*(alpn*PN/((g/bet)-1+del))^(alpn*(1-rho)/(1-alpn)))/((1-alp)*(ome*(ome*PN/(1-ome))^rho/(1-rho)+(1-ome))))^1/rho;
HX          = H - HN;
KX          = HX * (alpx/((g/bet)-1+del))^(1/1-alpx);
KN          = HN * (alpn*PN/((g/bet)-1+del))^(1/1-alpn);
YX          = KX^alpx * HX^(1-alpx);
YN          = KN^alpn * HN^(1-alpn);
Y           = YX+YN;
CM          = (PN*ome/(1-ome))^(1/(1-rho)) * (alpn*PN/((g/bet)-1+del))^(alpn/(1-alpn)) * HN;
CN          = YN;
C           = (ome*CM^rho + (1-ome)*CN^rho)^(1/rho);
IX          = KX*(g - 1 + del);
IN          = KN*(g - 1 + del);
I           = IX+IN;
B           = (CM+IX+IN - YX)/(R-g);
TB          = ((Y-C-I)/Y)*100;
Output        = 0;
Consumption   = 0;
Investment    = 0;
Labor         = 0;
Tradebal      = 0;
Terms         = 0;
PriceN        = 0;
OutputX       = 0;
OutputN       = 0;
CapitalX      = 0;
CapitalN      = 0;
%% END OF THE MODEL SPECIFIC BLOCK.


%% DO NOT CHANGE THIS PART.
%%
%% Here we define the steady state vZNues of the endogenous variables of
%% the model.
%%
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 vZNue of this variable.
end                                                           % End of the loop.
%%
