Rectangular cap of a sphere

Last updated: 2024-04-08

The rectangular cap of a sphere models a square/rectangular part of a sphere’s surface vibrating (in contrast to the cap of sphere, which models a circular cap).

Here we’ll try a top-down approach to understand the relevant variables and their corresponding code implementations in further detail.

Directivity functions \(D(\theta,\pi)\) , \(D(0,0)\)

The off-axis directivity function \(D(\theta,\pi)\) is given by:

\[D(\theta,\pi) = -\frac{4\pi}{k^{2}S}\sum^{N}_{n=0}\sum^{n/2}_{m=0}A_{mn}j^{n}P^{2m}_{n}(cos \:\theta)cos\:2m\phi \:\:\: (12.83)\]

The on-axis directivity function \(D(0,0)\) is given by:

\[D(0,0) = -\frac{4\pi}{k^{2}S}\sum^{N}_{n=0}A_{0n}j^{n} \:\:\: (12.85)\]

The variables \(S, A_{mn}, A_{0n}\) are defined below.

\[ \begin{align}\begin{aligned}\begin{split}S = 4R^{2}\Bigg(arctan\bigg(\frac{tan\:\alpha\:tan\:\beta}{sec^2\:\alpha + \sqrt{sec^{2}\:\alpha + tan^{2}\:\beta}}\bigg) \\ + arctan\bigg(\frac{tan\:\alpha\:tan\:\beta}{sec^2\:\beta + \sqrt{sec^{2}\:\beta + tan^{2}\:\alpha}}\bigg)\Bigg) \quad (12.69) \\ \\\end{split}\\A_{mn} = \frac{(2n+1)^2(n-2m)!I_{mn}}{j2\pi(n+2m)!\bigg(nh^{(2)}_{n-1}(kR) - (n+1)h^{(2)}_{n+1}(kR)\bigg)} \quad (12.75)\end{aligned}\end{align} \]

And \(A_{0n}\) is all \(A_{mn}\) where \(m=0\).

Definition of \(I_{mn}\):

\(A_{mn}\) has the variable \(I_{mn}\), defined as:

\[\begin{split}I_{mn} = \\ \int^{arctan\frac{tan\:\beta}{tan\:\alpha}}_{0} cos\:2m\phi\:\int^{arctan\frac{tan\:\alpha}{cos\:\phi}}_{0} P^{2m}_{n}(cos\:\theta)sin\:\theta\:d\theta d\phi \\ + \int^{\frac{\pi}{2}+arctan\frac{tan\:\alpha}{tan\:\beta}}_{\frac{\pi}{2}-arctan\frac{tan\:\alpha}{tan\:\beta}} cos\:2m\phi \:\int^{arctan\frac{tan\:\beta}{sin\:\phi}}_{0} P^{2m}_{n}(cos\:\theta)sin\:\theta\:d\theta d\phi \\ + \int^{\pi}_{\pi-arctan \frac{tan\:\beta}{tan\:\alpha}} cos\:2m\phi\:\int^{arctan\:\frac{tan\:\alpha}{-cos\phi}}_{0} P^{2m}_{n}(cos\:\theta)sin\:\theta\:d\theta d\phi \\ \quad (12.76)\end{split}\]

And \(I_{0n}\) is all \(I_{mn}\) where \(m=0\), given by:

\[\begin{split}I_{0n} = \\ \int^{arctan \frac{tan\:\beta}{tan\:\alpha}}_{0} \frac{tan\:\alpha}{\sqrt{cos^{2}\:\phi + tan^{2}\:\alpha}} P^{-1}_{n}\bigg(\frac{\cos\:\phi}{\sqrt{cos^{2}\:\phi + tan^{2}\:\alpha}}\bigg)d\phi \\ + \int^{\pi/2+arctan\frac{tan\:\alpha}{tan\:\beta}}_{\pi/2-arctan\frac{tan\\:alpha}{tan\:\beta}} \frac{tan\:\beta}{\sqrt{sin^{2}\:\phi + tan^{2}\:\beta}} P^{-1}_{n}\bigg(\frac{sin\:\phi}{\sqrt{sin^{2}\:\phi + tan^{2}\:\beta}}\bigg)d\phi \\ + \int^{\pi}_{\pi-arctan\frac{tan\:\beta}{tan\:\alpha}} \frac{tan\:\alpha}{\sqrt{cos^{2}\:\phi + tan^{2}\:\alpha}} P^{-1}_{n}\bigg(\frac{-cos\:\phi}{\sqrt{cos^{2}\:\phi + tan^{2}\:\alpha}}\bigg)d\phi \\ \quad (12.77)\end{split}\]

Computational implementation of \(I_{mn}\)

The code implementation looks different from these equations, and that is because the solutions to some of the integrals seem to have been included already.

Let’s examine them one-by-one.

\(I_{mn}\) is coded with the equivalent of Int[m_,n_,beta_]:

\[\begin{split}I_{mn} = \\ \frac{1}{PQ}arctan\frac{sin\:\beta}{sin\:\alpha}\sum^{P}_{p=1}\sum^{Q}_{q=1}arctan\:\frac{tan\:\alpha}{cos\:\phi_{1}}cos\:2m\phi_{1}\:P^{2m}_{n}(cos\theta_{1})\:sin\:\theta_{1} \\ + \frac{2}{PQ}arctan\frac{sin\:\alpha}{sin\:\beta}\sum^{P}_{p=1}\sum^{Q}_{q=1}arctan\:\frac{tan\:\beta}{sin\:\phi_{2}}cos\:2m\phi_{2}\:P^{2m}_{n}(cos\theta_{2})\:sin\:\theta_{2} \\ + \frac{1}{PQ}arctan\frac{sin\:\beta}{sin\:\alpha}\sum^{P}_{p=1}\sum^{Q}_{q=1}arctan\:\frac{tan\:\alpha}{-cos\:\phi_{3}}cos\:2m\phi_{3}\:P^{2m}_{n}(cos\theta_{3})\:sin\:\theta_{3} \\\end{split}\]

where,

\[\begin{split}P=100, Q=100 \\ \phi_{1}(p,\beta) = \frac{p-1/2}{P}arctan\:\frac{sin\:\beta}{sin\:\alpha} \\ \phi_{2}(p,\beta) = \frac{\pi}{2} - arctan\:\frac{sin\:\alpha}{sin\:\beta} + 2\frac{p-1/2}{P}arctan\:\frac{sin\:\alpha}{sin\:\beta} \\ \phi_{3}(p.\beta) = \pi - arctan\:\frac{sin\:\beta}{sin\:\alpha} + \frac{p-1/2}{P}arctan\:\frac{sin\:\beta}{sin\:\alpha} \\ \theta_{1}(p,q,\beta) = \frac{q-1/2}{Q}\bigg(arctan\:\frac{tan\:\alpha}{cos\:\phi_{1}} \bigg) \\ \theta_{2}(p,q,\beta) = \frac{q-1/2}{Q}\bigg(arctan\:\frac{tan\:\beta}{sin\:\phi_{2}} \bigg) \\ \theta_{3}(p,q,\beta) = \frac{q-1/2}{Q}\bigg(arctan\:\frac{tan\:\alpha}{-cos\:\phi_{3}} \bigg) \\\end{split}\]

Comparing the math \(I_{mn}\) definitions and code implementation

Let’s begin to compare the code implementation of the solution with the original \(I_{mn}\) terms:

Math \(I_{mn}\) term1:

\[ \begin{align}\begin{aligned}\begin{split}\int^{arctan\frac{tan\:\beta}{tan\:\alpha}}_{0} cos\:2m\phi\:\int^{arctan\frac{tan\:\alpha}{cos\:\phi}}_{0} P^{2m}_{n}(cos\:\theta)sin\:\theta\:d\theta d\phi \\\end{split}\\implemented\:as\: :\\\begin{split}\frac{1}{PQ}arctan\frac{sin\:\beta}{sin\:\alpha}\sum^{P}_{p=1}\sum^{Q}_{q=1}arctan\:\frac{tan\:\alpha}{cos\:\phi_{1}}cos\:2m\phi_{1}\:P^{2m}_{n}(cos\theta_{1})\:sin\:\theta_{1} \\\end{split}\end{aligned}\end{align} \]

\(I_{mn}\) term2:

\[ \begin{align}\begin{aligned}\begin{split}\int^{\frac{\pi}{2}+arctan\frac{tan\:\alpha}{tan\:\beta}}_{\frac{\pi}{2}-arctan\frac{tan\:\alpha}{tan\:\beta}} cos\:2m\phi \:\int^{arctan\frac{tan\:\beta}{sin\:\phi}}_{0} P^{2m}_{n}(cos\:\theta)sin\:\theta\:d\theta d\phi \\\end{split}\\implemented\:as\: :\\\begin{split}\frac{2}{PQ}arctan\frac{sin\:\alpha}{sin\:\beta}\sum^{P}_{p=1}\sum^{Q}_{q=1}arctan\:\frac{tan\:\beta}{sin\:\phi_{2}}cos\:2m\phi_{2}\:P^{2m}_{n}(cos\theta_{2})\:sin\:\theta_{2} \\\end{split}\end{aligned}\end{align} \]

\(I_{mn}\) term 3:

\[ \begin{align}\begin{aligned}\begin{split}\int^{\pi}_{\pi-arctan \frac{tan\:\beta}{tan\:\alpha}} cos\:2m\phi\:\int^{arctan\:\frac{tan\:\alpha}{-cos\phi}}_{0} P^{2m}_{n}(cos\:\theta)sin\:\theta\:d\theta d\phi \\\end{split}\\implemented\:as\: :\\\begin{split} \frac{1}{PQ}arctan\frac{sin\:\beta}{sin\:\alpha}\sum^{P}_{p=1}\sum^{Q}_{q=1}arctan\:\frac{tan\:\alpha}{-cos\:\phi_{3}}cos\:2m\phi_{3}\:P^{2m}_{n}(cos\theta_{3})\:sin\:\theta_{3} \\\end{split}\end{aligned}\end{align} \]

Definition of \(I_{0n}\):

\(I_{0n}\) (all m=0) terms:

\[\begin{split}\int^{arctan\:\frac{tan\:\beta}{tan\:\alpha}}_{0}\:\frac{tan\:\alpha}{\sqrt{cos^{2}\:\phi+tan^{2}\:\alpha}} P^{-1}_{n}\bigg( \frac{cos\:\phi}{\sqrt{cos^{2}\:\phi+tan^{2}\:\alpha}}\bigg)d\phi \\ + \int^{\pi/2 + arctan\:\frac{tan\:\alpha}{tan\:\beta}}_{\pi/2-arctan\:\frac{tan\:\alpha}{tan\:\beta}}\:\frac{tan\:\beta}{\sqrt{sin^{2}\:\phi+tan^{2}\:\beta}} P^{-1}_{n}\bigg( \frac{sin\:\phi}{\sqrt{sin^{2}\:\phi+tan^{2}\:\beta}}\bigg)d\phi \\ + \int^{\pi}_{\pi-arctan\:\frac{tan\:\beta}{tan\:\alpha}}\:\frac{tan\:\alpha}{\sqrt{cos^{2}\:\phi+tan^{2}\:\alpha}} P^{-1}_{n}\bigg( \frac{-cos\:\phi}{\sqrt{cos^{2}\:\phi+tan^{2}\:\alpha}}\bigg)d\phi \\\end{split}\]

Computational implementation of \(I_{0n}\):

\[\begin{split}\frac{1}{P} arctan\:\frac{sin\:\beta}{sin\:\alpha} \sum^{P}_{p=1} \frac{tan\:\alpha}{\sqrt{cos^{2}\:\phi_{1}+tan^{2}\alpha}} P^{-1}_{n}\bigg(\frac{cos\:\phi_{1}}{\sqrt{cos^{2}\:\phi_{1}+tan^{2}\:\alpha}}\bigg) \\ + \frac{2}{P} arctan\:\frac{sin\:\alpha}{sin\:\beta}\sum^{P}_{p=1}\frac{tan\:\beta}{\sqrt{sin^{2}\:\phi_{2}+tan^{2}\beta}} P^{-1}_{n}\bigg(\frac{sin\:\phi_{2}}{\sqrt{sin^{2}\:\phi_{2}+tan^{2}\:\beta}}\bigg) \\ \frac{1}{P} arctan\:\frac{sin\:\beta}{sin\:\alpha} \sum^{P}_{p=1} \frac{tan\:\alpha}{\sqrt{cos^{2}\:\phi_{3}+tan^{2}\alpha}} P^{-1}_{n}\bigg(\frac{-cos\:\phi_{3}}{\sqrt{cos^{2}\:\phi_{3}+tan^{2}\:\alpha}}\bigg) \\\end{split}\]

Comparing \(I_{0n}\) in code and definitions

The \(I_{0n}\) term doesn’t have any substitutions/solutions in the code implementation it. The main difference is that the numerical integration is built into the implementation (an alternative approach to use a inbuilt numerical integration routine).

Acknowledgements

Thanks to Tim Mellow for sharing the Mathematica code behind the textbook figures.