Beispiel #1
0
    def __init__(self, **parameters):
        ls = parameters.get('ls', 1e-9)
        rs = parameters.get('rs', 1.0)
        cp = parameters.get('cp', 150e-15)
        cs = parameters.get('cs', 30e-15)
        rac = parameters.get('rac', 1)
        ldc = parameters.get('ldc', 1e-9)
        k1 = parameters.get('k1', 0.9)
        rsub = parameters.get('rsub', 1)

        freq = linspace(0.1e9, 15e9, 101)

        lib = myinductor(name='myinductor',
                         rs=rs,
                         ls=ls,
                         cp=cp,
                         cs=cs,
                         rac=rac,
                         ldc=ldc,
                         k1=k1,
                         rsub=rsub)
        dev = Device(model='myinductor', nodes=('plus', 'minus', '0'))
        cir1 = Sp(library=lib, device=dev, freq=freq)
        cir1.simulate(verbose=True)
        y11, y12, y21, y22 = cir1.Y()

        self.freq = freq
        self.l11 = (1.0 / y11).imag / (2.0 * pi * freq)
        self.r11 = (1.0 / y11).real
        self.q11 = (1.0 / y11).imag / (1 / y11).real
Beispiel #2
0
    def __init__(self, **parameters):
        freq = linspace(0.1e9, 15e9, 101)
        dev = Nport(nodes=("plus", "0", "minus", "0"), file="./examples/MyInductor/mydata.s2p")
        cir1 = Sp(device=dev, freq=freq)
        cir1.simulate(verbose=True)
        y11, y12, y21, y22 = cir1.Y()

        self.freq = freq
        self.l11 = (1.0 / y11).imag / (2.0 * pi * freq)
        self.r11 = (1.0 / y11).real
        self.q11 = (1.0 / y11).imag / (1 / y11).real
Beispiel #3
0
    def __init__(self, **parameters):
        freq = linspace(0.1e9, 15e9, 101)
        dev = Nport(nodes=('plus', '0', 'minus', '0'),
                    file='./examples/MyInductor/mydata.s2p')
        cir1 = Sp(device=dev, freq=freq)
        cir1.simulate(verbose=True)
        y11, y12, y21, y22 = cir1.Y()

        self.freq = freq
        self.l11 = (1.0 / y11).imag / (2.0 * pi * freq)
        self.r11 = (1.0 / y11).real
        self.q11 = (1.0 / y11).imag / (1 / y11).real
Beispiel #4
0
    def __init__(self, **parameters):
        ls = parameters.get("ls", 1e-9)
        rs = parameters.get("rs", 1.0)
        cp = parameters.get("cp", 150e-15)
        cs = parameters.get("cs", 30e-15)
        rac = parameters.get("rac", 1)
        ldc = parameters.get("ldc", 1e-9)
        k1 = parameters.get("k1", 0.9)
        rsub = parameters.get("rsub", 1)

        freq = linspace(0.1e9, 15e9, 101)

        lib = myinductor(name="myinductor", rs=rs, ls=ls, cp=cp, cs=cs, rac=rac, ldc=ldc, k1=k1, rsub=rsub)
        dev = Device(model="myinductor", nodes=("plus", "minus", "0"))
        cir1 = Sp(library=lib, device=dev, freq=freq)
        cir1.simulate(verbose=True)
        y11, y12, y21, y22 = cir1.Y()

        self.freq = freq
        self.l11 = (1.0 / y11).imag / (2.0 * pi * freq)
        self.r11 = (1.0 / y11).real
        self.q11 = (1.0 / y11).imag / (1 / y11).real
Beispiel #5
0
    def draw_cadran(self):
        grain = 500.
        # quart de cercles a S constant
        Teta = linspace(0., pi / 2, step=pi / grain / 2.)
        S = [5., 2., 1., 0.5, 0.2, -0.2, -0.5, -1., -2., -5, 0.]
        for s in S:
            data = []
            R = np.tan(Teta)
            for r in R:
                d = (r + 1.)**2 + s**2
                x = ((r * r - 1.) + s * s) / d
                y = 2 * s / d
                pt = complex(x, y)
                if abs(pt) < 1:
                    data.append(pt)
            self.plot(np.array(data), color='grey', linestyle=':', linewidth=1)

        # trace de l'abaque
        # cercles a r constant
        Teta = linspace(-pi / 2., pi / 2., step=pi / grain / 2.)
        S = np.tan(Teta)
        R = [0.1, .3, 0.6, 1., 2., 3., 10., 0.]
        for r in R:
            data = []
            for s in S:
                d = s**2 + (r + 1.)**2
                x = (s**2 + (r**2 - 1.)) / d
                y = 2. * (s / d)
                data.append(complex(x, y))
            if r == 0.:
                self.plot(np.array(data), color='black')
            else:
                self.plot(np.array(data),
                          color='grey',
                          linestyle=':',
                          linewidth=1)
        # ticks
        s = 0.0
        R = [
            0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.2, 1.4, 1.6, 1.8,
            2.0, 3., 4., 5., 10, 20
        ]
        for r in R:
            data = []
            d = s**2 + (r + 1.)**2
            x = (s**2 + (r**2 - 1.)) / d
            y = 2. * (s / d)
            data.append(complex(x, y + 0.01))
            data.append(complex(x, y - 0.01))
            self.plot(np.array(data),
                      color='black',
                      linestyle='-',
                      linewidth=1.5)
        #
        self.plot(np.array([complex(-1, 0), complex(1, 0)]),
                  color='black',
                  linestyle='-',
                  linewidth=1.5)
        #
        S = [
            0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.2, 1.4, 1.6,
            1.8, 2.0, 3., 4., 5., 10, 20
        ]
        S += [
            -0.1, -0.2, -0.3, -0.4, -0.5, -0.6, -0.7, -0.8, -0.9, -1, -1.2,
            -1.4, -1.6, -1.8, -2.0, -3., -4., -5., -10, -20
        ]
        for s in S:
            data = []
            r = 0
            d = (r + 1.)**2 + s**2
            x = ((r * r - 1.) + s * s) / d
            y = 2 * s / d
            pt = complex(x, y)
            m, phi = cmath.polar(pt)
            pt = cmath.rect(m * 1.03, phi)
            x, y = pt.real, pt.imag
            pt1 = cmath.rect(m - 0.02, phi)
            pt2 = cmath.rect(m, phi)
            data = [pt1, pt2]
            self.plot(np.array(data),
                      color='black',
                      linestyle='-',
                      linewidth=1.5)
Beispiel #6
0
    def draw_cadran(self):
        grain=500.
        # quart de cercles a S constant
        Teta=linspace(0.,pi/2,step=pi/grain/2.)
        S=[5., 2.,1.,0.5, 0.2,-0.2, -0.5,-1.,-2.,-5, 0.]
        for s in S:
            data=[]
            R=np.tan(Teta)
            for r in R:
                d=(r+1.)**2+s**2
                x=((r*r-1.)+s*s)/d
                y=2*s/d
                pt = complex(x,y)
                if abs(pt)<1:
                    data.append(pt)
            self.plot(np.array(data),color='grey', linestyle=':', linewidth=1)

        # trace de l'abaque
        # cercles a r constant
        Teta=linspace(-pi/2.,pi/2.,step=pi/grain/2.)
        S=np.tan(Teta)
        R=[0.1, .3,0.6, 1.,2., 3.,10., 0.]
        for r in R:
            data=[]
            for s in S:
                d=s**2+(r+1.)**2
                x=(s**2+(r**2-1.))/d
                y=2.*(s/d)
                data.append(complex(x,y))
            if r==0.:
                self.plot(np.array(data),color='black')
            else:    
                self.plot(np.array(data),color='grey', linestyle=':', linewidth=1)
        # ticks
        s = 0.0
        R=[0.1, 0.2, 0.3,0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.2, 1.4, 1.6,1.8,2.0, 3., 4., 5., 10, 20]
        for r in R:
            data=[]
            d=s**2+(r+1.)**2
            x=(s**2+(r**2-1.))/d
            y=2.*(s/d)
            data.append(complex(x,y+0.01))
            data.append(complex(x,y-0.01))
            self.plot(np.array(data),color='black', linestyle='-', linewidth=1.5)
        #
        self.plot(np.array([complex(-1,0), complex(1,0)]),color='black', linestyle='-', linewidth=1.5)
        #
        S = [0.0, 0.1, 0.2, 0.3,0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.2, 1.4, 1.6,1.8,2.0, 3., 4., 5., 10, 20]
        S += [-0.1, -0.2, -0.3,-0.4, -0.5, -0.6, -0.7, -0.8, -0.9, -1, -1.2, -1.4, -1.6,-1.8,-2.0, -3., -4.,-5., -10, -20]
        for s in S:
            data=[]
            r=0
            d=(r+1.)**2+s**2
            x=((r*r-1.)+s*s)/d
            y=2*s/d
            pt = complex(x,y)
            m, phi = cmath.polar(pt)
            pt = cmath.rect(m*1.03, phi)
            x, y = pt.real, pt.imag
            pt1 = cmath.rect(m-0.02, phi)
            pt2 = cmath.rect(m, phi)
            data = [pt1, pt2]
            self.plot(np.array(data),color='black', linestyle='-', linewidth=1.5)