Hp27s19b Tech en
Hp27s19b Tech en
HP-275
HP-19B
(fip HEWLETT
PACKARD
Technical Applications
Step-by-Step Solutions
for Your HP-27S or HP-19B Calculator
(,‘p HEWLETT
PACKARD
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
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.
Please take a moment to familiarize yourself with the formats used in this
book.
S o
INPUT
u
Il CLEAR DATA
u
H SHOW
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.
Keys: Display:
39.087 [+/-][=] -39.0870
29 M [E]30[+/-][=] -2.9000E30
Keys: Display:
1.408 W [E][-]27[=] 1.4080E-27
2.55 M [E][-]15[+/-][=] -2.5500E-15
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.
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.
Intermediate Variables
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.
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.
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.
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.
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.
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).
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=
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.
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=.
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.
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.
1: Forcing lteration 23
More on Using the X Function
l
A=0
N=1
AzA+N?
=N+3
N=N+1
No No
Yes Yes
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.
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.
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.
—
100 =3
3* — In In( 100 )=nln3
= .
(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
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).
SINC=IF(X=0:1:IF(SIN(30)=.5:SIN(X)+RAD(X):
SIN(X)+X)).
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.
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.
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
Example Problems
Check to see that you have entered the equation described above prop-
erly, then press = CALC = to display the menu of variables.
tob.
SLCME= Re-enters a.
STO|ZA= A=13,338
Thus,
Reference
b - 2n
Son =£““%L[fo+4f1+2f2+4f3+2f4+ 4+ 2fon2t4fom_1tf ]
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.
Equation: Comments:
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]
When your equation matches this one, press = CALC = to display the menu
of variables.
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.
9 m[ 18+V 182-92
2m(9)(18) —19§ ¥ ] =2809.68999 square feet
V182-9? 9
2: Numerical Integration 39
The equation for area in polar coordinates is:
6,
1
A=1(r240
2.{'
2r
When your equation matches this one, press = CALC = to display the menu
of variables. Evaluate the area using 40 subintervals.
Im
MORE = Set radians mode.
t1
A=0.0000 Stores a .
o
i
1
>
40 2: Numerical Integration
2 mx]" Stores b.
[=]EBE B=6.2832
20=ENE N =20.0000 Storesn.
Reference
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) .
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.
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);
2: Numerical Differentiation 43
The Differentiation Equation
Thelistings below outline Solver equations for differentiation.
Equation: Comments:
Equation: Comments:
+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 .
44 2: Numerical Differentiation
Example Problems
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))
where
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.
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.
46 2: Numerical Differentiation
The true acceleration is
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).
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.
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
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
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.
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
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.
Equation: Comments:
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.
* To set the display to ALL on the HP-19B,use the following keystrokes: EALLE.
i
complete factorization.
Make sure that your display is still set to ALL as in the previous example.
Cross product:
VixVo=[x; y1 24
X2 Y2 Zg
Dot product:
ViVa=xxotyya+z:2,
Magnitude:
Vi|=Vxf+yf+zf
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:
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.
!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:
2: Vector Operations 59
The work done is given by the formula
W=F-d
where d is the vector of motion.
* 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:
Stores x-coordinate of
ol
RSl
Te
<
HIE:
X2=5.00 cable 2.
i
ll
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.
* 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.
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)
Division: X-{a*ib)(c-id)
y c2+4d?
1 a-1
Inverse: —=
X a%+p?
Equation: Comments:
Example Problems
When your Solver equation matches the one listed, press = CALC = to
display the menu of variables.
O .
150 Q 100 Q
Z,—>
25 ufF T/ 65 mH
SR —
R, + s
Z, Z,
Keys: Display: Description:
Thus, vV 27+136=6+13.
1
O
1]
[EXIT].
Boas, Mary L., Mathematical Methods in the Physical Sciences, John Wiley
and Sons, New York, 1983.
Triangle Formulas
The following formulas are used as the basis for the triangle solutions
Solver equation.
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,
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.
Equation: Comments:
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.
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.
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
For this example set the angular mode to degrees and the display format
to "FIX 2."
* To set the display to FIX 2 on the HP-19B, use the following keystrokes: ERAXE2
1
o
Pl
(ExiT].
2: Triangle Solutions 79
297.36=82= $2=297.35 Stores side 2.
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.
82 2: Triangle Solutions
= MORE = = MORE = A1=23.16 Angle 1.
SAIS
=A2S A2=109.16 Angle 2.
Reference
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
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:
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
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:
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.
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.
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,
W
= QN
|
|
p—
O
N
|
90 2: 3x 3 Matrix Operations
5ZA21= A21=5 Stores 4 21.
You may also wish to recall the elements of the original matrix to verify
that they have not been altered.
470Q 100 Q
1 kQ
2: 3x 3 Matrix Operations 91
Set your display format to "FIX 4" for this example.
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.
References
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
and
q = (1-cosb)
Equation: Comments:
2: Coordinate Transformations 95
+0xL (B:B:G (D)) Changes b to a true direction vector
componentif it isn’t already.
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.
1]
O
D
EXIT].
2: Coordinate Transformations 99
=Y Y’'=17.0649 y-coordinate of P, in
new coordinate 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.
Special thanks to Rene S. Julian for contributing the original version of this
program to the HP-65 Users’ Library.
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.
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
HEWLETT
(":” PACKARD
Reorder Number
00027-90044
00027-90053 English
Printed in Canada 11/88 0 886 98"000°2 0 5