Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: Maximize a single variable and solve for the rest
Replies: 5   Last Post: May 24, 2011 5:18 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
FranD

Posts: 14
Registered: 5/22/11
Re: Maximize a single variable and solve for the rest
Posted: May 24, 2011 5:18 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

This below appears to work.

r1 = 3/4; r2 = 1;

Maximize[{c, b == c*r1 && h + s + b + d == 1 && d == c*r2 && h == s && b + d <= 9/10, c <= 9},{h, s, b, d, c}]

Out = {18/35, {h -> 1/20, s -> 1/20, b -> 27/70, d -> 18/35, c -> 18/35}}

--Frank

----

Hello,

I have a problem where I would like to solve an equation (namely (h+s+b
+d==1) with some constraints, while maximizing for a related variable
"c" (c<=9). Please see below, any suggestions?

r1 = 3/4;
r2 = 1;
Block[{h, s, b, d, c},
NMaximize[{h + s + b + d,
b == c*r1 && h + s + b + d == 1 && d == c*r2 && h == s &&
b + d <= 0.9}, {h, s, b, d, c}]]

{1., {h -> 0.5, s -> 0.5, (3 c)/4 -> 0., c -> 0., c -> 0.}}

Should I be using NSolve?

Thanks in advance,
Ramiro




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.