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...

Minimal Surfaces

Minimum surfaces can be described in many equivalent ways. Today, we are going to focus on minimum surfaces by defining it using curvature. A surface is a minimum surface if and only if the mean curvature at every point is zero. This means that every point on the surface is a saddle point with equal and opposite curvature allowing the smallest surface area possible to form. Curvature helps define a minimal surface by looking at the normal vector. For a surface in R 3 , there is a tangent plane at each point. At each point in the surface, there is a normal vector perpendicular to the tangent plane. Then, we can intersect any plane that contains the normal vector with the surface to get a curve. Therefore, the mean curvature of a surface is defined by the following equation. Where theta is an angle from a starting plane that contains the normal vector. For this week’s project, we will be demonstrating minimum surfaces with a frame and soap bubbles! How It Works Minimum surfac...

Do Over: Ruled Surfaces

Why to choose this project to repeat For the do over project, I would like to choose the ruled surfaces. I don't think my last project was creative, and the 3D printed effect was not very satisfactory. In the previous attempts, all the lines are connected between a straight line and a circle. This connection structure is relatively uncomplicated. The printed model has too many lines, resulting in too dense line arrangement. The gaps between lines are too small, and the final effect is that all the lines are connected into a curved surface, which is far from the effect I expected. What to be improved In this do over project, I would like to improve in two aspects. Firstly, a different ruled surface is chosen. In the previous model, one curve is a unit circle on the \(x-y\) plane, and the ruled surface is a right circular conoid. In this do over project, it is replaced by two border lines. Each borderline is in the shape of an isosceles right triangl...