% 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,N9,N8,N5,N4,N6,N12,N11,g,N3,N2,psi,beta,mu,theta,N13,alpha,gamma,D,eta,f);
F =(((((N13*((1-mu*(x^(theta-1)))^(1/(1-theta)))*(1-mu*beta*(x^theta)))/(1-mu*beta*(x^(theta-1)))))^(1/(1-alpha)))*(N8-N9*(((g+N6*((((N13*((1-mu*(x^(theta-1)))^(1/(1-theta)))*(1-mu*beta*(x^theta)))/(1-mu*beta*(x^(theta-1)))))^(1/(1-alpha))))/(((((N13*((1-mu*(x^(theta-1)))^(1/(1-theta)))*(1-mu*beta*(x^theta)))/(1-mu*beta*(x^(theta-1)))))^(alpha/(1-alpha)))*(N5/(((1-mu)*(((N12*((1-mu*(x^(theta-1)))^(1/(1-theta)))))^-theta)/(1-mu*(x^theta)))))+N11*((((N13*((1-mu*(x^(theta-1)))^(1/(1-theta)))*(1-mu*beta*(x^theta)))/(1-mu*beta*(x^(theta-1)))))^(1/(1-alpha)))))))+N3*((N5*((((N13*((1-mu*(x^(theta-1)))^(1/(1-theta)))*(1-mu*beta*(x^theta)))/(1-mu*beta*(x^(theta-1)))))^(alpha/(1-alpha)))/(((1-mu)*(((N12*((1-mu*(x^(theta-1)))^(1/(1-theta)))))^-theta)/(1-mu*(x^theta)))))*((g+N6*((((N13*((1-mu*(x^(theta-1)))^(1/(1-theta)))*(1-mu*beta*(x^theta)))/(1-mu*beta*(x^(theta-1)))))^(1/(1-alpha))))/(((((N13*((1-mu*(x^(theta-1)))^(1/(1-theta)))*(1-mu*beta*(x^theta)))/(1-mu*beta*(x^(theta-1)))))^(alpha/(1-alpha)))*(N5/(((1-mu)*(((N12*((1-mu*(x^(theta-1)))^(1/(1-theta)))))^-theta)/(1-mu*(x^theta)))))+N11*((((N13*((1-mu*(x^(theta-1)))^(1/(1-theta)))*(1-mu*beta*(x^theta)))/(1-mu*beta*(x^(theta-1)))))^(1/(1-alpha))))))-N4*g)-(N2*(((gamma*(D*((((N13*((1-mu*(x^(theta-1)))^(1/(1-theta)))*(1-mu*beta*(x^theta)))/(1-mu*beta*(x^(theta-1)))))^(1/(1-alpha))))*x*(1-(((g+N6*((((N13*((1-mu*(x^(theta-1)))^(1/(1-theta)))*(1-mu*beta*(x^theta)))/(1-mu*beta*(x^(theta-1)))))^(1/(1-alpha))))/(((((N13*((1-mu*(x^(theta-1)))^(1/(1-theta)))*(1-mu*beta*(x^theta)))/(1-mu*beta*(x^(theta-1)))))^(alpha/(1-alpha)))*(N5/(((1-mu)*(((N12*((1-mu*(x^(theta-1)))^(1/(1-theta)))))^-theta)/(1-mu*(x^theta)))))+N11*((((N13*((1-mu*(x^(theta-1)))^(1/(1-theta)))*(1-mu*beta*(x^theta)))/(1-mu*beta*(x^(theta-1)))))^(1/(1-alpha))))))))/(eta*f*(x-beta)))^psi)*(1-(1/x)));