Volume-calculating function in Mathematica

In summary, the conversation focused on creating a function in Mathematica called MyContainer[R, L, l, H] to determine the capacity of fluid in a container with cones on both sides, based on the filling height H. The function needed to have the property of being able to calculate volume regardless of the values of the linear dimensions. The conversation also mentioned creating a graph depicting the relationship between filling height and volume. The individual was struggling with writing the equations and limits of the integrals needed to find the volumes, but eventually was able to solve it with the help of their professor. They still needed to create the graph, which they believed would not be difficult.
  • #1
alariv8
10
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: 532
Last edited:
Physics news on Phys.org
  • #2
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:
  • #3
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.
 

FAQ: Volume-calculating function in Mathematica

How do I use the volume-calculating function in Mathematica?

To use the volume-calculating function in Mathematica, you first need to define the shape or object for which you want to calculate the volume. This can be done using built-in geometric shapes or by defining your own custom shape using mathematical equations. Once the shape is defined, you can use the built-in function "Volume" to calculate the volume.

Can I calculate the volume of irregular shapes using Mathematica?

Yes, you can use the built-in function "Volume" in Mathematica to calculate the volume of irregular shapes. You can either use the "Region" function to define the irregular shape or define it using a set of points and use the "BoundaryMeshRegion" function. Once the shape is defined, you can use the "Volume" function to calculate the volume.

How accurate are the volume calculations in Mathematica?

The volume calculations in Mathematica are highly accurate. The software uses advanced algorithms and numerical methods to calculate the volume of complex shapes. However, the accuracy of the calculations may also depend on the precision and accuracy settings used in your Mathematica session.

Can I calculate the volume of 3D objects from images using Mathematica?

Yes, you can use Mathematica's built-in image processing functions to convert 2D images of 3D objects into 3D shapes and then use the "Volume" function to calculate the volume. This can be useful for applications such as medical imaging or 3D modeling.

Are there any limitations to the volume-calculating function in Mathematica?

There are some limitations to the volume-calculating function in Mathematica, depending on the complexity of the shape being calculated. For example, the "Volume" function may not be able to calculate the volume of extremely complex or highly irregular shapes. In such cases, it is recommended to break the shape into smaller, simpler components and calculate the volume separately.

Similar threads

Replies
33
Views
2K
Replies
20
Views
2K
Replies
4
Views
3K
Replies
4
Views
2K
Replies
10
Views
2K
Replies
1
Views
854
Replies
13
Views
1K
Back
Top