def calculate_dynamics(pos_vector, vel_vector, accel_vector):
    """Calculate the effort vector for a custom 2-DoF SCARA."""
    m1 = 1.0  # kg weight of first body
    r1 = 0.35  # distance to cg
    d1 = 0.5   # full link length
    i1 = (1./8)*m1*d1**2

    m2 = 1.0
    r2 = 0.35
    i2 = (1./8)*m2*0.5**2

    A = i1 + m1*r1**2
    B = i2 + m2*r2**2

    # Simple friction model only looking at j1 torque
    friction = 0  # np.tanh(vel_vector[1]*10)*0.8
    # Flip joint torques because joints are flipped
    tau2 = B * (-accel_vector[0] + accel_vector[1]) + friction
    tau1 = A*accel_vector[0] - tau2

    return [tau1, tau2]