Quantcast
Channel: Active questions tagged consumer - Stack Overflow
Viewing all articles
Browse latest Browse all 87

Solution of Consumer problem in Wolfram Mathematica doesn't work

$
0
0

I'm trying to solve a contrained consumer problem with Cobb-Douglas preferences with Wolfram Mathematica 13.1. This problem is simple and can be solved analyticaly.But my code doesn't work.

Utility = x1^\[Alpha] * x2^(1 - \[Alpha])constraint = p1*x1 + p2*x2 - rLagrangian = Utility - \[Lambda]*constraintFoc1 = D[Lagrangian, x1]Foc2 = D[Lagrangian, x2]Foc3 = D[Lagrangian, \[Lambda]]sols = Solve[{Foc1 == 0, Foc2 == 0, Foc3 == 0}, {x1, x2, \[Lambda]}]

This give me the following output:

Solve::incnst: Inconsistent or redundant transcendental equation. After reduction, the bad equation is r-p1 x1-p2 x2 == 0.Solve::svars: Equations may not give solutions for all "solve" variables.

I tried to simplify my code to:

Solve[{x1^(-1 + \[Alpha]) x2^(1 - \[Alpha]) \[Alpha] - p1 \[Lambda] == 0,        x1^\[Alpha] x2^-\[Alpha] (1 - \[Alpha]) - p2 \[Lambda] == 0,        r - p1 x1 - p2 x2 == 0},        {x1, x2, \[Lambda]}]

But this doesn't work, I get the same error. My Equations looks correct. There is an error or inconsistecy in my code?


Viewing all articles
Browse latest Browse all 87

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>