def cov_galve(t, w0, g, c0, c1, T, ci1, ci2 ,wd, i = 2, unpacked = False):
    """
    2 osciladores, alta temperatura, ambos entornos a T
    """
    a1, e1 = w0**2-g**2/4+c0-2*g, c1
    a2, e2 = w0**2-g**2/4-c0-2*g, -c1
    nu1, nu2 = fl.mathieu_nu(wd, a1, e1), fl.mathieu_nu(wd, a2, e2)    
    
    
    print 'Limite: ', np.abs(nu1.imag/g)
    print 'Estable: ', nu1.imag - g/2 < 0, nu2.imag - g/2 < 0

    Vmas = w0**2 + c0 +  c1 * np.cos(wd*t)
    Vmenos = w0**2 - c0 - c1 * np.cos(wd*t) 

    sxxM, sppM, sxpM = sigma(t, g, T, a1, e1, wd, ci1, Vmas, i)
    sxxm, sppm, sxpm = sigma(t, g, T, a2, e2, wd, ci2, Vmenos, i)

    x1x1 = 1/2 * (sxxM+sxxm)
    p1p1 = 1/2 * (sppM+sppm)
    x1p1 = 1/2 * (sxpM+sxpm)
    x2x2 = x1x1
    p2p2 = p1p1
    x2p2 = x1p1
    x1x2 = 1/2 * (sxxM-sxxm)
    p1p2 = 1/2 * (sppM-sppm)
    x1p2 = 1/2 * (sxpM-sxpm)
    x2p1 = x1p2

    if unpacked:
        return x1x1, x2x2, x1x2, x1p1, x2p2, x1p2, x2p1, p1p1, p2p2, p1p2, nu1, nu2
    else:
        cov_matrix = np.array([[x1x1, x1p1, x1x2, x1p2], [x1p1, p1p1, x2p1, p1p2], [x1x2, x2p1, x2x2, x2p2], [x1p2, p1p2, x2p2, p2p2]])
        return cov_matrix, nu1, nu2
def sigma(t, g, temp, a, e, wd, ci, V, i = 2):
    """
    V(t) = a + e * cos(wd*t)
    """
    nu = fl.mathieu_nu(wd, a, e)
    C = fl.mathieu_coefs(wd, a, e, nu)
    C = C[C.size//2-i:C.size//2+i+1]
    phi1, dphi1, phi2, dphi2 = fl.mathieu(wd, a, e, t)
    dt = t[1]-t[0]
    #d2phi1, d2phi2 = np.gradient(dphi1, dt), np.gradient(dphi2, dt)
    sxx0, sxp0, spp0 = ci[0], ci[1], ci[2]
#    dsxx0 = -((g*(spp0*phi1**2+2*sxp0*phi1*(-(g*phi1)/2+phi2)+sxx0*(-(g*phi1)/2+phi2)**2))/np.exp(g*t))+(2*spp0*phi1*dphi1+2*sxp0*(-(g*phi1)/2+phi2)*dphi1+2*sxp0*phi1*(-(g*dphi1)/2+dphi2)+2*sxx0*(-(g*phi1)/2+phi2)*(-(g*dphi1)/2+dphi2))/np.exp(g*t)
#    d2sxx0 = (g**2*(spp0*phi1**2+2*sxp0*phi1*(-(g*phi1)/2+phi2)+sxx0*(-(g*phi1)/2+phi2)**2))/np.exp(g*t)-(2*g*(2*spp0*phi1*dphi1+2*sxp0*(-(g*phi1)/2+phi2)*dphi1+2*sxp0*phi1*(-(g*dphi1)/2+dphi2)+2*sxx0*(-(g*phi1)/2+phi2)*(-(g*dphi1)/2+dphi2)))/np.exp(g*t)+(spp0*(2*dphi1**2+2*phi1*d2phi1)+2*sxp0*(2*dphi1*(-(g*dphi1)/2+dphi2)+(-(g*phi1)/2+phi2)*d2phi1+phi1*(-(g*d2phi1)/2+d2phi2))+sxx0*(2*(-(g*dphi1)/2+dphi2)**2+2*(-(g*phi1)/2+phi2)*(-(g*d2phi1)/2+d2phi2)))/np.exp(g*t) 
        
    
    sxx = np.exp(-g*t)*( (phi2-g/2*phi1)**2*sxx0 + 2*phi1*(phi2-g/2*phi1)*sxp0 + phi1**2 * spp0 )+S_xx(t, g, temp, nu, C)
    sxx = sxx.real
   
#    dsxx = dsxx0 + S_xx(t, g, temp, nu, C, deriv = 1)
#    d2sxx = d2sxx0 + S_xx(t, g, temp, nu, C, deriv = 2) 
    
    sxp = np.gradient(sxx, dt)/2
    spp = np.gradient(sxp, dt)+g*sxp+(V-2*g)*sxx    

#    sxp = 1/2 * dsxx
#    spp = 1/2 * d2sxx +g*sxp+(V-2*g)*sxx    

    
    return sxx.real, spp.real, sxp.real
Exemple #3
0
def cov(t, g, ca1, cq1, ca2, cq2, temp1, temp2, wc = 50, i = 5, unpacked = False):
    """
    Devuelve todos los valores medios para la matriz de covarianza. Puede devolverlos como
    la matriz armada o unpacked.
    """    
    nu1, nu2 = fl.mathieu_nu(ca1, cq1), fl.mathieu_nu(ca2, cq2)
    c1, c2 = fl.mathieu_coefs(ca1, cq1, nu1), fl.mathieu_coefs(ca2, cq2, nu2)
    c1, c2 = c1[c1.size//2-i:c1.size//2+i+1], c2[c2.size//2-i:c2.size//2+i+1]
 
    phi1, dphi1, phi2, dphi2 = fl.mathieu(ca1, cq1, t)    
    phim1, dphim1, phim2, dphim2 = fl.mathieu(ca2, cq2, t)
    
#    impedir_peq(phi1, .01)
#    impedir_peq(phim1, .01)

    
    Ma1 = a1(t, g,  nu1, c1, temp1, nu2, c2, temp2, wc, phi1, phim1)
    Ma2 = a2(t, g,  nu1, c1, temp1, nu2, c2, temp2, wc, phi1, phim1)
    Ma3 = a3(t, g,  nu1, c1, temp1, nu2, c2, temp2, wc, phi1, phim1)
    b1d, b1c, b2d, b2c, b3d, b3c = b(t, g, phi1, dphi1, phi2, dphi2, phim1, dphim1, phim2, dphim2)

    x1x1=(Ma3[1][1]*b3c**2-(Ma3[0][1]+Ma3[1][0])*b3c*b3d+Ma3[0][0]*b3d**2)/(b3c**2-b3d**2)**2
    x2x2=(Ma3[0][0]*b3c**2-(Ma3[0][1]+Ma3[1][0])*b3c*b3d+Ma3[1][1]*b3d**2)/(b3c**2-b3d**2)**2
    x1x2=((Ma3[0][1]+Ma3[1][0])*b3c**2-2*(Ma3[0][0]+Ma3[1][1])*b3c*b3d+(Ma3[0][1]+Ma3[1][0])*b3d**2)/(2*(b3c**2-b3d**2)**2)
    x1p1=(b3c**2*((Ma3[0][1]+Ma3[1][0])*b1c+2*Ma3[1][1]*b1d-Ma2[0][1]*b3c)+b3c*(-2*(Ma3[0][0]+Ma3[1][1])*b1c-2*(Ma3[0][1]+Ma3[1][0])*b1d+Ma2[0][0]*b3c)*b3d+((Ma3[0][1]+Ma3[1][0])*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*b3c*b3d+(Ma3[0][0]+Ma3[1][1])*b3d**2))/(b3c**2-b3d**2)**2)/2
    
    for i in [x1x1, x2x2, x1x2, x1p1, x2p2, x1p2, x2p1, p1p1, p2p2, p1p2]:
        i[0] = i[1]

    if unpacked:
        return x1x1, x2x2, x1x2, x1p1, x2p2, x1p2, x2p1, p1p1, p2p2, p1p2
    else:
        cov_matrix = np.array([[x1x1, x1p1, x1x2, x1p2], [x1p1, p1p1, x2p1, p1p2], [x1x2, x2p1, x2x2, x2p2], [x1p2, p1p2, x2p2, p2p2]])
        return cov_matrix
Exemple #4
0
def cov(t, g, ca1, cq1, ca2, cq2, temp1, temp2, wc = 50, i = 5):
    """
    Devuelve todos los valores medios para la matriz de covarianza. 
    """    
    nu1, nu2 = fl.mathieu_nu(ca1, cq1), fl.mathieu_nu(ca2, cq2)
    c1, c2 = fl.mathieu_coefs(ca1, cq1, nu1), fl.mathieu_coefs(ca2, cq2, nu2)
    c1, c2 = c1[c1.size//2-i:c1.size//2+i+1], c2[c2.size//2-i:c2.size//2+i+1]
 
    phi1, dphi1, phi2, dphi2 = fl.mathieu(ca1, cq1, t)    
    phim1, dphim1, phim2, dphim2 = fl.mathieu(ca2, cq2, t)
    
        

    
    Ma1 = a1t1(t, g,  nu1, c1, temp1, nu2, c2, wc, phi1, phim1)+a1t2(t, g,  nu1, c1, temp2, nu2, c2, wc, phi1, phim1)
    Ma2 = a2t1(t, g,  nu1, c1, temp1, nu2, c2, wc, phi1, phim1)+a2t2(t, g,  nu1, c1, temp2, nu2, c2, wc, phi1, phim1)
    Ma3 = a3t1(t, g,  nu1, c1, temp1, nu2, c2, wc, phi1, phim1)+a3t2(t, g,  nu1, c1, temp2, nu2, c2, wc, phi1, phim1)
    
    Ma1, Ma2, Ma3 = 2*Ma1, 2*Ma2, 2*Ma3
    
    b1d, b1c, b2d, b2c, b3d, b3c = b(t, g, phi1, dphi1, phi2, dphi2, phim1, dphim1, phim2, dphim2)

    x1x1=(Ma3[1][1]*b3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b3d**3)/(b3c**2-b3d**2)**2
    p1p2 = (Ma1[0][1]+Ma1[1][0]+(((Ma2[0][1]+Ma2[1][0])*b1c+(Ma2[0][0]+Ma2[1][1])*b1d)*b3c-((Ma2[0][0]+Ma2[1][1])*b1c+(Ma2[0][1]+Ma2[1][0])*b1d)*b3d)/(-b3c**2+b3d**2)+((b1c**2+b1d**2)*((Ma3[0][1]+Ma3[1][0])*b3c**2-2*(Ma3[0][0]+Ma3[1][1])*b3c*b3d+(Ma3[0][1]+Ma3[1][0])*b3d**2))/(b3c**2-b3d**2)**2+(2*b1c*b1d*((Ma3[0][0]+Ma3[1][1])*b3c**2-2*(Ma3[0][1]+Ma3[1][0])*b3c*b3d+(Ma3[0][0]+Ma3[1][1])*b3d**2))/(b3c**2-b3d**2)**2)/2
    
    for i in [x1x1, x2x2, x1x2, x1p1, x2p2, x1p2, x2p1, p1p1, p2p2, p1p2]:
        i[0] = i[1]
    return x1x1, x2x2, x1x2, x1p1, x2p2, x1p2, x2p1, p1p1, p2p2, p1p2
    x2p1 = x1p2
    
    Mcov= np.array([[x1x1, x1p1, x1x2, x1p2], [x1p1, p1p1, x2p1, p1p2], [x1x2, x2p1, x2x2, x2p2], [x1p2, p1p2, x2p2, p2p2]])
#    print Mcov[:, :, 500]
    neg = En(t, Mcov)
    detes = det_cov(t, Mcov) 
    
    return neg, sxxM, sxxm, sppM, sppm, detes
    
t = np.linspace(0, 100, 10000)
w = 1
wd = 2.05
c0 = 0.1
c1 = 0.11

nuM = fl.mathieu_nu(wd,  w**2+c0, c1)
num = fl.mathieu_nu(wd,  w**2-c0, -c1) 
print 'nu mas: ', nuM.imag
print 'nu menos: ', num.imag
neg, sxxM, sxxm, sppM, sppm, detes = entrelazamiento(t, w, wd, c0, c1)

plt.clf()
plt.subplot(1, 2, 1)
plt.plot(t, neg)
plt.grid()
plt.subplot(1, 2, 2)
plt.plot(t, sxxm, 'b',  t, sppm, 'r')
#plt.plot(t, detes)
#plt.axis([190, 210, 0, 100000000])
plt.grid()
#
#print 'new time: ', end1-beg1
#print 'old time: ', end2-beg2
#    
t = np.linspace(0, 10, 100)
plt.clf()
c_sci = np.loadtxt('0.75_-0.5.txt', np.complex)
nu_sci = c_sci[0]

c = c[1:]
i = 2
c = c[c.size//2-i:c.size//2+i+1]
a, q = .75, 1
g = 1
wc = 50
nu = fl.mathieu_nu(a, q, 15)
c = fl.mathieu_coefs(a, q, nu, 11)

c = c[c.size//2-i:c.size//2+i+1]
#old, cha, cha = si.sigma_baja(t, c, nu, g,  wc, 0)
new = sigma_baja_nuevo(t, c, nu, g, wc)
#plt.plot(t, old)
plt.plot(t, new, 'og')

#for wc in [50]:
#    s = sigma_alta_nuevo(t, ci, nu, g, wc)
#    plt.plot(t, s, label = str(wc))
#    plt.legend()
    
#for j in [0, .1, .3, .5, .6]:
#    i = 2    
Exemple #7
0
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 26 13:04:22 2015

@author: martin
"""

from __future__ import division
import numpy as np
import pylab as plt
import sigma as si
import floquet as fl
import erres as R

t = np.linspace(0, 30, 1000)
a1, q1 = 1, .5
a2, q2 = 1.1, .5
nu1, nu2 = fl.mathieu_nu(a1, q1), fl.mathieu_nu(a2, q2)
c1, c2 = fl.mathieu_coefs(a1, q1, nu1, 3), fl.mathieu_coefs(a1, q1, nu1, 3)
phi1, dphi1, phi2, dphi2 = fl.mathieu(a1, q1, t)
phim1, dphim1, phim2, dphim2 = fl.mathieu(a2, q2, t)
g = 1
plt.clf()
plt.plot(t, phi1, 'g-', t, phi2, 'b-')



Exemple #8
0
#
#print 'new time: ', end1-beg1
#print 'old time: ', end2-beg2
#
t = np.linspace(0, 10, 100)
plt.clf()
c_sci = np.loadtxt('0.75_-0.5.txt', np.complex)
nu_sci = c_sci[0]

c = c[1:]
i = 2
c = c[c.size // 2 - i:c.size // 2 + i + 1]
a, q = .75, 1
g = 1
wc = 50
nu = fl.mathieu_nu(a, q, 15)
c = fl.mathieu_coefs(a, q, nu, 11)

c = c[c.size // 2 - i:c.size // 2 + i + 1]
#old, cha, cha = si.sigma_baja(t, c, nu, g,  wc, 0)
new = sigma_baja_nuevo(t, c, nu, g, wc)
#plt.plot(t, old)
plt.plot(t, new, 'og')

#for wc in [50]:
#    s = sigma_alta_nuevo(t, ci, nu, g, wc)
#    plt.plot(t, s, label = str(wc))
#    plt.legend()

#for j in [0, .1, .3, .5, .6]:
#    i = 2
Exemple #9
0
    ret = np.zeros(len(t)) + 0 * 1j
    for i, ti in enumerate(t):
        print ti

        def integr(w):
            return w * np.real(z(ti, w, g, c1, nu1) * z(ti, w, g, c2, nu2))

        int_ti = si.complex_int(integr, 0, wc)
        ret[i] = int_ti
    return ret


import floquet as fl
import w_w as wes
ca1, cq1 = .7, .5
nu1 = fl.mathieu_nu(ca1, cq1)
g = 1
ca2, cq2 = .8, .5
nu2 = fl.mathieu_nu(ca2, cq2)
A1, A2 = fl.mathieu_coefs(ca1, cq1, nu1,
                          11), fl.mathieu_coefs(ca2, cq2, nu2, 11)
i = 2
A1, A2 = A1[A1.size // 2 - i:A1.size // 2 + i + 1], A2[A2.size // 2 -
                                                       i:A2.size // 2 + i + 1]
wc = 50
t = np.linspace(0, 10, 30)
phi1, dphi1, phi2, dphi2 = fl.mathieu(ca1, cq1, t)
phim1, dphim1, phim2, dphim2 = fl.mathieu(ca2, cq2, t)

int_mia = wes.w1_w1(t, g, 0, nu1, A1, nu2, A2, wc, phi1, phim1)
int_num = w1w1(t, wc, g, A1, nu1, A2, nu2)
Exemple #10
0
    Mcov = np.array([[x1x1, x1p1, x1x2, x1p2], [x1p1, p1p1, x2p1, p1p2],
                     [x1x2, x2p1, x2x2, x2p2], [x1p2, p1p2, x2p2, p2p2]])
    #    print Mcov[:, :, 500]
    neg = En(t, Mcov)
    detes = det_cov(t, Mcov)

    return neg, sxxM, sxxm, sppM, sppm, detes


t = np.linspace(0, 100, 10000)
w = 1
wd = 2.05
c0 = 0.1
c1 = 0.11

nuM = fl.mathieu_nu(wd, w**2 + c0, c1)
num = fl.mathieu_nu(wd, w**2 - c0, -c1)
print 'nu mas: ', nuM.imag
print 'nu menos: ', num.imag
neg, sxxM, sxxm, sppM, sppm, detes = entrelazamiento(t, w, wd, c0, c1)

plt.clf()
plt.subplot(1, 2, 1)
plt.plot(t, neg)
plt.grid()
plt.subplot(1, 2, 2)
plt.plot(t, sxxm, 'b', t, sppm, 'r')
#plt.plot(t, detes)
#plt.axis([190, 210, 0, 100000000])
plt.grid()
Exemple #11
0
import numpy as np
import floquet as fl
from matplotlib import pylab as plt
import sigma as si
import aes as aes
from numpy.linalg import det

w = 1
c_1 = .5
c_0 = 0
g = .005
T = 30

ca1, cq1 = w**2 - g**2 / 4 + c_0 - 2 * g, -.5 * c_1
ca2, cq2 = w**2 - g**2 / 4 - c_0 - 2 * g, .5 * c_1
nu1, nu2 = fl.mathieu_nu(ca1, cq1), fl.mathieu_nu(ca2, cq2)
#print np.abs(nu1.imag/g), np.abs(nu2.imag/g)
i = 3
t = np.linspace(0, 5, 30)
wc = 50

T1, T2 = T, T


def En(t, Mcov):
    var = np.array([])
    for i, ti in enumerate(t):

        A = Mcov[:2, :2, i]
        B = Mcov[2:, 2:, i]
        C = Mcov[2:, :2, i]
Exemple #12
0
import numpy as np
import floquet as fl
from matplotlib import pylab as plt
import sigma as si
import aes as aes
from numpy.linalg import det

w = 1
c_1 = .5
c_0 = 0
g = .005
T = 30

ca1, cq1 = w**2-g**2/4+c_0-2*g, -.5*c_1
ca2, cq2 = w**2-g**2/4-c_0-2*g, .5*c_1
nu1, nu2 = fl.mathieu_nu(ca1, cq1), fl.mathieu_nu(ca2, cq2)
#print np.abs(nu1.imag/g), np.abs(nu2.imag/g)
i = 3
t = np.linspace(0,5, 30)
wc = 50

T1, T2 = T, T

def En(t, Mcov):
    var = np.array([])
    for i, ti in enumerate(t):
        
        A = Mcov[:2, :2, i]
        B = Mcov[2:, 2:, i]
        C = Mcov[2:, :2, i]
        
Exemple #13
0
    return ret
    
def w1w1(t, wc, g, c1, nu1, c2, nu2):
    ret = np.zeros(len(t)) + 0 * 1j
    for i, ti in enumerate(t):
        print ti
        def integr(w):
            return w*np.real(z(ti, w, g, c1, nu1) * z(ti, w, g, c2, nu2))
        int_ti = si.complex_int(integr, 0, wc)
        ret[i] = int_ti
    return ret

import floquet as fl
import w_w as wes
ca1, cq1 = .7, .5
nu1 = fl.mathieu_nu(ca1, cq1)
g = 1
ca2, cq2 = .8, .5
nu2 = fl.mathieu_nu(ca2, cq2)
A1, A2 = fl.mathieu_coefs(ca1, cq1, nu1, 11), fl.mathieu_coefs(ca2, cq2, nu2, 11)
i = 2
A1, A2 = A1[A1.size//2-i:A1.size//2+i+1], A2[A2.size//2-i:A2.size//2+i+1]
wc = 50
t = np.linspace(0,10, 30)
phi1, dphi1, phi2, dphi2 = fl.mathieu(ca1, cq1, t)    
phim1, dphim1, phim2, dphim2 = fl.mathieu(ca2, cq2, t)


int_mia = wes.w1_w1(t, g, 0, nu1, A1, nu2, A2, wc, phi1, phim1)
int_num = w1w1(t, wc, g, A1, nu1, A2, nu2)