(func, variables, x, x_lower, x_upper, doit=True,
wf=1, method="auto", CDS=False, tau=None,
points=1000, numeric=True)
| 2239 | return results |
| 2240 | |
| 2241 | def _integrateCoeffs2(func, variables, x, x_lower, x_upper, doit=True, |
| 2242 | wf=1, method="auto", CDS=False, tau=None, |
| 2243 | points=1000, numeric=True): |
| 2244 | # Find the highest order terms in the denominator |
| 2245 | numer, denom = func.as_numer_denom() |
| 2246 | poly_denom = sp.Poly(denom, variables[0], variables[1]) |
| 2247 | max_degree = poly_denom.total_degree() |
| 2248 | for exponents in poly_denom.monoms(): |
| 2249 | if sum(exponents) == max_degree: |
| 2250 | var0_order, var1_order = exponents |
| 2251 | # Change the order to use sp.Poly |
| 2252 | denom = sp.simplify(sp.expand(denom) /( variables[0]**var0_order * variables[1]**var1_order)) |
| 2253 | func = numer/denom |
| 2254 | poly = sp.Poly(func, variables[0], variables[1]) |
| 2255 | # Integrate the polynomial coefficients numerically |
| 2256 | integratedCoeffs = _integrate_all_coeffs( |
| 2257 | poly, x, x_lower, x_upper, doit=doit, wf=wf, |
| 2258 | method=method, CDS=CDS, tau=tau, points=points, |
| 2259 | numeric=numeric) |
| 2260 | return integratedCoeffs, exponents |
| 2261 | |
| 2262 | def integrated_monomial_coeffs(expr, variables, x, x_lower, x_upper, doit=True, |
| 2263 | wf=1, method="auto", CDS=False, tau=None, |
no test coverage detected