Problem 45396. Design a tubesheet for shell-and-tube heat exchangers
A tubesheet is a metal plate used to hold multiple tubes in place in a shell-and-tube heat exchanger. In any industrial plant, heat exchangers are used to transfer heat from one stream to another, such as for cooling or heating.
In this problem, you are given the diameter D of a metal plate which is a perfect circle. We need to punch holes in this plate where the tubes can fit in. This is done by placing the plate on a 2-D coordinate system where the center of the circle lies in the origin. As seen in the figure below, the coordinate system can be imagined as being made of square cells. A hole can be punched in a square cell if and only if it lies completely inside the circular metal plate. Can you help count the number of holes we can punch, given the plate's diameter?
Write a function that accepts a floating-point value, D. Output the maximum number of holes that can be punched on a plate of diameter D. You are ensured that 1 <= D <= 50.
In the examples above, we can see that we can punch 16 holes when D = 6, and 60 holes when D = 10.
Solution Stats
Problem Comments
-
2 Comments
cokakola
on 26 Oct 2020
breaking the symmetry, one can place more holes in the circle!
Ntandoyakhe Tshuma
on 22 May 2021
Any insight on how to approach the problem? I tried to find a relationship between the number of total squares and the number of complete squares inside the circle.
My solution only passed 3 of the Tests.
Solution Comments
Show commentsProblem Recent Solvers55
Suggested Problems
-
2264 Solvers
-
4392 Solvers
-
Back to basics 8 - Matrix Diagonals
924 Solvers
-
Create an n-by-n null matrix and fill with ones certain positions
602 Solvers
-
441 Solvers
More from this Author19
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!