(*********************************************************************** Mathematica-Compatible Notebook This notebook can be used on any computer system with Mathematica 3.0, MathReader 3.0, or any compatible application. The data for the notebook starts with the line of stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. ***********************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 10370, 234]*) (*NotebookOutlinePosition[ 11029, 258]*) (* CellTagsIndexPosition[ 10985, 254]*) (*WindowFrame->Normal*) Notebook[{ Cell["\<\ Quaternion version of the following problem: Given the curvature and torsion, find the curve. - Quaternion frame equation version, modeled after the full Frenet frame version, \"plotintrinsic3d\" in Alfred Gray's \"Modern Differential Geometry of Curves and Surfaces\" 1st and 2nd editions by Andrew Hanson, Computer Science Dept., Indiana University. (1994-2000)\ \>", "Section"], Cell["\<\ Put in Quaternion Frame equations, model after Gray's integration of the complete 9-component Frenet-Serret equations: Initial parameters are in the list in 2nd argument: sz = curve param value at which BC are specified qplot[] shows just the quaternions. qplot3dx[] takes initial curve coordinates and finds the curve in 3-space with the indicated curvatures as well.\ \>", "Subsection", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(<< "\"\)], "Input", AspectRatioFixed->True], Cell[BoxData[ RowBox[{ RowBox[{ \(qplot[{k1_, k2_, k3_}, { sz_: 0, {qz0_: 1, qz1_: 0, qz2_: 0, qz3_: 0}}, {smin_: 0, smax_: 1}, angle_: 0, opts___]\), ":=", RowBox[{"ParametricPlot3D", "[", RowBox[{ RowBox[{"Evaluate", "[", RowBox[{"Module", "[", RowBox[{\({q0, q1, q2, q3}\), ",", RowBox[{ \({q1[s], q2[s], N[Cos[angle]\ q3[s] + Sin[angle]\ q0[s]]} \), "/.", RowBox[{"NDSolve", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{ SuperscriptBox["q0", "\[Prime]", MultilineFunction->None], "[", "ss", "]"}], "==", \(1\/2\ \((\(-k2[ss]\)\ q1[ss] - k3[ss]\ q2[ss] + k1[ss]\ q3[ss])\)\)}], ",", RowBox[{ RowBox[{ SuperscriptBox["q1", "\[Prime]", MultilineFunction->None], "[", "ss", "]"}], "==", \(1\/2\ \((k2[ss]\ q0[ss] - k1[ss]\ q2[ss] + k3[ss]\ q3[ss])\)\)}], ",", RowBox[{ RowBox[{ SuperscriptBox["q2", "\[Prime]", MultilineFunction->None], "[", "ss", "]"}], "==", \(1\/2\ \((k3[ss]\ q0[ss] + k1[ss]\ q1[ss] + k2[ss]\ q3[ss])\)\)}], ",", RowBox[{ RowBox[{ SuperscriptBox["q3", "\[Prime]", MultilineFunction->None], "[", "ss", "]"}], "==", \(1\/2\ \((\(-k1[ss]\)\ q0[ss] - k3[ss]\ q1[ss] - k2[ss]\ q2[ss])\)\)}], ",", \(q0[sz] == qz0\), ",", \(q1[sz] == qz1\), ",", \(q2[sz] == qz2\), ",", \(q3[sz] == qz3\)}], "}"}], ",", \({q0, q1, q2, q3}\), ",", \({ss, smin, smax}\)}], "]"}]}]}], "]"}], "]"}], ",", \({s, smin, smax}\), ",", "opts"}], "]"}]}], ";"}]], "Input", AspectRatioFixed->True], Cell[BoxData[ RowBox[{ RowBox[{ \(qplot3dx[{k1_, k2_, k3_}, { sz_: 0, {xz1_: 0, xz2_: 0, xz3_: 0}, {qz0_: 1, qz1_: 0, qz2_: 0, qz3_: 0}}, {smin_: 0, smax_: 1}, opts___]\), ":=", RowBox[{"ParametricPlot3D", "[", RowBox[{ RowBox[{"Evaluate", "[", RowBox[{"Module", "[", RowBox[{\({x1, x2, x3, q0, q1, q2, q3}\), ",", RowBox[{\({x1[s], x2[s], x3[s]}\), "/.", RowBox[{"NDSolve", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{ SuperscriptBox["q0", "\[Prime]", MultilineFunction->None], "[", "ss", "]"}], "==", \(1\/2\ \((\(-k2[ss]\)\ q1[ss] - k3[ss]\ q2[ss] + k1[ss]\ q3[ss])\)\)}], ",", RowBox[{ RowBox[{ SuperscriptBox["q1", "\[Prime]", MultilineFunction->None], "[", "ss", "]"}], "==", \(1\/2\ \((k2[ss]\ q0[ss] - k1[ss]\ q2[ss] + k3[ss]\ q3[ss])\)\)}], ",", RowBox[{ RowBox[{ SuperscriptBox["q2", "\[Prime]", MultilineFunction->None], "[", "ss", "]"}], "==", \(1\/2\ \((k3[ss]\ q0[ss] + k1[ss]\ q1[ss] + k2[ss]\ q3[ss])\)\)}], ",", RowBox[{ RowBox[{ SuperscriptBox["q3", "\[Prime]", MultilineFunction->None], "[", "ss", "]"}], "==", \(1\/2\ \((\(-k1[ss]\)\ q0[ss] - k3[ss]\ q1[ss] - k2[ss]\ q2[ss])\)\)}], ",", RowBox[{ RowBox[{ SuperscriptBox["x1", "\[Prime]", MultilineFunction->None], "[", "ss", "]"}], "==", \(q0[ss]\^2 + q1[ss]\^2 - q2[ss]\^2 - q3[ss]\^2\)}], ",", RowBox[{ RowBox[{ SuperscriptBox["x2", "\[Prime]", MultilineFunction->None], "[", "ss", "]"}], "==", \(2\ q1[ss]\ q2[ss] + 2\ q0[ss]\ q3[ss]\)}], ",", RowBox[{ RowBox[{ SuperscriptBox["x3", "\[Prime]", MultilineFunction->None], "[", "ss", "]"}], "==", \(2\ q3[ss]\ q1[ss] - 2\ q0[ss]\ q2[ss]\)}], ",", \(x1[sz] == xz1\), ",", \(x2[sz] == xz2\), ",", \(x3[sz] == xz3\), ",", \(q0[sz] == qz0\), ",", \(q1[sz] == qz1\), ",", \(q2[sz] == qz2\), ",", \(q3[sz] == qz3\)}], "}"}], ",", \({x1, x2, x3, q0, q1, q2, q3}\), ",", \({ss, smin, smax}\)}], "]"}]}]}], "]"}], "]"}], ",", \({s, smin, smax}\), ",", "opts"}], "]"}]}], ";"}]], "Input", AspectRatioFixed->True], Cell["\<\ Examples: Gray: figures on p. 147. (1st edition) . p224 (2nd edition) My sign convention reverses the curvature; in general, there are three curvatures, kx, ky, and kz, which is zero for the Frenet frame. The second figure seems to be incorrect in first edition of the book; I \ think this version is correct; in fact, it has been corrected to match mine in the second \ edition.\ \>", "Subsubsection"], Cell[BoxData[ \(qplot[{\(-Abs[#1]\)&, .3&, 0&}, {0, {1, 0, 0, 0}}, {0, 2\ \[Pi]}, \[Pi]\/2, AxesLabel \[Rule] {x, y, z}, \n\t PlotLabel -> "\<3D projection of the quaternions alone\>", \n\t PlotRange -> {{\(-1\), 1}, {\(-1\), 1}, {\(-1\), 1}}, PlotPoints \[Rule] 100]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(qplot3dx[{\(-Abs[#1]\)&, 0.3&, 0&}, {0, {0, 0, 0}, {1, 0, 0, 0}}, { \(-10\), 10}, Axes \[Rule] None, AxesLabel \[Rule] {x, y, z}, PlotPoints \[Rule] 500]\)], "Input", AspectRatioFixed->True], Cell[BoxData[ \(qplot3dx[{\(-1.3\)&, .5\ Sin[#1]&, 0&}, {0, {0, 0, 0}, {1, 0, 0, 0}}, { 0, 4\ \[Pi]}, AxesLabel \[Rule] {x, y, z}, PlotPoints \[Rule] 200]\)], "Input", AspectRatioFixed->True] }, FrontEndVersion->"X 3.0", ScreenRectangle->{{0, 1280}, {0, 1024}}, CellGrouping->Manual, WindowSize->{560, 789}, WindowMargins->{{150, Automatic}, {Automatic, 52}} ] (*********************************************************************** Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. ***********************************************************************) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[1709, 49, 397, 10, 230, "Section"], Cell[2109, 61, 468, 11, 147, "Subsection", Evaluatable->False], Cell[2580, 74, 94, 2, 27, "Input"], Cell[2677, 78, 2687, 51, 282, "Input"], Cell[5367, 131, 3797, 69, 348, "Input"], Cell[9167, 202, 419, 10, 138, "Subsubsection"], Cell[9589, 214, 336, 6, 97, "Input"], Cell[9928, 222, 227, 4, 43, "Input"], Cell[10158, 228, 208, 4, 43, "Input"] } ] *) (*********************************************************************** End of Mathematica Notebook file. ***********************************************************************)