Identify an arbitrary circular cylinder with 6 6 points

Calculus Level pending

In the table below, you are given six points in 3D space, and you are told that they lie on a circular cylinder whose axis intersects the x y xy plane at ( x 0 , y 0 ) (x_0, y_0) . Find a unit vector u = ( u x , u y , u z ) u = ( u_x, u_y, u_z) along the cylinder axis, and the radius R R of the cylinder, as well as x 0 x_0 and y 0 y_0 , and compute S = x 0 + y 0 + R + u x + u y + u z S = x_0 + y_0 + R + | u_x | + | u_y | + |u_z| . As your answer, enter 1 0 4 S \lfloor 10^4 S \rfloor

Point \text{Point} x x y y z z
1 1 4.347627526 4.347627526 15.74547184 15.74547184 1.286282963 -1.286282963
2 2 2.695157002 2.695157002 18.75852693 18.75852693 4.694715628 4.694715628
3 3 5.632766004 5.632766004 20.54167393 20.54167393 10.67571422 10.67571422
4 4 11.3654638 11.3654638 23.57607524 23.57607524 13.02307203 13.02307203
5 5 15.30317085 15.30317085 29.09163898 29.09163898 11.73678907 11.73678907
6 6 14.65079837 14.65079837 35.83711081 35.83711081 10.45050611 10.45050611


The answer is 203028.

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

Steven Chase
Jan 8, 2021

This isn't a calculus-based solution, but it does illustrate the power of another optimization method. Since the axial unit vector can be described using spherical angular parameters θ \theta and ϕ \phi , there are four unknown values ( x 0 , y 0 , θ , ϕ ) (x_0, y_0, \theta, \phi) . Using a hill-climbing algorithm, explore the four-dimensional parameter space and search for an optimal solution in the following way:

1) On each loop iteration (over many iterations), "mutate" the four parameters. Do this by moving a very small distance in a random direction within the four-dimensional space.

2) Using the mutated parameters, create the cylinder axis. Determine the distance from each of the six points to the axis. Equation 9 from this Wolfram Mathworld page is useful for calculating the distances. Per the Wolfram convention, the axis is defined by two points on a line segment.

3) Ideally, all six distances from the points to the axis should be the same. Form a "residual" as shown below. We want this residual to be as close to zero as possible.

Residual = d 1 d 2 + d 2 d 3 + d 3 d 4 + d 4 d 5 + d 5 d 6 + d 6 d 1 \text{Residual} = |d_1-d_2| + |d_2-d_3| + |d_3-d_4| + |d_4-d_5| + |d_5-d_6| + |d_6-d_1|

4) If the mutated parameters give a residual smaller than the smallest residual seen thus far, store the new residual and the mutated parameters, thereby converting them into the baseline parameters upon which further mutations will take place. Eventually, the algorithm converges to the optimal solution. The cylinder radius is the common distance d = d 1 = d 2 = d 3 = d 4 = d 5 = d 6 d = d_1 = d_2 = d_3 = d_4 = d_5 = d_6 .

Results are shown below:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#>>> 
#residual
#1.71839460705e-06

#x0,y0
#4.99999973965
#9.00000066422

#radius
#4.75199966755

#theta,phi
#4.45058954749
#2.05948851989

#ux,uy,uz
#-0.228523691009
#-0.852861871745
#-0.469471565029

#S
#203028.0

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

Hosam Hajjir
Jan 10, 2021

If r = ( x , y , z ) r = (x, y, z) is a point on the cylinder, then it satisfies the equation of the cylinder given by,

( r r 0 ) T Q ( r r 0 ) = R 2 (r - r0)^T Q (r - r0) = R^2

The symmetric matrix Q = I u u T Q = I - u u^T , where u u is a unit vector along the axis of the cylinder. Point r 0 = ( x 0 , y 0 , 0 ) r_0 = (x_0, y_0, 0) , and R R is the radius of the cylinder.

Vector u u can be parameterized using two angles θ \theta and ϕ \phi , as follows:

u = ( sin θ cos ϕ , sin θ sin ϕ , cos θ ) u = ( \sin \theta \cos \phi , \sin \theta \sin \phi, \cos \theta )

Our parameter vector is therefore 5-dimensional: x = ( θ , ϕ , x 0 , y 0 , R 2 ) \mathbf{x} = (\theta, \phi, x_0, y_0, R^2)

And for i = 1 , 2 , . . . , 6 i = 1,2,..., 6 , we want

f i = ( r i r 0 ) T Q ( r i r 0 ) R 2 = 0 f_i = (r_i - r_0)^T Q (r_i - r0) - R^2 = 0

One possible numerical method to solve these equations is the Newton-Raphson multivariate method that requires the computation of the Jacobian of the function vector f \mathbf{f} . This can be computed exactly by explicit analytical differentiation of f i f_i , or approximately by numerical differentiation. An initial guess of the parameter vector x 0 \mathbf{x}_0 is made, and iteratively new approximations of the solution are obtained by the Newton-Raphson multivariate recursive formula

x k + 1 = x k J k 1 f k \mathbf{x}_{k+1} = \mathbf{x}_k - J_k^{-1} \mathbf{f}_k

Note that since the dimension of the unknowns vector is 5 5 , we have to limit the number of equations to 5 5 , or otherwise use the Penrose inverse J # J^\# of matrix J J instead of the regular inverse; the formula for the Penrose (left) inverse is J # = ( J T J ) 1 J T J^\# = (J^T J)^{-1} J^T .

For this particular problem, it might be difficult to come up with a good initial guess, so an external loop to set the initial values for some of the parameters (for example, θ \theta and ϕ \phi is necessary. In my implementation, I used an external double loop to set the initial guess of θ 0 \theta_0 and ϕ 0 \phi_0 , so that I could guarantee the convergence of the Newton-Raphson iteration.

After a few initial guesses, the Newton-Raphson method converged to x = ( 1.082104136 , 7.592182246 , 5 , 9 , 22.581504 ) \mathbf{x}^* = ( 1.082104136, 7.592182246, 5, 9, 22.581504 )

So that the axis of the cylinder is given by

u = ( 0.228523653 , 0.852861883 , 0.469471563 ) u = (0.228523653 , 0.852861883 , 0.469471563 )

x 0 = 5 , y 0 = 9 , R = 22.581504 = 4.752 x_0 = 5 , y_ 0 = 9 , R = \sqrt{22.581504} = 4.752

Therefore, S = 20.3028571 S = 20.3028571 , making the answer 1 0 4 × 20.3028571 = 203028 \lfloor 10^4 \times 20.3028571 \rfloor = \boxed{203028}

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...