function u = plantmn(z);
%PLANTMN  is a function used to compute the optimal lotteries for
%         the planner in ``The firm and the plant in general equilibrium'' 
%         by Hornstein and Prescott (Section 3).  Here, I assume that
%         all of the mass is on two points.  The problem is:
%
%             max        u = x*U(c1,h)+(1-x)*U(c0,0)
%           c0,c1,h,x
%                      s.t. x*c1+(1-x)*c0 = h*kbar^alpha*x^(1-alpha)
%
%         u = plantmn(z) takes z=(c0,h,x) and computes the utility.

%         Ellen McGrattan, 04-07-93



% Inputs
% ------
%
% parameters:

alpha = .3;
gamma = .3;
sigma = .8;
kbar  = 2;



%----------------------------------------------------------------------------

% Problem
% -------

%   max          x*U(c1,h)+(1-x)*U(c0,0)
% c0,c1,h,x
%               s.t. x*c1+(1-x)*c0 = h*k^alpha*x  = h*kbar^alpha*x^(1-alpha)
%
% or
%
%   max          x*U(c1(c0,h,x),h)+(1-x)*U(c0,0)
%  c0,h,x

% Utility
% -------
%
%  Let
%
%  U(c,h)     = ((c^gamma*(1-h)^(1-gamma))^(1-sigma)-1)/(1-sigma)
%  c1(c,h,x)  = h*(kbar/x)^alpha-(1-x)*c/x

c = z(1);
h = z(2);
x = z(3);
c1= h*(kbar/x)^alpha-(1-x)*c/x;
u = -x*((c1^gamma*(1-h)^(1-gamma))^(1-sigma)-1)/(1-sigma) ...
   -(1-x)*(c^(gamma*(1-sigma))-1)/(1-sigma);


