Problem 1: Volume of a Cut Hemisphere
Consider a solid hemisphere whose base is the circular disk with radius 3. The parallel cross-sections (perpendicular to the base) are half circles, with the diameter lying along the base of the hemisphere. (FYI: The 3-D figures in this team lab were created in Maple: TeamLabPlotFigures.mw)
We will first use MATLAB to find the volume of the hemisphere from x = −3 to any value of t for several values of t. Notice that the base of the hemisphere is given by the equation: x2 + y2 ≤ 32 and that in this problem t is any point along the x-axis from −3 to 3. The following steps will lead you through the process:
Define a function named areaCutHemisphere(t) that computes the cross-sectional area of the hemisphere defined above at a given value t, where t is any value within the x-range of the hemisphere, x=−3..3. The area you need to calculate is the open part of the cut shown in the figure above. In other words, what is the cross-sectional area of the hemisphere at x = t? Does your area function give the correct value for t=0? for t=3?
VERIFY WITH A LAB LEADER that your areaCutHemisphere(t) computes the correct results for t=0 and t=3
Use the MATLAB function integral(...) to compute the volume of the entire hemisphere using your areaCutHemisphere function. The volume of the hemisphere equals the integral of the cross sectional area of the hemisphere from x = −3 to 3.
Note that when you pass a function (for example a function named integrand) as a parameter to the integral function you need to put an @ symbol in front of it, e.g., integral(@integrand, a, b). The @ symbol creates a function handle which indicates to MATLAB that this is the name of a function (as opposed to the name of a matrix or scalar value).
Compute the volume for the cut hemisphere over the range x = −3 to 0. What portion of the sphere is this? To check your answer, calculate the volume of a whole sphere. Note: Volume of a sphere = (4/3)πr3, where r is the radius of the sphere.
Now define a function named volumeCutHemisphere that computes the volume of the cut hemisphere over the range x = −3 to t for any t between −3 and 3.
Find the value of t so that the volume of the cut-off hemisphere is equal to 20. Since there is no "find20" function in MATLAB, you will need to find t where volumeCutHemisphere(t)-20 equals zero. We find where an expression equals zero using MATLAB's fzero function. In this problem, we want to find the value of x such that volumeCutHemisphere(x)=20. If we find x when volumeCutHemisphere(x)-20=0, we will find the cut off point (x) that will give us a volume of 20.
There are two ways to do this in MATLAB,
Option 1: define a separate MATLAB function named toBeZeroCutHemisphere20 that calculates the expression volumeCutHemisphere(x)-20. Then, call fzero(@toBeZeroCutHemisphere20, guess)
Option 2: "in-line" the function that calculates volumeCutHemisphere(x)-20 by calling fzero(@(x)volumeCutHemisphere(x)-20, guess) (in this situation, what you are technically creating is called an anonymous function).
For both options guess is your initial guess to find where your expression equals 0. (Hint: use your answers from 1.b and 1.c to come up with an initial guess.)
Is your answer reasonable for the value of t that causes the volume of the cut hemisphere to equal 20? Test this value by plugging it back in to the volumeCutHemisphere function. The Additional Problem shows you how to include constants for values like 20 instead of having to write a separate function for each new volume problem.
VERIFY YOUR ANSWER WITH A LAB LEADER
Problem 2: Volume of a Solid of Revolution
The equation (x − 2)2 + y2 = 1 defines a circle of radius 1 whose center is at (2, 0). Suppose we revolve this circle around the y-axis. The shape we get is called a torus (aka doughnut). The torus and the circle are shown below:
|
|
In this problem we want to find out where to cut off the torus perpendicular to the x-axis so that the volume of the cut torus is half the volume of the entire torus.
Define a function that computes the cross-sectional area of the specified torus for any value t in the valid range of x. The area you need to compute is colored blue (the outside "cylinder" of surface area) in the plot shown below. Name your function areaCutTorus(t). Test your function. It should return a value of zero for t = 1 and t = 3. Why? For t = 2 the area should be 8π.
What is the integral that calculates the volume as x ranges from 1 to an arbitrary value t as shown in the figure above? Use integral(...) and your areaCutTorus function to compute the volume for t = 2. What is the volume for t = 3? (It should be 4π2 for t = 3.)
Define a function, called volumeCutTorus that computes the volume of the cut-off torus as a function of t. What is the volume for t = 1? For t = 2? For t = 3? Compare your results to what you got in part b.
Find the value of t so that the volume of the cut-off torus is equal to half the volume of the entire torus.
VERIFY YOUR ANSWER WITH A LAB LEADER
Problem 3: Slicing the Torus Another Way
Repeat problem 2, but this time, but instead of cutting the torus perpendicular to the x-axis, cut perpendicular to the y-axis above and below the axis. The volume is the result of rotating the section shown in the figure on the left around the y-axis. Find the value of y so that the volume is 20. The area you need to compute is that shown in yellow (the top surface) in the plot on the right. (Hint: solve the equation for x instead of y.) What is the range for y?
![]() |
![]() |
For an additional challenge / additional practice, define anonymous functions instead of creating separate function files (like was used in 1.e Option 2). For example, instead of defining a separate areaSlice function representing the area of the yellow surface at y = t, define an anonymous function and name it areaSlice:
areaSlice = @(t) %code for computing cross-sectional area at y=t
VERIFY YOUR ANSWER WITH A LAB LEADER
A more general form for using fzero (and integral)
Suppose that you wish to define a function that returns where along the x-axis to cut a hemisphere of a given radius, r, (similar to problem 1), such that the volume after cutting the hemisphere at t, will be equal to a second specified argument to your function. The header and comments might look like this:
function t = findTforCutHemisphereWithVolume(radius, volume) % radius is the radius of the hemisphere % volume is the desired volume after cutting the hemisphere at t % t is the point along the x-axis to cut the hemisphere % such that the volume will be equal to the given volume
To solve this problem:
These parameters will replace 3 as the radius and 20 as the volume in the respective function definitions.
Once these modifications have been made, complete the definition of your findTforCutHemisphereWithVolume function by using fzero as follows:
t = fzero( @(x)toBeZeroCutHemisphere(x, radius, volume) , radius/2);
Finally, use your findTforCutHemisphereWithVolume to find the values of x needed for a volume of 15 for a sphere of radius 3 and a volume of 25 for a sphere of radius 5.