Packing identical cylinders into a rectangular prism

Dear all,
I need to pack identical cylinders into a rectangular prism (e. g. figure). Is there a way to do this without identifying the cylinders one by one? Can someone help me with this problem?
Thank you!

2 件のコメント

DGM
DGM 2021 年 12 月 22 日
What are the constraints?
Are you trying to find the minumum volume for a fixed number of fixed-size cylinders?
Are you trying to fit a maximum number of fixed-size cylinders into a fixed volume?
Does the cylinder height even matter for the problem?
Is there any preference given to regular packings?
What do you mean "identify the cylinder"?
You need to have a well defined problem before you can solve the problem.
If this just reduces to a circle packing problem, then maybe this is a start:
Ege Arsan
Ege Arsan 2021 年 12 月 22 日
As you said, I am trying to fit a maximum number of fixed-size cylinders in to a fixed volume. I also need to find the used volume by the cylinders therefore the cylinder height is relevant to the problem.
So the constraints are the fixed volume, dimensions of the cylinders, the gaps between the cylinders and the gap to the walls.

サインインしてコメントする。

回答 (2 件)

Image Analyst
Image Analyst 2021 年 12 月 22 日

0 投票

I gave you a way to pack them in there tightly in your other question. You can easily adapt it if you want spaces between the cylinders. The volume is just the area times the height of course.

12 件のコメント

Ege Arsan
Ege Arsan 2021 年 12 月 22 日
Yes, but I need to visualize them as cylinders and I failed to do so with "viscircles", therefore I reformulated the question.
Image Analyst
Image Analyst 2021 年 12 月 22 日
How did you create the cylinder image you posted?
Ege Arsan
Ege Arsan 2021 年 12 月 22 日
I found it on the internet. It is probably from a cad file.
Also the problem with the method you suggested earlier was that the radii was not fixed. As I mentioned, I need to pack cylinders with fixed dimentions in to a fixed volume and I don't think it is possible with that method.
Image Analyst
Image Analyst 2021 年 12 月 22 日
The radii was fixed. It was a constant for all circles.
Ege Arsan
Ege Arsan 2021 年 12 月 22 日
You are right, my bad. But i still don't know how to turn them into cylinders.
Image Analyst
Image Analyst 2021 年 12 月 22 日
So the cylinder() function can't be adapted to what you need?
cylinder
Ege Arsan
Ege Arsan 2021 年 12 月 22 日
I'm afraid not. I guess it is because of viscircles().
Image Analyst
Image Analyst 2021 年 12 月 22 日
So don't call viscircles(). Call cylinder() instead.
Ege Arsan
Ege Arsan 2021 年 12 月 23 日
It says "Execution of script cylinder as a function is not supported" when I try to call cylinder.
Ege Arsan
Ege Arsan 2021 年 12 月 23 日
Do you have any idea how I can identify the z coordinates so that I can may be call surf(x,y,z)
Image Analyst
Image Analyst 2021 年 12 月 23 日
You should not call your script cylinder.m since sylinder is the name of a built-in function. What does this say
which -all cylinder
Ege Arsan
Ege Arsan 2021 年 12 月 23 日
There isn't any error now. How should I plot them now?

サインインしてコメントする。

John D'Errico
John D'Errico 2021 年 12 月 22 日

0 投票

Sorry, but no, there is no simple mathematical formula to perform maximal circle packing of a known radius circle into a given domain. Since your cylinders will be the height of the domain, the height is known. And that means this is just a circle packing problem, in a rectangular domain, so just a 2-d problem. A hexagonal close packed solution is probably at least close to optimal, but along the edges, you may be able to do just a bit better, depending on the dimensions of the rect and the circle radius.
If you then say you don't know the orientation of the cylinders, so you don't know the height, then it is just THREE independent circle packing problems. Solve it three times, once along each axis of the domain. In each case, it becomes a circle packing problem in a rect.
Once you know how many circles can fit into the rect, computing the volume is trivial. Just multiply the area of one circle with the height, then multiply by the number of circles you were able to fit inside. But there is no formula to give you the circle locations or the number of circles.

カテゴリ

製品

リリース

R2021b

質問済み:

2021 年 12 月 22 日

コメント済み:

2021 年 12 月 23 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by