Partial integration
10 ビュー (過去 30 日間)
古いコメントを表示
I have integrate twice, but IT IS NOT a double integral (which would be easy with quad2d or dblquad), but its smth like this: int(a->b)(f(x) * int(c->d)(g(x,x') dx')dx)
so basicly, i need to partialy integrate g(x,x') by x':c->d, then multiply with f(x), and integrate with x:a->b)
and after a few hours spent on this website and searching the matlab documentation and finding nothing of use, i decided to ask here. thanks for any help!
1 件のコメント
Bjorn Gustavsson
2011 年 7 月 13 日
Come to think of it it actually is a double integral:
\int_a^b f(x)*\int_c^d g(x,x')dx' dx = \int_a^b \int_c^d f(x)*g(x,x')dx' dx
採用された回答
Tomislav Broni?
2011 年 7 月 12 日
1 件のコメント
Bjorn Gustavsson
2011 年 7 月 13 日
Nowhere in your example did I see any matrices of functions, so obviously I could not guess stat you had such a problem, only that you wanted to integrate someting like this:
\int_a^b f(x)*\int_c^d g(x,x')dx' dx
So this is what I gave you.
その他の回答 (3 件)
Bjorn Gustavsson
2011 年 7 月 11 日
Maybe something based on this pattern would work:
g = @(x,xp) (x-xp).^2;
f = @(x) x;
IntOfG = @(x,c,d) quadgk(@(xp) g(x,xp),c,d);
res = quadgk(@(x) f(x).*IntOfG(x,c,d),a,b);
0 件のコメント
Tomislav Broni?
2011 年 7 月 11 日
1 件のコメント
Bjorn Gustavsson
2011 年 7 月 12 日
Hi,
If you read the help for quadgk you see that the first argument should be a function.
Since you don't show me how f1 is defined I can't know why you get that error. If you try to test/evaluate the functions you define step by step (in my example g, f and IntOfG) you can at least make sure that they work. The only thing I can say is that my example works in matlab R2009a.
参考
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!