Integral inside integral is taking too much time
Show older comments
Hi,
I am trying to evaluate integral inside integral using the following script but it is taking too much time, is there anyway I can reduce the time of evaluation:
f =@(x,y) x+y; % "x+y is just a simple example, the actual function is way more complicated"
integral(@(y) exp(-integral(@(x) f(x,y),a,b,'RelTol',1e-8,'AbsTol',1e-13),aa,bb,'RelTol',1e-8,'AbsTol',1e-13,'ArrayValued',true)
5 Comments
Waseem Akhtar
on 20 Jul 2021
syms x y a b aa bb
f = x + y;
Fx = int(f,x,a,b);
Fxy = int(exp(-Fx),y,aa,bb)
integrates your function from above symbolically.
Walter Roberson
on 20 Jul 2021
Sometimes it helps to reverse the order of integration.
Waseem Akhtar
on 23 Jul 2021
Edited: Waseem Akhtar
on 23 Jul 2021
Accepted Answer
More Answers (0)
Categories
Find more on Numerical Integration and Differentiation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

