Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: FindRoot failing in v8 on a system easily solvable in v7

  • To: mathgroup at smc.vnet.net
  • Subject: [mg114779] Re: FindRoot failing in v8 on a system easily solvable in v7
  • From: Grischika <Grischika at mail.ru>
  • Date: Fri, 17 Dec 2010 03:26:49 -0500 (EST)
  • References: <ieadji$r8m$1@smc.vnet.net>

On 15 15:50, vasil michev <mic... at gmail.com> wrote:
> Consider the following input
>
> eq1:=Block[{u1,u2,u3,u4},u1:=uX-2*NIntegrate[Cos[x]/(Exp[1/1.529266/
> T*(uX*0.004559*(1-Cos[x])+uY*0.004559*(1-Cos[y])+uZ*0.012095*(1-
> Cos[z]))]-1),{x,-\[Pi],\[Pi]},{y,-\[Pi],\[Pi]},{z,-\[Pi],\
> [Pi]},PrecisionGoal->4, MaxPoints->15000000,Method ->
> {"LocalAdaptive"}]/8/\[Pi]^3;
> u2:=uY-2*NIntegrate[Cos[y]/(Exp[1/1.529266/T*(uX*0.004559*(1-Cos[x])
> +uY*0.004559*(1-Cos[y])+uZ*0.012095*(1-Cos[z]))]-1),{x,-\[Pi],\[Pi]},
> {y,-\[Pi],\[Pi]},{z,-\[Pi],\[Pi]},PrecisionGoal->4, MaxPoints->15000000,Method -> {"LocalAdaptive"}]/8/\[Pi]^3;
>
> u3:=uZ-2*NIntegrate[Cos[z]/(Exp[1/1.529266/T*(uX*0.004559*(1-Cos[x])
> +uY*0.004559*(1-Cos[y])+uZ*0.012095*(1-Cos[z]))]-1),{x,-\[Pi],\[Pi]},
> {y,-\[Pi],\[Pi]},{z,-\[Pi],\[Pi]},PrecisionGoal->4, MaxPoints->15000000,Method -> {"LocalAdaptive"}]/8/\[Pi]^3;
>
> u4:=1.529266-NIntegrate[1/(Exp[1/1.529266/T*(uX*0.004559*(1-Cos[x])
> +uY*0.004559*(1-Cos[y])+uZ*0.012095*(1-Cos[z]))]-1),{x,-\[Pi],\[Pi]},
> {y,-\[Pi],\[Pi]},{z,-\[Pi],\[Pi]},PrecisionGoal->4, MaxPoints->15000000,Method -> {"LocalAdaptive"}]/8/\[Pi]^3;
>
> FindRoot[{u1,u2,u3,u4},{{uX,2,2.2},{uY,.5,.8},{uZ,1.5,2.5},{T,
> 0.01,0.1}},AccuracyGoal->5,PrecisionGoal->5]//Quiet]
>
> In v7 I get
>
> {uX->1.08147,uY->1.08147,uZ->2.08043,T->0.023582}
>
> while in v8 I get NIntegrate::inumr errors. Help browser shows no
> changes to FindRoot in v8 and I cant figure out whats failing. A quick
> test shows that the equations dont have any undefined parameters
>
> In[15]:= Block[{uX=1,uY=1,uZ=1,T=1},u1]
> Out[15]= -69.385
>
> so it must be FindRoot thats causing the problem. Any ideas?

This is work
eq1:=Block[{u1,u2,u3,u4},u1[uX_?NumberQ,uY_?NumberQ,uZ_?
NumberQ]:=uX-2*NIntegrate[Cos[x]/(Exp[1/1.529266/T*(uX*0.004559*(1-
Cos[x])+uY*0.004559*(1-Cos[y])+uZ*0.012095*(1-Cos[z]))]-1),{x,-\[Pi],\
[Pi]},{y,-\[Pi],\[Pi]},{z,-\[Pi],\[Pi]},PrecisionGoal->4,MaxPoints-
>15000000,Method->{"LocalAdaptive"}]/8/\[Pi]^3;
u2[uX_?NumberQ,uY_?NumberQ,uZ_?NumberQ]:=uY-2*NIntegrate[Cos[y]/
(Exp[1/1.529266/T*(uX*0.004559*(1-Cos[x])+uY*0.004559*(1-Cos[y])
+uZ*0.012095*(1-Cos[z]))]-1),{x,-\[Pi],\[Pi]},{y,-\[Pi],\[Pi]},{z,-\
[Pi],\[Pi]},PrecisionGoal->4,MaxPoints->15000000,Method-
>{"LocalAdaptive"}]/8/\[Pi]^3;
u3[uX_?NumberQ,uY_?NumberQ,uZ_?NumberQ]:=uZ-2*NIntegrate[Cos[z]/
(Exp[1/1.529266/T*(uX*0.004559*(1-Cos[x])+uY*0.004559*(1-Cos[y])
+uZ*0.012095*(1-Cos[z]))]-1),{x,-\[Pi],\[Pi]},{y,-\[Pi],\[Pi]},{z,-\
[Pi],\[Pi]},PrecisionGoal->4,MaxPoints->15000000,Method-
>{"LocalAdaptive"}]/8/\[Pi]^3;
u4[uX_?NumberQ,uY_?NumberQ,uZ_?NumberQ]:=1.529266-NIntegrate[1/
(Exp[1/1.529266/T*(uX*0.004559*(1-Cos[x])+uY*0.004559*(1-Cos[y])
+uZ*0.012095*(1-Cos[z]))]-1),{x,-\[Pi],\[Pi]},{y,-\[Pi],\[Pi]},{z,-\
[Pi],\[Pi]},PrecisionGoal->4,MaxPoints->15000000,Method-
>{"LocalAdaptive"}]/8/\[Pi]^3;
FindRoot[{u1[uX,uY,uZ],u2[uX,uY,uZ],u3[uX,uY,uZ],u4[uX,uY,uZ]},{{uX,
2,2.2},{uY,.5,.8},{uZ,1.5,2.5},{T,0.01,0.1}},AccuracyGoal-
>5,PrecisionGoal->5]//Quiet]
eq1


  • Prev by Date: Re: VectorPlot on a Circle
  • Next by Date: Re: Help with Loop to Rule Based Algorithm
  • Previous by thread: FindRoot failing in v8 on a system easily solvable in v7
  • Next by thread: Defining a distribution