Biorhythm Chart Generator Project: A Data Science Approach

Verified

Added on  2025/05/05

|9
|790
|495
AI Summary
Desklib provides solved assignments and past papers to help students succeed.
Document Page
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Contents
Description of Biorhythms.........................................................................................................4
Biorhythms as sine and cosine curves........................................................................................4
Pseudocode.................................................................................................................................5
Graphical display.......................................................................................................................6
Algorithm description................................................................................................................6
Demonstration of correct day/date.............................................................................................7
Demonstration of other features.................................................................................................8
Document Page
LIST OF FIGURES
Figure 1: How a biorhythm plot looks like................................................................................4
Figure 2: Screenshot of the biorhythm plot generated by the program......................................5
Figure 3 Demonstration that day/date annotation is implemented.............................................6
Figure 4 Features of the biorhythm graph..................................................................................7
Document Page
Description of Biorhythms
At the beginning of the last century doctors noticed a repetitive pattern in the illness records
of their patients. They observed that patients had a similar kind of emotional, mental &
physical level and with such kind of observations biorhythms were found. A combination of
physiological & bio-chemical activities that take place periodically in all human beings. The
biorhythm principles work under these observations made-
23 day cycle for the physical level curve
28 day cycle for the emotional level curve
33 day cycle for mental level curve
Biorhythms have also been sometimes called as rhythms of life for all the life forms on earth.
Vital body functions such as the blood pressure and the heart rate change as day turns into
night and vice versa. Other variations in the functioning of body occur in a repetitive pattern
and these patterns are the biological rhythms.
In the biorhythm plot, the curves below the median show the negative phase for the particular
cycle. For example if the physical biorhythm curve is below the median then the person may
feel weak & tired for that day. The same goes for the other biorhythm plots.
Biorhythms as sine and cosine curves
It is known that biorhythms are not very scientific but are represented as sine curves which
have the same amplitude and varying period.
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
The amplitude of the curve is not very important for a biorhythm plot but it is mandatory that
it is same for all the types of curves that are being represented. The critical days in a graph
are represented by the curves crossing the axis of the graph & it is recommended for the
person to stay alert on that day.
Pseudocode
Get birth date from user in integer format
Get target date from user in integer format
Calculate plus-minus 15 range from target date
Store dates in a usable format
bio_rhy =(sin(2*pi*(difference-birth)/28), sin(2*pi*(difference-
birth)/23), sin(2*pi*(difference-birth)/33))
add target range dates in a list/array
define graph colours/width/gridlines
define plot legend
plot biorhythm curves from the calculated values for the target
range
show plot
Document Page
Graphical display
Figure 2: Screenshot of the biorhythm plot generated by the program
Algorithm description
The created program asks the user for their birth date and the target date around which
they need to plot their biorhythm graph.
The input is taken in integer format and is split using python’s in-built split() function.
The user input date are converted into usable format by toordianal() function.
The range for which the graph is to be plotted is calculated by subtracting 15 dates
from the target and adding 15 dates to it.
Biorhythms for physical, emotional and intellectual levels are calculated by defining
the formula for each type of biorhythm.
The ranged ordinal dates are added into a separate list.
The plot style and look is defined.
Legend for the plot is added which will make looking and understanding the graph
easier.
Line width, colour etc. are defined.
Plot is shown to the used from the calculated biorhythm values.
Document Page
Demonstration of correct day/date
Figure 3 Demonstration that day/date annotation is implemented
The above biorhythm plot is generated from the program created as a part of this assignment.
The sample birth date taken as an input was 01-11-1997 and the input target date was 29-05-
2019. In the above screenshot it can be noted that the biorhythms around the target date have
been calculated correctly. Code for the same is shown below:
bdate,bmonth,byear=map(int,input("Enter your date of birth in
dd-mm-yyyy format: ").split('-'))
date_t,month_t,year_t=map(int,input("Enter target date in dd-
mm-yyyy format: ").split('-'))
birth = date(byear,bmonth,bdate).toordinal()
target = date(year_t,month_t,date_t).toordinal()
difference = array(range(target-15,target+15))
The difference stores fifteen days before and after the input target date.
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Demonstration of other features
Suitable legend has been added to the graph for better readability. Suitable values at
appropriate intervals are shown at the x-axis, y-axis. The graph shows the input birth date and
input target date as well.
Figure 4 Features of the biorhythm graph
The implementation in code is as follows:
figure = plot.figure(figsize=(12,8))
axis = figure.gca()
plot.plot(plot_g,bio_rhy[0], color="b", linewidth=3)
plot.plot(plot_g,bio_rhy[1], color="g",linewidth=3)
plot.plot(plot_g,bio_rhy[2], color="r",linewidth=3)
plot.legend(['Emotional', 'Physical', 'Intellectual'])
Document Page
plot.axhline(0, color="black", linewidth=2)
date_target = date(year_t,month_t,date_t)
plot.title("Plot for Biorhythm\n\nBirth Date = %02u.%02u.
%04u // Target Date = %02u.%02u.%04u" % (bdate,bmonth,byear,
date_target.day, date_target.month, date_target.year))
plot.grid(True)
plot.xlim((difference[0],difference[-1]))
a = date(year_t,month_t,date_t)
chevron_up_icon
1 out of 9
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]