Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
from idmlin import IDMLin
from matplotlib import pyplot as plt
from numpy import arange
def idmgo(t, a, b, s, v, fmt=None):
idm = IDMLin(t=t, a=a, b=b, s0=s)
res = arange(100)/100.
idm.go(v, res)
if fmt is None:
return res, idm.os()
else:
return res, idm.os(), fmt
def sweep():
names = ("T", "a", "b", "s_0", "v_0")
defaults = (1.5, 1, 3, 2, 30)
trng = [0.5, 1, 2, 2.5]
arng = [0.3, 0.5, 0.8, 1.5]
brng = [1, 2, 4, 5]
srng = [0.5, 1, 2.5, 3]
vrng = [10, 20, 40, 50]
rngs = [trng, arng, brng, srng, vrng]
colors = ['r', 'g', 'b', 'm', 'c']
dots = [':', '--', '-', '.-']
'''
for i in range(len(rngs)):
plt.plot(*idmgo(*defaults, fmt='k'))
print names[i], rngs[i][:2], defaults[i], rngs[i][2:]
args = list(defaults)
for n, arg in enumerate(rngs[i]):
args[i] = arg
plt.plot(*idmgo(*args, fmt=colors[i]+dots[n]))
plt.axis([0,1,-.2,.2])
plt.show()
'''
plt.plot(*idmgo(*defaults, fmt='k'))
print "a = ",
for arg in range(20):
args = list(defaults)
a = arg/20. + 0.2
print a,
args[1] = a
plt.plot(*idmgo(*args))
print
plt.axis([0,0.1,-.05,.45])
plt.show()
sweep()