%  clex101b.m
%  This program creates the matrices for a four period to maturity
%  "cattle model"
x0=[0 10 10 10 10 10 10 0 0 0 0 1]';
										
beta=.97;
alpha=.3;   % number of young cattle for each mature cow
del1=.94;   % depreciation rate for young cows
del2=.94;
del3=.95;
del4=.95;
del5=.99;
del6=.98;   % depreciation rate of capital in "Hall" part of model
deltak=[0 0 0 alpha 0 0;del1 0 0 0 0 0;0 del2 0 0 0 0;...
	0 0 del3 del4 0 0;0 0 0 0 del5 0;0 0 0 0 0 del6];
thetak=[0 0 0;0 0 0;0 0 0;-1 0 0;1 -1 0;0 0 1];
phic=[0 0;0 0;0 0;0 0;0 0;0 0;0 0;1 0;0 1];
phig=zeros(9,7);
for i=1:7
phig(i,i)=1;
end
gam1=.5;
gam2=.5;
gam3=.5;
gam4=.5;
gam5=2;     % labor costs of slaughtering
gamh=1;  % dependence of cost of converting meat on amount converted to c
										
gam6=-2; % dependence of meat conversion costs on amount of stored meat.
	 % set gam6 < 0
gam9=.08;   % productivity of capital in Hall part of technology
%
%  gam9, del6, and beta are involved in the Manuelli-Jones 'growth cond'
%  that determines random-walkness in the Hall model.
%  set beta*(gam9+del6)=1 to get random walk in Hall component of model.
%
%    gam9=beta^(-1)-del6; % this line imposes the grth condn
phi3=2;  % costs of adjustment in Hall part of technology
phii=zeros(9,3);
phii(5,1)=-gam5;
phii(7,3)=-phi3;    % Hall like adjustment cost
phii(8,2)=-1;
phii(9,3)=1;
gamma=zeros(9,6);
gamma(1,1)=gam1;
gamma(2,2)=gam2;
gamma(3,3)=gam3;
gamma(4,4)=gam4;
gamma(6,5)=gam6;
gamma(9,6)=gam9;
phii(6,2)=-gamh;
deltah=0;
thetah=[0 0];
pih=[1 0; 0 1];    % goods are specified to be substitutes
lambda=[0 0]';
a22=zeros(5,5);
a22(1,1)=.9;
a22(2,2)=.8;
a22(3,3)=.4;
a22(4,4)=.5;
a22(5,5)=1;
c2=zeros(5,4);
for i=1:4
c2(i,i)=1;
end
ub=[1 0 0 0 50;0 1 0 0 80];  % b is first two components of z
ud=zeros(9,5);
ud(1,3)=1;
ud(9,4)=1;    % d1 is third component of z;d9 is the fourth comp of z
