case = 10 if case == 5: """ View the req and rpo for the same di. 2d version """ N = 1024 d = 30 h = 0.0002 di = 0.422 a0, wth0, wphi0, err = cqcglReadReqdi('../../data/cgl/reqDi.h5', di, 1) cgl = pyCqcgl1d(N, d, h, True, 0, 4.0, 0.8, 0.01, di, 4) eigvalues, eigvectors = eigReq(cgl, a0, wth0, wphi0) eigvectors = Tcopy(realve(eigvectors)) a0Hat = cgl.orbit2slice(a0)[0] veHat = cgl.ve2slice(eigvectors, a0) e1, e2 = orthAxes2(veHat[0], veHat[1]) x1, T1, nstp1, th1, phi1, err1 = cqcglReadRPOdi( '../../data/cgl/rpoT2X1.h5', di, 1) h1 = T1 / nstp1 nstp1 = np.int(nstp1) cgl2 = pyCqcgl1d(N, d, h1, False, 0, 4.0, 0.8, 0.01, di, 4) aa1 = cgl2.intg(x1, nstp1, 1) aa1Hat, th2, phi2 = cgl2.orbit2slice(aa1)
case = 1 if case == 1: """ use different N and h to view the explosion process. Try to find the optimal values. """ N = 512 d = 50 h = 0.0001 cgl = pyCqcgl1d(N, d, h, True, 0, -0.1, 1.0, 0.8, 0.125, 0.5, -0.1, -0.6, 4) Ndim = cgl.Ndim nstp3 = 200000 a0Erg3 = cgl.Config2Fourier(centerRand(2*N, 0.25)) aaErg3 = cgl.intg(a0Erg3, 20000, 20000) a0Erg3 = aaErg3[-1] aaErg3 = cgl.intg(a0Erg3, nstp3, 1) aaErgHat3, th3, phi3 = cgl.orbit2slice(aaErg3) aaErgTilde3 = cgl.reduceReflection(aaErgHat3) # plot3dfig(aaErgTildeProj3[:, 0], aaErgTildeProj3[:, 1], aaErgTildeProj3[:, 2]) # plot the variance => indicator of the integration error. plot1dfig(aaErg3[:, 0]) plot1dfig(aaErg3[:-1, 0]-aaErg3[1:, 0])