co L'- O z < Z NASA TN D-1078 TECHNICAL NOTE D-1078 FOURIER SERIES OPERATING PACKAGE Milton L. Charnow Goddard Space Fright Center Greenbelt, Maryland NATIONAL AERONAUTICS AND SPACE ADMINISTRATION WASHINGTON December 1961 https://ntrs.nasa.gov/search.jsp?R=19980227213 2020-07-09T10:31:59+00:00Z
60
Embed
TECHNICAL NOTE - NASA › archive › nasa › casi.ntrs.nasa... · AiA1 + A2A2 + A3A3 + . . . + AnA n (Series A) and , , , , BIBI + B2B2 + B3B 3 + . . . + BmB m (Series B) which
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
This report presents a computer program for multiplying,
adding, differentiating, i nt e g r a t i n g, "barring" and scalarly
multiplying "literal" Fourier series as such, and for extracting
the coefficients of specified terms.
CONTENTS
oO
0
Summary .................................
INTRODUCTION ............................
SPECIAL REPRESENTATION OF A SINE,
COSINE, OR CONSTANT ....................
THE FOURIER OPERATING PACKAGE .............
Multiplication .............................
Addition and Subtraction ......................
Differentiation ............................
Integration ...............................
Bar Operation ............................
Scalar Multiplication ........................
Coefficient Extraction .......................
Series Evaluation ..........................
CONCLUDING REMARKS ......................
ACKNOWLEDGMENTS ........................
Appendix A - Nine Term Series in Standard
and Special Form .........................
Appendix B - Flow Charts ......................
Appendix C - Listing of Instructions ...............
Appendix D - Mystic Code ......................
2
3
4
4
5
5
5
6
6
II
25
47
.°.III
o0r,-
FOURIER SERIES OPERATING PACKAGE
by
Milton L. Charnow
Goddard Space Flight Center
INTRODUCTION
The Hansen Satellite Theory as modified by Musen 1 involves various manipulations
of "literal" Fourier series, as such, before final numerical evaluation. To program this
formulation it is necessary to represent cosines, sines, and constants in a special man-
ner and thus manipulate the various Fourier series.
SPECIAL REPRESENTATION OF A SINE, COSINE,
OR CONSTANT
It was decided to represent any term, including the constant term, of the Fourier
series we are concerned with by two consecutive eight-place floating-point words. The
terms of this series have the general form
A n cos (iF+jE +kW+ 1U)
or
A n sin (iF+jE +kW+ 1U)
and the values of F, E, W, and U are not used until final numerical evaluation. The first
eight-place floating-point word represents the coefficient A n in an entirely standard man-
ner. The second eight-place floating-point word represents the sine or cosine term of up
to four arguments in an artificial manner.
1Musen, P., "A Modified Hansen's Theory as Applied to the Motion of Artificial Satel-lites," NASA Technical Note D-492, November 1960.
Considera term suchasAncos (iF + jE + kW+ IU). Ultil this term is evaluatedweare concernedonlywith thevaluesof An, i, j, k, and1. The ::oefficient A n is represented
by the first of the two eight-digit floating-point words. The four coefficients of the argu-
ments (i, j, k, and 1) are each represented by two digits of tl-e second eight-place floating-
point word. The first two digits represent i and are normalized to 00; the next three pairs
of digits represent j, k, and 1, and are normalized to 50. Thas, the value of i may vary
from 0 to 99, while j, k, and 1 may vary from -49 to +49. A cosine is denoted by a plus
sign; a sine by a minus sign, that is, 1 cos (OF + 0E + 0W + ()U) or cos (0) becomes
+10000000 + 01, +00505050 + 08. Any constant term can be represented as A n cos (0). A
few additional examples will be helpful (see also Appendix A):
Conventional
1/4 cos (IF + 2E - 3W - 2U)
1/'4sin (OF + 1E - 0W + 2U)
1/4
0
Special
25000000+ 00, +01524748 + 08
25000000 + 00, -00515052 + 08
25000000 + 00, +00505050 + 08
00000000 + 00, +00505050 + 08
The convention of having the first non-zero coefficient of th,_ argument word positive was
adopted. Cos(-x) becomes cos(x) and sin(-x) becomes -sin(x). Examples are:
(L2) cos (OF - 3E + lW + 0U) becomes (1/2) co.4 (0F + 3E - 1W + 0U)
and the special representation is 50000000 + (_0, + 00534950 + 08
(1/2) sin (OF - 3E + lW + 0U) becomes -(1/2) sin (OF + 3E - lW + 0U)
and the special representation is -50000000 + 00 - 00534950 + 08.
The first location address of a series contains the num)er of terms of the series.
A series of n terms would be represented by 2n + 1 words the first of which would be
the number n.
THE FOURIER OPERATING PACKAGE
The following series operations are performed by the t'ourier Operating Package:
• Multiplication
• Addition and Subtraction
• Differentiation
• Integration
• Bar (Special operation used in the Hansen sa=ellite theory)
• Scalar Multiplication
• Coefficient Extraction
• Series Evaluation
oOt'--0,-4
Multiplication
Multiplication of two series, where the terms are of the general form described
earlier and the values of F, E, W, and U are not used until the final numerical evalua-
tion, is according to the conventional trigonometric identities:
A cos X'B cos Y = (AB/2) cos (X+Y) + (AB/2) cos (X-Y)
A cos X-B sin Y = (AB/2) sin (X+Y) - (AB/2) sin (X-Y)
A sin X.B cos Y = (AB/2) sin (X+Y) + (AB/2) sin (X-Y)
A sin X'B sin Y = (AB/2) cos (X+Y) + (AB/2) cos (X-Y).
The Fourier Multiplication routine is composed of three major sections: the multiplier,
the collapser, and the arranger.
The Multiplier
Two Fourier series such as
AiA1 + A2A2 + A3A3 + . . . + AnA n (Series A)
and , , , ,BIBI + B2B2 + B3B 3 + . . . + BmB m (Series B)
which are to be multiplied are arranged in descending order of the absolute values of the
coefficients, that is,
IAI > A21> A 3 >...> An and [BI > I B2 > B31>...> Bm]
To facilitate further discussion, we shall denote any term in the A series AxA_,
any term in the B series as ByBy, and any term. in.the resultant, series by CzCz, where
Ax, By and C z are the coefficient words and Ax, By, and C z are the argument words.
The multiplication of the A series by the B series proceeds as follows: The first
term in the A series is multiplied by each term in the B series, then the second term in
the A series is multiplied by each term in the B series, and so on until each term in the
A series has been multiplied by each term in the B series. For exampl% AxBy is compared
AxBy * •with some numerical criterion e. If > e, then CzC z and C(z + 1) C(z + 1) are gen-
erated according to the trigonometric formulas already stated. If I AxBy _- e, then the
value of y is examined. If y > 1 (i.e., By is any term other than the first term), A x is
replaced by A(x + 1) and A(x + 1) is multiplied by B 1. If y = 1, the multiplication of the
two series is terminated since any further A(x + 1) By will also be less than e. The mul-
tiplication process continues until AnA* has been multiplied by BmB* unless the
numerical criterion or space limitations intervene.
The Co llaps er
Every multiplication generates two terms of _wo words each. The purpose of the
collapser is to combine like argument terms. Each _'gument term Cz is compared with,each other argument term previously generated and s_ored. If C z equals any other
argument term, the corresponding coefficient terms are added. Thus, there is no dupli-
cation of terms.
The Arranger
The final step in the multiplication is the arranging of the terms of the series.
ICll is comparedwithlC21 , IC31,etc. If ICzl)ICll, then C 1is replaced by C z and
C_ is replaced by C z. The process continues until the terms are arranged, in descending
order, according to the absolute value of the coefficients.
Addition and Subtraction
Addition or subtraction of two Fourier serie_ is primarily a process of com-
paring argument terms and adding the coefficients of like terms. A_ is compared suc-
cessively with B_ through Bm, A_ with B_ through Brl , etc., until A n has been compared
with B m.* If A x*= By,* the sum of the coefficients (A x _ By) and the argument term A* are* *
stored, and By and By are replaced by zeros, If A_ d)es not equal any By, both A x and,
A x are stored. After all terms in the A series have been compared with all terms in theB series, the remaining B series terms are stored.
Subtraction is accomplished in like manner after changing the signs of each coeffi-
cient term in the B series. The resultant series in each case is processed through the
arranger.
Differentiation
Differentiation, in this application, is with respect to the F variable.
_ A sin (iF +jE +kW+ 1U) - iA cos (iF +jE +kW+ 1U).
The numerical values F, E, W, and U are only employed in the Series Evalua-
tion Routine.
To evaluate a Fourier series, the numerical valu_.s of i, j, k, and 1 are multi-
plied by the numerical values of F, E, W, and U, and the s_Lm iF + jE + kW + IU is de-
termined. The sine or cosine of iF + jE + hW + 1U is multiplied by the coefficient A and
the terms are added.
CONCLUDING REMARKS
Appendix A is the special representation of a nine ter_n series. Appendix B presents
flow charts and Appendix C a listing of instructions for the program packages for multi-
plication (including the collapser and arranger), addition t_r subtraction, differentiation,
integration, bar operation, scalar multiplication, coefficie_t extraction, and the evalua-
tion of the final series. Because this program was writter in Mystic Code for the IBM
709, an explanation of Mystic Code is given in Appendix D.
The Fourier operating package can be used with any t]mory that involves representa-
tions of functions by Fourier series. It can also be modified to operate with polynomials
of the form xaybzcu d.
o0
D-O
ACKNOWLEDGMENTS
The author is indebted to Messrs. R. G. Kelly and T. P. Gorman for their aid in the
construction of the package and for the translation into Mystic Code and to Aileen Marlo"
for preparing the flow charts.
AppendixA
oO
O
Nine Term Series in Standard and Special Form
The following is a nine term series presented in standard and in special form. Note
that in the special form, the first location (address) contains the number of terms in the
series.
Series in standard representation
.29467121 cos (0)
+.00010496334 cos (OF + 0E + 2W + 0U)
+.00005252596 sin (OF + 1E - lW + 0U)
+.000019845618 cos (0F+ 1E - 2W+0U)
+.0000066329604 cos (OF + 1E + 2W + 0U)
+.0000020107054 cos (OF + 2E - 2W + 0U)
-.00000036004597 sin (OF + 0E + lW + 0U)
-.000000055052357 sin (OF + 0E + 3W + 0U)
-.000000031090653 sin (OF + 1E + lW + 0U)
Series in special representation
90000000 + 01
+29467127+00,
+10496334-03,
+52525962-04,
+19845618-04,
+66329604-05,
-20107054-05,
-36004597-06,
-55052357-07,
-31090653-07,
+00505050+08
+00505250+08
-00514950+08
+00514850+08
+00515250+08
+00524850+06
-00505150+08
-00505350+08
-00515150+08
11
cO
0
Appendix B
Flow Charts
The following are the flow charts for the op-
erating packages for multiplication (including
the collapser and the arranger), addition or
subtraction, bar operation, differentiation, in-
tegration, and series evaluation.
2H
cO
0
?Coq)_t e I
criterion e
Initiate
N l , N 2
Flow Chart for Multiplication
Initiate
A series
counter a
=+2
Initiate
B series
13
A x By > O}
45
I y I
I I_t ermi..e I
for k x l
i k+50[
j+so 1+so IGet By I
Is it + or -?|
sin I c ,s //
M
14
Flow Chart for Multiplication (<'ontinued)
Determine
for By
i' k' + SO
j' +SO l' +50
Determine
i +i' i - i'
J+i' J-J'k +k' k -k'
1 + 1' [ - 1'
i+i' = +,07
\ + I o I
lj+j ' = +,0,-?_
_101-/l
+ I ° =+,O,-P_
_1° I-/
I Change
indicator
to zero
Ib
Change signs
of j+j', k+k °
1+1'; indicate
reversal
fC]lange
indicator
to zero
Change
signs and
indicate
reversal
t
t
0-..j
Gc
Flow Chart for Multiplication (Continued)
15
?Determine I
j+j'+SO j-j'+50k+k'+SO k-k' +50
1+1'+50 1-1'+50
i +i' > 99?
Arranger
Arranger
Form
i+i', j÷j', etc.
i-i', j-j*, etc.
in normalized
form
Was A_ sin
or cos_
16
Flow Chart for Multiplication (Continued)
B ,ino.co. 8 ' norco"sin [ Cos? sin I cos?
Ui
V=_O0
sin x sin y
sin x cos y
Fol'm
- _A_ey cos (X ÷ y)
+lA_y cos (x-y_
C C_ and c,. xC_, x
Form
_ AxBy sin (x+y)
1
+ _ AxBy sin (x-y)
C,C_ and C,. tC_ +x
cos x sin y _J cos x cos y
!Form
1
+ _AxSy :;in (x+y)
1
- _ AxBy _.in (x-y)
CzC _ _ ('i+1C_÷i
Check that _
no sin (0) ]
propagated
Form
I
+ _A_Sy cos (x*y)
1+ W A_By cos (x- y)
CzC _ and Cz+lC_, 1
v
Collal )ser
o_
O"
Flow Chart for Multiplication
Collapser
first
term
lAdd toe f f.
terms (new
coe f f. term=
(Continued)
17
1st term?
B series?
A series?
Arranger
18
Flow Chart for Multiplication (Continued)
Arranger
I
_o
_+2
Ax, l
Is A z < O?
Ax, 1 <
I Store A x Inow larRest
½
-- \,.. I _o/
cO
p--O
Flow Chart for Addition or Subtraction
Add _ubt r _t
_/2, and
counters
/ _+2 . \
Get By rand By
I
19
I InitiAte •counter for
r e_olning B's
Store
By snd B_
20
Flow Chart for Bar Operation
Initiate
Initiste
c_t ^ ^: IIndicate sinl
Determine [i,j,k,I
+Addi+j = j
Replsce i by
is j' > O?
Change signs
j', k, land
indicate change
was A_ sin or cos?
I + 50
Normalize
into A_
I
",4
j O0
Flow Chart for Differentiation
21
oo
o "Initialize 2NInitialize
_+2
Get Ax, A_
Is A_ positive?
22
Flow Chart for Integration
Initiate 2N
InitiRte
a+2
Get A x snd A'_
Indicate sine
or cosine
+i,j,k,I
tJi
Determine
jc kg
jc+kg =
Determine
A z : A_/kg
¢os_
Indicate
printout
Store A s
and A z
23
Flow Chart for Series Evaluation
oor-c_
?Initialize
series total
accumulator,
_, and series
counter a
_+2
Get A_,
+G_t IA_I
Determine
arglJments
i, j,k,l
and add
+Get
absolute
value of
angle
Determine
value of cos
Multiply by A x
AccumulAte
totnls
I
Determine
value of sin
Multlp[y by A x
Accumulate
totals
I
25
o0r'-O
Appendix C
Listing of Instructions
The following is a listing of instructions for
multiplication (including the coUapser and the
arranger), addition or subtraction, differentia-
tion, integration, bar operation, scalar multi-
plication, and coefficient extraction.
The square root instructions are for stand-
ard number representations and therefore have
not been discussed in the report.
_7
SOD-O
,--4
r/:"
O
O
UJ
t'.
OOOO O OOOO ,'-q '-4,-4 ,-_ ,-_,-_ "4 r_'-'l '-_ e'_ (_'1 e'l N e4 e4 e'4 ¢'4 t'_ (_ _ _ _ _ _ _ _ _ _ _ _ 4"4"O OOC C OOOOO O(DO OC O (DO O(D OOOO OOOOO OOOC O(DOOO OO C C
C
CC
CO
r,_d
7
L9
j-,
_d
®
Z
® Z
I-- M
U _-Z LJ
D ZLL D
Lu
® UJ
® ZrP"
U9
UJ
L2
D Z
O
CO '.,9
U
-J
>-r,"
I'_F-- ,.1
U
I.I ,_(
I--- {3-
J_._J I_J
LUl-
l-- a.
Z
L_
Z
I
O ,'-_ I"-
+ I OOO O ,--_ ,-n 0,-400 ,-_O
OOOOOO O (DO OO(DO (DOO OOO-(D O O OO OOOO CO
OOOOOO O OO (DOOO (DO
OOOO O O ,--__r_ _ _ _- _(_ _ (_3 _ _ _'_ u'% _ _
OOOOOO COOOO O O ,-_ ,-_ '--_ '-_ O
(:DOOOO C C C C-OC) O O C_, (:D C C" OO ,--_ e,I O O O 00(:2,00 OO OO(DOO
+ OO O CO000 OO OOOC O
OOC ,-_ u"_ I'- O _ (_ "-I ('4 _ID _C O' "-_ I_ O'_ (''4 _'_ 4" '_ _D O" '-_ _ _ O C _uP.C_ OO O,-'10 O (DO O O O ''_ O O "-_ ''q '-_ "_ '-_ O '-'_ O O (:D f" O
I" O O OOOOOO OO O OOOOOO OO OO OC OOO CO
,.-_ O C OO OOO O O O O C_ O O O O O O O O O O (::_ O O O C_Ot',_ O (D OO OOO O O O (:D C_ O O O O O OO O O O C" O O O C'O