Chapter 4: Partial Differentiation
Section 4.8: Unconstrained Optimization
|
Example 4.8.7
|
|
Line passes through the point P: and has direction . Line passes through the point Q: and has direction . Show that the lines are skew, and find the minimum distance between them. Hint: Parametrize each line with a different parameter and minimize the square of the distance between an arbitrary point on each line.
|
|
|
|
Solution
|
|
|
Mathematical Solution
|
|
•
|
Figure 4.8.7(a) shows line in black, line in red, their common normal in green, and the points between which the distance from one line to the other is measured.
|
•
|
Since = , the lines are not parallel.
|
•
|
Parametric equations for lines and are, respectively
|
|
>
|
use plots in
module()
local p1,p2,p3,p4,p5,A,B;
A:=[3287/1421,-1823/1421,7995/1421];
B:=[3093/1421,-593/203, 5182/1421];
p1:=spacecurve([1+2*t,2-5*t,3+4*t],t=-.4..1.6,color=black,numpoints=2,thickness=3):
p2:=spacecurve([3+3*s,-1+7*s,2-6*s],s=-.8..0.2,color=red,numpoints=2,thickness=3):
p3:=spacecurve([A,B],color=green,numpoints=2):
p4:=pointplot3d([A,B],symbol=solidsphere,symbolsize=20,color=gold);
p5:=display(p1,p2,p3,p4,scaling=constrained,axes=none,labels=[x,y,z],orientation=[-45,55,-15]);
print(p5);
end module:
end use:
|
|
Figure 4.8.7(a) Skew lines and common normal
|
|
|
|
|
|
and .
•
|
The equations are inconsistent, so the lines do not intersect.
|
•
|
Hence, the lines are skew.
|
•
|
The distance between the lines is given by
|
|
|
|
|
|
|
•
|
To minimize , solve the equations
|
|
|
|
|
for .
•
|
The minimum of is then .
|
•
|
This minimum distance is measured between the points
|
and
|
|
Maple Solution - Interactive
|
|
Initialize
|
•
|
Tools≻Load Package: Student Multivariate Calculus
|
|
Loading Student:-MultivariateCalculus
|
Define vectors and
|
•
|
Context Panel: Assign Name
|
|
|
|
Define the points P and Q
|
•
|
Context Panel: Assign Name
|
|
|
|
Form lines and
|
•
|
Write the sequence of names for the point and vector determining the line.
Context Panel: Evaluate and Display Inline
|
•
|
Context Panel: Student Multivariate Calculus≻Lines & Planes≻Line
|
•
|
Context Panel: Assign to a Name≻L[1] or L[2], as appropriate
|
|
=
|
=
|
Show lines and are skew lines
|
•
|
Write the sequence of names for lines and .
Context Panel: Evaluate and Display Inline
|
•
|
Context Panel: Student Multivariate Calculus≻Lines & Planes≻Skew
|
|
=
|
Obtain the distance between lines and
|
•
|
Write the sequence of names for lines and .
Context Panel: Evaluate and Display Inline
|
•
|
Context Panel: Student Multivariate Calculus≻Lines & Planes≻Distance
|
•
|
Context Panel: Approximate≻5 (digits)
|
|
=
|
|
|
The distance between the lines can also be found from first principles by minimizing the distance between points on each line.
Obtain the general point on each line
|
•
|
Write the name of the line.
Context Panel: Evaluate and Display Inline
|
•
|
Context Panel: Student Multivariate Calculus≻Lines & Planes≻Representation≻combined_vector
(Use as the parameter on one line, and as the parameter on the other. See Figure 4.8.7(b).)
|
•
|
Context Panel: Conversions≻To List
|
•
|
Context Panel: Assign to a Name≻ (first line) and (second line)
|
|
Figure 4.8.7(b) Line representation dialog
|
|
|
|
=
|
=
|
Obtain the distance between points and
|
•
|
Write the sequence of names for the generic points and press the Enter key.
|
•
|
Context Panel: Student Multivariate Calculus≻Lines & Planes≻Distance
|
•
|
Context Panel: Simplify≻Simplify
|
•
|
Context Panel: Assign to a Name≻
|
|
|
Determine the values of and that minimize the distance
|
•
|
Write and press the Enter key.
|
•
|
Context Panel: Student Multivariate Calculus≻Differentiate≻Gradient
|
•
|
Context Panel: Conversions≻To List
|
•
|
Context Panel: Solve≻Solve
|
•
|
Context Panel: Assign to a Name≻
|
|
|
Evaluate at the values in
|
•
|
Expression palette: Evaluation template
|
•
|
Context Panel: Evaluate and Display Inline
|
•
|
Context Panel: Simplify≻Simplify
|
|
=
|
|
|
Finally, the two points that are closest, are found by substituting into the generic points and , the values in .
•
|
Expression palette: Evaluation template
|
•
|
Context Panel: Evaluate and Display Inline
|
|
=
|
=
|
|
|
|
|
Maple Solution - Coded
|
|
Initialize
|
•
|
Install the Student MultivariateCalculus package.
|
|
|
•
|
Define the directions of the two lines.
|
|
|
•
|
Define the points through which each line passes.
|
|
|
•
|
Use the Line command to define the two given lines.
|
|
|
Show the lines are skew
|
•
|
Use the AreSkew command to test for skewness.
|
|
=
|
Calculate the distance between the lines
|
|
=
|
Work from first principles
|
•
|
Apply the GetRepresentation command to each line, returning the equations as vectors assigned to the names A and B, respectively. These names then represent generic points on the lines.
|
|
=
|
=
|
Obtain an expression for the distance between points A and B
|
Apply the convert/list command to A and B, and to this, simplify the Distance between them.
|
|
Minimize by forming and solving the equations
|
•
|
Obtain with the Gradient command, and the Equate command to form the componentwise equations in .
|
•
|
Apply the solve command to obtain the minimizing values of and .
|
•
|
Assign the solution to the name .
|
|
=
|
By substitution, obtain the value of the minimum distance
|
Use the eval and simplify commands to obtain the exact value of the minimum distance, and the evalf command to obtain this distance as a floating-point number.
|
=
|
=
|
By substitution, obtain the coordinates of the points between which the minimum distance occurs
|
•
|
Change the vectors A and B to lists with the convert/list command, and make the substitution with the eval command.
|
|
|
|
|
|
|
|
|
<< Previous Example Section 4.8
Next Example >>
© Maplesoft, a division of Waterloo Maple Inc., 2024. All rights reserved. This product is protected by copyright and distributed under licenses restricting its use, copying, distribution, and decompilation.
For more information on Maplesoft products and services, visit www.maplesoft.com
|