Keystrokes display – HP 15c User Manual

Page 75

Advertising
background image

Section 3: Calculating in Complex Mode

75

To use this program:

1. Enter your function subroutine labeled "B" into program memory.

2. Press 7´m%

to reserve registers R

0

through R

7

. (Your subroutine may

require additional registers.)

3. Set the display format for f.

4. Enter the two complex points that define the ends of the straight line that your

function will be integrated along. The lower limit should be in the Y-registers; the
upper limit should be in the X-registers.

5. Press ´A

to calculate the complex line integral. The value of the integral is in

the X-registers; the value of the uncertainty is in the Y-registers,

Because two integrals are being evaluated, the f program will usually take longer than a
real integral, although the routine doesn't have to use the same number of sample points for
both integrals. The easier integral will use less calculation than the more difficult one.

Example: Approximate the integrals

1

1

/

1

cos

dx

x

x

x

I

and

1

2

/

1

sin

dx

x

x

x

I

.

These integrands decay very slowly as x approaches infinity and therefore require a long
interval of integration and a long execution time. You can expedite this calculation by
deforming the path of integration from the real axis into the complex plane. According to
complex variable theory, these integrals can be combined as

i

iz

dz

z

z

e

iI

I

1

1

2

1

/

1

.

This complex integrand, evaluated along the line x=1 and y≥ 0, decays rapidly as y
increases—like e

-y

.

To use the previous program to calculate both integrals at the same time, write a subroutine
to evaluate

z

z

e

z

f

iz

/

1

)

(

.

Keystrokes

Display

´bB

046-42,21,12

047- 15

|K

048- 43 36

+

049- 40

Calculates z + 1/z.

|K

050- 43 36

1

051- 1

´}

052- 42 30

Forms 0 + i.

*

053- 20

Advertising