def continuityTestingFixedEps(eqns, names, ts, compinds, tsprops, epsprops, lags, numlags, fname=''): forwardconf, inverseconf, epsM1, epsM2, forwardprobs, inverseprobs = PM.convergenceWithContinuityTestFixedLagsFixedEps( ts[:, compinds[0]], ts[:, compinds[1]], numlags, lags[0], lags[1], tsprops=tsprops, epsprops=epsprops) forwardtitle = eqns + r', M{0} $\to$ M{1}'.format(names[compinds[0]], names[compinds[1]]) inversetitle = eqns + r', M{1} $\to$ M{0}'.format(names[compinds[0]], names[compinds[1]]) outdict = dict([(x, locals()[x]) for x in [ 'forwardconf', 'inverseconf', 'forwardtitle', 'inversetitle', 'numlags', 'lags', 'ts', 'tsprops', 'epsprops', 'epsM1', 'epsM2', 'forwardprobs', 'inverseprobs' ]]) if fname: fileops.dumpPickle(outdict, fname) else: return outdict
def continuityTestingFixedEps(eqns,names,ts,compinds,tsprops,epsprops,lags,fname='',numlags=5): ''' Will work with any of the equations, Lorenz, double pendulum, or modified double pendulum. ''' if len(lags) == 1: forwardconf, inverseconf, epsM1, epsM2, forwardprobs, inverseprobs = PM.convergenceWithContinuityTestFixedLagsFixedEps(ts[:,compinds[0]],ts[:,compinds[1]],numlags,lags[0][0],lags[0][1],tsprops=tsprops,epsprops=epsprops) else: forwardconf, inverseconf, epsM1, epsM2, forwardprobs, inverseprobs = PM.convergenceWithContinuityTestMultipleLagsFixedEps(ts[:,compinds[0]],ts[:,compinds[1]],numlags,lags,tsprops=tsprops,epsprops=epsprops) forwardtitle = eqns + r', M{0} $\to$ M{1}'.format(names[compinds[0]],names[compinds[1]]) inversetitle = eqns + r', M{1} $\to$ M{0}'.format(names[compinds[0]],names[compinds[1]]) outdict = dict([(x,locals()[x]) for x in ['forwardconf','inverseconf','forwardtitle','inversetitle','numlags','lags','ts','tsprops','epsprops','epsM1','epsM2','forwardprobs','inverseprobs']]) if fname: fileops.dumpPickle(outdict,fname) else: return outdict
def testDoublePendulum(masterts,mastereps,fname=''): eqns,names,ts = doublependulumTS(finaltime=2400.0) compind1=2 compind2=3 numlags = 5 #num dims lagsize = 6900 #504 #307 #117 #28 # lagsize = SSR.numlagsFromFirstZeroOfAutocorrelation(ts[:,compind1]) # print(lagsize) M1 = SSR.makeShadowManifold(ts[:,compind1], numlags, lagsize) M2 = SSR.makeShadowManifold(ts[:,compind2], numlags, lagsize) N = int(0.1*M1.shape[0]) forwardconf, inverseconf = PM.convergenceWithContinuityTest(M1,M2,N,masterts,mastereps) forwardtitle = eqns + r', M{0} $\to$ M{1}'.format(names[compind1],names[compind2]) inversetitle = eqns + r', M{1} $\to$ M{0}'.format(names[compind1],names[compind2]) outdict = dict([(x,locals()[x]) for x in ['forwardconf','inverseconf','forwardtitle','inversetitle','N','numlags','lagsize','ts','masterts','mastereps']]) if fname: fileops.dumpPickle(outdict,fname) else: return outdict
def testLorenz(masterts,mastereps,fname=''): eqns,names,ts = lorenzTS() compind1=0 compind2=1 numlags = 3 #num dims lagsize = 8 # lagsize = SSR.numlagsFromFirstZeroOfAutocorrelation(ts[:,compind1]) # print(lagsize) Mx = SSR.makeShadowManifold(ts[:,compind1], numlags, lagsize) My = SSR.makeShadowManifold(ts[:,compind2], numlags, lagsize) N = int(0.1*Mx.shape[0]) forwardconf, inverseconf = PM.convergenceWithContinuityTest(Mx,My,N,masterts,mastereps) forwardtitle = eqns + r', M{0} $\to$ M{1}'.format(names[compind1],names[compind2]) inversetitle = eqns + r', M{1} $\to$ M{0}'.format(names[compind1],names[compind2]) outdict = dict([(x,locals()[x]) for x in ['forwardconf','inverseconf','forwardtitle','inversetitle','N','numlags','lagsize','ts','masterts','mastereps']]) if fname: fileops.dumpPickle(outdict,fname) else: return outdict