Skip to main content
Notice removed Draw attention by Vsevolod A.
Bounty Ended with Michael E2's answer chosen by Vsevolod A.
Tweeted twitter.com/StackMma/status/1101905163407814656
Notice added Draw attention by Vsevolod A.
Bounty Started worth 50 reputation by Vsevolod A.
edited tags
Link
Routine cleanup
Source Link
m_goldberg
  • 108.1k
  • 16
  • 104
  • 259

I'm trying to find a maximum of interpolated function inside a particular mesh cell. However, for some cells the process is very slow and it returns a warning:

FindMinimum::eit: The algorithm does not converge to the tolerance of 1 1.`*^-6 in 500 iterations

The code is:

FF = Interpolation[q, InterpolationOrder -> 2];
dp = 
  DensityPlot[FF[x, y], {x, y} \[Element] Disk[{0, 0}, 2], 
    PlotRange -> All, PlotPoints -> 40];
ms = DelaunayMesh[kekL, MeshCellStyle -> {2 -> Opacity[0]}];
pg = MeshPrimitives[ms, 2][[104]];
fm = 
  FindMaximum[{FF[x, y], {x, y} \[Element] pg}, {{x, pg[[1, 1, 1]]}, {y, pg[[1, 1, 2]]}}, 
    MaxIterations -> 30]
Show[
  {dp, ms,
   Graphics[{White, Point[{x, y} /. fm[[2]]],  Point[RegionCentroid[pg]]}]}, 
  ImageSize -> 600]

AndThe definitions of q and kekL are on pastebin. I

I don't want a particularly accurate solution (even 10^-2 precision is fine)m but I'd like it to be fast. I tried using option MaxIterations but no matter what the parameter was it still reported "500 iterations" warning. It seems like it's ignoring eveything I put like AccuracyGoal and PrecisionGoal as well. The version is 11.2

I'm trying to find a maximum of interpolated function inside a particular mesh cell. However for some cells the process is very slow and it returns a warning:

FindMinimum::eit: The algorithm does not converge to the tolerance of 1.`*^-6 in 500 iterations

The code is:

FF = Interpolation[q, InterpolationOrder -> 2];
dp = DensityPlot[FF[x, y], {x, y} \[Element] Disk[{0, 0}, 2], PlotRange -> All, PlotPoints -> 40];
ms = DelaunayMesh[kekL, MeshCellStyle -> {2 -> Opacity[0]}];
pg = MeshPrimitives[ms, 2][[104]];
fm = FindMaximum[{FF[x, y], {x, y} \[Element] pg}, {{x, pg[[1, 1, 1]]}, {y, pg[[1, 1, 2]]}}, MaxIterations -> 30]
Show[{dp, ms, Graphics[{White, Point[{x, y} /. fm[[2]]],  Point[RegionCentroid[pg]]}]}, ImageSize -> 600]

And definitions of q and kekL are on pastebin. I don't want a particularly accurate solution (even 10^-2 precision is fine) but I'd like it to be fast. I tried using option MaxIterations but no matter what the parameter was it still reported "500 iterations" warning. It seems like it's ignoring eveything I put like AccuracyGoal and PrecisionGoal as well. The version is 11.2

I'm trying to find a maximum of interpolated function inside a particular mesh cell. However, for some cells the process is very slow and it returns a warning:

FindMinimum::eit: The algorithm does not converge to the tolerance of 1.`*^-6 in 500 iterations

The code is:

FF = Interpolation[q, InterpolationOrder -> 2];
dp = 
  DensityPlot[FF[x, y], {x, y}  Disk[{0, 0}, 2], 
    PlotRange -> All, PlotPoints -> 40];
ms = DelaunayMesh[kekL, MeshCellStyle -> {2 -> Opacity[0]}];
pg = MeshPrimitives[ms, 2][[104]];
fm = 
  FindMaximum[{FF[x, y], {x, y}  pg}, {{x, pg[[1, 1, 1]]}, {y, pg[[1, 1, 2]]}}, 
    MaxIterations -> 30]
Show[
  {dp, ms,
   Graphics[{White, Point[{x, y} /. fm[[2]]], Point[RegionCentroid[pg]]}]}, 
  ImageSize -> 600]

The definitions of q and kekL are on pastebin.

I don't want a particularly accurate solution (even 10^-2 precision is fine)m but I'd like it to be fast. I tried using option MaxIterations but no matter what the parameter was it still reported "500 iterations" warning. It seems like it's ignoring eveything I put like AccuracyGoal and PrecisionGoal as well. The version is 11.2

Source Link
Vsevolod A.
  • 999
  • 6
  • 16

FindMaximum ignores MaxIterations option

I'm trying to find a maximum of interpolated function inside a particular mesh cell. However for some cells the process is very slow and it returns a warning:

FindMinimum::eit: The algorithm does not converge to the tolerance of 1.`*^-6 in 500 iterations

The code is:

FF = Interpolation[q, InterpolationOrder -> 2];
dp = DensityPlot[FF[x, y], {x, y} \[Element] Disk[{0, 0}, 2], PlotRange -> All, PlotPoints -> 40];
ms = DelaunayMesh[kekL, MeshCellStyle -> {2 -> Opacity[0]}];
pg = MeshPrimitives[ms, 2][[104]];
fm = FindMaximum[{FF[x, y], {x, y} \[Element] pg}, {{x, pg[[1, 1, 1]]}, {y, pg[[1, 1, 2]]}}, MaxIterations -> 30]
Show[{dp, ms, Graphics[{White, Point[{x, y} /. fm[[2]]],  Point[RegionCentroid[pg]]}]}, ImageSize -> 600]

And definitions of q and kekL are on pastebin. I don't want a particularly accurate solution (even 10^-2 precision is fine) but I'd like it to be fast. I tried using option MaxIterations but no matter what the parameter was it still reported "500 iterations" warning. It seems like it's ignoring eveything I put like AccuracyGoal and PrecisionGoal as well. The version is 11.2