Message Boards Message Boards

0
|
7678 Views
|
6 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Deterministic Code Gives Different Results for Same Input

My augmented Lagrangian local minimization code gives slightly different results for the same inputs for a problem involving packing 50 integer circles.
Past work has shown that circle packing is chaotic in that slightly different inputs give different results but I don't understand why the same input gives different results. For the first run, I get an objective function value of 232.568 and 232.132 for the second. The starting point is generated randomly but is used for both runs.

The attached notebook has the code. It was run with Mathematica Version 10.1 on a PC running Windows 8.

Attachments:
POSTED BY: Frank Kampas
6 Replies

I put in some Print statements. The results of the first FindMinimum run are different when the final results differ.

POSTED BY: Frank Kampas
Posted 9 years ago

Well, my impression of Windows 8 is that your results might depend on what's currently available on Taylor Swift's facebook page. ;-)

POSTED BY: David Keith

I also get the same result both times under Win 7 x64.

POSTED BY: Frank Kampas

The problem does not occur on my MacBookAir, which makes me think it is not a coding problem but a problem related to the operating system. When I run packing problems with MathOptimizer Professional, which compiles the objective function and and constraints to Fortran or C, I get slightly different results with different compilers, but consistent results for one compiler.

POSTED BY: Frank Kampas
Posted 9 years ago

On my Thinkpad on Win 7 x64 I get 232.516 for both runs. Both with a fresh kernel, and with a second evaluation.

POSTED BY: David Keith

I wasn't able to reproduce the problem on my mac.

Normally when I see something like this, the cause is that a different variable name is used for something between the two runs. In symbolic computing the choice of a variable name matters, which is counterintuitive for most programmers in most languages. Another common cause is that a method isn't specified for a numerical function. I didn't see that though in your notebook, but please check that both of these aren't being done.

POSTED BY: Sean Clarke
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