Group Abstract Group Abstract

Message Boards Message Boards

0
|
7.6K Views
|
8 Replies
|
1 Total Like
View groups...
Share
Share this post:

Perform numerical nonlinear global optimization?

Posted 6 years ago
POSTED BY: Michael Fischer
8 Replies

I do not know what is getting in the way. Here is a simple case that works as I would expect.

function[x_?NumericQ, y_?NumericQ, z_?NumericQ] :=  x + y^3 + z^6

 NMinimize[{(function[x, 1, 2] - 70)^2, 3 < x < 4}, {x, 3, 4}]

(* Out[10]= {1., {x -> 4.}} *)

It may be too simple though, since it would also work without using the ?NumericQ pattern predicate checks.

POSTED BY: Daniel Lichtblau
Attachments:
POSTED BY: Michael Fischer
function[mmm_?NumericQ, nnn_]

I tried to define your function in NMinimize and it runs without error message. However, the function is stochastic in nature. I doubt this type of function is suitable for NMinimize.

issue

POSTED BY: Shenghui Yang

First of all, thank you alot.

Could you upload that file? And I know the issue with the Randomness but I assumed if I do it mutliple times there, it is a start (I had no better idea at the moment)

POSTED BY: Michael Fischer

here is the file, I just copied your definition and add a plot function.

Attachments:
POSTED BY: Shenghui Yang

Dear Daniel, thanks again for the quick reply Just to understand it correctly,

function[x_?NumericQ, y_?NumericQ, z_?NumericQ] := ...

And then, when guessing e.g. x, I use

NMinimize[{(function[x, 1,2] -70)^2, 3 < x < 4}, {x, 3, 4}] ? Because this doesn't work. However, before going into detail, as written in the Link, the solution

NMinimize[{Hold[(function[x,1,2] - 70)^2, 3 < x < 4}, {x, 3, 4}]
NMinimize[{Hold[(function[x,1,2 ] - 70)^2, 3 < x < 4}, {x, 3, 4}]

gives me twice the same result, even my simulation has (more then one) propabilistic effect in it. I assume hold is the reason? But again, no idea why

I'll now try to build a minimal example to represent my problem

POSTED BY: Michael Fischer

Might try defining function a bit differently:

function[x_?NumericQ, 1, 2] := ...

See if that improves matters. if not, more detail will be needed in the question.

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