MathGroup Archive 2006

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

Search the Archive

Re: Tricky visualization of maximization problem


This plots the 3D surface:

g1=Plot3D[x1^2+4*x1*x2+3*x2^2,{x1,-1,1},{x2,-1,1}];

This plots the constraint on the surface:

eps=0.03;
g2=ParametricPlot3D[
      Evaluate[{x1,x2,
            x1^2+4*x1*x2+3*x2^2+eps,{Thickness[eps],Red}}/.Solve[
              x1^2+x2^2\[Equal]1,x2][[1]]],{x1,-1,1}];

This displays the plots together:

Show[g1,g2];

Perhaps this is a better orientation to view it from:

Show[g1,g2,ViewPoint->{1.148, 2.752, 1.600}];

Note how the eps parameter is used to slightly displace the constraint curve 
so that it it is not obscured by the surface.

Steve Luttrell
West Malvern, UK

"Uwe Ziegenhagen" <newsgroup at ziegenhagen.info> wrote in message 
news:eihm95$ov4$1 at smc.vnet.net...
> 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
> 



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