Re: Problem with Solve
- To: mathgroup at smc.vnet.net
- Subject: [mg45079] Re: [mg45071] Problem with Solve
- From: Andreas Reinstaller <Andreas.Reinstaller at wu-wien.ac.at>
- Date: Tue, 16 Dec 2003 06:21:05 -0500 (EST)
- References: <200312151248.HAA00545@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Thanks Dan,
sorry there were some typos that were not there in the original notebook.
First I defined \beta2 via beta1 hence there is no recursion and the pQ1 in
the original mail is of course a p*Q1, also I did not use any variable
called ''out'', I used that just for my e-mail to indicate, that this was
the output I wanted to get.
Nevertheless, using your code (with little modification, i.e rr=q*q1 +q2)
yields the same result, i.e. Mathematica running ad infinitum.
foc[f_,x_] := Map[(D[f,#]==0)&,x]
ll = 80;
kk = 80;
alpha1= 3/4;
alpha2 = 1- alpha1;
beta1 = 1/3;
beta2 = 1 - beta1;
q1 = l1^alpha1*k1^alpha2;
q2 = (ll-l1)^beta1*(kk-k1)^beta2;
rr = p*q1 + q2;
Flatten[Solve[foc[rr,{l1,k1}],{k1,l1}]]
Perhaps you have some other clues besides the obvious candidates.
Thanks,
Andreas
At 15:51 15.12.2003, Daniel Lichtblau wrote:
>Andreas Reinstaller wrote:
> >
> > I have a bizarre Problem. In trying to run this standard economics
> > maximization problem Mathematica runs ad infinitum. Same if instead of
> > Solve I use NSolve. Same if I split up the problem in doing first the
> > partial derivatives etc. It is definitely a Solve/NSolve problem, but I
> > can't believe that it is not able to do this numerical stories on such a
> > standard problem with so well-behaved functions.
> >
> > Foc[f_,x_]:=Map[(D[f,#]==0)&,x]
> >
> > Parameters:
> > L=80; K=80; \alpha1= 3/4; \alpha2 = 1- \alpha1; \beta1 = 1/3; \beta2=1 -
> > \beta2;
> >
> > Q1 = L1^\alpha1 K1^\alpha2
> > Q2 = (L-L1)^\beta1 (K-K1)^\beta2
> > R = pQ1 + Q2
> > Out = Flatten[Solve[FOC,[R,{L1,K1}],{K1,L1}]]
> >
> > Curiously it works for \alpha1 = 2/3 but for \alpha1 = 3/4 as above, or any
> > other value such as \alpha1 = 0.7 \alpha2 = 0.3
> >
> > I should be grateful if anybody could give me a hint on the sources of this
> > problem, and on how to be able to use any type of exponents.
> >
> > Thanks,
> > Andreas
>
>I think if you type it in correctly you can get a result. Your
>"equations" contain an infinite recursion (defining beta2 in terms of
>itself). Also your Solve input is not well formed. Also use of a
>variable called "Out" in Mathematica is, well, a very bad idea.
>
>foc[f_,x_] := Map[(D[f,#]==0)&,x]
>ll = 80;
>kk = 80;
>alpha1= 3/4;
>alpha2 = 1- alpha1;
>beta1 = 1/3;
>beta2 = 1 - beta1;
>q1 = l1^alpha1*k1^alpha2;
>q2 = (ll-l1)^beta1*(kk-k1)^beta2;
>rr = q1 + q2;
>
>In[39]:= InputForm[out = Flatten[Solve[foc[rr,{l1,k1}],{k1,l1}]]]
>
>Out[39]//InputForm=
>{k1 -> (10827737831833600 - 457019805007872*
> Root[-346487610618675200 + 18280792200314880*#1 -
>380849837506560*#1^2 +
> 3967185807360*#1^3 - 20662426080*#1^4 + 43046721*#1^5 & , 1, 0]
>+
> 7140934453248*Root[-346487610618675200 + 18280792200314880*#1 -
> 380849837506560*#1^2 + 3967185807360*#1^3 - 20662426080*#1^4 +
> 43046721*#1^5 & , 1, 0]^2 - 49589822592*
> Root[-346487610618675200 + 18280792200314880*#1 -
>380849837506560*#1^2 +
> 3967185807360*#1^3 - 20662426080*#1^4 + 43046721*#1^5 & , 1,
>0]^3 +
> 129140163*Root[-346487610618675200 + 18280792200314880*#1 -
> 380849837506560*#1^2 + 3967185807360*#1^3 - 20662426080*#1^4 +
> 43046721*#1^5 & , 1, 0]^4)/8796093022208,
> l1 -> Root[-346487610618675200 + 18280792200314880*#1 -
> 380849837506560*#1^2 + 3967185807360*#1^3 - 20662426080*#1^4 +
> 43046721*#1^5 & , 1, 0]}
>
>
>Daniel Lichtblau
>Wolfram Research
- References:
- Problem with Solve
- From: Andreas Reinstaller <Andreas.Reinstaller@wu-wien.ac.at>
- Problem with Solve