Message Boards Message Boards

0
|
3224 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Solve does not work this Lagrangian function

Posted 12 years ago
I have the following code in Mathematica:
L = Log[c1] + \[Beta] Log[
c2] + \[Lambda] (r c1 + c2 - (1 - \[Tau]) A c3^\[Theta] +
r ((1 - \[Alpha]) c3)^(1/(1 - \[Alpha])))
x1 = D[L, c1]
x2 = D[L, c2]
x3 = D[L, c3]
Solve[{x1 == 0, x2 == 0, x3 == 0}, {c1, c2, c3}]
The derivatives are calculated correctly. The Solve function does not appear to do a thing. Aplogize in advance if this is elementary; I have just begun to self-learn Mathematica. Objective is to have it solve this Lagrangean.

Thanks!
POSTED BY: Glenn F
2 Replies
Posted 12 years ago
Thank you for this! Very helpful.
POSTED BY: Glenn F
Hi,

When I tried your code, I got the following error message:
Solve::nsmet: This system cannot be solved with the methods available to Solve. >>
The first and second equations can be solved for c1 and c2, respectively. The above error message is due to the third equation x3==0. Try
x3 = PowerExpand[x3]
before calling Solve assuming that  \ is less than 1. Solve will then be able to solve the equations. The result is, unfortunately, not so illuminating. After some arithmetic, the third equation can be turned into the form
\[Lambda] (c3^(1/(1-\[Alpha])-\[Theta]) r (1-\[Alpha])^(\[Alpha]/(1-\[Alpha]))-A \[Theta] (1-\[Tau])) == 0
which gives a better looking solution.

Youngjoo Chung
POSTED BY: Youngjoo Chung
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract