Matlab奇点
我在评估以下二重积分时遇到困难:
显然,cos 函数的振荡性质导致了这些问题。当我将 f 和 g 增加到更大的数字时,matlab 抱怨存在奇点并且积分不成功。
(3 - 2*cos(y).*cos(f*x+g*y) - cos((f-1)*x + g*y)) ./ (4 - 2*cos(y).*(cos(y) + cos(x))) dxdy
x 超出限制 -pi 到 pi,y 超出限制 -pi 到 pi。
我一直在使用:
quad2d(@(x,y)my_func(x,y,f,g),-pi,pi,-pi,pi)
请问有什么帮助或想法吗???
I am having trouble in evaluating the following double integral:
Clearly the oscillating nature of the cos function is causing these issues. As I increase f and g to larger numbers, matlab complains of the singularities and the integration being unsuccessful.
(3 - 2*cos(y).*cos(f*x+g*y) - cos((f-1)*x + g*y)) ./ (4 - 2*cos(y).*(cos(y) + cos(x))) dxdy
Over limits -pi to pi for x and -pi to pi for y.
I have been using:
quad2d(@(x,y)my_func(x,y,f,g),-pi,pi,-pi,pi)
Any help or ideas please???
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您首先需要检查这是一个数学问题还是一个编程问题。对于 f 和 g 的输入 0 和 130,积分的边缘确实趋于无穷大。因此,matlab 计算结果为无穷大也就不足为奇了,因为这确实是答案。
现在可以肯定的是,被积函数的边缘有可能趋于无穷大,而总积分也不会趋于无穷大,但如果您在接近 pi 的极限时绘制结果,则总积分不会接近极限,并且当你接近 pi 时继续上升。
You first need to check if this is a mathematical problem or a programming problem. For your inputs of f and g of 0 and 130, the edges of your integral do indeed go to infinity. Therefore it should be no surprise that matlab evaluates to infinity, because that is indeed the answer.
Now to be sure, it is possible for the edge of the integrand to go to infinity without the total integral also going to infinity, but if you plot the results as you approach the limit of pi, the total integral does not approach a limit and continues to rise as you approach pi.