Area calculation of circle projection on cylindric surface

15 vues (au cours des 30 derniers jours)
Julian Zettl
Julian Zettl le 17 Fév 2021
Commenté : Just Manuel le 23 Fév 2021
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 commentaire
Just Manuel
Just Manuel le 17 Fév 2021
Modifié(e) : Just Manuel le 17 Fév 2021
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

Connectez-vous pour commenter.

Réponses (2)

darova
darova le 17 Fév 2021
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 commentaires
darova
darova le 18 Fév 2021
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)
darova
darova le 18 Fév 2021

Connectez-vous pour commenter.


Just Manuel
Just Manuel le 23 Fév 2021
Modifié(e) : Just Manuel le 23 Fév 2021
@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 commentaires
darova
darova le 23 Fév 2021
I got the same answer
Just Manuel
Just Manuel le 23 Fév 2021
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

Connectez-vous pour commenter.

Produits


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by