Skip to main content
12-Amethyst
April 23, 2013
Solved

Maximize Function: MC 15

  • April 23, 2013
  • 2 replies
  • 6080 views

All --

Any ideas on why the attached sheet bombs? The error is (of course) "This variable is undefined", but I have been using MC long enough now to know that when you get that error in a solve block the absolute last thing that is likely wrong is that you have an undefined variable. I note that if I remove two of the conditions in the solve block, it works. Maybe this means there is no convergence?

Thanks in advance.

Matt

Best answer by MoeSzyslak

OK, I'm an idiot. Worksheet (below) now works correctly (I think). Putting it in to production mode to look for remaining issues. Thanks, all.

2 replies

24-Ruby IV
April 23, 2013

1. The vector p is a constant.

2. Plot please H(p) function

12-Amethyst
April 23, 2013

Valery -- thanks for the reply.However, I'm not sure that I follow you. I provide guess values for p that are constant, but the vector values are, themselves, the parameters being optimized in the solve block. As for plotting the function H(p), that doesn't make sense. H takes the vector p as input and provides a scalar output. I'm not exactly sure what you would like for me to plot.

Matt

24-Ruby IV
April 23, 2013

Moe, if You would like to find a maximum of a function with one argument You can plot this function and see this maximum.

I think so.

12-Amethyst
April 23, 2013

OK, attached is a modified sheet that calls the Maximize(f,v) function 'n' times. It executes without error, but the results are incorrect. What am I missing? Thanks.

MoeSzyslak12-AmethystAuthorAnswer
12-Amethyst
April 24, 2013

OK, I'm an idiot. Worksheet (below) now works correctly (I think). Putting it in to production mode to look for remaining issues. Thanks, all.

19-Tanzanite
April 24, 2013

Good idea, but why log to the base N? The values of v are essentially the same if you use base 10, though you don't seem to get the same H(v) as in the single run worksheet (suggests perhaps that your hypersurface has a steep spike in it?).

Alan