Generating the Weierstrass Monster with #Python
This is pathology of calculus that is continuous everywhere but differentiable nowhere. Henri Poincaré condemned it as “an outrage against common sense.” Charles Hermite called it a “deplorable evil.” Muahahahaha!
#!/usr/bin/env python3
import numpy as n,matplotlib.pyplot as p
a=.5;b=11;n_terms=50
x=n.linspace(-2,2,20000)
f=sum(a**k*n.cos(b**k*n.pi*x) for k in range(n_terms))
p.plot(x,f,'b',lw=.1)
p.title('Weierstrass Function')
p.grid()
p.show()









