Sharedwww / talks / 2006-05-09-sage-digipen / dampedho.sageOpen in CoCalc
Author: William A. Stein
1
2
G = Graphics()
3
tg, bg = [],[]
4
mn, mx = 0, 10*pi
5
6
for i in range(1,4):
7
a = 1/i^2
8
fp,fn,fs = lambda x: exp(-a*x), lambda x: -exp(-a*x), lambda x: exp(-a*x)*sin(x)
9
c = hue(0.4 + 0.1*(i))
10
p1 = plot((fp,fn), mn, mx, rgbcolor=c, alpha=0.5)
11
p2 = plot(fs, mn, mx, rgbcolor=c)
12
tg.append(p1), bg.append(p2)
13
G += p1 + p2
14
15
bg.reverse(), tg.reverse()
16
17
ga = graphics_array((bg,tg))
18
19