Replies: 1 comment 13 replies
-
import numpy as np
import quadpy
def integrand(x):
return [np.sin(x), np.ones_like(x)]
res, err = quadpy.quad(integrand, 0, 1) |
Beta Was this translation helpful? Give feedback.
13 replies
Answer selected by
piperfw
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I'm looking to integrate a vector-valued function of a single variable. Following the example
I tried
Expecting the second element of
res
to be1.0
, but instead I get the ValueErrorValueError: Expected the function return value to be of shape (..., 21), but got shape (2,) instead.
Where am I going wrong? Apologies for such a basic question. I noted that changing
1.0
to1.0+x*0.0
allowed the second integral to be performed.Beta Was this translation helpful? Give feedback.
All reactions