如何在R中的网格点上通过函数值给出的任意区域执行2D数值集成?
我想数字评估形式的积分:
$$ int_d f(x,y)dx dy $$,
其中$ d $是$ r^2 $和$ f(x,y)$的区域从$ r^2 $到$ r $。
我有一个网格覆盖$ r^2 $的子集。从这个网格中,对于我的特定应用$ f(x,y)< 5 $)。
然后,我想在此选定的区域上集成该功能。在矩形区域上,2D积分存在许多功能,有些功能已实施以进行简单。在我看来,在更一般的区域上都没有集成。实施Riemann Sugs的版本似乎并不太复杂,但在任何地方都没有看到它。
有人知道吗?
I would like to numerically evaluate an integral of the form:
$$ int_D f(x,y) dx dy $$
where $D$ is a region in $R^2$ and $f(x,y)$ is a map from $R^2$ to $R$.
I have a grid covering a subset of $R^2$. From this grid, for my particular application, I select a particular region $D$ (not necessarily rectangular, but simply-connected) according to the value of $f(x,y)$ (for example, I select all points for which $f(x,y) < 5$).
I would then like to integrate the function over this selected region. Many functions exist for 2D integrals over rectangular regions and some have been implemented for integration over simplicies. It appears to me none exist for integration over more general regions. It does not seem too complicated to implement a version of Riemann Sums, but have not seen it anywhere.
Does anyone know?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以为双变量使用
Integral
函数。假设您有一个函数
f(x,y)= xy/2
,并且要将该函数与0&lt; x&lt; x&lt; 10
and0&lt; y&lt; y&lt; x
我们有:这正是您手工获得的价值
You can use the
integral
function for bivariate.Assume you have a function
f(x, y) = xy/2
and you want to integrate the function with0<x<10
and0<y<x
we have:This is exactly the value you obtain by hand