예제 #1
0
    def recalculate(self):
        M1_1 = HMatrix.Roty(self.a1)
        M1_2 = HMatrix.Translation(self.l1.l, 0, 0)
        M2_1 = HMatrix.Roty(self.a2)
        M2_2 = HMatrix.Translation(self.l2.l, 0, 0)
        self.l1.T = M1_1
        self.f1.T = self.l1.T * M1_2
        self.l2.T = self.f1.T * M2_1
        self.f2.T = self.l2.T * M2_2

        #-- Frame position vectors
        self.f1_r.T = self.l1.T
        self.f2_r.T = self.l2.T
예제 #2
0
파일: pyooml.py 프로젝트: josecurras/friki
def test_friki6():
    #-- Frame 1
    frame()

    #-- Frame 2
    f2 = frame()

    #-- Homogeneours matrices
    M = HMatrix.Translation(20, 0, 0)
    N = HMatrix.Rotx(30)

    #-- Apply a transformation matrix to the frame 2
    f2.T = M * N
예제 #3
0
def eival(phi, theta, t7):
    N1 = 150
    N2 = 150
    N3 = 150
    a = 1
    t1 = 3
    t2 = 3
    t3 = 3
    t6 = 0.4

    t1_tilde = 3
    t2_tilde = 3
    t3_tilde = 3
    kx, ky = path(N1, N2, N3)
    eigenvals1 = []
    eigenvals2 = []
    eigenvals3 = []
    eigenvals4 = []

    for i in range(len(kx)):
        eigval = eigvalsh(
            Ham.Bilayer_origin_A2_field_angle(kx[i], ky[i], 0, t1, t2, t3,
                                              t1_tilde, t2_tilde, t3_tilde, t6,
                                              t7 * t6, phi, theta, a, 0))
        eigenvals1.append(eigval[0, 0, 0])
        eigenvals2.append(eigval[0, 0, 1])
        eigenvals3.append(eigval[0, 0, 2])
        eigenvals4.append(eigval[0, 0, 3])

    return eigenvals1, eigenvals2, eigenvals3, eigenvals4
예제 #4
0
def evals1(phi, theta, t7):
    N = 150
    kx = np.linspace(-np.pi, np.pi, N + 1)
    ky = np.linspace(-np.pi, np.pi, N + 1)
    KX, KY = np.meshgrid(kx, ky)

    a = 1
    t1 = 3
    t2 = 3
    t3 = 3
    t6 = 0.4
    t1_tilde = 3
    t2_tilde = 3
    t3_tilde = 3

    H = Ham.Bilayer_origin_A2_field_angle(KX, KY, N, t1, t2, t3, t1_tilde,
                                          t2_tilde, t3_tilde, t6, t7 * t6, phi,
                                          theta, a, 0)
    eigenvals = eigvalsh(H)
    return eigenvals[:, :, 1]
예제 #5
0
def evals2(phi, theta, t7):
    K = -(4 * np.pi) / (3 * np.sqrt(3))
    N = 150
    dkx = np.linspace(K - 0.4, K + 0.4, N + 1)  # (-0.6, 0.6, N+1)
    dky = np.linspace(-0.4, 0.4, N + 1)  # (K-0.6, K+0.6, N+1)
    DKX, DKY = np.meshgrid(dkx, dky)

    a = 1
    t1 = 3
    t2 = 3
    t3 = 3
    t6 = 0.4

    t1_tilde = 3
    t2_tilde = 3
    t3_tilde = 3

    H = Ham.Bilayer_origin_A2_field_angle(DKX, DKY, N, t1, t2, t3, t1_tilde,
                                          t2_tilde, t3_tilde, t6, t7 * t6, phi,
                                          theta, a, 0)
    eigenvals = eigvalsh(H)
    return eigenvals[:, :, 1]
예제 #6
0
a1 = -60
a2 = 70
L1 = 40
L2 = 40
 
v1 = Vector(L1, 0, 0)
v2 = Vector(L2, 0, 0)
 
f0 = frame()
f1 = frame()
f2 = frame()
 
sv1 = svector(v1).color("yellow")
sv2 = svector(v2).color("yellow")
 
Ma = HMatrix.Roty(a1)
Mb = HMatrix.Translation(v1)
Mc = HMatrix.Roty(a2)
Md = HMatrix.Translation(v2)
 
sv1.T = Ma
f1.T = Ma * Mb
 
sv2.T = Ma * Mb * Mc
f2.T = Ma * Mb * Mc * Md
 
vr = f2.T.multiply(Vector(0,0,0))
svr = svector(vr).color("orange")
 
l1 = link(l = L1, D = 10, w = 5).ice(80)
l2 = link(l = L2, D = 10, w = 3).ice(80)
예제 #7
0
#-- Robot parameters
a1 = -30
a2 = -60
a3 = 70
L1 = 11
L2 = 40
L3 = 40

#--- Link vectors
v1 = Vector(0, 0, L1)
v2 = Vector(L2, 0, 0)
v3 = Vector(L3, 0, 0)

#--- Transformations
Ma = HMatrix.Rotz(a1) * HMatrix.Translation(v1)
Mb = HMatrix.Roty(a2)
Mc = HMatrix.Translation(v2)
Md = HMatrix.Roty(a3)
Me = HMatrix.Translation(v3)

#--- Graphical elements for the kinematics

f0 = frame()
f1 = frame()
f2 = frame()
f3 = frame()
#sv1 = svector(v1).color("yellow")
sv2 = svector(v2).color("yellow")
sv3 = svector(v3).color("yellow")