
function z=usmodel_p_fff(y)
z=zeros(47,1);
global ex_ ex_det_ it_ recur_

global calfa cbeta cbetabar ccs ccy cfc cg cgamma cgy chabb 
global chia chib chig chim chip chiq chiw cik cikbar cindp 
global cindw cinvs ciy cky clandap clandaw clk cmap cmaw constebeta 
global constelab constepinf conster cpie cprobp cprobw cr crdpi crdy crhoa 
global crhoas crhob crhog crhols crhoms crhopinf crhoqs crhow crk crkky 
global crpi crr cry csadjcost csigl csigma ctou ctrend curvp curvw 
global cw cwhlc cwly czcap 
usmodel_stst;
z(1) = 0*(1-calfa)*y(1)+1*y(1) -(calfa*y(35)+(1-calfa)*(y(43)));
z(2) = y(47) -((1/(czcap/(1-czcap)))*y(35));
z(3) = y(35) -((y(43))+y(22)-y(18));
z(4) = y(18) -(y(20)+y(47));
z(5) = y(16) -((1/(1+cbetabar*cgamma))*(y(16)+cbetabar*cgamma*y(16)+(1/( ...
cgamma^2*csadjcost))*y(30))+y(31));
z(6) = y(30) -(-y(37)-0*y(3)+(1/((1-chabb/cgamma)/(csigma*(1+chabb/cgamma)) ...
))*y(3)+(crk/(crk+(1-ctou)))*y(35)+((1-ctou)/(crk+(1-ctou)))*y(30));
z(7) = y(6) -((chabb/cgamma)/(1+chabb/cgamma)*y(6)+(1/(1+chabb/cgamma))* ...
y(6)+((csigma-1)*cwhlc/(csigma*(1+chabb/cgamma)))*(y(22)-y(22))-(1-chabb/ ...
cgamma)/(csigma*(1+chabb/cgamma))*(y(37)+0*y(3))+y(3));
z(8) = y(45) -(ccy*y(6)+ciy*y(16)+y(13)+crkky*y(47));
z(9) = y(45) -(cfc*(calfa*y(18)+(1-calfa)*y(22)+y(1)));
z(10) = y(43) -(csigl*y(22)+(1/(1-chabb/cgamma))*y(6)-(chabb/cgamma)/(1- ...
chabb/cgamma)*y(6));
z(11) = y(20) -((1-cikbar)*y(20)+(cikbar)*y(16)+(cikbar)*(cgamma^2* ...
csadjcost)*y(31));
z(12) = y(24) -(calfa*y(34)+(1-calfa)*(y(42))-1*y(1)-0*(1-calfa)*y(1));
z(13) = y(46) -((1/(czcap/(1-czcap)))*y(34));
z(14) = y(34) -(y(42)+y(21)-y(17));
z(15) = y(17) -(y(19)+y(46));
z(16) = y(15) -((1/(1+cbetabar*cgamma))*(y(15)+cbetabar*cgamma*y(15)+(1/( ...
cgamma^2*csadjcost))*y(29))+y(31));
z(17) = y(29) -(-y(33)+y(27)-0*y(3)+(1/((1-chabb/cgamma)/(csigma*(1+chabb/ ...
cgamma))))*y(3)+(crk/(crk+(1-ctou)))*y(34)+((1-ctou)/(crk+(1-ctou)))*y(29));
z(18) = y(5) -((chabb/cgamma)/(1+chabb/cgamma)*y(5)+(1/(1+chabb/cgamma))* ...
y(5)+((csigma-1)*cwhlc/(csigma*(1+chabb/cgamma)))*(y(21)-y(21))-(1-chabb/ ...
cgamma)/(csigma*(1+chabb/cgamma))*(y(33)-y(27)+0*y(3))+y(3));
z(19) = y(44) -(ccy*y(5)+ciy*y(15)+y(13)+1*crkky*y(46));
z(20) = y(44) -(cfc*(calfa*y(17)+(1-calfa)*y(21)+y(1)));
z(21) = y(27) -((1/(1+cbetabar*cgamma*cindp))*(cbetabar*cgamma*y(27)+cindp* ...
y(27)+((1-cprobp)*(1-cbetabar*cgamma*cprobp)/cprobp)/((cfc-1)*curvp+1)*( ...
y(24)))+y(38));
z(22) = y(42) -((1/(1+cbetabar*cgamma))*y(42)+(cbetabar*cgamma/(1+cbetabar* ...
cgamma))*y(42)+(cindw/(1+cbetabar*cgamma))*y(27)-(1+cbetabar*cgamma*cindw)/( ...
1+cbetabar*cgamma)*y(27)+(cbetabar*cgamma)/(1+cbetabar*cgamma)*y(27)+(1- ...
cprobw)*(1-cbetabar*cgamma*cprobw)/((1+cbetabar*cgamma)*cprobw)*(1/((clandaw ...
-1)*curvw+1))*(csigl*y(21)+(1/(1-chabb/cgamma))*y(5)-((chabb/cgamma)/(1- ...
chabb/cgamma))*y(5)-y(42))+1*y(40));
z(23) = y(33) -(crpi*(1-crr)*y(27)+cry*(1-crr)*(y(44)-y(45))+crdy*(y(44)- ...
y(45)-y(44)+y(45))+crr*y(33)+y(25));
z(24) = y(19) -((1-cikbar)*y(19)+cikbar*y(15)+cikbar*cgamma^2*csadjcost* ...
y(31));
z(25) = y(1) -(chia*y(2));
z(26) = y(3) -(chib*y(4));
z(27) = y(13) -(chig*y(14));
z(28) = y(25) -(chim*y(26));
z(29) = y(31) -(chiq*y(32));
z(30) = y(38) -(chip*y(39));
z(31) = y(40) -(chiw*y(41));
z(32) = y(2) -(crhoa*y(2)+ex_(it_-1,1));
z(33) = y(4) -(crhob*y(4)+ex_(it_-1,2));
z(34) = y(14) -(crhog*y(14)+ex_(it_-1,3)+cgy*ex_(it_-1,1));
z(35) = y(26) -(crhoms*y(26)+ex_(it_-1,4));
z(36) = y(32) -(crhoqs*y(32)+ex_(it_-1,6));
z(37) = y(39) -(crhopinf*y(39)+y(11)-cmap*y(11));
z(38) = y(41) -(crhow*y(41)+y(12)-cmaw*y(12));
z(39) = y(11) -(ex_(it_-1,5));
z(40) = y(12) -(ex_(it_-1,7));
z(41) = y(10) -(y(44)-y(44)+ctrend);
z(42) = y(7) -(y(5)-y(5)+ctrend);
z(43) = y(8) -(y(15)-y(15)+ctrend);
z(44) = y(9) -(y(42)-y(42)+ctrend);
z(45) = y(28) -(1*(y(27))+constepinf);
z(46) = y(36) -(1*(y(33))+conster);
z(47) = y(23) -(y(21)+constelab);
if ~isreal(z)
  z = real(z)+imag(z).^2;
end
