0
|
8306 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
GROUPS:

# NMinimize failed to converge despite increasing MaxIterations

Posted 9 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!
2 Replies
Sort By:
Posted 9 years ago
 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 9 years ago
 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?