More of a project than a problem - Part 1

Calculus Level 4

A cuboid measures 2 × 3 × 5 2 \times 3 \times 5 . Find the volume of revolution that results when the cuboid is rotated about its space diagonal (a space diagonal is a line segment connecting two opposite vertices such that the center of the cuboid bisects it). The use of a programming environment is highly recommended.


The answer is 96.6137.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

David Vreken
Dec 29, 2018

Using the following code, the result for a = 2 a = 2 , b = 3 b = 3 , and c = 5 c = 5 is V 96.6137 V \approx \boxed{96.6137} .

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Brilliant - More of a Project than a Problem
# Python 2.7.3

import math

# number of cylindrical slices
m = 100000

# dimensions of cuboid, and space diagonal vector is (a, b, c)
a = 2
b = 3
c = 5

# equation perpendicular to (a, b, c) at (at, bt, ct) is 
#   ax + by + cz = dt with the following d value.
d = a ** 2 + b ** 2 + c ** 2

# find volume of each cylindrical slice and keep a running total 
totalv = 0
for t1 in range(0, 1 * m):
    t = 1.0 * t1 / m

    # find the maximum radius for the cylindrical slice by testing all
    #   12 line segments of the cuboid that intersect ax + by + cz = dt,
    #   the equation of the plane perpendicular to (a, b, c) at (at, bt, ct)
    maxr = 0

    # test intersection of planes x = 0 and y = 0, x = 0 and y = b,
    #   x = a and y = 0, and x = a and y = b for possible maxr
    for x in range(0, a + 1, a):
        for y in range(0, b + 1, b):
            z = 1.0 * (d * t - a * x - b * y) / c
            r = math.sqrt((a * t - x) ** 2 + (b * t - y) ** 2 + (c * t - z) ** 2)
            if z >= 0 and z <= c and r > maxr:
                maxr = r

    # test intersection of planes x = 0 and z = 0, x = 0 and z = c,
    #   x = a and z = 0, and x = a and z = c for possible maxr
    for x in range(0, a + 1, a):
        for z in range(0, c + 1, c):
            y = 1.0 * (d * t - a * x - c * z) / b
            r = math.sqrt((a * t - x) ** 2 + (b * t - y) ** 2 + (c * t - z) ** 2)
            if y >= 0 and y <= b and r > maxr:
                maxr = r

    # test intersection of planes y = 0 and z = 0, y = 0 and z = c,
    #   y = b and z = 0, and y = b and z = c for possible maxr
    for y in range(0, b + 1, b):
        for z in range(0, c + 1, c):
            x = 1.0 * (d * t - b * y - c * z) / a
            r = math.sqrt((a * t - x) ** 2 + (b * t - y) ** 2 + (c * t - z) ** 2)
            if x >= 0 and x <= a and r > maxr:
                maxr = r

    # find volume of the cylindrical slice using maxr and add it to the total
    v = 1.0 * math.pi * maxr ** 2 * math.sqrt(d) / m
    totalv += v

# display the volume total
print "The volume of revolution is %0.4f" % totalv + "."

Excellent solution. Thanks for sharing it.

Hosam Hajjir - 2 years, 5 months ago
Steven Chase
Dec 29, 2018

A fun little project indeed!

Let the space diagonal be between points ( 0 , 0 , 0 ) (0,0,0) and ( 2 , 3 , 5 ) (2,3,5) . Let u \vec{u} be a unit vector along the space diagonal, and let u 1 \vec{u_1} and u 2 \vec{u_2} be unit vectors perpendicular to u \vec{u} .

Let the parameter α \alpha be the distance along the space diagonal. Let the value σ \sigma be the perpendicular distance from a point on the space diagonal to some place on the cuboid. Let θ \theta be an angular parameter.

u 3 = c o s θ u 1 + s i n θ u 2 Point on Cuboid Surface = α u + σ u 3 \vec{u_3} = cos \theta \, \vec{u_1} + sin \theta \, \vec{u_2} \\ \text{Point on Cuboid Surface} = \alpha \, \vec{u} + \sigma \, \vec{u_3}

Now, the tricky part is that for each α \alpha , θ \theta varies continuously between 0 0 and 2 π 2 \pi . Consequently, there are infinitely many σ \sigma values for each α \alpha . The processing is as follows:

1) For every α \alpha between 0 0 and the length of the space diagonal (in small steps), sweep θ \theta from 0 0 to 2 π 2 \pi in small steps.
2) For every θ \theta , form u 3 \vec{u_3} and determine a σ \sigma value corresponding to the intersection with the infinite plane containing each cuboid face. There will be six σ \sigma calculations in total.
3) The intersection point with the cuboid corresponds to the smallest positive σ \sigma value. Call this σ i n t e r s e c t \sigma_{intersect}
4) For each α \alpha , as θ \theta is swept, keep track of the largest value of σ i n t e r s e c t \sigma_{intersect} . Call this σ m a x \sigma_{max}
5) This yields a disk of area π σ m a x 2 \pi \, \sigma_{max}^2 for each α \alpha
6) The infinitesimal volume associated with each α \alpha value is π σ m a x 2 d α \pi \, \sigma_{max}^2 \, d \alpha
7) Summing up all of the infinitesimal volumes yields a total volume of rotation of about 96.5 96.5



  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# https://brilliant.org/problems/more-of-a-project-than-a-problem/

import math

##################################

Num = 4*10**3

##################################

vx = 2.0
vy = 3.0
vz = 5.0

v = math.sqrt(vx**2.0 + vy**2.0 + vz**2.0)

v1x = 1.0
v1y = 1.0
v1z = -1.0

v1 = math.sqrt(v1x**2.0 + v1y**2.0 + v1z**2.0)

v2x = -8.0
v2y = 7.0
v2z = -1.0

v2 = math.sqrt(v2x**2.0 + v2y**2.0 + v2z**2.0)

##################################

ux = vx / v
uy = vy / v
uz = vz / v

u1x = v1x / v1
u1y = v1y / v1
u1z = v1z / v1

u2x = v2x / v2
u2y = v2y / v2
u2z = v2z / v2

##################################

print (ux**2.0 + uy**2.0 + uz**2.0)
print (u1x**2.0 + u1y**2.0 + u1z**2.0)
print (u2x**2.0 + u2y**2.0 + u2z**2.0)

print ""

print (ux*u1x + uy*u1y + uz*u1z)
print (ux*u2x + uy*u2y + uz*u2z)
print (u1x*u2x + u1y*u2y + u1z*u2z)

print ""


##################################

dalpha = v / Num
dtheta = 2.0 * math.pi / Num

##################################

xref_left = 0.0
xref_right = 2.0

yref_up = 3.0
yref_down = 0.0

zref_bottom = 0.0
zref_top = 5.0

####################################################################

Vol = 0.0

alpha = 0.0

while alpha <= v:

    x0 = alpha * ux
    y0 = alpha * uy
    z0 = alpha * uz

    theta = 0.0

    sigma_max = -999999.0

    while theta <= 2.0 * math.pi:

        u3x = math.cos(theta) * u1x + math.sin(theta) * u2x
        u3y = math.cos(theta) * u1y + math.sin(theta) * u2y
        u3z = math.cos(theta) * u1z + math.sin(theta) * u2z

        #####

        sigma_x_left = (xref_left - x0)/u3x
        sigma_x_right = (xref_right - x0)/u3x

        sigma_y_up = (yref_up - y0)/u3y
        sigma_y_down = (yref_down - y0)/u3y

        sigma_z_bottom = (zref_bottom - z0)/u3z
        sigma_z_top = (zref_top - z0)/u3z

        #####

        if sigma_x_left < 0.0:
            sigma_x_left = 10.0**12.0

        if sigma_x_right < 0.0:
            sigma_x_right = 10.0**12.0

        if sigma_y_up < 0.0:
            sigma_y_up = 10.0**12.0

        if sigma_y_down < 0.0:
            sigma_y_down = 10.0**12.0

        if sigma_z_bottom < 0.0:
            sigma_z_bottom = 10.0**12.0

        if sigma_z_top < 0.0:
            sigma_z_top = 10.0**12.0

        #####

        sigma_intersect = min(sigma_x_left,sigma_x_right,sigma_y_up,sigma_y_down,sigma_z_bottom,sigma_z_top)

        #####

        if sigma_intersect > sigma_max:
            sigma_max = sigma_intersect

        #####

        theta = theta + dtheta

    Area = math.pi * (sigma_max**2.0)

    dVol = Area * dalpha

    Vol = Vol + dVol


    alpha = alpha + dalpha

####################################################################

print Vol

Excellent solution. Thank you for sharing it.

Hosam Hajjir - 2 years, 5 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...