pg_utils.numerics.matrices.quad_matrix_gmpy2

pg_utils.numerics.matrices.quad_matrix_gmpy2(operand_A: Expr, operand_B: Expr, nrange_A: List[int], nrange_B: List[int], xi_quad: ndarray, wt_quad: ndarray, n_dps: int = 33) ndarray[source]

Compute quadrature matrix using gmpy2, where \(w_k\) is wt_quad[k], \(\xi_k\) is xi_quad[k], \(f_A\) is operand_A and \(f_B\) is operand_B.

Parameters:
  • operand_A (sympy.Expr) – operand A

  • operand_B (sympy.Expr) – operand B

  • nrange_A (List[int]) – range of degrees where operand A is evaluated

  • nrange_B (List[int]) – range of degrees where operand B is evaluated

  • xi_quad (np.ndarray) – x coordinates where the operands are evaluated

  • wt_quad (np.ndarray) – weights for summation

  • dps (int) – decimal places to which the calculation is performed

Returns:

output matrix in np.ndarray

Note

The input xi_quad and wt_quad, despite being numpy.ndarray, should be arrays of multi-precision gmpy2.mpf objs whose prec is at least the same as the calculation precision, otherwise the multi-precision calculation is meaningless.