Message Boards Message Boards

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

Understand the NMinimize output vs. StepMonitor output

Posted 10 years ago

Here i s part of my code. I am looking for a minimal value of a function krit (with a given parameter Fexp).

The output from the StepMonitor says, that NMinimize found a value 87.985 of the function krit, but the result of the NMinimize function is (worse) value 99.8154. Why? Why not 87.985?

Thank you for help!

In[77]:= res = NMinimize[
  krit[k1, k2, n1, n2, \[CapitalDelta]1, \[CapitalDelta]2, e1, e2, 
   Fexp], k1 > 0 && k2 > 0 && n1 > 0.01 && 
   n2 > 0.01 && \[CapitalDelta]1 > 0 && \[CapitalDelta]2 > 0 && 
   e1 > 0.01 && 
   e2 > 0.01 && \[CapitalDelta]1 \[Element] 
    Integers && \[CapitalDelta]2 \[Element] Integers, {k1, k2, n1, 
   n2, \[CapitalDelta]1, \[CapitalDelta]2, e1, e2}, 
  MaxIterations -> 5,
  StepMonitor :> {Print[
     krit[k1, k2, n1, n2, \[CapitalDelta]1, \[CapitalDelta]2, e1, e2, 
      Fexp], " <-> ", {k1, k2, n1, 
      n2, \[CapitalDelta]1, \[CapitalDelta]2, e1, e2}]}
  ]

During evaluation of In[77]:= 99.9059 <-> {1.73071,1.13718,0.601198,1.31724,2,2,1.05854,0.129745}

During evaluation of In[77]:= 99.9059 <-> {1.73071,1.13718,0.601198,1.31724,2,2,1.05854,0.129745}

During evaluation of In[77]:= 99.9059 <-> {1.73071,1.13718,0.601198,1.31724,2,2,1.05854,0.129745}

During evaluation of In[77]:= 99.8549 <-> {1.85288,1.36396,0.739199,1.1769,4,1,1.07687,0.807171}

During evaluation of In[77]:= 99.8549 <-> {1.85288,1.36396,0.739199,1.1769,4,1,1.07687,0.807171}

During evaluation of In[77]:= 99.8154 <-> {1.37364,1.49254,0.147263,1.26496,4,1,1.01063,1.75675}

During evaluation of In[77]:= 96.4886 <-> {1.53655,1.49543,0.0669391,1.26766,4,1,0.299039,1.75928}

During evaluation of In[77]:= 88.3542 <-> {1.58294,1.49545,0.026076,1.26766,4,1,0.0128904,1.75928}

During evaluation of In[77]:= 88.1938 <-> {1.58489,1.49545,0.0242414,1.26766,4,1,0.0100289,1.75928}

During evaluation of In[77]:= 87.985 <-> {1.60044,1.49546,0.0109273,1.26766,4,1,0.0100003,1.75929}

Out[77]= {99.8154, {k1 -> 1.37364, k2 -> 1.49254, n1 -> 0.147263, 
  n2 -> 1.26496, \[CapitalDelta]1 -> 4, \[CapitalDelta]2 -> 1, 
  e1 -> 1.01063, e2 -> 1.75675}}

In[78]:= krit[1.6004404664797225`, 1.4954588369276354`, \
0.010927309028896423`, 1.2676565106600015`, 4, 1, \
0.010000289039330264`, 1.7592900563124902`, Fexp]

Out[78]= 87.985
POSTED BY: Tomáš Hruš

Maybe the intermediate values shown don't satisfy all constraints? It's pretty much impossible to say for sure without full code.

POSTED BY: Daniel Lichtblau
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