Volume of a bead with square hole- Program approach?
|
06-10-2020, 09:31 PM
(This post was last modified: 11-05-2023 02:07 PM by Albert Chan.)
Post: #17
|
|||
|
|||
RE: Volume of a bead with square hole- Program approach?
(06-09-2020 09:45 PM)Albert Chan Wrote: \(\Large \frac{2abk\; -\; \left( b^3 - 3bd^2 \right) \arctan (\frac{a}{k})\;-\; I just noticed the last big arctan mess can be simplified with half-angle formula In[1]:= t = (a b) / (d k); In[2]:= x = 2 t / (1 - t^2) // Simplify → \(\frac{2\,a\,b\,d\,k}{-\left( a^2\,b^2 \right) + d^2\,k^2}\) Numerator matched exactly, now check the denominator ... In[3]:= Denominator[x] /. b^2 -> d^2 - a^2 - k^2 // Expand → \(a^4 - a^2\,d^2 + a^2\,k^2 + d^2\,k^2\) → \(\arctan (\frac{2abdk}{a^4 + d^2k^2 + a^2\left( -d^2 + k^2 \right) }) = 2 \arctan \left({a b \over d k}\right)\) This is my revised Lua code. I use diameter this time, to match the quoted formula. Code: function hv2(d,a,b) -- sphere, rectanglar hole removed volume lua> hv2(20,2,2) 79.73270765594204 lua> hv2(20,2,4) 158.6579531235735 lua> hv2(20,2,8) 310.6995953333083 lua> hv2(20,2,16) 561.6790116105259 |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)