Skip to content
Snippets Groups Projects
Commit 3b90e2ab authored by mehtank's avatar mehtank
Browse files

eigenvalue of big A matrix vs max magnitude

parent adf2aa8f
Branches
No related merge requests found
from matplotlib import pyplot as plt from matplotlib import pyplot as plt
from numpy import arange, zeros, linspace, sign from numpy import arange, zeros, linspace, sign, logspace, log10
from idmlin import IDMLin from idmlin import IDMLin
t = 1.5 t = 1.5
amin, amax, acount = 0.1, 0.6, 50 amin, amax, acount = log10(0.3), log10(3), 20
bmin, bmax, bcount = 2, 4, 100 bmin, bmax, bcount = log10(1), log10(4), 20
arng = linspace(amin, amax, acount) arng = logspace(amin, amax, acount)
brng = linspace(bmin, bmax, bcount) brng = logspace(bmin, bmax, bcount)
s0 = 2 s0 = 2
v0 = 30 v0 = 30
re = 0.5 re = 0.1
ns = (10, 25, 50) ns = (200,)
f, axarr = plt.subplots(2, len(ns)+1, sharex=True, sharey=True) f, axarr = plt.subplots(2, len(ns)+1, sharex=True, sharey=True)
#f, axarr = plt.subplots(2, 2, sharex=True, sharey=True) #f, axarr = plt.subplots(2, 2, sharex=True, sharey=True)
...@@ -29,10 +29,13 @@ for i, n in enumerate(ns): ...@@ -29,10 +29,13 @@ for i, n in enumerate(ns):
def isstable(a, b): def isstable(a, b):
idm = IDMLin(t=t, a=a, b=b, s0=s0) idm = IDMLin(t=t, a=a, b=b, s0=s0)
idm.go(v0, re) idm.go(v0, re)
if idm.isloopstable(n): sys = idm.sys()
return 1, sign(idm.os()) ils = idm.isloopstable(n)
else: imr = idm.maxresponse()
return 0, sign(idm.os()) print a, b, ils, imr
return 1 if ils else 0, imr
#return 1 if ils else 0, 1 if imr<0 else 0
for ai, a in enumerate(arng): for ai, a in enumerate(arng):
for bi, b in enumerate(brng): for bi, b in enumerate(brng):
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment