Double Integral Approximation by FormulaJockey 3d model
3dmdb logo
Thingiverse
Double Integral Approximation by FormulaJockey

Double Integral Approximation by FormulaJockey

by Thingiverse
Last crawled date: 3 years ago
This was made at George Mason University for Math493: Mathematics Through 3D Printing, taught by Dr. Evelyn Sander.
Gives the double integral approximation for the function f(x,y) = 2*e^(-x^2-y^2), the Gaussian curve in 3 dimensions, 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: http://www2.stetson.edu/~wmiles/coursedocs/Fall_05/MS_203/calc3labs/Calculus%20III%20-%20Lab%209.htm.
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, deltaX = (b1-a1)/n and deltaY = (b2-a2)/n. The x and y coordinates of the jth and kth rectangle are thus given by x_j = a1+deltaXj and y_k = a2+deltaYk.
In Mathematica, Cuboid[{lower corner (x,y,z), upper corner (x,y,z)]. Here the lower corner is given by (x_j, yk, 0), and the upper corner (x(j+1), y_(k+1), f(x_j, y_k)).
Suggestions: try playing around with the function, and changing the number of rectangles used.
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]

Tags