Basically i need to perform a double integration of a function f(x,y) over a triangluar area. I understand that the quad2d function is ideal in this case. However, since my function f(x,y) contains a vector in it, I want the result of this integration to be a vector , and this is creating some kind of mismatch between the integrand output and input of the quad2d.
I looked into the quadv function, and this appears to be in line with what I want, but quadv applies only for single integral with one variable. Is there some way how i can apply double vectorized integration?
Here is the function i want to integrate:
function z = Amn_plus(x_dash,y_dash)
U = 1.2566e6;
E = 8.8542e12;
lamda = 1;
k = 2*pi/lamda;
n = evalin('base','n');
m = evalin('base','m');
[free_vertex] = find_vertex(n); %find_vertex returns a vector in the form [* *]
row_n_plus = [x_dashfree_vertex(1) y_dashfree_vertex(2)];
[rm_centroid] = find_centroid_plus(m); %find_centroid returns a vector in the form [* *]
Rm_plus = sqrt((rm_centroid(1)x_dash).^2+(rm_centroid(2)y_dash).^2);
green = exp(1i.*k.*Rm_plus)./Rm_plus;
z = [20.*row_n_plus(1).*green 20.*row_n_plus(2).*green];
end
%%calling function handle in main%%%
A_plus = quad2d(@Amn_plus,x_dash_min, x_dash_max,y_dash_min, y_dash_max);
Any ideas? Thanks!
