| Author |
Comment/Response |
Ben Dundee
|
08/21/09 2:57pm
I am trying to numerically minimize a potential, call it f(x,y). Mathematica gives several options to do this, but there is a problem that I don't quite understand.
When I try to minimize f(x,y) with FindRoot, by setting the various derivatives to zero and giving mathematica a starting point, I get one answer. However, when I graph the function, the answer is wrong by about 10% in one of the variables. So, for example, the true minimum of f is at, say (2,1), and mathematica finds a minimum at (2,1.1).
Now, when I take the good value and plug it into the function, then use Minimize, mathematica returns the correct answer. So, for example, when I evaluate
FindMinimum[ f[2,y], ... ]
Mathematica returns
y->1
This is highly frustrating, and I am not sure what is happening. I am evaluating both expressions (FindRoot and FindMinimum) using the following option
WorkingPresicion -> 500
For both functions, I use
Compiled->False.
Also, for FindRoot, I've tried setting PrecisionGoal and AccuracyGoal to ``Infinity''. Finally, I've tried the different Methods in FindRoot, both ``Brent'' and ``Secant'', all with the same result.
Can anyone give me some advice?
URL: , |
|