Message Boards Message Boards

0
|
3005 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

Unexpected behavior of FindMinimum

Posted 2 years ago

This kind of FindMinimum is something I have often done. Now it's gone crazy.

Look carefully at the search descriptions for the two versions of FindMinimum. In the first version, u0 is gray, as though it is unknown.

In the second version, I have moved the u search description to the end. So now the x20 is grayed, although it wasn't grayed before! So somehow, the first search description is screwed up, no matter what it is.

At the top, you see that u0 and x20 have perfectly reasonable values.

If I start either one of the FindMinimum's, I get very wrong behaviors ("err" is instrumented to tell me what is happening.)

I've stared at this a million times, and I don't see the problem. Any suggestions?

I have attached a part of the notebook. The whole notebook is long, and works off a very long data file. I have left the screen shot attached, since it shows the colors I am talking about. The code sample does not show these.

In[411]:= {x20, u0}

Out[411]= {-55, 10.}

count = 0;
result = FindMinimum[
  Hold@err[
    bez5[#, {llc[u], {x2, y2}, {x3, y3}, {x4, y4}, ulc[v]}, {w10, w2, 
       w3, w4, w50}] &,
    lcData,
    Table[1, Length@lcData],
    {u, {llc[u], {x2, y2}, {x3, y3}, {x4, y4}, ulc[v]}, 
     v, {w10, w2, w3, w4, w50}}
    ],
  {u, u0, u0 + .1},
  {x2, x20, x20 + 1}, {y2, y20, y20 + 1}, {w2, w20, w20 + .1},
  {x3, x30, x30 + 1}, {y3, y30, y30 + 1}, {w3, w30, w30 + .1},
  {x4, x40, x40 + 1}, {y4, y40, y40 + 1}, {w4, w40, w40 + .1},
  {v, v0, v0 + .1}
  ]

count = 0;
result = FindMinimum[
  Hold@err[
    bez5[#, {llc[u], {x2, y2}, {x3, y3}, {x4, y4}, ulc[v]}, {w10, w2, 
       w3, w4, w50}] &,
    lcData,
    Table[1, Length@lcData],
    {u, {llc[u], {x2, y2}, {x3, y3}, {x4, y4}, ulc[v]}, 
     v, {w10, w2, w3, w4, w50}}
    ],
  {x2, x20, x20 + 1}, {y2, y20, y20 + 1}, {w2, w20, w20 + .1},
  {x3, x30, x30 + 1}, {y3, y30, y30 + 1}, {w3, w30, w30 + .1},
  {x4, x40, x40 + 1}, {y4, y40, y40 + 1}, {w4, w40, w40 + .1},
  {u, u0, u0 + .1},
  {v, v0, v0 + .1}
  ]
POSTED BY: David Golber
Posted 2 years ago

Well, I have no answer/solution to the question of why the first x20 or u0 is gray. But I found the reason that FindMinimum was not doing what I wanted in a completely different place. In other words, the gray made no difference in the actual behavior. (But it was misleading.)

POSTED BY: David Golber
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