2016-03-08 130 views
0

我想在數值上集成Matlab中的不連續函數。在Matlab積分中的不連續性

fun = @(z) 1./((z+1).^2+4) * 1./(exp(-z)-1); 
q = integral(fun,-Inf,Inf,'Waypoints',[0]) 

有一個在z=0不連續的,但我不知道如何使用Waypoints選項來指定。我收到一條錯誤消息:

Warning: Reached the limit on the maximum number of intervals in use. Approximate bound on error is 7.4e-01. The integral may not exist, or it may be difficult to approximate numerically to the requested accuracy. 

如何準確計算此積分?

回答

2

從文檔「使用路標指示您希望集成商使用的積分時間間隔內的任何點」。

也許這個方程中唯一的一點你不想使用我們的零....因爲函數在該值時是不確定的(它的左邊和右邊的極限是不同的,因此它不是無限的,它的undefined )。

Wolfram Alpha claims that the integral does not exists

所以,當MATLAB說

「積分可能不存在,也可能是難以用數字接近 到要求的精度」

這是....因爲它可能不存在!


我猜你總是可以這樣做:

q = integral(fun,-Inf,-0.001)+integral(fun,0.001,Inf); 

,但我不知道如何正確的,這是....

0

添加備註,以@Ander Biguri的正確答案。

還有其他的奇點功能,例如, 1/((x+1)*sqrt(x))(看improper integrals

integral(@(x) 1./((x+1).*sqrt(x)), 0, inf) 

ans = 

    3.1416 

,甚至不是在積分範圍

integral(@(x) 1./(x.^2).^(1/3), -1, 1) 

ans = 

    6.0000 

的邊界與奇點匯聚,以MATLAB做一切正確的函數。你的功能不會收斂。

也許你有興趣Cauchy's principal value,但這是另一個話題。

+0

我的表達式的Cauchy PV:類似於int(fun,z,-Inf,Inf,'PrincipalValue',true)''只是返回我的輸入。這是否意味着Cauchy PV和數值/分析解決方案不存在? –

+0

對不起,這就是我所知道的這個話題。也許你應該在數學論壇中提出這個問題 – rst