# 2 coupled pendulums # x1'' = -k1*x1 + k*(x2-x1) # x2'' = -k2*x2 - k*(x2-x1) # xi are the displacement of the pendulum to its resting position coefficient.1 -> k1 coefficient.2 -> k2 coefficient.3 -> k coefficient.5(-1) -> -x10 # initial displacement x1 coefficient.6(-1) -> -x20 # initial displacement x2 iintegrate x1'' -> -x1' iintegrate -x1' -> x1 IC: -x10 iintegrate x2'' -> -x2' iintegrate -x2' -> x2 IC: -x20 cmultiply x1, k1 -> k1*x1 cmultiply x2, k2 -> k2*x2 invert x1 -> -x1 isum x2, -x1 -> -(x2-x1) cmultiply -(x2-x1), k -> -k*(x2-x1) isum k1*x1, -k*(x2-x1) -> -k1*x1+k*(x2-x1) assign -k1*x1+k*(x2-x1) -> x1'' invert -k*(x2-x1) -> k*(x2-x1) isum k2*x2, k*(x2-x1) -> -k2*x2-k*(x2-x1) assign -k2*x2-k*(x2-x1) -> x2'' output x1 -> out.x output x2 -> out.y