Accelerating the pace of engineering and science

# Documentation Center

• Trial Software

# airy

Airy Functions

## Description

example

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.

## Examples

expand all

### Airy Function of Real-Valued x

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');```

### Airy Function of Complex-Valued Input

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)');```

### Scaled Airy Function

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');```

## Input Arguments

expand all

### Z — System variablevector | matrix | N-D Array

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

Data Types: single | double
Complex Number Support: Yes

### k — Type of Airy function0 (default) | 1 | 2 | 3

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

k

Returns

0

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

1

First derivative of Airy function, .

2

Airy function of the second kind,

3

First derivative of Airy function of the second kind,

Data Types: single | double

### scale — Scaling option0 (default) | 1

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

12 or 3

Data Types: single | double

## Output Arguments

expand all

### W — Airy function of Zvector | matrix | N-D Array

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

expand all

### Airy Functions

The Airy functions form a pair of linearly independent solutions to

The relationship between the Airy and modified Bessel functions is

where