[Date Index]
[Thread Index]
[Author Index]
NMinimize inconsistencies
*To*: mathgroup at smc.vnet.net
*Subject*: [mg51341] NMinimize inconsistencies
*From*: DrBob <drbob at bigfoot.com>
*Date*: Thu, 14 Oct 2004 06:38:03 -0400 (EDT)
*Reply-to*: drbob at bigfoot.com
*Sender*: owner-wri-mathgroup at wolfram.com
I'm not sure what NMinimize is doing wrong, but it hardly matters. The point is to solve the problem, I hope, since it's already known that NMinimize isn't very dependable.
In the first place, p and m need not be separate variables, since they appear only as the product p m in the problem.
Secondly, intuition suggests the objective will be minimized when b-a is maximum, namely at b=1, a=0. That's simply because the range of values Log's argument takes on apparently isn't constrained by the values of a and b.
With these ideas in mind, take the argument of Log and minimize it (since Log is monotone):
exp = (c + pm - b*pm)/(c + pm - a*pm);
NMinimize[{exp, 105 <= c <= 315 &&
0 <= pm <= 5*4000 && 0 <= a <= b <= 1},
{{c, 105, 315}, {pm, 0, 5*4000},
{a, 0, 1}, {b, 0, 1}}]
{0.005222581447401144,
{a -> 2.7767903863779616*^-27, b -> 1., c -> 105., pm -> 20000.}}
As expected, exp is minimized when b-a is maximum. (It would have been sufficient to show that exp CAN be minimized with b-a at its maximum.) It follows that the same is true for exp/(b-a), so we have an optimal solution. We can go one step farther as follows:
objective = Log[exp]/(b - a) /. {a -> 0, b -> 1}
Log[c/(c + pm)]
NMinimize[{objective, 105 <= c <= 315 && 0 <= pm <= 5*4000},
{{c, 105 - delta, 315 + delta}, {pm, 0, 5*4000}}]
{-5.254763469173851, {c -> 105., pm -> 20000.}}
Bobby
From: skirmantas.janusonis at yale.edu (Skirmantas)
To: mathgroup at smc.vnet.net
Subject: [mg51341] NMinimize inconsistencies
Organization: Steven M. Christensen and Associates, Inc and MathTensor, Inc.
I'm puzzled by some inconsistencies of NMinimize.
Namely,
NMinimize[{ Log[( C + P*m - b*P*m)/( C + P*m - a*P*m)]/(a - b), 105 <
C < 315&&2000 < P < 4000&&0 < a < 1 &&0 < b < 1 &&a < b &&0 < m < 5},
{{C, 105, 315}, {P, 2000,4000}, {a, 0, 1}, {b, 0, 1}, {m, 0, 5}},
Method -> "NelderMead"]
converges to 0 on a computer running Mathematica 5.0.0. and complains
about 1/0 infinities on a computer running Mathematica 5.0.1. In
Mathematica 5.0.1., changing a<b to a>b still leads to 1/0 infinities
(why?) but then changing a>b to a!=b converges to a solution that is,
amazingly, a>b. Why does NMinimize keep running into 1/0 infinities if
I demand that a>b but not if a!=b? Are there any differences in the
NMinimize implementation in Mathematica 5.0.0. and Mathematica 5.0.1.?
Any help would be appreciated.
Skirmantas
Prev by Date:
**PDE Notation options (one works the other does not)**
Next by Date:
**Sorting a list of pairs on the second elements**
Previous by thread:
**Re: NMinimize inconsistencies**
Next by thread:
**Convert Points to Circles**
| |