Biorhythms - Python Application, Federation University, Australia
ITECH1400 Foundations Of Programming
DO YOU WANT TO EXCEL IN BIORHYTHMS - PYTHON APPLICATION ASSIGNMENT? HIRE TRUSTED TUTORS FROM EXPERTSMINDS AND ACHIEVE SUCCESS!
Question: Develop a Python application that can display Biorhythms for a person given their date of birth and the target date. You should be able to provide the Biorhythms for a suitable spread around the target date as well.
Answer: from datetime import date
from math import sin, pi
from pylab import *
from datetime import date
import matplotlib.dates
from pylab import *
from numpy import array,sin,pi
rc(('xtick.major','xtick.minor','ytick.major','ytick.minor'), pad=10)
dd,mm,yy=12,11,2009
dd2,mm2,yy2=25,1,2019 # Liz Taylor
# computation method:
method = 1 # 1: summed phase; 0: phase difference
# (See https://www.brianapps.net/palmbio/compatibilitycomparison.png for
# the differences between computation methods.)
#----------------------------------------------------------------------
s1 = "%04u-%02u-%02u" % (yy,mm,dd)
s2 = "%04u-%02u-%02u" % (yy2,mm2,dd2)
print ("Compatibility between",s1,"and",s2)
print (47*'-')
t1 = date(yy,mm,dd).toordinal()
t2 = date(yy2,mm2,dd2).toordinal()
lag = abs(t2-t1)
lag_p = lag % 23
lag_e = lag % 28
lag_i = lag % 33
lag_int = lag % 38
lag_aes = lag % 43
lag_awa = lag % 48
lag_spi = lag % 53
print ("lags (PEI):", lag_p,lag_e,lag_i)
avg1, avg2 = 0,0
out = []
def ana_lag(s, l, t):
global avg1, avg2
if method:
qq = 100.*abs(cos(pi*l/t)) # summed maximum method
else:
qq = 200./t*abs(l-t/2.) # phase difference
print (s, round(qq), "%")
avg1 += qq
avg2 += qq
out.append(qq)
ana_lag("compat physical: ", lag_p, 23)
ana_lag("compat emotional: ", lag_e, 28)
ana_lag("compat intellectual:", lag_i, 33)
avg1f = int(.5+avg1/3.)
print ("average: ", avg1f, "%")
ana_lag("compat intuitive: ", lag_int, 38) # aka compassion
ana_lag("compat aesthetic: ", lag_aes, 43)
ana_lag("compat awareness: ", lag_awa, 48)
ana_lag("compat spiritual: ", lag_spi, 53)
avg2f = int(.5+avg2/7.)
print ("total average: ", avg2f, "%")
t = array(range((t1-10),(t1+10))) # range of 20 days
y = 100*[sin(2*pi*(t-t1)/23), # Physical
sin(2*pi*(t-t1)/28), # Emotional
sin(2*pi*(t-t1)/33)]; # Intellectual
# converting ordinals to date
label = []
for p in t:
label.append(date.fromordinal(p))
fig = figure()
ax = fig.gca()
plot(label,y[0],label,y[1],label,y[2])
# adding a legend
legend(['Physical', 'Emotional', 'Intellectual'])
# formatting the dates on the x axis
ax.xaxis.set_major_formatter(matplotlib.dates.DateFormatter('%d/%b'))
show()
yticks(arange(8.5,-.5,-1), tnam)
xlim((0,100))
xlabel("%")
x = 102
text(x,8.5, "%u%%" % round(out[1]), va="center")
text(x,7.5, "%u%%" % round(out[0]), va="center")
text(x,6.5, "%u%%" % round(out[2]), va="center")
text(x,5.5, "%u%%" % round(avg1f), va="center")
text(x,4.5, "%u%%" % round(out[6]), va="center")
text(x,3.5, "%u%%" % round(out[5]), va="center")
text(x,2.5, "%u%%" % round(out[3]), va="center")
text(x,1.5, "%u%%" % round(out[4]), va="center")
text(x,.5, "%u%%" % round(avg2f), va="center")
title("Compatibility between %04u-%02u-%02u and %04u-%02u-%02u" % (yy,mm,dd,yy2,mm2,dd2))
fn = "%04u-%02u-%02u_and_%04u-%02u-%02u.pdf" % (yy,mm,dd,yy2,mm2,dd2)
savefig(fn)
show()
GET ASSURED A++ GRADE IN EACH BIORHYTHMS - PYTHON APPLICATION ASSIGNMENT ORDER - ORDER FOR ORIGINALLY WRITTEN SOLUTIONS!
Here we have included the major courses and learning units under our Federation University, Australia assignment help service, such as -
- ITECH1101 - IT Problem Solving Assignment Help
- ITECH1102 - Networking And Security Assignment Help
- ITECH1103 - Big Data And Analytics Assignment Help
- ITECH1104 - Cloud And Enterprise Computing Assignment Help
- ITECH1300 - Mobile Computing Platforms And Development Fundamentals Assignment Help
- ITECH2000 - Mobile Development Fundamentals Assignment Help
- ITECH2001 - Game Development Fundamentals Assignment Help
- ITECH2002 - Systems Modelling Assignment Help
- ITECH2003 - Web Design Assignment Help
- ITECH2004 - Data Modelling Assignment Help