-------------------------------------------------------------------------------

                             Vectors 1.0 Library
                               Library # 1190

                               by Felipe Jordao

-------------------------------------------------------------------------------



Introduction
------------

This library contains functions for manipulating symbolic vectors in the
coordinate systems supported by the HP48 G series calculator.  It will not work
on the SX because of G specific functions.

The programs can be used in any of the coordinate systems (Rectangular,
Cylindrical, Spherical) and will give the answer depending on what mode the
calculator is on.

Terms used in these instructions:

rs    --- right shift key
ls    --- left shift key
theta --- the theta symbol, [alpha][rs][F]
phi   --- the small phi symbol, [alpha][ls][EVAL][alpha][rs][9]
          or echoed from the CHARS menu (easier)
v|    --- square root sign



Coordinates
-----------

The programs only support specific coordinate variables.
When you enter the vector you must use these variables:

system              variables

Rectangular         x, y, z      (note: these are lower case)
Cylindrical         r, theta, z
Spherical           r, theta, phi

You can cange the coordinate system of the calculator by pressing [rs][MODES]
or [ls][MODES] in the [ANGL] directory



Entering Symbolic Vectors
-------------------------

Symbolic vectors can be entered as lists on the 48.
To enter the vector: (x*y)i - (3*x^2*z)j
You key in:   { 'x*y' '-3*x^2*z' 0 }

Notice there is a zero at the end of the list.  This is because the vector we
are using is in two dimensions, so you must set the k unit vector to zero.

If you have a vector: (2*w) etheta   in cylindrical coordinates
(note etheta is the unit vector in the theta direction)
You make sure the calculator is in Cylindrical mode (so the functions work)
You key in:   { 0 '2*w' 0 }

Notice the zeros again



Functions
---------

Dot

  Dot product of two vectors

  takes two vectors on levels 1 and 2 of the stack
  returns their dot product on level 1

Cross

  Cross product of two vectors

  takes two vectors on levels 1 & 2 of the stack
  returns their cross product on level 1

Grad

  Takes the gradient of a scalar field

  takes a symbolic object on level 1
  returns its gradient on level 1

Lapl

  Takes the laplacian
  The divergence of the gradient of a field

  takes the field on level 1
  returns its laplacian on level 1

Div

  Calculates the divergence of a vector field

  takes the vector on level 1
  returns its divergence on level 1

  example:
    calculate the divergence of V
    where V = (e^(v|(xy)))i + (sec^2 yz)j + (x^y)k

    solution
    - make sure you are in rectangular coordinates
    - key in:  { 'EXP(v|(x*y)' 'INV(COS(y*z)^2)' 'x^y' }
    - press the [Div] key
    - the answer is  '.5*EXP(v|(x*y))/v|(x*y)*y+2*COS(y*z)^-3*SIN(x*z)*z'
    - this is the simplest form the HP48 gives, but with some manipulation
      you can get:  (v|y/(2v|x))*e^(v|(xy)) + 2z sec^2(yz) tan(yz)
      which is the same thing that's in the back of my old calc book!  :)


Curl

  Calculates the curl of a vector field

  takes vector on level 1
  returns its curl on level 1

  example:
    Calculate the curl of V in cylindrical coordinates
    where V = (wr)etheta

    solution
    - make sure you are in cylindrical coordinates
    - key in :  { 0 'w*r' 0 }
    - press the [Curl] key
    - the answer is { 0 0 '2*w' }  or (2w)k
    - easy isn't it?

ds

  Shows a table of conversions for each coordinate system
  I though it was useful because sometimes you forget that dy goes to rd(theta)
  and not just d(theta) in cylindrical coords.


-------------------------------------------------------------------------------


Have fun with it.

This version only has a few functions because a lot of people asked me for it,
so I'm releasing this prematurely.  I am working on more stuff like directional
cosines, tensors, angle between two vectors, projection of a vector, etc.

please report any bugs to:  fjordao@eniac.seas.upenn.edu

Note:  the calculator simplifies as much as it can, so if you know the answer
       and it does not match the calculator's answer, make sure you do the
       trig identities and other simplifications before writing saying you
       got the wrong answer.


Felipe Jordao
-- HAC --

