function f = drh1nkss(xx,eta,beta,delta,h,sigma,phi,psi,thetaw,thetap,upsilon,DS,LS,KS,alphal,alphak,Al)

L = xx(1);

eta = 1.2;
beta = 0.99;
delta = 0.025;
h = 0.65;
sigma = 2;
phi = 1;
psi=1;
thetaw =0.75;
thetap=0.75;
upsilon =1;
alphal=0.6;
alphak=1-alphal;
DS =0.1;
LS =(1-DS)*alphal;
KS =1-LS-DS;

Al=1;
%L=1;

mp=1/(1-DS);
Rk= (1/beta - (1-delta))/upsilon;
Ak=Rk*KS^(1/(eta-1))*(mp/alphak)^(eta/(eta-1));
Y=(alphal/mp/LS)^(eta/(eta-1))*Al*L;
W=LS*Y/L;
epsilonp = mp/(mp-1);
mw = 1/W/mp;
%mw=mp;
epsilonw = mw/(mw-1);
K=KS*Y/Rk;
Inv=delta*K;
X = Inv/upsilon;
C = Y - X;
D=DS*Y;
lambda = (C-h*C)^(-sigma)-beta*h*(C-h*C)^(-sigma);
H1 = psi*L^(1+phi)/(1-thetaw*beta);
H2 = lambda*L/(1-thetaw*beta);
mc= 1/mp;
X1 = lambda*mc*Y/(1-thetap*beta);
X2 = lambda*Y/(1-thetap*beta);

% equations
f1 = psi*mw*L^phi-W*lambda;
f = [f1];
