Package 'kelvin'

Title: Calculate Solutions to the Kelvin Differential Equation using Bessel Functions
Description: Uses Bessel functions to calculate the fundamental and complementary analytic solutions to the Kelvin differential equation.
Authors: Andrew J Barbour
Maintainer: Andrew J Barbour <[email protected]>
License: GPL (>= 2)
Version: 2.0-2
Built: 2025-01-24 02:53:33 UTC
Source: https://github.com/abarbour/kelvin

Help Index


Fundamental and equivalent solutions to the Kelvin differential equation using Bessel functions

Description

The functions here use Bessel functions to calculate the analytic solutions to the Kelvin differential equation, namely the fundamental (Be) and equivalent (Ke) complex functions.

Details

The complex second-order ordinary differential equation, known as the Kelvin differential equation, is defined as

x2y¨+xy˙(ix2+ν2)y=0x^2 \ddot{y} + x \dot{y} - \left(i x^2 + \nu^2\right) y = 0

and has a suite of complex solutions. One set of solutions, Bν\mathcal{B}_\nu, is defined in the following manner:

BνBerν(x)+iBeiν(x)\mathcal{B}_\nu \equiv \mathrm{Ber}_\nu (x) + i \mathrm{Bei}_\nu (x)

=Jν(xexp(3πi/4))= J_\nu \left(x \cdot \exp(3 \pi i / 4)\right)

=exp(νπi)Jν(xexp(πi/4))= \exp(\nu \pi i) \cdot J_\nu \left(x \cdot \exp(-\pi i / 4)\right)

=exp(νπi/2)Iν(xexp(πi/4))= \exp(\nu \pi i / 2) \cdot I_\nu \left(x \cdot \exp(\pi i / 4)\right)

=exp(3νπi/2)Iν(xexp(3πi/4))= \exp(3 \nu \pi i / 2) \cdot I_\nu \left(x \cdot \exp(-3 \pi i / 4)\right)

where JνJ_\nu is a Bessel function of the first kind, and IνI_\nu is a modified Bessel function of the first kind.

Similarly, the complementary solutions, Kν\mathcal{K}_\nu, are defined as

KνKerν(x)+iKeiν(x)\mathcal{K}_\nu \equiv \mathrm{Ker}_\nu (x) + i \mathrm{Kei}_\nu (x)

=exp(νπi/2)Kν(xexp(πi/4))= \exp(- \nu \pi i / 2) \cdot K_\nu \left(x \cdot \exp(\pi i / 4)\right)

where KνK_\nu is a modified Bessel function of the second kind.

The relationships between yy in the differential equation, and the solutions Bν\mathcal{B}_\nu and Kν\mathcal{K}_\nu are as follows

y=Berν(x)+iBeiν(x)y = \mathrm{Ber}_\nu (x) + i \mathrm{Bei}_\nu (x)

=Berν(x)+iBeiν(x)= \mathrm{Ber}_{-\nu} (x) + i \mathrm{Bei}_{-\nu} (x)

=Kerν(x)+iKeiν(x)= \mathrm{Ker}_\nu (x) + i \mathrm{Kei}_\nu (x)

=Kerν(x)+iKeiν(x)= \mathrm{Ker}_{-\nu} (x) + i \mathrm{Kei}_{-\nu} (x)

In the case where ν=0\nu=0, the differential equation reduces to

x2y¨+xy˙ix2y=0x^2 \ddot{y} + x \dot{y} - i x^2y = 0

which has the set of solutions:

J0(iix)J_0 \left(i \sqrt{i} \cdot x\right)

=J0(2(i1)x/2)= J_0 \left(\sqrt{2} \cdot (i-1) \cdot x / 2\right)

=Ber0(x)+iBei0(x)B0= \mathrm{Ber}_0 (x) + i \mathrm{Bei}_0 (x) \equiv \mathcal{B}_0

This package has functions to calculate Bν\mathcal{B}_\nu and Kν\mathcal{K}_\nu.

Author(s)

Andrew Barbour <[email protected]>

References

Abramowitz, M. and Stegun, I. A. (Eds.). "Kelvin Functions." §9.9\S 9.9 in Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables, 9th printing. New York: Dover, pp. 379-381, 1972.

Kelvin functions: http://mathworld.wolfram.com/KelvinFunctions.html

Bessel functions: http://mathworld.wolfram.com/BesselFunction.html

See Also

Fundamental solution: Beir

Equivalent solution: Keir


Fundamental solution to the Kelvin differential equation (J)

Description

This function calculates the complex solution to the Kelvin differential equation using modified Bessel functions of the first kind, specifically those produced by BesselJ.

Usage

Beir(x, ...)

## Default S3 method:
Beir(x, nu. = 0, nSeq. = 1, return.list = FALSE, ...)

Bei(...)

Ber(...)

Arguments

x

numeric; values to evaluate the complex solution at

...

additional arguments passed to BesselK or Beir

nu.

numeric; value of ν\nu in Bν\mathcal{B}_\nu solutions

nSeq.

positive integer; equivalent to nSeq in BesselJ

return.list

logical; Should the result be a list instead of matrix?

Details

Ber and Bei are wrapper functions which return the real and imaginary components of Beir, respectively.

Value

If return.list==FALSE (the default), a complex matrix with as many columns as using nSeq. creates. Otherwise the result is a list with matrices for Real and Imaginary components.

Author(s)

Andrew Barbour

References

http://mathworld.wolfram.com/KelvinFunctions.html

Imaginary: http://mathworld.wolfram.com/Bei.html

Real: http://mathworld.wolfram.com/Ber.html

See Also

kelvin-package, Keir, BesselJ

Examples

Beir(1:10)    # defaults to nu.=0
Beir(1:10, nu.=2)
Beir(1:10, nSeq.=2)
Beir(1:10, nSeq.=2, return.list=TRUE)


# Imaginary component only
Bei(1:10)

# Real component only
Ber(1:10)

Complementary solution to the Kelvin differential equation (K)

Description

This function calculates the complex solution to the Kelvin differential equation using modified Bessel functions of the second kind, specifically those produced by BesselK.

Usage

Keir(x, ...)

## Default S3 method:
Keir(
  x,
  nu. = 0,
  nSeq. = 1,
  add.tol = TRUE,
  return.list = FALSE,
  show.scaling = FALSE,
  ...
)

Kei(...)

Ker(...)

Arguments

x

numeric; values to evaluate the complex solution at

...

additional arguments passed to BesselK or Keir

nu.

numeric; value of ν\nu in Kν\mathcal{K}_\nu solutions

nSeq.

positive integer; equivalent to nSeq in BesselK

add.tol

logical; Should a fudge factor be added to prevent an error for zero-values?

return.list

logical; Should the result be a list instead of matrix?

show.scaling

logical; Should the normalization values be given as a message?

Details

Ker and Kei are wrapper functions which return the real and imaginary components of Keir,, respectively.

Value

If return.list==FALSE (the default), a complex matrix with as many columns as using nSeq. creates. Otherwise the result is a list with matrices for Real and Imaginary components.

Author(s)

Andrew Barbour

References

http://mathworld.wolfram.com/KelvinFunctions.html

Imaginary: http://mathworld.wolfram.com/Kei.html

Real: http://mathworld.wolfram.com/Ker.html

See Also

kelvin-package, Beir, BesselK

Examples

Keir(1:10)    # defaults to nu.=0, nSeq=1
Keir(1:10, nu.=2)
Keir(1:10, nSeq=2)
Keir(1:10, nSeq=2, return.list=TRUE)


# Imaginary component only
Kei(1:10)

# Real component only
Ker(1:10)