Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

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

Search the Archive

Re: reuse values maximize

  • To: mathgroup at
  • Subject: [mg51996] Re: reuse values maximize
  • From: Bill Rowe <readnewsciv at>
  • Date: Sat, 6 Nov 2004 02:08:50 -0500 (EST)
  • Sender: owner-wri-mathgroup at

On 11/5/04 at 2:18 AM, a.kant at (Arne) wrote:

>I want to use the output of a maximation for further calculations.
>something like:


>Now mathematica returns {y -> -0.5}.

>I want to assign the value of -0.5 to a new variable. So far I
>haven't worked out how to do this (besides copy and paste!).

Try the following:

z = -y^2 + y
a = Maximize[z,{y}]
b = y/.Last[a]

That is the usual way to use an output formated as {y->expr} is y/.{y->expr}

Alternatively, you could directly access what you want, i.e.,


But I wouldn't use this approach since it makes the code more difficult to understand
To reply via email subtract one hundred and four

  • Prev by Date: Re: Inverse of "PowerExpand"
  • Next by Date: Re: reuse values maximize
  • Previous by thread: Re: reuse values maximize
  • Next by thread: Re: reuse values maximize