How to do Double numerical integration with a variable limits
10 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Abdulaziz Al-Amodi
le 3 Sep 2022
Commenté : Abdulaziz Al-Amodi
le 8 Sep 2022
Can someone please help me in doing numerical integration on the following function, I want to do double numerical integration with respect to y and x, such that the final answer will be a function of z only. Also the limit of integration is not a constant, it is basically something like (x-y, x+y), not sure if there exist a way to do this, can someone please advise me on how to proceed?
Thank you

10 commentaires
Torsten
le 4 Sep 2022
The integral (once it is correctly written) could be considered as a function of z. Then numerical integration can be carried out.
Réponse acceptée
Matt J
le 6 Sep 2022
Modifié(e) : Matt J
le 6 Sep 2022
I'll demonstrate for a simpler function. The technique is the same regardless of what function we're integrating.
F=@(x,y,z) x.^2+y.^2+z.^2; %The input function to be integrated
Iyz=@(y,z)integral( vect(@(q)F(q,y,z)), z-y,z+y); %partial integral w.r.t. x
Iz=@(z) integral( vect(@(q)Iyz(q,z)) , 0,z); %partial integral w.r.t. y
Iz(1)
function fun=vect(fun)
%vectorize a non-vectorized function
fun=@(x) arrayfun(fun,x);
end
6 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Numerical Integration and Differentiation dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!