o
    jgr                     @   s  d dl mZ d dlmZ d dlmZ d dlmZmZm	Z	 d dl
mZ d dlmZ d dlmZmZ d dlmZmZ d d	lmZ d d
lmZ d dlmZ d dlmZ d dlmZ d dlmZ d dl m!Z! d dl"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2 edZ3edZ4dd Z5dd Z6dd Z7dd Z8dd Z9dd Z:dd  Z;d!d" Z<d#d$ Z=d%d& Z>d'd( Z?d)d* Z@d+d, ZAd-d. ZBd/d0 ZCd1d2 ZDd3d4 ZEd5d6 ZFd7d8 ZGd9d: ZHe!d;d< ZId=S )>    )randint)Function)Mul)IRationaloo)Eq)S)Dummysymbols)explog)tanh)sqrt)sin)Poly)ratsimp)checkodesol)slow)riccati_normalriccati_inverse_normalriccati_reducedmatch_riccatiinverse_transform_polylimit_at_infcheck_necessary_conds
val_at_infconstruct_c_case_1construct_c_case_2construct_c_case_3construct_d_case_4construct_d_case_5construct_d_case_6rational_laurent_seriessolve_riccatifxc                 C   s   t t|  | td| S )N   )r   r   maxint r*   \/var/www/html/zoom/venv/lib/python3.10/site-packages/sympy/solvers/ode/tests/test_riccati.pyrand_rational   s   r,   c                    s    t  fddt|d D | S )Nc                    s   g | ]}t  qS r*   )r,   ).0_r(   r*   r+   
<listcomp>"   s    zrand_poly.<locals>.<listcomp>r'   )r   range)r&   degreer)   r*   r(   r+   	rand_poly!   s    r2   c                 C   s\   t d|}t d|}t| ||}t| ||}|td| kr*t| ||}|td| ks|| S )Nr'   r   )r   r2   r   )r&   r1   r)   degnumdegdennumdenr*   r*   r+   rand_rational_function%   s   

r7   c           
      C   s   | }| |}t|dd}t|dd}|dkr!t|dd}|dkst|||  ||d   }t|  |||  ||d   }t||}	t||	dksNJ ||||fS )Nr'      r      )Tr   )diffr7   r   r   r   )
ratfuncr&   yfyypq1q2q0eqsolr*   r*   r+   find_riccati_ode/   s   
"
rD   c                  C   sv  t t d  t d d d t  t t d  t d  t t d d tdd   d  ddt    fdt  d dt  d  ddt   t d  dt  dt  dt  d  dt  d  ddt   tdt d dd  ddt    fd	dt d  d  d
dt  dt  d  dt  dt  d dt d  d   dt  d tddt  dddt  d d  ddt  d    tddt  dd  ft dt  d dt  d  t d dt  d  t d  dt  d  dt  d tddt  d dd  dt  d dt d  dt  d d  dt d  dt  d    dt d    fg} | D ]!\}}}}|t|t ||ks$J |t|t || ks2J qdt  d dt d  dt   d  dt  t  d dt   dt d  ddt   t  d dt d     t  d d  dt  d   dt  d	dt   t  d dt d     t  d  dt  d t  d  dt  dt d  dt   d    dt   fddt d   dt  t  d dt   dt d  ddt   t  d dt d     t  d d  dt  d   dt  d	dt   t  d dt d     t  d  dt   tdt  d dddt d    fg} | D ]#\}}}}}|t|t ||ks(J |t|t ||| ks7J qdS )ar  
    This function tests the transformation of the
    solution of a Riccati ODE to the solution of
    its corresponding normal Riccati ODE.

    Each test case 4 values -

    1. w - The solution to be transformed
    2. b1 - The coefficient of f(x) in the ODE.
    3. b2 - The coefficient of f(x)**2 in the ODE.
    4. y - The solution to the normal Riccati ODE.
    r'   r9      r8      Fevaluater            	      N)r&   r	   r   r   r   cancel)testswb1b2r=   bpr*   r*   r+   test_riccati_transformation?   sz   
<HBP
 "H^	HZ"rY   c                  C   s  t tttd  tt t  tt td   t ttt td  td  td d  ddtd    fdt dt d  t tt td t td  t  dtd  dt t d td   d  dt d d   tdt d dd	dt d   t td  t tt d
td t  tt d    ft td t tt td t t t tdd    dt d d  ddt d d   dt d dt d d   t td  t tt ddt d   ft ttt td t  t td t tt ddtd    fdtd  t d  td dt  d  t tt t td t  t td t tt dtd  td dt  d  dt td dt  d   dtd dt  d   t  ddtd    fdt dt d  t tt td t t t  dft tt tt dt  t td  t td td d   dfg} | D ]\}}|t|t tksJ qdS )z
    This function tests the transformation of a
    Riccati ODE to its normal Riccati ODE.

    Each test case 2 values -

    1. eq - A Riccati ODE.
    2. normal_eq - The normal Riccati ODE of eq.
    r9   r8   rK   rP   rO   r'   FrH   rJ   N)r%   r&   r:   r   r	   r   )rT   rB   	normal_eqr*   r*   r+   test_riccati_reduced   sf   0<8>


:@
(FB4@(r\   c                  C   s  t ttdtd  dtd   dt  d dtd  d	td   d
td   dt  d   d t td dt d   tdd t t t tdd dt d    ddtd  dtd  dtd   dtd   dt  d  dtd  dtd  dtd   dtd   dt  d   dt dtd  dtd   dtd   dt  d   d ddtd  d	td   d
td   dt  d   tdddt  ddd t d  ddt d  ft ttdt d  td d t td   dt d d t t dt d   td!d  d"td  d#t  d$ d%td  d&td     dd't d td!d  ddtd  dtd     d(d)td  dt    d"d%t d&   tdd*t d ddd t d  td d ft ttd+td,  d-td   d.td   d/td   d0t  d1 d)td  d&td,   d2td   d3td   d4td   d1t    td5d   ttdd  t t td tdd    td d t td  dt   dd+td  d)td,  d&td   d2td   d3td   d4t  d1  d-td  d)td,  d&td   d2td   d3td   d4t  d1   d.td  d)td,  d&td   d2td   d3td   d4t  d1   d6t d7td,  dtd   d8td   d9td   d:t  d)   td5d   d7dtd  dtd,   d;td   d<td   d=td   d7t    d>dtd,  dtd   d;td   d<td   d=t  d7   tdddt  ddtd  tdd t ddd t  ft ttttdd  ttdd  d   td t t  tt td  ttdd    dd?d?d?ft ttttd  ttt t  ttt td   dd?d?d?ft ttttt	t  t t td t td   dd?d?d?fdtd  t ttd dt t tt  dt t  dd?d?d?ft tttd  td t t  td td  t td   dd?d?d?ft ttt td  td d td d  t t  ddt d   t td  dd?d?d?fg	} | D ]$\}}}}}t
|t t\}}||ksJ |r|||g|ksJ qd@S )Aa  
    This function tests if an ODE is Riccati or not.

    Each test case has 5 values -

    1. eq - The Riccati ODE.
    2. match - Boolean indicating if eq is a Riccati ODE.
    3. b0 -
    4. b1 - Coefficient of f(x) in eq.
    5. b2 - Coefficient of f(x)**2 in eq.
    i  r8   ir  r9   N   \      rK   i  iN     H   r'   T-      i   ^      rM   b      Q   ;  i  <      rJ   rP   FrH   rO   
   i	  i     iD     rL   /   $   rR   i0  rF   i  iw  il     l   i  i7  ih     i$  rN         x   5   ?   (      r   N)r%   r&   r:   r	   r   r   r   r   r   r   r   )rT   rB   resb0rV   rW   matchfuncsr*   r*   r+   test_match_riccati   sL  8

.D.


 :

> 
:.


@8.(






@<8<@@
Pr   c               
   C   sX  t dtd  dtd   dt  d tt dtd  td  d	td   d
td
   dtd   dtd	   d
td   dtd   dtd   d	t  d td
ft dtt dtd  dtd   dtd   dt  d tdft dtd  dtd   dt  d tt dtd  dtd   dt  d tdft dtd  dtd
   dtd   dtd	   dtd   td  td  dt  tt dtd  t tdft d	td  dtd	   dtd   dtd   td  dt  d tt dtd  dtd   dtd   dt  d tdfg} | D ]\}}}t||t|ks(J qdS )a  
    This function tests the valuation of rational
    function at oo.

    Each test case has 3 values -

    1. num - Numerator of rational function.
    2. den - Denominator of rational function.
    3. val_inf - Valuation of rational function at oo
    rm   r8   rM   r9      rP   irO   rF   rE   rK      r'         rQ   rG   rN   r   irR   N)r   r&   r   )rT   r5   r6   valr*   r*   r+   test_val_at_inf  s0   (x4((XH4r   c                   C   s\   t dg ddksJ t dg ddksJ t dg ddks!J t dg dd	ks,J d
S )zt
    This function tests the necessary conditions for
    a Riccati ODE to have a rational particular solution.
    rZ   )r'   r9   rK   Fr'   r9   )r8   r'   rP   )r'   r9   rM   rN   TN)r   r*   r*   r*   r+   test_necessary_condsF  s   r   c               	   C   s<  dt d  dt d   dt   d dt  d  dt d  d	t d
   dt d   dt d   dt   d dt d  dt d   dt   d  dt d  dt d
   dt d   dt d   dt   d dt d
  dt d   dt d   dt   d  dt d  dt d   dt d   dt d
   dt d   dt   d dt d  dt   d  dt d  dt d   dt d
   dt d   dt   d dt d  dt d   dt d   dt d
   dt d   dt d   dt   d  g} | D ]&}dd | D \}}t||t \}}|t dt   || ksJ qdS )zi
    This function tests the substitution x -> 1/x
    in rational functions represented using Poly.
    r   r8   rM   r9   rP      r`   rF   rz   rK   P      rk      K   rN   irq   rE   rl   rf   d      rm   rb   rO   c                 S   s   g | ]}t |tqS r*   )r   r&   )r-   er*   r*   r+   r/   g  s    z/test_inverse_transform_poly.<locals>.<listcomp>r'   N)r&   as_numer_denomr   subsrS   )fnsr%   r5   r6   r*   r*   r+   test_inverse_transform_polyU  s"   .^j^t
$r   c               
   C   s  t dtd  dt  d tt dtd  dtd   dt  d tdft dtd	  dtd   d
td   dt  d tt dtd  dtd   dt  d ttft dtd  dtd   dtd   dtd   dtd	   dtd   dtd   dt  d tt dtd  dtd   dtd   dtd	   dtd   d td   d!t  d" tt ft d!td  d#td   d$td   d$td	   d%td   d&td   d't  d( tt d)td  dtd   d*td   d*td	   d+td   d,td   d-t  d. ttd/d ft d0td	  d1td   d.td   d2t  d3 tt d4td	  dtd   d5td   dt  d ttd0d4 fg} | D ]\}}}t||t|ksaJ qQd6S )7a   
    This function tests the limit at oo of a
    rational function.

    Each test case has 3 values -

    1. num - Numerator of rational function.
    2. den - Denominator of rational function.
    3. limit_at_inf - Limit of rational function at oo
    r9   rf       r8   ra   r     rK   i  ix  i  i'    i  i!rM   rE   i  rP   rj   rF   iX  H  i  iv  i  i  |  T     i  rd      i  rk   r   rb   rw   r   i  i  i   i	  i
  i  r'      i  i  Z   i_  i  N)r   r&   r   r	   r   )rT   r5   r6   limr*   r*   r+   test_limit_at_infl  s<   (4(TXXX
44
r   c                  C   s  t dtd  dtd   dt  d tddt dtd  d	td
   dtd   dtd   dtd   dtd   tddtdtdd tdt d  gtdd tdt d  ggft dtd  dtd   dt  d tddt dtd  dtd   dtd   dtd   dt  d tddtd
d tdd tdd  gtdd tdd  ggft dt d tddt dtd  ddtd  td   ddtd  td   ddtd  t  dtd  d	 tdd tdtd d tdd ttddtd d d!d"d#td d$  d d  gtdd ttddtd d d!d"d#td d$  d d  ggfg} | D ]\}}}}t||t||ksWJ qEd%S )&ab  
    This function tests the Case 1 in the step
    to calculate coefficients of c-vectors.

    Each test case has 4 values -

    1. num - Numerator of the rational function a(x).
    2. den - Denominator of the rational function a(x).
    3. pole - Pole of a(x) for which c-vector is being
       calculated.
    4. c - The c-vector for the pole.
    rZ   r8   r9   rK   rF   T	extensionrM      rE   rO   rN   rP   r   r'   i  i  i0  i0     i  i  ie  i  1   ij iz  r   r   r   zQQ<sqrt(3)>domainFrH      ,   N)r   r&   r	   r   r   r   r   )rT   r5   r6   polecr*   r*   r+   test_construct_c_case_1  s6   ,P:,D
2P
BBr   c                  C   s  t dtddt td d td  tddddt dt  d gtdt  d ggft dtd  dtd	   d
td   d tddt dt d d td d  tddtdd dtd d gtd d ggft td td  d	t  tddt td d	 td d  tdddd	d
td tdd d	td d
   d dtd d
 gdtd tdd d	td d
   d dtd d
 ggft dtd  td	  d tddt d	t d d	 td  tddtd d	 d	dtd td d tdd   d tdd gdtd tdd tdd   d td d ggft td d tddt dt d d td d  tddtdd ddtd td d tdd   d dtd d tdd  gd!td tdd tdd   d dtd d td d  ggft td d tddt ttd d tddtddtd"tdd
 dtd"   d# td
d
 td"gtd" tdd
 dtd"   d# td
 d
 td" ggfg} | D ]\}}}}}t||t|||ksJ qd$S )%a  
    This function tests the Case 2 in the step
    to calculate coefficients of c-vectors.

    Each test case has 5 values -

    1. num - Numerator of the rational function a(x).
    2. den - Denominator of the rational function a(x).
    3. pole - Pole of a(x) for which c-vector is being
       calculated.
    4. mul - The multiplicity of the pole.
    5. c - The c-vector for the pole.
    r'   Tr   r9   rJ   r8   rF   rN   rK   rE   Y   rg   rO   rk   iW  rR   r   i  7   i 8     irP   rc   B   6      i$ r{   i  rn   ir      N)r   r&   r   r	   r   r   )rT   r5   r6   r   mulr   r*   r*   r+   test_construct_c_case_2  sT   $0$  ::  44	$BB4:,r   c                   C   s   t  dggks	J dS )z`
    This function tests the Case 3 in the step
    to calculate coefficients of c-vectors.
    r'   N)r   r*   r*   r*   r+   test_construct_c_case_3  s   r   c                  C   s  t td  dtd   dtd   dt  d tddt dtd  dtd   dt  d tddddt d	 td d
t tdd td   d gdt d	 t d dt tdd td   d ggft td  dtd   dtd   dtd   dtd   dt  d tddt td dtd   dtd   t d tddddt tt dt  d gdt t tdt  d ggft dtd  td  td  dtd   td  dt  d tddt dtd  dt  d tddddtd t d dtd t d tdt d td t tdd dtd t d   d gdtd t d dtd t d td t d tdt tdd dtd t d   d ggft d
td  dtd   dtd   td  d tddt dt d tddddt d dt d td t td d  t  gd!t d d"t d t d ttd d  t  ggft td  td  td  td  t tddt td tdddd#t d dt t tt d$dt   d gdt d dt tt td$dt   d ggft td  td  dtd   dtd   td  td  dt  d tddt dt d tddddtd t d dtd t d tdt d tdt d td t td d% dtd t d   d gd
td t d d
td t d td t d td t d tdt td d% dtd t d   d ggfg} | D ]\}}}}t||tt|d}t||d |ksJ qd&S )'a9  
    This function tests the Case 4 in the step
    to calculate coefficients of the d-vector.

    Each test case has 4 values -

    1. num - Numerator of the rational function a(x).
    2. den - Denominator of the rational function a(x).
    3. mul - Multiplicity of oo as a pole.
    4. d - The d-vector.
    rF   r9   rK   r8   Tr   rO   rm   rc   rZ      r_   r   rP   rE   rN   rQ   rt   rR   i  r   irq   iIB  i 
  ir'   )      rl   ;   i   ir   rG   r   rM   N)r   r&   r   r	   r   r#   r   r    )rT   r5   r6   r   dserr*   r*   r+   test_construct_d_case_4  sn   6,02N06D H4.8	22.	XNXD0.r   c               	   C   s  t dtd  td  t d tddt dtd  dtd   dt  d tddtdd td d gtd d tdd ggft dtd  td	  td  td  dt  d td
dt dtd  dtd	   dtd   dtd   dt  d td
dtdd dtd d gtd d dtd d ggft td t d td
dt dtd  dt  d td
dtdd dtd d gtd d dtd d ggfg} | D ]\}}}t||ttdd}t||ksJ qdS )a  
    This function tests the Case 5 in the step
    to calculate coefficients of the d-vector.

    Each test case has 3 values -

    1. num - Numerator of the rational function a(x).
    2. den - Denominator of the rational function a(x).
    3. d - The d-vector.
    r9   r8   Tr   rO   rF   r'   rs   rK   ZZr   rE   rR   rc   rG   r   N)r   r&   r   r#   r   r!   )rT   r5   r6   r   r   r*   r*   r+   test_construct_d_case_5E  s"   $,28D8 8r   c                  C   s  t dtd  d tddt dtd  dtd   dt  d tddtdd td  gtdd td  ggft dtd	  dtd   dt  d tddt td
 td  dtd   dtd	   dtd   dt  d tdddgdggft dtd	  td  dt  d tddt d
td  dtd   dtd
   dtd   dtd   dtd	   dtd   dt  d tdddgdggfg} | D ]\}}}t||t|ksJ qdS )a  
    This function tests the Case 6 in the step
    to calculate coefficients of the d-vector.

    Each test case has 3 values -

    1. num - Numerator of the rational function a(x).
    2. den - Denominator of the rational function a(x).
    3. d - The d-vector.
    rR   r9   rF   r   r   rK   rm   r'   r8   rP   rO   r   rG   r   rN   rM   rh   rE   rc   r   .   "   *   N)r   r&   r	   r   r"   )rT   r5   r6   r   r*   r*   r+   test_construct_d_case_6f  s,   ,*,H
(T
r   c                  C   s  t td dt  d tddt td t tddtddddd	dd
dd
dft dtd  dt  d tddt dtd  dtd   dtd   dt  d tddtdd ddtdd tdd tdd tdd dft dtddt td dtd d td   dtd d  td   d!dtd  td   ddtd  t  d tddtddddtd d"dtd  td#d"dtd  d$d%d#td  d"dtd  d#td d  td#d"dtd  d$d%d#td d  d"dtd  d#td d  d&ft td dtd   dtd   d't  d( tddt td d tddtdddd)ddd*d+d,ft dtd  dtd   dt  d tddt dtd  td  dtd   dt  d tddtdd d)dtd-d. td/d0 td1d2 td3d4 td5d6 d7ft d8td  dt  d tddt dtd  dtd   dtd   dtd   dt  d tddtd)dd)d)td9 d: d)d#td;d d<fg} | D ]\}}}}}}|t||t|||ksJ qd=S )>a  
    This function tests the computation of coefficients
    of Laurent series of a rational function.

    Each test case has 5 values -

    1. num - Numerator of the rational function.
    2. den - Denominator of the rational function.
    3. x0 - Point about which Laurent series is to
       be calculated.
    4. mul - Multiplicity of x0 if x0 is a pole of
       the rational function (0 otherwise).
    5. n - Number of terms upto which the series
       is to be calculated.
    r9   r8   rO   Tr   r'   rP   rE   ir   )r'   r   rJ   rR   rZ   rL   @   i  i  rK   r   i?  i  i  rM   i iKi  i  l    `B l   -R i0 i}' )r   r9   rJ   r'   rF   rL   rN   r   rZ   rJ   FrH   )rK   r8   r9   r'   r   rJ   rm   r   r   r   rt   )r8   r9   r'   r   rJ   rR   i  i  i i) l   ?PT l   @qs lF41l   @4lJ!tz l    Zdjm )r   rJ   rR   rZ   rL   r   G   r   r   )r   rR   rG   rJ   rZ   rL   N)r   r&   r	   r   r   r   r#   )rT   r5   r6   x0r   nr   r*   r*   r+   test_rational_laurent_series  sf   
 8
P
264,	4 D"/ r   c                    s   t | tr| j| j } t| tt\}}ttttg|R  }td  fdd|D }t	dd t
| |D s:J t	fddt||D sJJ dS )z
    Helper function to check if actual solution
    matches expected solution if actual solution
    contains dummy symbols.
    C1c                    s   g | ]}|  qS r*   )r   )r-   rC   r   	dummy_symr*   r+   r/     s    z#check_dummy_sol.<locals>.<listcomp>c                 s   s    | ]}|d  V  qdS )r   Nr*   )r-   r&   r*   r*   r+   	<genexpr>  s    z"check_dummy_sol.<locals>.<genexpr>c                 3   s     | ]\}}| | V  qd S )N)dummy_eq)r-   s1s2)r   r*   r+   r     s    N)
isinstancer   lhsrhsr   r%   r&   r$   r
   allr   zip)rB   solser   r.   r   solsr*   r   r+   check_dummy_sol  s   
$r   c                  C   s0  t d} ttttttd  d dttttdttttd gfttd ttt dtt t  dtd   tttd|  t | t td   gfdtd  ttt tdtt ttt d   ttd tt  ttt| dtd   | t  gfttttttd  dtd td    tttdtd t  gftd dt dt  tt  ttd  ttt ttt| t td  dt  | td   ttttgftd ttt td  tdttd  ttt   tt ttt| td  t | td   ttttd gfttd  ttt dtd  d	t  d
 td d dt d d    tttd|  t d|   dtd   dtd   dtd   dtd   dt  d d|  td  d|  t  d|   dtd   dtd   dtd   dtd   dtd   dt   tttdt d dtd  dt  d  gfttd ttt dtd  dtd   dtd   dtd   d
td   d	t  d dtd    tttdtd  dtd   td  dtd   dt  d dtd  dtd    gftttttd  dtd   dtd   dtd   dt  d td dtd   dtd   dtd   dtd   dtd
   d td   dtd   dtd   dtd   dtd   dt  d  ttd  tt tttdtd dtd   dtd   d	td   dtd   dt  d  gfttttttt dt  dt d ttd  dt d   dtd  d
t  d! d"td  dtd   d   tdd  tttddt  dt d  gfttttd#td  d$t  d dtd  dtd   dt  d  dttd  dt d   tttdt d dt d  gftttdtd  d ttd  t  dtd  t d tt ttd    dtd  dt  d ttd d    ttt|  td  td  dt  | t |  td  td  td  t  tttd%td  gftttdt ttd d  t  tttt |  ttd   | td   tttt gfttttttt tdd dt   td tdd  ttd  dt d tdd    tdd  d&td  d't  d( d"td  dtd     tttdt t tttdtd)  d*td+   d,td   d-td   d.td   d/td   d0td   d1td
   d2td   d3td   d4td   d5td   d6td   d7t  d8 dtd)  d9td+   d:td   d;td   d<td   d/td   d=td   d>td
   d?td   d@td   dAtd   dBtd   dBtd   dCt   gfttttdDtd  dDtd   t d tdd  ttd   d tttdt gfttttdEtd  d dt d  td tdd  ttd   d dt tt t  dt  tttdEt d d gfg}|D ]\}}t|||  qdFS )Ga  
    This function tests the computation of rational
    particular solutions for a Riccati ODE.

    Each test case has 2 values -

    1. eq - Riccati ODE to be solved.
    2. sol - Expected solution to the equation.

    Some examples have been taken from the paper - "Statistical Investigation of
    First-Order Algebraic ODEs and their Rational General Solutions" by
    Georg Grasegger, N. Thieu Vo, Franz Winkler

    https://www3.risc.jku.at/publications/download/risc_5197/RISCReport15-19.pdf
    C0r9   r   rK   rR   r'   r8   r   rf   rE   rO   rP   rF   rk   re   ra   r      9   :   rM   rN   rz   rb   rl   r   r   rm        i  i  rh   r   r   0   rJ   i  r   r   r   r   r   r   r   i0H  i iF i4" i< ii2ҍi"0	iimi^   r   i  i<Z  i8X i4 iLB i i|Mi:i r   rZ   N)	r
   r   r%   r&   r:   r   r	   r   r   r   rT   rB   rC   r*   r*   r+   test_solve_riccati  s^  "$4&N"08:F6@J:


F


H
FN




RD	2
"H"J&F(:J
.J







F





LHer   c                  C   s   t d} ttttdt tt td  ddt  ttd  dt d   dtd  dtd   d	t  d
 dtd  dtd   dtd   dt  d   d tttdt d dt d  gfg}|D ]
\}}t|||  qkdS )z
    This function tests the computation of rational
    particular solutions for a Riccati ODE.

    Each test case has 2 values -

    1. eq - Riccati ODE to be solved.
    2. sol - Expected solution to the equation.
    r   r'   r8   r9   rN   rO   i  i/ i i- rM   rK      i*  i  r   r   rP   N)r
   r   r%   r&   r:   r   r   r*   r*   r+   test_solve_riccati_slowX  s    HD"r   N)Jsympy.core.randomr   sympy.core.functionr   sympy.core.mulr   sympy.core.numbersr   r   r   sympy.core.relationalr   sympy.core.singletonr	   sympy.core.symbolr
   r   &sympy.functions.elementary.exponentialr   r   %sympy.functions.elementary.hyperbolicr   (sympy.functions.elementary.miscellaneousr   (sympy.functions.elementary.trigonometricr   sympy.polys.polytoolsr   sympy.simplify.ratsimpr   sympy.solvers.ode.subscheckr   sympy.testing.pytestr   sympy.solvers.ode.riccatir   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r,   r2   r7   rD   rY   r\   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r*   r*   r*   r+   <module>   sP    H
B6c,.&>?! C}