function F=myfct(z) % date: 10.18
% known variables
beta = 0.995;
phi_m = 0.06;
% pi = 1; % inflation rate which at SS point will be 1.
alpha = 0.7556;
phi_l = 0.60;
eta = 2;
phi = 0.50;
theta = 1.5;
theta_p = 10;
psi_bar = 0.9;
phi_tilda = (1-phi)^(phi-1)/phi^phi;
alpha_tilda = (1-alpha)^(alpha-1)/alpha^alpha;
v = (theta_p - 1)/theta_p;
R = 1/beta;
Rf = 1/beta;

% Unknown variables
M = z(1);
c = z(2);
B = z(3);
w = z(4);
L = z(5);
qm = z(6);
q = z(7);
gamma_f = z(8);
gamma_h = z(9);
Bf = z(10);
e = z(11);
gamma = z(12);
GDP = z(13);
P = z(14);
Bf_p = z(15);


F(1)=M/P- M/P * beta - phi_m*c;
F(2)=B/(B+e*Bf_p)-psi_bar;
F(3)=(1-phi)*(gamma/L)^phi-w;
F(3)=w/(phi_l*L^eta)-c;
F(4)= phi_tilda * qm^phi * w^(1-phi)-v;
F(5)= (1-phi)/phi * gamma * qm/w-L; 
F(7)= alpha_tilda*q^(1-alpha)-qm;
F(8)= (1-alpha)/alpha * gamma_h/gamma_f - q;
F(9)= q^theta - q*gamma_f + e*(Rf-1)*Bf/P;
F(10)= B-e*(Bf-Bf_p);
F(11)=c+q^theta+gamma_h-gamma^phi*L^(1-phi);
F(12)= gamma_h^alpha * gamma_f^(1-alpha)-gamma;
F(13)= c + q^theta -q*gamma_f-GDP;
F(14)= alpha*(gamma_h/gamma_f)^(alpha-1)-P;
F(15)= GDP + (R*B+e*Rf*Bf_p)/P - c - (B+e*Bf_p)/P;
