% Dekle-Jeong-Kiyotaki Small Open Economy Steady State Calculation for new Shrunk Model (taking real exchange rate as exogenous and dropping foreign bond equations)
% Function J(N) solving for equilibrium N
% Feburary 22, 2012
% coded by Karrar Hussain

function F = paramJN(x,g,theta,z_s,A,B,A2,A5,A9,A10,A11,B1,B3,B4,B5,beta,B6,tau_ys,tau_cs,k);

F =(1-((g+(tau_ys*(A5*x*(x-1))/A2)+((g+(theta/2)*(x-1)^2)/(B1+(A/((A/(B+1-(beta/x)))^.5))+B*((A/(B+1-(beta/x)))^.5)))*(tau_cs+k*((A/(B+1-(beta/x)))^.5)))/((z_s/(B1+(A/((A/(B+1-(beta/x)))^.5))+B*((A/(B+1-(beta/x)))^.5)))*(tau_cs+k*((A/(B+1-(beta/x)))^.5))+(z_s*tau_ys/A2))))*((1/((g+(tau_ys*(A5*x*(x-1))/A2)+((g+(theta/2)*(x-1)^2)/(B1+(A/((A/(B+1-(beta/x)))^.5))+B*((A/(B+1-(beta/x)))^.5)))*(tau_cs+k*((A/(B+1-(beta/x)))^.5)))/((z_s/(B1+(A/((A/(B+1-(beta/x)))^.5))+B*((A/(B+1-(beta/x)))^.5)))*(tau_cs+k*((A/(B+1-(beta/x)))^.5))+(z_s*tau_ys/A2))))*((z_s*((g+(tau_ys*(A5*x*(x-1))/A2)+((g+(theta/2)*(x-1)^2)/(B1+(A/((A/(B+1-(beta/x)))^.5))+B*((A/(B+1-(beta/x)))^.5)))*(tau_cs+k*((A/(B+1-(beta/x)))^.5)))/((z_s/(B1+(A/((A/(B+1-(beta/x)))^.5))+B*((A/(B+1-(beta/x)))^.5)))*(tau_cs+k*((A/(B+1-(beta/x)))^.5))+(z_s*tau_ys/A2)))-(A5*x*(x-1)))/A2))-(A9*(B1+2*A/((A/(B+1-(beta/x)))^.5)))*((z_s/(B1+(A/((A/(B+1-(beta/x)))^.5))+B*((A/(B+1-(beta/x)))^.5)))*((g+(tau_ys*(A5*x*(x-1))/A2)+((g+(theta/2)*(x-1)^2)/(B1+(A/((A/(B+1-(beta/x)))^.5))+B*((A/(B+1-(beta/x)))^.5)))*(tau_cs+k*((A/(B+1-(beta/x)))^.5)))/((z_s/(B1+(A/((A/(B+1-(beta/x)))^.5))+B*((A/(B+1-(beta/x)))^.5)))*(tau_cs+k*((A/(B+1-(beta/x)))^.5))+(z_s*tau_ys/A2)))-((g+(theta/2)*(x-1)^2)/(B1+(A/((A/(B+1-(beta/x)))^.5))+B*((A/(B+1-(beta/x)))^.5))));