% computes the steady state of dog.mod (growthless deterministic growth model). 
% stephane [DOT] adjemian [AT] ens [DOT] fr

function [ys,check] = SS_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;
%%
%% END OF THE FIRST MODEL INDEPENDENT BLOCK.


%% THIS BLOCK IS MODEL SPECIFIC.
%%
%% Here the user has to define the steady state.
%%
  
P_N = (omegaa/(1-omegaa))*(C_N/C_T)^(-etaa-1);                                                                
C_T=((1+tauu)*(-(N)^(deltaa-1))/omegaa*W*(omegaa*(C_T)^(-etaa)+(1-omegaa)*(C_N)^(-etaa))^(-(1/etaa)-1))^(1/(-etaa-1));   
         
lambda = Z*R*lambda(+1)+ mu;                                                                         
N=(ppi-D-((1-tauu)*(C_T + P_N*C_N)) + (Z*R*D)-T-(P_N*T_N))/W;                                                                                                                                           
mu=0;
C=((omegaa*(C_T)^(-etaa))+(1-omegaa)*(C_N)^(-etaa))^(-(1/etaa)-1);    
GDP=Z*(K^(1-aplhaa))*(N^aplhaa);
ppi=GDP-W;
P=P_N/((omegaa*(C_T)^(-etaa))+(1-omegaa)*(C_N)^(-etaa))^(-(1/etaa)-1);
Z=1;
Z2=1;
Z3=1;  


W=P_N*Z3*aplhaa*(K^(1-aplhaa))*(N^aplhaa);          
D=-(1+tauu)*C_T+P_N*(GDP-T_N)+Z2*Y_T+D(-1)*Z*R-T;
C_N = GDP-T_N;


%%
%% END OF THE MODEL SPECIFIC BLOCK.
 

%% DO NOT CHANGE THIS PART.
%%
%% Here we define the steady state values 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 value of this variable.
end                                                           % End of the loop.
%%
%% END OF THE SECOND MODEL INDEPENDENT BLOCK.