function F= find_para( par,target )

%par=[delta, eta, alpha, psi, A,z,r_star,tau_f_star,tau_star,tau,theta,phi,sigma,Psi]
%target includes labor supply and gross foreign asset-to-GDP ratio.
%assume the steady state solution is an inner solution

delta=par(1);
eta=par(2);
alpha=par(3);
psi=par(4);
A=par(5);
z=par(6);
r_star=par(7);
tau_f_star=par(8);
tau_star=par(9);
tau=par(10);
theta=par(11);
phi=par(12);

sigma=par(13);
Psi=par(14);

%---interest rate and lagrange multipliers---
r=(1-tau_star)*r_star/(1-tau);%domestic interest rate
xi=1-delta*(1+r)/(1+(1-tau_star)*r_star);%LM of domestic constraint
xi_star=delta*(r-(1+tau_f_star)*r_star)/(1+(1-tau_star)*r_star);%LM of international constraint
mu=theta*xi+theta*phi*xi_star+delta/(1+(1-tau_star)*r_star);%LM of production constraint
%---quantities---
c=(1+(1-tau_star)*r_star)^(1/sigma)-1;%household consumption
lambda=1/c;%household marginal utility
x1=alpha/(alpha+psi*(1-alpha));%share of labor in final good production
x2=1-x1;%share of labor in intermediate good production
l=(A*z^(1-alpha)*alpha*lambda*mu*x1^(alpha-1)*x2^(psi*(1-alpha))/Psi)^(1/(eta+(1-alpha)*(1-psi)));%labor supply
l1=x1*l;%labor used in final good production
l2=x2*l;%labor used in intermediate good production
m=z*l2^psi;% intermediate good
y=A*l1^alpha*m^(1-alpha);%final good
%----prices----
w=Psi*l^eta/lambda;%wage
q=(1-alpha)*mu*y/m;%price of intermediate good
%---international positions--
b=theta*(1-psi)*y;%entrepreneurial borrowing from domestic investors
b_star=theta*psi*y;%entrepreneurial borrowing from foreign investors
c_e=y*(1-mu)-b*r-b_star*(1+tau_f_star)*r_star;%entrepreneurial consumption
B_star=(c+c_e-y)/r_star+b_star;%foreign bond holding by household
nx_y=(y-c-c_e)/y;%net export-to-GDP ratio
fa_y=B_star/y;%gross foreign asset-to-GDP ratio

F=[fa_y l]-target;
end

