Post Reply 
Volume of a bead with square hole- Program approach?
11-10-2023, 01:52 AM
Post: #35
RE: Volume of a bead with square hole- Program approach?
Hi, DM48

Double integral reduced to single. Nice!
I simplified a bit, using Arc SOHCAHTOA method

10 DEF FNZ(Y) @ N=N+1 @ Y=D*D-Y*Y @ FNZ=Y*ACOS(B/SQR(Y)) @ END DEF
20 INPUT "D,A,B = ";D,A,B @ N=0 @ P=1E-5
30 I1=INTEGRAL(0,A,P,FNZ(IVAR))/2 @ C=SQR(D*D-A*A-B*B)
40 I2=PI/12*(D-A)^2*(2*D+A) - B/4*(A*C+(D*D-B*B)*ATAN(A/C))
50 DISP I1;"+";I2;"=";I1+I2,N @ GOTO 20

>run
D,A,B = 12,2,2
 200.09879005  +  657.127264322 = 857.226054372     15
D,A,B = 12,2,10
 82.547121343  +  615.365121066 = 697.912242409     31
D,A,B = 12,10,2
 764.410058495 + -66.4978178412 = 697.912240654    31

Below is direct formula for I1 (c is corner height, see code)

>a*(3*d^2-a^2)*pi/12 - a*b*c/12
 858.633041958
>res - b*(3*d^2+b^2)*atan(a/c)/12
 785.468340817
>res - a*(3*d^2-a^2)*atan(b/c)/6
 615.99486321
>res + d^3*atan(a*b/(c*d))/3
 764.410059992
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Volume of a bead with square hole- Program approach? - Albert Chan - 11-10-2023 01:52 AM



User(s) browsing this thread: 1 Guest(s)