0

I am trying to calculate the volume of the intersection between a sphere and a cylinder given the variables of the displacement between the 2 centers and the cylinder radius. The volume is given by the formula seen in the screen dump and the Heuman function is a part of that expression.

I have tried the code for the Heuman Lambda Function described in this question and adjusted it a bit, since I do not use angles in degrees. However, it does not seem to work, since the calculated volumes do not agree with the tabulated results in the article.

Can anyone help me to solve the problem? Is it something with the inputs due to different definitions in Matlab and the text? The code looks like this.

% volume of the intersection between a sphere and a cylinder
clc, clear, close

rho = 1; % radius of the cylinder nu = 1.5; % distance between the 2 centers % rho+nu

v = asin(nu-rho) % argument to Heuman function k = sqrt((1-(nu-rho)^2)/(4nurho)) % argument to Heuman function

H_1 = Heuman_Lambda_1(v,k) V_1A = volume_1A(rho,nu,k,H_1)

function [V_1A] = volume_1A(rho,nu,k,H_1) % nu > rho and nu + rho > 1, Ms intersects Mc in 2 points

[K,E] = ellipke(k); V_1A = (2pi/3)(1-H_1)-(8/9)sqrt(rhonu)(6rho^2+2rhonu-3)(1-k^2)K+(8/9)sqrt(rhonu)(7rho^2+nu^2-4)*E;

end

function [HL_1] = Heuman_Lambda_1(v,k)

kdash = (1-k);

[K,E] = ellipke(k);

incF = ellipticF(v,kdash);

incE = ellipticE(v,kdash);

HL_1 = 2/pi * (EincF + KincE - K*incF); end

Thanks a lot!

Jean Marie
  • 88,997
Thomas
  • 1
  • We have a Latex-like typesetting system for mathematical expressions, called MathJax. Information is here: https://math.meta.stackexchange.com/a/10164/ – 311411 Jul 06 '21 at 14:07

1 Answers1

0

I have solved the problem. The inputs to the Matlab functions are the squared moduli, $k^2$. Hence, the kdash in the code should be $1-k^2$ and [K,E] = ellipke(k^2) has now a squared modulus. Thanks anyway.

Thomas
  • 1