Exemplo n.º 1
0
 def fixed_reset(self):
     self.lgf1.Pv(0.0, -cos(pi*self.eta), 0)
     self.lgf2.Pv(self.fixed_freq_max/(2*self.ft_mult*self.f0), cos(pi*self.eta))
     self.get_member("fixed_freq").reset(self)
     self.get_member("fixed_alpha").reset(self)
     self.get_member("surface_x").reset(self)
     self.get_member("surface_charge").reset(self)
     self.get_member("surface_voltage").reset(self)
Exemplo n.º 2
0
 def fixed_reset(self):
     self.lgf1.Pv(0.0, -cos(pi * self.eta), 0)
     self.lgf2.Pv(self.fixed_freq_max / (2 * self.ft_mult * self.f0),
                  cos(pi * self.eta))
     self.get_member("fixed_freq").reset(self)
     self.get_member("fixed_alpha").reset(self)
     self.get_member("surface_x").reset(self)
     self.get_member("surface_charge").reset(self)
     self.get_member("surface_voltage").reset(self)
Exemplo n.º 3
0
def alpha(f, f0, eta=0.5, ft_mult=1, Nmax=2000):
    """Fourier transform of charge for 1 positive finger IDT.
    ft_mult=1 for single finger and 2 for double finger. eta is metallization ratio"""
    pieta=pi*eta
    if isinstance(f, float):
        m=int(f/(2*ft_mult*f0))
        s=f/(2*ft_mult*f0)-m
        return 2*sin(pi*s)/lgf(-s, -cos(pieta), Nmax=Nmax)*lgf(m, cos(pieta), Nmax=Nmax)
    m=(f/(2*ft_mult*f0)).astype(int)
    s=f/(2*ft_mult*f0)-m
    return 2*sin(pi*s)/lgf_arr(-s, -cos(pieta), 0)*lgf_arr(m, cos(pieta))
Exemplo n.º 4
0
def alpha(f, f0, eta=0.5, ft_mult=1, Nmax=2000):
    """Fourier transform of charge for 1 positive finger IDT.
    ft_mult=1 for single finger and 2 for double finger. eta is metallization ratio"""
    pieta = pi * eta
    if isinstance(f, float):
        m = int(f / (2 * ft_mult * f0))
        s = f / (2 * ft_mult * f0) - m
        return 2 * sin(pi * s) / lgf(-s, -cos(pieta), Nmax=Nmax) * lgf(
            m, cos(pieta), Nmax=Nmax)
    m = (f / (2 * ft_mult * f0)).astype(int)
    s = f / (2 * ft_mult * f0) - m
    return 2 * sin(pi * s) / lgf_arr(-s, -cos(pieta), 0) * lgf_arr(
        m, cos(pieta))
Exemplo n.º 5
0
def test_plot(**kwargs):
    rho=Rho.process_kwargs(kwargs)
    rho.ft="single"
    kdiv2pi=(rho.fixed_freq[1]-rho.fixed_freq[0])/rho.vf
    k=2*pi*rho.fixed_freq/rho.vf
    lbda0=1.0 #rho.lbda0
    xx=linspace(-1.75*lbda0, 1.75*lbda0, 201)
    rhox=array([sum(2*kdiv2pi*rho.fixed_alpha*cos(k*x)) for x in xx])
    pl=line(xx, rhox, linewidth=0.5)[0]
    return pl
Exemplo n.º 6
0
def test_plot(**kwargs):
    rho = Rho.process_kwargs(kwargs)
    rho.ft = "single"
    kdiv2pi = (rho.fixed_freq[1] - rho.fixed_freq[0]) / rho.vf
    k = 2 * pi * rho.fixed_freq / rho.vf
    lbda0 = 1.0  #rho.lbda0
    xx = linspace(-1.75 * lbda0, 1.75 * lbda0, 201)
    rhox = array([sum(2 * kdiv2pi * rho.fixed_alpha * cos(k * x)) for x in xx])
    pl = line(xx, rhox, linewidth=0.5)[0]
    return pl
Exemplo n.º 7
0
    def rh(x):
        m = int(2 * x / (lbda0))
        if absolute(2 * x / lbda0 - m) < 1.0 / 4.0:
            theta = 4 * pi * x / lbda0
            return 2 / lbda0 * 2 * sqrt(2.0) * (
                (1.0)**m) / sqrt(cos(theta) - cos(pieta)) * trapz(
                    sin(pi * s) * cos(
                        (s - 1 / 2) * theta) / rho.lgf1.Pv(-s), s)
        if absolute(2 * x / lbda0 - m - 1) < 1.0 / 4.0:
            theta = 4 * pi * x / lbda0
            return 2 / lbda0 * 2 * sqrt(2.0) * (
                (1.0)**m) / sqrt(cos(theta) - cos(pieta)) * trapz(
                    sin(pi * s) * cos(
                        (s - 1 / 2) * theta) / rho.lgf1.Pv(-s), s)
        if absolute(2 * x / lbda0 - m + 1) < 1.0 / 4.0:
            theta = 4 * pi * x / lbda0
            return 2 / lbda0 * 2 * sqrt(2.0) * (
                (1.0)**m) / sqrt(cos(theta) - cos(pieta)) * trapz(
                    sin(pi * s) * cos(
                        (s - 1 / 2) * theta) / rho.lgf1.Pv(-s), s)

        return 0.0
Exemplo n.º 8
0
    def rh(x):
        m=int(2*x/(lbda0))
        if absolute(2*x/lbda0-m)<1.0/4.0:
            theta=4*pi*x/lbda0
            return 2/lbda0*2*sqrt(2.0)*((1.0)**m)/sqrt(cos(theta)-cos(pieta))*trapz(sin(pi*s)*cos((s-1/2)*theta)/rho.lgf1.Pv(-s),s)
        if absolute(2*x/lbda0-m-1)<1.0/4.0:
            theta=4*pi*x/lbda0
            return 2/lbda0*2*sqrt(2.0)*((1.0)**m)/sqrt(cos(theta)-cos(pieta))*trapz(sin(pi*s)*cos((s-1/2)*theta)/rho.lgf1.Pv(-s),s)
        if absolute(2*x/lbda0-m+1)<1.0/4.0:
            theta=4*pi*x/lbda0
            return 2/lbda0*2*sqrt(2.0)*((1.0)**m)/sqrt(cos(theta)-cos(pieta))*trapz(sin(pi*s)*cos((s-1/2)*theta)/rho.lgf1.Pv(-s),s)

        return 0.0
Exemplo n.º 9
0
 def _update_Ej(self, Ejmax, flux_over_flux0):
     return Ejmax * absolute(cos(pi * flux_over_flux0))
Exemplo n.º 10
0
 def _default_lgf2(self):
     return Legendre(x=cos(pi*self.eta), v=self._get_m(f=self.fixed_freq_max))
Exemplo n.º 11
0
 def _default_lgf1(self):
     return Legendre(x=-cos(pi*self.eta), Nmult=0)
Exemplo n.º 12
0
 def _default_lgf2(self):
     return Legendre(x=cos(pi * self.eta),
                     v=self._get_m(f=self.fixed_freq_max))
Exemplo n.º 13
0
 def _default_lgf1(self):
     return Legendre(x=-cos(pi * self.eta), Nmult=0)
Exemplo n.º 14
0
 def Ej(self, Ejmax, flux_over_flux0):
     return Ejmax*absolute(cos(pi*flux_over_flux0))