code: def test_n_link_pendulum_on_cart_inputs():
      l0, m0 = symbols("l0 m0")
      m1 = symbols("m1")
      g = symbols("g")
      q0, q1, F, T1 = dynamicsymbols("q0 q1 F T1")
      u0, u1 = dynamicsymbols("u0 u1")
  
      kane1 = models.n_link_pendulum_on_cart(1)
      massmatrix1 = Matrix(
          [
              [m0 + m1, -l0 * m1 * cos(q1)],
              [-l0 * m1 * cos(q1), l0**2 * m1],
          ]
      )
      forcing1 = Matrix(
          [[-l0 * m1 * u1**2 * sin(q1) + F], [g * l0 * m1 * sin(q1)]]
      )
      assert simplify(massmatrix1 - kane1.mass_matrix) == zeros(2)
      assert simplify(forcing1 - kane1.forcing) == Matrix([0, 0])
  
      kane2 = models.n_link_pendulum_on_cart(1, False)
      massmatrix2 = Matrix(
          [
              [m0 + m1, -l0 * m1 * cos(q1)],
              [-l0 * m1 * cos(q1), l0**2 * m1],
          ]
      )
      forcing2 = Matrix(
          [[-l0 * m1 * u1**2 * sin(q1)], [g * l0 * m1 * sin(q1)]]
      )
      assert simplify(massmatrix2 - kane2.mass_matrix) == zeros(2)
      assert simplify(forcing2 - kane2.forcing) == Matrix([0, 0])
  
      kane3 = models.n_link_pendulum_on_cart(1, False, True)
      massmatrix3 = Matrix(
          [
              [m0 + m1, -l0 * m1 * cos(q1)],
              [-l0 * m1 * cos(q1), l0**2 * m1],
          ]
      )
      forcing3 = Matrix(
          [[-l0 * m1 * u1**2 * sin(q1)], [g * l0 * m1 * sin(q1) + T1]]
      )
      assert simplify(massmatrix3 - kane3.mass_matrix) == zeros(2)
      assert simplify(forcing3 - kane3.forcing) == Matrix([0, 0])
  
      kane4 = models.n_link_pendulum_on_cart(1, True, False)
      massmatrix4 = Matrix(
          [
              [m0 + m1, -l0 * m1 * cos(q1)],
              [-l0 * m1 * cos(q1), l0**2 * m1],
          ]
      )
      forcing4 = Matrix(
          [[-l0 * m1 * u1**2 * sin(q1) + F], [g * l0 * m1 * sin(q1)]]
      )
      assert simplify(massmatrix4 - kane4.mass_matrix) == zeros(2)
      assert simplify(forcing4 - kane4.forcing) == Matrix([0, 0])
  
file_path: sympy/sympy/physics/mechanics/tests/test_models.py
imports: import sympy.physics.mechanics.models
  from sympy import cos, sin, Matrix, symbols, zeros
  from sympy.simplify.simplify import simplify
  from sympy.physics.mechanics import dynamicsymbols
label_desc: Use image node_id 3 for calling a global function with example usage: test_n_link_pendulum_on_cart_inputs() without return types