orthovec.tex 22 KB

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