Ejemplo n.º 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
Ejemplo n.º 2
0
def reactions(phi1,
              omg1,
              alp1,
              ms,
              Is,
              F_ext,
              g=-10j,
              variation=0,
              AB=1,
              BC=1):
    rB, rC, rBC = pos(phi1, AB, BC)[variation]
    aB, aC, alp2 = acc(phi1, omg1, alp1, variation, AB, BC)
    a_Cs = np.array([aB / 2, (aB + aC) / 2, aC])
    vC = vel(phi1, omg1, variation, AB, BC)[1]
    coeffs = -ms * g + ms * a_Cs

    coeffs[2] -= np.sign(-vC) * F_ext
    A = [[1, 0, 0, 0, 0, 0, 0, 0], [-1, 0, 1, 0, 0, 0, 0, 0],
         [0, -1, 0, 1, 0, 0, 0, 0], [0, 0, -1, 0, 1, 0, 0, 0],
         [0, 0, 0, -1, 0, 1, 0, 0], [0, 0, 0, 0, -1, 0, 1, 0],
         [0, 0, 0, 0, 0, -1, 0, 1],
         [
             0, 0, -np.imag(rBC) / 2,
             np.real(rBC) / 2, -np.imag(rBC) / 2,
             np.real(rBC) / 2, 0, 0
         ]]
    b = [
        0,
        np.real(-np.sign(-vC) * F_ext + coeffs[2]),
        np.imag(-np.sign(-vC) * F_ext + coeffs[2]),
        np.real(coeffs[1]),
        np.imag(coeffs[1]),
        np.real(coeffs[0]),
        np.imag(coeffs[0]), Is[1] * alp2
    ]
    res = np.linalg.solve(A, b)

    F30 = res[0] + res[1] * 1j
    F23 = res[2] + res[3] * 1j
    F12 = res[4] + res[5] * 1j
    F01 = res[6] + res[7] * 1j
    M_equilibrium = Is[0] * alp1 - dA.toCross(rB / 2, -F12) - dA.toCross(
        -rB / 2, F01)
    return F30, F23, F12, F01, M_equilibrium
Ejemplo n.º 3
0
def dyad(phi1, omg1, alp1, ms, Is, F_ext, g=-10j, variation=0, AB=1, BC=1):
    rB, rC, rBC = pos(phi1, AB, BC)[variation]
    aB, aC, alp2 = acc(phi1, omg1, alp1, variation, AB, BC)
    a_Cs = np.array([aB / 2, (aB + aC) / 2, aC])
    Gs = ms * g

    vC = vel(phi1, omg1, variation, AB, BC)[1]
    F_ext *= -np.sign(vC)

    F12x = np.real((ms * a_Cs)[2] + (ms * a_Cs)[1]) - F_ext
    F12y = (Is[1] * alp2 + dA.toCross(rBC / 2, (ms * a_Cs)[1]) +
            np.imag(rBC) * F12x - dA.toCross(rBC / 2, Gs[1])) / np.real(rBC)
    F12 = F12x + F12y * 1j
    F03 = (ms * a_Cs)[2] + (ms * a_Cs)[1] - (Gs[1] + Gs[2] + F12 + F_ext)
    F23 = (ms * a_Cs)[1] - (Gs[1] + F12)
    F01 = (ms * a_Cs)[0] - (Gs[0] + -F12)
    M_equilibrium = Is[0] * alp1 - dA.toCross(rB / 2, -F12) - dA.toCross(
        -rB / 2, F01)
    return F03, F23, F12, F01, M_equilibrium
Ejemplo n.º 4
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
Ejemplo n.º 5
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),
Ejemplo n.º 6
0
    rB, rC, rD, rE, rF = pos(phi1, case)
    aB, aD, aE, alp2, alp4, alp5 = acc(phi1, case)
    M_ext *= -np.sign(vel(phi1, case)[-2])

    aGs = np.array([aB / 2, (aB + aD) / 2, 0, (aE + aD) / 2, aE / 2])
    Gs, FGs = ms * g, ms * aGs

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

    # find F45
    F45 = FGs[4] - Gs[4] - F05

    # find F03, F12 using dyad method, moment at C
    rG2 = (rB + rD) / 2
    A = dA.mat([[1, 0, 1, 0], [0, 1, 0, 1], [0, 0],
                dA.moment(rB - rC),
                kA.toList(rB - rD), [0, 0]], (4, 4))
    b = dA.mat([
        kA.toList(FGs[2] + FGs[1] - Gs[2] - Gs[1] - (-F24)),
Ejemplo n.º 7
0
def reactions(phi1, case, ms, Is, F_ext, g=-9.807j):
    
    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))