MathGroup Archive 2006

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

Search the Archive

Re: Tricky visualization of maximization problem


Uwe Ziegenhagen wrote:
> Hi,
> 
> I want to maximize
> 
> x1^2 + 4*x1*x2 + 3*x2^2  (eq.1)
> 
> under the constraint
> 
> x1^2 + x2^2 == 1 (eq. 2)
> 
> So far no problem, Maximize gives me 2 + sqrt(5)
> 
> But how can I display this visually?
> 
> For eq. 1 I can use Plot3D[], for eq. 2 ImplicitPlot[] but how to have
> them in one picture?
> 
> 
> Thanks in advance,
> 
> 
> Uwe
> 
DisplayTogether will plot both graphs.

eq1 = x1^2 + 4*x1*x2 + 3*x2^2;
eq2 = x1^2 + x2^2;

Maximize[{eq1, eq2 == 1}, {x1, x2}]

<< "Graphics`Graphics`"
g1 = Plot3D[eq1, {x1, -2, 2}, {x2, -2, 2}];
g2 = Plot3D[eq2, {x1, -2, 2}, {x2, -2, 2}];
DisplayTogether[g1, g2];
DisplayTogether[g1, g2, PlotRange -> All];

Regards,
Jean-Marc


  • Prev by Date: Re: Matrix Output
  • Next by Date: Lists and polynomials
  • Previous by thread: Re: Tricky visualization of maximization problem
  • Next by thread: Re: Tricky visualization of maximization problem