# # MATH 3150 SUMMER 99 # PROJECT 1 # GRADIENT FLOWS # # # # This Maple project is a short aid to visualizing gradient flows. # There are just two problems. # # The Maple work sheet has a lot of extra junk in it -- namely all my # comments and explanations. # # DO NOT HAND ALL THAT IN. # # Instead, just copy over the commands you want to another worksheet # and do the problems there. Label each problem as you go, A.1 etc., # otherwise the grader may get lost and be unable to find your marks. # # We need the packages and , so we load them up now. # The commands are ended with colons instead of semicolons in order to # avoid a lot of extraneous output. > with(plots): > with(linalg): # # Heat flow driven by temperature gradients # # Recall that heat flows in the direction in which the temperature # decreases most rapidly at a rate proportional to the slope of the # temperature in that direction. If T (x,y) is the temperature,this # translates into mathematics as F = -K *grad (T ) = K*grad (-T), where # F is the heat flow field and K is the conductivity. Let us illustrate # this with some plots of the heat flow superimposed on contour plots of # the temperature. In these problems K is always equal to 1. # # Example: T(x,y) =cos(Pi*y)*sin(2*Pi*x) # # We set this up with T as an expression rather than a function because # it is a bit more convenient to do it this way in Maple. The Pi's are # in there to make it look pretty in a domain which is a 1x1 box. # > T:=cos(Pi*y)*sin(2*Pi*x); T := cos(Pi y) sin(2 Pi x) # The Maple command for grad is "grad" , with the list [x,y] denoting # the variables with respect to which the partials are taken. Notice # the - on the T. > F:=grad(-T,[x,y]); F := [-2 cos(Pi y) cos(2 Pi x) Pi, sin(Pi y) Pi sin(2 Pi x)] # We now make a contour plot of the temperature and a field plot (little # arrows) of the heat flow in a 1x1 box. We follow the commands by : # so they aren't displayed. > Tplot:=contourplot(T,x=0..1,y=0..1): > Fplot:=fieldplot(F,x=0..1,y=0..1): # Now we make the display with the two supperimposed on each other. > display([Tplot,Fplot]); # There are hot spots in the lower left and upper right and cold spots # in the upper left and lower right. Notice how the heat flows downhill # and perpindicular to the contours, although if the scales on the x and # y axis are not the same the arrows may not appear perpindicular. Also # note that the arrows on the top and bottom edges do not point across # the edges, i.e. , there is no heat flow across the edges, they are # insulated. On the other hand, the left and right edges are at 0 # degrees, so heat flows from the edges to the cold spots, and from the # hot spots to the edges. # # Question: Is T a steady state solution of the heat equation if the # temperature is held fixed on the boundaries? # (The Maple function for div is diverge.) # > diverge(F,[x,y]); 2 5 cos(Pi y) sin(2 Pi x) Pi # Answer: No, div(F) is not identically zero and consequently there a # regions with a net heat flow in or out. This causes the temperature to # change in these regions. # # OK, here are two similar problems for you to do. Do the plots on # x=0..1, y=0..1. # # # # Problem A.1 T(x,y) = sinh(Pi*y)*sin(Pi*x) # part 1. Do a field plot of the heat flow superimposed on a contour # plot of the temperature. # part 2. Is T a steady state solution of the heat equation if the # temperature on the boundaries is fixed ? # # Problem A.2 T(x,y)=cosh(Pi*y)*cos(Pi*x) # part 1. Do a field plot of the heat flow superimposed on a contour # plot of the temperature. # part 2. Is T a steady state solution of the heat equation if the # temperature on the boundaries is fixed ? # # FINIS