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!