
    \hK                         S r SSKJr  SSKJrJr  SSKJrJrJ	r	J
r
JrJrJr  SSKJr  SSKJr  SSKJr  SSKJr  SS	KJr  SS
KJr  SSKJr  \" SSS/0S9r " S S5      rg)zJ
This module can be used to solve probelsm related to 2D parabolic arches
    )sympify)Symbolsymbols)diffsqrtcossinatanradMin)Eq)solve)	Piecewise)plot)limit)doctest_depends_on)import_modulenumpyfromlistarange)import_kwargsc                      \ rS rSrSrS r\S 5       r\S 5       r\S 5       r	\S 5       r
\S 5       r\S	 5       rSS jrS rSS jrSS jrSS jrS rSS jrSS jrSS jrS r\" SS9S 5       rS rS rS rS rSrg
)Arch   a  
This class is used to solve problems related to a three hinged arch(determinate) structure.

An arch is a curved vertical structure spanning an open space underneath it.

Arches can be used to reduce the bending moments in long-span structures.


Arches are used in structural engineering(over windows, door and even bridges)

because they can support a very large mass placed on top of them.

Example
========
>>> from sympy.physics.continuum_mechanics.arch import Arch
>>> a = Arch((0,0),(10,0),crown_x=5,crown_y=5)
>>> a.get_shape_eqn
5 - (x - 5)**2/5

>>> from sympy.physics.continuum_mechanics.arch import Arch
>>> a = Arch((0,0),(10,1),crown_x=6)
>>> a.get_shape_eqn
9/5 - (x - 6)**2/20
c           	      R   S U l         [        US   5      [        US   5      4U l        [        US   5      [        US   5      4U l        S U l        S U l        SU;   a  [        US   5      U l        SU;   a  [        US   5      U l        U R                  U l         0 U l        0 U l        U R                  U R                  S.U l	        0 U l
        SSS.U l        S U l        S U l        [        S5      S[        S	5      S[        S
5      S[        S5      S0U l        [!        5       U l        [!        5       U l        0 U l        0 U l        0 U l        0 U l        [/        S5      U l        [/        S5      U l        [/        S5      U l        [/        S5      U l        S U l        S U l        S U l        g )Nr      crown_xcrown_y)concentrateddistributedhinge)leftrightR_A_xR_A_yR_B_xR_B_yr   T)
_shape_eqnr   _left_support_right_support_crown_x_crown_yget_shape_eqn_conc_loads_distributed_loads_loads_loads_applied	_supports_member_member_forcer   _reaction_forceset_points_disc_x_points_disc_y	_moment_x	_moment_y_load_x_load_yr   _moment_x_func_moment_y_func_load_x_func_load_y_func_bending_moment_shear_force_axial_force)selfleft_supportright_supportkwargss       ^/var/www/auris/envauris/lib/python3.13/site-packages/sympy/physics/continuum_mechanics/arch.py__init__Arch.__init__&   s   &|A7Q8PQ 'a(8 9'-PQBR:ST#F9$56DM#F9$56DM,,"$'+'7'7tG^G^_ !(':! &w6'?1fWoVWY_`gYhijk!e!e'1'1%h/%h/#      c                    U R                   (       a  U R                   $ [        S5      u  pn[        SSS9nU R                  (       a  U R                  (       a  U R                  nU R                  nXAU-
  S-  -  U-   U-
  nUR                  XR                  S   X R                  S   05      n[        X5      n	U	S   X-
  S-  -  U-   nUR                  XR                  S   05      U R                  S   :w  a  [        S5      e U$ U R                  (       a  U R                  nXAU-
  S-  -  U-   U-
  nUR                  XR                  S   X R                  S   05      nUR                  XR                  S   X R                  S   05      n
[        X4XC45      n	[        U	5      S:  d  X   S:X  a  [        S	5      eX   X-
  S-  -  X   -   nX   U l        U$ [        S
5      e)z3returns the equation of the shape of arch developedzx y caF)positive   r   r   zQprovided coordinates of crown and supports are not consistent with parabolic archzYparabolic arch cannot be constructed with the provided coordinates, try providing crown_yz(please provide crown_x to construct arch)r)   r   r   r,   r-   subsr*   r   r+   
ValueErrorlenKeyError)rE   xycrN   x0y0parabola_eqneq1solutioneq2s              rI   r.   Arch.get_shape_eqnH   s    ????" A3&==T]]--BBdQY;+a/L##Q'9'9!'<a@R@RST@U$VWCc'H#A;qy025L  !$7$7$:!;<@S@STU@VV !tuu W"  ]]--BdQY;?Q.L##Q'9'9!'<a@R@RST@U$VWC##Q':':1'=qATATUVAW$XYCcYu-H8}a8;!#3 !|}}#;qy0(+=L$KDM
  EFFrL   c                     U R                   $ )zL
return the position of the applied load and angle (for concentrated loads)
)r1   rE   s    rI   	get_loadsArch.get_loadsj   s    
 {{rL   c                     U R                   $ )z
Returns the type of support
)r3   r`   s    rI   supportsArch.supportsq   s    
 ~~rL   c                     U R                   $ )z+
Returns the position of the left support.
)r*   r`   s    rI   rF   Arch.left_supportx   s    
 !!!rL   c                     U R                   $ )z,
Returns the position of the right support.
)r+   r`   s    rI   rG   Arch.right_support   s    
 """rL   c                     U R                   $ )z&
return the reaction forces generated
)r6   r`   s    rI   reaction_forceArch.reaction_force   s    
 ###rL   Nc           
      R   [        S5      n[        S5      n[        S5      n	[        U5      n[        U5      n[        U5      nX R                  ;   a  [        S5      eUS;   a  [        S5      eUS:X  Ga  Ub  XS:  a  [	        S	5      eX5US
.U R
                  U'   U R                  R                  U5        X0R                  ;   aa  U R                  U==   U[        X5      U-
  -  X[        X5      -   S-  -
  -  -  ss'   U R                  U==   U[        XX5      U-
  -  -  ss'   OQU* [        X5      U-
  -  X[        X5      -   S-  -
  -  U R                  U'   U[        XX5      U-
  -  U R                  U'   SU R                  U'   US:X  Ga  Uc  [        S5      eU R                  R                  SU05      n
X:U[        [        U5      5      -  U[!        [        U5      5      -  XFS.U R"                  U'   U R$                  R                  U5        U R                  R                  U5        X0R&                  ;   ad  U R&                  U==   U R"                  U   S   XpR"                  U   S   -
  -  -  ss'   U R(                  U==   U R"                  U   S   -  ss'   OSU R"                  U   S   XpR"                  U   S   -
  -  U R&                  U'   U R"                  U   S   U R(                  U'   X0R                  ;   aT  U R                  U==   U R"                  U   S   X-
  -  -  ss'   U R                  U==   U R"                  U   S   -  ss'   ODU R"                  U   S   * X-
  -  U R                  U'   U R"                  U   S   U R                  U'   SU R                  U'   gg)aF  
This method adds load to the Arch.

Parameters
==========

    order : Integer
        Order of the applied load.

            - For point/concentrated loads, order = -1
            - For distributed load, order = 0

    label : String or Symbol
        The label of the load
        - should not use 'A' or 'B' as it is used for supports.

    start : Float

            - For concentrated/point loads, start is the x coordinate
            - For distributed loads, start is the starting position of distributed load

    mag : Sympifyable
        Magnitude of the applied load. Must be positive

    end : Float
        Required for distributed loads

            - For concentrated/point load , end is None(may not be given)
            - For distributed loads, end is the end position of distributed load

    angle: Sympifyable
        The angle in degrees, the load vector makes with the horizontal
        in the counter-clockwise direction.

Examples
========
For applying distributed load

>>> from sympy.physics.continuum_mechanics.arch import Arch
>>> a = Arch((0,0),(10,0),crown_x=5,crown_y=5)
>>> a.apply_load(0,'C',start=3,end=5,mag=-10)

For applying point/concentrated_loads

>>> from sympy.physics.continuum_mechanics.arch import Arch
>>> a = Arch((0,0),(10,0),crown_x=5,crown_y=5)
>>> a.apply_load(-1,'C',start=2,mag=15,angle=45)

rV   rU   rX   z(load with the given label already exists)ABz1cannot use the given label, reserved for supportsr   Nzprovide end greater than start)startendf_yrP   r    z!please provide direction of force)rU   rV   f_xrr   maganglert   rr   r   )r   r   r2   rR   rT   r0   r9   addr;   r   r=   	TypeErrorr)   rQ   r   r   r	   r/   r8   r:   r<   )rE   orderlabelrp   ru   rq   rv   rV   rU   rX   heights              rI   
apply_loadArch.apply_load   s   d 3K3KD\u~cl'''GHHIPQQA:{ci?@@6;s-SD##E*##E*&u%c!j.>)?CPQJEWYZDZAZ)[[%U#sCJu,<'==#),c!j.>(?CPQJEWYZDZAZ([u%&)3s:e+;&<U#)6D&B;} CDD__))3u+6F+0CCPUJDW`cdghklqhrds`s{~  'ODU###E*##E*&u%)9)9%)@)GK[K[\aKbcfKgIg)hh%U#t'7'7'>u'EE#(,(8(8(?(FJZJZ[`JabeJfHf(gu%&*&6&6u&=e&DU#&u%)9)9%)@)G)RR%U#t'7'7'>u'EE#)-)9)9%)@)G(G(Ru%&*&6&6u&=e&DU#)7D&1 rL   c           
         [        S5      n[        S5      n[        S5      nXR                  ;   a  U R                  R                  U5        U R                  U   S   nU R                  U   S   nU R                  U   S   nU R                  R                  U5        U R                  U==   U[        X65      U-
  -  -  ss'   U R                  U==   U[        X65      U-
  -  XE[        X65      -   S-  -
  -  -  ss'   U R                  R                  U5      n[        SU S	U 35        gXR                  ;   GaF  U R                  R                  U5        U R                  U   S   nU R                  R                  U5        U R                  R                  U5        U R                  U==   U R                  U   S   XE-
  -  -  ss'   U R                  U==   U R                  U   S
   X R                  U   S   -
  -  -  ss'   U R                  U==   U R                  U   S
   -  ss'   U R                  U==   U R                  U   S   -  ss'   U R                  R                  U5      n[        SU S	U 35        g[        S5      e)a}  
This methods removes the load applied to the arch

Parameters
==========

label : String or Symbol
    The label of the applied load

Examples
========

>>> from sympy.physics.continuum_mechanics.arch import Arch
>>> a = Arch((0,0),(10,0),crown_x=5,crown_y=5)
>>> a.apply_load(0,'C',start=3,end=5,mag=-10)
>>> a.remove_load('C')
removed load C: {'start': 3, 'end': 5, 'f_y': -10}
rV   rU   rX   rp   rq   rr   rP   zremoved load : rt   zlabel not foundN)r   r0   r2   popr9   remover=   r   r;   printr/   r8   r:   r<   rR   )	rE   rz   rV   rU   rX   rp   rq   ru   vals	            rI   remove_loadArch.remove_load   s_   & 3K3KD\+++##E*++E27;E))%07C**51%8C&&u-LL3A
5(8#99NN5!S#a*U*:%;RA
ASUV@V=V%WW!))--e4CM%3%01&&&##E*$$U+C0E&&u-&&u-NN5!T%5%5e%<U%CRX%NN!NN5!T%5%5e%<U%CQGWGWX]G^_bGcEc%dd!LL4#3#3E#:5#AALL4#3#3E#:5#AA""&&u-CM%3%01 .//rL   c                 |    Ub  US   US   4U l         Ub  US   US   4U l        SU l        U R                  U l        g)a  
Change position of supports.
If not provided , defaults to the old value.
Parameters
==========

    left_support: tuple (x, y)
        x: float
            x-coordinate value of the left_support

        y: float
            y-coordinate value of the left_support

    right_support: tuple (x, y)
        x: float
            x-coordinate value of the right_support

        y: float
            y-coordinate value of the right_support
Nr   r   )r*   r+   r)   r.   )rE   rF   rG   s      rI   change_support_positionArch.change_support_position+  sP    * #".q/,q/!BD$#0#3M!4D"ED,,rL   c                 L    Xl         X l        SU l        U R                  U l        g)a;  
Change the position of the crown/hinge of the arch

Parameters
==========

    crown_x: Float
        The x coordinate of the position of the hinge
        - if not provided, defaults to old value

    crown_y: Float
        The y coordinate of the position of the hinge
        - if not provided defaults to None
N)r,   r-   r)   r.   )rE   r   r   s      rI   change_crown_positionArch.change_crown_positionI  s"      ,,rL   c                     SS/nU(       a  X;  a  [        S5      eXR                  S'   U(       a  X#;  a  [        S5      eX R                  S'   gg)ab  
Add the type for support at each end.
Can use roller or hinge support at each end.

Parameters
==========

    left_support, right_support : string
        Type of support at respective end

            - For roller support , left_support/right_support = "roller"
            - For hinged support, left_support/right_support = "hinge"
            - defaults to hinge if value not provided

Examples
========

For applying roller support at right end

>>> from sympy.physics.continuum_mechanics.arch import Arch
>>> a = Arch((0,0),(10,0),crown_x=5,crown_y=5)
>>> a.change_support_type(right_support="roller")

rollerr!   z%supports must only be roller or hinger"   r#   N)rR   r3   )rE   rF   rG   support_typess       rI   change_support_typeArch.change_support_type]  sU    2 "'*0 !HII%1NN6"1 !HII&3NN7#	 rL   c                    XR                   :  d*  U[        U R                  S   U R                  S   5      :  a?  [	        S[        U R                  S   U R                  S   5       SU R                    35      e[        S5      n[        U R                  U5      R                  X R                  S-   5      S-  n[        XR                   -
  U-  5      nU R                  U-   nU R                  U-
  nXVU4U l        g)z
This method adds a member/rod at a particular height y.
A rod is used for stability of the structure in case of a roller support.
r   z&position of support must be between y=z and y=rU   rP   N)r-   minr*   r+   rR   r   r   r)   rQ   r,   r   r4   )rE   rV   rU   rN   x_diffx1x2s          rI   
add_memberArch.add_member  s    
 ]]?aD$6$6q$9D<O<OPQ<R SSEc$J\J\]^J_bfbubuvwbxFyEz  {B  CG  CP  CP  BQ  R  S  S3K#((==?;A=q==(!+,]]V#]]V#ayrL   c                     Uc  U R                   $ [        S5      nSU;   a  US   n[        U R                   X1US9$ U R                   R                  X15      $ )zT
return the shear at some x-coordinates
if no x value provided, returns the formula
rU   dirr   )rC   r   r   rQ   rE   posrH   rU   r   s        rI   shear_force_atArch.shear_force_at  Z    
 ;$$$sAUmT..q==$$))!00rL   c                     Uc  U R                   $ [        S5      nSU;   a  US   n[        U R                   X1US9$ U R                   R                  X15      $ )z]
return the bending moment at some x-coordinates
if no x value provided, returns the formula
rX   r   r   )rB   r   r   rQ   )rE   r   rH   rX   r   s        rI   bending_moment_atArch.bending_moment_at  sZ    
 ;'''BUmT11"SAA'',,R44rL   c                     Uc  U R                   $ [        S5      nSU;   a  US   n[        U R                   X1US9$ U R                   R                  X15      $ )zj
return the axial/normal force generated at some x-coordinate
if no x value provided, returns the formula
rU   r   r   )rD   r   r   rQ   r   s        rI   axial_force_atArch.axial_force_at  r   rL   c                    [        S5      n[        S5      n[        S5      n[        U R                  5      n[        U R                  5      n[	        S5      U l        [	        S5      U l        [	        S5      U l        [	        S5      U l        SnSnSnSn	U He  n
X*:  nXR                  U
   -  nX`R                  U
   -  n[	        X4U R                  S45      U l        [	        Xk4U R
                  S45      U l        Mg     U He  n
X*:  nXpR                  U
   -  nXR                  U
   -  n	[	        X4U R                  S45      U l        [	        X{4U R                  S45      U l        Mg     U R                  R                  X R                  S   5      R                  X0R                  S   5      U R
                  R                  X R                  S   5      R                  XR                  S   5      -   nU R                  R                  X R                   5      R                  X0R                   5      U R
                  R                  X R                   5      R                  XR"                  5      -   nU R                  R                  X R                  S   5      R                  X0R                   5      U R                  R                  X R                   5      R                  X0R                   5      -
  U R
                  R                  X R                  S   5      R                  XR"                  5      -   U R
                  R                  X R                   5      R                  XR"                  5      -
  nU R                  R                  X R                  S   5      nU R                  R                  X R                  S   5      nU R$                  S   S	:X  d  U R$                  S
   S	:X  a  U R&                  (       d  [)        S5        g[+        S5      u  nnnnnU R$                  S   S	:X  Ga  U R$                  S
   S	:X  Ga  U R&                  S   [-        U R                  S   U R                  S   5      :  a  US:w  a  [/        S5      e[1        US5      n[1        US5      n[1        UU-   U-   S5      n[1        UU R                  S   U R                  S   -
  -  UU R                  S   U R                  S   -
  -  -
  U-   S5      n[1        UUU R                  S   U R                   -
  -  -   UU R&                  S   U R"                  -
  -  -   S5      n[3        UUUUU4UUUUU45      nGOU R&                  S   U R                  S   :  a  [1        US5      n[1        US5      n[1        UU-   U-   S5      n[1        UU R                  S   U R                  S   -
  -  UU R&                  S   U R                  S   -
  -  -
  U-   S5      n[1        UU-   S5      n[3        UUUUU4UUUUU45      nGOU R&                  S   U R                  S   :  a  [1        US5      n[1        US5      n[1        UU-   U-   S5      n[1        UU R                  S   U R                  S   -
  -  UU R&                  S   U R                  S   -
  -  -   U-   S5      n[1        UU-
  S5      n[3        UUUUU4UUUUU45      nGO,U R$                  S   S	:X  GaM  U R&                  S   [-        U R                  S   U R                  S   5      :  a  [1        US5      n[1        UU-   S5      n[1        UU-   U-   S5      n[1        UU R                  S   U R                  S   -
  -  UU R                  S   U R                  S   -
  -  -
  U-   S5      n[1        UUU R                  S   U R                   -
  -  -   UU R&                  S   U R"                  -
  -  -
  S5      n[3        UUUUU4UUUUU45      nGOU R&                  S   U R                  S   :  Ga	  [1        US5      n[1        UU-   U-   S5      n[1        UU-   U-   S5      n[1        UU R                  S   U R                  S   -
  -  UU R                  S   U R                  S   -
  -  -
  UU R&                  S   U R                  S   -
  -  -
  U-   S5      n[1        UUU R                  S   U R                   -
  -  -   UU R&                  S   U R"                  -
  -  -
  S5      n[3        UUUUU4UUUUU45      nGOU R&                  S   U R                  S   :  a  [1        US5      n[1        UU-
  U-   S5      n[1        UU-   U-   S5      n[1        UUU R                  S   U R                   -
  -  -   S5      n[1        UUU R                  S   U R                  S   -
  -  -   UU R                  S   U R                  S   -
  -  -
  UU R&                  S   U R                  S   -
  -  -   S5      n[3        UUUUU4UUUUU45      nGOU R$                  S
   S	:X  Ga  U R&                  S   [-        U R                  S   U R                  S   5      :  a  [1        US5      n[1        UU-   S5      n[1        UU-   U-   S5      n[1        UUU R                  S   U R                   -
  -  -   UU R&                  S   U R"                  -
  -  -   S5      n[1        UUU R                  S   U R                  S   -
  -  -   S5      n[3        UUUUU4UUUUU45      nGOU R&                  S   U R                  S   :  a  [1        US5      n[1        UU-   U-   S5      n[1        UU-   U-   S5      n[1        UUU R                  S   U R                   -
  -  -   S5      n[1        UUU R&                  S   U R                  S   -
  -  -
  UU R                  S   U R                  S   -
  -  -   S5      n[3        UUUUU4UUUUU45      nGOU R&                  S   U R                  S   :  a  [1        US5      n[1        UU-
  U-   S5      n[1        UU-   U-   S5      n[1        UUU R                  S   U R                   -
  -  -   UU R&                  S   U R"                  -
  -  -   S5      n[1        UUU R&                  S   U R                  S   -
  -  -   UU R                  S   U R                  S   -
  -  -   5      n[3        UUUUU4UUUUU45      nO[1        UU-   U-   S5      n[1        UU-   U-   S5      n[1        UU R                  S   U R                  S   -
  -  UU R                  S   U R                  S   -
  -  -
  U-   S5      n[1        UUU R                  S   U R                   -
  -  -   UU R                  S   U R"                  -
  -  -
  S5      n[3        UUUU4UUUU45      nU R4                   H  nWU   U R4                  U'   M     U R
                  R                  X#5      U R                  R                  X#5      -   WU   X0R                  S   -
  -  -
  UU   U R6                  R                  X#05      U R                  S   -
  -  -   * U l        [;        [=        U R6                  U5      5      nU R                  UU   -   nU R                  UU   -   nU[?        U5      -  U[A        U5      -  -   n U* [A        U5      -  U[?        U5      -  -   n!U U l!        U!U l"        g)a  
This method solves for the reaction forces generated at the supports,

and bending moment and generated in the arch and tension produced in the member if used.

Examples
========

>>> from sympy.physics.continuum_mechanics.arch import Arch
>>> a = Arch((0,0),(10,0),crown_x=5,crown_y=5)
>>> a.apply_load(0,'C',start=3,end=5,mag=-10)
>>> a.solve()
>>> a.reaction_force
{R_A_x: 8, R_A_y: 12, R_B_x: -8, R_B_y: 8}

>>> from sympy import Symbol
>>> t = Symbol('t')
>>> from sympy.physics.continuum_mechanics.arch import Arch
>>> a = Arch((0,0),(16,0),crown_x=8,crown_y=5)
>>> a.apply_load(0,'C',start=3,end=5,mag=t)
>>> a.solve()
>>> a.reaction_force
{R_A_x: -4*t/5, R_A_y: -3*t/2, R_B_x: 4*t/5, R_B_y: -t/2}

>>> a.bending_moment_at(4)
-5*t/2
rV   rU   rX   r(   r   Tr   r"   r   r#   z5member must be added if any of the supports is rollerNzR_A_x R_A_y R_B_x R_B_y TrP   zDnet force in x direction not possible under the specified conditions)#r   sortedr8   r9   r   r>   r?   r@   rA   r<   r:   r;   r=   rQ   r+   r*   r,   r-   r3   r4   r   r   maxrR   r   r   r6   r)   rB   r
   r   r   r	   rD   rC   )"rE   rV   rU   rX   discontinuity_points_xdiscontinuity_points_yaccumulated_x_momentaccumulated_y_momentaccumulated_x_loadaccumulated_y_loadpointcondmoment_Amoment_hinge_leftmoment_hinge_rightnet_xnet_yr$   r%   r&   r'   Tr[   r]   eq3eq4eq5r\   symbrv   fxfyaxial_forceshear_forces"                                     rI   r   
Arch.solve  s   6 3K3KD\!'(;(;!<!'(;(;!<'1'1%h/%h/  +EJD,,u"55 NN5$99  )+=*CTEVEVW[D\ ]D"+-A,GI\I\]aHb"cD , ,EJD NN5$99 ,,u"55 )+=*CTEVEVW[D\ ]D"+-A,GI\I\]aHb"cD , &&++A.A.A!.DEJJ2N`N`abNcd&&++A.A.A!.DEJJ1M_M_`aMbcd !//44Q}}EJJ2mm\ //44Q}}EJJ1]][\ "0055a8K8KA8NOTTUWXeXef!0055aFKKB}}]^!0055a8K8KA8NOTTUVWdWdef "0055aFKKAmm\]
 !!&&q)<)<Q)?@!!&&q)<)<Q)?@NN6"H,w0G0Q[_[g[gIJ(/0K(L%ueUA>>&!X-$..2IX2U||AD$6$6q$9$:M:Ma:P QQ!8$%kll UA,CUA,CUU]U215CUD$7$7$:4;M;Ma;P$PQ"D$7$7$:4;M;Ma;P$PQRRZ[[\^C /%9L9LQ9OPTP]P]9]2^^Q =>??@BC$c#c#c%:E%eTU;VWHa$"4"4Q"77ll.q1 3 3A 6t7I7I!7L LMDLLOD,>,>q,AABCCKLLMO5m #c#c#!6eE%PQ7RSa$"5"5a"88ll.q1 3 3A 6t7I7I!7L LMDLLOD,>,>q,AABCCKLLMO5m #c#c#!6eE%PQ7RS^^F#x/||AD$6$6q$94;N;Nq;Q RRluQ'.q1 3 3A 6t7I7I!7L LM 3 3A 6t7I7I!7L LMNNVWWXZ*UD4F4Fq4I$--4W-XXDLLODMM9:;;<> #c#c#!6eE%PQ7RSa$"4"4Q"77l5+.q1 3 3A 6t7I7I!7L LM 3 3A 6t7I7I!7L LMNDLLOD,>,>q,AABCCKLLMO *UD4F4Fq4I$--4W-XXDLLODMM9:;;<> #c#c#!6eE%PQ7RSa$"5"5a"88qk5+.q1*5$2D2DQ2G2U+VVWXY%)<)<Q)?@R@RST@U)U"VV 3 3A 6t7I7I!7L LMNDLLOD,>,>q,AABCCDF !#c#c#!6eE%PQ7RS^^G$0||AD$6$6q$94;N;Nq;Q RRqkuQ'uU*1-+E43F3Fq3I$--3W,XXDLLODMM9:;;<>%)<)<Q)?@R@RST@U)U"VVWXY #c#c#!6eE%PQ7RSa$"4"4Q"77qkqq)uU*1-+E43F3Fq3I$--3W,XXYZ[!T\\!_T5G5G5J%J"KK 3 3A 6t7I7I!7L LMNNOQ #c#c#!6eE%PQ7RSa$"5"5a"88qkqq)uU*1-+E43F3Fq3I$--3W,XXDLLODMM9:;;<>!T\\!_T5G5G5J%J"KK 3 3A 6t7I7I!7L LMN O #c#c#!6eE%PQ7RSUU]U*1-CUU]U*1-CUD//243E3Ea3HHID//243E3Ea3HHIJJRSSTVC'%1D1DQ1G1U*VVD//24==@ABBCECc#c#.eE%/HIH((D)1$D  & ) #'"5"5":":1"@4CVCVC[C[\]Ca"a"*5/26H6H6K3K"L#M"*5/4??3G3G3OPTPbPbcdPe3e"f#g  h d4??1-.//UmbUm3c#e*nr#e*}4''rL   )r   )modulesc                 .   [        S5      n/ nU R                  5       n/ nU R                  5       nX%-  nU R                  S   nU R                  S   n[        U R                  S   U R                  S   5      nU R                  n	[        US-  US-  -
  S-   U	S-  US-  -
  S-   5      n
U R                  5       nU R                  5       nXK-  nU R                  b  U R                  S   U R                  S   :  a;  UR                  U R                  S   SU
-  -   /U R                  S   //SS	S
SS.5        U R                  S   U R                  S   :  a;  UR                  U R                  S   SU
-  -
  /U R                  S   //SS	S
SS.5        UR                  U R                  /U R                  SU
-  -
  //SSS
SS.5        XS-  US-  -
  S-   :X  aa  [        U R                  SU
-  -
  U R                  XR                  S   U R                  S   4USUUUSU
-  -
  US-  4USU
-  -
  US-  4SSS9nU$ [        U R                  SU
-  -
  U R                  XR                  S   U R                  S   4USUUUSU
-  -
  U	S-  4USU
-  -
  U	S-  4SSS9nU$ )a  
This method returns a plot object containing the diagram of the specified arch along with the supports
and forces applied to the structure.

Examples
========

>>> from sympy import Symbol
>>> t = Symbol('t')
>>> from sympy.physics.continuum_mechanics.arch import Arch
>>> a = Arch((0,0),(40,0),crown_x=20,crown_y=12)
>>> a.apply_load(-1,'C',8,150,angle=270)
>>> a.apply_load(0,'D',start=20,end=40,mag=-4)
>>> a.apply_load(-1,'E',10,t,angle=300)
>>> p = a.draw()
>>> p # doctest: +ELLIPSIS
Plot object containing:
[0]: cartesian line: 11.325 - 3*(x - 20)**2/100 for x over (0.0, 40.0)
[1]: cartesian line: 12 - 3*(x - 20)**2/100 for x over (0.0, 40.0)
...
>>> p.show()

rU   r   r   皙?皙?rP   {Gzt?o   whitenoneargsmarker
markersizecolormarkerfacecolor   Q?F皙?brown)markersshowannotations
rectanglesxlimylimaxis
line_color)r   _draw_loads_draw_supportsr+   r*   r   r-   r   _draw_rectangles_draw_fillerr4   appendr,   r   r)   )rE   rU   r   r   r   rd   xmaxxminyminymaxlimfiller	sing_plots                rI   draw	Arch.draw  s   2 3K&&(
&&(""1%!!!$4%%a()<)<Q)?@}}$s(48#A%tCxS'8':;**,
""$
<<#||A 3 3A 66!%as!: ;T\\!_<MN!$&'!(*0 ||A 2 21 55!%as!: ;T\\!_<MN!$&'!(*0 	]]OT]]59%<$=>$
 	 Sc!!##T__U3Y6!__!3!3A!68K8KA8NO%,"')4*4#'S=$s(";#'S=$s(";"'(/
1I2  T__U3Y6!__!3!3A!68K8KA8NO%,"')4*4#'S=$s(";#'S=$s(";"'(/
1I rL   c                 @   / nU R                   S   nU R                  S   n[        U R                  S   U R                   S   5      nU R                  n[	        SU-  SU-  -
  5      [	        SU-  SU-  -
  5      :  a  SU-  SU-  -
  nOSU-  SU-  -
  nU R
                  S   S:X  a<  UR                  U R                  S   /U R                  S   SU-  -
  //SS	S
SS.5        O;UR                  U R                  S   /U R                  S   SU-  -
  //SSS
SS.5        U R
                  S   S:X  a<  UR                  U R                   S   /U R                   S   SU-  -
  //SS	S
SS.5        O;UR                  U R                   S   /U R                   S   SU-  -
  //SSS
SS.5        UR                  U R                   S   /U R                   S   SU-  -
  //SSS
SS.5        UR                  U R                  S   /U R                  S   SU-  -
  //SSS
SS.5        U$ )Nr   r   r   r   r"   r   g{Gz?r      blackr   r   gy&1|?      r#   g;On?_)r+   r*   r   r-   absr3   r   )rE   support_markersr   r   r   r   max_diffs          rI   r   Arch._draw_supports  s   ""1%!!!$4%%a()<)<Q)?@}}s4xD !#c$hs4x&7"884xD(H4xD(H>>&!8+"" ++A./++A.tH}<= !!##&,	 "" ++A./++A.uX~=> !##&,	 >>'"H,"" ,,Q/0,,Q/X=> !!##&,	 "" ,,Q/0,,Q/h>? !##&,	 	 ((+,((+E(N:; "(		
 	 ''*+''*5>9: "(		
 rL   c                 
   / nU R                   S   nU R                  S   n[        U R                  S   U R                   S   5      nU R                  n[	        SU-  SU-  -
  5      [	        SU-  SU-  -
  5      :  a  SU-  SU-  -
  nOSU-  SU-  -
  nU R
                  Gbm  U R
                  S   [        U R                  S   U R                   S   5      :  aZ  UR                  U R
                  S   U R
                  S   SU-  -
  4U R
                  S   U R
                  S   -
  SU-  SSS	.5        OU R
                  S   U R                  S   :  aZ  UR                  U R
                  S   U R
                  S   SU-  -
  4U R                   S   U R
                  S   -
  SU-  SSS	.5        ObUR                  U R
                  S   U R
                  S   SU-  -
  4[	        U R                  S   U R
                  S   -
  5      SU-  S
SS	.5        U R                  (       ac  U R                   HS  nU R                  U   S   nU R                  U   S   n	UR                  XR                  US-  -   4X-
  US-  SS.5        MU     U$ )Nr   r   r   r   rP   r   g{Gz?r   )xywidthr{   rv   r      rp   rq   333333?oranger   r   r{   r   )	r+   r*   r   r-   r   r4   r   r   r0   )
rE   memberr   r   r   r   r   loadsrp   rq   s
             rI   r   Arch._draw_rectanglesR  s   ""1%!!!$4%%a()<)<Q)?@}}s4xD !#c$hs4x&7"884xD(H4xD(H<<#||AT%7%7%:4;N;Nq;Q!RR"ll1odll1oeHn.LM $QQ ?"&x-!" ' a$"4"4Q"77"ll1odll1oeHn.LM $ 3 3A 6t||A F"&x-!" ' "ll1odll1oeHn.LM #D$6$6q$9$,,q/$I J"&x-!$ ' ""00//6w?--e4U;#MM(4-$?@"%)"*4-!)	 1 rL   c                 P   / nU R                   S   nU R                  S   n[        U R                  S   U R                   S   5      nU R                  n[	        SU-  SU-  -
  5      [	        SU-  SU-  -
  5      :  a  SU-  SU-  -
  nOSU-  SU-  -
  nU R
                   H  nU R
                  U   S   nU R
                  U   S   n	U R
                  U   S   n
U R
                  U   S   nUR                  S	U[        [        U
5      5      U-  S
-  -   U	[        [        U
5      5      U-  S
-  -   4X4SSSSSSSS.S.5        UR                  U SU S3SSU[        [        U
5      5      U-  S-  -   U	[        [        U
5      5      U-  S-  -   4S.5        M     U R                   GH{  nU R                  U   S   nU R                  U   S   nU R                  U   S   n[        R                  XX-
  US-  -  5      n[        R                  X5      nU H  nUS:  a@  UR                  S	XR                  US-  -   4XR                  US-  -   4SSSSSS.S.5        MI  UR                  S	XR                  US-  -   4XR                  US-  -   4SSSSSS.S.5        M     US:  a?  UR                  U S[	        U5       S3SSX-   S -  U R                  US!-  -   4S.5        GM?  UR                  U S[	        U5       S3SSX-   S -  U R                  US"-  -   4S.5        GM~     U$ )#Nr   r   r   r   rU   rV   rv   ru    g{Gz?
   boldg      ?r   blue)r   
headlength	headwidth	facecolor	edgecolor)textr   xytextfontsize
fontweight
arrowpropsr   z NgQ?)r  r  r	  r   rp   rq   rr   g      ?r   r   r   )r  r   r  r
  g?z N/mrP   gffffff?g      ?)r+   r*   r   r-   r   r/   r   r   r   r	   r0   r   r   )rE   load_annotationsr   r   r   r   r   loadrU   rV   rv   ru   rp   rq   x_pointsr   s                   rI   r   Arch._draw_loads  s   ""1%!!!$4%%a()<)<Q)?@}}s4xD !#c$hs4x&7"884xD(H4xD(H$$D  &s+A  &s+A$$T*73E""4(/C###c%j/(2477#c%j/(2477  U!"(*-A1Z`ms!t
 ##"V2cU"-!"(SU_X5d::1SU_X=UVZ=Z;Z[	% %6 ++D++D1':E))$/6C))$/6C||Esy8D=.IJH||H1H!q5$++#%"'htm(C!D',]]8D=-H&I25ASTbjw  *A	 %++#%"'hsl(B!C',]]8D=-H&I25ASTbjw  *A	 "& 1u ''"&r#c(48#%&,$y!mDMM(5.,HI	 !''"&r#c(48#%&,$y!mDMM(5.,HI	G ,V  rL   c                    [        S5      n/ nU R                  S   nU R                  S   n[        U R                  S   U R                  S   5      nU R                  n[        SU-  SU-  -
  5      [        SU-  SU-  -
  5      :  a  SU-  SU-  -
  nOSU-  SU-  -
  n[        R                  U R                  S   U R                  S   U R                  S   U R                  S   -
  Xw-  -  5      nU H^  n	UR                  XR                  R                  X5      US-  -
  4U R                  S   U R                  S   -
  Xw-  -  US-  SS.5        M`     U$ )	NrU   r   r   r   r   r   r   r   )r   r+   r*   r   r-   r   r   r   r   r)   rQ   )
rE   rU   r   r   r   r   r   r   r  r   s
             rI   r   Arch._draw_filler  sz   3K""1%!!!$4%%a()<)<Q)?@}}s4xD !#c$hs4x&7"884xD(H4xD(H<< 2 21 5d6I6I!6LdNaNabcNdeiewewxyezNz  ~F  ~O  NP  QEMM#OO$8$8$A(5.$PQ"&"5"5a"89K9KA9N"NQYQb!c"*5.!(	  rL   )rD   rB   r/   r,   r-   r0   r*   r<   r@   r=   rA   r1   r2   r4   r5   r:   r>   r;   r?   r8   r9   r6   r+   r)   rC   r3   )NN)N)__name__
__module____qualname____firstlineno____doc__rJ   propertyr.   ra   rd   rF   rG   rk   r|   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   __static_attributes__ rL   rI   r   r      s    (!D  B     " " # # $ $h8V10f-<-($4L!151J(X 
+g ,gT]~?BS jrL   r   N)r  sympy.core.sympifyr   sympy.core.symbolr   r   sympyr   r   r   r	   r
   r   r   sympy.core.relationalr   sympy.solvers.solversr   sympy.functionsr   sympy.plottingr   r   sympy.utilities.decoratorr   sympy.external.importtoolsr   r   r   r  rL   rI   <module>r"     sO    ' , 7 7 7 $ ' %   8 4gj(-DEp prL   