+
    i(                     r    ^ RI HtHtHtHtHtHt ^ RIHt ^ RI	H
t
 ^ RIHt ^ RIHt R.t ! R R]
4      tR# )	    )Body
LagrangianKanesMethodLagrangesMethod	RigidBodyParticle)BodyBase)_Methods)Matrix)sympy_deprecation_warningJointsMethodc                     a  ] tR t^t o RtR t]R 4       t]R 4       t]R 4       t	]R 4       t
]R 4       t]R 4       t]R	 4       t]R
 4       t]R 4       t]R 4       tR tR tR tR tR tR t]3R ltRR ltRtV tR# )r   a	  Method for formulating the equations of motion using a set of interconnected bodies with joints.

.. deprecated:: 1.13
    The JointsMethod class is deprecated. Its functionality has been
    replaced by the new :class:`~.System` class.

Parameters
==========

newtonion : Body or ReferenceFrame
    The newtonion(inertial) frame.
*joints : Joint
    The joints in the system

Attributes
==========

q, u : iterable
    Iterable of the generalized coordinates and speeds
bodies : iterable
    Iterable of Body objects in the system.
loads : iterable
    Iterable of (Point, vector) or (ReferenceFrame, vector) tuples
    describing the forces on the system.
mass_matrix : Matrix, shape(n, n)
    The system's mass matrix
forcing : Matrix, shape(n, 1)
    The system's forcing vector
mass_matrix_full : Matrix, shape(2*n, 2*n)
    The "mass matrix" for the u's and q's
forcing_full : Matrix, shape(2*n, 1)
    The "forcing vector" for the u's and q's
method : KanesMethod or Lagrange's method
    Method's object.
kdes : iterable
    Iterable of kde in they system.

Examples
========

As Body and JointsMethod have been deprecated, the following examples are
for illustrative purposes only. The functionality of Body is fully captured
by :class:`~.RigidBody` and :class:`~.Particle` and the functionality of
JointsMethod is fully captured by :class:`~.System`. To ignore the
deprecation warning we can use the ignore_warnings context manager.

>>> from sympy.utilities.exceptions import ignore_warnings

This is a simple example for a one degree of freedom translational
spring-mass-damper.

>>> from sympy import symbols
>>> from sympy.physics.mechanics import Body, JointsMethod, PrismaticJoint
>>> from sympy.physics.vector import dynamicsymbols
>>> c, k = symbols('c k')
>>> x, v = dynamicsymbols('x v')
>>> with ignore_warnings(DeprecationWarning):
...     wall = Body('W')
...     body = Body('B')
>>> J = PrismaticJoint('J', wall, body, coordinates=x, speeds=v)
>>> wall.apply_force(c*v*wall.x, reaction_body=body)
>>> wall.apply_force(k*x*wall.x, reaction_body=body)
>>> with ignore_warnings(DeprecationWarning):
...     method = JointsMethod(wall, J)
>>> method.form_eoms()
Matrix([[-B_mass*Derivative(v(t), t) - c*v(t) - k*x(t)]])
>>> M = method.mass_matrix_full
>>> F = method.forcing_full
>>> rhs = M.LUsolve(F)
>>> rhs
Matrix([
[                     v(t)],
[(-c*v(t) - k*x(t))/B_mass]])

Notes
=====

``JointsMethod`` currently only works with systems that do not have any
configuration or motion constraints.

c                j   \        R RRR7       \        V\        4      '       d   VP                  V n        MWn        W n        V P                  4       V n        V P                  4       V n        V P                  4       V n
        V P                  4       V n        V P                  4       V n        RV n        R# )z
            The JointsMethod class is deprecated.
            Its functionality has been replaced by the new System class.
            z1.13z!deprecated-mechanics-jointsmethod)deprecated_since_versionactive_deprecations_targetN)r   
isinstancer	   frame_joints_generate_bodylist_bodies_generate_loadlist_loads_generate_q_q_generate_u_u_generate_kdes_kdes_method)self	newtonionjointss   &&*ڄ/Users/tonyclaw/.openclaw/workspace/skills/math-calculator/venv/lib/python3.14/site-packages/sympy/physics/mechanics/jointsmethod.py__init__JointsMethod.__init__^   s    ! &,'J	
 i**"DJ"J..0--/""$""$((*
    c                    V P                   # )zList of bodies in they system.)r   r    s   &r#   bodiesJointsMethod.bodiesu        ||r&   c                    V P                   # )zList of loads on the system.)r   r(   s   &r#   loadsJointsMethod.loadsz   s     {{r&   c                    V P                   # z$List of the generalized coordinates.)r   r(   s   &r#   qJointsMethod.q        wwr&   c                    V P                   # )zList of the generalized speeds.)r   r(   s   &r#   uJointsMethod.u   r3   r&   c                    V P                   # r0   )r   r(   s   &r#   kdesJointsMethod.kdes   s     zzr&   c                .    V P                   P                  # )z)The "forcing vector" for the u's and q's.)methodforcing_fullr(   s   &r#   r<   JointsMethod.forcing_full   s     {{'''r&   c                .    V P                   P                  # )z&The "mass matrix" for the u's and q's.)r;   mass_matrix_fullr(   s   &r#   r?   JointsMethod.mass_matrix_full   s     {{+++r&   c                .    V P                   P                  # )zThe system's mass matrix.)r;   mass_matrixr(   s   &r#   rB   JointsMethod.mass_matrix   s     {{&&&r&   c                .    V P                   P                  # )zThe system's forcing vector.)r;   forcingr(   s   &r#   rE   JointsMethod.forcing   s     {{"""r&   c                    V P                   # )z3Object of method used to form equations of systems.)r   r(   s   &r#   r;   JointsMethod.method   r+   r&   c                    . pV P                    F]  pVP                  V9  d   VP                  VP                  4       VP                  V9  g   KB  VP                  VP                  4       K_  	  V# N)r   childappendparent)r    r)   joints   &  r#   r   JointsMethod._generate_bodylist   sT    \\E{{&(ekk*||6)ell+	 "
 r&   c                    . pV P                    F6  p\        V\        4      '       g   K  VP                  VP                  4       K8  	  V# rJ   )r)   r   r   extendr-   )r    	load_listbodys   &  r#   r   JointsMethod._generate_loadlist   s<    	KKD$%%  ,   r&   c                    . pV P                    F8  pVP                   F%  pW19   d   \        R 4      hVP                  V4       K'  	  K:  	  \	        V4      # )z'Coordinates of joints should be unique.)r   coordinates
ValueErrorrL   r   )r    q_indrN   
coordinates   &   r#   r   JointsMethod._generate_q   sO    \\E#//
&$%NOOZ( 0 "
 e}r&   c                    . pV P                    F8  pVP                   F%  pW19   d   \        R 4      hVP                  V4       K'  	  K:  	  \	        V4      # )z"Speeds of joints should be unique.)r   speedsrW   rL   r   )r    u_indrN   speeds   &   r#   r   JointsMethod._generate_u   sL    \\E>$%IJJU# & "
 e}r&   c                    \        ^^ . 4      P                  pV P                   F  pVP                  VP                  4      pK   	  V# )   )r   Tr   col_joinr8   )r    kd_indrN   s   &  r#   r   JointsMethod._generate_kdes   s;    1b!##\\E__UZZ0F "r&   c           	     "   . pV P                    F  p\        V\        4      '       g   VP                  V4       K,  VP                  '       dr   \        VP                  VP                  VP                  VP                  VP                  VP                  34      pVP                  Vn        VP                  V4       K  \        VP                  VP                  VP                  4      pVP                  Vn        VP                  V4       K  	  V# rJ   )r)   r   r   rL   is_rigidbodyr   name
masscenterr   masscentral_inertiapotential_energyr   )r    bodylistrS   rbparts   &    r#   _convert_bodiesJointsMethod._convert_bodies   s    KKDdD))%   tyy$//4::tyy))4??;=&*&;&;##		4??DIIF(,(=(=%%   r&   c           	        V P                  4       p\        V\        4      '       dF   \        V P                  .VO5!  pV! W0P
                  V P                  W P                  4      V n        MEV! V P                  V P
                  V P                  V P                  V P                  VR7      V n        V P                  P                  4       pV# )aB  Method to form system's equation of motions.

Parameters
==========

method : Class
    Class name of method.

Returns
========

Matrix
    Vector of equations of motions.

Examples
========

As Body and JointsMethod have been deprecated, the following examples
are for illustrative purposes only. The functionality of Body is fully
captured by :class:`~.RigidBody` and :class:`~.Particle` and the
functionality of JointsMethod is fully captured by :class:`~.System`. To
ignore the deprecation warning we can use the ignore_warnings context
manager.

>>> from sympy.utilities.exceptions import ignore_warnings

This is a simple example for a one degree of freedom translational
spring-mass-damper.

>>> from sympy import S, symbols
>>> from sympy.physics.mechanics import LagrangesMethod, dynamicsymbols, Body
>>> from sympy.physics.mechanics import PrismaticJoint, JointsMethod
>>> q = dynamicsymbols('q')
>>> qd = dynamicsymbols('q', 1)
>>> m, k, b = symbols('m k b')
>>> with ignore_warnings(DeprecationWarning):
...     wall = Body('W')
...     part = Body('P', mass=m)
>>> part.potential_energy = k * q**2 / S(2)
>>> J = PrismaticJoint('J', wall, part, coordinates=q, speeds=qd)
>>> wall.apply_force(b * qd * wall.x, reaction_body=part)
>>> with ignore_warnings(DeprecationWarning):
...     method = JointsMethod(wall, J)
>>> method.form_eoms(LagrangesMethod)
Matrix([[b*Derivative(q(t), t) + k*q(t) + m*Derivative(q(t), (t, 2))]])

We can also solve for the states using the 'rhs' method.

>>> method.rhs()
Matrix([
[                Derivative(q(t), t)],
[(-b*Derivative(q(t), t) - k*q(t))/m]])

)rX   r]   kd_eqs	forcelistr)   )rp   
issubclassr   r   r   r1   r-   r   r5   r8   r;   
_form_eoms)r    r;   rm   Lsolns   &&   r#   	form_eomsJointsMethod.form_eoms   s    p '')fo..4::11A!!VVTZZ::NDL!$**DFF$&&QUQZQZ.2jjKDL{{%%'r&   Nc                :    V P                   P                  VR7      # )a  Returns equations that can be solved numerically.

Parameters
==========

inv_method : str
    The specific sympy inverse matrix calculation method to use. For a
    list of valid methods, see
    :meth:`~sympy.matrices.matrixbase.MatrixBase.inv`

Returns
========

Matrix
    Numerically solvable equations.

See Also
========

sympy.physics.mechanics.kane.KanesMethod.rhs:
    KanesMethod's rhs function.
sympy.physics.mechanics.lagrange.LagrangesMethod.rhs:
    LagrangesMethod's rhs function.

)
inv_method)r;   rhs)r    r|   s   &&r#   r}   JointsMethod.rhs#  s    6 {{*55r&   )r   r   r   r   r   r   r   r   rJ   )__name__
__module____qualname____firstlineno____doc__r$   propertyr)   r-   r1   r5   r8   r<   r?   rB   rE   r;   r   r   r   r   r   rp   r   ry   r}   __static_attributes____classdictcell__)__classdict__s   @r#   r   r      s    Pd.           ( ( , , ' ' # #  $  + @D6 6r&   N)sympy.physics.mechanicsr   r   r   r   r   r   !sympy.physics.mechanics.body_baser	   sympy.physics.mechanics.methodr
   sympyr   sympy.utilities.exceptionsr   __all__r    r&   r#   <module>r      s1   9 9 6 3  @
s68 s6r&   