Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Double Vectorized Integration

Subject: Double Vectorized Integration

From: Nate

Date: 29 Mar, 2013 04:07:05

Message: 1 of 1

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.2566e-6;
E = 8.8542e-12;
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_dash-free_vertex(1) y_dash-free_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!

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us