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!