Message Boards Message Boards

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

NMinimize failed to converge despite increasing MaxIterations

Posted 10 years ago

If MaxIterations is reached ,such as ''NMinimize::cvmit: Failed to converge to the requested accuracy or precision within 100 iterations. '', I have tried to increase the MaxIterations number, but it still not converge. Does it has any return value so as to Exclude the unwanted data?

code: (* Xq is a function of kz and ky*)

kztemp = Range[0.1, Pi, 0.1];
len = Length[kztemp];
kytemp = Table[0, {len}];
For[h1 = 1, h1 <= len, 
  h1++, {Xqtemp = Xq /. {kz -> kztemp[[h1]]}, 
   temp = ky /. 
     Last[NMinimize[{Abs[Xqtemp], -Pi < ky < Pi}, ky, 
       MaxIterations -> 10000]] , kytemp[[h1]] = temp}];

Thank you vary much!

POSTED BY: xia lingbo
2 Replies

Nothing works from this code

(*Xq is a function of kz and ky*)
kztemp = Range[0.1, Pi, 0.1]; len = Length[kztemp]; kytemp = 
 Table[0, {len}]; For[h1 = 1, h1 <= len, 
 h1++, {Xqtemp = Xq /. {kz -> kztemp[[h1]]},
  temp = ky /. 
    Last[NMinimize[{Abs[Xqtemp], -Pi < ky < Pi}, ky, 
      MaxIterations -> 10000]],
  kytemp[[h1]] = temp}
 ];

NMinimize::nnum: The function value Abs[Xq] is not a number at {ky} = {-2.82734}. >> 
NMinimize::nnum: The function value Abs[Xq] is not a number at {ky} = {-2.82734}. >>
NMinimize::nnum: The function value Abs[Xq] is not a number at {ky} = {-2.82734}. >>
General::stop: Further output of NMinimize::nnum will be suppressed during this calculation. >>

what is Xq? It must be given in functional form to apply the rule kz-> kztemp[[h1]] ...

POSTED BY: Udo Krause

I'm Sorry that I didn't paste the full code, becuase that is too long, nearly 100 rows and run nearly 1 hour. So i have just showed the error reminder ''NMinimize::cvmit: Failed to converge to the requested accuracy or precision within 100 iterations. ''. And i want to know Does it has any return value so as to Exclude the unwanted data?

POSTED BY: xia lingbo
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