docs-v2/content/flux/v0/stdlib/math/j0.md

3.3 KiB

title description menu weight
math.j0() function `math.j0()` returns the order-zero Bessel function of the first kind.
flux_v0_ref
name parent identifier
math.j0 math math/j0
101

math.j0() returns the order-zero Bessel function of the first kind.

Function type signature
(x: float) => float

{{% caption %}} For more information, see Function type signatures. {{% /caption %}}

Parameters

x

({{< req >}}) Value to operate on.

Examples

Return the order-zero Bessel function of a value

import "math"

math.j0(x: 1.23)// 0.656070571706025


Use math.j0 in map

import "sampledata"
import "math"

sampledata.float()
    |> map(fn: (r) => ({r with _value: math.j0(x: r._value)}))

{{< expand-wrapper >}} {{% expand "View example input and output" %}}

Input data

_time *tag _value
2021-01-01T00:00:00Z t1 -2.18
2021-01-01T00:00:10Z t1 10.92
2021-01-01T00:00:20Z t1 7.35
2021-01-01T00:00:30Z t1 17.53
2021-01-01T00:00:40Z t1 15.23
2021-01-01T00:00:50Z t1 4.43
_time *tag _value
2021-01-01T00:00:00Z t2 19.85
2021-01-01T00:00:10Z t2 4.97
2021-01-01T00:00:20Z t2 -3.75
2021-01-01T00:00:30Z t2 19.77
2021-01-01T00:00:40Z t2 13.86
2021-01-01T00:00:50Z t2 1.86

Output data

_time _value *tag
2021-01-01T00:00:00Z 0.12150949471274336 t1
2021-01-01T00:00:10Z -0.1848208162077201 t1
2021-01-01T00:00:20Z 0.2837448367876356 t1
2021-01-01T00:00:30Z -0.09816636158288365 t1
2021-01-01T00:00:40Z -0.0602560278685108 t1
2021-01-01T00:00:50Z -0.3360414225378073 t1
_time _value *tag
2021-01-01T00:00:00Z 0.17516950223786715 t2
2021-01-01T00:00:10Z -0.18737219444686604 t2
2021-01-01T00:00:20Z -0.4014060549361743 t2
2021-01-01T00:00:30Z 0.1779340476167977 t2
2021-01-01T00:00:40Z 0.18809934034815845 t2
2021-01-01T00:00:50Z 0.30507973268984145 t2

{{% /expand %}} {{< /expand-wrapper >}}