

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Problem set 2 for math 241, focusing on matlab implementation of calculus concepts. The problems involve plotting curves and surfaces, calculating speeds and curvatures, and identifying critical points and level curves.
Typology: Assignments
1 / 3
This page cannot be seen from the preview
Don't miss anything!


MATLAB Problem Set 2
Problems 2,3,4,5 are based on material in chapters 5 and 8 of the MATLAB Companion. Print out the plots of each part of the following problems to hand in. If you wish to economize on the amount of paper, you may use the command subplot (page 93 of the MATLAB Companion). Make a short Mfile for each problem that contains all the commands that you used to make your plots. Use the command diary and the command type to print out the Mfile. See the end of Chapter 2 of the MATLAB Companion. It is on my webpage at www.math.umd.edu/~jec. For each problem, hand in the printout of the Mfile and attach the plots.
r(t) = ((cos t)^3 , (sin t)^3 ), 0 ≤ t ≤ 2 π.
This is an example of a piecewise smooth curve. a) Plot the curve. Does it have cusps? b) Calculate the speed ‖v(t)‖ = ‖r′(t)‖ by hand. Then graph it on the interval [0, 2 π]. Where is the speed equal to zero? Does this agree with the values of t where the plot in part a) has a cusp? c) Calculate the curvature by hand. In two dimensions, the formula becomes
κ =
|x′′y′^ − y′′x′| ‖v‖^3
For what values of t does κ blow up? Is this what you expect from your graph in part a)? Why?
g(x, y) = 2e−(x−1)
(^2) −(y−1) 2
(^2) − 3 y 2 − e−2(x−1)
(^2) −3(y+.5) 2 .
The formula is too long for an inline function, so it is best to write an Mfile, g.m, for this function. Make it “array smart”. a) Graph g over the same square D used in problem 1. Here you should construct the meshgrid as in Example 5.2 and the command surf. b) To see the contours in the xy plane, use the contour command as in Example 5.5 with 20 contour lines. Use this contour plot to estimate the coordinates of the the two peaks, the bottom of the valley, and the saddle point.
u(x, y) = (− 4 x^3 + 3x^2 + 1)(y − y^2 ).
Make sure it is “array smart”. The function u is the temperature at a point (x, y) in the unit square Q = { 0 ≤ x ≤ 1 , 0 ≤ y ≤ 1 }. The heat flux at each point is the negative of the gradient vector −∇u(x, y) = −[ux(x, y), uy(x, y)]. a) Verify by hand that ux(0, y) = 0 for 0 ≤ y ≤ 1 and that u = 0 on the other three edges of the square. This means that the left edge of the square is insulated, and that the temperature is held at zero on the other three edges. b) Put a 20 by 20 meshgrid on Q. Graph u over Q using the command surf(X,Y,u(X,Y)). Note where the temperature is greatest, and the appearance of the surface on the edge x = 0. c) Compute the gradient of u by hand. Write inline functions for ux and uy. Then enter the commands
U = u(X,Y); Ux = ux(X,Y); Uy = uy(X,Y); contour(X,Y,U,20) hold on quiver(X,Y,-Ux,-Uy)
The last command attaches arrows at each point of the meshgrid to represent the vector field of the heat flux. d) Use the plot of part c) to answer the following questions. What is the direction of the heat flux with respect to the level curves? Where is the hot spot, and which way is the heat flowing? What is the angle at which the level curves meet the edge x = 0? What is the direction of the heat flux at that edge of the square? How do you explain this physically? Why are the flux vectors perpendicular to the other edges?