MathGroup Archive 2004

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

Search the Archive

Re: reuse values maximize

  • To: mathgroup at smc.vnet.net
  • Subject: [mg51969] Re: [mg51947] reuse values maximize
  • From: DrBob <drbob at bigfoot.com>
  • Date: Sat, 6 Nov 2004 02:07:30 -0500 (EST)
  • References: <200411050718.CAA06954@smc.vnet.net>
  • Reply-to: drbob at bigfoot.com
  • Sender: owner-wri-mathgroup at wolfram.com

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

{1/4, {y -> 1/2}}
1/2

or

b = y /. Last[Maximize[z[y], {y}]]

1/2

or

b = y /. Last[Maximize[y - y^2, {y}]]
1/2

Bobby

On Fri, 5 Nov 2004 02:18:55 -0500 (EST), Arne <a.kant at web.de> wrote:

> Sorry, very simple question, but I really can't work it out...
>
> I want to use the output of a maximation for further calculations.
> something like:
>
> z[y_]=-y^2+y
> a=Maximize[z,{y}]
> b=Extract[a,1]
>
> 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!).
>
> Thanks for any comment.
>
>
>
>



-- 
DrBob at bigfoot.com
www.eclecticdreams.net


  • Prev by Date: Re: reuse values maximize
  • Next by Date: Re: ListContourPlot - different levels
  • Previous by thread: reuse values maximize
  • Next by thread: Re: reuse values maximize