
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

MATH 340 Sec. 0101
You may work in groups of up to three people. Each group must submit a single printed solution. Solutions must contain your relevant MATLAB input and output (do not include commands that didnāt work), and text that indicates what your commands are doing and interprets your results. (You may find one of the following commands useful in preparing your solutions: publish, notebook, or diary; see MATLABās online help for details.) Organization and clarity count.
................................................................................................. The MATLAB command dblquad numerically approximates a double integral over a rectangle. Simi- larly, triplequad approximates a triple integral over a box. In this assignment, weāll use these commands on integrals for which we know the correct answer, in order to assess their accuracy. In particular, for re- gions of integration that are not rectangular, weāll compare two approaches for numerical integration: one is to define the function to be zero outside the region of integration (like in the definition of double and triple integrals by Riemann sums), and the other is to make a change of coordinates so that the region of integration is rectangular in the new coordinates.
(a) Find the double integral of x^2 over the unit disk x^2 + y^2 ⤠1 in R^2 by writing it as an it- erated integral and using the MATLAB command int. Compare this exact answer with the approximate answers found by dblquad, first using rectangular coordinates and then using polar coordinates. To do the integral in rectangular coordinates, use a command similar to last sample command in the the last example in the online help for dblquad. Then rewrite the integral in polar coordinates and use dblquad to approximate that integral. In each case, observe how long it takes the command to run and how accurate the answer is. How does the accuracy compare to the intended error tolerance of 10 ā^6? (b) Now use triplequad to approximate the volume of the unit ball x^2 + y^2 + z^2 ⤠1 in R^3 , using both rectangular and spherical coordinates. In each case, adjust the error tolerance (see the online help) in order to see how many digits of accuracy you can get using at most 60 seconds of computation time. (c) Based on your results, discuss the relative merits of the two approaches to numerical integration over a nonrectangular region. Why do the two approaches produce such different results?
Fall 2008 1 B. Hunt