Ë
    7^(h?  ã                   ó:   — d Z ddlmZ ddlmc mZ 	 	 dd„Zdd„Z	y)zOThis module contains some sample symbolic models used for testing and
examples.é    )ÚbackendNc                 óª  — t        j                  dj                  | «      «      }t        j                  dj                  | «      «      }t        j                  dj                  | «      «      }t        j                  d«      }t        j                  dj                  | «      «      }t        j                  dj                  | «      «      }t        j                  dj                  | «      «      }	t        j
                  d«      }
t        j                  d	«      }|j                  |
d
«       |g}g }g }g }t        | «      D �]W  }|d   j                  dj                  |«      ||   |
j                  z  «      }|j                  |
|d   j                  |
«      ||   |
j                  z  z   «       |j                  |«       t        j                  dj                  |«      |||   «      }|j                  ||   ||   j                  «       z
  «       ||    ||   z  ||   ||   z  z
  }	 |||dz      ||dz      z  ||dz      ||dz      z  z   z  }|r|||   |z  z  }|r||	|   z  }|j                  |||
j                  z  f«       |j                  |«       �ŒZ t        j                   |
|||¬«      }|j#                  ||«       |S # t        $ r Y Œƒw xY w)as  Returns a system containing the symbolic equations of motion and
    associated variables for a simple multi-degree of freedom point mass,
    spring, damper system with optional gravitational and external
    specified forces. For example, a two mass system under the influence of
    gravity and external forces looks like:

    ::

        ----------------
         |     |     |   | g
         \    | |    |   V
      k0 /    --- c0 |
         |     |     | x0, v0
        ---------    V
        |  m0   | -----
        ---------    |
         | |   |     |
         \ v  | |    |
      k1 / f0 --- c1 |
         |     |     | x1, v1
        ---------    V
        |  m1   | -----
        ---------
           | f1
           V

    Parameters
    ==========

    n : integer
        The number of masses in the serial chain.
    apply_gravity : boolean
        If true, gravity will be applied to each mass.
    apply_external_forces : boolean
        If true, a time varying external force will be applied to each mass.

    Returns
    =======

    kane : sympy.physics.mechanics.kane.KanesMethod
        A KanesMethod object.

    úm:{}zk:{}zc:{}Úgzx:{}zv:{}zf:{}ÚNÚoriginr   éÿÿÿÿzcenter{}zblock{}é   ©Úq_indÚu_indÚkd_eqs)ÚsmÚsymbolsÚformatÚmeÚdynamicsymbolsÚReferenceFrameÚPointÚset_velÚrangeÚ	locatenewÚxÚvelÚappendÚParticleÚdiffÚ
IndexErrorÚKanesMethodÚkanes_equations)ÚnÚapply_gravityÚapply_external_forcesÚmassÚ	stiffnessÚdampingÚacceleration_due_to_gravityÚcoordinatesÚspeedsÚ
specifiedsÚceilingr   ÚpointsÚkinematic_equationsÚ	particlesÚforcesÚiÚcenterÚblockÚtotal_forceÚkanes                        ú\/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/sympy/physics/mechanics/models.pyÚmulti_mass_spring_damperr6   
   s°  € ô\ �:‰:�f—m‘m AÓ&Ó'€DÜ—
‘
˜6Ÿ=™=¨Ó+Ó,€IÜ�j‰j˜Ÿ™ qÓ)Ó*€Gä"$§*¡*¨S£/Ðä×#Ñ# F§M¡M°!Ó$4Ó5€KÜ×Ñ˜vŸ}™}¨QÓ/Ó0€FÜ×"Ñ" 6§=¡=°Ó#3Ó4€Jä×Ñ Ó$€GÜ�X‰X�hÓ€FØ
‡N�N�7˜AÔàˆX€FØÐØ€IØ€Fä�1‹Xó  ˆà˜‘×%Ñ% j×&7Ñ&7¸Ó&:Ø&1°!¡n°w·y±yÑ&@óBˆà�‰�w  r¡
§¡¨wÓ 7Ø˜a‘y 7§9¡9Ñ,ñ!-ô 	.à�‰�fÔä—‘˜I×,Ñ,¨QÓ/°¸¸a¹ÓAˆà×"Ñ" 6¨!¡9¨{¸1©~×/BÑ/BÓ/DÑ#DÔEà! !™�} {°1¡~Ñ5Ø˜q‘z F¨1¡IÑ-ñ.ˆð	Ø˜I a¨!¡eÑ,¨{¸1¸q¹5Ñ/AÑAØ# A¨¡E™N¨V°A¸±E©]Ñ:ñ;ñ <ˆKñ
 Ø˜4 ™7Ð%@Ñ@Ñ@ˆKá Ø˜: a™=Ñ(ˆKà�‰�v˜{¨W¯Y©YÑ6Ð7Ô8à×Ñ˜Öð9 ô< �>‰>˜'¨¸FØ!4ô6€Dà×Ñ˜ FÔ+à€Køô# ò 	Ùð	ús   È(&KË	KËKc                 óæ  — | dk  rt        d«      ‚t        j                  dj                  | dz   «      «      }t        j                  dj                  | dz   «      «      }|du r't        j                  dj                  | dz   «      «      }t	        j
                  dj                  | dz   «      «      }t	        j
                  d	j                  | «      «      }t	        j
                  d
«      \  }}	t        j                  d«      }
t        j                  d«      }|j                  |
d«       t        j                  d«      }|j                  ||d   |
j                  z  «       |j                  |
|d   |
j                  z  «       t        j                  d||d   «      }|
g}|g}|g}||d    |z  |
j                  z  fg}|d   j                  |	«      |d   z
  g}|du s|du rg }nd}t        | «      D �]  }|
j                  dj                  |«      d||dz      |
j                   g«      }|j#                  |
||dz      |
j                   z  «       |j%                  |«       |d   j'                  dj                  |dz   «      ||   |j                  z  «      }|j)                  |d   |
|«       |j%                  |«       t        j                  dt+        |dz   «      z   |||dz      «      }|j%                  |«       |j%                  |||dz       |z  |
j                  z  f«       |du r¢|j%                  |   «       |dk(  r$|j%                  |
||    |
j                   z  f«       || dz
  k(  r$|j%                  |||   |
j                   z  f«       n9|j%                  |||   |
j                   z  ||dz      |
j                   z  z
  f«       |j%                  ||dz      j                  |	«      ||dz      z
  «       �Œ
 |du rFt        j                  d«      }|j%                  |||
j                  z  f«       |j%                  |«       t        j,                  |
|||¬«      }|j/                  ||«       |S )a-  Returns the system containing the symbolic first order equations of
    motion for a 2D n-link pendulum on a sliding cart under the influence of
    gravity.

    ::

                  |
         o    y   v
          \ 0 ^   g
           \  |
          --\-|----
          |  \|   |
      F-> |   o --|---> x
          |       |
          ---------
           o     o

    Parameters
    ==========

    n : integer
        The number of links in the pendulum.
    cart_force : boolean, default=True
        If true an external specified lateral force is applied to the cart.
    joint_torques : boolean, default=False
        If true joint torques will be added as specified inputs at each
        joint.

    Returns
    =======

    kane : sympy.physics.mechanics.kane.KanesMethod
        A KanesMethod object.

    Notes
    =====

    The degrees of freedom of the system are n + 1, i.e. one for each
    pendulum link and one for the lateral motion of the cart.

    M x' = F, where x = [u0, ..., un+1, q0, ..., qn+1]

    The joint angles are all defined relative to the ground where the x axis
    defines the ground line and the y axis points up. The joint torques are
    applied between each adjacent link and the between the cart and the
    lower link where a positive torque corresponds to positive angle.

    r   z/The number of links must be a positive integer.zq:{}r
   zu:{}TzT1:{}r   zl:{}zg tÚIÚOÚP0ÚPa0NzB{}ÚAxisr	   zP{}ÚPaÚFr   )Ú
ValueErrorr   r   r   r   r   r   r   r   Úset_posr   r   Úyr   r   Ú	orientnewÚzÚset_ang_velr   r   Úv2pt_theoryÚstrr   r    )r!   Ú
cart_forceÚjoint_torquesÚqÚuÚTÚmÚlr   Útr8   r9   r:   r;   Úframesr,   r.   r/   ÚkindiffsÚ	specifiedr0   ÚBiÚPiÚPair>   r4   s                             r5   Ún_link_pendulum_on_cartrU   p   sæ  € ðb 	ˆA‚vÜÐJÓKÐKä
×Ñ˜&Ÿ-™-¨¨A©Ó.Ó/€AÜ
×Ñ˜&Ÿ-™-¨¨A©Ó.Ó/€Aà˜ÑÜ×Ñ˜gŸn™n¨Q°©UÓ3Ó4ˆä
�
‰
�6—=‘=  Q¡Ó'Ó(€AÜ
�
‰
�6—=‘= Ó#Ó$€AÜ�:‰:�eÓ�D€A€qä
×Ñ˜#Ó€AÜ
�‰�‹€AØ‡I�Iˆa�„Oä	�‰�$‹€BØ‡J�Jˆq�!�A‘$˜Ÿ™‘*ÔØ‡J�Jˆq�!�A‘$˜Ÿ™‘*ÔÜ
�+‰+�e˜R  1¡Ó
&€CàˆS€FØˆT€FØ�€IØ�A�a‘D�5˜1‘9˜qŸs™s‘?Ð#Ð$€FØ�!‘—	‘	˜!“˜q ™tÑ#Ð$€Hà�TÑ˜]¨dÑ2Ø‰	àˆ	ä�1‹Xó 5ˆØ�[‰[˜Ÿ™ a›¨&°1°Q¸±U±8¸Q¿S¹S°/ÓBˆØ
�‰�q˜!˜A ™E™( Q§S¡S™.Ô)Ø�‰�bÔà�B‰Z×!Ñ! %§,¡,¨q°1©uÓ"5°q¸±t¸b¿d¹d±{ÓCˆØ
�‰�v˜b‘z 1 bÔ)Ø�‰�bÔä�k‰k˜$¤ Q¨¡U£Ñ+¨R°°1°q±5±Ó:ˆØ×Ñ˜Ôà�‰�r˜A˜a !™e™H˜9 q™=¨1¯3©3Ñ.Ð/Ô0à˜DÑ à×Ñ˜Q˜q™TÔ"à�AŠvØ—‘˜q 1 Q¡4 %¨!¯#©#¡+Ð.Ô/à�A˜‘EŠzØ—‘˜r 1 Q¡4¨!¯#©#¡:Ð.Õ/à—‘˜r 1 Q¡4¨!¯#©#¡:°°!°a±%±¸1¿3¹3±Ñ#>Ð?Ô@à�‰˜˜!˜a™%™Ÿ™ aÓ(¨1¨Q°©U©8Ñ3Ö4ð55ð8 �TÑÜ×Ñ˜cÓ"ˆØ�‰�r˜1˜qŸs™s™7�mÔ$Ø×Ñ˜Ôä�>‰>˜! 1¨A°hÔ?€DØ×Ñ˜ FÔ+à€Kó    )r
   FF)r
   TF)
Ú__doc__Ú
sympy.corer   r   Úsympy.physics.mechanicsÚphysicsÚ	mechanicsr   r6   rU   © rV   r5   ú<module>r]      s*   ðñõ %ß $Ð $ð 16Ø38ócôLvrV   