+
    
þÎj¯(  ã                   ó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   &&*ÚZ/opt/data/home/.local/lib/python3.14/site-packages/sympy/physics/mechanics/jointsmethod.pyÚ__init__ÚJointsMethod.__init__^   s’   € Ü!ðð &,Ø'Jõ	
ô �i¤×*Ò*Ø"Ÿ™ˆD�Jà"Œ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   ó   € ð �w‰wˆ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   € ð �z‰zÐ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Ø�{‰{ &Ô(Ø—‘˜eŸk™kÔ*Ø�|‰| 6Ö)Ø—‘˜eŸl™lÖ+ñ	 "ð
 ˆ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<   € Øˆ	Ø—K”KˆDÜ˜$¤×%Ô%Ø× Ñ  §¡Ö,ñ  ð Ð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;   € Ü˜˜1˜bÓ!×#Ñ#ˆØ—\”\ˆEØ—_‘_ U§Z¡ZÓ0ŠFñ "àˆ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Æ   € àˆØ—K”KˆDÜ˜d¤D×)Ò)Ø—‘ Ô%ÙØ× × Ð Ü˜tŸy™y¨$¯/©/¸4¿:¹:ÀtÇyÁyØ×)Ñ)¨4¯?©?Ð;ó=�à&*×&;Ñ&;�Ô#Ø—‘ Ö#ä §	¡	¨4¯?©?¸D¿I¹IÓ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 ×'Ñ'Ó)ˆÜ�fœo×.Ò.Ü˜4Ÿ:™:Ð1¨Ó1ˆAÙ! !§V¡V¨T¯Z©Z¸Ç:Á:ÓNˆD�Lá! $§*¡*°D·F±FÀ$Ç&Á&ÐQU×QZÑQZØ.2¯j©jÀôKˆDŒLà�{‰{×%Ñ%Ó'ˆØˆ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6�8ö s6r&   