Volumes of Revolution in Python
Author: David Manuel
This video shows how to find the volume of a solid of revolution in Python. The steps to find the volume are explained: graphing the function, finding the points of intersection, and computing the integral. The integral for the volume is set up using the disk method.
Transcript 22
Transcript 22
Exercises
Python Code:
from sympy import *
x=symbols('x')
a,b=symbols('a b')
f=b/a*sqrt(a**2-x**2)
fplot=f.subs({a:3,b:4})
print(fplot)
Python Code:
matplotlib notebook
plot(fplot,(x,-3,3))
c=solve(f,x)
print(c)
Volume=integrate(pi*f**2,(x,c[0],c[1]))
print('The volume of the ellipsoid is',Volume.simplify())
Open Python Notebook File
from sympy import *
x=symbols('x')
a,b=symbols('a b')
f=b/a*sqrt(a**2-x**2)
fplot=f.subs({a:3,b:4})
print(fplot)
Python Code:
matplotlib notebook
plot(fplot,(x,-3,3))
c=solve(f,x)
print(c)
Volume=integrate(pi*f**2,(x,c[0],c[1]))
print('The volume of the ellipsoid is',Volume.simplify())
Open Python Notebook File
Related Videos (200)
Antiderivatives: MATH 171 Problems 4-6
Proving facts about antiderivatives and a physics application
Area Between Two Curves
Finding the area between two curves on an interval using a definite integral
MATH 152: Work Exercise 13
Calculating the work done pulling part of a rope to the top of a building
MATH 152: Work Exercise 8
Calculating the work done pumping water out of a tank shaped like a trough
MATH 152: Work Exercise 9
Calculating the work done pumping water out of a tank shaped like a trough
