code: def test_pend():
      q, u = dynamicsymbols("q u")
      qd, ud = dynamicsymbols("q u", 1)
      m, l, g = symbols("m l g")
      N = ReferenceFrame("N")
      P = Point("P")
      P.set_vel(N, -l * u * sin(q) * N.x + l * u * cos(q) * N.y)
      kd = [qd - u]
  
      FL = [(P, m * g * N.x)]
      pa = Particle("pa", P, m)
      BL = [pa]
  
      KM = KanesMethod(N, [q], [u], kd)
      KM.kanes_equations(BL, FL)
      MM = KM.mass_matrix
      forcing = KM.forcing
      rhs = MM.inv() * forcing
      rhs.simplify()
      assert expand(rhs[0]) == expand(-g / l * sin(q))
      assert simplify(
          KM.rhs() - KM.mass_matrix_full.LUsolve(KM.forcing_full)
      ) == zeros(2, 1)
  
file_path: sympy/sympy/physics/mechanics/tests/test_kane.py
imports: from sympy import solve
  from sympy import cos, expand, Matrix, sin, symbols, tan, sqrt, S, zeros, eye
  from sympy.simplify.simplify import simplify
  from sympy.physics.mechanics import dynamicsymbols, ReferenceFrame, Point, RigidBody, KanesMethod, inertia, Particle, dot, find_dynamicsymbols
  from sympy.testing.pytest import raises
label_desc: Use image node_id 4 for calling a global function with example usage: test_pend() without return types