�
��gψ � �F � d Z ddlmZ ddlmZ ddlmZ ddlmZm Z ddl
mZmZm
Z
mZ ddlmZmZ ddlmZmZmZ dd lmZ dd
lmZmZ ddlmZmZ ddlmZ dd
l m!Z!m"Z"m#Z# ddl$m%Z% ddl&m'Z' ddl(Z(dZ)d$d�Z*d� Z+d� Z,d%dd�d�Z-d&d�Z.d� Z/d� Z0d� Z1d� Z2d'd �Z3d!� Z4d"� Z5d#� Z6dS )(a�
This module contains pdsolve() and different helper functions that it
uses. It is heavily inspired by the ode module and hence the basic
infrastructure remains the same.
**Functions in this module**
These are the user functions in this module:
- pdsolve() - Solves PDE's
- classify_pde() - Classifies PDEs into possible hints for dsolve().
- pde_separate() - Separate variables in partial differential equation either by
additive or multiplicative separation approach.
These are the helper functions in this module:
- pde_separate_add() - Helper function for searching additive separable solutions.
- pde_separate_mul() - Helper function for searching multiplicative
separable solutions.
**Currently implemented solver methods**
The following methods are implemented for solving partial differential
equations. See the docstrings of the various pde_hint() functions for
more information on each (run help(pde)):
- 1st order linear homogeneous partial differential equations
with constant coefficients.
- 1st order linear general partial differential equations
with constant coefficients.
- 1st order linear partial differential equations with
variable coefficients.
� )�reduce)�combinations_with_replacement)�simplify)�Add�S)�Function�expand�AppliedUndef�Subs)�Equality�Eq)�Symbol�Wild�symbols)�exp)�Integral� integrate)�has_dups�is_sequence)�
filldedent)�_preprocess� ode_order�_desolve)�solve)�collectN)�%1st_linear_constant_coeff_homogeneous�1st_linear_constant_coeff�"1st_linear_constant_coeff_Integral�1st_linear_variable_coeff�defaultFc �f � |st d� � }t | f||ddd�|��}|� dd� � } |� dd� � }|r�i }i } t | d�� � }
|� |
d |
d
d�� � |D ]\} t | ||| d || d || | |� � }|||<