コード例 #1
0
def reactions(phi1,
              omg1,
              alp1,
              ms,
              Is,
              M5_ext,
              g=-9.807j,
              AB=0.15,
              AC=0.1,
              CD=0.15,
              DF=0.4,
              AG=0.3):

    rA, rB, rC, rD, rF, rG = pos(phi1, AB, AC, CD, DF, AG)
    M5_ext = -np.sign(vel(phi1, omg1, AB, AC, CD, DF, AG)[-1]) * M5_ext
    a2, a3_T, a5_T, a4, aF, aG, alp3, alp5 = acc(phi1, omg1, alp1, AB, AC, CD,
                                                 DF, AG)
    aGs = np.array([a2 / 2, a2, (a4 + aF) / 2, a4, aG / 2])
    Gs, FGs = ms * g, ms * aGs

    # find F45, F05 with matrix solve AX=B
    # moment equation, force equation, dot product of F45 and rD = 0
    A = dA.mat([
        dA.moment(rD - rG / 2),
        dA.moment(rA - rG / 2), [1, 0, 1, 0], [0, 1, 0, 1],
        [np.real(rD), np.imag(rD), 0, 0]
    ], (4, 4))
    b = dA.mat([[Is[-1] * alp5 - M5_ext], kA.toList(FGs[-1] - Gs[-1]), [0]], 4)
    F45, F05 = kA.toComplexes(np.linalg.solve(A, b))

    # find F34
    F34 = FGs[-2] - (Gs[-2] + (-F45))

    # find F03, F23 with matrix solve AX=B
    # moment equation, force equation, dot product of F23 and rF-rC = 0
    rG3 = (rD + rF) / 2

    A = dA.mat([
        dA.moment(rC - rG3),
        dA.moment(rB - rG3), [1, 0, 1, 0], [0, 1, 0, 1],
        [0, 0, np.real(rB - rG3), np.imag(rB - rG3)]
    ], (4, 4))
    b = dA.mat([[Is[2] * alp3 - dA.toCross(rD - rG3, -F34)],
                kA.toList(FGs[2] - Gs[2] - (-F34)), [0]], 4)
    F03, F23 = kA.toComplexes(np.linalg.solve(A, b))

    # find F12, F01
    F12 = FGs[1] - Gs[1] - (-F23)
    F01 = FGs[0] - Gs[0] - (-F12)
    M_eq = Is[0] * alp1 - dA.toCross(rB / 2, -F12) - dA.toCross(-rB / 2, F01)
    return F05, F45, F34, F03, F23, F12, F01, M_eq
コード例 #2
0
def reactions(theta1,
              omg1,
              alp1,
              ms,
              Is,
              M_ext,
              AB,
              AD,
              BC,
              CD,
              g=-9.807j,
              variation=0):
    rB, rC = pos(theta1, AB, AD, BC, CD)[variation]
    aB, aC, alp2, alp3 = acc(theta1, omg1, alp1, AB, AD, BC, CD, variation)
    aGs = np.array([aB / 2, (aB + aC) / 2, aC / 2])

    M_ext *= -np.sign(vel(theta1, omg1, AB, AD, BC, CD, variation)[3])
    Gs, FGs = ms * g, ms * aGs

    # find F03, F12 using dyad method (link 2-3)
    # equilibrium equations,
    A = dA.mat([[1, 0, 1, 0], [0, 1, 0, 1],
                dA.moment(AD - rC), [0, 0], [0, 0],
                dA.moment(rB - rC)], (4, 4))
    b = dA.mat([
        kA.toList(FGs[1] + FGs[2] - Gs[1] - Gs[2]),
        [
            Is[2] * alp3 + dA.toCross((AD - rC) / 2, FGs[2] - Gs[2]) - M_ext,
            Is[1] * alp2 + dA.toCross((rB - rC) / 2, FGs[1] - Gs[1])
        ]
    ], 4)
    F03, F12 = kA.toComplexes(np.linalg.solve(A, b))

    # find F23, F01
    F23 = FGs[2] - Gs[2] - F03
    F01 = FGs[0] - Gs[0] - (-F12)

    # find drive moment
    M_eq = Is[0] * alp1 - (dA.toCross(rB / 2, -F12) + dA.toCross(-rB / 2, F01))
    return F03, F23, F12, F01, M_eq
コード例 #3
0
def reactions(phi1, case, ms, Is, F_ext, g=-9.807j):

    rB, rC, rD, rE, rF = pos(phi1, case)
    aB, aC, aE, aF, alp2, alp3, alp4 = acc(phi1, case)
    F = F_ext * -np.sign(np.real(vel(phi1, case)[1]))
    Gs, FGs = ms * g, ms * np.array(
        [aB / 2, (aB + aC) / 2, (aC + aE) / 2, (aE + aF) / 2, aF])

    # find F05, F34 using dyad method
    A = dA.mat([[1, 0, 1, 0], [0, 1, 0, 1], [0, 0],
                dA.moment(rE - rF), [1, 0, 0, 0]], (4, 4))
    b = dA.mat([
        kA.toList(FGs[3] + FGs[4] - Gs[3] - Gs[4] - F),
        [Is[3] * alp4 + dA.toCross((rE - rF) / 2, FGs[3] - Gs[3]), 0]
    ], 4)
    F05, F34 = kA.toComplexes(np.linalg.solve(A, b))
    # find F45
    F45 = FGs[4] - Gs[4] - F05 - F

    # find F03, F12 using dyad method, moment at C
    rG3, rG2 = (rE + rC) / 2, (rB + rC) / 2
    A = dA.mat([[1, 0, 1, 0], [0, 1, 0, 1],
                dA.moment(rD - rC), [0, 0], [0, 0],
                dA.moment(rB - rC)], (4, 4))
    b = dA.mat([
        kA.toList(FGs[2] + FGs[1] - Gs[2] - Gs[1] - (-F34)),
        [
            Is[2] * alp3 + dA.toCross(rG3 - rC, FGs[2] - Gs[2]) -
            dA.toCross(rE - rC, -F34),
            Is[1] * alp2 + dA.toCross(rG2 - rC, FGs[1] - Gs[1])
        ]
コード例 #4
0
 
 rB, rC, rD, rD_max, rE, rC_max = pos(phi1, case)
 aB, aC, aE, aD_max, aC_max, alp2, a2_T = acc(phi1, case)
 F = F_ext*-np.sign(vel(phi1, case)[2])
 aGs = np.array([aB/2, (aD_max+aC)/2, 0, aC, (aE+aC_max)/2])
 Gs, FGs = ms*g, ms*aGs
 
 # find F05, F24 using dyad method, moment at C
 rG5 = (rE+rC_max)/2
 A = dA.mat([[1, 0, 1, 0],
             [0, 1, 0, 1],
             dA.moment(rE-rC), [0, 0],
             [0, 0, 1, 0]], (4, 4))
 b = dA.mat([kA.toList(FGs[3]+FGs[4]-Gs[3]-Gs[4]-F),
             [dA.toCross(rG5-rC, FGs[4]-Gs[4]), 0]], 4)
 F05, F24 = kA.toComplexes(np.linalg.solve(A, b))
     
 # find F45
 F45 = FGs[4] - Gs[4] - F05 - F
 
 # find F32, F12 using dyad method, moment at D
 rG2 = (rC+rD_max)/2
 A = dA.mat([[1, 0, 1, 0],
             [0, 1, 0, 1],
             kA.toList(rB-rD), [0, 0],
             [0, 0], dA.moment(rB-rD)], (4, 4))
 b = dA.mat([kA.toList(FGs[1]-Gs[1]-(-F24)),
             [0, dA.toCross(rG2-rD, FGs[1]-Gs[1]) - dA.toCross(rC-rD, -F24)]], 4)
 F32, F12 = kA.toComplexes(np.linalg.solve(A, b))
 
 # find F03