| Server IP : 93.86.61.54 / Your IP : 216.73.216.206 Web Server : Apache/2.4.62 (Ubuntu) System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64 User : www-data ( 33) PHP Version : 8.4.22 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/lib/python3/dist-packages/sympy/integrals/__pycache__/ |
Upload File : |
o
�8Va � @ sH d dl mZ d dlmZmZ d dlmZ d dlmZ dd� Z dd� Z
d S )
� )�Mul)�
DiracDelta� Heaviside)�default_sort_key)�Sc C s6 g }d}| � � \}}t|td�}|�|� |D ]1}|jr2t|jt�r2|�|� |j|j
d �� |j}|du rCt|t�rC|�|�rC|}q|�|� q|s�g }|D ]1}t|t�ra|�|jd|d�� qO|jr{t|jt�r{|�|� |jjd|d�|j
�� qO|�|� qO||kr�t
|� �� }d|fS d}d|fS |t
|� fS )a� change_mul(node, x)
Rearranges the operands of a product, bringing to front any simple
DiracDelta expression.
Explanation
===========
If no simple DiracDelta expression was found, then all the DiracDelta
expressions are simplified (using DiracDelta.expand(diracdelta=True, wrt=x)).
Return: (dirac, new node)
Where:
o dirac is either a simple DiracDelta expression or None (if no simple
expression was found);
o new node is either a simplified DiracDelta expressions or None (if it
could not be simplified).
Examples
========
>>> from sympy import DiracDelta, cos
>>> from sympy.integrals.deltafunctions import change_mul
>>> from sympy.abc import x, y
>>> change_mul(x*y*DiracDelta(x)*cos(x), x)
(DiracDelta(x), x*y*cos(x))
>>> change_mul(x*y*DiracDelta(x**2 - 1)*cos(x), x)
(None, x*y*cos(x)*DiracDelta(x - 1)/2 + x*y*cos(x)*DiracDelta(x + 1)/2)
>>> change_mul(x*y*DiracDelta(cos(x))*cos(x), x)
(None, None)
See Also
========
sympy.functions.special.delta_functions.DiracDelta
deltaintegrate
N)�key� T��
diracdelta�wrt)�args_cnc�sortedr �extend�is_Pow�
isinstance�baser �append�func�exp� is_simple�expandr ) �node�x�new_args�dirac�c�nc�sorted_args�arg�nnode� r �@/usr/lib/python3/dist-packages/sympy/integrals/deltafunctions.py�
change_mul s4 '
"�r"