Message Boards Message Boards

Maximize with Manipulate

Posted 4 years ago

Hello Dear Members, I am trying to include a manipulate to NMaximize function to see how the output values are changing for p and t. By varying the variable w, x, y and z. Kindly please help me to resolve this, the file in attachment. Thanks.

Manipulate[[NMaximize[{
(*Objective function*)
-6 p + 92 t,
(*Constraints*)
-0.3 p + 12 t >= (w - 11.81) &&
-4 p + 34 t >= (x - 228.92) &&
-3 p + 133 t == (y - 163.28) &&
6 p - 92 t >= (z - 128.69),
p >= 0 &&
t >= 0},
{p, t}]],
{w, 6, 16}, {x, 170, 200}, {y, 150, 300}, {z, 50, 200}]
Attachments:
POSTED BY: Manoj Imrith
2 Replies
Posted 4 years ago

Does this work for you

Manipulate[
  NMaximize[{(*Objective function*)-6p+92t,
    (*Constraints*)-0.3p+12t>=(w-11.81)&&-4p+34t>=x-228.92&&
    -3p+133t==y-163.28&&6p-92t>=z-128.69&&p>=0&&t>=0},{p,t}],
  {w,6,16},{x,170,200},{y,150,300},{z,50,200}]
POSTED BY: Bill Nelson
Posted 4 years ago

Dear Mr. Bill, Thanks for your prompt reply. It works fine. There was additional square brackets in my code after the manipulate. Kind Regards.

POSTED BY: Manoj Imrith
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract