Main Content

airy

Airy Functions

Description

W = airy(Z) returns the Airy function, Ai(Z), for each element of Z.

example

W = airy(k,Z) returns any of four different Airy functions, depending on the value of k, such as the Airy function of the second kind or the first derivative of an Airy function.

example

W = airy(k,Z,scale) scales the resulting Airy function. airy applies a specific scaling function to W depending on your choice of k and scale.

example

Examples

collapse all

Define x.

x = -10:0.01:1;

Calculate Ai(x)

ai = airy(x);

Calculate Bi(x) using k=2.

bi = airy(2,x);

Plot both results together on the same axes.

figure
plot(x,ai,'-b',x,bi,'-r')
axis([-10 1 -0.6 1.4])
xlabel('x')
legend('Ai(x)','Bi(x)','Location','NorthWest')

Figure contains an axes object. The axes object with xlabel x contains 2 objects of type line. These objects represent Ai(x), Bi(x).

Compute the Airy function at a slice through the complex plane at x+i.

Take a slice through the complex plane.

x = -4:0.1:4;
z = x+1i;

Calculate Ai(z).

w = airy(z);

Plot the real part of the result.

figure
plot(x, real(w))
axis([-4 4 -1.5 1])
xlabel('real(z)')

Figure contains an axes object. The axes object with xlabel real(z) contains an object of type line.

Define x.

x = -10:0.01:1;

Calculate the scaled and unscaled Airy function.

scaledAi = airy(0,x,1);
noscaleAi =  airy(0,x,0);

Plot the real part of each result.

rscaled = real(scaledAi);
rnoscale = real(noscaleAi);
figure
plot(x,rscaled,'-b',x,rnoscale,'-r')
axis([-10 1 -0.60 0.60])
xlabel('x')
legend('scaled','not scaled','Location','SouthEast')

Figure contains an axes object. The axes object with xlabel x contains 2 objects of type line. These objects represent scaled, not scaled.

Input Arguments

collapse all

System variable, specified as a real or complex vector, matrix, or N-D array.

Data Types: single | double
Complex Number Support: Yes

Type of Airy function, specified as one of four values.

k

Returns

0

Airy function,Ai(Z), which is the same as airy(Z).

1

First derivative of Airy function, Ai(Z).

2

Airy function of the second kind,Bi(Z)

3

First derivative of Airy function of the second kind,Bi(Z)

Data Types: single | double

Scaling option, specified as 0 or 1. Use scale = 1 to enable the scaling of Z. The values you specify for k and scale determine the scaling function airy applies to Z.

scalekScaling applied to output
0Any

None

10 or 1

e23Z(3/2)

12 or 3

e|23Re(Z(3/2))|

Data Types: single | double

Output Arguments

collapse all

Airy function of Z, returned as an array the same size as Z.

More About

collapse all

Airy Functions

The Airy functions form a pair of linearly independent solutions to

d2WdZ2ZW=0.

The relationship between the Airy and modified Bessel functions is

Ai(Z)=[1πZ3]K1/3(ζ)Bi(Z)=Z3[I1/3(ζ)+I1/3(ζ)],

where

ζ=23Z3/2.

References

[1] Amos, D. E. “Algorithm 644: A Portable Package for Bessel Functions of a Complex Argument and Nonnegative Order.” ACM Transactions on Mathematical Software 12, no. 3 (September 1986): 265–273. https://dl.acm.org/doi/10.1145/7921.214331.

Extended Capabilities

Version History

Introduced before R2006a