wolframscience.com

A New Kind of Science: The NKS Forum : Powered by vBulletin version 2.3.0 A New Kind of Science: The NKS Forum > Pure NKS > Work with argument of Maximize?
  Last Thread   Next Thread
Author
Thread Post New Thread    Post A Reply
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}]

and get the answer.

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.

Thank you for your time.

Serge

Report this post to a moderator | IP: Logged

Old Post 09-06-2004 03:04 PM
serge is offline Click Here to See the Profile for serge Click here to Send serge a Private Message Click Here to Email serge Edit/Delete Message Reply w/Quote
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

Old Post 09-09-2004 02:07 PM
Richard Phillips is offline Click Here to See the Profile for Richard Phillips Click here to Send Richard Phillips a Private Message Edit/Delete Message Reply w/Quote
Post New Thread    Post A Reply
  Last Thread   Next Thread
Show Printable Version | Email this Page | Subscribe to this Thread


 

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

Forum Sponsored by Wolfram Research

© 2004-13 Wolfram Research, Inc. | Powered by vBulletin 2.3.0 © 2000-2002 Jelsoft Enterprises, Ltd. | Disclaimer | Archives