## `linalg::ogCoordTab` -- table of orthogonal coordinate transformations

#### Introduction

`linalg::ogCoordTab` is a table of predefined orthogonal coordinate transformations in R^3.

#### Call(s)

`linalg::ogCoordTab``[ogCoord <, Scales>](u1, u2, u3 <, c...>)`

#### Parameters

`ogCoord` | - | the name of a predefined coordinate system (an identifier)
`u1,u2,u3` | - | names of the coordinates of the specified coordinate system (identifiers)
`c` | - | an arithmetical expression

#### Options

`Scales` | - | returns the scaling factors of the coordinate system `ogCoord`.

#### Returns

a function in the coordinates `u1,u2,u3` of the specified coordinate system. The function returns a list of the three vectors e_u1, e_u2, e_u3, where each vector is a list of three arithmetical expressions.

#### Related Functions

`linalg::curl`, `linalg::divergence`, `linalg::grad`, `linalg::hessian`, `linalg::jacobian`

#### Details

- The entry associated with `ogCoord` defines a coordinate transformation X = T(U), which maps the vector U = [u1,u2,u3] in the corresponding orthogonal coordinate system to a vector X = [x,y,z] in Cartesian coordinates.
- The result of the transformation X = T(U) is a list of three arithmetical expressions in the unknows `u1,u2,u3`.
- Some coordinate systems need additional constants, which appear as additional parameters of the transformation T (see example 2).
- `linalg::ogCoordTab` is used by functions such as `linalg::curl`, `linalg::divergence` and `linalg::grad` to perform computations with respect to other coordinates than Cartesian coordinates.
- `linalg::ogCoordTab` defines the following coordinate transformations with the implicit assumptions 0 <= theta < PI and 0 <= phi < 2*PI:
  `Cartesian`
    -- U = X = [x,y,z]
  `Spherical`
    -- U = [r,theta,phi]

        x = r*sin(theta)*cos(phi)
        y = r*sin(theta)*sin(phi)
        z = r*cos(theta)

    .
  `Cylindrical`
    -- U = [r,phi,z]

        x = r*cos(phi)
        y = r*sin(phi)
        z = z

  `ParabolicCylindrical`
    -- U = [u,v,z]

        x = 1/2*(u^2 + v^2)
        y = u*v
        z = z

  `Torus`
    -- U = [r,theta,phi]

        x = (c - r*cos(theta))*cos(phi)
        y = (c - r*cos(theta))*sin(phi)
        z = r*sin(theta), 0 <= r < c  (c a real constant)

  `RotationParabolic`
    -- U = [u,v,phi]

        x = u*v*cos(phi)
        y = u*v*sin(phi)
        z = 1/2*(u^2 - v^2)

  `EllipticCylindrical`
    -- U = [u,v,z]

        x = c*cosh(u)*cos(v)
        y = c*sinh(u)*sin(v)
        z = z  (c a real constant)

#### Option: Scales

- Returns the scaling factors of the specified coordinate transformation. The scaling factors g1,g2,g3 of a coordinate transformation are defined by g[i]:=|diff(T,u[i])| for i=1,2,3.

#### Example 1

The following call returns the vector [x,y,z] in spherical coordinates, expressed in terms of r, theta and phi:

    >> delete r, theta, phi:
       linalg::ogCoordTab[Spherical](r, theta, phi)

          [[cos(phi) sin(theta), sin(phi) sin(theta), cos(theta)],

             [cos(phi) cos(theta), sin(phi) cos(theta), -sin(theta)],

             [-sin(phi), cos(phi), 0]]

The scaling factors of the corresponding coordinate transformation are:

    >> linalg::ogCoordTab[Spherical,Scales](r, theta, phi)

                               [1, r, r sin(theta)]

#### Example 2

We express the Cartesian coordinates [x,y,z] in elliptic cylindrical coordinates written in terms of u, v and z, choosing c=1:

    >> delete u, v, z:
       linalg::ogCoordTab[EllipticCylindrical](u, v, z, 1)

          -- --     cos(v) sinh(u)           sin(v) cosh(u)         --
          |  |  -----------------------, -----------------------, 0  |,
          |  |          2         2 1/2          2         2 1/2     |
          -- -- (cosh(u)  - cos(v) )     (cosh(u)  - cos(v) )       --

             --       sin(v) cosh(u)           cos(v) sinh(u)         --
             |  - -----------------------, -----------------------, 0  |
             |            2         2 1/2          2         2 1/2     |
             --   (cosh(u)  - cos(v) )     (cosh(u)  - cos(v) )       --

                         --
             , [0, 0, 1]  |
                          |
                         --

To compute the gradient of the vector function 2*x*y+z in elliptic cylindrical coordinates with c=1 we enter:

    >> delete x, y, z:
       linalg::grad(2*x*y + z, [x, y, z],
         linalg::ogCoordTab[EllipticCylindrical,Scales](u, v, z, 1)
       )

                          +-                           -+
                          |             2 y             |
                          |  -------------------------  |
                          |           2          2 1/2  |
                          |  (- cos(v)  + cosh(u) )     |
                          |                             |
                          |             2 x             |
                          |  -------------------------  |
                          |           2          2 1/2  |
                          |  (- cos(v)  + cosh(u) )     |
                          |                             |
                          |              1              |
                          +-                           -+

Do you have questions or comments?
Copyright © SciFace Software GmbH & Co. KG 2000