function fval=ss_tsjhrbc(xint,params);
%param=[beta;eta;gamma;alpha1;alpha2;delta];
beta=params(1);eta=params(2);gamma=params(3);alpha1=params(4);alpha2=params(5);delta=params(6);b=params(7);

c1=xint(1);
lam1=xint(2);
d=xint(3);
lam2=xint(4);
h1=xint(5);
h2=xint(6);
k1=xint(7);
k2=xint(8);

fval=zeros(8,1);

fval(1)=lam1-b/c1;
fval(2)=(1-b)/d-(1-beta*(1-delta))*lam2;
fval(3)=eta*h1^gamma-(1-alpha1)*lam1*(k1/h1)^alpha1;
fval(4)=eta*h2^gamma-(1-alpha2)*lam2*(k2/h2)^alpha2;

fval(5)=beta*lam1*alpha1*(k1/h1)^(alpha1-1)-(1-beta*(1-delta))*lam2;

fval(6)=beta*alpha2*(k2/h2)^(alpha2-1)-(1-beta*(1-delta));
fval(7)=h1^alpha1*k1^(1-alpha1)-c1;
fval(8)=h2^alpha2*k2^(1-alpha1)-delta*(k1+k2+d);
