%compute the steady state of RBC Model 
function[ys,check]=Deter1_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.
%%



  
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Y=1;
C=Y;
uc=C^(-gama);
Lambda=pbeta%*uc/uc; 
R=1/Lambda; 
D=@(N)(phi-1).*N;
N1=@(N) Y+(1-R).*D(N)-(sigmaa./(1-sigmaa)).*(N-delta);
N=fsolve(@(N) N1(N),[0,10]);
N=N(1);
%N=(Y - Y*sigmaa + delta*sigmaa)/(R*phi - phi - R + R*sigmaa + phi*sigmaa - R*phi*sigmaa + 1)
Q=phi*N;
D=Q-N;
Rk=(Q+Y)/Q;

mun=@(Omega) Lambda*Omega*R;
RkR=(Rk-R);
mud=@(Omega) Lambda*Omega*(RkR); 
M1=@(Omega) Omega-(sigmaa+(1-sigmaa)*(mun(Omega)+(phi-1)*(mud(Omega))));
Omega=fsolve(@(Omega) M1(Omega),[0,10]);
Omega=Omega(1)
mun=Lambda*Omega*R;
mud= Lambda*Omega*(RkR);
Nn=delta; 
%********************

%  ***********************
 



%% 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.
%%