
function F = findSS(X)
                
% Function to compute steady state for the model with unseparable utility.
% This is done numerically because of most of the variables are determined
% simul.
    
%X(1) = QHTOC;
%X(2) = n;
%X(3) = CTOY;
%X(4) = C1TOY;
%X(5) = QH1TOC1;
%X(6) = n1;
%X(7) = BTOY;
%X(8) = B1TOY;

paramfile_baby00

r = PIBAR / BETA;
rk = 1 / BETA - (1-DK);
xp = XP_SS;
xw = XW_SS;
xw1 = XW_SS;
lm = (1-BETA1/BETA) / (1-BETA1*RHOB/PIBAR);

KTOY = ALPHA / (xp*rk); 
B1TOQH1 = (M*(1 - RHOB)) /(1-(RHOB / PIBAR)); 
WNTOY = (1-ALPHA)*(1-SIGMA)/xp;
TTOY = (1/BETA-1)*BGTOY+GTOY;


F = [(JEI*RHOD) /((1-BETA)*(1-X(2))^((1-RHOD)*(1-VARTHETA)))-X(1);
    ((1-SIGMA)*(1-ALPHA)*(1/(xp*xw*((1-RHOD)/RHOD)*X(3))))*(xp*xw*((1-RHOD)/RHOD)*X(3)*(1/((1-SIGMA)*(1-ALPHA)+1)))-X(2);
    (1-1*X(4)-DK*KTOY-GTOY) -X(3);
    (((1-ALPHA)*SIGMA*(1/xp) - SIGMA*TTOY)/(1+(1/BETA-1)*B1TOQH1*X(5)))-X(4);
    (JEI*RHOD) /((1 - BETA1 - lm*(1-RHOD)*M)*1/(1-X(6))^((1-RHOD)*(1-VARTHETA)))-X(5);
    ((1-SIGMA)*(1-ALPHA)*(1/(xp*xw1*((1-RHOD)/RHOD)*X(4))))*(xp*xw1*((1-RHOD)/RHOD)*X(4)*(1/((1-SIGMA)*(1-ALPHA)+1)))-X(6);
    1/(1-1/BETA)*(X(3) - WNTOY - rk*KTOY + DK*KTOY - (xp-1)/xp + (1-SIGMA)*TTOY)-X(7)];
end

 