Motion Factorization

This tutorial demonstrates how to use the method MotionFactorization.factorize() and related class rational_linkages.FactorizationProvider to factorize a rational motion, as described by Hegedüs et al.[1] and [2].

The theory behind the motion factorization is described in section Rational Motions and their Factorization.

For better computational stability, it is recommended (but not necessary) to use rational dual quaternions, constructed using the method DualQuaternion.as_rational(), which will take the input and applies Sympy’s Rational function to each element of the give 8-vector array.

Factorization of planar 4-bar

from rational_linkages import (DualQuaternion, MotionFactorization,
                               RationalMechanism, Plotter)


f1 = MotionFactorization([DualQuaternion.as_rational([0, 0, 0, 1, 0, 0, 0, 0]),
                          DualQuaternion.as_rational([0, 0, 0, 2, 0, 0, -1, 0])])

# find factorizations
factorizations = f1.factorize()

# create mechanism
m = RationalMechanism(factorizations, tool='mid_of_last_link')

# plot mechanism
plt = Plotter(mechanism=m, arrows_length=0.05)
plt.show()

Which results in the following plot:

4-bar mechanism

Factorized 4-bar mechanism

Factorization of spatial 6R mechanism

from rational_linkages import (DualQuaternion, MotionFactorization, RationalMechanism,
                               Plotter)


h1 = DualQuaternion.as_rational([0, 1, 0, 0, 0, 0, 0, 0])
h2 = DualQuaternion.as_rational([0, 0, 3, 0, 0, 0, 0, 1])
h3 = DualQuaternion.as_rational([0, 1, 1, 0, 0, 0, 0, -2])

f1 = MotionFactorization([h1, h2, h3])

# find factorizations
factorizations = f1.factorize()

# create mechanism
m = RationalMechanism(factorizations)

# plot mechanism
plt = Plotter(mechanism=m, arrows_length=0.2)
plt.show()

Which results in the following plot:

6-bar mechanism

Factorized 6-bar mechanism

References: