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: stop when not converge
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
H.J. Wang

Posts: 12
Registered: 12/7/04
stop when not converge
Posted: Jun 18, 1997 10:20 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

How to stop Mma when iterations are not converging?

For example, I want to increase x in the function f[x,y] until the value
of y solved from FindRoot[ f[x,y]==0, ...] is not a real number OR
FindRoot does not converge. More specificly, I tried to do something
like the following:

g[x_,yIni_] := FindRoot[ f[x_,y_]==0, {y,yIni} ][[1,2]];

(* the Part at the end of the expression is to take out
the solution of y *)

m=0;
xV0=1; yV0=2; (* or something like that *)

While[ tem = g[xV0+m, yV0]; Im[tem]==0 && the_findroot_do_converge,
m=m+0.01 ];

( The Im[tem] is to test whether the solution of y is a real number.)
So the problem I have is how to specify the condition for
"the_findroot_do_converge", or, maybe more easily,
"the_findroot_donot_converge"? I want it stops when not converging even
though it may return a real number.

Thank you in advance for any suggestion.

-- H.J. Wang





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.