Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
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.
Solved! Go to Solution.
Put the x value first in the function to be maximized. See attached.
Alan
Put the x value first in the function to be maximized. See attached.
Alan
That's subtle. I never got that from the quicksheets or help. Works on my "real" problem. Thanks.