% MODELO MEDEA (July 2010)
% @by Pablo Burriel, Jesús Fernández-Villaverde and Juan Rubio
%
% THIS CODE SOLVES THE STEADY STATE VALUE OF LABOR FOR THE MEDEA MODEL IN 
% "MEDEA: a DSGE model for the Spanish economy" SERIEs, Vol. 1 (1), 2010, pp. 175-243.

function F = MEDEA_ld_ss(l,omega,gammaL_bar,zmu_bar,z_bar,zA_bar,vp_bar,pc_p_bar,pi_p_bar,bigpi,piwstar_bar,...
                         wstar_bar,delta,alpha,phi,epsilonc,epsiloni,h,beta,thetaw,eta,vatheta,chiw,psi,taow,...
                         taoc,g_bar,psic,psii)

k_bar  = omega*l;
i_bar      = ((gammaL_bar*zmu_bar*z_bar-1+delta)/(zmu_bar*z_bar))*k_bar;
yd_bar = (zA_bar/z_bar*k_bar^alpha*l^(1-alpha)-phi)/vp_bar;
c_bar  = 1/psic*(pc_p_bar)^(-epsilonc)*(yd_bar-psii*pi_p_bar^epsiloni*i_bar-g_bar);
lambda_bar = ((z_bar-h*beta*gammaL_bar)/(z_bar-h))*(c_bar*(1+taoc)*pc_p_bar)^(-1);

F = (1-beta*thetaw*z_bar^(eta*(1+vatheta))*bigpi^(eta*(1-chiw)*(1+vatheta))*gammaL_bar)/(1-beta*thetaw*z_bar^(eta-1)*bigpi^(-(1-chiw)*(1-eta))*gammaL_bar)...
    -(psi*piwstar_bar^(-eta*vatheta)*l^vatheta)/((eta-1)/eta*(1-taow)*wstar_bar*lambda_bar);