% computes the steady state of RBC with growth analyticaly
% Rob Luginbuhl March 2009
function [ys,check] = RBC_ID_steadystate(ys,exe)
  global M_
  
    % get location of parameter in global
    p_name = 'beta';
    i = strmatch(p_name, M_.param_names, 'exact');
  beta    = M_.params(i); 
    % get location of parameter in global
    p_name = 'psi';
    i = strmatch(p_name, M_.param_names, 'exact');
  psi     = M_.params(i); 
    % get location of parameter in global
    p_name = 'delta';
    i = strmatch(p_name, M_.param_names, 'exact');
  delta   = M_.params(i); 
    % get location of parameter in global
    p_name = 'alpha';
    i = strmatch(p_name, M_.param_names, 'exact');
  alpha   = M_.params(i); 
    % get location of parameter in global
    p_name = 'gamma';
    i = strmatch(p_name, M_.param_names, 'exact');
  gamma   = M_.params(i);
    % get location of parameter in global
    p_name = 'epsilon';
    i = strmatch(p_name, M_.param_names, 'exact');
  epsilon = M_.params(i); 

  check = 0;
  
  dA  = exp(gamma);
  % help variable
  eps = (epsilon - 1)/epsilon;
  % interest rate
  r   = delta - 1 + dA/beta;
  % wage
  w   = eps^(1/(1 - alpha)) * (1 - alpha) * (alpha/r)^(alpha/(1 - alpha));
  % more help variables
      ome = eps * alpha/r;
      % k = omega * y
      omega = ome * dA;
      % c = S * y
      S     = 1 - ome * (dA - 1 + delta);
      % l = theta * y
      theta = (ome)^(alpha/(alpha-1));
  %
  % income
  y   = w/(psi*S + w*theta);
  % consumption
  c   = S * y;
  % capital
  k   = omega * y;
  % labor
  l   = theta * y;
  % investment
  i = k * (1 - (1 - delta)/dA);
  % e = exp(disturbance)
  e = 1.0;
  % observed variable (must = 1 for dynare)
  Y_obs = 1;
  
  ys =[
        y    
        c    
        k    
        i    
        l    
        w    
        r    
        dA   
        Y_obs
	e
      ];
