This workbook solves the standard consumer theory problem with Excel's Solver.
max U = XaYb
s.t. M = PxX + PyY
Via calculus, you set up the Lagrangean and solve for X* and Y* as functions of a, b, Px, Py, and M.
X* as a function of Px, ceteris paribus , is the individual demand curve for X.
From the ConsumerTheoryProblem sheet, use the CS Wiz add-in to do a comparative statics analysis that derives the demand curve.
The results of such an analysis are displayed in the DemandCurve sheet.
s that derives the demand curve.
Objective function Execute Tools: Solver to get the initial solution.
max U 0 U=X Y
Run the Comparative Statics Wizard to get a demand curve.
The shock variable is Px (cell B11); vary it by 0.1 with 5 shocks.
X 0 units of X
Y 0 units of Y
Px 2 $/unit
Py 6 $/unit
M 144 $
Budget 144 M = PxX + PyY
Excel can handle an inequality constraint, but let's keep it simple.
et a demand curve.
by 0.1 with 5 shocks.
Comparative Statics Analysis
The following exogenous variables comprised the INITIAL problem:
s Variable Value
Exogenou Optimal Endogeno Endogeno
s Shock Objective us us
Variable Function Variable Variable
Obj Fn (or
Px ($B$2) X Y
2 20.78461 36 12
2.1 20.2837 34.28572 12
2.2 19.81735 32.72727 12
2.3 19.38175 31.30435 12
2.4 18.97367 30 12
2.5 18.59032 28.79913 12.00036