## `linalg::vectorPotential` -- vector potential of a three-dimensional vector field

#### Introduction

`linalg::vectorPotential``(j, x)` returns the vector potential of the vector field j(x) with respect to x. This is a vector field v with curl(v,x) = f.

#### Call(s)

`linalg::vectorPotential(j, [x1, x2, x3] <, Test>)`

#### Parameters

`j` | - | a list of three arithmetical expressions, or a 3-dimensional vector (i.e., a 3 x 1 or 1 x 3 matrix of a domain of category `Cat::Matrix`)
`x1,x2,x3` | - | (indexed) identifiers

#### Options

`Test` | - | `linalg::vectorPotential` only checks whether the vector field `j` has a vector potential and returns `TRUE` or `FALSE`, respectively.

#### Returns

a vector with three components, i.e., an 3 x 1 or 1 x 3 matrix of a domain of category `Cat::Matrix`, or a boolean value.

#### Related Functions

`linalg::curl`, `linalg::divergence`, `linalg::grad`

#### Details

- The vector potential of a vector function `j` exists if and only if the divergence of `j` is zero. It is uniquely determined.
- If the vector potential of `j` does not exist, then `linalg::vectorPotential` returns `FALSE`.
- If `j` is a vector then the component ring of `j` must be a field (i.e., a domain of category `Cat::Field`) for which definite integration can be performed.
- If `j` is given as a list of three arithmetical expressions, then `linalg::vectorPotential` returns a vector of the domain `Dom::Matrix()`.

#### Example 1

We check if the vector function j(x,y,z)=[x^2*y,-1/2*y^2*x,-x*y*z] has a vector potential:

    >> delete x, y, z:
       linalg::vectorPotential(
         [x^2*y, -1/2*y^2*x, -x*y*z], [x, y, z], Test
       )

                                       TRUE

The answer is yes, so let us compute the vector potential of j:

    >> linalg::vectorPotential(
         [x^2*y, -1/2*y^2*x, -x*y*z], [x, y, z]
       )

                                  +-          -+
                                  |       2    |
                                  |    x y  z  |
                                  |  - ------  |
                                  |      2     |
                                  |            |
                                  |     2      |
                                  |  - x  y z  |
                                  |            |
                                  |      0     |
                                  +-          -+

We check the result:

    >> linalg::curl(%, [x, y, z])

                                   +-        -+
                                   |    2     |
                                   |   x  y   |
                                   |          |
                                   |       2  |
                                   |    x y   |
                                   |  - ----  |
                                   |     2    |
                                   |          |
                                   |  -x y z  |
                                   +-        -+

#### Example 2

The vector function j=[x^2,2*y,z] does not have a vector potential:

    >> linalg::vectorPotential([x^2, 2*y, z], [x, y, z])

                                       FALSE

#### Changes

- The result is a vector even if the vector field is given as a list of expressions.

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