Volume-calculating function in Mathematica

Click For Summary
SUMMARY

The discussion centers on creating a volume-calculating function, MyContainer[R, L, l, H], in Mathematica for a container shaped like a cylinder with cones on both ends. The function must compute the fluid capacity based on the filling height H, regardless of the linear dimensions R, L, and l. The user initially struggles with integrating to find the volumes and setting the correct limits for the integrals, particularly for the cone volumes, but recognizes that the cylinder volume does not require integration. A graph depicting the relationship between filling height H and filling volume v is also required.

PREREQUISITES
  • Understanding of volume integration in calculus
  • Familiarity with Mathematica programming language
  • Knowledge of geometric shapes, specifically cylinders and cones
  • Ability to create graphs in Mathematica
NEXT STEPS
  • Learn how to define functions in Mathematica
  • Study integration techniques for calculating volumes of composite shapes
  • Explore Mathematica's graphing capabilities for visualizing functions
  • Review examples of similar volume calculations in Mathematica
USEFUL FOR

Students in mathematics or engineering courses, particularly those working on fluid dynamics or geometric volume calculations using Mathematica.

alariv8
Messages
10
Reaction score
0

Homework Statement


Create a function MyContainer[R, L, l, H] in the program 'Mathematica' to determine the capacity of fluid in the container according to the given filling height H. The container is a cyclinder with cones on both sides.

The arguments of the function MyContainer[R, L, l, H] have to be changeable. The function has to have the property of being able to calculate the volume, irrespective of the values of the linear dimensions ( R,L,l).

Create a graph that depicts the filling height (H) dependence of the filling volume (v).

image002.gif


I really appreciate the help, I need to get started with this assignment, but I am not sure how. I am not very crafty at using Mathematica, it is one of the course homeworks that everybody has to submit.

Great thanks!



The Attempt at a Solution




All I know is that I have to integrate to find the volumes, but I don't know how to write down the equations and the limits of the integrals.
 

Attachments

  • image002.gif
    image002.gif
    1.8 KB · Views: 582
Last edited:
Physics news on Phys.org
Firstly, I tried to calculate the volumes of the cones, the cylinder volume is easy (no integration needed?).

I tried the following expression:

Integrate[2 [l/R] Sqrt[x^2 + z^2], {x, 0, R}, {z, -Sqrt[R^2 - x^2], Sqrt[R^2 - x^2]}, {y, Sqrt[x^2 + z^2], l}, Reals]
Simplify[%]

But unfortunately, Mathematica doesn't give any sensible result for this integral. The professor saw this effort and promised to show his own solution, hopefully I will get it solved, eventually.
 
Last edited:
Okay, I think I got it already, the cone stuff is relatively easy. It was all about the limits of the integrals, I needed no more specific integrand than dzdydx. Great.

The graph still needs to be created. Not difficult probably.
 

Similar threads

  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 33 ·
2
Replies
33
Views
3K
  • · Replies 20 ·
Replies
20
Views
3K
Replies
9
Views
3K
  • · Replies 4 ·
Replies
4
Views
5K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
Replies
6
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K