Skip to main content

Approximating volume with pentagon slices!


Finding the volume enclosed by a curve using a known cross section provides an alternative to using the solid of revolution method. In this scenario, the value of the curve at a given point could act as the side length of a polygon or the radius of a hemisphere. Likewise, many other options exist for this method, and any cross section allows for the computation of volume as long as the cross section has a feasible formula. 

Every value of the function then goes into the area function of the cross section. Moreover, each cross section acts as an individual where the change in the independent variable acts as the width. Rather than finding the area under the curve, we find the volume of the sum of these cross section slices. When we have cross sections perpendicular to the x-axis we have a function of the x-variable, but when we have cross sections perpendicular to the y-axis, we have a function of the y-variable. For each slice, \(dx\) and \(dy\) act as the width of each slice respectively. We can find the exact volume of a solid that has cross sections perpendicular to the x-axis by using the following integral. 

\[V =   \int_{a}^{b} A(x) dx\]

However, we can also approximate a volume of a known cross section since we can define a finite number of slices, \(k\)! We use the following formula to approximate this volume (once again assuming that we have cross sections perpendicular to the x-axis.) Each slice has width \(\Delta  x\) which we can easily find by dividing the length of our interval \(b - a\) by \(k\).

\[V \approx  \sum_{n=1}^{k} A(x_n) \Delta    x  \]

I chose to use the following function:

\[f(x) = \sqrt[]{1- x ^2}\]

My function only exists on the interval between -1 and 1. 


Likewise, in my case, I chose to use regular pentagons that sit perpendicular to the x-axis.

Below I give the area of a pentagon:

\[A = \frac{1}{4}  \sqrt[]{5(5+2 \sqrt[]{5})} s ^2 \]

In the above formula, \(s\) acts as the side length of the regular pentagon. This means that every value of \(f(x)\) acts as this side length \(s\). Since we have a function of x, \(dx\) will act as the width of each slice.

I can just insert my function literally into the area formula to create the area function \(A(x)\) which we then integrate (or sum) with respect to x. 

\[A(x) = \frac{1}{4}  \sqrt[]{5(5+2 \sqrt[]{5})} \sqrt[]{1- x ^2} ^2 \]

However, we can simplify this since we have a square root, squared. 

\[A(x) = \frac{1}{4}  \sqrt[]{5(5+2 \sqrt[]{5})} (1- x ^2)\]

To find the exact volume of the cross sections over our whole interval, we use the following definite integral.

\[V =   \int_{-1}^{1}  \frac{1}{4}  \sqrt[]{5(5+2 \sqrt[]{5})} (1- x ^2) dx     = 2.2939\]

We can also plot the exact volume of each slice at a given point, with width of  \(dx\)!



But, I also choose to approximate this using 10 slices over our whole interval. This means that \(\displaystyle \Delta  x = \frac{(1-(-1)}{10}  = \frac{1}{5}\)

Our approximation has the following form. 
\[V \approx  \sum_{k=1}^{10}  \frac{1}{4}  \sqrt[]{5(5+2 \sqrt[]{5})}(1 - x_k ^2) \Delta    x  \]

Below I give a table of the volume of each slice. Our top and bottom slice have a volume of 0, so we only have 8 real slices to work with, and we do not have a great approximation given that we have an error of about 0.3 cubic units. 




I used the following Python code to do my calculations for me, and to create the plots shown here. 
import math
import matplotlib.pyplot as plt
import numpy as np

def integrate(X, dx, do_print=False):
    _sum = []
    append = _sum.append
    for i,x in enumerate(X):
        if do_print:
            print(F"\tSection {i} has a sidelength of {round(x,4)} and area {round((x**2) * dx*2*pentagon_coeff,4)}")
            print(F"\tSection {i} has a volume of: {round((x**2) * dx*2*pentagon_coeff,4)}")
            print(F"\t{'-'*70}")
        append((x**2) * dx)
    if do_print:
        print(F"\tThe total volume is: {round(sum(_sum)*2*pentagon_coeff,4)}")
    return sum(_sum), _sum
pentagon_coeff = 0.25*math.sqrt(5*(5+2*math.sqrt(5)))
domain = np.linspace(-1, 1, 100000)
_range = np.array([math.sqrt(1-x**2) for x in domain ])
chopped_domain = np.linspace(-1,1, 10)
chopped_range = np.array([math.sqrt(1-x**2) for x in chopped_domain ])
true_sum, true_array = integrate(_range,1/100000)
true_sum = true_sum*2*pentagon_coeff
true_array =np.array(true_array)*2*pentagon_coeff
print()
_sum, __sum = integrate(chopped_range, 1/10, True)
print(F"\t{'-'*70}")
print(F"\tWe have a true volume of {round(true_sum, 4)}\n")
plt.plot(domain, _range)
plt.title("Line To Integrate")
plt.savefig("True_line.png", dpi = 200)
plt.show()
plt.plot(domain, true_array)
plt.title("True Volume Plot")
plt.savefig("True_Volume.png", dpi = 200)
plt.show()



















Comments

Popular posts from this blog

Do Over: Integration Over a Region in a Plane

Throughout the semester we have covered a variety of topics and how their mathematical orientation applies to real world scenarios. One topic we discussed, and I would like to revisit, is integration over a region in a plane which involves calculating a double integral. Integrating functions of two variables allows us to calculate the volume under the function in a 3D space. You can see a more in depth description and my previous example in my blog post, https://ukyma391.blogspot.com/2021/09/integration-for-over-regions-in-plane_27.html . I want to revisit this topic because in my previous attempt my volume calculations were incorrect, and my print lacked structural stability. I believed this print and calculation was the topic I could most improve on and wanted to give it another chance. What needed Improvement? The function used previously was f(x) = cos(xy) bounded on [-3,3] x [-1,3]. After solving for the estimated and actual volume, it was difficult to represent in a print...

Knot 9-31

Knot 9-31 A knot is mathematics is defined as a closed, non-self-intersecting curve that is placed in three dimensions and cannot be the "unknot". The main difference between a knot in the real world and a known in mathematics is that a knot in mathematics does not contain any extra strands. The example following will help visualize this. Today, I have specifically chosen knot 9-31 from the Knot Atlas. This knot is very unique and contains some very interesting properties that we are going to look into. The Crossing Number For my knot today, I chose knot 9-31 from the Knot Atlas. This knot contains 9 crossings! The Unknotting Number The unknotting number is exactly what is sounds like. This is the minimum number of times the knot must be passed through itself to untie it. Luckily, the Knot Atlas is super useful and provides the unknotting number for us, but I still...

Do Over: Integration for Over Regions in the Plane

Introduction Earlier in the semester, we visited the topic of integration for over region regions in the plane. This was our first experience with taking integration in the third dimension. To do this, we had to use double integrals to calculate the volume of a region between two surfaces. This topic seems relatively straightforward and anyone who has taken a higher calculus class knows of double integrals. Today, we are going to revisit this topic for a couple of reasons. Why Double Integrals Again? As mentioned before, I am revisiting this topic for a couple of reasons. One of the main reasons is due to how the 3D print turned out. Due to the function, I chose, the final rectangular prism was stand alone. When printing, this resulted in a sloppy prism that lacked structural integrity. The image below is a reference to my original design that includes the prism that had the issue. The main cause of ...