
function z=usmodel_pshk_ff(y)
z=zeros(41,1);
global ex_ ex_det_ it_ recur_

global calfa cbeta cbetabar ccs ccy cfc cg cgamma cgy chabb 
global cik cikbar cindp cindw cinvs ciy cky clandap clandaw clk 
global cmap cmaw constebeta constelab constepinf conster cpie cprobp cprobw ...
 cr 
global crdpi crdy crhoa crhoas crhob crhog crhols crhoms crhopinf crhoqs 
global crhow crk crkky crpi crr cry csadjcost csigl csigma ctou 
global ctrend curvp curvw cw cwhlc cwly czcap 
usmodel_stst;
z(1) = 0 -(calfa*y(50)+(1-calfa)*(y(56))-0*(1-calfa)*y(20)-1*y(20)+1/((1/(1 ...
+cbetabar*cgamma*cindp))*((1-cprobp)*(1-cbetabar*cgamma*cprobp)/cprobp)/(( ...
cfc-1)*curvp+1))*y(53));
z(2) = y(60) -((1/(czcap/(1-czcap)))*y(50));
z(3) = y(50) -((y(56))+y(38)-y(34));
z(4) = y(34) -(y(10)+y(60));
z(5) = y(32) -((1/(1+cbetabar*cgamma))*(y(8)+cbetabar*cgamma*y(64)+(1/( ...
cgamma^2*csadjcost))*y(46))+y(47));
z(6) = y(46) -(-y(52)-0*y(21)+(1/((1-chabb/cgamma)/(csigma*(1+chabb/cgamma) ...
)))*y(21)+(crk/(crk+(1-ctou)))*y(71)+((1-ctou)/(crk+(1-ctou)))*y(69));
z(7) = y(23) -((chabb/cgamma)/(1+chabb/cgamma)*y(4)+(1/(1+chabb/cgamma))* ...
y(62)+((csigma-1)*cwhlc/(csigma*(1+chabb/cgamma)))*(y(38)-y(66))-(1-chabb/ ...
cgamma)/(csigma*(1+chabb/cgamma))*(y(52)+0*y(21))+y(21));
z(8) = y(58) -(ccy*y(23)+ciy*y(32)+y(30)+crkky*y(60));
z(9) = y(58) -(cfc*(calfa*y(34)+(1-calfa)*y(38)+y(20)));
z(10) = y(56) -(csigl*y(38)+(1/(1-chabb/cgamma))*y(23)-(chabb/cgamma)/(1- ...
chabb/cgamma)*y(4)+1/((1-cprobw)*(1-cbetabar*cgamma*cprobw)/((1+cbetabar* ...
cgamma)*cprobw)*(1/((clandaw-1)*curvw+1)))*y(40));
z(11) = y(36) -((1-cikbar)*y(10)+(cikbar)*y(32)+(cikbar)*(cgamma^2* ...
csadjcost)*y(47));
z(12) = y(41) -(calfa*y(49)+(1-calfa)*(y(55))-1*y(20)-0*(1-calfa)*y(20));
z(13) = y(59) -((1/(czcap/(1-czcap)))*y(49));
z(14) = y(49) -(y(55)+y(37)-y(33));
z(15) = y(33) -(y(9)+y(59));
z(16) = y(31) -((1/(1+cbetabar*cgamma))*(y(7)+cbetabar*cgamma*y(63)+(1/( ...
cgamma^2*csadjcost))*y(45))+y(47));
z(17) = y(45) -(-y(48)+y(67)-0*y(21)+(1/((1-chabb/cgamma)/(csigma*(1+chabb/ ...
cgamma))))*y(21)+(crk/(crk+(1-ctou)))*y(70)+((1-ctou)/(crk+(1-ctou)))*y(68)) ...
;
z(18) = y(22) -((chabb/cgamma)/(1+chabb/cgamma)*y(3)+(1/(1+chabb/cgamma))* ...
y(61)+((csigma-1)*cwhlc/(csigma*(1+chabb/cgamma)))*(y(37)-y(65))-(1-chabb/ ...
cgamma)/(csigma*(1+chabb/cgamma))*(y(48)-y(67)+0*y(21))+y(21));
z(19) = y(57) -(ccy*y(22)+ciy*y(31)+y(30)+1*crkky*y(59));
z(20) = y(57) -(cfc*(calfa*y(33)+(1-calfa)*y(37)+y(20)));
z(21) = y(43) -((1/(1+cbetabar*cgamma*cindp))*(cbetabar*cgamma*y(67)+cindp* ...
y(13)+((1-cprobp)*(1-cbetabar*cgamma*cprobp)/cprobp)/((cfc-1)*curvp+1)*( ...
y(41)))+y(53));
z(22) = y(55) -((1/(1+cbetabar*cgamma))*y(17)+(cbetabar*cgamma/(1+cbetabar* ...
cgamma))*y(72)+(cindw/(1+cbetabar*cgamma))*y(13)-(1+cbetabar*cgamma*cindw)/( ...
1+cbetabar*cgamma)*y(43)+(cbetabar*cgamma)/(1+cbetabar*cgamma)*y(67)+(1- ...
cprobw)*(1-cbetabar*cgamma*cprobw)/((1+cbetabar*cgamma)*cprobw)*(1/((clandaw ...
-1)*curvw+1))*(csigl*y(37)+(1/(1-chabb/cgamma))*y(22)-((chabb/cgamma)/(1- ...
chabb/cgamma))*y(3)-y(55))+1*y(54));
z(23) = y(48) -(crpi*(1-crr)*y(43)+cry*(1-crr)*(y(57)-y(58))+crdy*(y(57)- ...
y(58)-y(18)+y(19))+crr*y(15)+y(42));
z(24) = y(20) -(crhoa*y(1)+ex_(it_-1,1));
z(25) = y(21) -(crhob*y(2)+ex_(it_-1,2));
z(26) = y(30) -(crhog*(y(6))+ex_(it_-1,3)+cgy*ex_(it_-1,1));
z(27) = y(47) -(crhoqs*y(14)+ex_(it_-1,6));
z(28) = y(42) -(crhoms*y(12)+ex_(it_-1,4));
z(29) = y(53) -(crhopinf*y(16)+y(28)-cmap*y(5));
z(30) = y(28) -(ex_(it_-1,5));
z(31) = y(40) -(crhow*y(11)+ex_(it_-1,7));
z(32) = y(54) -(y(40)+ex_(it_-1,8));
z(33) = y(29) -(0);
z(34) = y(35) -((1-cikbar)*y(9)+cikbar*y(31)+cikbar*cgamma^2*csadjcost* ...
y(47));
z(35) = y(27) -(y(57)-y(18)+ctrend);
z(36) = y(24) -(y(22)-y(3)+ctrend);
z(37) = y(25) -(y(31)-y(7)+ctrend);
z(38) = y(26) -(y(55)-y(17)+ctrend);
z(39) = y(44) -(1*(y(43))+constepinf);
z(40) = y(51) -(1*(y(48))+conster);
z(41) = y(39) -(y(37)+constelab);
