How to make a contourplot go through a particular point?

Probably the easiest way to explain this is to show you what I want to do. I want to draw a contourplot which shows the contour lines going through the points [0,-1] and [3/4,-7/16] (these are the expression's stationary points).  The values of f at each of these points respectively are 1 and 101/128, so I have tried to display these contours, but when the graph comes up, the contour lines don't go through the point [3/4,-7/16], although they do go through [0,-1]. The code I'm trying to use is below.

f(x,y):=x^3-3*x*y+2*y^2-3*x+4*y+3;

u:=pointplot({[0,-1],[3/4,-7/16]},symbol=asterisk,color=[red,blue]);
v:=contourplot(f(x,y),x=-2..2,y=-2..1, contours=[1,101/128], grid=[100,100],color=black );
display(u,v);
 

Thanks very much

 

acer's picture

isolated point in contour

If you use contours=[1,0.83,0.81] then does it appear to you as if the contours are shrinking to the point indicated by the contour at height 101/128 ?

Try plot3d(f,x=-2..2,y=-2..2,axes=boxed) for another visual of it. It should appear as if you are asking for the contour about the local minimum (3/4,-7/16). It's possible that contourplot is not showing the single black dot at (3/4,-7/16), which you could test by display(v) alone.

acer

related - sort of

Acer, I was wondering how you came up with the .83 and .81 so I did a 3d plot and saw a minima around .78, so I then did:
    Minimize(x^3-3*x*y+2*y^2-3*x+4*y+3, x = -.1 .. 2, y = -1.1 .. 1,location=false)
and got   [.789062499999999998], indicating that the contour line would never cross that point since it was indeed the minima.

I then redid the contourplot with [.79] eliminated the point at [0,-1], zoomed in, and observed the dot was actually surrounded by the contour line. I was wondering if there is an easier way to go about this. What I did to get from point A to B, seemed a little weird.

sorry acer -

I just read your message again, and it appears that I had actually stopped reading the first time around when I saw the .83, wondered where you had gotten that number and went directly to maple to figure it out. After writing my last message, I went back and read yours again and it occurred to me that you had pretty much already explained it. Sorry for the confusion I may have created.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
}