Department of Mathematics

Math 300: Mathematical Computing

Assignment C

Your assignment is to find the volume of a wine fermentation tank made by Sonoma Stone. When converted to the metric system (because wine bottles have a volume of 750 milliliters), the boundary of the central cross section of the interior of the tank is very nearly \begin{equation}0.0002017404542x^2+ \label{eq:egg} \frac{0.0001303290910y^2}{0.9520444748+\alpha y} = 1. \end{equation} All distances are measured in centimeters. In other words, the interior of the tank is interior of the surface described by rotating that curve about the y axis. The volume of that region can be found as an integral. I.e. we are evaluating an integral to find the volume of the interior of a surface of rotation. For the real tank, α0.005.

  1. Create a Python/Sympy script to evaluate the volume for any value of α between 0 and 0.02. Comment the file liberally.

  2. Figure 1
  3. Find a way in your script to plot the cross section of the tank when α=0.005. A sample appears in Figure 1.
  4. Plot the value of the volume of the tank for values of α between 0 and 0.02.
  5. Write a LaTeX document describing how to find the volume of the tank. Remember that this is a mathematical discussion - you will use mathematical notation to describe the process - not computer or Python notation. Moreover, the instructor has no interest in a description of the computational steps in finding the volume - he wants to know how you solved mathematically for the various components of the integral. Obviously, your document will include some astute observations about the way that the volume depends on α, and so on.
  6. Make sure to tell how many bottles of wine one expects to get out of the tank when α=0.005. Do not try to include the solution for all values of α, unless it were in an appendix.
  7. Make sure to include the pictures of the cross-section of the tank that you created, as well as the one for variation of volume with α.
  8. You are likely at some point to want to solve for \(x\) or \(y\). Recall that you can do that in Sympy using e.g. solve(expression,x). That solves the equation expression=0 for the variable x.

This assignment is worth 60 points and is due at 9 AM on Monday, 10 December. It is turned in when a message containing four attachments appears in the instructor's email inbox. The attachments are a) the Python .py file; b) the .tex file; and c) the image for your cross section; and d) the image of volume as a function of alpha. These files are all small - do not archive or compress them.

Hint: Sometimes people experience the following terrifying error.

 sympy.polys.polyerrors.CoercionFailed: can't convert DMP([1, 0], ZZ, ZZ[_b1]) of type ZZ[_b1] to RR
This seems to indicate that Sympy has tried to evaluate the integral in the complex plane, and failed. There are a couple of ways to fix this, but perhaps the simplest is to make a little function that evaluates the integrand:
def integrand(t):
  return e.g. x value in terms of y
Then use the numerical integration function from Sympy to evaluate the integral.
volume = sp.mpmath.quad(integrand,(lower_limit,upper_limit))
Your variables may differ...

Assignment C is posted.

The test solution is available.

Department of Mathematics, PO Box 643113, Neill Hall 103, Washington State University, Pullman WA 99164-3113, 509-335-3926, Contact Us
Copyright © 1996-2015 Kevin Cooper