code: def test_parallel_axis():
      # This is for a 2 dof inverted pendulum on a cart.
      # This tests the parallel axis code in KanesMethod. The inertia of the
      # pendulum is defined about the hinge, not about the center of mass.
  
      # Defining the constants and knowns of the system
      gravity = symbols("g")
      k, ls = symbols("k ls")
      a, mA, mC = symbols("a mA mC")
      F = dynamicsymbols("F")
      Ix, Iy, Iz = symbols("Ix Iy Iz")
  
      # Declaring the Generalized coordinates and speeds
      q1, q2 = dynamicsymbols("q1 q2")
      q1d, q2d = dynamicsymbols("q1 q2", 1)
      u1, u2 = dynamicsymbols("u1 u2")
      u1d, u2d = dynamicsymbols("u1 u2", 1)
  
      # Creating reference frames
      N = ReferenceFrame("N")
      A = ReferenceFrame("A")
  
      A.orient(N, "Axis", [-q2, N.z])
      A.set_ang_vel(N, -u2 * N.z)
  
      # Origin of Newtonian reference frame
      O = Point("O")
  
      # Creating and Locating the positions of the cart, C, and the
      # center of mass of the pendulum, A
      C = O.locatenew("C", q1 * N.x)
      Ao = C.locatenew("Ao", a * A.y)
  
      # Defining velocities of the points
      O.set_vel(N, 0)
      C.set_vel(N, u1 * N.x)
      Ao.v2pt_theory(C, N, A)
      Cart = Particle("Cart", C, mC)
      Pendulum = RigidBody(
          "Pendulum", Ao, A, mA, (inertia(A, Ix, Iy, Iz), C)
      )
  
      # kinematical differential equations
  
      kindiffs = [q1d - u1, q2d - u2]
  
      bodyList = [Cart, Pendulum]
  
      forceList = [
          (Ao, -N.y * gravity * mA),
          (C, -N.y * gravity * mC),
          (C, -N.x * k * (q1 - ls)),
          (C, N.x * F),
      ]
  
      km = KanesMethod(N, [q1, q2], [u1, u2], kindiffs)
      (fr, frstar) = km.kanes_equations(bodyList, forceList)
      mm = km.mass_matrix_full
      assert mm[3, 3] == Iz
  
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 7 for calling a global function with example usage: test_parallel_axis() without return types