Fubini's Theorem asserts that for a function f(x,y) the volume under the surface which is bounded by a region [a,b]×[c,d] can be found either by first integrating with respect to y, or with respect to x. In either case, the other variable is treated like a constant.
This means that if we make the bounds of y between c and d, and the bounds of x between a and b, then the two following integrals are equivalent!
∫dc∫baf(x,y)dxdy
∫ba∫dcf(x,y)dydx
This really only works easily for continuous functions. The fact that we can integrate x and y (or any collection of independent variables) in any order is surprisingly fundamental to quantum chemistry. For the three-dimensional wavefunction for electronic orbitals for a molecule, to determine the electronic surface, each electron is given a volume integral over the whole space, for each spin. If we couldn't integrate freely in any direction, matter as we know it wouldn't exist!
Here, Ψ1 represents wavefunctions for electrons with spin 1 and Ψ2 represents electrons with spin 2, s represents energetic states, and r represents a basis set of functions for each particle in an N particle system.
(Ψ1,Ψ2)=∑sN…∑s2∑s1∭Vr1dxdydz…∭VrNdxdydz
Additionally, a region can also be bounded by functions of a certain variable. For instance, we could force the bounds of y to be g(x) and h(x) to yield the integral below:
∫ba∫h(x)g(x)f(x,y)dydx
However, for the purpose of brevity, I choose to enclose my function in a rectangular region. I was thinking about how much I liked egg cartons, but how I hated eggs. Likewise, I didn't want to do anything as high flying and complicated as a wavefunction, though it would have been fun. So, I decided to make a surface which looked like an egg carton. Below I give my surface, which I created with Geogebra.
I chose f(x,y)=3cos(x)−4cos(y) and bound x and y between [0,4] and [0,4] respectively since it roughly captured the geometry of an egg carton.
I can find the volume under this region with the following integral:
V=∫40∫403cos(x)−4cos(y)dxdy
V=∫403sin(x)−4xcos(y)|40dy
V=∫403sin(4)−16cos(y)dy
V=(3ysin(4)−16sin(y)|40
V=(3∗4sin(4)−16sin(4)
V=−4sin(4)≈3.027
My approximation had a high error, and the computed volume was V≈4.8u3. I believe this was due to the high step size, and that integrating over a more dense grid would solve this problem.
To make a model of this surface, I divided the region into 20 squares and found the righthand endpoints. My model spanned 4 inches in both the x and y directions, and spanned almost 11 inches from top to bottom due to the height of the wave in the positive and negative z direction.
Once again, I used Python to calculate the how f(x,y) changed over the region with my chosen subdivision. I give the output of this code below, as written to a CSV file, made from a Pandas DataFrame.
My code only spans 20 lines, so I supply it as an image, rather than an interactable widget.
Comments
Post a Comment