# bessel_k (MathScript RT Module Function)

LabVIEW 2012 MathScript RT Module Help

Edition Date: June 2012

Part Number: 373123C-01

»View Product Info Download Help (Windows Only)

Requires: MathScript RT Module

## Syntax

kv = bessel_k(v, x)

kv = bessel_k(v, x, 1)

[kv, error] = bessel_k(v, x)

[kv, error] = bessel_k(v, x, 1)

Legacy Name: `besselk`

## Description

Computes the modified Bessel function of the second kind of a given order.

Details

Examples

## Inputs

Name Description
v Specifies the order of the Bessel function. v is a real, double-precision, floating-point, positive scalar, vector, or matrix.
x Specifies the value for which you want to compute the Bessel function. x is a real or complex, double-precision, floating-point scalar, vector, or matrix.
1 Scales the computation. bessel_k(v, x, 1) scales bessel_k(v, x) by exp(x).

## Outputs

Name Description
kv Returns the modified Bessel function of the second kind. kv is a real or complex, double-precision, floating-point scalar, vector, or matrix.
error Returns error information about the evaluation of the Bessel function. error is a matrix of integers in which each element can return the following values.

 0 Indicates that no error occurred. 1 Indicates that you specified invalid inputs. 2 Indicates that the result is too large for the data type of kv. Use the scaling option 1. 3 Indicates that LabVIEW achieved less than half the machine accuracy in the calculation because |x| or v is greater than approximately 1.3E8. 4 Indicates that the result is meaningless because |x| or v is greater than approximately 1.8E16. 5 Indicates that the calculation did not reach the termination condition so LabVIEW did not complete the calculation.

## Details

bessel_k(v, x) solves the following equation: x2*w''+x*w'-(x2+v2)*w = 0.
The following equation is a well-known representation for bessel_k(v, x): bessel_k(v, x) = (pi/2)*(bessel_i(-v, x)-bessel_i(v, x))/sin(v*pi).

The following table lists the support characteristics of this function.

 Supported in the LabVIEW Run-Time Engine Yes Supported on RT targets Yes Suitable for bounded execution times on RT Not characterized

## Examples

X = [0:0.01:2];
KV = bessel_k(2, X);
plot(X, KV)