Tuesday, November 22, 2016

Double Integrals over Rectangular Regions


Double Integrals over Rectangular Regions



Section 13.1Double Integrals over Rectangular Regions

Note: Section number refers to Calculus, Early Transcedentals (2nd edition) by Briggs, Cochran, and Gillett.





These 3D prints illustrate the concept of Riemann sums used for calculating volumes of solids. As the number of rectangles are increased, we get a better and better approximation of the double integral.





The double integral approximation for the function:
                                               
is demonstrated below. It is the Gaussian curve in 3 dimensions, generated using 100, 225, and 400 rectangular prisms, respectively on the interval [-2,2.5] x [-2,2]. The Mathematica code used to generate these models was based on Raouf Boules', Geoff Goodson's, Ohoe Kim's and Mike O'Leary's Calculus III Lab at Towson University, found here.

The integral approximator (code provided below) takes a function f on an interval [a1,b1]x[a2,b2] with n discretization points in both the x and y directions, therefore approximating the area under the function with n^2 rectangular prisms (cuboids in Mathematica). Just like in the 1-dimensional integral approximation methods, 
   
The x and y coordinates of the jth and kth rectangle are thus given by, 






Technical Details for Printing:


In Mathematica, Cuboid[{lower corner (x,y,z), upper corner (x,y,z)]. Here the lower corner is given by (x_j, y_k, 0), and the upper corner (x(j+1), y_(k+1), f(x_j, y_k)).
Mathematica code:

RD[f, {a1, b1}, {a2, b2}, n] := Show[Table[Graphics3D[Cuboid[{a1 + (b1 - a1)/nj, a2 + (b2 - a2)/nk, 0},

{a1 + (b1 - a1)/n(j + 1), a2 + (b2 - a2)/n(k + 1),f[a1 + (b1 - a1)/nj, a2 + (b2 - a2)/nk]}]], {j, 0, n - 1}, {k,0, n - 1}]]

Clear[f, x, y]

f[x, y] := 2*Exp[-x^2 - y^2]

print1 = RD[f, {-2, 2.5}, {-2, 2}, 10]

Export["filename.stl",print1]

In the figure below, from left to right, we have n=10, 15, 20 and 50.





This code was created by Mae Markowski, in Mathematics through 3D Printing, taught by Dr. Evelyn Sander in Spring 2016, and printed at the Math Makerlab, GMU. 

2 comments: