mech-math 0.3.4

Math library for the Mech language
Documentation
math/j1
===============================================================================

%% Bessel function of the first kind, order 1

1. Usage
-------------------------------------------------------------------------------

```mech:disabled
Y := math/j1(X)
```

2. Description
-------------------------------------------------------------------------------

Computes the Bessel function of the first kind of order 1, `J₁(x)`, for each element of `X`.  
This special function arises in problems with cylindrical symmetry, such as electromagnetic waves, vibrations, and heat conduction.

The function is defined as:

$$ J_1(x) = \sum_{m=0}^{\infty} \frac{(-1)^m}{m!(m+1)!} \left( \frac{x}{2} \right)^{2m+1}

3. Input
-------------------------------------------------------------------------------

| Argument | Kind               | Description                         |
|----------|--------------------|-------------------------------------|
| `X`      | `float`, `[float]` | Input value(s), real. |

4. Output
-------------------------------------------------------------------------------

| Argument | Kind               | Description                                    |
|----------|--------------------|------------------------------------------------|
| `Y`      | matches input      | Values of the Bessel function of order 1 at each input point. |

5. Examples  
-------------------------------------------------------------------------------

(a) Compute the Bessel J1 function of a number

```mech:ex1
y := math/j1(0.0)
```

(b) Compute the J1 function for a vector of numbers

```mech:ex2
x := [0.0, 1.0, 2.0, 3.0]
y := math/j1(x)
```

(c) Compute the J1 function for a matrix

```mech:ex3
x := [0.0, 2.0; 4.0, 6.0]
y := math/j1(x)
```

6. Details
-------------------------------------------------------------------------------

- $$J1(0) = 0$$
- $$J1(x)$$ oscillates and decays in amplitude as $$x → ∞$$.
- Appears in many physics and engineering applications involving cylindrical symmetry.

Special cases:

- $$j1(±∞) = 0$$
- $$j1(NaN) = NaN$$