Re: Tricky visualization of maximization problem
- To: mathgroup at smc.vnet.net
- Subject: [mg71021] Re: Tricky visualization of maximization problem
- From: "Steve Luttrell" <steve_usenet at _removemefirst_luttrell.org.uk>
- Date: Sat, 4 Nov 2006 23:07:20 -0500 (EST)
- References: <eihm95$ov4$1@smc.vnet.net>
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 >