Problem 2 (25 pts) You are part of a team that will build a sculpture of two granite spheres stacked on top of each othe
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Problem 2 (25 pts) You are part of a team that will build a sculpture of two granite spheres stacked on top of each othe
Problem 2 (25 pts) You are part of a team that will build a sculpture of two granite spheres stacked on top of each other. Because granite is a dense material, and because mass is directly proportional to volume, you want to minimize the total volume of this two-sphere sculpture. This volume can be minimized by appropriately choosing the radius of each sphere (see Fig. 2). To do this, you will write a Python program that computes the total volume of the two spheres over a range of radii. sphere 2 r 2 total height sphere 1 Figure 2: Stacked spheres statue for Problem 2. Required Tasks: 1. (5 pts) Write a Python function called calculate volume that fulfills these specifications: Accepts the total height of the sculpture (in meters), as well as the radius of the bottom sphere (ri, also in meters) as input arguments. • Determines the radius of the second sphere (r₂) from this information, then computes the total volume. • Determines the total mass (in kilograms) of the two-sphere sculpture, assuming granite has a density of 2.75 g/cm³. Returns the computed volume and mass as the output arguments. 2. (20 pts) In the main section of the Python script, within a loop: • Displays a memi allowing the user to select from these options: (a) [r] Enter a single height and r₁ combination and print the resulting volume and mass. (b) [p] Plot a graph of volume versus ri. (c) [q] Quit the program. . If requested, calls your calculate volume function to do the actual calculation and then displays the result up to two decimal points. • If the user wants a plot, it should fulfill the following: Plots total volume versus radius r₁ of the first (bottom) sphere, where r₁ ranges from 0 m to the full height of the sculpture. Has reasonable axis labels and a title. Displays the values of r₁ and r₂ that minimizes the volume, as well as the resulting mass of the sculpture. All values should be to two decimal points.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!