MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Maximize a single variable and solve for the rest

  • To: mathgroup at smc.vnet.net
  • Subject: [mg119039] Maximize a single variable and solve for the rest
  • From: Ramiro <ramiro.barrantes at gmail.com>
  • Date: Fri, 20 May 2011 06:38:28 -0400 (EDT)

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


  • Prev by Date: Re: How To Break Long List to m-by-n MatrixForm
  • Next by Date: Re: A bug or something wrong with Mathematica 8 ?
  • Previous by thread: Re: NDSolve with NIntegrate for a PDE where the unknown function is integrated wrt its variables
  • Next by thread: Re: Maximize a single variable and solve for the rest