# chap1 - Chapter 1 Solutions Exercise 1.1 f x y = x a level...

This preview shows pages 1–5. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Chapter 1 Solutions Exercise 1.1 f ( x, y ) = x : a level curve f ( x, y ) = constant is a vertical line x = c . Curves for c = − 1 , , 1 / 2 , 3 and 4 are graphed below:-2-1.5-1-0.5 0.5 1 1.5 2-1 1 2 3 4 y x Level sets x=c for c=-1,0,1/2,3, and 4 c=-1 c=0 c=1/2 c=3 c=4 Here is a surface plot of graph( f ): z=x-2-1.5-1-0.5 0.5 1 1.5 2 x-2-1.5-1-0.5 0.5 1 1.5 2 y-2-1.5-1-0.5 0.5 1 1.5 2 z The Matlab m-file used for this problem is % level sets and graph(f) for f: (x,y)-->x clear clf x=-2:0.1:2; y=x; % level curves f(x,y)=c for c=-1.0,1/2,3,4 c=[-1,0,0.5,3,4]; % generate level curves all at once xx=c’*ones(size(x)); plot(xx,y,’k’); % put in axes, curve labels and title xlabel(’x’), ylabel(’y’) text(-0.9,0.25,’c=-1’) text(-0.25,-0.25,’c=0’) text(0.2,0.25,’c=1/2’) text(2.75,-0.25,’c=3’) text(3.75,0.25,’c=4’) title(’Level sets x=c for c=-1,0,1/2,3, and 4’) print -deps contour1.eps % print plot to .eps file pause % hit a key to continue close % close plot % surface plot of the graph of f [X,Y]=meshgrid(x,y); mesh(X,Y,X) % plot labels and title xlabel(’x’), ylabel(’y’), zlabel(’z’) title(’z=x’) print -deps surface1.eps pause close 2 Exercise 1.3 f ( x, y ) = x 2 − y 2 : a level curve f ( x, y ) = constant is a hyperbola x 2 − y 2 = c if c negationslash = 0. Vertices are on the y-axis if c < 0 and on the x-axis if c > 0. If c = 0 the level curve is the graph of the equation | x | = | y | , that is, the set of all points for which y = ± x .-2-1 .5-1-0 .5 0 .5 1 1 .5 2-2-1 1 2 y x x 2- y 2 = c f o r c = - 1 , 0 , 1 / 2 , 3 , 4 c = - 1 c = - 1 c = 0 c = 0 c = 1 / 2 c = 1 / 2 c = 3 c = 3 c = 4 c = 4 A surface plot of graph( f ): z = x 2- y 2-2-1 .5-1-0 .5 0 .5 1 1 .5 2 x-2-1 .5-1-0 .5 0 .5 1 1 .5 2 y-4-3-2-1 1 2 3 4 z 3 The Matlab m-file used for this problem is: % level sets and graph(f) for f: (x,y)-->x^2-y^2 clear clf x=-2:0.1:2; y=-2:0.1:2; % level curves f(x,y)=c for c=-1.0,1/2,3,4 % superimpose level curves hold on % label x & y axes and give plot a title xlabel(’x’) ylabel(’y’) title(’x^2-y^2=c for c=-1,0,1/2,3,4’) % c=-1 plot(x,[sqrt(x.^2+1); -sqrt(x.^2+1)],’k’); text(-1.25,1.8,’c=-1’) text(-1.25,-1.8,’c=-1’) % c=0 plot(x,[x;-x],’k’) text(-0.35,0.55,’c=0’) text(-0.35,-0.55,’c=0’)text(-0....
View Full Document

{[ snackBarMessage ]}

### Page1 / 15

chap1 - Chapter 1 Solutions Exercise 1.1 f x y = x a level...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online