Volume of a bead with square hole- Program approach?
|
06-09-2020, 09:45 PM
Post: #7
|
|||
|
|||
RE: Volume of a bead with square hole- Program approach?
I cheated, and solve with Mathematica.
This time, I scaled everything by 2, to eliminate the 8x in front of hole volume. > f1 = Integrate[Sqrt[d^2-x^2-y^2],{x,0,a}] \(\frac{a\,{\sqrt{-a^2 + d^2 - y^2}} - d^2\,\arctan (\frac{a\,{\sqrt{-a^2 + d^2 - y^2}}}{a^2 - d^2 + y^2}) + y^2\,\arctan (\frac{a\,{\sqrt{-a^2 + d^2 - y^2}}}{a^2 - d^2 + y^2})}{2}\) > f2 = Integrate[f1, y] // Expand; > f2 /. y -> 0 // Simplify → 0 > f2 = f2 /. y -> b (* dy is integrated from 0 to b *) \(\frac{a\,b\,{\sqrt{-a^2 - b^2 + d^2}}}{3} \\ + \frac{b^3\,\arctan (\frac{a\,{\sqrt{-a^2 - b^2 + d^2}}}{a^2 + b^2 - d^2})}{6} - \frac{b\,d^2\,\arctan (\frac{a\,{\sqrt{-a^2 - b^2 + d^2}}}{a^2 + b^2 - d^2})}{2}\\ + \frac{a^3\,\arctan (\frac{b\,{\sqrt{-a^2 - b^2 + d^2}}}{a^2 + b^2 - d^2})}{6} - \frac{a\,d^2\,\arctan (\frac{b\,{\sqrt{-a^2 - b^2 + d^2}}}{a^2 + b^2 - d^2})}{2}\\ \\ - \frac{i}{6}\,d^3\,\log (\frac{6\,{\sqrt{-a^2 - b^2 + d^2}}} {a\,d^3\,\left( -2\,b + 2\,d \right) } + \frac{3\,i \,\left( -\left( a^2\,d \right) - b\,d^2 + d^3 \right) } {a^2\,d^4\,\left( -b + d \right) }) + \frac{i}{6}\,d^3\,\log (\frac{-6\,{\sqrt{-a^2 - b^2 + d^2}}} {a\,\left( -2\,b - 2\,d \right) \,d^3} + \frac{3\,i \,\left( -\left( a^2\,d \right) + b\,d^2 + d^3 \right) } {a^2\,d^4\,\left( b + d \right)})\) > f2 /. {d->20, a->2, b->2} // N → 79.7327 + 0. I f2 is already hole volume formula, but it is best if we simplify, and remove the imag. part. log(z) = log(|z|) + i * args(z), args(z) = atan(z.imag / z.real) > f3 = Part[f2,-2,-1,-1] → \(\frac{6\,{\sqrt{-a^2 - b^2 + d^2}}}{a\,d^3\,\left( -2\,b + 2\,d \right) } + \frac{3\,i \,\left( -\left( a^2\,d \right) - b\,d^2 + d^3 \right) } {a^2\,d^4\,\left( -b + d \right)}\) > f4 = Part[f2,-1,-1,-1] → \(\frac{-6\,{\sqrt{-a^2 - b^2 + d^2}}} {a\,\left( -2\,b - 2\,d \right) \,d^3} + \frac{3\,i \,\left( -\left( a^2\,d \right) + b\,d^2 + d^3 \right) } {a^2\,d^4\,\left( b + d \right) }\) > t3 = Part[f3,2]/I / Part[f3,1] // Simplify → \(\frac{-a^2 + d\,\left( -b + d \right) }{a\,{\sqrt{-a^2 - b^2 + d^2}}}\) > t4 = Part[f4,2]/I / Part[f4,1] // Simplify → \(\frac{-a^2 + d\,\left( b + d \right) }{a\,{\sqrt{-a^2 - b^2 + d^2}}}\) Using identity, tan(x-y) = (tan(x) - tan(y)) / (1 + tan(x) tan(y)), combine tan(2 angles) > t34 = (t3 - t4) / (1 + t3 t4) // Simplify → \(\frac{2 a b d \sqrt{-a^2 - b^2 + d^2}} {d^2 (b^2-d^2) + a^2 (b^2 + d^2)}\) > hv = f2 - Part[f2,{-2,-1}] + d^3/6 ArcTan[t34] // Simplify Result is still messy. Let k = √(d^2 - a^2 - b^2), and expanding √(k²) as k: > hv2 = hv /. b^2 -> d^2 - a^2 - k^2 // Simplify // PowerExpand \(\Large \frac{2abk\; -\; \left( b^3 - 3bd^2 \right) \arctan (\frac{a}{k})\;-\; \left( a^3 - 3ad^2 \right)\arctan (\frac{b}{k})\;-\; d^3\arctan (\frac{2abdk} {a^4 + d^2k^2 + a^2\left( -d^2 + k^2 \right) })}{6}\) > hv2 /. {a->2, b->2, d->20, k->Sqrt[400-4-4]} // N → 79.7327 |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 3 Guest(s)