Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: FindRoot failing in v8 on a system easily solvable in v7
Replies: 1   Last Post: Dec 17, 2010 3:26 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Grischika@mail.ru

Posts: 23
Registered: 2/5/08
Re: FindRoot failing in v8 on a system easily solvable in v7
Posted: Dec 17, 2010 3:26 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 15 15:50, vasil michev <mic...@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




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.