# |(e^(-2.1 i x)-e^(2.1 i x))/(e^(-1/7 i pi x)-e^((i pi x)/7))|
# enkvaf(x) = abs((sin(2.1*x)/sin(1/7*pi*x)))
from datetime import date, datetime, timedelta
today = date.today ().weekday () # mon = 0, sun = 6 -> wed = 2
vaf(x) = (e^(-2.1*I*x)-e^(2.1*I*x)) / (e^(-1/7 *I*pi*x) - e^(I*pi*x/7))
absvaf(x) = abs(vaf(x).real() + vaf(x).imag()) # sage.. ?
idagvaf (t) = absvaf(t + today + (7 - 2))
p = plot (idagvaf, -2, 20, ymin = -5, ymax = 30, xmin=0, figsize = [9, 4], fill='axis', dpi=120, transparent=True, color='#1D89C8', thickness=2, fillcolor='white', fillalpha='0.8')
weds = 2 - today # dagar til neste onsdag
if weds < 0: weds = 7 + weds
format = "Ons %d. %b (ca kl 8)"
delta = timedelta (int(weds))
next = datetime.now ()
if weds > 0:
next = next + delta
p += text (next.strftime (format), (weds -1, 30), color='white', fontsize=11)
next = next + timedelta (int(7))
p += text (next.strftime (format), (weds + 6, 30), color='white', fontsize=11)
next = next + timedelta (int(7))
p += text (next.strftime (format), (weds + 13, 30), color='white', fontsize=11)
p.axes_labels (['Dagar', 'Vaflabilitet'])
p.axes_color ('white')
p.axes_label_color ('white')
p.tick_label_color ('white')
p.axes_width (2)
show (p)
show (abs(vaf))
|
|
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ {\left| \frac{e^{\left(-2.10000000000000i \, x\right)} - e^{\left(2.10000000000000i \, x\right)}}{e^{\left(-\frac{1}{7} i \, \pi x\right)} - e^{\left(\frac{1}{7} i \, \pi x\right)}} \right|}
\newcommand{\Bold}[1]{\mathbf{#1}}x \ {\mapsto}\ {\left| \frac{e^{\left(-2.10000000000000i \, x\right)} - e^{\left(2.10000000000000i \, x\right)}}{e^{\left(-\frac{1}{7} i \, \pi x\right)} - e^{\left(\frac{1}{7} i \, \pi x\right)}} \right|}
|