camal.tex 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. \chapter[CAMAL: Celestial Mechanics]{CAMAL: Calculations in Celestial Mechanics}
  2. \label{CAMAL}
  3. \typeout{{CAMAL: Calculations in Celestial Mechanics}}
  4. {\footnotesize
  5. \begin{center}
  6. J. P. Fitch \\
  7. School of Mathematical Sciences, University of Bath\\
  8. BATH BA2 7AY, England \\[0.05in]
  9. e--mail: jpff@cs.bath.ac.uk
  10. \end{center}
  11. }
  12. \ttindex{CAMAL}
  13. The CAMAL package provides facilities for calculations in Fourier
  14. series similar to those in the specialist Celestial Mechanics system
  15. of the 1970s, and the Cambridge Algebra system in
  16. particular.\index{Fourier Series}\index{CAMAL}\index{Celestial
  17. Mechanics}
  18. \section{Operators for Fourier Series}
  19. \subsection*{\f{HARMONIC}}\ttindex{HARMONIC}
  20. The celestial mechanics system distinguish between polynomial
  21. variables and angular variables. All angles must be declared before
  22. use with the \f{HARMONIC} function.
  23. \begin{verbatim}
  24. harmonic theta, phi;
  25. \end{verbatim}
  26. \subsection*{\f{FOURIER}}\ttindex{FOURIER}
  27. The \f{FOURIER} function coerces its argument into the domain of a
  28. Fourier Series. The expression may contain {\em sine} and {\em
  29. cosine} terms of linear sums of harmonic variables.
  30. \begin{verbatim}
  31. fourier sin(theta)
  32. \end{verbatim}
  33. Fourier series expressions may be added, subtracted multiplies and
  34. differentiated in the usual \REDUCE\ fashion. Multiplications involve
  35. the automatic linearisation of products of angular functions.
  36. There are three other functions which correspond to the usual
  37. restrictive harmonic differentiation and integration, and harmonic
  38. substitution.
  39. \subsection*{\f{HDIFF} and \f{HINT}}\ttindex{HDIFF}\ttindex{HINT{}}
  40. Differentiate or integrate a Fourier expression with respect to an angular
  41. variable. Any secular terms in the integration are disregarded without
  42. comment.
  43. \begin{verbatim}
  44. load_package camal;
  45. harmonic u;
  46. bige := fourier (sin(u) + cos(2*u));
  47. aa := fourier 1+hdiff(bige,u);
  48. ff := hint(aa*aa*fourier cc,u);
  49. \end{verbatim}
  50. \subsection*{\f{HSUB}}\ttindex{HSUB}
  51. The operation of substituting an angle plus a Fourier expression for
  52. an angles and expanding to some degree is called harmonic substitution.
  53. The function takes 5 arguments; the basic expression, the angle being
  54. replaced, the angular part of the replacement, the fourier part of the
  55. replacement and a degree to which to expand.
  56. \begin{verbatim}
  57. harmonic u,v,w,x,y,z;
  58. xx:=hsub(fourier((1-d*d)*cos(u)),u,u-v+w-x-y+z,yy,n);
  59. \end{verbatim}
  60. \section{A Short Example}
  61. The following program solves Kepler's Equation as a Fourier series to
  62. the degree $n$.
  63. \begin{verbatim}
  64. bige := fourier 0;
  65. for k:=1:n do <<
  66. wtlevel k;
  67. bige:=fourier e * hsub(fourier(sin u), u, u, bige, k);
  68. >>;
  69. write "Kepler Eqn solution:", bige$
  70. \end{verbatim}