필터 지우기
필터 지우기

Area calculation of circle projection on cylindric surface

조회 수: 16 (최근 30일)
Julian Zettl
Julian Zettl 2021년 2월 17일
댓글: Just Manuel 2021년 2월 23일
Hello,
i have a very basic problem that is not necessarily a matlab issue, but i figured since i need matlab to calculate a series of these areas at different conditions i might as well post it here....
I want to calculate the area shown in the picture in dependence of r1, r2 and x (r=radius, x=distance between cylinder axes).
  댓글 수: 1
Just Manuel
Just Manuel 2021년 2월 17일
편집: Just Manuel 2021년 2월 17일
Not a complete solution, but an Idea, what you colud do:
You can try going down the infinitesimal road.
Try calculating the area piecewise by going in dx pieces from x-r2 to x+r2. unfold the cylinder c1, calculate the equivalent of dx on the surface of c1, multiply by the width of the circle c2 at the position and then sum up those pieces.
you can have a numeric solution by making dx smaller and smaller, until you have a desired accuracy, or maybe you will find an analytic solution when formulating your sum.
Cheers
Manuel

댓글을 달려면 로그인하십시오.

답변 (2개)

darova
darova 2021년 2월 17일
Here is an example (not tested)
clc,clear
R = 3;
r = 1;
t = linspace(0,2*pi-0.1,30); % unclosed contour
[x,y] = pol2cart(t,r);
x = x+1;
z = sqrt(R^2-x.^2); % find Z coordinate
gd = [2;length(x);x(:);y(:)]; % geometry description
dl = decsg(gd); % decomposition
[p,e,t] = initmesh(dl); % triangulation
p(:,3) = sqrt(R^2-p(:,1).^2);
% create structure for visualization
pp1.faces = t(1:3,:)';
pp1.vertices = p;
pp1.facecolor = 'green';
plot3(x,y,z)
patch(pp1)
view(45,45)
note: contour for decsg should NOT be closed
  댓글 수: 3
darova
darova 2021년 2월 18일
If your contour is always that simple
clc,clear
R = 3;
r = 1;
t = linspace(0,2*pi,30);
[x,y] = pol2cart(t,r);
x = [0*x; 3*x; 5*x; 7*x; 10*x]/10;
y = [0*y; 3*y; 5*y; 7*y; 10*y]/10;
x = x+1;
z = sqrt(R^2-x.^2);
h = surf(x,y,z);
h1 = surf2patch(h,'triangles'); % convert to triangles
view(35,15)

댓글을 달려면 로그인하십시오.


Just Manuel
Just Manuel 2021년 2월 23일
편집: Just Manuel 2021년 2월 23일
@darova already gave you an answer using the pde package.
I followed through the Idea I gave you in the comment:
Try calculating the area piecewise by going in dx pieces from x-r2 to x+r2. unfold the cylinder c1, calculate the equivalent of dx on the surface of c1, multiply by the width of the circle c2 at the position and then sum up those pieces.
This gives actually some happy and short code:
% I renamed the x in your picture to x0, so as to have x as the integration variable
% witdh of c2 at position
% use pythagoras to get the other circle coordinate, then double it
w = @(x) sqrt(r2^2 - (x - x0).^2) .* 2;
% unfolded length is the infinitesimal dx multiplied by
% a factor depending on the slope of c1
% use some geometry to find the factor:
% you can see that n/r1 = dx/d and n = sqrt(r1^2 - (x-x0)^2)
% so you end up with
d = @(x) r1 ./ sqrt(r1.^2 - x.^2);
% so the function to integrate is
f = @(x) w(x) .* d(x);
% so the area is that integral within the boundaries of x0-r2 and x1+r2
A = integral(f, x0-r2, x0+r2);
It even has better precision than the graphical approach :)
try r1 = 1e100, r2 = sqrt(1/pi) and x0 = 0
the numerical approach yields 1.0000...
while the graphical approach yields 0.9972...
For an analytical (closed form) solution, you'd have to solve the integral. I made a short attempt, but it seems to me, that this integral has no closed form. (Prove me wrong, I'd be happy to see one :) )
Cheers
Manuel
  댓글 수: 2
darova
darova 2021년 2월 23일
I got the same answer
Just Manuel
Just Manuel 2021년 2월 23일
nice!
There are always multiple approaches. I also did one integrrating over the angle on r1, but in the end, i thought the solution over dx more straightforward. anywho, if you prefer the angle, you can also do
which produces the same results.
It also seems somewhat nicer, as the integration variable only appears once. However, also this variant does not seem to have a closed form solution.
Cheers
Manuel

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Geometry and Mesh에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by