A New Kind of Science: The NKS Forum > Pure NKS > Work with argument of Maximize?
Author
serge

Registered: Sep 2004
Posts: 1

Work with argument of Maximize?

Hello, I have a following question. I would like to understand how I could work with the arguments of Maximize. Suppose that I maximize the following function

In[1]=Maximize[{x^2 + 2y, x^2 + y^2 ¡Ü 1}, {x, y}]

Out[1]={2, {x -> 0, y -> 1}}

I would like to know if I could work further on with the new variable z=y=1 (in other words, I wonder if I could assign the value of argmaximum to (some) variable so that I could work with it)? E.G. I would like to calculate y+y, i.e. I want to use the output of Maximize in my further calculations. I would be grateful if smb told me the direction to take.

Serge

Report this post to a moderator | IP: Logged

09-06-2004 03:04 PM
Richard Phillips
Wolfram Science Group
Boston, USA

Registered: Oct 2003
Posts: 46

Serge,

You may get better answers at the MathGroup Forum for Mathematica use and programming:
http://forums.wolfram.com/mathgroup/

A forum for Student users exists too:
http://forums.wolfram.com/student-support/list/

You can assign the results to variables, as follows:

In[1] := {max, r} = Maximize[{x^2 + 2y, x^2 + y^2 <= 1}, {x, y}]
Out[1] = {2, {x -> 0, y -> 1}}

In[2] := max
Out[2] = 2

In[3] := r
Out[3] = {x->0, y->1}

Any expression containing x and y can then be calculated by using ReplaceAll (written /. ) as follows:

In[4]:= {x, y} /. r
Out[4] = {0, 1}

In[5]:= y + y /. r
Out[5] = 2

Does this help?

Report this post to a moderator | IP: Logged

09-09-2004 02:07 PM

wolframscience.com  |  wolfram atlas  |  NKS online  |  web resources  |  contact us