Group Abstract Group Abstract

Message Boards Message Boards

0
|
65 Views
|
0 Replies
|
0 Total Likes
View groups...
Share
Share this post:
GROUPS:

Speeding Up Random Search

Using an example from the documentation

f[x, y] = Exp[Sin[50 x]] + Sin[60 Exp[y]] + Sin[70 Sin[x]] + Sin[Sin[80 y]] - Sin[10 (x + y)] + 1/4 (x^2 + y^2);

AbsoluteTiming @ NMinimize[f[x, y], {x, y}, Method -> "RandomSearch"]

{0.0919746, {-2.38708, {x -> -0.124868, y -> 0.290932}}}

AbsoluteTiming @ NMinimize[f[x, y], {x, y}, Method -> {"RandomSearch", "SearchPoints" -> 1500}]

{4.19461, {-3.30687, {x -> -0.0244031, y -> 0.210612}}}

AbsoluteTiming @ (sln = NMinimize[{f[x + dx, y + dy], -0.01 <= dx <= .01 , -.01 <= dy <= .01}, {x, y, dx, dy}, Method -> {"RandomSearch", "SearchPoints" -> 50 }])

{0.432524, {-3.30687, {x -> -0.0156802, y -> 0.212335, dx -> -0.00872292, dy -> -0.00172211}}}

{x + dx, y + dy} /. sln[[2]]

{-0.0244031, 0.210612}

POSTED BY: Frank Kampas
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard