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

2.4 KiB

title description menu weight
math.yn() function `math.yn()` returns the order-n Bessel function of the second kind.
flux_v0_ref
name parent identifier
math.yn math math/yn
101

math.yn() returns the order-n Bessel function of the second kind.

Function type signature
(n: int, x: float) => float

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

Parameters

n

({{< req >}}) Order number to use in the operation.

x

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

Examples

Return the order-n Bessel function of a value

import "math"

math.yn(n: 3, x: 3.14)// -0.4866506930335083


Use math.yn in map

import "math"

data
    |> map(fn: (r) => ({_time: r._time, _value: math.yn(n: r.n, x: r.x)}))

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

Input data

_time x n
2021-01-01T00:00:00Z 1.2 3
2021-01-01T01:00:00Z 2.4 4
2021-01-01T02:00:00Z 3.6 5
2021-01-01T03:00:00Z 4.8 6
2021-01-01T04:00:00Z 5.1 7

Output data

_time _value
2021-01-01T00:00:00Z -3.589899629613186
2021-01-01T01:00:00Z -1.6023565737844263
2021-01-01T02:00:00Z -1.0581497196727103
2021-01-01T03:00:00Z -0.8050704522628885
2021-01-01T04:00:00Z -1.1643613692219157

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