orthovec.tex 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586
  1. \documentstyle[12pt]{article}
  2. %\documentstyle{paper}
  3. \setlength{\textheight}{9.0in}
  4. \setlength{\textwidth}{6.5in}
  5. \setlength{\oddsidemargin}{-0.0in}
  6. \setlength{\topmargin}{0.0in}
  7. \begin{document}
  8. \begin{center}
  9. {\Large {\bf ORTHOVEC} \\[3ex]
  10. Version 2 of the REDUCE program \\
  11. for 3-D vector analysis in \\
  12. orthogonal curvilinear coordinates }\\
  13. \vspace{1.25in}
  14. {\large James W.~EASTWOOD}\\[2ex]
  15. {\large AEA Technology}\\
  16. {\large Culham Laboratory}\\
  17. {\large Abingdon}\\
  18. {\large Oxon OX14 3DB}\\[2ex]
  19. {\large June 1990} \\
  20. \normalsize
  21. \vspace{0.50in}
  22. Submitted to {\em Computer Physics Communications} \\
  23. \end{center}
  24. \vspace{0.75in}
  25. \begin{abstract}
  26. The revised version of ORTHOVEC is a collection of REDUCE 3.3
  27. procedures and operations which provide a simple to use environment
  28. for the manipulation of scalars and vectors.
  29. Operations include addition,
  30. subtraction, dot and cross products, division, modulus, div,
  31. grad, curl, laplacian, differentiation, integration, ${\bf a \cdot
  32. \nabla}$ and Taylor expansion. Version 2 is summarized in Comp. Phys.
  33. Commun. 64 (1991) 121-122. It differs from the original (Comp. Phys.
  34. Commun. 47 (1987) 139-147) in revised notation and extended capabilities.
  35. \end{abstract}
  36. %\newpage
  37. %\tableofcontents
  38. \newpage
  39. \begin{center}
  40. {\Large{\bf New Version Summary}}
  41. \end{center}
  42. \begin{tabular}{ll}
  43. \underline{Title of program}:&ORTHOVEC\\[2ex]
  44. \underline{Catalogue number}:&AAXY\\[2ex]
  45. \underline{Program obtainable from}: &CPC Program Library,\\
  46. &Queen's University of Belfast, N.~Ireland\\[2ex]
  47. \underline{Reference to original program}: &CPC 47 (1987) 139-147\\[2ex]
  48. \underline{Operating system}:&UNIX, MS-DOS + ARM-OS\\[2ex]
  49. \underline{Programming Language used}: &REDUCE 3.3\\[2ex]
  50. \underline{High speed storage required}: &As for
  51. the underlying PSL/REDUCE \\
  52. &system, typically $>$ 1 Megabyte\\[2ex]
  53. \underline{No. of lines in combined programs and test deck}:&600 \\[2ex]
  54. \underline{Keywords}: & Computer Algebra, Vector Analysis,\\
  55. & series Expansion, Plasma Physics, \\
  56. &Hydrodynamics, Electromagnetics.\\[2ex]
  57. \underline{Author of original program}: &James W. EASTWOOD\\[2ex]
  58. \underline{Nature of Physical Problem}:
  59. &There is a wide range using vector\\
  60. & calculus in orthogonal curvilinear coordinates\\
  61. & and vector integration, differentiation\\
  62. & and series expansion.\\[2ex]
  63. \underline{Method of Solution}: & computer aided algebra using\\
  64. &standard orthogonal curvilinear coordinates\\
  65. &for differential and integral operators.\\[2ex]
  66. \underline{Typical running time}:
  67. & This is strongly problem dependent:\\
  68. &the test examples given took respectively\\
  69. & 10,19 and 48 seconds on a SUN 4/310,\\
  70. &SUN 4/110 and ACORN Springboard. \\[2ex]
  71. \underline{Unusual Features of the Program}:
  72. &The REDUCE procedures use\\
  73. &LISP vectors \cite{r2}
  74. to provide a compact\\
  75. &mathematical notation similar\\
  76. & to that normally found in vector\\
  77. & analysis textbooks.\\
  78. \end{tabular}
  79. \newpage
  80. \section{Introduction}
  81. The revised version of ORTHOVEC is, like the original \cite{r4}, a
  82. collection of REDUCE procedures and operators designed to simplify the
  83. machine aided manipulation of vectors and vector expansions frequently
  84. met in many areas of applied mathematics. The revisions
  85. have been introduced for two reasons: firstly, to add extra capabilities
  86. missing from the original and secondly, to tidy up input and
  87. output to make the package easier to use.
  88. The changes from Version 1 include\\
  89. i) merging of scalar and vector unary and binary operators, $+, - , *, /
  90. $\\
  91. ii) extensions of the definitions of division and exponentiation
  92. to vectors\\
  93. iii) new vector dependency procedures\\
  94. iv) application of L'H\^opital's rule in limits and Taylor expansions\\
  95. v) a new component selector operator\\
  96. vi) algebraic mode output of LISP vector components\\
  97. The LISP vector primitives are again used to store vectors, although
  98. with the introduction of LIST types in algebraic mode in REDUCE
  99. 3.3 \cite{r1}, the implementation may have been more simply achieved
  100. using lists to store vector components.
  101. The philosophy used in Version 2 follows that used in the original:
  102. namely, algebraic mode is used wherever possible. The view
  103. is taken that some computational inefficiencies are
  104. acceptable if it allows coding to be
  105. intelligible to (and thence adaptable by)
  106. users other than LISP experts familiar
  107. with the internal workings of REDUCE.
  108. Procedures and operators in ORTHOVEC fall into the five classes:
  109. initialisation, input-output, algebraic operations, differential
  110. operations and integral operations. Definitions are given in
  111. the following sections, and
  112. a summary of the procedure names and their meanings are give in Table 1.
  113. The final section discusses test examples.
  114. \section{Initialisation}
  115. The procedure VSTART initialises ORTHOVEC. It may be
  116. called after ORTHOVEC has been INputted (or LOADed if a fast load
  117. version has been made) to reset coordinates. VSTART provides a
  118. menu of standard coordinate systems:-
  119. \begin{enumerate}
  120. \item cartesian $(x, y, z) = $ {\tt (x, y, z)}
  121. \item cylindrical $(r, \theta, z) = $ {\tt (r, th, z)}
  122. \item spherical $(r, \theta, \phi) = $ {\tt (r, th, ph) }
  123. \item general $( u_1, u_2, u_3 ) = $ {\tt (u1, u2, u3) }
  124. \item others
  125. \end{enumerate}
  126. which the user selects by number. Selecting options (1)-(4)
  127. automatically sets up the coordinates and scale factors.
  128. Selection option
  129. (5) shows the user how to select another coordinate system.
  130. If VSTART is not called, then the default cartesian coordinates are
  131. used.
  132. ORTHOVEC may be re-initialised to a new coordinate system at any
  133. time during a given REDUCE session by typing
  134. \begin{verbatim}
  135. VSTART $.
  136. \end{verbatim}
  137. \section{Input-Output}
  138. ORTHOVEC assumes all quantities are either
  139. scalars or 3 component vectors.
  140. To define a vector $a$ with components $(c_1, c_2, c_3)$ use
  141. the procedure SVEC as follows
  142. \begin{verbatim}
  143. a := svec(c1, c2, c3);
  144. \end{verbatim}
  145. The standard REDUCE output for vectors when using the terminator ``$;$''
  146. is to list the three components inside square brackets
  147. $[\cdots]$, with each component in prefix form. A replacement for the
  148. standard REDUCE procedure MAPRIN is included in
  149. the package to change the
  150. output of LISP vector components to algebraic notation. The procedure
  151. VOUT (which returns the value of its argument)
  152. can be used to give labelled output of components
  153. in algebraic form: e.g.,
  154. \begin{verbatim}
  155. b := svec (sin(x)**2, y**2, z)$
  156. vout(b)$
  157. \end{verbatim}
  158. The operator {\tt \_} can be used to select a particular
  159. component (1, 2 or 3) for output e.g.
  160. \begin{verbatim}
  161. b_1 ;
  162. \end{verbatim}
  163. \section{Algebraic Operations}
  164. Six infix operators, sum, difference, quotient, times, exponentiation
  165. and cross product, and four prefix
  166. operators, plus, minus, reciprocal
  167. and modulus are defined in ORTHOVEC. These operators can take suitable
  168. combinations of scalar and vector arguments,
  169. and in the case of scalar arguments reduce to the usual definitions of
  170. $ +, -, *, /, $ etc.
  171. The operators are represented by symbols
  172. \begin{verbatim}
  173. +, -, /, *, ^, ><
  174. \end{verbatim}
  175. The composite {\tt ><} is an
  176. attempt to represent the cross product symbol
  177. $\times$ in ASCII characters.
  178. If we let ${\bf v}$ be a vector and $s$ be a scalar, then
  179. valid combinations of arguments of the
  180. procedures and operators and the type of the result
  181. are as summarised below. The notation used is\\
  182. {\em result :=procedure(left argument, right argument) } or\\
  183. {\em result :=(left operand) operator (right operand) } . \\
  184. \underline{Vector Addition} \\
  185. \begin{tabular}{rclcrcl}
  186. {\bf v} &:=& VECTORPLUS({\bf v}) &{\rm or}& {\bf v} &:=& + {\bf v} \\
  187. s &:=& VECTORPLUS(s) &{\rm or} & s &:=& + s \\
  188. {\bf v} &:=& VECTORADD({\bf v},{\bf v}) &{\rm or }& {\bf v} &:=&
  189. {\bf v} + {\bf v} \\
  190. s &:=& VECTORADD(s,s) &{\rm or }& s &:=& s + s \\
  191. \end{tabular} \\
  192. \underline{Vector Subtraction} \\
  193. \begin{tabular}{rclcrcl}
  194. {\bf v} &:=& VECTORMINUS({\bf v}) &{\rm or}&
  195. {\bf v} &:=& + {\bf v} \\
  196. s &:=& VECTORMINUS(s) &{\rm or} & s &:=& + s \\
  197. {\bf v} &:=& VECTORDIFFERENCE({\bf v},{\bf v}) &{\rm or }& {\bf v} &:=&
  198. {\bf v} + {\bf v} \\
  199. s &:=& VECTORDIFFERENCE(s,s) &{\rm or }& s &:=& s + s \\
  200. \end{tabular} \\
  201. \underline{Vector Division}\\
  202. \begin{tabular}{rclcrcl}
  203. {\bf v} &:=& VECTORRECIP({\bf v}) &{\rm or}& {\bf v} &:=& /
  204. {\bf v} \\
  205. s &:=& VECTORRECIP(s) &{\rm or} & s &:=& / s \\
  206. {\bf v} &:=& VECTORQUOTIENT({\bf v},{\bf v}) &{\rm or }& {\bf v} &:=&
  207. {\bf v} / {\bf v} \\
  208. {\bf v} &:=& VECTORQUOTIENT({\bf v}, s ) &{\rm or }& {\bf v} &:=&
  209. {\bf v} / s \\
  210. {\bf v} &:=& VECTORQUOTIENT( s ,{\bf v}) &{\rm or }& {\bf v} &:=&
  211. s / {\bf v} \\
  212. s &:=& VECTORQUOTIENT(s,s) &{\rm or }& s &:=& s / s
  213. \\
  214. \end{tabular} \\
  215. \underline{Vector Multiplication}\\
  216. \begin{tabular}{rclcrcl}
  217. {\bf v} &:=& VECTORTIMES( s ,{\bf v}) &{\rm or }& {\bf v} &:=&
  218. s * {\bf v} \\
  219. {\bf v} &:=& VECTORTIMES({\bf v}, s ) &{\rm or }& {\bf v} &:=& {\bf
  220. v} * s \\
  221. s &:=& VECTORTIMES({\bf v},{\bf v}) &{\rm or }& s &:=& {\bf
  222. v} * {\bf v} \\
  223. s &:=& VECTORTIMES( s , s ) &{\rm or }& s &:=&
  224. s * s \\
  225. \end{tabular} \\
  226. \underline{Vector Cross Product} \\
  227. \begin{tabular}{rclcrcl}
  228. {\bf v} &:=& VECTORCROSS({\bf v},{\bf v}) &{\rm or }& {\bf v} &:=& {\bf
  229. v} $\times$ {\bf v} \\
  230. \end{tabular} \\
  231. \underline{Vector Exponentiation}\\
  232. \begin{tabular}{rclcrcl}
  233. s &:=& VECTOREXPT ({\bf v}, s ) &{\rm or }& s &:=& {\bf
  234. v} \^~ s \\
  235. s &:=& VECTOREXPT ( s , s ) &{\rm or }& s &:=& s
  236. \^~ s \\
  237. \end{tabular} \\
  238. \underline{Vector Modulus}\\
  239. \begin{tabular}{rcl}
  240. s &:=& VMOD (s)\\
  241. s &:=& VMOD ({\bf v}) \\
  242. \end{tabular} \\
  243. All other combinations of operands for these operators lead to error
  244. messages being issued . The first two instances of vector
  245. multiplication are scalar multiplication of vectors, the third is the
  246. product of two scalars and the last is the inner (dot) product. The
  247. prefix operators {\tt +, -, /} can take either scalar or vector
  248. arguments and return results of the same type as their arguments.
  249. VMOD returns a scalar.
  250. In compound expressions, parenthesis may be used to specify the order of
  251. combination. If parentheses are omitted the ordering of the
  252. operators, in increasing order of precedence is
  253. \begin{verbatim}
  254. + | - | dotgrad | * | >< | ^ | _
  255. \end{verbatim}
  256. and these are placed in the precedence list defined in REDUCE \cite{r1}
  257. after $<$.
  258. The differential operator
  259. DOTGRAD is defined in the
  260. following section, and the component selector {\tt \_} was introduced in
  261. section 3.
  262. Vector divisions are defined as follows: If ${\bf a}$ and ${\bf b}$ are
  263. vectors and $c$ is a scalar, then
  264. \begin{eqnarray*}
  265. {\bf a} / {\bf b} & = & \frac{{\bf a} \cdot {\bf b}}{ \mid {\bf b}
  266. \mid^2}\\
  267. c / {\bf a} & = & \frac{c {\bf a} }{ \mid {\bf a} \mid^2}
  268. \end{eqnarray*}
  269. Both scalar multiplication and dot products are given by the same symbol
  270. , so braces are advisable to ensure the correct
  271. precedences in expressions such as $({\bf a} \cdot {\bf b})
  272. ({\bf c} \cdot {\bf d})$.
  273. Vector exponentiation is defined as the power of the modulus:\\
  274. ${\bf a}^n \equiv {\rm VMOD}(a)^n = \mid {\bf a} \mid^n$
  275. \section{Differential Operations}
  276. Differential operators provided are div, grad, curl, delsq, and dotgrad.
  277. All but the last of these are prefix operators having a single
  278. vector or scalar argument as appropriate. Valid combinations of
  279. operator and argument, and the type of the result are as follows
  280. \begin{tabular}{rcl}
  281. s & := & div ({\bf v}) \\
  282. {\bf v} & := & grad(s) \\
  283. {\bf v} & := & curl({\bf v}) \\
  284. {\bf v} & := & delsq({\bf v}) \\
  285. s & := & delsq(s) \\
  286. {\bf v} & := & {\bf v} dotgrad {\bf v} \\
  287. s & := & {\bf v} dotgrad s
  288. \end{tabular}
  289. All other combinations of operator and argument type cause error
  290. messages to be issued. The differential operators have their usual
  291. meanings \cite{r3}. The coordinate system used by these operators is
  292. set by invoking VSTART (cf. Sec.1). The names {\tt h1},
  293. {\tt h2} and {\tt h3 } are
  294. reserved for the scale factors, and {\tt u1}, {\tt u2} and {\tt u3} are
  295. used for the coordinates.
  296. A vector extension, VDF , of the REDUCE procedure DF allows the
  297. differentiation of a vector (scalar) with respect to a scalar to be
  298. performed. Allowed forms are
  299. VDF({\bf v}, s) $\rightarrow$ {\bf v} and
  300. VDF(s, s) $\rightarrow$ s ,
  301. where, for example\\
  302. \begin{eqnarray*}
  303. {\tt vdf( B,x)} \equiv \frac{\partial {\bf B}}{\partial x}
  304. \end{eqnarray*}
  305. The standard REDUCE procedures DEPEND and NODEPEND have been redefined
  306. to allow dependences of vectors to be compactly
  307. defined. For example
  308. \begin{verbatim}
  309. a := svec(a1,a2,a3)$;
  310. depend a,x,y;
  311. \end{verbatim}
  312. causes all three components {\tt a1},{\tt a2} and {\tt a3} of {\tt a}
  313. to be treated as functions of {\tt x} and {\tt y}.
  314. Individual component dependences can still be defined if desired.
  315. \begin{verbatim}
  316. depend a3,z;
  317. \end{verbatim}
  318. The procedure VTAYLOR gives truncated Taylor series expansions of scalar
  319. or vector functions:-
  320. \begin{verbatim}
  321. vtaylor(vex,vx,vpt,vorder);
  322. \end{verbatim}
  323. returns the series expansion of the expression
  324. VEX with respect to variable VX
  325. about point VPT to order VORDER. Valid
  326. combinations of argument types are as follows:\\
  327. \begin{tabular}{cccc}
  328. VEX & VX & VPT & VORDER \\[2ex]
  329. {\bf v} & {\bf v} & {\bf v} & {\bf v}\\
  330. {\bf v} & {\bf v} & {\bf v} & s\\
  331. {\bf v} & s & s & s \\
  332. s & {\bf v} & {\bf v} & {\bf v} \\
  333. s & {\bf v} & {\bf v} & s\\
  334. s & s & s & s\\
  335. \end{tabular}\\
  336. Any other combinations cause error messages to be issued. Elements of
  337. VORDER must be non-negative integers, otherwise error
  338. messages are issued. If scalar VORDER is given for a vector expansion,
  339. expansions in each component are truncated at the same
  340. order, VORDER.
  341. The new version of Taylor expansion applies
  342. L'H\^opital's rule in evaluating coefficients,
  343. so handle cases such as $\sin(x) / (x) $ , etc.
  344. which the original version of ORTHOVEC could not. The procedure used for
  345. this is LIMIT,
  346. which can be used directly to find the limit of a scalar
  347. function {\tt ex} of variable {\tt x} at point {\tt pt}:-
  348. \begin{verbatim}
  349. ans := limit(ex,x,pt);
  350. \end{verbatim}
  351. \section{Integral Operations}
  352. Definite and indefinite vector, volume and scalar line
  353. integration procedures are included in ORTHOVEC.
  354. They are defined as follows:
  355. \begin{eqnarray*}
  356. {\rm VINT} ({\bf v},x) & = & \int {\bf v}(x)dx\\
  357. %
  358. {\rm DVINT} ({\bf v},x, a, b) & = & \int^b_a {\bf v} (x) dx\\
  359. %
  360. {\rm VOLINT} ({\bf v}) & = & \int {\bf v} h_1 h_2 h_3 du_1 du_2 du_3\\
  361. %
  362. {\rm DVOLINT}({\bf v},{\bf l},{\bf u},n) & = & \int^{\bf u}_{\bf l} {\bf
  363. v} h_1 h_2 h_3 du_1 du_2 du_3\\
  364. %
  365. {\rm LINEINT} ({\bf v, \omega}, t) & = & \int {\bf v} \cdot {\bf dr}
  366. \equiv \int v_i h_i \frac{\partial \omega_i}{\partial t} dt\\
  367. %
  368. {\rm DLINEINT} ({\bf v, \omega} t, a, b) & = & \int^b_a v_i h_i
  369. \frac{\partial \omega_i}{\partial t} dt\\
  370. \end{eqnarray*}
  371. In the vector and volume integrals, ${\bf v}$ are vector or scalar, $a,
  372. b,x$ and $n$ are scalar. Vectors ${\bf l}$ and ${\bf u}$ contain
  373. expressions for lower and upper bounds to the integrals. The integer
  374. index $n$ defines the order in which the integrals over $u_1, u_2$
  375. and $u_3$ are performed in order to allow for functional dependencies in
  376. the integral bounds:
  377. \begin{tabular}{ll}
  378. n & order\\
  379. 1 & $u_1~u_2~u_3$\\
  380. %
  381. 2 & $u_3~u_1~u_2$\\
  382. %
  383. 3 & $u_2~u_3~u_1$\\
  384. %
  385. 4 & $u_1~u_3~u_2$\\
  386. %
  387. 5 & $u_2~u_1~u_3$\\
  388. otherwise & $u_3~u_2~u_1$\\
  389. \end{tabular}
  390. The vector ${\bf \omega}$ in the line
  391. integral's arguments contain explicit paramterisation
  392. of the coordinates $u_1, u_2, u_3$ of the
  393. line ${\bf u}(t)$ along which the integral is taken.
  394. \begin{table}
  395. \centering
  396. \caption{Procedures names and operators used in ORTHOVEC version 2}
  397. \vspace*{5mm}
  398. \begin{tabular}{|l c l|} \hline
  399. Procedures & & Description \\ \hline
  400. VSTART & & select coordinate system \\ & & \\
  401. SVEC & & set up a vector \\
  402. VOUT & & output a vector \\
  403. VECTORCOMPONENT & \_ & extract a vector component (1-3) \\
  404. & & \\
  405. VECTORADD & + & add two vectors or scalars \\
  406. VECTORPLUS & + & unary vector or scalar plus\\
  407. VECTORMINUS & - & unary vector or scalar minus\\
  408. VECTORDIFFERENCE & - & subtract two vectors or scalars \\
  409. VECTORQUOTIENT & / & vector divided by scalar \\
  410. VECTORRECIP & / & unary vector or scalar division (reciprocal)\\
  411. VECTORTIMES & * & multiply vector or scalar by vector or scalar \\
  412. VECTORCROSS & $><$ & cross product of two vectors \\
  413. VECTOREXPT & \^~ & exponentiate vector modulus or scalar \\
  414. VMOD & & length of vector or scalar \\ & & \\
  415. DIV & & divergence of vector \\
  416. GRAD & & gradient of scalar \\
  417. CURL & & curl of vector \\
  418. DELSQ & & laplacian of scalar or vector \\
  419. DOTGRAD & & (vector).grad(scalar or vector) \\ & & \\
  420. VTAYLOR & & vector or scalar Taylor series of vector or scalar \\
  421. VPTAYLOR & & vector or scalar Taylor series of scalar \\
  422. TAYLOR & & scalar Taylor series of scalar \\
  423. LIMIT & & limit of quotient using L'H\^opital's rule \\ & & \\
  424. VINT & & vector integral \\
  425. DVINT & & definite vector integral \\
  426. VOLINT & & volume integral \\
  427. DVOLINT & & definite volume integral \\
  428. LINEINT & & line integral \\
  429. DLINEINT & & definite line integral \\ & & \\
  430. MAPRIN & & vector extension of REDUCE MAPRIN \\
  431. DEPEND & & vector extension of REDUCE DEPEND \\
  432. NODEPEND & & vector extension of REDUCE NODEPEND \\ \hline
  433. \end {tabular}
  434. \end{table}
  435. \section{Test Cases}
  436. To use the REDUCE source version of ORTHOVEC, initiate a REDUCE session
  437. and then IN the file {\em orthovec.red}
  438. containing ORTHOVEC. However, it is recommended that for
  439. efficiency a compiled fast loading version be
  440. made and LOADed when required (see
  441. Sec.~18 of the REDUCE manual \cite{r1}).
  442. If coordinate dependent differential and
  443. integral operators other than cartesian are needed, then VSTART must
  444. be used to reset coordinates and scale factors.
  445. Six simple examples are given in the Test Run Output file
  446. {\em orthovectest.log} to illustrate the working of ORTHOVEC.
  447. The input lines were taken from the file
  448. {\em orthovectest.red} (the Test Run Input), but could
  449. equally well be typed in at the Terminal.
  450. \subsection{Example 1}
  451. Show that
  452. \begin{eqnarray*}
  453. ({\bf a} \times {\bf b}) \cdot ({\bf c} \times {\bf d}) - ({\bf a}
  454. \cdot {\bf c})({\bf b} \cdot {\bf d})
  455. + ({\bf a} \cdot {\bf d})({\bf b} \cdot {\bf c}) \equiv 0
  456. \end{eqnarray*}
  457. \subsection{Example 2}
  458. Write the equation of motion
  459. \begin{eqnarray*}
  460. \frac{\partial {\bf v}}{\partial t} + {\bf v} \cdot {\bf \nabla v}
  461. + {\bf \nabla} p - curl ({\bf B}) \times {\bf B}
  462. \end{eqnarray*}
  463. in cylindrical coordinates.
  464. \subsection{Example 3}
  465. Taylor expand
  466. \begin{itemize}
  467. \item $\sin(x) \cos(y) +e^z$
  468. about the point $(0,0,0)$ to third order in $x$, fourth order in $y$ and
  469. fifth order in $z$.
  470. \item $\sin(x)/x$ about $x$ to fifth order.
  471. \item ${\bf v}$ about ${\bf x}=(x,y,z)$ to fifth order, where
  472. ${\bf v} = (x/ \sin(x),(e^y-1)/y,(1+z)^{10})$.
  473. \end{itemize}
  474. \subsection{Example 4}
  475. Obtain the second component of the equation of motion in example 2, and
  476. the first
  477. component of the final vector Taylor series in example 3.
  478. \subsection{Example 5}
  479. Evaluate the line integral
  480. \begin{eqnarray*}
  481. \int^{{\bf r}_2}_{{\bf r}_1} {\bf A} \cdot d{\bf r}
  482. \end{eqnarray*}
  483. from point ${\bf r}_1 = (1,1,1)$ to point
  484. ${\bf r}_2 = (2,4,8)$ along the path $(x,y,z) = (s, s^2, s^3)$ where\\
  485. \begin{eqnarray*}
  486. {\bf A} = (3x^2 + 5y) {\bf i} - 12xy{\bf j} + 2xyz^2{\bf k}
  487. \end{eqnarray*}
  488. and $({\bf i, j, k})$ are unit vectors in the ($x,y,z$) directions.
  489. \subsection{Example 6}
  490. Find the volume $V$ common to the intersecting cylinders $x^2 + y^2
  491. = r^2$ and $x^2 + z^2 = r^2$ i.e. evaluate
  492. \begin{eqnarray*}
  493. V = 8 \int^r_0 dx \int^{ub}_0 dy \int^{ub}_0 dz
  494. \end{eqnarray*}
  495. where $ub = \overline{\sqrt { r^2 - x^2}}$
  496. \begin{thebibliography}{9}
  497. \bibitem{r4} J.~W.~Eastwood,{\em Computer Phys.~Commun.~}\underline{47}
  498. (1987) 139-147.
  499. \bibitem{r1} A. C. Hearn,{\em REDUCE User's Manual},
  500. (Rand Publication CP78 (Rev. 7/87), 1987.
  501. \bibitem{r2} J. B. Marti, A. S. Hearn, M. L. Griss and C. Griss,\\
  502. {\em Standard LISP Report},
  503. ACM SIGPLAN Notices \underline{14} (1979) 48.
  504. \bibitem{r3} M . Speigel,{\em Vector Analysis}, (Scheum Publishing Co.,
  505. 1959).
  506. \end{thebibliography}
  507. \newpage
  508. \appendix
  509. \begin{center}
  510. {\Large{\bf Appendices}}
  511. \end{center}
  512. \section {Test Run Input}
  513. $\bullet$ Insert file orthovectest.red
  514. \section {Test Run Output}
  515. $\bullet$ Insert file orthovectest.log
  516. \section {Source Listing}
  517. $\bullet$ Insert file orthovec.red
  518. \end{document}