
    Ed[                     L   d dl mZ d dlmZ d dlmZmZmZmZm	Z	 d dl
mZmZmZmZmZ d dlmZ d dlmZ d dlmZ d dlmZmZmZmZmZmZmZmZmZ g d	Z eZ!eZ"eZ#eZ$d
 Z%ej&        e%_&        ddZ'd Z(d Z)d Z*d Z+d Z,d Z-d Z.d Z/d dZ0dddZ1d Z2d Z3d Z4d Z5d Z6d Z7dS )!    )
dict_merge)iterable)DyadicVectorReferenceFramePointdynamicsymbols)vprintvsprintvpprintvlatexinit_vprinting)Particle)	RigidBody)simplify)	MatrixsympifyMul
DerivativesincostanAppliedUndefS)inertiainertia_of_point_masslinear_momentumangular_momentumkinetic_energypotential_energy
Lagrangianmechanics_printingmprintmsprintmpprintmlatexmsubsfind_dynamicsymbolsc                      t          di |  dS )z]
    Initializes time derivative printing for all SymPy objects in
    mechanics module.
    N )r   )kwargss    Alib/python3.11/site-packages/sympy/physics/mechanics/functions.pyr"   r"   %   s     V    c                 v   t          | t                    st          d          t          |          }t          |          }t          |          }t          |          }t          |          }t          |          }|| j        | j        z  z  }||| j        | j        z  z  z  }||| j        | j        z  z  z  }||| j        | j        z  z  z  }||| j        | j        z  z  z  }||| j        | j        z  z  z  }||| j        | j        z  z  z  }||| j        | j        z  z  z  }||| j        | j        z  z  z  }|S )a  Simple way to create inertia Dyadic object.

    Explanation
    ===========

    If you do not know what a Dyadic is, just treat this like the inertia
    tensor. Then, do the easy thing and define it in a body-fixed frame.

    Parameters
    ==========

    frame : ReferenceFrame
        The frame the inertia is defined in
    ixx : Sympifyable
        the xx element in the inertia dyadic
    iyy : Sympifyable
        the yy element in the inertia dyadic
    izz : Sympifyable
        the zz element in the inertia dyadic
    ixy : Sympifyable
        the xy element in the inertia dyadic
    iyz : Sympifyable
        the yz element in the inertia dyadic
    izx : Sympifyable
        the zx element in the inertia dyadic

    Examples
    ========

    >>> from sympy.physics.mechanics import ReferenceFrame, inertia
    >>> N = ReferenceFrame('N')
    >>> inertia(N, 1, 2, 3)
    (N.x|N.x) + 2*(N.y|N.y) + 3*(N.z|N.z)

    z%Need to define the inertia in a frame)
isinstancer   	TypeErrorr   xyz)frameixxiyyizzixyiyzizxols           r,   r   r   0   sA   J e^,, A?@@@
#,,C
#,,C
#,,C
#,,C
#,,C
#,,C	%'!	"B#57"
##B#57"
##B#57"
##B#57"
##B#57"
##B#57"
##B#57"
##B#57"
##BIr-   c                 ~    | |j         |j         z  |j        |j        z  z   |j        |j        z  z   ||z  z  ||z  z
  z  S )aO  Inertia dyadic of a point mass relative to point O.

    Parameters
    ==========

    mass : Sympifyable
        Mass of the point mass
    pos_vec : Vector
        Position from point O to point mass
    frame : ReferenceFrame
        Reference frame to express the dyadic in

    Examples
    ========

    >>> from sympy import symbols
    >>> from sympy.physics.mechanics import ReferenceFrame, inertia_of_point_mass
    >>> N = ReferenceFrame('N')
    >>> r, m = symbols('r m')
    >>> px = r * N.x
    >>> inertia_of_point_mass(m, px, N)
    m*r**2*(N.y|N.y) + m*r**2*(N.z|N.z)

    )r1   r2   r3   )masspos_vecr4   s      r,   r   r   i   sU    4 UWuw&57UW+<=Geg%'+2W+<>g%' ( (r-   c                     t          | t                    st          d          t          d          }|D ]E}t          |t          t
          f          r||                    |           z  }7t          d          |S )a  Linear momentum of the system.

    Explanation
    ===========

    This function returns the linear momentum of a system of Particle's and/or
    RigidBody's. The linear momentum of a system is equal to the vector sum of
    the linear momentum of its constituents. Consider a system, S, comprised of
    a rigid body, A, and a particle, P. The linear momentum of the system, L,
    is equal to the vector sum of the linear momentum of the particle, L1, and
    the linear momentum of the rigid body, L2, i.e.

    L = L1 + L2

    Parameters
    ==========

    frame : ReferenceFrame
        The frame in which linear momentum is desired.
    body1, body2, body3... : Particle and/or RigidBody
        The body (or bodies) whose linear momentum is required.

    Examples
    ========

    >>> from sympy.physics.mechanics import Point, Particle, ReferenceFrame
    >>> from sympy.physics.mechanics import RigidBody, outer, linear_momentum
    >>> N = ReferenceFrame('N')
    >>> P = Point('P')
    >>> P.set_vel(N, 10 * N.x)
    >>> Pa = Particle('Pa', P, 1)
    >>> Ac = Point('Ac')
    >>> Ac.set_vel(N, 25 * N.y)
    >>> I = outer(N.x, N.x)
    >>> A = RigidBody('A', Ac, N, 20, (I, Ac))
    >>> linear_momentum(N, A, Pa)
    10*N.x + 500*N.y

    z%Please specify a valid ReferenceFramer   **body must have only Particle or RigidBody)r/   r   r0   r   r   r   r   )r4   bodylinear_momentum_syses       r,   r   r      s    R e^,, N?@@@$Qii 	N 	NA!i233 N#q'8'8'?'??## LMMMr-   c                 F   t          |t                    st          d          t          | t                    st          d          t	          d          }|D ]F}t          |t
          t          f          r||                    | |          z  }8t          d          |S )a  Angular momentum of a system.

    Explanation
    ===========

    This function returns the angular momentum of a system of Particle's and/or
    RigidBody's. The angular momentum of such a system is equal to the vector
    sum of the angular momentum of its constituents. Consider a system, S,
    comprised of a rigid body, A, and a particle, P. The angular momentum of
    the system, H, is equal to the vector sum of the angular momentum of the
    particle, H1, and the angular momentum of the rigid body, H2, i.e.

    H = H1 + H2

    Parameters
    ==========

    point : Point
        The point about which angular momentum of the system is desired.
    frame : ReferenceFrame
        The frame in which angular momentum is desired.
    body1, body2, body3... : Particle and/or RigidBody
        The body (or bodies) whose angular momentum is required.

    Examples
    ========

    >>> from sympy.physics.mechanics import Point, Particle, ReferenceFrame
    >>> from sympy.physics.mechanics import RigidBody, outer, angular_momentum
    >>> N = ReferenceFrame('N')
    >>> O = Point('O')
    >>> O.set_vel(N, 0 * N.x)
    >>> P = O.locatenew('P', 1 * N.x)
    >>> P.set_vel(N, 10 * N.x)
    >>> Pa = Particle('Pa', P, 1)
    >>> Ac = O.locatenew('Ac', 2 * N.y)
    >>> Ac.set_vel(N, 5 * N.y)
    >>> a = ReferenceFrame('a')
    >>> a.set_ang_vel(N, 10 * N.z)
    >>> I = outer(N.z, N.z)
    >>> A = RigidBody('A', Ac, a, 20, (I, Ac))
    >>> angular_momentum(O, N, Pa, A)
    10*N.z

    #Please enter a valid ReferenceFramezPlease specify a valid Pointr   r@   )r/   r   r0   r   r   r   r   r   )pointr4   rA   angular_momentum_sysrC   s        r,   r   r      s    ^ e^,, ?=>>>eU## N6777%ayy 	N 	NA!i233 N$(:(:5%(H(HH$$ LMMMr-   c                     t          | t                    st          d          t          j        }|D ]E}t          |t
          t          f          r||                    |           z  }7t          d          |S )a  Kinetic energy of a multibody system.

    Explanation
    ===========

    This function returns the kinetic energy of a system of Particle's and/or
    RigidBody's. The kinetic energy of such a system is equal to the sum of
    the kinetic energies of its constituents. Consider a system, S, comprising
    a rigid body, A, and a particle, P. The kinetic energy of the system, T,
    is equal to the vector sum of the kinetic energy of the particle, T1, and
    the kinetic energy of the rigid body, T2, i.e.

    T = T1 + T2

    Kinetic energy is a scalar.

    Parameters
    ==========

    frame : ReferenceFrame
        The frame in which the velocity or angular velocity of the body is
        defined.
    body1, body2, body3... : Particle and/or RigidBody
        The body (or bodies) whose kinetic energy is required.

    Examples
    ========

    >>> from sympy.physics.mechanics import Point, Particle, ReferenceFrame
    >>> from sympy.physics.mechanics import RigidBody, outer, kinetic_energy
    >>> N = ReferenceFrame('N')
    >>> O = Point('O')
    >>> O.set_vel(N, 0 * N.x)
    >>> P = O.locatenew('P', 1 * N.x)
    >>> P.set_vel(N, 10 * N.x)
    >>> Pa = Particle('Pa', P, 1)
    >>> Ac = O.locatenew('Ac', 2 * N.y)
    >>> Ac.set_vel(N, 5 * N.y)
    >>> a = ReferenceFrame('a')
    >>> a.set_ang_vel(N, 10 * N.z)
    >>> I = outer(N.z, N.z)
    >>> A = RigidBody('A', Ac, a, 20, (I, Ac))
    >>> kinetic_energy(N, Pa, A)
    350

    rE   r@   )r/   r   r0   r   Zeror   r   r   )r4   rA   ke_sysrC   s       r,   r   r      s    ` e^,, ?=>>>VF J Ja)X.// 	Ja&&u---FFHIIIMr-   c                      t           j        }| D ]7}t          |t          t          f          r||j        z  })t          d          |S )a  Potential energy of a multibody system.

    Explanation
    ===========

    This function returns the potential energy of a system of Particle's and/or
    RigidBody's. The potential energy of such a system is equal to the sum of
    the potential energy of its constituents. Consider a system, S, comprising
    a rigid body, A, and a particle, P. The potential energy of the system, V,
    is equal to the vector sum of the potential energy of the particle, V1, and
    the potential energy of the rigid body, V2, i.e.

    V = V1 + V2

    Potential energy is a scalar.

    Parameters
    ==========

    body1, body2, body3... : Particle and/or RigidBody
        The body (or bodies) whose potential energy is required.

    Examples
    ========

    >>> from sympy.physics.mechanics import Point, Particle, ReferenceFrame
    >>> from sympy.physics.mechanics import RigidBody, outer, potential_energy
    >>> from sympy import symbols
    >>> M, m, g, h = symbols('M m g h')
    >>> N = ReferenceFrame('N')
    >>> O = Point('O')
    >>> O.set_vel(N, 0 * N.x)
    >>> P = O.locatenew('P', 1 * N.x)
    >>> Pa = Particle('Pa', P, m)
    >>> Ac = O.locatenew('Ac', 2 * N.y)
    >>> a = ReferenceFrame('a')
    >>> I = outer(N.z, N.z)
    >>> A = RigidBody('A', Ac, a, M, (I, Ac))
    >>> Pa.potential_energy = m * g * h
    >>> A.potential_energy = M * g * h
    >>> potential_energy(Pa, A)
    M*g*h + g*h*m

    r@   )r   rI   r/   r   r   r    r0   )rA   pe_sysrC   s      r,   r    r    5  sX    \ VF J Ja)X.// 	Ja((FFHIIIMr-   c                     g }|st          d          |D ];}t          |dd          }||j        }|                    ||j        | z  f           <|S )a  
    Returns a list of gravity forces given the acceleration
    due to gravity and any number of particles or rigidbodies.

    Example
    =======

    >>> from sympy.physics.mechanics import ReferenceFrame, Point, Particle, outer, RigidBody
    >>> from sympy.physics.mechanics.functions import gravity
    >>> from sympy import symbols
    >>> N = ReferenceFrame('N')
    >>> m, M, g = symbols('m M g')
    >>> F1, F2 = symbols('F1 F2')
    >>> po = Point('po')
    >>> pa = Particle('pa', po, m)
    >>> A = ReferenceFrame('A')
    >>> P = Point('P')
    >>> I = outer(A.x, A.x)
    >>> B = RigidBody('B', P, A, M, (I, P))
    >>> forceList = [(po, F1), (P, F2)]
    >>> forceList.extend(gravity(g*N.y, pa, B))
    >>> forceList
    [(po, F1), (P, F2), (po, g*m*N.y), (P, M*g*N.y)]
    :No bodies(instances of Particle or Rigidbody) were passed.
masscenterN)r0   getattrrF   appendr=   )accelerationbodiesgravity_forcerC   rF   s        r,   gravityrU   l  sy    4 M VTUUU ; ;<.. 	GEeQVL%89::::r-   c                     |st          d          d}t          d          }|D ]F}||j        z  }t          |dd          }||j        }||j        |                    |           z  z  }G||z  S )a  
    Returns the position vector from the given point to the center of mass
    of the given bodies(particles or rigidbodies).

    Example
    =======

    >>> from sympy import symbols, S
    >>> from sympy.physics.vector import Point
    >>> from sympy.physics.mechanics import Particle, ReferenceFrame, RigidBody, outer
    >>> from sympy.physics.mechanics.functions import center_of_mass
    >>> a = ReferenceFrame('a')
    >>> m = symbols('m', real=True)
    >>> p1 = Particle('p1', Point('p1_pt'), S(1))
    >>> p2 = Particle('p2', Point('p2_pt'), S(2))
    >>> p3 = Particle('p3', Point('p3_pt'), S(3))
    >>> p4 = Particle('p4', Point('p4_pt'), m)
    >>> b_f = ReferenceFrame('b_f')
    >>> b_cm = Point('b_cm')
    >>> mb = symbols('mb')
    >>> b = RigidBody('b', b_cm, b_f, mb, (outer(b_f.x, b_f.x), b_cm))
    >>> p2.point.set_pos(p1.point, a.x)
    >>> p3.point.set_pos(p1.point, a.x + a.y)
    >>> p4.point.set_pos(p1.point, a.y)
    >>> b.masscenter.set_pos(p1.point, a.y + a.z)
    >>> point_o=Point('o')
    >>> point_o.set_pos(p1.point, center_of_mass(p1.point, p1, p2, p3, p4, b))
    >>> expr = 5/(m + mb + 6)*a.x + (m + mb + 3)/(m + mb + 6)*a.y + mb/(m + mb + 6)*a.z
    >>> point_o.pos_from(p1.point)
    5/(m + mb + 6)*a.x + (m + mb + 3)/(m + mb + 6)*a.y + mb/(m + mb + 6)*a.z
    rN   r   rO   N)r0   r   r=   rP   rF   pos_from)rF   rS   
total_massvecirO   s         r,   center_of_massr[     s    @  VTUUUJ
))C 1 1af
Qd33
 	!Jqvj))%0000z>r-   c                     t          | t                    st          d          |D ]-}t          |t          t          f          st          d          .t          | g|R  t          | z
  S )a  Lagrangian of a multibody system.

    Explanation
    ===========

    This function returns the Lagrangian of a system of Particle's and/or
    RigidBody's. The Lagrangian of such a system is equal to the difference
    between the kinetic energies and potential energies of its constituents. If
    T and V are the kinetic and potential energies of a system then it's
    Lagrangian, L, is defined as

    L = T - V

    The Lagrangian is a scalar.

    Parameters
    ==========

    frame : ReferenceFrame
        The frame in which the velocity or angular velocity of the body is
        defined to determine the kinetic energy.

    body1, body2, body3... : Particle and/or RigidBody
        The body (or bodies) whose Lagrangian is required.

    Examples
    ========

    >>> from sympy.physics.mechanics import Point, Particle, ReferenceFrame
    >>> from sympy.physics.mechanics import RigidBody, outer, Lagrangian
    >>> from sympy import symbols
    >>> M, m, g, h = symbols('M m g h')
    >>> N = ReferenceFrame('N')
    >>> O = Point('O')
    >>> O.set_vel(N, 0 * N.x)
    >>> P = O.locatenew('P', 1 * N.x)
    >>> P.set_vel(N, 10 * N.x)
    >>> Pa = Particle('Pa', P, 1)
    >>> Ac = O.locatenew('Ac', 2 * N.y)
    >>> Ac.set_vel(N, 5 * N.y)
    >>> a = ReferenceFrame('a')
    >>> a.set_ang_vel(N, 10 * N.z)
    >>> I = outer(N.z, N.z)
    >>> A = RigidBody('A', Ac, a, 20, (I, Ac))
    >>> Pa.potential_energy = m * g * h
    >>> A.potential_energy = M * g * h
    >>> Lagrangian(N, Pa, A)
    -M*g*h - g*h*m + 350

    z$Please supply a valid ReferenceFramer@   )r/   r   r0   r   r   r   r    )r4   rA   rC   s      r,   r!   r!     s    h e^,, @>??? J J!i233 	JHIII	J%'$'''*:D*AAAr-   Nc                 t   t           j        h|r.t          |          rt          |          }nt	          d          t                      }t          | t                    r)|t          d|z            |                     |          } fd| 	                    t          t                    D             |z
  S )a  Find all dynamicsymbols in expression.

    Explanation
    ===========

    If the optional ``exclude`` kwarg is used, only dynamicsymbols
    not in the iterable ``exclude`` are returned.
    If we intend to apply this function on a vector, the optional
    ``reference_frame`` is also used to inform about the corresponding frame
    with respect to which the dynamic symbols of the given vector is to be
    determined.

    Parameters
    ==========

    expression : SymPy expression

    exclude : iterable of dynamicsymbols, optional

    reference_frame : ReferenceFrame, optional
        The frame with respect to which the dynamic symbols of the
        given vector is to be determined.

    Examples
    ========

    >>> from sympy.physics.mechanics import dynamicsymbols, find_dynamicsymbols
    >>> from sympy.physics.mechanics import ReferenceFrame
    >>> x, y = dynamicsymbols('x, y')
    >>> expr = x + x.diff()*y
    >>> find_dynamicsymbols(expr)
    {x(t), y(t), Derivative(x(t), t)}
    >>> find_dynamicsymbols(expr, exclude=[x, y])
    {Derivative(x(t), t)}
    >>> a, b, c = dynamicsymbols('a, b, c')
    >>> A = ReferenceFrame('A')
    >>> v = a * A.x + b * A.y + c * A.z
    >>> find_dynamicsymbols(v, reference_frame=A)
    {a(t), b(t), c(t)}

    zexclude kwarg must be iterableNzJYou must provide reference_frame when passing a vector expression, got %s.c                 *    h | ]}|j         k    |S r*   )free_symbols).0rZ   t_sets     r,   	<setcomp>z&find_dynamicsymbols.<locals>.<setcomp>8  s4     % % %!Ne#%A % % %r-   )r	   _tr   setr0   r/   r   
ValueError	to_matrixatomsr   r   )
expressionexcludereference_frameexclude_setra   s       @r,   r(   r(      s    T E G 	>g,,KK<===ee*f%% ? 	? :<KL M M M $--o>>J% % % %z''jAA % % %'23 3r-   F)smartc                
   t          | |rt          n(t          | d          r|                               S d t	          | t
          t          t          f          r|                     fd          S  |           S )a%  A custom subs for use on expressions derived in physics.mechanics.

    Traverses the expression tree once, performing the subs found in sub_dicts.
    Terms inside ``Derivative`` expressions are ignored:

    Examples
    ========

    >>> from sympy.physics.mechanics import dynamicsymbols, msubs
    >>> x = dynamicsymbols('x')
    >>> msubs(x.diff() + x, {x: 1})
    Derivative(x(t), t) + 1

    Note that sub_dicts can be a single dictionary, or several dictionaries:

    >>> x, y, z = dynamicsymbols('x, y, z')
    >>> sub1 = {x: 1, y: 2}
    >>> sub2 = {z: 3, x.diff(): 4}
    >>> msubs(x.diff() + x + y + z, sub1, sub2)
    10

    If smart=True (default False), also checks for conditions that may result
    in ``nan``, but if simplified would yield a valid expression. For example:

    >>> from sympy import sin, tan
    >>> (sin(x)/tan(x)).subs(x, 0)
    nan
    >>> msubs(sin(x)/tan(x), {x: 0}, smart=True)
    1

    It does this by first replacing all ``tan`` with ``sin/cos``. Then each
    node is traversed. If the node is a fraction, subs is first evaluated on
    the denominator. If this results in 0, simplification of the entire
    fraction is attempted. Using this selective simplification, only
    subexpressions that result in 1/0 are targeted, resulting in faster
    performance.

    r'   c                 .    t          | t          |          S N)_crawl	_sub_funcexprsub_dicts     r,   <lambda>zmsubs.<locals>.<lambda>j  s    fT9h&G&G r-   c                      |           S ro   r*   )r1   funcrt   s    r,   ru   zmsubs.<locals>.<lambda>l  s    Q(9(9 r-   )	r   _smart_subshasattrr'   r/   r   r   r   	applyfunc)rs   rl   	sub_dictsr+   rw   rt   s       @@r,   r'   r'   <  s    P 9%H H	w		 Hzz(###GG$011 $~~99999:::tD(###r-   c                 f     | gR i }||S fd| j         D             } | j        | S )z8Crawl the expression tree, and apply func to every node.Nc              3   :   K   | ]}t          |gR i V  d S ro   )rp   )r`   argargsrw   r+   s     r,   	<genexpr>z_crawl.<locals>.<genexpr>v  s=      HHssD24222622HHHHHHr-   )r   rw   )rs   rw   r   r+   valnew_argss    ```  r,   rp   rp   q  sa    
$t
%d
%
%
%f
%
%C
 
HHHHHHdiHHHH49hr-   c                 >    | |v r||          S | j         r| j        r| S dS )z;Perform direct matching substitution, ignoring derivatives.N)r   is_Derivativerr   s     r,   rq   rq   z  s<    x ~Y $,  r-   c                     t          | t                    rt          | j         t	          | j         z  S | j        r| j        r| S dS )zReplace tan with sin/cos.N)r/   r   r   r   r   r   )rs   s    r,   _tan_repl_funcr     sN    $ DIdi00Y $,  r-   c                 P    t          | t                    } fd | |          S )a  Performs subs, checking for conditions that may result in `nan` or
    `oo`, and attempts to simplify them out.

    The expression tree is traversed twice, and the following steps are
    performed on each expression node:
    - First traverse:
        Replace all `tan` with `sin/cos`.
    - Second traverse:
        If node is a fraction, check if the denominator evaluates to 0.
        If so, attempt to simplify it out. Then if node is in sub_dict,
        sub in the corresponding value.c                 $   t          |           \  }}|dk    rE |          }|                                dk    rt          |           } n |          }||z  S t          |           }||S fd| j        D             } | j        | S )N   r   c              3   0   K   | ]} |          V  d S ro   r*   )r`   r~   	_recurserrt   s     r,   r   z1_smart_subs.<locals>._recurser.<locals>.<genexpr>  s/      BBIIc8,,BBBBBBr-   )_fraction_decompevalfr   rq   r   rw   )	rs   rt   numdendenom_subbed
num_subbedr   r   r   s	    `      r,   r   z_smart_subs.<locals>._recurser  s    #D))S!8 		1$9S(33L!!##q( 1~~ 'YsH55
!L00 h'' 	JBBBBB	BBBty(##r-   )rp   r   )rs   rt   r   s     @r,   rx   rx     sA     $''D$ $ $ $ $( 9T8$$$r-   c                    t          | t                    s| dfS g }g }| j        D ]H}|j        r*|j        d         dk     r|                    d|z             3|                    |           I|s| dfS t          | }t          | }||fS )z(Return num, den such that expr = num/denr   r   )r/   r   r   is_PowrQ   )rs   r   r   as       r,   r   r     s    dC   Qw
C
CY  8 	q	A 	JJq1uJJqMMMM Qw
s)C
s)C8Or-   c                 v      fd} sd\  }}n&d } |t           |                                \  }}||fS )aH  Parses the provided forcelist composed of items
    of the form (obj, force).
    Returns a tuple containing:
        vel_list: The velocity (ang_vel for Frames, vel for Points) in
                the provided reference frame.
        f_list: The forces.

    Used internally in the KanesMethod and LagrangesMethod classes.
    c               3      K   D ]s} | \  }}t          |t                    r|                              |fV  6t          |t                    r|                              |fV  et          d          d S )Nz<First entry in each forcelist pair must be a point or frame.)r/   r   
ang_vel_inr   velr0   )pairobjforcefl	ref_frames      r,   
flist_iterz"_f_list_parser.<locals>.flist_iter  s       	8 	8DJC#~.. 8nnY//66666C'' 8ggi((%///// !7 8 8 8	8 	8r-   )r*   r*   c                 F    | d         rt          t          |            nddgS )Nr   r*   )listzip)ls    r,   ru   z _f_list_parser.<locals>.<lambda>  s!    1Q4=$sAw---b"X r-   )r   )r   r   r   vel_listf_listunzips   ``    r,   _f_list_parserr     sm    	8 	8 	8 	8 	8 	8  5!&&== 5jjll!3!344&Vr-   )r   r   r   )NN)8sympy.utilitiesr   sympy.utilities.iterablesr   sympy.physics.vectorr   r   r   r   r	   sympy.physics.vector.printingr
   r   r   r   r    sympy.physics.mechanics.particler   !sympy.physics.mechanics.rigidbodyr   sympy.simplify.simplifyr   sympy.core.backendr   r   r   r   r   r   r   r   r   __all__r#   r$   r%   r&   r"   __doc__r   r   r   r   r   r    rU   r[   r!   r(   r'   rp   rq   r   rx   r   r   r*   r-   r,   <module>r      s   & & & & & & . . . . . .9 9 9 9 9 9 9 9 9 9 9 9 9 9; ; ; ; ; ; ; ; ; ; ; ; ; ; 5 5 5 5 5 5 7 7 7 7 7 7 , , , , , ,6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6" " "$ 


	   ,3  6 6 6 6r( ( (>2 2 2j:  :  : z8 8 8v4 4 4n% % %P- - -`9B 9B 9Bx93 93 93 93x #( 2$ 2$ 2$ 2$ 2$j         "% "% "%J  $    r-   