Scott,
It is strange, I got your posting as an email but it is not here on the site.
Your problem is solved as follows:
CostofPart1 = 1;
CostofPart2 = 2;
NumberofPart1 = x;
NumberofPart2 = y;
ExCosts =
ExampleCosts == ((CostofPart1*NumberofPart1) + (CostofPart2*
NumberofPart2));
ExampleRevenue = ExampleRev;
prof = ExampleRevenue - ExampleCosts;
Now construct the constraints -- they must be one expression separated by && -- (Eqn1 AND Eqn2 AND ...)
constraintsA =
ExampleCosts >= 100 && ExampleRev <= 1000 &&
20 <= NumberofPart1 <= 80 && 20 <= NumberofPart2 <= 80;
Solve the problem with:
Maximize[{prof, constraintsA && ExCosts}, {ExampleCosts, ExampleRev,
NumberofPart1, NumberofPart2}]
to get:
{900, {ExampleCosts -> 100, ExampleRev -> 1000, x -> 20, y -> 40}}
Note that I used ";" to end lines to suppress printing. You are mixing up equations and variables and assignments. you solve for variables -- they do not have to be x and y but they must be consistently used. Also, you really should not have expressions like ExampleRevenue = ExampleRev
Adding extra variables only confuses things. Just use the minimal number -- I left some in your example but I would avoid the confusion.
The answer of 900 is correct -- the profit is ExampleRev - ExampleCosts = (1000 - 100) = 900. The cost of 100 comes from the 20 units of x at 1 and 40 units of y at 2 (80 +20 = 100)
anything else would not maximize profit and meet the constraints.
Lastly it is bad form to start variables with Capital letters -- Mathematica internal symbols start with Cap letters -- yours should not.
I hope this helps