good in python
Computer Corner
The purpose of the "Computer Corner" is to provide readers an opportunity to share mathematically-
related problems which can be demonstrated or solved using a computer. The computer programs
accompanying the problems should be short and as simple as possible. Be sure to include with your
problem a listing of the computer program and a successful computer run and output. All problems
and computer solutions should be sent to:
Professor Gary Bitter
Arizona State University
Tempe, Arizona 85281
Biorhythms: A Computer Program
James G. Troutman
Jim Troutman is Assistant Professor of Mathematics and
Chairman of the Physical Science Department of York College of Pennsylvania, where he has been employed since 1970. He
V V Mm J } earned his M.A. in mathematics from Ball State University in
1968, a B.S. in mathematics education from the Pennsylvania State University in 1967, and is currently working toward the
D.Ed. in College Administration and Teaching at Nova Univer-
sity.
You say you're having a bad day, buddy! Well, maybe your biorhythms are down. There seems to be a national increase of interest in biorhythms. The theory of
biorhythms is the study of what appear to be certain life cycles which recur
consistently throughout one's life. Biorhythm cycles were first studied by Dr.
Wilhelm Fliess in Germany at the beginning of this century. According to the
theory, at birth a set of three cycles-physical, sensitivity, and intellectual-are started. The graph of each of these cycles appears as a sine curve with periods of 23, 28, and 33 days, respectively.
Each of the three cycles has a positive period (above the axis), a negative period (below the axis), and critical days where the cycle crosses the axis. The positive period is characterized by good feelings, activity, and increased vitality. The negative period is characterized by a need for rest and recuperation, and moodiness. During the critical days a person's cycles are changing from a positive to a negative period or vice versa. On these days one's body is in a state of flux, and stress builds up as energy changes characteristics. The advocates of biorhythm theory claim that during this period there is an increased potential for accidents.
The physical cycle is concerned with motor activities. It has a length of twenty-three days, with critical days being the first and twelfth days of the cycle. The critical days are characterized by headaches, worsening of illness, and acci- dents. The positive period occurs from the second through the eleventh days. This
101
Troutman, J. G. (1978). Biorhythms: A Computer Program. The Two-Year College Mathematics Journal, 9(2), 101-103. doi:10.2307/3026611
period is characterized by physical strength, endurance and stamina. A person will have a feeling of self-confidence during this period. The negative period occurs from the thirteenth through the twenty-third day. This period is characterized by a
lack of stamina and susceptibility to disease. The sensitivity cycle is concerned with emotions. The critical days occur on the
first and fifteenth days of this twenty-eight-day cycle. The critical days are
characterized by quarrels and slips of the tongue. The positive period occurs from the second through the fourteenth day. This period is characterized by cheerfulness and a feeling of cooperation. The negative period occurs from the sixteenth through the twenty-eighth day. This period is characterized by a lack of moral energy and a certain edginess.
The third cycle is the thirty-three-day intellectual cycle. The critical days occur
on the first and seventeenth days of the cycle, and are characterized by an inability
to concentrate, a failure of memory, and an increase in mental errors. The positive period of this cycle occurs from the second through the sixteenth day. This period is characterized by an increase in mental powers and an ability to learn and think
more clearly. The negative period occurs from the eighteenth through the thirty- third day of the cycle and is characterized by a need for repetition before learning occurs.
It should be pointed out that all three of these cycles operate in concert. Also, one should not be fatalistic about biorhythms. The positive and negative periods contrast each other. To experience a critical day does not mean that one is in danger and should stay in bed; rather, it is a day when one should be more alert. There is much need for further study in biorhythm theory, and it is the author's desire that this article will stimulate further interest in this area.
Following is a computer program written in FORTRAN that will plot a person's biorhythms. A sample run on an IBM 1131 is included.
I T-15 P~nGRAM IS nF5IGsNFn TO PQINT THF 81ORYHTHM5 OF A PER50N FOR C A 47 ')AY PFRION THF RlRTHr)AY OF THF 5UnJFCT AND THE STARTING
M ATF nF THF CHkART AQF PFOUIPFn INPU)T,
I)I-PNSION r.QAPHeR;). - ONTH( 12,1M) . OAW.) IS(3)
T-e Mtn.TH5 MIIST RF QFAD IN FROM A CAR) D ATA nFcK.
QPAr1( 2,9q4) ((-nNTHf I.J).J-I.I0) .1-I.I2) 1*14 -)Q.AT ( a XInA ))
W'?1TE (1I ,990) 00n enQ-AT (I THF FOLLOWINGX PRn)GPAM wILL PLOT YOUR BIORHTHMNS FOR A 47
InAY PFQlnn.1//, IF YoIJ WANT TO STOP Pt)T SWITCH I UP AT PAUSF 11111 7///l
C PAtJISE AND TFST FOP THF 1)?51RF TO STOP.
C Q PA(ISE 111 ' CALL rnAT5W ( 1, 1 rSn TO (990.1(10).1
IrnO W I TE "1 9P0 ) Qwn FnPQAT (' FNTFQ YOUIP MONTH. DAY ANn) YFAQ OF RIRTH AS 07/28/45'*/)
PFArn (6.970) NRM.-Nkrn MNRY0 07nb FnQ-AT X 1 XI?,AI1)
WRITE (1.960) o^n rnQ-AT (- FNTFP THF MtONTH. DAY AND YEAR YOU W15H THE CHART TO STAR
IT nN. IF, nl1/n1/77'?//) PFAn(6.1)7t )NCM . NCnM ,NCY,-
C. TeST FnQ PAD INPUTI
IF (NCY - N9Y) |10. 1'0. 1710 lit) WR1TE II.-501 4sin FnPMAT (' INCORRFCT MATF. TRY AGAIN. /
O~n TO 1 no
n7 NnYSI * NrnYS2 * NnYS3 *
C FROM~ HFQF TO 712 COMPUTE THF NUMMERF OF DAYS LIVEO DURING THE YEAR C OF' IRITH.
C. TFST FOR A LFAP YEAR.
IF (NAtY-X (NOY/41*41 1 150. 130. 150
110 IF (2- NRFMI 151) 140. 140 14A ^InrYss Nr)YSl + I 150 rl. TO (70)1.707.703.704.705.706.707.708.709.7?10.711.7121.ti9M 7ol NnY5I * NAYSI + 36A - NAO
r-n TO IAO
7 n> ss iy51 . NnYSI + ii 5 - N~n r(:) TO I hn
7WA NIIYSl * NnYSI + 107 - Nnn rn, TO 1 6n
7A4 stnysl * NnYSI + 77A - N~R) (:0 TO I 60
71) N YS1 *l Nnysl + 74A - N~r) ~n, TO 1 hn
7n6 MnY'.l * NnYSI + 71$, - N~R) Gn TO I (n
7n7 Nny,,l * NnYSI + IRS - NRo r-n TO I hn
70A 61MYS1 * Nr)YSj + 154 - NWO r-. TO I h?
7nQ -nY.,l * NnYSl + 1 21 - NRr) t~fn TO 1 hn
71A 1,rAY~l * NnY5I + 9i - NRO 611 TO I An
711 WlYS1 * Nnysl + h7 - NRr) r:n TO 1 hn
7111 KnY~l * NnYSl + 37 - Nkr)
FRAY HFRF TO ?On + 001 COMPUTE THE NUMBER OF DAYS LIVED FROm B'IRTH YFAQ TO THF CHART YFAR.
IAin -YR . NRY 17n NYQ * NYR + I
IFf NCY-NYR) 71O.210.IRO
c TFST rFnQ LFAP YEAR
IRA IF (NYQ-((NYQ/4.1-41) 700.190.200 IQn bN'YS2 * Nr)YS7 + I Pnl) NnY52 * N')YS7 +165
rl) TO 170
F sn- HFRE TO A12 COMPUITE THE NyUMMER OF DAYS LIVED DURtING THE CHART r YFAQ.
r TeST FnQ A LFAP YFAR. .,cr. , v,. ...nsA.,.
102
240 Co TO (A01?802.A03.A04.nFtOh.e6807.AOA.809.810.811.RI2) .NCM A ml Nn YS3 *r NYSIN + c
fiO TO 2 S0 An? NnY53 * NDYSI + NCn + 30
C'0 TO 750 Rni NM YS3 * NDYSI + NCO + SR
So TO 2 50 mn4 NMYS3 * NnYS4 + NCD + 89
trn To 2 50 AM 5 NMYS3 * Nr)YS3 +NsCn + 114
GO TO 250 An6 NnYS3 * NnYSI + NCD + 150
GOF TO 250 nn7 NnYS3 * NOYSI + NCD + I Rn
AMF TO 7 s0 AMA NOYS3 * NnYSI + Ncn + 211
C0n TO 250 AMR NnYS3 * Nn)YSI + Ncn + 242
GO TO 250o RIM NnYS3 * NOzYSI + NCn + 272
SwO TO 250o All NnYS3 * NDYSI + NCn + 303
GO TO 250 A12 NnYS3 * NDYSI + NCO + 331
C TOTAL Nom8FR OF DAYS LIVFD. r
7S0 NMYS *NOYS1 + NDYS7 + NOYSI A~NYS* NnYS
C THIS LooP COMPUTFS THE NU^4RER OF DAYS INTO EAC- CYCLE FOR THE C STARTING r)ATF OF THF CHART. IT I NIT IAL IZFS THF CYCLFS. C
no 751, 1-1.3 JT * (21+((1-1>*) >)
15,(~sI) - IFIX( X X ANn)Ys/JT)-(Nn)YS/JT) )*JT)+.01)>
C PRINT THF CHART HFAnlING,
WRITE (1.940) NAM, NPn) NRY 94n FORMAT ( 1 ,T21., - * I 0 R H Y T H M C HA R T * *|.//.T24.
1I n o A P F R s n) N Ft o R N./Tn?2/1 1?/T4 2 S * SFNSITIVITYIT2s -P *PHYSICAL ,T4401 *INTELLFCTLJAL .T7.1 3AYS ALIVF ? . WRITE (1.010
')In Fe)R-AT (I '.I - - - - - - - - - - - - - - - - - - - - - - - - - - I. . . . . . . . . . . . .? 1 NMAY * NCr)
61-TH * NCM
NYRS - NCY MMYS . NI)YS
r sTAnT A NFW -nNT-. I^ An ,'AY*1
r START A NFW YFAR.
IF (11 NMTH) 1 6rn ,'4r),4I-
.nS NYQS+1
r.n1 TO .III
11 ('REA*F ')AY RkY ONF. THFRF IS NO NFW YEAR OR M4ONTH.
7M ,NOVI * NoDAY+1
r-1n TO 410
TFST A '41 r)AY -ONT-.
1an le (11-eNAY) 150n150.170
TFST A 2P FIAY -ONTH.
Iqr IF ( 2 - NnAY) 'in.400n'470
r ('HFCK FOR FFARIlARY DURINGZ A LEAP YEAR.
400 IF (N'1QS-e NYRS/4)*4)) 35X0.370.350 4111 -1YS * -nYS + I 47n (nNTINIIF
r WRIlTE THF FOOTING FOR THF CHART.
WR>ITE f 1?01n) rGn TO 40
900 (ALL PXIT .)ANf1AQY FFFRUARQY MARCH APRIL MAY JUNE JULY AUGUST
S?FDTF..FP OC TOFRw NOVFMRFR OECEMRER
Cn-PILATloN )ISC.ONTIN(IFI)
- I& SYATFM PROGrAm rFTFCTFn) MONITOR CONTROL RFCORD
f 0)S L'nn C7V0L0'7S eA07 LIA E 70 7o0 T 0A. GR A- , DE OF 7) LTT C CO' qe CHOOG?F 70nV 42 C 00G00 s) FR512 AI 'ANo 9Y COANGINOG T- C LAS' 7'0's0 0 TN `00 L700 57TATE70FT Al.) Y C.ANGINO STATOA7NT 270.
- 021 X-1 ,42
f 0!!z L070 I"!TIALLV 0L1NK7
^^2^ J-l ..5 111 -OAA-(J) * 'LA,.-<
C OT A T S T 0 IS V ^0 07 AV N O.
C 7070 )? ?LACFC L-F (7- 007 - 70.0 517 TA F C70 A0
P '.A * Ae(L- ) )
07000 . 00,1,2 . 00?10,10,As)+IF(~ee 7AO,4K0) I)
C 7000700006". J ~ 07)7 1 7000 IAS 000070 070,IT
'LA SNS I 01:1 . I CI LE O 0 J A C1 I, 0 70) 010
I^ . I OS 11747
7AP' 1.I.I N AY, (CQ C1 1 ).J I ,54511750Y
7 , ' A ( . I . ? T P 4, 1 T? . 1 1 75
0 4 W 7UR LAT A 0Y0 03C EAING THE DAYHFY
C ~0. I. 0S 5LA IC 11754NAA SCV
11t F,4A 0 I I 00756?? , 9 2?X4A1 5
C 10 A0I T F 40K'TH AN) YEAR AS AD -OQODATF
'In C." T^ (I2!1?34fIPO,340,342,?40IO .IPOtao340.190.440.AO).NMETH C C TFST A In r1AY "nNTM. C
14 0 Jr1 (37-NDAY) 35750.170
1 R I Q 1 T H C H A 0 T
F n Q A D E ? S 0 N R 1 7 N
71/7200/4 5
S * SFN51TIVITY D * PHY,15ICAL I *INTFLLFCTUAL DAYS ALIVE
JAN PY 1. 197 0 I . P 11846 2 I P S 11P47 3 Ps I P 11048 4 . I IIR49 77 SP 11850 A S I S 1 185 1
77 7 1 7 11067 74 . I 110605
5 . P 11070
70 . P S I 11770
11 . P S I 110756
12 P , S 0 II 57
1 P S 5 11858 I P S I I 11 59 i s . I 11860 16 . 1 11061 17 P . I 11062 1.4 P S. I IIA63 19 P I . 1 1864 70 S P I . II65 71 Pl p Il"66
77 S I P I 1186 7 23 IP 1186A
24 I S * P I IA69 25 I S * P IIR70 7h II S . P 1171 27 I S P 11072 2 A 175 . S 1 073 29 1 . P IIA74 30 1 . P IIR75 1 1 1 S P I187 6
FFARU{ARY 1. 197A I , P 5 11 87 7
2 I . 5 118798 4 P I S IIR80
' ~ ~ ~~~ ~ ~ ~ ~~~~P * IS 11 881I p P . I1 A I82
7 P . I1 A I83 8 P , I IIRR4 9 P . S IIA85
FFFRU{ARY 11. 197R P S *1 A I87
JUNE 1978 SHORT COURSE ON APPLICATIONS FROM CONTROL THEORY
The Ohio Section and the Allegheny Mountain Section of the MAA will jointly sponsor a Summer Short Course on "Applications from Control Theory." The
course will be given at Allegheny College, Meadville, PA, in the second or third week of June 1978 with Professor Donald 0. Norris of Ohio University the main speaker. For further information, interested persons should contact Professor Klaus Eldridge, Department of Mathematics, Ohio University, Athens, Ohio 45701.
103
- Contents
- p. 101
- p. 102
- p. 103
- Issue Table of Contents
- Two-Year College Mathematics Journal, Vol. 9, No. 2 (Mar., 1978) pp. i+66-107
- Front Matter [pp. ]
- Mathematical
- Mapping, Diagrams, Continuous Functions and Derivatives [pp. 67-72]
- 乯瑥渠䰧䡯灩瑡氧猠創汥潲⁴桥⁉湤整敲浩湡瑥⁆潲洠∞⼢Ḡ孰瀮‷㌭㜴�
- Curricular
- A Note on Angle Construction [pp. 75-80]
- A Question of Interest [pp. 81-83]
- Reviews
- Review: untitled [pp. 84-86]
- Telegraphic Reviews [pp. 86-89]
- Two-Year College News [pp. 90-93]
- Problems and Solutions [pp. 95-100]
- Computer Corner
- Biorhythms: A Computer Program [pp. 101-103]
- Classroom Notes
- A Simple Antidifferentiation Technique [pp. 104-105]
- A Note on the Integral Test [pp. 105-106]
- A Geometrical Proof of Cramer's Rule [pp. 106-107]
- Back Matter [pp. ]