0% found this document useful (0 votes)
20 views110 pages

Hp27s19b Tech en

This document provides step-by-step solutions and technical applications for the HP-27S and HP-19B calculators, focusing on advanced solver techniques and various scientific and engineering applications. It includes instructions on using the LET and GET functions, entering equations, and troubleshooting common errors. The content is structured to assist users in maximizing the capabilities of their calculators through practical examples and detailed explanations.

Uploaded by

readytoroll50
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views110 pages

Hp27s19b Tech en

This document provides step-by-step solutions and technical applications for the HP-27S and HP-19B calculators, focusing on advanced solver techniques and various scientific and engineering applications. It includes instructions on using the LET and GET functions, entering equations, and troubleshooting common errors. The content is structured to assist users in maximizing the capabilities of their calculators through practical examples and detailed explanations.

Uploaded by

readytoroll50
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 110

Step-by-Step Solutions

For Your HP Calculator


Technical Applications

HP-275
HP-19B
(fip HEWLETT
PACKARD
Technical Applications
Step-by-Step Solutions
for Your HP-27S or HP-19B Calculator

(,‘p HEWLETT
PACKARD

Edition 2 November 1988


Reorder Number (00027-90044
Notice
This book and any keystroke programs contained herein are provided “as
is” and are subject to change without notice. Hewlett-Packard Company
makes no warranty of any kind with regard to this book or the keystroke
programs contained herein, including, but not limited to, the implied
warranties of merchantability and fitness for a particular purpose.
Hewlett-Packard Company shall not be liable for any errors or for
incidental or consequential damages in connection with the furnishing,
performance, or use of this book or the keystroke programs contained
herein.

o Hewlett-Packard Company 1988. All rights reserved. Reproduction,


adaptation, or translation ofthis book, including any programs, is prohi-
bited without prior written permission by Hewlett-Packard Company;
except as allowed under the copyright laws. Hewlett-Packard Company
grants you the right to use any program contained in this book in a
Hewlett-Packard calculator.

The programs that control your calculator are copyrighted and all rights
are reserved. Reproduction, adaptation, or translation of those programs
without prior written permission of Hewlett-Packard Companyis also
prohibited.

Corvallis Division
1000 N.E. Circle Blvd.
Corvallis, OR 97330, U.S.A.

Printing History

Edition 1 November 1987 Mfg. No. 00027-90045


Edition 2 November 1988 Mfg. No. 00027-90053
Contents
5 How To Use This Book
6 Keys and Menu Selection
7 Display Formats and Numeric Input
8 Entering Equations

1 9 Advanced Solver Techniques


10 Using LET and GET
10 Function Descriptions
11 Intermediate Variables
12 Reducing Keystrokes With LET
14 How LET and GET Change an Equation
14 Using New and Old Values
16 When Not to Use LET and GET
17 Arranging Menu Variables
19 Solving for More Than One Variable at a Time
21 Evaluation Order
23 Forcing Iteration
24 More on Using the ¥ Function
24 Definite and Indefinite Loops
25 Simulating an Indefinite Loop
28 Using Trigonometric Functions
29 In Conclusion
30 Reference

Contents 3
31 Technical Application Equations
32 Greatest Common Divisor and Least Common Multiple
33 The GCD and LCM Equation
33 Example Problems
36 Numerical Integration
37 The Integration Equation
38 Example Problems
42 Numerical Differentiation
43 Choosing h
44 The Differentiation Equation
45 Example Problems
47 Minimum/Maximum Problems
52 Factors and Primes
52 The Factors and Primes Equation
54 Example Problems
56 Vector Operations
57 The Vector Operations Equation
58 Example Problems
64 Complex Number Operations
64 The Complex Operations Equation
69 Example Problems
74 Triangle Solutions
74 Triangle Formulas
76 The Triangle Solutions Equation
78 Example Problems
84 3 X 3 Matrix Operations
84 Defining Equations
85 Solving a System of Linear Equations
86 The 3 x 3 Matrix Operation Equation
88 Example Problems
94 Coordinate Transformations
95 Coordinate Transformation Formulas
95 The Coordinate Transformation Equation
98 Example Problems

4 Contents
How To Use This Book
By purchasing this book, Technical Applications, you’ve shown that you’re
interested in getting the most from your Hewlett-Packard calculator. In
the pages that follow, we’ll help you achieve that goal.

This book divided into two chapters. In Chapter 1, advanced techniques


for writing Solver equations are discussed. In Chapter 2, a number ofsci-
ence and engineering-related applications and examples are presented. It
is not necessary to read the material on advanced Solver equation-writing
before using an application. Simply turn to the appropriate topic in
Chapter 2 and enter the equation you need. Likewise,it is not necessary
to understand the specific applications if you only wish to learn the
advanced Solver techniques described in Chapter 1. How you use the
book is best determined by your particular needs and wants. However,
before you try the examples in this book, you should be familiar with cer-
tain concepts from the owner’s manual:

m The basics of your calculator — how to write Solver equations and


assign values to variables, how to solve for an unknown variable in an
equation, how to recall Solver variables, how to move from menu to
menu, and how to enter and edit lists.
m Entering numbers and using the built-in functions (LN, %, TAN,
ABS,etc.)

This portion of the book contains important information on the examples


in this book and provides a quick review of selected calculator operations.
While this book presents basic equations and theory for each application
topic,it should not be considered a text on these subjects. For more
information on the topics encountered, you can consult the references
listed at the end of each topic or any good textbook.

How To Use This Book 5


The examplesin this book demonstrate approaches to solving certain
problems, but by no means exhaust the many possible ways to obtain an
answer.

Please take a moment to familiarize yourself with the formats used in this
book.

Keys and Menu Selection


A box represents a key on the calculator keyboard:
[+] %]

S o

INPUT

Theshift key is represented by the symbol M. Thus, shifted keys appear


as:

u
Il CLEAR DATA
u
H SHOW

A menu labelis represented like this:

=PMT= (found in the menu)


=STDEVE (found in the menu)
=DOT= (a user-created variable in a Solver equation)

6 How To Use This Book


Some menus contain sub-menus accessed by pressing the appropriate
menu key (these are listed in the owner’s manual). Also, some menus
include more labels than can be displayed above the six redefinable menu
keys. Press = MORE = to see the other menu options.

Display Formats and Numeric Input

The examplesin this book will use a display format of 4 decimal places
(FIX 4) except where noted. If your display is set such that the numeric
displays do not match exactly, you can modify your display format with the
menu on the HP-27S or the menu on the HP-19B, and the
= FIX £ key within these menus. If you wish to see the full 12-digit preci-
sion of a number regardless of the display format, simply press l ;
the full precision numberis displayed as long as you hold down the
key.

Negative numbers are created using the key:

Keys: Display:
39.087 [+/-][=] -39.0870
29 M [E]30[+/-][=] -2.9000E30

Negative exponents of ten are created using the -] key:

Keys: Display:
1.408 W [E][-]27[=] 1.4080E-27
2.55 M [E][-]15[+/-][=] -2.5500E-15

How To Use This Book 7


Entering Equations
When entering equations on your calculator, follow the instructions in the
Solver chapter of your owner’s manual, and in "Advanced Solver Tech-
niques." Here are hints to help you in common errorsituations:
m If the calculator displays INVALID EQUATION when you press
= CALC =, the calculator does not understand something in the equa-
tion. When the equation returns to the display, the cursor blinks
where the calculator detected the error. Check the equation in the
display against the equation in the book. Make sure the parentheses
match and the operators are where they should be. If the equation
includes a logical operator ("AND" or "OR"), make certain that you
include a space on both sides of the operator.
If the calculator accepts the equation but your answer does not match
the example, check the values stored in the variables by recalling them
(press then the menu key). If the values are correct, return to
the menu by pressing and check the equation against the
one in this book for accuracy. When you find an error, edit the equa-
tion and then press = CALC = to display the menu of variables again.
If the calculator displays INSUFFICIENT MEMORY when you
press or = CALC =, you must clear portions of memory before
continuing. Refer to "Managing Calculator Memory" in appendix A of
your owner’s manual and to the conclusion of "Advanced Solver Tech-
niques" in this book for additional information.

The equations in this book use variable names that are intended to
remind you of what to store. Feel free to change them to something more
meaningful to you.

Our thanks to Steven J. Sabin of Oregon State University for developing the
problems and Solver equations in this book.

How To Use This Book


Advanced Solver Techniques
To help you utilize the full power and flexibility of your calculator, several
advanced techniques and two new and powerful functions, LET and GET,
are introduced in this chapter. As was mentioned in "How To Use This
Book," it is not necessary to read this chapterif you are only interested in
using a specific application. Simply turn to the appropriate topic in
Chapter 2 and key in the equation. However, the Solver equations used in
the applications incorporate many of the advanced techniques presented
here. Thus, if you want to understand what you are keying in, read this
chapter first.

1: Advanced Solver Techniques 9


Using LET and GET

Function Descriptions
These two functions are not covered in your owner’s manual. However,
yow’ll find them useful in a variety of applications. LET assigns the value
of an algebraic expression (or number) to a specific variable. GET recalls
the contents of a specific variable. The format for these two functionsis:

Function: Description:
L (variable name : algebraic Evaluates the algebraic expression,
expression) stores the result in the specified vari-
able, and also returns that result as
the value of the LET function.
G (variable name) Returns the contents ofthe specified
variable.

Like ¥ and IF, LET and GET are for use only in Solver equations. Thus,
you will not find these functions on a calculator key or in any menu. To
use LET and GET in a Solver equation, simply type the letters G or L and
include the parentheses around the arguments. If a variable appears only
as the first argument of a LET function and/or only as the argument of a
GET function,it will not appear in the menu of variables.

There are many ways in which LET and GET enhance the capabilities of
your Solver, and we will describe each of these in the pages that follow.
First, a few examples will help introduce you to these two powerful func-
tions.

* The GET here has no relation to GET in the , [SuM] , and menus of the
HP-19B, or to GET in the [STAT] menu of the HP-27S.

10 1: Using LET and GET


Example 1. The Solver equation A=L(D:B+C)+SIN (D) stores
the sum of B and C in D, and addsthis result to the sine of D when cal-
culating 4. The LET function causes the value of D used in the argu-
ment of the sine function to be B + C. Notice that when this equation is
"CALC"ed, 4,B, C, and D all appear in the menu, butit is not neces-
sary to explicitly enter a value for D since the LET function does so
automatically.

Example 2. The Solver equation A=L(D:B+C)+SIN(G(D)) is


functionally identical to the last example when calculating a result for 4,
but here the GET function is used in computing the sine of D. When this
equation is "CALC"ed, D does not appear in the menu. This is because D
only appears as the first argument of the LET function and as the argu-
ment of the GET function in this Solver equation. In the last example, D
was the argument of the SIN function (an appearance outside the first
argument of LET or GET), and thus did appear in the menu.

Intermediate Variables

Normally, whenever you use a variable in a Solver equation,it will appear


in the menu. When variables are used in this manner they are referred to
as formal variables or simply variables when no distinction is necessary.
However, there are two cases in which a variable will not appear in the
menu:
1. The only occurrence of a variable is as the counter variable of the
function.
2. The only occurrence ofa variable is as the first argument of LET
and/or as the argument of GET.

The second case wasillustrated in Example 2 for the variable D. When a


variable is used only as the first argument of LET and as the argument of
GETit is given the special name intermediate variable. This is because
intermediate variables hold intermediate results that can be used
repeatedly in an equation, even though such variables do not appear in the
menu. The user cannot directly assign a, value to an intermediate variable.
Keeping an intermediate variable from appearing in the menu avoids con-
fusion since the menu prompts only for relevant variables.

1: Using LET and GET 11


Example 3. The equationa =b + ¢ — In(b +¢) +x®*° can be imple-
mented by the Solver equation

A=L(D:B+C)-LN(G(D)) +X~G(D).
Here, D serves as an intermediate variable and will not show up in the
menu. The use of D in this manner avoids having to type B+C more
than once in the equation and keeps D from appearing in the menu, a
source of possible confusion since there is no variable d in the original
equation.

Reducing Keystrokes With LET


In some instances you may wish to use the LET function to reduce
keystrokes (as shown in the previous examples), yet still view the value of
the variable used with the LET function. This is accomplished by simply
including the variable formally one or more times in your equation, thus
causing it to appear in the menu of variables. An example will help clarify
this.

Example 4. The Solver equation from Example 3 can be changed


slightly to A=L(D:B+C)—LN (D) +X~D. Notice that the GET func-
tion has simply been removed and now D appears formally two times; as
the argument ofIn, and as the power to which x is raised. We havestill
employed LET to reduce redundant keystrokes (typing B+C more than
once), but now the sum b + ¢ can be viewed by recalling D .

A practical application of these last two techniques is in the calculation of


planetary orbits as shown in the next example.

12 1: Using LET and GET


Example 5: Orbits of Planets. The equation in polar coordinates for
a planet’s orbit about the sun is given by:
p=—2Pr
1+ecosf
where:
roV 2
e =0—0_1 .
GM
Here, r is the orbital radius, 6 is the angle swept out by the planetasit
orbits, p is the distance between the focus and directrix (the orbitis
always one of the conic sections), 7, is the planet’s orbital radiusat its
closest approach to the sun, vis its speed at the point of closest
approach, G is the universal gravitational constant, and M is the mass of
the sun.

To simplify the orbital equation, we have used the variable e. You are
probably familiar with this method of notation for complicated expres-
sions. In an analogous manner, repetitive keystrokes can be eliminated in
a Solver equation by using the variable E. The following Solver equation
for the planet’s orbit uses ANG to represent 6.

R=PxL (E:ROxSQ (VO0) =+ (GxM) —1) + ( 1+ExCOS (ANG) )


Here we have used the LET function to assign a value to E and thus elim-
inate the need to type the rather long expression for E again later in the
equation. Since the variable e in the original equations has special
significance (the eccentricity of orbit), E is not used as an intermediate
variable; instead, it appears formally as a multiplier of cos# and thus
appears in the menu of variables. If it were not necessary to view E , the
Solver equation

R=PxL (E:ROxSQ (V0) + (GxM) —1) + (1+G (E) xCOS (ANG) )


could be used. Notice that the only change made from the previous
Solver equation is to employ the GET function with E. We havestill used
LET to reduce keystrokes by assigning a value to E, and the equation is
functionally identical to the previous Solver equation when R is solved for.
However, now E does not appear in the menu. In this case, E is used as
an intermediate variable.

1: Using LET and GET 13


How LET and GET Change an Equation
In many cases, when an unknown variable appears only once as a formal
variable, the Solver algebraically rearranges the equation to isolate a direct
solution. However,if an unknown variable appears formally more than
once, the direct solution method always fails and the Solver attempts to
locate a solution iteratively. When a variable appears as the first argu-
ment of LET or as the argument of GET,it is not considered by the
Solver in determining whether a direct solution can be found. Thus, a
variable may occur many times in an equation, yet only once formally. In
these instances, a direct solution may be found, butit will not normally be
"correct" mathematically. The next example will clarify this.

Example 6. The Solver equation A=2xA+B is solved iteratively for A


(since A appears twice formally) such that 4 = —B. On the other hand,
the Solver equation A=2xG (A) +B is treated much differently. When
A is solved for, a direct solution is found (4 appears formally only once).
The Solver multiplies the current contents ofA by 2, adds the contents of
B, and storesthis result as the new value of4 .

Using New and Old Values


As shown in "How LET and GET Change and Equation," the Solver will
often return a solution that is not "correct” in the strict mathematical
sense when LET and GET occur in an equation. Actually, this result is
quite useful and allows LET and GET to be used to assign new values to
variables using the values they currently contain. This technique can be
used in recursive problems; i.e., problems in which the next value of the
output is dependent on the old output.

Whenever you encounter an equation in which the unknown variable


appears as both a formal variable and as the argument of a GET function,
the GET function will use the current value of the variable (the value of
the variable when the calculation is initiated).

14 1: Using LET and GET


A helpful aid in understanding thisis to think of the variable as behaving
in two different ways:
1. Where it appears formally, the variable is used as it would normally
be in finding a solution to an equation;i.e.,it can be algebraically
rearranged to find a direct solution or used to find an iterative solu-
tion.
2. As the argument of a GET function, the variable is treated as
though it were a constant, not an unknown. The value used is the
current value as previously described.

In the LET function, the Solver does not check to see if a variable appears
on both sides of the colon. Instead, it simply evaluates the algebraic
expression on the right side of the colon using the current values of all
variables. This result is assigned as the new value of the variable on the
left side ofthe colon.

Some specific examples will demonstrate these features.

Example 7. Consider the Solver equation A=G (A)+1. Since A only


appears once formally, the direct Solver is used. This equation recalls the
current value ofA (by the GET function) then adds 1. This result is then
assigned as the new value ofA. Thus,this simple equation increments 4
by 1 each time A4 is calculated.

Example 8. Like the last example, the Solver equation


Q=L (A:A+1) alsoincrements A by 1. In this case, Q is calculated
instead of4. As mentioned above, the right side of the colon in the LET
argument (A+1) is evaluated using the current value ofA and this result
is assigned as the new value of4. Note that 4 appears on the right side
of the colon in the LET argument and therefore appears in the menu
when the equation is "CALC"ed.

The next example shows a practical use of these techniques.

1: Using LET and GET 15


Example 9: Taylor Series Expansion. The Taylor Series expansion
fore is

How many terms are needed in the series to express e accurately to 4


decimal places?

The Solver equation E=G (E)+1+FACT (L(J:J+1)) will accom-


plish this. The GET used with E causes E to appear only once formally,
and thus the direct method is used when E is solved for. The GET tech-
nique of Example 7 is used to add a new term (1/j!) to the current value
of E each time E is calculated. This new result is then returned as the
"solution" for E .

Using the LET technique of Example 8, the equation increments J by 1


each time E is calculated. When the equation is "CALC"ed, E and J
appear in the menu of variables. You should set E initially by storing a
zero in it, since the sum should begin by GETting a zero value for E .
From the defining equation for the series expansion ofe, the sum should
start at j =0. J in the Solver equation is set to —1 initially so that the
value of J used by the factorial function is zero the first time E is calcu-
lated.

To view the full precision of the number as the Solver adds each term in
the series, select the display format "ALL". You will find that E must be
calculated 8 times to express e accurately to 4 decimal places. Thus, 8
terms (j =0 to 7) are needed to achieve the specified accuracy.

When Not to Use LET and GET


There are times when you mustiterate to find the solution to an equation.
The previous examples have shown how LET and GET change the way an
equation is evaluated when their arguments are unknowns. Sometimes
this can result in a direct solution that is not the desired solution.

16 1: Using LET and GET


Consider the equation x = —e”. This is a transcendental equation; i.e., it
cannot be algebraically manipulated to isolate a solution for x. Here it is
necessary to iteratively find a solution. If you write the Solver equation
X=—EXP (G (X) ) with hopes that the Solver will somehow find a direct
solution (since, formally, X only appears once), you are asking for a
mathematical impossibility. The Solver equation above takes the base e,
raises it to the X th power based on an initial value of X', and assigns the
negative of this result as the final value of X.

Arranging Menu Variables


At times you may wish to arrange your equation variables in a specific
order in the menu. There are two ways to do this.

LET and GET Method. Recall that a variable only appears in a menu
when it appears formally in an equation. When you press = CALC = after
entering an equation, the Solver scans from left to right in your equation
and assigns variables to the menu in the order in which they are encoun-
tered. A variable is not considered by the Solver in menu assignments
under the following conditions:
1. When a variableis used as a counter variable in the ¥ function.
2. When a variableis used as the first argument of LET.
3. When a variable is used as the argument of GET.

This technique is shown in the example below.

Example 10. The equation a =/n (bd ) +e° +d? can haveits variables
arranged alphabetically using the Solver equation A=LN (BxG (D) )
+EXP (C) +SQ (D). Since D first occurs as the argument of a GET
function,it is not assigned to the menu until it is encountered as a formal
variable in the term SQ (D).

1: Using LET and GET 17


@ This technique of arranging menu variables is most useful
when certain variables will not be unknowns. If the Solver
Note equation of Example 10 is used to calculate D, the GET
function causes new and old values of D to be used rather
than a true algebraic solution. If the equation always calculates variables
other than D, it is perfectly acceptable.

Multiplication by 0 Method. Unlike the LET and GET method, mul-


tiplication by zero does not cause the Solver to use new and old values of a
variable. Instead, the true mathematical integrity of the equation is
preserved. The next example shows how.

Example 11. The Solver equation of Example 10 can be rewritten as


A=LN ( (B+0xC)xD) +EXP (C) +SQ (D). This will arrange the
menu variables alphabetically and still allow all variables to be calculated.
Notice that as the Solver scans this equation, it encounters the formal
variables in the order 4, B, C, and D . The multiplication by zero adds
nothing to the argument ofthe natural logarithm function and its sole pur-
pose is to arrange the variables alphabetically in the menu.

d Multiplication by zero causes variables that appear only


once in a defining equation to appear more than once in a
Note Solver equation. If these variables are unknown, the Solver
will iteratively locate a solution since they appear formally
more than once. For example, C appears formally twice in the Solver
equation above even though it appears only once in the defining equation
of Example 10. Thus, when C is calculated, the Solver will locate a solu-
tion iteratively.

18 1: Using LET and GET


Solving for More Than One Variable at a Time
In the last example, multiplication by zero was used to arrange the menu
of variables in a Solver equation. Multiplication by zero has another very
powerful use in Solver equations...assigning a result to more than one vari-
able when a single unknown is calculated. This is done by employing the
LET function and multiplication by zero. An example will illustrate this
technique.

Example 12: Nautical Depth Conversions. Nautical depths are


often measured in fathoms. Since most people do not "think" in terms of
fathoms, conversion to more customary units is desirable. To convert
from fathomsto feet, multiply by 6.000012; to convert from fathoms to
meters multiply by 1.828804. A Solver equation that converts fathoms to
feet and meters at the same time is

FT=FATHx6.000012+0xL(M: FATHx1.828804) +0xM.

Here we assume that fathoms (FATH) is the known quantity, and feet
(FT) and meters (M) are unknown. Notice that when FT is calculated,
the Solver multiplies FATH by the proper conversion factor. Then, the
LET function is multiplied by zero so thatits value will not affect the value
of FT. The LET function will assign the proper value to M. We have
also included the term OXM to cause M to appear formally and hence, in
the menu of variables. When FT is calculated, the Solver returns a
proper result and stores the number of meters in M. To see M, you must
recall it using =M=

# This technique of solving for more than one unknown is


most useful when certain variables will not be unknowns.
Note The Solver equation of Example 12 is intended to be used
only when FATH is known and FT and M are to be found.
Solving for M will result in the message SOLUTION NOT FOUND
since the direct Solver will attemptto isolate M and a division by zero
error occurs. In general, this technique should not be employed when al/
variables in an equation will be calculated.

1: Using LET and GET 19


The next example combines several of the techniques you have learned so
far to solve a practical problem.

Example 13: Complex Multiplication. To multiply two complex


numbersx =a +1b andy =c +id, use the formula
xy=(ac -bd) + i(bc +ad).
A Solver equation can be written that calculates the product, stores the
real part of the product as a and the imaginary part as b, and leaves ¢
and d unchanged. This makes the equation useful for chain calculations.

Equation: Comments:
OxL (R: AxG (C) —BxG (D) ) Stores the real part of the product xy
in the intermediate variable R. The
intermediate variable R is employed
since we do not want to store the
real part of the product in A4 yet.
Before 4 can be assigned a new
value, the current value of4 is
needed to calculate the imaginary
part of the product. Notice that
GET is used with C and D so that
the menu of variables will be in the
order4,B,C,D, and XY. This can
be verified by looking at the equation
as a whole and noting the order in
which the values appear formally
when scanning from left to right.
+0xL (B : BxC+AxD) Stores the imaginary part of the pro-
ductxy inB.

20 1: Using LET and GET


+L(A:G(R))=XY Stores the real part of the product xy
in A since the original value of4 is
no longer needed. GET is used with
R since it is an intermediate variable
and is not to appear in the menu.
Notice that all the LET functions
except this one are multiplied by
zero. Thus, when XY is solved for,
the Solver uses a direct solution
method (XY appears formally only
once) and effectively reduces the
equation to XY =R. When XY is
solved for, the real part of the pro-
duct is displayed and the real and
imaginary parts of the product are
stored in A and B respectively.
Notice that C and D are left
unchanged.

Since the real part of the product is returned as the value of XY, this elim-
inates having to press = A = after every calculation to see the real
part of the product. To see the imaginary part, press =B=.

An application with a several complex number functions has been


developed in Chapter 2 of this book using the ideas in this equation.

Evaluation Order
As your Solver equations become increasingly more sophisticated, you
may find that using LET and GET takes a bit of forethought to insure
that the Solver assigns and recalls values in the order you intended. When
calculating an unknown, your calculator effectively rearranges the equa-
tion and either isolates the variable in question and solves for it directly,
or uses an iterative process. During rearrangement, the simple left-to-
right order of evaluation may be disturbed.

1: Using LET and GET 21


For example, when G (X)+Y=0xL(X:4+X)+4 issolved forY,itis
not obvious if the GET or LET is performed first. Actually, the Solver
performs the LET before the GET in this equation.

Most ambiguities in using LET and GET can be avoided by observing the
following guidelines:
1. Place all LET and GET functions on the same side of an equalsign.
2. Try to group the variable(s) you are calculating on the other side of
the equalssign.

When these guidelines are followed, you can assume that the simple left-
to-right evaluation process occurs.

22 1: Using LET and GET


Forcing lteration
Although the idea of forcing iteration was introduced in your owner’s
manual, it bears repeating here. An equation such as 1=sinx can be
solved directly for x, but there are an infinite number ofsolutions to this
equation given by x = +(2n + 1)xr/2 for n =0,1,2,.... The Solver will find
the root corresponding to the principle value ofthe sine function.

In general, the trigonometric functions operate using the principle value.


If you are interested in a root that is not a principle value, you can re-write
the equation in a mathematically equivalent form that forces an iterative
solution. This allows you to enterinitial guesses instructing the Solver to
look for a root between the two bounds.

The equation above can be entered as the Solver equation


1=0xX+SIN (X). This forces an iterative search since X appears for-
mally twice.

1: Forcing lteration 23
More on Using the X Function

Definite and Indefinite Loops


A loop is a technique used by computer programmers to repeat a certain
section of instructions a number of times before continuing to other
instructions. Often, the loop is executed a fixed number of times (a
definite loop), while other times the loop repeats indefinitely until a cer-
tain condition is met. The second type of loop is referred to as an
indefinite loop.

l
A=0
N=1

AzA+N?

=N+3

N=N+1

No No

Yes Yes

Definite Loop Indefinite Loop

24 1: More on Using the ¥ Function


The definite loop illustrated in the figure will generate the sum of the
squares of the integers 1 through 10. Notice that A is 0 initially, the loop
counter N is 1 initially, and the loop counter is incremented by 1 with
each pass through the loop. The definite loop is performed a fixed
number of times (10 in this case). On the other hand, the indefinite loop
repeats indefinitely until the desired condition (X<100) is met.

By using the ¥ function you can effectively include definite loops in your
equations. In fact, the ¥ function was designed to operate as a definite
loop. Indefinite loops may also arise. While you are not able to construct
a true indefinite loop for reasons that are explained below, you can
effectively simulate one.

Simulating an Indefinite Loop


The ¥ function is defined as follows:

Y(cvicI:c2:s:alg)

where the algebraic expression (alg) is evaluated and summed for values
of the counter variable (cv). The counter variable starts with value ¢
and is incremented in steps of s to a final value of c2.

When the ¥ function is first encountered in an equation, the Solver stores


the step size s and the counter variable’s initial and final values ¢! and c2
in a special location in memory not accessible to the user. Any attempt to
alter the values of s, cv, cI, or c2 using the LET function causes the
Solver to create separate variables of the same name. Since the value of
these variables cannot be changed, a loop cannot be prematurely exited.
Thisis precisely what makes construction of a true indefinite loop impos-
sible. However, an indefinite loop can be simulated as shown in the next
example.

1: More on Using the X Function 25


Example 14: An Indefinite Loop. To simulate the indefinite loop
shown in the previous figure, the X function can be performed until the
desired condition (X<100) is met. Then the loop can simply add zeros to
this result on subsequent passes until the final value of the counter vari-
able is reached. To avoid having too few or far too many loop repetitions,
a way is needed to determine in advance the maximum number of loops
necessary to meet the desired condition and to assign this value to c2.

For the example at hand, we must find the number of times n that X
must be divided by 3. Thisis given by the equation
snstsal <100.

If thisis solved for n , we obtain the maximum number of loops needed to


obtain the desired result (X<100). Rearranging and taking the logarithms
of both sides we have


100 =3
3* — In In( 100 )=nln3
= .

Solving for n, we obtain the final result

(g
Xinitial

In3
This value of n is the value for c2 that guarantees sufficient passes
through the loop. The Solver equation is shown below.

Equation: Comments:
A= The variable we will calculate.
Y(N:1: The counter variable is N andis set
initially to 1.
IF(X<=300:1: Thisis the final value of the counter
IN(X+100)+LN(3)+1): variable. The conditional check
made by the IF insures that at
least 1 loop will be performed (if X
is less than 300, » is less than 1). In
the event that X >300, the result for

26 1: More on Using the X Function


n derived above is used with a small
change: here we have added a 1to
the result. If this had not been done,
the loop would only be performed
n —1 times instead of n times.
1: This is the step value; i.e., N is incre-
mented by 1 each time the loop is
repeated.
IF(X<=100 AND N<>1: The body of the loop. If X is less
0:0xL(X:X+3))) than or equal to 100 and it is not the
first pass through the loop (N #1), a
zero is added to the loop and X
remains unchanged. If X is greater
than 100 or N =1 (first pass), the
current value ofX is divided by 3
and this result is assigned as the new
value of X. Notice that the LET
function is multiplied by zero causing
the ¥ function to have a value of
zero. The 3 closing parentheses are
needed to complete the LET func-
tion, the IF function, and the ¥ func-
tion respectively.
+X This term simply adds the final value
of X to the value of the ¥ function
(which is zero as noted above) leav-
ing the effective result 4 =X. This
final value of X is returned as the
solution for 4.

A practical use of this Solver technique can be found in the application


"Greatest Common Divisor and Least Common Multiple" in Chapter 2 of
this book.

1: More on Using the X Function 27


Using Trigonometric Functions
Equations involving trigonometric functions often demand thatthe vari-
ables be in radians rather than degrees. For example, in a branch of
mathematics known as Fourier Transforms, the sinc function arises and is
defined as
sinx
sincx =

Here, x must be in radians; however,it is often desirable to enter x in


either radians or degrees. A convenient way to accomplish this is with a
conditional check, illustrated in the following Solver equation:

SINC=IF(SIN(30)=.5:SIN(X)=+RAD(X) :SIN(X)=X).
Notice that the conditional check is true only when the calculatoris in
degrees mode. Although you must be aware of what mode the calculator
is in when entering numbers in this Solver equation, this technique elim-
inates the need to always set radians mode and the need for two separate
Solver equations (one for degrees and one for radians).

fi The sinc function has the indeterminate value 0/0 at x =0.


By a technique of calculus known as L’Hopital’s Rule, the
Note sinc function can be shown to approach 1 as x approaches0.
Thus, the sinc function is defined as 1 atx =0. To give a
correct result for x =0, the above Solver equation can be modified slightly
to:

SINC=IF(X=0:1:IF(SIN(30)=.5:SIN(X)+RAD(X):
SIN(X)+X)).

28 1: Using Trigonometric Functions


In Conclusion
Although it is unlikely that you will want to use every application in this
book, they represent operations that arise frequently in science and
engineering. For this reason, you will probably want to keep several
applications in your calculator’s memory. To give yourself plenty of room
to store and "CALC" the application Solver equations, we recommend
that you delete the example equations created in this chapter after you
have worked through them.

Recall from your owner’s manual that Solver variables are "remembered"
by the calculator for use in moving from one Solver equation to another.
These variables consume a significant amount of calculator memory and
should be periodically reviewed and deleted as described in your owner’s
manual.

1: In Conclusion 29
30 1: Reference
2
Technical Application Equations
The topics included in this chapter contain Solver equations used in many
science and engineering-related applications. In most cases, the examples
have been chosen to reflect typical uses for such equations in engineering
practice.

2: Technical Application Equations 31


Greatest Common Divisor and Least
Common Multiple
In some situations it is preferable to use fractions rather than decimals to
express numbers (e.g. 1/17 rather than 0.05882). The techniques of
adding, subtracting, multiplying, and dividing fractions require the ability
to find greatest common divisors and least common multiples. Although
simple in theory, thisis often a tedious process.

The basic algorithm used in finding the greatest common divisor for two
integers @ and b is as follows:
1. Ifb = 0, GCD(a,b) +a and execution stops.
2. Ifb#0, 2z (a modbd),a—b,and b+—z. Returnto 1.

The least common multiple of @ and b is found by

ab
LCM(a,b)=m.

The equation uses an indefinite loop similar to the one that was discussed
in "More on Using the ¥ Function" in Part 1 of this book. Of particular
importance is a formula that gives the maximum number of divisions M
needed to arrive at a zero remainder. This formula is given as:

Forn>a>b>0, M = 2.0781n(n)-.328

The development ofthis result as well as the algorithm aboveis in the


reference cited following the examples.

32 2: Greatest Common Divisor and Least Common Multiple


The GCD and LCM Equation
Equation: Comments:

LCM/GCD: Equation name.


OxL(A1l:A)xL(B1l:B) Storesinitial values of @ and b for
use by LCM routine.
+X(N:0:2.078x Sets loop parameters, including the
LN(A+1)—-.328+1:1: maximum number of divisions (loop
repetitions) required.
IF(B=0:0:0xL(Z: GCD algorithm.
MOD (A:B) ) +0xL(A:B)
+0xL(B:G(2))))
+A Value of GCD(a,b) after loop is
completed.
=IF (S (GCD) :GCD: Generates the proper result (GCD
G (Al)xG (B1)=LCM) or LCM) depending upon what you
are solving for.

Remarks on Using the Equation.


m The larger of the two numbers must be entered as 4.
m The equation is designed to operate on positive integers only.
®m You may wish to set your display format to "ALL" to eliminate extra
trailing zeros since only integers are used.
m The equation assigns new values to 4 and B when calculating LCM or
GCD; thus, the original values ofA and B are lost.

Example Problems
Check to see that you have entered the equation described above prop-
erly, then press = CALC = to display the menu of variables.

2: Greatest Common Divisor and Least Common Multiple 33


Example 1. Find the greatest common divisor and least common multi-
ple of 406 and 266.

Keys: Display: Description:

BMODES Set the display format


=ALLE" to ALL to eliminate
trailing zeros.
406 =A= A=406 Stores a.

266 =B= B=266 Stores b .

=GCD= GCD=14 Greatest common divi-


SOr.

406 ZA= A=406 Re-enters a.

266 =B= B=266 Re-enters b.

=LCM= LCM=7,714 Least common multiple.

Example 2: Addition of Fractions. Express T + 39


208 1006 2 2 single
fraction. Make sure that your display is still set to "ALL" as shown in the
previous example.

Keys: Display: Description:

1026 EA= A=1026 Stores a.

494=B= B=494 Stores b .

SLCM= LCM=13,338 Least common multiple


(denominator of final
fraction).

* To set the display format to ALL on the HP-19B, press EALLE.

34 2: Greatest Common Divisor and Least Common Multiple


[+]494 71 Assigns the numerator
[J[RCL]ELCME offinal fraction i.e.,
1026 39 13338 13338
E_BE B=2,424 —4_{9—Z—X71+ —1—0—2—6—X39

tob.

SLCME= Re-enters a.
STO|ZA= A=13,338

=GCD= GCD=6 Greatest common divi-


Sor.

Thus,

71, 39 _ 2424/6 _ 404


494 1026 13338/6 2223°

Reference

Knuth, Donald E., The Art of Computer Programming, Vol. 2, Addison-


Wesley, Reading, MA, 1969.

2: Greatest Common Divisor and Least Common Multiple 35


Numerical Integration
Simpson’s Rule is widely used to approximate definite integrals. Thisis
dueto its simplicity, good results, and ease of implementation. Simpson’s
Rule essentially divides the area to be integrated into an even number of
subintervals and interpolates a quadratic polynomial to f (x) at the top of
each subinterval.

For integrals of the form


b
Jf(x)ax
the approximation for 2n subintervals is given by:

b - 2n
Son =£““%L[fo+4f1+2f2+4f3+2f4+ 4+ 2fon2t4fom_1tf ]

This approximation is valid if the integral meets the following conditions:


1. The limits of integration are finite.
2. Foralla <x <b, f (x) is both finite and defined.

A judicious change of variables can sometimes transform an integral


violating these conditions into an acceptable form. For example, consider
the improper integral
o0

fax /(1+x%).
1
The change of variable u =1/x transforms this integral to
1
Ju®au /(1+u®)
0
which is easily evaluated.

36 2: Numerical Integration
Errors in approximating definite integrals with Simpson’s Rule arise in
two ways:
1. Error due to the quadratic polynomial substituted for f (x) in each
subinterval.
2. Round-off error during calculations due to the limited precision of
your calculator.

While the second source of errors can never be completely eliminated, the
first source of errors can generally be made arbitrarily small by choosing a
large enough number of subintervals. While increasing the number of
subintervals will usually improve the accuracy of the results,it also
increases the computation time needed by the calculator.

The Integration Equation

Equation: Comments:

INTEGRATE: Equation name.


I=L(H: (A-B)+(—2xN)) Interval size set to (b —a)/2n.
+3xZ(R:0:2xN:1:0x Evaluates f (x) at 2n +1 evenly
L(X:A+RxG(H)) spaced points.
+ (SGN (R) +SGN (2xN—-R) + Multiplies f (x) by proper constant.
2xMOD (R:2) )x(FX))

Remarks on Using the Equation.


m When integrating trigonometric equations, radians mode must be set.
m The function being integrated should be written with x as the indepen-
dent variable.
m The function being integrated is used in place of FX in the Solver
equation above.

2: Numerical Integration 37
Example Problems
In preparation for the first example, enter the equation described above
using the following function in place of FX .

N=
_
f(x)=36r [1 _x?
81] [1+ .
324—4x2]

The Solver equation should now look like this:

INTEGRATE: I=L(H: (A-B)+(—2xN))=+3


XC(R:0:2xN:1:0xL(X:A+RxG(H) )+ (SGN(R)
+SGN (2xXN—-R) +2xMOD (R: 2) ) x (36XPIXSQRT (1
—-SQ(X)+81)xSQRT (1+ (16xSQ(X) )+ (324-
4x5Q(X)))))

When your equation matches this one, press = CALC = to display the menu
of variables.

Example 1: Surface Area Computation. A new water tank is to be


constructed by Erisman Industries. The tank has a circular cross-section
when viewed from above. When viewed from the side its cross-section is
that of an ellipse with height 18 ft. and width 36 ft. How many square feet
of steel should Mr. Erisman plan on using for the tank?

The shape of the tank can be generated by revolving the ellipse


2 2
_'X.'_+L=1

182 92
about the y-axis. The surface area integral is then
b
A=2[fGWV1+[* §)P dy.
Substituting the values for the problem at hand we obtain

38 2: Numerical Integration
1
9 2 -
36 [ [1-L] [1+—16X2—— * &
Sl 81 324-4y?
Since the integrand becomesinfinite at both endpoints (y = +9), we will
adjust our limits to y = £8.999 to avoid an error condition when the Solver
evaluates the equation. We will use 40 subintervals to approximate the
integral.

Keys: Display: Description:

8.999 =AS A= -8.9990 Stores a.


8.999=B= B=8.9990 Stores b .
20=ENE N =20.0000 Stores n (recall that the
approximation is for 2n
subintervals or 40 in this
case).

=I= 1=2,809.2376 Approximate surface


area in square feet.

For comparison, the exact result is

9 m[ 18+V 182-92
2m(9)(18) —19§ ¥ ] =2809.68999 square feet
V182-9? 9

The numerical estimate is accurate to within .016%.

Example 2: Broadcast Signal Coverage. An AM radio station


radiates a signal from its directional antenna array in the shape ofthe car-
dioid 7 =30(1+cos §) , where 6 is the radial angle around the antenna
array. If 7 is measured in miles, how many square miles of coverage does
this radio station have?

2: Numerical Integration 39
The equation for area in polar coordinates is:

6,
1
A=1(r240
2.{'

For this problem we have

2r

A = [450(1+cos 6)? d6.


0

Enter this equation in the INTEGRATE equation by replacing 6 with x .


It is not necessary to re-type the entire equation. Simply edit the existing
INTEGRATE equation. Your equation should look like this:

INTEGRATE: I=L(H: (A-B) =+ (-2xN) ) +3


xT(R:0:2xN:1:0xL(X:A+RxG (H) ) + (SGN (R)
+SGN (2xN—-R) +2xMOD (R: 2) ) x (450xSQ (1+COS (X)) ) )

When your equation matches this one, press = CALC = to display the menu
of variables. Evaluate the area using 40 subintervals.

Keys: Display: Description:

Im
MORE = Set radians mode.
t1

A=0.0000 Stores a .
o
i

1
>

* To set radians mode on the HP-19B, press: i £D/RE .

40 2: Numerical Integration
2 mx]" Stores b.
[=]EBE B=6.2832
20=ENE N =20.0000 Storesn.

== 1=4,241.1501 Approximate area in


square miles.

The exact area is 6r (30/2)%=4241.15008234 square miles.

Reference

Kaplan, W., Advanced Mathematics for Engineers, Addison-Wesley, Inc.,


Reading, MA, 1981.

* To enter x from the HP-19B, press: Il [MATH]EPI .

2: Numerical Integration M
Numerical Differentiation
The numerical differentiation Solver equation developed below calculates
the numerical value of a function’s derivative at a point. Using the
features of your Solver, minimums and maximums of functions can also
be found.

The defining equation for the derivative is the limit of the difference quo-
tient:
f’(x)=’lli_1_%t (x +hh2—[ (x) .

Another way of expressing a derivative is with the equation


f (x)—gt5x+h?%f5x
’ -1 - - h) .

This equation can be shown to approach its limit faster than the first
equation and for this reason will be used to approximate f “ (x) forsuit-
ably small 4. (More about the choice of 4 later.) The figure below shows
that this approximation is the slope of the secant line through f (x +4)
and f (x -h).

flx)
A

flx+h)

flx-hJ)
vy
x

42 2: Numerical Differentiation
We can use the previous results and an increment of % to approximate
frr(x)as
o (x)= [ (x+h/[2)-f"(x —h/Z).
@)*/2)
This can be simplified to
f"(x)zf(x +h)—2];(2x)+f (x=h)

which will be used sinceit involves only the function (notits first
derivative).

Choosing &
The HP-27S and HP-19B store numbers using 12-digit precision. This
means that 2+ 1022 and 2— 102 will both be rounded and stored as 2.
Thus,if you are calculating
s f(2+R)=F (2=h)
@~ -
you will always obtain a zero result for 2 =1x10~'2. In general, x and &
cannot be separated by more than 12 orders of magnitude.

In addition to the effects of round-off error on the argument of f , another


equally important consideration in choosing 4 is the effect of round-off
error on the result. If h is too small, f (x +k) and f (x —h ) may only
differ in decimal places beyond the 12-digit precision of your calculator.
This rounding of f (x +h) and f (x —h) may cause f (x +h)-f (x —h) to
deviate significantly from its actual value, thus affecting the approximation
of f* (x). For example,iff (x)=Vx using h =1x10~11 we have

V1+10M-vi1-1001 oo
=
2x10~11

The true value is 0.5. The error here is because V' 1+10~1! is rounded to
1. Values for 4 in the range 1—)(6)5 <h < —1%4- give good results for f “ (x);

y, for f " (x)


similarly, 0t
(x), —x—Sh 105 Bvesg
5——'1- ives good results.

2: Numerical Differentiation 43
The Differentiation Equation
Thelistings below outline Solver equations for differentiation.

Equation: Comments:

DY/DX: Equation name.


F’/X=0xL(Q:X) Create local variable so x will not be
lost.
+S(N:-1:1:2:0xL Equivalent to LX)/ (x k)
(X:G(Q)+NxH) + _ 2h )
Nx (FX) + (2xH) ) where FX is replaced by the function
to be differentiated.
+OxL(X:G(Q)) Restores value of x .

Equation: Comments:

D2Y/DX2: Equation name.


F/7X=0xL(Q:X) Create local variable so x will not be
lost.

+X(N:1:3:1:0xL(X: Equivalent to
G(Q)+Hx(2-N) )+ fCxth)-2f (x)+f(x=h)
(-1)~(N+1)x(2- h?
MOD(N:2) )x(FX)+SQ(H))
+OxL(X:G(Q)) Restores value ofx .

Remarks on Using the Equations.


m In each equation, FX is replaced with the function to be differentiated.
m The functions to be differentiated must be entered with x as the
independent variable.
m Trigonometric functions must have radians mode set for proper
results.

44 2: Numerical Differentiation
Example Problems

Key in the Solver equations listed with

f(x)=yo— %ln (coshx\/g)

in preparation for the first example. Your equations should look like this:

DY/DX:F/X=0xL(Q:X)+X(N:—-1:1:2:0xL(X:G(Q)
+NxH) +Nx (YO—- (1+P) xLN (COSH (
XXSQRT (PxG) ) ) )+ (2xH) ) +OxL(X:G(Q))

D2Y/DX2:F’ ' X=0xL(Q:X)+E(N:1:3:1:0xL(X:G(Q)+H


x(2=N) )+ (-1) A (N+1)x(2-MOD(N:2) )x(Y0- (1+P)
xLN (COSH (XxSQRT (PxG) ) ) ) +SQ (H) ) +0xL (X: G (Q) )
When your equations match these, press = CALC = to display the menu of
variables.

Example 1: Freefall of Heavy Bodies. As part of a TV advertising


campaign for a new pick-up truck, creative genius Will Selmore proposes
to have several pick-ups dropped by parachute into a large field for the
video portion of the ad. To ensure that the trucks will not be damaged on
impact they must be traveling no faster than 200 ft/sec when their para-
chutes open. If the trucks-are dropped from 6,000 ft. and allowed to
freefall for 10 seconds, will they land safely? Also, find the acceleration at
the instant when the parachutes open.

The equation governing freefall of a heavy body under the influence of


gravity and air resistance is:

y()=yo- %ln (coshtVv pg)

where

g =32 ft/sec (acceleration due to gravity)


p=.001 (drag coefficient)
y0=6000 ft. (initial height)
y(t) = position at time ¢

2: Numerical Differentiation 45
Since you have already loaded this function into both the 1st and 2nd
derivative Solver equations, the velocity at ¢t =10 seconds can be found
simply by evaluating dy / dx atx =10. Use # =0.001.

Keys: Display: Description:

10=XE X=10.0000 Stores x .


001 =HE H=0.0010 Stores i .
6000 Y0= Y0=6,000.0000 Storesy,.
001=P= P=0.0010 Stores p.
32=G= G=32.0000 Stores g.
=SPXE F’X=-169.1611 Velocity in ft/sec at
t =10 seconds.

The minus sign indicates the trucks are falling downward. The actual
velocity is
dy /dt =v = Vg /ptanhtVpg = —169.161141610
The numerical estimate agrees with the actual velocity to 4 decimal
places. Since the speed is less than 200 ft/sec the trucks will land safely.

The acceleration is found by using the Solver equation D2Y/DX2. Move


the pointer in your Solver to this equation and press = CALC =. The values
from the previous equation are saved. Simply change 4 to 0.01 and solve
for f **(x).
Keys: Display: Description:

NE H=0.0100 Stores new value of & .

SFP'XE F’"X=-3.3845 Acceleration in ft/sec?.

46 2: Numerical Differentiation
The true acceleration is

% =—g +g tanh® ¢tV pg = —3.38450816930 ft/sec>

The estimate agrees to 4 decimal places.

Minimum/Maximum Problems
An extremely powerful application of the derivative is that of finding
extrema of functions. Local maximums and minimums potentially occur
where f “ (x) is 0 or undefined. If an extrema exists, the sign of the
second derivative indicates the type of extrema (negative for local max-
imums and positive for local minimums).

Example 2: Minimum Field Strength. For the design ofa vertical


broadcasting tower, radio engineer Ann Tenor wants to find the angle
from the tower at which the relative field intensity is most negative. The
relative field intensity created by the tower is given by:
_ cos(2nl cos ) — cos(2nl )
s [1 —cos(2nl )] sin 6

where E is the relative field intensity, / is the antenna height in


wavelengths, and 6 is the angle from vertical in radians. The height is 0.6
wavelengths for her design.

The desired angle is one at which the derivative of the intensity with
respect to 4 is zero. Edit both existing derivative equations (DY/DX and
D2Y/DX2) replacing the old f (x) with the function for E above
(rememberto enter the function in terms ofx instead of §). Your equa-
tions should look like this:

DY/DX:F’X=0xL(Q:X)+Z(N:-1:1:2:0xL(X:G(Q)
+NxH) +Nx ( (COS (2xPIXIxCOS (X))
—COS (2xPIxL) )+ ( (1-COS (2xPIxL) )xSIN (X)) )
+(2xH) ) +OxL(X:G(Q))

2: Numerical Differentiation 47
D2Y/DX2:F/ ’"X=0xL(Q:X)+X(N:1:3:1:0xL(X:G(Q)
+Hx(2-N) )+ (-1)~(N+1)x(2-MOD(N:2) )x( (COS
(2xPIXIXCOS (X)) —COS (2xPIXL) )+ ( (1-COS (2xPIXL) )
xSIN(X)))+SQ(H) )+0xL(X:G(Q))

When your equations match these, set radians mode, adjust your Solver
pointer to DY/DX, and press = CALC = to display the menu ofvariables.
Solve for % =( using an & of .001.

Keys: Display: Description:

[MODES = MORE = Set radians mode, if


=D/R= ' necessary.
m 0.0000 Sets all variables equal
to zero, including
F*(X).
6ZL= L=0.6000 Stores /.

001 =HE= H=0.0010 Stores A .

=X= X=0.4899 Angle in radians where


extrema occurs.

Now see if this corresponds to a local maximum or minimum by executing


D2Y/DX2. The values from the previous calculation are retained, but
you should use a slightly larger 4 of .01. Position your pointer to this
equation and press = CALC=.

Keys: Display: Description:

O1=H= H=0.0100 New value of & .


Sy =
EPXE vy _
F’X=2.7105 2
Valucode.
dF

* To set radians mode on the HP-19B, press: [l ED/RE[EXT].

48 2: Numerical Differentiation
The positive value indicates that a local minimum was found. To ensure
that this is an absolute minimum on the interval 0° < § < 90° you should
check for other zeros of the first derivative. You will find an absolute
maximum at §=90° and no other extrema in the interval, as shown in the
figure below. Thus, the most negative relative field intensity occurs at
§ = .4899 radians = 28.0692°. For comparison the exact minimum occurs
at 6=28.068°.

0.5 T

m/4 m/2
=}

@
Y

=25 T

Example 3: Minimizing Cost per Part. A production line supervi-


sor for the Rainy Day Sprinkler Company must determine the optimal
number of machinesto install for making 500,000 plastic housings for a
new line of lawn sprinklers. It costs $6,750 to set up each machine initially
and $250+ $37.60n to run n machines for 1 hour. Each machine is capa-
ble of producing 73 parts/hour. The parts must be ready in 6 weeks and
the machines can run at most 6 days a week for 16 hours a day.

The optimal number of machines occurs where the cost per partis
minimum. The set-up cost is 67507 /500000 ($/part). The remaining cost
is the hourly cost per part, and is given by

1 (hours/part) x (250+37.60n ) ($/hour) -= 250+37.60n


T n ($/part).

2: Numerical Differentiation 49
The total cost is then
6750n 250+37.60n
500000 T m3n O/pary).
Edit the DY/DX equation replacing the old function of x with the one
above (using x in place of n). It should look like this:

DY/DX:F’/X=0xL(Q:X)+Z(N:—1:1:2:0xL(X:G(Q)
+NxH) +Nx (2504 (73xX) +37 . 6+73
+6750xX+500000) + (2xH) ) +0xL (X:G(Q) )

Press = CALC = to display the menu of variables, and solve for f“ (x)=0
using an & of .001. Instruct the Solver to look for a zero in the positive
direction (you cannot have a negative number of machines) by entering
initial guesses of 1 and 50. The Solver will search between these two
bounds for a zero.

Keys: Display: Description:

001 EHE H=0.0010 Stores h .

0=FX= F’X=0.0000 Stores f “ (x).


1EXEB0EXE=EXE X=15.9273 Stores search boun-
daries and locates
minimum.

Since the number of machines must be an integer, we roundthis to 16.


You may wish to verify that this is indeed an absolute minimum over the
interval 1 to 50 and that the function increases without bound for x > 16.
For n =15 and n =17 the cost per part is 94.6 cents; for n =16 the cost per
part is 94.5 cents. This small difference amounts to a $500 savings for
500,000 parts. Finally, to insure the validity of this answer, verify that 16
machines will be able to produce 500,000 parts in the allotted time.

50 2: Numerical Differentiation
6 (wks) x 6 (dys/wk) x 16 (hrs/dy) x 73 (parts/machine-hr) x 16
(machines) = 672,768 parts.

Thus, 16 machines can meet the time constraint with the least cost per
part.

References

Edwards, Penney, Calculus and Analytic Geometry, Prentice-Hall, Inc.,


Englewood Cliffs, New Jersey, 1982.

Kaplan, W., Advanced Mathematics for Engineers, Addison-Wesley, Inc.,


Reading, MA, 1981.

2: Numerical Differentiation 51
Factors and Primes
The factors and primes Solver equation will find all the prime factors of a
positive integer 7 .

The algorithm for this equation selects a trial divisor d and tests d as a
factor of n. If d dividesn,thenn+—n /d and d is tested as a factor of
the newn. If d does not divide n, a newd is selected. The process con-
tinues until d >V/n , at which point n is returned as the final factor. The
trial divisor d takes on the values 2, 3, 5, and 7; then for d > 10, d takes on
those values that satisfy (d —10)mod 30 = 1, 3, 7,9, 13, 19, 21, or 27.
Thus, in the first cycle of 30 integers from 11 to 40, d assumes the values
11, 13, 17, 19, 23, 29, 31, 37. This technique eliminates from the test those
values of d (d >10) that are divisible by 2, 3, or 5.

To translate this algorithm into a suitable Solver equation we use the fol-
lowing techniques:
1. Use nested IF functionsto test for a factor of 2, 3, 5, or 7.
2. Use a final nested IF as a loop that looks for prime factors > 11.

The Factors and Primes Equation


The following Solver equation uses the algorithm described above to
determine the prime factors of a number.

Equation: Comments:

FACTOR: Equation name.


FACT=0xL(E:N) Stores N in intermediate variable E
so that initial value of N will not be
lost.

+IF(MOD(N:2)=0: If 2 is a factor store 2 in E, otherwise


OxL(E:2): continue.

52 2: Factors and Primes


IF(MOD(N:3)=0: If 3 is a factor store 3 in E, otherwise
OxL(E:3): continue.

IF(MOD(N:5)=0: If 5 is a factor store 5in E, otherwise


OxXL(E:5): continue.

IF(MOD(N:7)=0: If 7 is a factor store 7 in E , otherwise


OxL(E:7): continue.
L(J:0) Initializes "first factor" flagJ to zero.
+X(D:11:SQRT(N):2: If the first prime factor has already
IF(G(J)=1:0: been found (J =1) zeros are added.
IF(L(C:MOD(D-10:30)) If not, the prime divisors greater
=1 OR G(C)=3 OR than 10 are generated.
G(C)=7 OR G(C)=9 OR
G(C)=13 OR G(C)=19
OR G(C)=21 OR
G(C)=27:
IF(MOD(G(E) :D)=0: Tests to see if current value of D is a
prime factor.
OxL(J:1)xL(E:D): If so, value of D is saved and "first
factor" flag J is set.
0): If not, loop gets next value of D .

0))))))) Other argument of the first IF func-


tion. Only occurs if no prime factors
are found.
+G(E)+L(J:0)x Returns the value of the first prime
L(N:N=G(E)) factor encountered, clears the "first
factor" flag J, and adjusts N to its
new value (N,/D).

2: Factors and Primes 53


Remarks on Using the Equation.
m 1 must be an integer > 1.
m To eliminate extra trailing zeros, set your display format to "ALL".
m You should expect long execution times for very large integers.

Example Problems
Enter the Solver equation FACTOR,taking special care to include the
correct number of parentheses and to put spaces around the AND func-
tions. When your equation matches the equation listed, press = CALCE,
then set your display to ALL. You should see only = FACT= and =N = on
the menu of variables.

Example 1. Find all the prime factors of 924.

Keys: Display: Description:

[MODES| Set the display to ALL.


SALLE"
924 =N= N=924 Stores number to be
factored.

=FACT = FACT=2 First factor.

= FACT= FACT=2 Second factor.

SFACT= FACT=3 Third factor.

=FACT = FACT=7 Fourth factor.

* To set the display to ALL on the HP-19B,use the following keystrokes: EALLE.

2: Factors and Primes


g
FACT FACT=11 Fifth factor.

FACT FACT =1 A result of 1 indicates


1

i
complete factorization.

Thus, 924=2x2x3x 7 x 11.

Example 2. Find all the prime factors of 3623.

Make sure that your display is still set to ALL as in the previous example.

Keys: Display: Description:

3623=N= N=3,623 Stores number to be


factored.

=FACT= FACT=3,623 Indicates 3623 has no


prime factors...it is
primeitself.

2: Factors and Primes 55


Vector Operations
Because vectors arise frequently in engineering computations,it is con-
venient to have several vector operations available. The most common of
these are the cross product, the dot product, the magnitude of a vector,
and the angle between 2 vectors. Given the vectors Vy=x,i +y,j +z:k
and Va=x, +y,j +zok defined in a 3-dimensional rectangular coordinate
system, the definitions are as follows:

Cross product:

VixVo=[x; y1 24
X2 Y2 Zg

Dot product:

ViVa=xxotyya+z:2,

Magnitude:

Vi|=Vxf+yf+zf

Angle between vectors:


1 ViVa
Y=cos~
v Ia

56 2: Vector Operations
The Vector Operations Equation
Since it is convenient to have all the functions defined above available on
a single menu, nested IF S functions are used. The equation is as follows:

Equation: Comments:

VECTOR: Equation name.


IF (S (CROSS) : CROSS: Nested IF’s to assign result to proper
IF (S (DOT) : DOT: variable.
IF (S (ANG) :ANG:MAG)) )=
OxL (M: SQRT (SQ (X1) + Stores magnitude of ¥in intermedi-
SQ(Y1)+SQ(Z1))) ate variable M .
+IF (S (DOT) OR If DOT or ANG are desired, com-
S (ANG) : OxL (C: X1xX2+ pute dot product and store in inter-
Y1xY2+Z1xZ2) mediate variable C.
+IF (S (ANG) : If solving for angle, compute angle; if
ACOS (G (C) =+ (G (M) x solving for dot product, recall C.
SQRT (SQ(X2)+SQ(Y2)+
5Q(22)))):G(C))
:IF(S(MAG) :G(M): If dot product or angle is not being
solved for, check if magnitude is
sought. If so, recall M.

OXL (A:Z1xX2-X1xZ2)x If not, then cross product is the only


L(B:X1xY2-Y1xX2)+ possibility left and it is computed.
L(X1:Y1xZ2-Z21xY2)+ The intermediate variables 4 and B
OxL(Y1:G(A))+ will store the y- and z-components of
OxL(Z1:G(B)))) the resulting vector until equation
finishes using the original com-
ponents of V;.

2: Vector Operations 57
Remarks on Using the Equation.
m DOT,MAG, and ANG leave the x, y, and z-components of their
arguments unchanged. You can then do computations using the same
vectors without re-entering the vector components.
m The magnitude of ¥}is calculated when the MAG function is exe-
cuted.
m CROSS returns the resulting vector as ¥;. The x-componentis
displayed and the other components can be viewed by using the
key. This feature is useful for chain calculations.
m For two dimensional vectors, simply consider that the k component
does not exist, i.e. enter O for the z’s.

Example Problems
Key in the equation described above, making sure to put spaces around
the OR function. When you finish, press = CALC = to display the menu of
variables.

Example 1: Force on a Transmission Line. A long straight


transmission line carrying a DC curreat of 200 A in the direction
d =10i +7.3j —4.1k (m) is immersed in a uniform magnetic field
B =.008i —.0015j —.0049k where B is in Wb/m?2. Find the force per unit
length (N/m) acting on the wire.

The force per unit length is given by

!l;= Id xB

where / is the length of the wire and I is the DC currentin the wire.

58 2: Vector Operations
Keys: Display: Description:

10 [x]200 X1= X1=2,000.0000 Stores x-component of


200d.

=MORE= 7.3 [x] 200 Stores y-component of


=Y1= Y1=1,460.0000 200d.
41[+/-][x]200=z1= Z1=-820.0000 Stores z-component of
200d.
008=X2= X2=0.0080 Stores x-component of
B.

0015 +/-|=EY2= Y2=-0.0015 Stores y-component of


B.

0049[+/-]Z22= Z2=-0.0049 Stores z-component of


B.

= MORE = = CROSS = CROSS = -8.3840 x-component offorce


per unit length

= MORE = y-component of force


[RCL]EY1E Y1=3.2400 per unit length

RCL|EZ1= Z1=-14.6800 z-component of force


per unit length

Thus, the force per unit length acting on the wire is


~8.384i +3.24j —14.68k (N/m).
Example 2: Work Done by a Space Probe. A space probe must be
repositioned by flight controllers on earth so that it can achieve a better
viewing angle of one of Saturn’s rings. To place the probe in a proper
position for obtaining photographs,it must move to a position
100i +534j +378k (km) from its present position. The probe is acted
upon by the gravitational fields of several bodies which exert a total force
of F =-5.2i +3.4j —1.6k (N). Find the energy expended by the probe in
moving to the desired position.

2: Vector Operations 59
The work done is given by the formula
W=F-d
where d is the vector of motion.

Set the display format to "FIX 2" for this example.

Keys: Display: Description:

M[MODES|=FIX= 2 Set the display to FIX 2.


[INPUT]”
100 =X1 = X1=100.00 Stores x-component of
distance vector.

= MORE = Stores y-component of


534 =Y1= Y1=534.00 distance vector.
378=Z1= Z1=378.00 Stores z-component of
distance vector.
52[+/-|EX2= X2=-5.20 Stores x-component of
force vector.
34=Y2= Y2=3.40 Stores y-component of
force vector.
1.6[+/-]=22= Z2=-1.60 Stores z-component of
force vector.

=MORE==DOT= DOT=690.80 Dot product.

Thus, the energy expended is 690.8 kJ.

* To set the display to FIX 2 on the HP-19B, use the following keystrokes: ERAXE 2
INPUT

60 2: Vector Operations
Example 3: Angle for a Mounting Bracket. A mounting bracket
for supporting a sign is to be constructed as shown in the figure below.
What angle a should be used for the dimensions given? Also,find the
length of cable needed.

Cable 2

Mounting
Bracket

Represent the cables as vectors goingfrom the wall to the brackets and
compute the angle o between them for the bracket angle. For the length
of cable needed, find the magnitude of the vector representing one cable.
By symmetry, the total cable length is twice this.

For this example set the display mode to "FIX 2" and the angular mode to
degrees.

2: Vector Operations 61
Keys: Display: Description:

M[MODES|= FIXE 2 Set the display to FIX 2,


[INPUT]” if necessary.

W[ MODES £ MORE = Set degrees mode, if


=p/RE[ExT)! necessary.
5EX1 X1=5.00 Stores x-coordinate of
cable 1.

Stores x-coordinate of
ol

RSl
Te
<

HIE:

X2=5.00 cable 2.
i
ll

Y1=2.00 Stores y-coordinate of


N
i

I
N

cable 1.
[+/-]EY2Z Y2=-2.00 Stores y-coordinate of
cable 2.
7[:]12 Converts 4 feet 7 inches
[+]4[=][+/-]ZZ1E Z1=-458 to decimal feet and
stores as z-coordinate of
cable 1.

EZ22= Z2=-458 Stores —4.58 feet as the


z-coordinate of cable 2.

=MORE=Z=ZANGE ANG=32.86 Angle between cables in


degrees.
=MAG = MAG=7.07 Length of one cable in
feet. (Double this for
total cable needed.)

* To set the display to FIX 2 on the HP-19B, use the following keystrokes: EAXE2
INPUT
t To set degrees mode on the HP-19B, use the following keystrokes: Il
1

1
’E
i)

[EXIT].

2: Vector Operations
Thus,the total length of cable needed is about 14 feet 2 inches and the
bracket should have an angle of about 33°.

References

Meriam, J.L., Engineering Mechanics, Vol. 1 and 2, John Wiley and Sons,
New York, 1980.

Resnick, Robert and David Halliday, Fundamentals of Physics, 2nd Edi-


tion, John Wiley and Sons, Inc., New York, 1981.

2: Vector Operations 63
Complex Number Operations
Given the complex numbers x =a + ib =re' and y = ¢ + id = me'?, the
following operations will be implemented:

Addition: x+y=(a+b)+i(c+d)

Subtraction: x-y=(a-b)+i(c-d)

Multiplication: xy =(ac — bd) + i(ad + bc)

Division: X-{a*ib)(c-id)
y c2+4d?

Logarithm: In(x)=In(re!®)=In(r) +i6

Power: x¥ =¢ln® =ylnz

1 a-1
Inverse: —=
X a%+p?

Swap: exchanges x and y

The Complex Operations Equation


The Solver equation listed here implements the operations described
above.

Equation: Comments:

COMPLEX: Equation name.


IF (S (SWAP): Is a swap desired?

64 2: Complex Number Operations


Ox(L(R:RX)+L(I:IX)) If so, store the real and imaginary
parts of x in the intermediate vari-
ables R and /.
~L(RX:RY)+0x(L(IX:IY) Store the real and imaginary part of
yinx.
+L(RY:G (R)) Store the original contents ofx iny.
+L(IY:G(I)))
+SWAP: End of execution when SWAP is
solved for. Mulitiplication by zero
has been used to assign proper
results to variables. This leaves the
effective equation —SWAP +RX =0.
This is solved directly to obtain
SWAP =RX .
IF(S(MUL) OR S(DIV): Are either multiplication or division
desired? (Note the spaces around
OR.)
IF(S(DIV): If so, is division desired?
Ox (L (RX:RX If division is desired, execution
+SQ (RADIUS (RY:1Y))) comes here. Real part of x (RX) is
divided by denominator in division
definition above. This becomes new
RX.

+L(IX:IX Analagous operation is done on


+SQ (RADIUS (RY:IY))) imaginary part of x (ZX).
+L (R:RXXRY+IXxIY) R is used as an intermediate variable
to store the final value of RX (old
value of RX isstill needed).
+L(IX:IX<RY-RXxIY)) IX given its final value. Note that a
2nd closing parenthesis encloses
those functions that are multiplied by
0.
~L(RX:G(R)) Assigns RX its proper value.

2: Complex Number Operations 65


+DIV: End of execution when DIV is solved
for. Multiplication by zero has been
used to assign proper values to vari-
ables. This leaves the equation
—RX +DIV =0. This is solved
directly to obtain DIV =RX .

Ox (L (R: RXXRY-IXxIY) If multiplication is desired, execution


jumps to here. This line uses R as
an intermediate variable to store the
final value of RX (old value of RX is
still needed).
+L(IX: IXxRY+RXXIY) ) IX given its final value. Note that
2nd closing parenthesis encloses
those functions that are multiplied by
0.
-L(RX:G(R)) Assigns RX its proper value.
+MUL) : End of execution when MUL is
solved for. Multiplication by zero
has been used to assign proper
values to variables. This leaves the
equation —RX +MUL =0. This is
solved directly to obtain MUL =RX .
Note the closing parenthesis after
MUL to finish the IF(S(DIV) argu-
ment. The colon refers to the 2nd
half of the IF(S(MUL) OR S(DIV)
argument.

IF (S (ADD) : Execution jumps to here if neither


MUL or DIV are desired and checks
to see ifADD is desired.

ADD-L (RX:RX+RY) IfADD is desired, RX is assigned its


proper value.

66 2: Complex Number Operations


+OxL(IX:IX+IY): Assigns IX its proper value without
disturbing the equation ADD -
RX =0 that was generated in the pre-
vious line. This is solved directly to
give ADD =RX .
IF (S (SUB) : If ADD is not desired execution
jumpsto here.
SUB-L (RX :RX-RY) If SUB is desired, RX is assigned its
proper value.
+0xL (IX: IX-IY): Assigns IX its proper value without
disturbing the equation SUB -
RX =0 that was generated in the pre-
vious line. This is solved directly to
give SUB =RX .
IF (S (INV): Is 1/x desired?
L(RX:RX+L(R:SQ( Assigns new value to RX while stor-
RADIUS (RX:IX)))) ing a2+b? in intermediate variable R
for use in next step.
+OXL(IX:—-IX+G(R)) Assigns new value to IX .
—-INV: Multiplication by zero leaves the
effective equation RX —INV =0.
This is solved directly to give
INV =RX.

Ox(L(LNX: If SUB is not desired, execution


LN (RADIUS (RX:IX))) jumps to here. LNX is used as an
intermediate variable to store the
final value of RX (old value of RX is
still needed).
+L (IX:ANGLE (RX:IX))) Final value of IX assigned if LNX is
desired. If x¥ is desired, IX will be
changed again later. Note that the
3rd closing parenthesis encloses
those functions multiplied by zero.

2: Complex Number Operations 67


~L(RX:G (LNX) ) Assigns RX its final value if LNX 1is
desired. If x¥ is desired, RX will be
changed again later.
+IF (S (LNX): Is LNX desired?

LNX: If so, execution stops. Multiplica-


tion by zero has been used to assign
proper values to variables. This
leaves the equation —RX +LNX =0.
Thisis solved directly to obtain
LNX =RX.

LNX+0xL (R: RXxRY- If LNX is not desired, then the only


IXxIY) option left is XY (x¥). LNX is
added to the - L(RX:G(LNX))
encountered two lines previously to
give a zero result. Then, R is used
as an intermediate variable to store
the real part ofyIn(x).
+0x (L (IX: IX<RY+ IX is assigned an intermediate value
RXxIY) of the imaginary part ofy In(x).
+L(RX:G(R))) RX is assigned an intermediate value
sinceits old value is no longer
needed. Note that the 3rd closing
parenthesis encloses those functions
that are multiplied by zero.
~L(RX:EXP (G (R) ) x Final value of RX is assigned.
COS (IX))
+0xL (IX:SIN(IX)x Final value of LX is assigned and
EXP(G(R))) multiplied by zero.

+XY)))))) The remaining equation is


—RX +XY =0. This is solved directly
to give XY =RX . Thesix closing
parentheses are required to conclude
all of the nested IFs.

68 2: Complex Number Operations


Remarks on Using the Equation.
m All functions (ADD, SUB, XY, LNX, MUL , SWAP,INV, and DIV')
return the real part of the result when evaluated. The real and imag-
inary parts of the result are placed in RX and IX respectively and can
be viewed using the key. The real and complex parts ofy are not
changed.
m For XY and LNX to give proper results, radians mode must be set.
m The equation will not allow RX, IX, RY, or IY to be unknowns. A
"solution" will be returned, but it will not be correct.
m An infinite family of solutions for In(x) exist of the form
In(x)=In(r)+1(6 + 2k ), where k =0,1,2,...
LNX returns the principle value ofthis family of solutions (k =0).
m XY likewise returns the principle value when an 7 th root is sought.

Example Problems

When your Solver equation matches the one listed, press = CALC = to
display the menu of variables.

Example 1: Parallel Impedance. Find the total impedance Z,, for


the circuit illustrated below. Assume the circuit is excited with a
sinusoidal source of frequency f = 60 Hz.

O .

150 Q 100 Q

Z,—>

25 ufF T/ 65 mH

2: Complex Number Operations 69


The elements in series are simply added to give the branch impedances
Z,=150-1106.1033 and Z,=100+124.5044. The circuit is redrawn below.

The formula for two impedances in parallel is

SR —
R, + s

Z, Z,
Keys: Display: Description:

150 ERX= RX=150.0000 Stores real part of Z,.


106.1033 =X IX=-106.1033 Stores imaginary part of
Z,.
100 =ERY = RY =100.0000 Stores real part of Z,,.
24.5044 =Y = 1Y =24.5044 Stores imaginary part of
Z,.
SMOREZZINVE INV=0.0044 Real part of 1/Z;.

70 2: Complex Number Operations


= MORE = EMORE = x (1/Zy) andy (Z,)
= SWAP= SWAP =100.0000 swapped. Real part of
number in RX is
displayed.
=MOREZSINVE INV=0.0094 Calculates 1/Z, and
displays real part.
=ADDZ= ADD=0.0139 Calculates1/Z, + 1/Z,
and displays real part.
E INV=71.8042 Final result calculated
and real part displayed.
= MORE = = MORE = Recall imaginary part of
e IX=-4.3021 final result.

Thus, the total impedance Z, is 71.8042 — 14.3021 (02).

Example 2: Logarithm of a Negative Number. Find the natural


logarithm of —-12.

Be sure to set your calculator to radians mode before performing this


example.

Keys: Display: Description:

B[MODES| = MORE = Set radians mode.


=p/RE[EXIT)”
W[ CLEAR DATA Sets all variables to zero
12 and stores real part of
RX=-12.0000 X.
i
i

* To set radians mode on the HP-19B, use the following keystrokes:


[ExiT].

2: Complex Number Operations 71


= MORE = Real part of result.
=MOREEZ LNXE LNX=2.4849

= MORE = Imaginary part of result


= XS IX=3.1416 ().

Thus, In(-12) = 2.4849 + 1.

Example 3: Complex Roots. Find vV 27+i36.

Be sure to set your calculator to radians mode before performing this


example.

Keys: Display: Description:

B[MODES = MORE = Set radians mode,if


=D/RE ¥ necessary.
M[CLEAR Sets all variables to zero
27 =RXE RX=27.0000 and stores real part of
x.
36 IXE IX=36.0000 Stores IX .
SERYE RY =0.5000 Stores RY .

= MORE = = MORE= Real part ofVx.


=XYZ= XY =6.0000

= MORE= Imaginary part of Vx.


RCL = IXE IX=3.0000

Thus, vV 27+136=6+13.

* To set radians mode on the HP-19B, use the following keystrokes: Il


il

1
O
1]

[EXIT].

72 2: Complex Number Operations


References

Boas, Mary L., Mathematical Methods in the Physical Sciences, John Wiley
and Sons, New York, 1983.

Nilsson, James W., Electric Circuits, 2nd Edition, Addison-Wesley, Read-


ing, MA, 1986.

Van Valkenburg, M. E., Network Analysis, 3rd Edition, Prentice-Hall,


Englewood Cliffs, New Jersey, 1974.

2: Complex Number Operations 73


Triangle Solutions
The triangle solutions Solver equation can be used to find the area, the
lengths of the sides (S, So, S3), and the angles (4, 44, A3) of a triangle.

Triangle Formulas
The following formulas are used as the basis for the triangle solutions
Solver equation.

Side-Side-Side (S}, S5, S3)


N=

A3=2cos‘1[w}
S1S3
V=

Ay=2 cos‘l[f—gil)]
S2Ss
where P=(S;+S,+S3)/2
A;=cos™Y(-cos(A,+A43))

74 2: Triangle Solutions
Angle-Side-Angle (A 3 S]_, A 1)

Ag=cos (- cos(4,+A3))
sinA
2=81—
sinA,

S3=S1 COSA3 + SzCOSAz

Side-Angle-Angle (S, 4,,45)


Az=cos™!(-cos(4,+A3))
The problem has been reduced to the 45, S, A, configuration.

Side-Angle-Side (S 1s A 1 S2)

S3=v/S5,2+5,2-25,S,c0sA4,
The problem has been reduced to the S, S 5, S 3 configuration.

Side'Side'Angle (S 1 Sz, A 2)

S
A3=Sin_1 l:"'"z_SinAz]
S1
Ay=cosI(-cos(4,+A3))
The problem has been reduced to the A3, S, A, configuration. Note that
two possible solutions exist for 45 if44 is not equal to 90° and S, is
greater than S, as shown below. Both possible answer sets are calcu-
lated.

2: Triangle Solutions 75
In all cases, the area is calculated as

Area = %SlSe,sinAs.

The Triangle Solutions Equation


To use the Solver equation described below, simply key in the three
known values and solve for the appropriate variable. After the calculator
finishes solving the triangle,it displays the area. To view the sides and
angles, use the key and the appropriate menu key.

Equation: Comments:

TRIANGLE: Equation name.


IF(S(SSS) OR S(SAS): Solving for SSS or SAS?
IF (S (SAS): If so, solving for SAS specifically?
0xL (S3:SQRT (SQ(S1) Calculates S 3. Triangle is now in
+SQ(S2) -2xS1xS2 SSS configuration.
xCOS (G (A1) ))):
0) Does nothing if SSS is sought.
+0xL(P: (S1+S2+S3)+2) Defines intermediate variable P.

+0xL (A3 : 2xACOS (SQRT Calculates 4 3 according to SSS for-


(G(P)x(G(P)—-S2) mula.
+(S1xS3))))
+0xL (A2 : 2xACOS (SQRT Calculates 4 2 according to SSS for-
(G(P)x(G(P)—-S1) mula.
+(52x83))))
+0xL (A1 :ACOS (- Calculates 4 1 according to SSS for-
COS (0xA1+A2+A3))) mula. Notice multiplication by zero
employed to force 4 1 to appear on
the menu before 42 and 4 3.
— . 5xS1xS3xSIN (A3) Calculates area.

76 2: Triangle Solutions
+IF (S (SSS) :SSS:SAS) : Assigns area to proper variable. If
solving for SSS or SAS execution
stops here.
IF (S(SSA): If not solving for SSS or SAS,
execution jumps here. Checks to see
if SSA 1is sought.
IF (G(FLG)=1 AND If SSA is sought, check flag and side
S2>S1: relationship to see which solution set
will appear.
OxL (A3 :2xASIN(1) - If flag is set, convert 4 3 to its other
A3)+0xL(FLG:0) : possible value and clear the flag.
OxL(FLG:1)+0xL (A3 If flag is clear, calculate 4 3 accord-
ASIN (S2xSIN(A2) ing to principle value of arcsine func-
+581))) tion. Set flag so the next time SSA is
sought the other solution set will be
generated.
+0xL (A1 :ACOS (- Calculates 4 1. Problem is now
COS (A2+A3))) : reduced to ASA configuration.

0) Other argument of IF(G(FLG)=1:


from above. Does nothing if SSA4 is
not sought.

+IF(S(SAA):0 If SAA is sought, calculate 4 3


xL (A3 :ACOS (- accordingly. Problem is now
COS (A1+A2))) : reduced to ASA configuration.

0) Does nothing if SAA is not sought.


+0xL (A2 : ACOS (- Calculates 4 2 according to ASA for-
COS (A1+A3))) mula.
+0xL(S2:51 Calculates S 2 according to ASA for-
xSIN (A3)+SIN(A2)) mula.
+0xL(S3:S1 Calculates S 3 according to ASA for-
xCOS (A3) +S2xCOS (A2)) mula.

2: Triangle Solutions 77
- .5xS1xS3xSIN (A3) Calculates area.
+IF(S(SSA) :SSA: Nested IF functions assign area to
IF(S(SAA) :SAA:ASA))) proper variable.

Remarks on Using the Equation


Label the sides and angles of the triangle you wish to solve so they are
consistent with the illustration on page 74. As you move clockwise
around the triangle, the labels must be in the order
Sl,Ala S2aA2’ S3aA3'
Angles must be in units corresponding to the angular mode ofthe cal-
culator (degrees or radians).
Note that the triangle described by the equation does not conform to
the standard triangle notation, i.e., 4 ; is not opposite S ;.
Angles must be entered as decimals. The = >HR = key can be used to
convert degrees, minutes, and seconds to decimal degrees.
The accuracy of a solution may degenerate fortriangles containing
extremely small angles.
If the calculator displays SOLUTIOH HOT FOUMD, there is no trian-
gle satisfying the given dimensions.
When the Solver equation uses the SSA4 formula, the first solution set
is displayed. To see the second set, solve for SSA4 again (it is not
necessary to re-enter the dimensions). Subsequent pushes of = SSA =
will alternate between the two solution sets.

Example Problems.

Enter the Solver equation described above, taking care to put spaces
around the OR functions and to use the proper number of parentheses.
When you have finished, press = CALC = to display the menu ofvariables.

78 2: Triangle Solutions
Example 1: Surveying a Land Parcel. A surveyoris to find the
area and dimensions ofa triangular land parcel. From point 4, the dis-
tances to B and C are measured with an electronic distance meter. The
angle between AB and AC is also measured. Find the area and other
dimensions of the triangle.

171.63
meters S S, 297.35
meters

This is a side-angle-side problem. Labeling the triangle to be consistent


with the illustration on page 74 we have:
S,=171.63, 4,=98.2°, and S,=297.35.

For this example set the angular mode to degrees and the display format
to "FIX 2."

Keys: Display: Description:

M[MODES FIXE 2 Set the display to FIX 2.


[INPUT]”
W[MODES = MORE = Set degrees mode,if
= p/RE [EXIT]! necessary.
171.63=81= S$1=171.63 Stores side 1.

* To set the display to FIX 2 on the HP-19B, use the following keystrokes: ERAXE2

t To set degrees mode on the HP-19B, use the following keystrokes: Wl


i

1
o
Pl

(ExiT].

2: Triangle Solutions 79
297.36=82= $2=297.35 Stores side 2.

98.2=A1= A1=98.20 Stores angle 1.

=MORE==SAS = SAS =25,256.21 Area of land in square


meters.

[RCL|ZEA3= A3=53.97 Angle 3 (angle at point


C in the figure).

= MORE = = MORE = Angle 2 (angle at point


[RCLIEA2Z A2=27.83 B in the figure).
[RCL]= 83 = S3=363.91 Side 3 (BC in the
figure).

80 2: Triangle Solutions
Example 2: Phasor Diagrams. For a certain circuit it is known that
the three voltages V', + V5 +V3=0. The voltages are complex quantities
and can be expressed in a phasor diagram as shown below. The magni-
tudes are measured with a voltmeter and are as shown. Find the angular
relationships between the voltages.

V=92V

2: Triangle Solutions 81
The phasor diagram can be re-drawn as the triangle shown below. We
now have a side-side-side problem.

Make sure that the calculatoris still in FIX 2 and degrees mode,as set in
the previous example.

Keys: Display: Description:

221=81= $1=221.00 Stores side 1.

173 =82= $2=173.00 Stores side 2.

92=S3= $3=92.00 Stores side 3.

MOREE=SSS $S85=7,517.13 Area oftriangle (no


physical interpretation
in this example).

[RCL|IEA3E A3=47.68 Angle 3.

82 2: Triangle Solutions
= MORE = = MORE = A1=23.16 Angle 1.
SAIS
=A2S A2=109.16 Angle 2.

Thus, 6, = 180° - A, = 70.84° and 6, = 180° - A5 = 132.32°.

Reference

Munem, M.A., Foulis, D.J., College Trigonometry with Applications, Worth


Publishers, Inc., 1982

2: Triangle Solutions 83
3 x 3 Matrix Operations
This Solver equation calculates both the determinant and,if it exists, the
inverse of a 3 X 3 matrix. The inverse exists only if the determinant is not
equal to zero. Using these results, a system of 3 linear equations in 3
unknowns may be solved.

Defining Equations
Let

ap Q12 43
A =|ay axn ax

a3 QA3 433

then

ax ax a2 a3 a2 433
a3z 433 - a3z 433 axn A4z

41 1 az Q3 a ass a a3
~ det a3 ass Az @z |Gz G

az Qx an a2 apn a2
| as A3 | as asx az ax
where

det = a1,(a %035 — Axax) — 4122033 — Axas)


+ aj3(@z a3 — axpas)
and

ab
cd = ad - bc.

84 2: 3x 3 Matrix Operations
Solving a System of Linear Equations
A set of three linear equations in three unknowns can be written as:

11Xy + QoXo + @13X3 = C;


A Xy + AxpXo + AxpXs = Co
A31X1 + AzpXo + A33X3 = C3
where each a;; is a constantcoefficient, each ¢;is a constant, and each x;
is an unknown.

This system of equations is written compactly in matrix form as


Ax =C

where

ap a2 a3
A =|aqg ayp ax (coefficient matrix),

g3A3z 433

X1
X = |Xxg (unknown vector),
X3

and

Ci
C=|c, (constant vector).
Cs

The unknowns are then found as

x=A"1C.

2: 3x 3 Matrix Operations 85
The 3 x 3 Matrix Operation Equation
This Solver equation uses the equations described previously to calculate
the determinant and inverse of a 3 X 3 matrix and, using these results, to
solve a set of three linear equations in three unknowns.

Equation: Comments:

MATRIX: Equation name.


OxL(M:1+(O0xA1l1xAl2+ Assigns 1/det to intermediate vari-
Al13x(A21xG(A32)-A22x able M. Notice multiplication by
G(A31))-Al2x(-A23x zero used to arrange the variables
A31+0xA32+A21xA33) + A 11 through A4 33 on the menu.
Allx(A22xA33-A23
xA32)))
xL(A:A22xA33-A23xA32) Assigns a,; ofA~ to intermediate
variable 4 .
xL (B:A12xA33-A13xA32) Assigns a4, ofA~ to intermediate
variable B.
xL(C:A12xA23-A13xA22) Assigns a3 ofA~ to intermediate
variable C.
xL(D:A21xA33-A23xA31) Assigns a4 ofA~! to intermediate
variable D .
xL(E:A11xA33-A13xA31) Assigns ay, ofA~! to intermediate
variable E .
xL(F:A11xA23-A13xA21) Assigns a3 ofA~! to intermediate
variable F .
xL(G:A21xA32-A22xA31) Assigns ag; ofA~ to intermediate
variable G .
xL(A32:G (M) x— (Allx Assigns ag, ofA1 to 4 32.
A32-A12xA31))

86 2: 3x 3 Matrix Operations
xL(A33:G(M)x(All Assigns ags ofA= to 4 33.
xA22-A12xA21))
+0xL(A11:G(M)xG(A)) Assigns ay; ofA=1to 4 11.
xL(A12:G(M)x-G(B)) Assigns @, ofA~ to.A12.
xL(A13:G(M)xG(C)) Assigns a3 ofA~ to.A13.
xL(A21:G(M)x-G(D)) Assigns a5 ofA= to A4 21.
xL(A22:G(M)XG(E)) Assigns @, ofA~ to.A22.
XL (A23:G(M)x-G(F)) Assigns @, ofA1 to A 23.
xL(A31:G(M)xG(G)) Assigns ag; ofA~ to.A31.
+IF(S(SIM): Solving for SIM ?
L(X1:0xX1xX2xX3+A1ll Uses multiplication by zero to
XC1+A12xC2+A13xC3) arrange variables on the menu and
assigns result to X' 1.
+0xL (X2 :A21xC1+A22 Assigns result to X 2.
xC2+A23xC3)
+0xL (X3 :A31xC1+A32 Assigns result to X 3.
xC2+A33xC3)
-SIM: Generates equation X1 — SIM = 0,
which is solved directly to give
SIM =X 1.

1+G (M) -DET) If SIM is not solved for, the equation


1/(1+det) — DET = Qis solved
directly to give DET = det.

2: 3x 3 Matrix Operations 87
Remarks on Using the Equation.
m When DETis calculated, the matrix elements are replaced by the ele-
ments of the inverted matrix. These new elements can be viewed by
using the key and the appropriate menu key.
m The Solver equation will return the value of X'1 when SIM is calcu-
lated and will replace the matrix elements with the elements of the
inverted matrix. X 2, X3, and the inverted matrix elements can be
viewed by using the key and the appropriate menu key.
m A homogeneous system (every c¢; equals zero) will return the trivial
solution x = 0.
m If the calculator displays SOLUTION NOT FOUND when
solving for DET or SIM , the original matrix elements will remain
intact. This message occurs when the computed value of det 4 = 0.
A matrix with a zero determinant is known as a singular matrix and
has no inverse. When no inverse exists for the coefficient matrix in a
system of simultaneous equations, either the system has no solution or
infinitely many solutions. In some rare cases, the calculator may,
through round-off error, return a zero value for det 4 when the actual
value for the determinantis not zero. For matrices of this kind, an
inverse does exist, but cannot be found using this Solver equation.

Example Problems
When your equation matches the matrix operation Solver equation, press
= CALC = to display the menu of variables.

88 2: 3x 3 Matrix Operations
Example 1: Finding the Determinant and Inverse. Find the
determinant and inverse of4 where
1 2 3
A=|1 3 3
1 2 4
Since the matrix has only integer elements, use the display format "ALL"
for this example to eliminate extra trailing zeros.

Keys: Display: Description:

MMODES|" SALL= Set the display to ALL.


1=A11E Al11=1 Stores 4 11.

2=ZA12= A12=2 Stores 4 12.

3=A13= A13=3 Stores A 13.


1=A21= A21=1 Stores 4 21.

3=A22= A22=3 Stores A4 22.


= MORE = Stores 4 23
3=A23= A23=3
1=A31= A31=1 Stores A 31.
2=A32= A32=2 Stores A 32.
4=A33= A33=4 Stores A4 33.

= MORE EEMORE = Determinant of4.


DET=1
1

i
O

m

* To set the display to ALL on the HP-19B, use the following keystrokes: [DISP|ZALL=.

2: 3x 3 Matrix Operations 89
= MORE = ay ofA~1,
[RCL]EA11= A11=6
RCL|=A12E A12=-2 a;pofA7L,
[RCLIZA13E A13=-3 a3 0fAL
[RCL]EA21 = A21=—1 ay ofA~L,
[RCL]EA22= A22=1 aqpofA1,
= MORE = aqs ofA1,
[RCL]EA23 = A23=0
[RCL]EA31E A31=-1 as ofA~L.
RCL|=A32= A32=0 asp of471,
RCL|=A33= A33=1 ags ofA1,

Thus, det 4 = 1, and


=N

W
= QN
|

|
p—

O
N
|

Example 2: A Singular Matrix. Find the inverse and determinant of


A where
W 3o
» L oo
N oA
AN
I

Asin the previous example, set the display format to "ALL."

Keys: Display: Description:

4=A11S A11=4 Stores 4 11.

6=A12= A12=6 Stores 4 12.


8=A13= A13=8 Stores A 13.

90 2: 3x 3 Matrix Operations
5ZA21= A21=5 Stores 4 21.

7T=A22= A22=7 Stores A4 22.

5=MORE==A23= A23=5 Stores.A4 23.


2=A31= A31=2 Stores A4 31.

3=A32= A32=3 Stores A4 32.

4=A33= A33=4 Stores A4 33.

= MORE = = MORE = SOLUTION NOT A~ does notexist.


=DET= FOUND Thus, 4 is singular and
det4 = 0.

You may also wish to recall the elements of the original matrix to verify
that they have not been altered.

Example 3: DC Circuit Analysis. For the circuit below, find iy,i,,


and is. (iy,iq andijare all measured in mA.)

470Q 100 Q

1 kQ

The following 3 equations are generated by summing the voltage drops


around each loop.
800i, - 330i, + Ois =15
~330i, + 530i, — 100i3= 0
Oil - 100i2 + 1100i3 = O

2: 3x 3 Matrix Operations 91
Set your display format to "FIX 4" for this example.

Keys: Display: Description:

M[MODES|=FIX= 4 Set the display to FIX 4,


* if necessary.
W[CLEAR 0.0000 Sets all variables in
equation equal to zero
(eliminates having to
explicitly store zeros in
A13,431,C2, and
C3).
800=A11= A11=800.0000 Stores A 11.

330 [+/=|EA12= A12= —330.0000 Stores A 12.


A21= A21 = -330.0000 Stores 4 21.
530 =A22= A22=530.0000 Stores A 22.

MORE Stores 4 23.


100 [+/-|ZAZ= A23 = —100.0000
STO|=A32= A32=-100.0000 Stores 4 32.

1100 = A33 = A33=1,100.0000 Stores A 33.

MORE Stores C 1.
16=C1= C1=15.0000

* To set the display to FIX 4 on the HP-19B, use the following keystrokes: EFAXZ 4
INPUT |

92 2: 3x 3 Matrix Operations
=MORE==SIM= SIM=0.0254 Solves for the 3
unknown currents and
returns the value of i,.
= MORE = = MORE = Recalls value of i,
= MORE =
[RCL]EX2= X2=0.0161
RCL|EX3 = X3=0.0015 Recalls value of i 5.

Thus, i; = 254 mA,i, = 16.1 mA, andiz = 1.5 mA.

References

Florey, Francis G., Elementary Linear Algebra with Applications, Prentice-


Hall, Englewood Cliffs, NJ, 1979.

Foulis, D. J. and M.A. Munem, College Algebra with Applications, Worth


Publishers, Inc., 1982

2: 3x 3 Matrix Operations 93
Coordinate Transformations
The coordinate transformation Solver equation will provide two- and
three-dimensional coordinate translation and/or rotation.

You must input the coordinates of the origin of the translated system
(*0,¥0,20), the rotation angle (¢) relative to the original system, and the
axis about which rotation has occurred by giving a direction vector
(ai, bj, ck) parallel to this axis. Note that the rotation axis passes through
the translated origin (x¢,y0,2¢). A point (x,y,z) in the original system
can be converted to a point (x °,y “, z *) in the new system. Inverse
transformations are also possible. The figure below depicts two-
dimensional translation and rotation.

Original System
~

94 2: Coordinate Transformations
Coordinate Transformation Formulas
The following formulas are used to develop the coordinate transformation
Solver equation.

ll mi n, X _xo
=

lo mg ng Y Yo
N e

I3 ms ng zZ -2
X

Iy I I3 x’ Xo
N e

m; mgo mg y + Yo
ny ng ns z Zg
where

I, 1, g a%(q)+cosf ab(q)—c sinf ac(q)+b sinf


my; mqo Mg ba(q)+c sinf b%(q)+cosfd bc(q)-a sinf
n, ny ng ca(q)-b sinf cb(q)+a sind c?(q)+cosf

and
q = (1-cosb)

The Coordinate Transformation Equation


This Solver equation uses the matrix formulas described above to
translate and/or rotate a two or three dimensional coordinate system.

Equation: Comments:

CTRANS: Equation name.

OxL(A:A+L(D: Changes a to a true direction vector


SQRT (SQ(A) +SQ(B) componentif it isn’t already. The
+5Q(C)))) intermediate variable D is used for
the magnitude of the original vector.

2: Coordinate Transformations 95
+0xL (B:B:G (D)) Changes b to a true direction vector
componentif it isn’t already.

+0xL(C:C+G (D)) Changes ¢ to a true direction vector


component if it isn’t already.

+0xL(L1:SQ(A)xL(Q: 1~ Assigns proper value to L 1. Note


COS (ANG) ) +COS (ANG) ) that Q serves the role of ¢ in the
defining equations.
+0xL (L2 : AxBXG (Q) - Assigns proper value to L 2.
CxSIN (ANG) )
+0xL (L3 : AXCxG (Q) + Assigns proper value to L 3.
BxSIN (ANG))
+0xL (M1:G (L2) +2xC Assigns proper value to M 1.
xSIN (ANG) )
+0xL (M2 :SQ (B)xG (Q) + Assigns proper value to M 2.
COS (ANG) )
+0xL (M3 : BXCxG (Q) Assigns proper value to M 3.
—AxSIN (ANG))
+0xL (N1:G (L3) —2xBx Assigns proper value to N 1.
SIN (ANG))
+0xL (N2 : G (M3) +2xAx Assigns proper value to N 2.
SIN (ANG))
+0xL(N3:SQ(C)xG(Q) + Assigns proper value to N 3.
COS (ANG) )
+IF (S (FTRN) : Solving for FTRN ?
L(X’:G(L1)x(X-G(X0)) Assigns properresult to X * during
+G (M1)x(Y-G(Y0) )+ forward transformation.
G(N1)x(Z-G(Z0)))

96 2: Coordinate Transformations
+0xL (Y’ :G(L2)x(X Assigns proper result to Y during
~-X0)+G (M2)x(Y-YO0) + forward transformation.
G(N2)x(Z-20))
+0xL (2’ :G(L3)x(X Assigns proper result to Z ~ during
-X0)+G (M3)x(Y-Y0)+ forward transformation.
G(N3)x(2-20))
—FTRN: Generates the equation
X “—FTRN =0, which is solved
directly to give FTRN =X ".
L(X:G(L1)xX’+G(L2) Execution jumps to here when not
XY’ +G (L3)xZ’+X0) solving for FTRN (implies that
ITRN is sought). Assigns proper
result to X when reverse transform-
ing.
+OxL(Y:G(M1)xX'+ Assigns proper result to Y when
G(M2)xY’"+G(M3)xZ'’+ reverse transforming.
YO)
+0xL(2Z:G(N1)xX’+ Assigns proper result to Z when
G(N2)xY’+G(N3)xZ '+ reverse transforming.
Z0)
—~ITRN) Generates the equation
X —ITRN =0, which is solved directly
to give ITRN =X .

2: Coordinate Transformations 97
Remarks on Using the Equation.
m The sign of the rotation angle 6 is determined by the direction of the
rotation axis and the right-hand rule. Thus, with the thumb of the
right hand pointing in the direction of the rotation axis, the fingers
curl in the positive direction of 6.
m §is given the variable name ANG in the Solver equation. It may be in
either radians or degrees, depending upon the angular mode of the
calculator.
m It is not necessary to key in a true direction vector parallel to the axis
of rotation. Any parallel vector, whether it has unit magnitude or not,
can be used. The equation will automatically adjust (a,b,c) so that
they constitute a true direction vector of magnitude 1.
m Two-dimensional transformations are handled as a special case of
three-dimensional transformation with (a,b,c) set to (0,0,1). This
causes rotation to occur about the z-axis.
m For pure translation, input 0 for 4.
m For pure rotation, input zeros for x, yo, and z,.
m For forward transforms (original to new) use FTRN (Forward
TRaNsform). For inverse transforms (new to original) use ITRN
(Inverse TRaNsform). FTRN and ITRN return X * and X respec-
tively. The other coordinates of the transformed point can be viewed
by using and the appropriate menu key.

Example Problems
The following examples show you how to use the Solver equation to per-
form coordinate transformations. When your Solver equation matches
the one listed, press = CALC = to display the menu of variables.

98 2: Coordinate Transformations
Example 1: A Two-Dimensional Transformation. A two-
dimensional coordinate system with origin (0,0) is translated to (7,—4).
After translation, a 27° rotation occurs. Convert the points P;(—9,7) and
P(6,8) to equivalent coordinatesin the translated rotated system.

For this example make sure that the calculator is set to degrees mode.

Keys: Display: Description:

M[MODES]= MORE = Set degrees mode if


= D/R=[EXIT)" necessary.
M[CLEAR 0.0000 Setsall variables equal
to zero.

1=C= C=1.0000 Stores rotation axis


(0,0,1).
27 =ANG = ANG =27.0000 Stores rotation angle.

=MOREE7=X0= X0=7.0000 Stores x-coordinate of


translated origin.

4 =Y0= Y0 = -4.0000 Stores y-coordinate of


translated origin.
7EYE Y =7.0000 Stores y-coordinate of
P;.
= MORE = = MORE = Stores x-coordinate of
9[+/-]=EXE X=-9.0000 P;.

= MORE = = MORE = x-coordinate of P, in


=FTRN = FTRN=-9.2622 new coordinate system.

* To set degrees mode on the HP-19B,use the following keystrokes: Wl


i

1]
O
D

EXIT].

2: Coordinate Transformations 99
=Y Y’'=17.0649 y-coordinate of P, in
new coordinate system.

=MORE=6=X= X=6.0000 Stores x-coordinate of


P,
=MORE=8ESY= Y =8.0000 Stores y-coordinate of
P,
MORE= S FTRNZ= FTRN=4.5569 x-coordinate of P, in
new coordinate system.

SY= Y’'=11.1461 y-coordinate of P, in


new coordinate system.

Now, convert the point P“3(2.7,—3.6) to its equivalent coordinates in the


original system.

Keys: Display: Description:

27=XE X =2.7000 Stores x-coordinate of


P’5 in new system.
3.6 =Y = Y’ = -3.6000 Stores y-coordinate of
P’5 in new system.
SITRN= ITRN=11.0401 x-coordinate of P”5 in
original system.

= MORE = = MORE = y-coordinate of P”5 in


SYS Y=-5.9818 original system.

Notice that once the translated origin, rotation angle, and rotation axis
have been stored, points can be both forward and inverse transformed
without re-entering this data.

100 2: Coordinate Transformations


Example 2: A Three-Dimensional Transformation. A three-
dimensional coordinate system is translated to (2.45, 4.00, 4.25). After
translation, a 62.5° rotation occurs about the (0, -1, —1) axis. In the ori-
ginal system, a point had the coordinates (3.9, 2.1, 7.0). What are the
coordinates of the point in the translated rotated system?

Asin the previous example, set the calculator to degrees mode.

Keys: Display: Description:

| CLEAR DATA 0.0000 Clears all variables in


"CTRANS" equation.
1[+/-]EBZ B=-1.0000 Stores b-component of
rotation axis.
C=-1.0000 Stores c-component of
rotation axis.
ANG =62.5000 Stores rotation angle.
Stores x-coordinate of
X0=2.4500 translated origin.
Y0=4.0000 Stores y-coordinate of
translated origin.

Z20=4.2500 Stores z-coordinate of


translated origin.

Y=2.1000 Stores y-coordinate of


pointin original system.
Z=7.0000 Stores z-coordinate of
point in original system.
Stores x-coordinate of
X=3.9000 point in original system.

2: Coordinate Transformations 101


= MORE = = MORE = x-coordinate of point in
SFIRNE FTRN=3.5861 new system.

SYE Y’'=0.2609 y-coordinate of point in


new system.

=Z= Z'=0.5891 z-coordinate of point in


new system.

In the translated, rotated system above, a point has the coordinates


(1,1, 1). What are the corresponding coordinates in the original system?

Keys: Display: Description:

1EXE= X’ =1.0000 Stores x-component of


point in new system.
[STO]EY'E Y’=1.0000 Stores y-component of
point in new system.
[STOJEZ = Z’'=1.0000 Stores z-component of
point in new system.
=ITRNZ ITRN=2.9117 x-component of point in
original system.
= MORE = = MORE = y-component of point in
=YE Y=4.3728 original system.
RCL|IEZE Z=5.8772 z-component of point in
original system.

102 2: Coordinate Transformations


References

CRC Handbook of Mathematical Sciences, 5th Edition, page 354, Edited


by William H. Beyer, CRC Press,Inc., 1978

The VNR Concise Encyclopedia ofMathematics, page 533, Edited by W.


Gallert,et.al., Van Nostrand Reinhold Co., 1975

Special thanks to Rene S. Julian for contributing the original version of this
program to the HP-65 Users’ Library.

2: Coordinate Transformations 103


More Step-by-Step Solutions
for Your HP-27S or HP-19B Calculator
These additional books offer a variety of examples and keystroke pro-
cedures to help set up your calculations the way you need them.

Practical routines show you how to use the built-in menus to solve prob-
lems more effectively, while easy-to-follow instructions help you create
personalized menus.

Real Estate, Banking, and Leasing (00017-90019)


m Use the TVM menu for real estate, banking, and leasing calculations.
m Calculate the annual percentage rate of a loan with fees.
m Calculate discounted, adjustable-rate, and bi-weekly mortgages.
m Develop menus for graduated-payment and wrap-around mortgages.
m Estimate monthly payments and mortgage insurance.
m Use menus to calculate Rule of 78s, add-on loans, constant payment
loans, loans with odd first periods, and leases with multiple payments
in advance.
m Work with a variety of methods to evaluate savings plans.

Business Finance and Accounting (00017-90020)


m Calculate break-even point, profits, and standard business ratios.
m Make investment decisions using payback period, net present value,
and internal rate of return.
m Solve for variances and other cost-accounting variables.
m Develop menus to calculate the sample size for an inventory audit.
m Perform financial statement, production, and inventory analyses.
m Forecast sales and units to manufacture.
Marketing and Sales (00017-90021)
m Forecast sales using moving averages, exponential growth curves, and
linear regression.
n Determine price, mark-up, and profit.
n Estimate the financial feasibility of a new product.
m Estimate the elasticity of demand.
m Build a "quote maker" for accurate, on-the-spot quotes.
m Base a customized menu on your company’s commission scale to cal-
culate your commission on a product.

Personal Investment and Tax Planning (00017-90022)


m Evaluate savings and IRA plans.
m Solve for funds available upon premature distribution from an IRA.
m Calculate basic mortgage components and the annual percentage rate
of a loan.
m Evaluate your investment alternatives among life insurance, treasury
bills, bonds, stocks, mutual funds, and limited partnerships.
m Calculate the Beta of your portfolio, estimate your stock price volatil-
ity, target your gains, hedge with call options, and estimate margin
account gain or loss.
m Determine your tax and inflation break-even point.

How to Order...

To order a book your dealer does not carry, call toll-free 1-800-538-8787
and refer to call code P270. Master Card, Visa, and American Express
cards are welcome. For countries outside the U.S., contact your local
Hewlett-Packard sales office.
Step-by-Step Solutions
for Your HP-27S or HP-19B Calculator

This book contains advanced Solver techniques and a variety of appli-


cations, equations, and keystrokes to provide solutions for the science
and engineering professions.

B Advanced Solver Techniques


® Two Powerful New Functions: LET and GET
Keystroke Reduction Techniques
Recursive Equations
Menu Variable Arrangement
Solutions for More Than One Variable at a Time
Techniques for Forcing Iteration
Indefinite Loop Simulation
B Use of Trigonometric Functions
B Technical and Scientific Solutions
B Greatest Common Divisor and Least Common Multiple
Numerical Integration
Numerical Differentiation
Factors and Primes
Vector Operations
Complex Number Operations
Triangle Solutions
3 X 3 Matrix Operations
Coordinate Transformations

HEWLETT
(":” PACKARD
Reorder Number
00027-90044
00027-90053 English
Printed in Canada 11/88 0 886 98"000°2 0 5

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy