
function z=usmodel_ces_ff(y)
z=zeros(40,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*(1-calfa)*y(21)+1*y(21) -(calfa*y(50)+(1-calfa)*(y(56)));
z(2) = y(60) -((1/(czcap/(1-czcap)))*y(50));
z(3) = y(50) -((y(56))+y(39)-y(35));
z(4) = y(35) -(y(11)+y(60));
z(5) = y(33) -((1/(1+cbetabar*cgamma))*(y(9)+cbetabar*cgamma*y(64)+(1/( ...
cgamma^2*csadjcost))*y(46))+y(47));
z(6) = y(46) -(-y(52)-0*y(22)+(1/((1-chabb/cgamma)/(csigma*(1+chabb/cgamma) ...
)))*y(22)+(crk/(crk+(1-ctou)))*y(71)+((1-ctou)/(crk+(1-ctou)))*y(69));
z(7) = y(24) -((chabb/cgamma)/(1+chabb/cgamma)*y(4)+(1/(1+chabb/cgamma))* ...
y(62)+((csigma-1)*cwhlc/(csigma*(1+chabb/cgamma)))*(y(39)-y(66))-(1-chabb/ ...
cgamma)/(csigma*(1+chabb/cgamma))*(y(52)+0*y(22))+y(22));
z(8) = y(58) -(ccy*y(24)+ciy*y(33)+y(31)+crkky*y(60));
z(9) = y(58) -(cfc*(calfa*y(35)+(1-calfa)*y(39)+y(21)));
z(10) = y(56) -(csigl*y(39)+(1/(1-chabb/cgamma))*y(24)-(chabb/cgamma)/(1- ...
chabb/cgamma)*y(4));
z(11) = y(37) -((1-cikbar)*y(11)+(cikbar)*y(33)+(cikbar)*(cgamma^2* ...
csadjcost)*y(47));
z(12) = y(41) -(calfa*y(49)+(1-calfa)*(y(55))-1*y(21)-0*(1-calfa)*y(21));
z(13) = y(59) -((1/(czcap/(1-czcap)))*y(49));
z(14) = y(49) -(y(55)+y(38)-y(34));
z(15) = y(34) -(y(10)+y(59));
z(16) = y(32) -((1/(1+cbetabar*cgamma))*(y(8)+cbetabar*cgamma*y(63)+(1/( ...
cgamma^2*csadjcost))*y(45))+y(47));
z(17) = y(45) -(-y(48)+y(67)-0*y(22)+(1/((1-chabb/cgamma)/(csigma*(1+chabb/ ...
cgamma))))*y(22)+(crk/(crk+(1-ctou)))*y(70)+((1-ctou)/(crk+(1-ctou)))*y(68)) ...
;
z(18) = y(23) -((chabb/cgamma)/(1+chabb/cgamma)*y(3)+(1/(1+chabb/cgamma))* ...
y(61)+((csigma-1)*cwhlc/(csigma*(1+chabb/cgamma)))*(y(38)-y(65))-(1-chabb/ ...
cgamma)/(csigma*(1+chabb/cgamma))*(y(48)-y(67)+0*y(22))+y(22));
z(19) = y(57) -(ccy*y(23)+ciy*y(32)+y(31)+1*crkky*y(59));
z(20) = y(57) -(cfc*(calfa*y(34)+(1-calfa)*y(38)+y(21)));
z(21) = y(43) -((1/(1+cbetabar*cgamma*cindp))*(cbetabar*cgamma*y(67)+cindp* ...
y(13)+((1-cprobp)*(1-cbetabar*cgamma*cprobp)/cprobp)*(y(41)))+y(53));
z(22) = y(55) -((1/(1+cbetabar*cgamma))*y(18)+(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)*(csigl*y(38) ...
+(1/(1-chabb/cgamma))*y(23)-((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(19)+y(20))+crr*y(15)+y(42));
z(24) = y(21) -(crhoa*y(1)+ex_(it_-1,1));
z(25) = y(22) -(crhob*y(2)+ex_(it_-1,2));
z(26) = y(31) -(crhog*(y(7))+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(29)-cmap*y(5));
z(30) = y(29) -(ex_(it_-1,5));
z(31) = y(54) -(crhow*y(17)+y(30)-cmaw*y(6));
z(32) = y(30) -(ex_(it_-1,7));
z(33) = y(36) -((1-cikbar)*y(10)+cikbar*y(32)+cikbar*cgamma^2*csadjcost* ...
y(47));
z(34) = y(28) -(y(57)-y(19)+ctrend);
z(35) = y(25) -(y(23)-y(3)+ctrend);
z(36) = y(26) -(y(32)-y(8)+ctrend);
z(37) = y(27) -(y(55)-y(18)+ctrend);
z(38) = y(44) -(1*(y(43))+constepinf);
z(39) = y(51) -(1*(y(48))+conster);
z(40) = y(40) -(y(38)+constelab);
