Skip to main content
12-Amethyst
Aug 14, 2015 8:56 PM UTC
Solved

Maximize solve block with range variables

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.

19-Tanzanite
Aug 15, 2015 2:12 PM UTC

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

Alan

2 replies

19-Tanzanite
Aug 15, 2015 2:12 PM UTC

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

Alan

Translate
akelly12-AmethystAuthor
12-Amethyst
Aug 16, 2015 11:34 PM UTC

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

Translate