Group Abstract Group Abstract

Message Boards Message Boards

0
|
1.8K Views
|
3 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Issue with solving an optimization model using FindMaximum and mismatch the result from a paper

Posted 1 year ago
3 Replies

After some plotting, like

Plot3D[F[d, n], {d, 0, 8}, {n, 0, 1/2},
 PlotRange -> {-1, 2500000}]

I come to suspect that the maximum is attained near d=4 and n=1/100. Using these values as starting points I get

In[172]:= FindMaximum[F[d, n], {{d, 4}, {n, 1/100}}]

Out[172]= {1.94398*10^6, {d -> 4.00704, n -> 0.0125096}}

I don't know if these are sensible values for your problem.

POSTED BY: Gianluca Gorni
Posted 1 year ago

I run your first block of code and I get the error that you get. But it doesn't really clearly show me why something is not numeric. So I try

F[0.999994,1] // InputForm

and I get

Out[8]//InputForm= -598.2275653440438 - 11.063835115005528*(57.25000000000001*
  (-Log[121] + Log[1 + 1.*(-1 + k/2)^1.]) - 57.25000000000001*Log[(-1 + k/2)/120])

and it is clear that the error message is correct, that is not a real number because k has not been assigned any numeric value. I look at all your variable assignments and see that is correct.

I have no idea what k should be so I try a few simple ideas. I try including k=2 and restart and it fails because the value for F[0.999994,1] is -infinity. I try k=1 and it fails. I try k=4 and it fails.

If you know what value k should have to give a real numeric value for F then this might let you find the maximum.

POSTED BY: Bill Nelson
Posted 1 year ago

Hi, thank you for your help!

After reviewing my work, I realized I made a mistake in the equation for Tf, which includes K. I had written it as:

Tf = - (Log[1/z (k/ww - 1)]/q);

But it should actually be:

Tf = - (Log[1/z (g/ww - 1)]/q);

Where g has a value of 6.87. According to the paper, the equation looks like this:

enter image description here

But after correcting the equation, I’m still encountering the following error:

FindMaximum::nrnum: The function value -2.5726110^29 + 2.5726110^29 I is not a real number at {d,n} = {985.615,-217184.}.

General::stop: Further output of FindMaximum::nrnum will be suppressed during this calculation.

IPOPTMinimize::badobj: Invalid objective function. The objective function doesn't evaluate to a real-valued numeric result at the initial point.

FindMaximum::nrgnum: The gradient is not a vector of real numbers at {d,n} = {985.5,-217184.}.

FindMaximum::conv: Interior point method fails to converge.

Do you have any suggestions on how I can fix this issue? It seems that the function is still returning non-real values, and the method fails to converge.

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