double integral with one changing limits integral
古いコメントを表示
Hi experts,
I am trying to numerically calculate a double integral with one changing limits integral. f(x,a,b), g(y,a,b) are the functions, a and b are parameters. the integral is: h(a,b) = int [0,b/a] ( f * {int [0,x] (g*dy)} * dx). Give the value of a, I want to solve the value of b with h(a,b) = 1.
I tried to use function handles and quad() and fsolve(), there is always error saying the fsolve() cannot initiate the integration. Does anyone can help me solve this problem?
Here is my code which does not work (just a simplified version):
function test
f = @(x,a,b) sin(a*x+b);
g = @(y,a,b) quad(@(x) f(x,a,b),0,y);
h = @(a,b) quad(@(y) cos(y)*g(y,a,b),0,2);
for b=1:1:3
n =@(a) h(a,b);
fsolve(n,1)
end
Thanks!!
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Numerical Integration and Differentiation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!