§
    OŠtj?  ã                   ó<   — d Z ddlmZ ddlmc mZ 	 	 d	d„Zd
d„Z	dS )zOThis module contains some sample symbolic models used for testing and
examples.é    )ÚbackendNé   Fc                 ót  — t          j        d                     | ¦  «        ¦  «        }t          j        d                     | ¦  «        ¦  «        }t          j        d                     | ¦  «        ¦  «        }t          j        d¦  «        }t          j        d                     | ¦  «        ¦  «        }t          j        d                     | ¦  «        ¦  «        }t          j        d                     | ¦  «        ¦  «        }	t          j        d¦  «        }
t          j        d	¦  «        }|                     |
d
¦  «         |g}g }g }g }t          | ¦  «        D �]³}|d          	                    d                     |¦  «        ||         |
j
        z  ¦  «        }|                     |
|d                              |
¦  «        ||         |
j
        z  z   ¦  «         |                     |¦  «         t          j        d                     |¦  «        |||         ¦  «        }|                     ||         ||                              ¦   «         z
  ¦  «         ||          ||         z  ||         ||         z  z
  }	 |||dz            ||dz            z  ||dz            ||dz            z  z   z  }n# t          $ r Y nw xY w|r|||         |z  z  }|r||	|         z  }|                     |||
j
        z  f¦  «         |                     |¦  «         �Œµt          j        |
|||¬¦  «        }|                     ||¦  «         |S )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{}r   ©Ú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/html/CA-Chatbot/venv/lib/python3.11/site-packages/sympy/physics/mechanics/models.pyÚmulti_mass_spring_damperr6   
   s%  € õ\ Œ:�f—m’m AÑ&Ô&Ñ'Ô'€DÝ”
˜6Ÿ=š=¨Ñ+Ô+Ñ,Ô,€IÝŒj˜Ÿš qÑ)Ô)Ñ*Ô*€Gå"$¤*¨S¡/¤/ÐåÔ# F§M¢M°!Ñ$4Ô$4Ñ5Ô5€KÝÔ˜vŸ}š}¨QÑ/Ô/Ñ0Ô0€FÝÔ" 6§=¢=°Ñ#3Ô#3Ñ4Ô4€JåÔ Ñ$Ô$€GÝŒX�hÑÔ€FØ
‡N‚N�7˜AÑÔÐàˆX€FØÐØ€IØ€Få�1‰XŒXð  ñ  ˆà˜”×%Ò% j×&7Ò&7¸Ñ&:Ô&:Ø&1°!¤n°w´yÑ&@ñBô Bˆà�Š�w  r¤
§¢¨wÑ 7Ô 7Ø˜a”y 7¤9Ñ,ñ!-ñ 	.ô 	.ð 	.à�Š�fÑÔÐå”˜I×,Ò,¨QÑ/Ô/°¸¸a¼ÑAÔAˆà×"Ò" 6¨!¤9¨{¸1¬~×/BÒ/BÑ/DÔ/DÑ#DÑEÔEÐEà! !œ�} {°1¤~Ñ5Ø˜q”z F¨1¤IÑ-ñ.ˆð	Ø˜I a¨!¡eÔ,¨{¸1¸q¹5Ô/AÑAØ# A¨¡EœN¨V°A¸±E¬]Ñ:ñ;ñ <ˆKˆKøåð 	ð 	ð 	ØˆDð	øøøð ð 	AØ˜4 œ7Ð%@Ñ@Ñ@ˆKà ð 	)Ø˜: aœ=Ñ(ˆKà�Š�v˜{¨W¬YÑ6Ð7Ñ8Ô8Ð8à×Ò˜ÑÔÐÑåŒ>˜'¨¸FØ!4ð6ñ 6ô 6€Dà×Ò˜ FÑ+Ô+Ð+à€Ks   É42J'Ê'
J4Ê3J4Tc                 óÆ	  — | dk    rt          d¦  «        ‚t          j        d                     | dz   ¦  «        ¦  «        }t          j        d                     | dz   ¦  «        ¦  «        }|du r*t          j        d                     | dz   ¦  «        ¦  «        }t	          j        d                     | dz   ¦  «        ¦  «        }t	          j        d	                     | ¦  «        ¦  «        }t	          j        d
¦  «        \  }}	t          j        d¦  «        }
t          j        d¦  «        }|                     |
d¦  «         t          j        d¦  «        }| 	                    ||d         |
j
        z  ¦  «         |                     |
|d         |
j
        z  ¦  «         t          j        d||d         ¦  «        }|
g}|g}|g}||d          |z  |
j        z  fg}|d                              |	¦  «        |d         z
  g}|du s|du rg }nd}t          | ¦  «        D �]N}|
                     d                     |¦  «        d||dz            |
j        g¦  «        }|                     |
||dz            |
j        z  ¦  «         |                     |¦  «         |d                              d                     |dz   ¦  «        ||         |j        z  ¦  «        }|                     |d         |
|¦  «         |                     |¦  «         t          j        dt+          |dz   ¦  «        z   |||dz            ¦  «        }|                     |¦  «         |                     |||dz             |z  |
j        z  f¦  «         |du r¯|                     ||         ¦  «         |dk    r&|                     |
||          |
j        z  f¦  «         || dz
  k    r&|                     |||         |
j        z  f¦  «         n9|                     |||         |
j        z  ||dz            |
j        z  z
  f¦  «         |                     ||dz                                 |	¦  «        ||dz            z
  ¦  «         �ŒP|du rHt          j        d¦  «        }|                     |||
j
        z  f¦  «         |                     |¦  «         t          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€vÝÐJÑKÔKÐKå
Ô˜&Ÿ-š-¨¨A©Ñ.Ô.Ñ/Ô/€AÝ
Ô˜&Ÿ-š-¨¨A©Ñ.Ô.Ñ/Ô/€Aà˜ÐÐÝÔ˜gŸnšn¨Q°©UÑ3Ô3Ñ4Ô4ˆå
Œ
�6—=’=  Q¡Ñ'Ô'Ñ(Ô(€AÝ
Œ
�6—=’= Ñ#Ô#Ñ$Ô$€AÝŒ:�eÑÔ�D€A€qå
Ô˜#ÑÔ€AÝ
Œ�‰Œ€AØ‡I‚Iˆa��O„O€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‘?Ð#Ð$€FØ�!”—	’	˜!‘”˜q œtÑ#Ð$€Hà�TÐÐ˜]¨dÐ2Ð2Øˆ	ˆ	àˆ	å�1‰XŒXð 5ñ 5ˆØ�[Š[˜Ÿš a™œ¨&°1°Q¸±U´8¸Q¼S°/ÑBÔBˆØ
�Š�q˜!˜A ™Eœ( Q¤S™.Ñ)Ô)Ð)Ø�Š�bÑÔÐà�BŒZ×!Ò! %§,¢,¨q°1©uÑ"5Ô"5°q¸´t¸b¼d±{ÑCÔCˆØ
�Š�v˜b”z 1 bÑ)Ô)Ð)Ø�Š�bÑÔÐåŒk˜$¥ Q¨¡U¡¤Ñ+¨R°°1°q±5´Ñ:Ô:ˆØ×Ò˜ÑÔÐà�Š�r˜A˜a !™eœH˜9 q™=¨1¬3Ñ.Ð/Ñ0Ô0Ð0à˜DÐ Ð à×Ò˜Q˜qœTÑ"Ô"Ð"à�AŠvˆvØ—’˜q 1 Q¤4 %¨!¬#¡+Ð.Ñ/Ô/Ð/à�A˜‘EŠzˆzØ—’˜r 1 Q¤4¨!¬#¡:Ð.Ñ/Ô/Ð/Ð/à—’˜r 1 Q¤4¨!¬#¡:°°!°a±%´¸1¼3±Ñ#>Ð?Ñ@Ô@Ð@à�Š˜˜!˜a™%œŸš aÑ(Ô(¨1¨Q°©U¬8Ñ3Ñ4Ô4Ð4Ñ4à�TÐÐÝÔ˜cÑ"Ô"ˆØ�Š�r˜1˜qœ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ð cð cð cðLvð vð vð vð vð vrV   