Bottle Design via MATLAB with Volume and Surface Area
Summary
In this activity, students design a bottle silhouette using parametric splines in MATLAB and compute its volume and surface area using numerical integration. The project connects numerical methods and computation to a tangible real-world application, helping students see how abstract mathematical tools can be applied to design and modeling.
Learning Goals
Conceptual
Students will be able to define a parametric spline to create a smooth curve.
Students will be able to use numerical integration and differentiation techniques to approximate the volume and surface area of a solid of revolution.
Computational
Students will be able to write and implement MATLAB functions that compute the volume and surface area of a spline-defined solid using $\texttt{spline}$, $\texttt{ppval}$, and $\texttt{integral}$.
Students will be able to debug and verify computational results through visualization and comparison with analytical formulas.
Higher-Order
Students will be able to connect mathematical modeling with physical design by adjusting spline-defined geometries to create 3D-printable objects.
Students will be able to validate their computational models through physical 3D printing and measurement of printed designs.
Students will be able to interpret computational results and iteratively redesign their models in response to mathematical or design constraints.
Context for Use
This activity is designed for second- and third-year undergraduates enrolled in numerical analysis, scientific computing, or applied mathematics courses. Students should have completed Calculus I and II, Linear Algebra, and an introductory programming course. The project is flexible and can be implemented in small to medium-sized classes. It fits best in the middle or later part of the semester, after students have been introduced to interpolation techniques.
Students should have prior exposure to:
- Basic MATLAB operations: navigating the environment, creating scripts, using arrays and vectors, plotting simple graphs.
- Elementary programming structures: variables, loops, functions, and conditional statements.
- Calculus background in MATLAB: evaluating functions, performing basic differentiation/integration (symbolic or numeric), and working with built-in math functions.
- Familiarity with numerical methods concepts: interpolation/approximation and numerical integration at an introductory level.
Description and Teaching Materials
The bottle activity is structured to guide students from a simple 2D sketch through the use of spline interpolation, to numerical integration, and visualization of a 3D solid.
Students begin by selecting a set of control points $(u,v)$ to represent the silhouette of a bottle, where $u$ is the radial distance and $v$ is the height. Using MATLAB's spline function, they interpolate these points to construct a smooth curve and visualize it dynamically.
The profile is then revolved around the vertical axis to create a 3D bottle surface, rendered with MATLAB's plotting tools (surf). This reinforces the geometric idea of solids of revolution, while also giving students immediate feedback on whether their design looks reasonable.
Once the bottle shape is established, students move into computation. They write a function in MATLAB to calculate the volume of revolution, parameterizing the spline by chord length and applying the integral
$V = \pi \int u(t)^2 v'(t)\,dt .$
Next, the activity extends to computing surface area, introducing the need for derivatives of both $u(t)$ and $v(t)$ and applying the corresponding formula.
$A = 2\pi \int u(t)\sqrt{(u'(t))^2 + (v'(t))^2}\,dt .$
Throughout the process, students are encouraged to perform realism and feasibility checks: are their radii always nonnegative? Does the surface close at the top and bottom? Are the computed dimensions and volume physically plausible (e.g., could this vessel hold water)? These checks reinforce both mathematical understanding and practical modeling.
Consider closing the activity with a short written reflection in which students describe their process, identify challenges they encountered, and explain how they connected MATLAB computation to the underlying mathematical concepts. Optionally, instructors may suggest 3D printing as an extension, but it is not required.
Optional Extensions: These activities are not required for completion but provide opportunities for students to extend their learning and creativity beyond the core project requirements.
- 3D Printing and Model Export: Students may export their spline-based designs to STL format for 3D printing. This optional step reinforces the connection between computational modeling and physical realization, allowing students to experience the tangible outcomes of their mathematical work.
- Iterative Redesign Challenge: Students who complete a printed model may choose to redesign their bottle to optimize for a chosen constraint (e.g., minimizing surface area for a fixed volume, or achieving aesthetic symmetry). They can compare printed results before and after redesign, reflecting on how mathematical and design trade-offs influence feasibility.
Teaching Materials: Starter MATLAB code with example data points can be found here: BottleProjectDemo.m (Matlab File 6kB Sep27 25)
More details can be found in the paper: "A Semester-Long Bottle Design Project for an Undergraduate Numerical Analysis Course" by B. Ettinger — it's listed on the Taylor & Francis site:
https://www.tandfonline.com/doi/abs/10.1080/10511970.2024.2395997
Teaching Notes and Tips
Preparation & Scaffolding
- Introduce splines and solids of revolution before starting the project to ensure students have the necessary conceptual grounding.
- Scaffold the coding into steps:
- Plot and animate the spline profile.
- Write a function to compute volume using numerical integration.
- Extend the function to compute surface area.
- Encourage students to validate their code by testing on simple, known shapes (e.g., hemisphere).
Engagement & Motivation
- Allow students creative freedom in designing bottle silhouettes. This increases buy-in and ownership of their work.
- If available, 3D printing the bottles is highly motivating. Students enjoy seeing their designs realized physically, though plots alone are sufficient.
- Some students may feel limited by the symmetry of surfaces of revolution; instructors can acknowledge this constraint but emphasize how it simplifies the mathematics and still allows for creativity.
Implementation Notes
- Works best as a semester-long project, tying together interpolation, differentiation, and integration in a tangible design challenge.
- Time management matters: large classes generate many bottles, so if 3D printing is included, consider having students help with preparation/printing rather than the instructor doing it all. This deepens learning and prevents unrealistic designs from slipping through.
- Students benefit from performing feasibility checks: e.g., ensuring nonnegative radii, plausible scaling, and reasonable volumes (could the bottle actually hold water?).
- Instructors may vary the integration approach: for example, having students implement Simpson's Rule for comparison reinforces numerical methods skills.
Assessment
Formative assessment: Providing ongoing feedback throughout the project helps students connect mathematical theory, computation, and design. These formative assessments build confidence with MATLAB tools, promote early correction of misconceptions, and lead to smoother, more aesthetically appealing, and 3D-printable bottle designs.
- In-class code checks and visualizations:
- Students generate and plot spline curves for their bottle profiles, verifying smoothness and continuity using $\texttt{spline}$ and $\texttt{ppval}$.
- Instructors provide real-time guidance on numerical integration and differentiation techniques and on interpreting intermediate computational outputs.
- Peer feedback:
- Students exchange MATLAB figures and provide comments on the realism and smoothness of curve shapes, proper axis scaling, and code clarity.
- These interactions reinforce conceptual understanding of splines and their role in modeling continuous surfaces.
- 3D Printing Feasibility Check
- Not all spline-generated bottles are immediately suitable for 3D printing, which introduces an authentic design constraint. Asking students to attempt 3D printing encourages them to evaluate the feasibility of their models and apply their understanding of spline properties to make adjustments. For instance, students learn that splines can be segmented at knots, allowing complex bottles to be printed in separate pieces and later assembled. This hands-on challenge reinforces the relationship between mathematical modeling, computational design, and physical realization.
Summative assessment: Each student submits a Bottle Design Report that demonstrates their conceptual understanding, computational skills, and capacity to connect mathematics with physical design.
MATLAB Code and Visualizations (40%)
- Functions accurately compute volume and surface area using spline-based methods ($\texttt{spline}$, $\texttt{ppval}$, $\texttt{integral}$).
- Plots show smooth, continuous, and properly scaled curves.
- Code is well-documented and clearly connects computational steps to underlying mathematical concepts.
Mathematical Interpretation (25%)
- Written explanations connect numerical integration and differentiation processes to the geometry of solids of revolution.
- Students articulate how spline approximations represent continuous surfaces and discuss possible sources of numerical error.
Validation and Redesign (25%)
- Students validate computational results through 3D printing (or comparison with printed models).
- Discrepancies between computed and physical measurements are analyzed, leading to iterative redesigns that satisfy specified constraints (e.g., fixed volume, minimized surface area).
- Reflections emphasize the relationship between modeling precision, design feasibility, and mathematical representation.
Presentation and Reflection (10%)
- Students submit a short written reflection (½–1 page) on the process of translating mathematics into computation and design. Students in past cohorts reported that the project helped bridge the gap between abstract math and applied contexts, and many expressed pride and ownership in their designs.
- Prompts may include:
- "What challenges arose in connecting your code to physical measurements?"
- "How did this project change your view of how mathematics informs design?"
- "What did you learn about iteration and precision from the redesign process?"
Rubric
| Criterion | Exemplary | Proficient | Developing | Emerging |
|---|---|---|---|---|
| Spline Construction (Conceptual) | Defines and implements parametric splines correctly; produces smooth, realistic curves with clear understanding of control points. | Minor plotting or continuity issues; spline is mostly accurate but relies on too many points rather than strategically placed ones. | Curve is loopy with self intersections. | Unable to produce a smooth spline. Curve is discontinuous or nonsensical. |
| Numerical Methods (Conceptual + Computational) | Accurately applies numerical integration and differentiation to compute volume and surface area; explains steps clearly. | Correct approach but with small computational or conceptual errors. | Partial or unclear application of methods. | Misapplies or omits numerical techniques. |
| Code Implementation (Computational) | MATLAB functions are used efficiently, well-documented, error-free, and use MATLAB's built-in functions appropriately. | Code is mostly correct but missing minor documentation or efficiency. | Code runs with errors or unclear logic. | Code is incomplete or fails to execute. |
| Validation & Redesign (Higher-Order) | Accurately compares computational and physical results; redesign effectively meets constraints and demonstrates insight. | Some validation and redesign; generally correct interpretation. | Minimal validation or unclear redesign rationale. | No validation or redesign attempted. |
| Reflection & Communication | Clearly articulates challenges, insights, and links between math, computation, and design. | General reflection with some insight. | Reflection is superficial or incomplete. | No reflection submitted or lacks relevance. |
References and Resources
Print Resources
Ettinger, B. (2024). A Semester-Long Bottle Design Project for an Undergraduate Numerical Analysis Course. PRIMUS.
Describes the semester-long version of the bottle project, including implementation details, learning goals, and assessment approaches. Provides the pedagogical foundation for this shorter workshop activity.
Burden, R. L., & Faires, J. D. (2011). Numerical Analysis (9th ed.). Brooks/Cole.
A widely used numerical analysis textbook. Relevant sections on numerical integration and interpolation provide theoretical background that supports the methods applied in this activity.
Web Resources
MATLAB Documentation on spline — https://www.mathworks.com/help/matlab/ref/spline.html
Provides official guidance and examples for creating and evaluating splines in MATLAB, which are central to modeling the bottle silhouette.
MATLAB Documentation on integral — https://www.mathworks.com/help/matlab/ref/integral.html
Explains MATLAB's numerical integration function, used by students to compute bottle volume and surface area.
MATLAB File Exchange: surf2stl — https://www.mathworks.com/matlabcentral/fileexchange/4512-surf2stl
A community-contributed function that allows exporting MATLAB surfaces as STL files for 3D printing. While optional, it offers an engaging extension for visualizing bottles physically.