Skip to main content
12-Amethyst
August 14, 2015
Solved

Maximize solve block with range variables

  • August 14, 2015
  • 1 reply
  • 1918 views

Using a Given ... Maximize(f,x) solve block.  The equations work correctly for a test case.

I'm re-writing the worksheet to process a table of inputs I'm reading from Excel.  So I need to run the solve block to find the maximum "x" for each row of the Excel data (e.g. 1000 times).  I've decomposed the input table into several arrays and have done a bunch of calculations on each "row" using range variables or "vectorize" operator.

What's giving me problems is that the function f has more variables - f(a,b,c,x).  So for each "row", a, b, and c are fixed, and I need to find x that maximizes f.  The next row, a, b, and c are different, but they are considered as fixed values for the purposes of finding a new x that maximizes f.

I made an example in Mathcad 15.  Oddly enough, the simple example I made works.  But if I add units, the solve block fails.  Even stranger, the original worksheet with a single case used units and the solve block worked.

Looking for suggestions.

Best answer by AlanStevens

Put the x value first in the function to be maximized.  See attached.

Alan

1 reply

19-Tanzanite
August 15, 2015

Put the x value first in the function to be maximized.  See attached.

Alan

akelly12-AmethystAuthor
12-Amethyst
August 16, 2015

That's subtle.  I never got that from the quicksheets or help.  Works on my "real" problem.  Thanks.