Numerical integration with two parameters
9 ビュー (過去 30 日間)
古いコメントを表示
So I want to integrate the following integral fun = @(t, x, y) (y-t*x+t^2)/(sqrt((x-2*t)^2+(y-t^2)^2)^3). I tried using the quad function (@t from -inf to inf) because the parameters are 'vectors' ie. x=-inf:inf and y=-inf:inf but I don't get an answer. Am I using the correct function or should I do something else, I really can't figure it out. Any answer would be helpful, thanks in advance.
2 件のコメント
Torsten
2022 年 8 月 22 日
編集済み: Torsten
2022 年 8 月 22 日
I tried using the quad function (@t from -inf to inf) because the parameters are 'vectors' ie. x=-inf:inf and y=-inf:inf
So you are trying to calculate the 3d integral for x=-Inf:Inf and for y=-Inf:Inf and for t=-Inf:Inf of the above function ?
Or is it a one-dimensional integral with fixed values for x and y ?
回答 (1 件)
Torsten
2022 年 8 月 22 日
編集済み: Torsten
2022 年 8 月 22 日
You should check whether the integral exists when y = x^2/4. In this case, the denominator of fun is 0, and I think you'll have a pole of order 1 at t = x/2. This would mean the integral does not exist.
fun = @(t,x,y)(y-t*x+t.^2)./(sqrt((x-2*t).^2+(y-t.^2).^2).^3);
% Case where y ~= x^2/4
x = 2;
y = 4;
value = integral(@(t)fun(t,x,y),-Inf,Inf)
% Case where y = x^2/4
x = 2;
y = 1;
value = integral(@(t)fun(t,x,y),-Inf,Inf)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!