2D surface integral in MATLAB for Finite Element Calculation

In summary, Vivek is trying to numerically compute the expressionb_{i}^{e} &=& \frac{E_{0}^{i}k_0^2(\epsilon_r-1/\mu_r)}{2\Delta^e}\left[\iint\limits_{\Omega^e}(a_i^e + b_i^e x + c_i^e y)e^{-jk_0 x} dx dy\right] \nonumber\\&&- \frac{jk_0 E_0^i r'}{2\Delta^e \mu_r}\left[\int_{\phi_{1
  • #1
maverick280857
1,789
5
Hi everyone,

As part of a project, I am required to numerically compute the expression

[tex]b_{i}^{e} &=& \frac{E_{0}^{i}k_0^2(\epsilon_r-1/\mu_r)}{2\Delta^e}\left[\iint\limits_{\Omega^e}(a_i^e + b_i^e x + c_i^e y)e^{-jk_0 x} dx dy\right] \nonumber\\&&- \frac{jk_0 E_0^i r'}{2\Delta^e \mu_r}\left[\int_{\phi_{1}^{s_2}}^{\phi_{2}^{s_2}}(a_i^e \cos\phi + b_i^e r'\cos^2\phi + c_i^e r'\sin\phi\cos\phi)e^{-jk_0r'\cos\phi}d\phi\right][/tex]

specifically, compute the integrals numerically. The problem is that [itex]\Omega^e[/itex], the domain of integration of the first integral is a triangle (whose vertex coordinates are well known).

I am unable to figure out a way to do this integral computationally in MATLAB. That is, how does one compute an area integral in MATLAB when the x and y coordinates are coupled (and bounded to lie in a spatial region).

If there is a documented way of doing this, or a preexisting function, I would prefer to use it and go ahead with my work, rather than reinvent the wheel. Any inputs would be greatly appreciated!

Thanks in advance!

Cheers
Vivek
 
Physics news on Phys.org
  • #2
Hi Vivek,

One thing you could do is define a function of x and y that will return one in the domain and zero outside.

For example, the following function returns one only in the 45-45-90 triangle near the origin given by x<3, y>0, x>y:
domain = @(x,y) heaviside(x-y)*heaviside(3-x)*heaviside(y).

Then you can integrate over a square including your triangular domain and multiply the integral argument by this domain function.

I'm sure you've solved this problem by now, but I stumbled across it while searching for surface integration techniques and figured I might as well reply.
Cheers,
David
 
  • #3
dreens said:
Hi Vivek,

One thing you could do is define a function of x and y that will return one in the domain and zero outside.

For example, the following function returns one only in the 45-45-90 triangle near the origin given by x<3, y>0, x>y:
domain = @(x,y) heaviside(x-y)*heaviside(3-x)*heaviside(y).

Then you can integrate over a square including your triangular domain and multiply the integral argument by this domain function.

I'm sure you've solved this problem by now, but I stumbled across it while searching for surface integration techniques and figured I might as well reply.
Cheers,
David
Vivek hasn't posted in a year.

Please resist the urge to necro post to these ancient threads.
 
  • #4
Why? This thread shows up for anyone who google searches "matlab surface integral". Wouldn't it be better if they found a reply?
 
  • #5
dreens said:
Why? This thread shows up for anyone who google searches "matlab surface integral". Wouldn't it be better if they found a reply?
I'm just repeating the policy of the moderators of this forum. They prefer not to have these old posts dredged up from the past.

However, if you wish to create a new thread of your own, dealing with this subject, you can always refer to previous threads on the same topic.

If you seek another opinion on this point, please feel free to contact one of the moderators, say via PM, and start a discussion about necro posting to these old threads. Policies do change at PF from time to time.
 
  • #6
Ah I see. Thank you SteamKing. I'll be happy to review the policy and comply in the future.
 

FAQ: 2D surface integral in MATLAB for Finite Element Calculation

What is a 2D surface integral in MATLAB?

A 2D surface integral in MATLAB is a mathematical calculation that involves finding the area under a two-dimensional surface. This is commonly used in finite element analysis to calculate various quantities such as forces and stresses.

How is a 2D surface integral calculated in MATLAB?

In MATLAB, a 2D surface integral can be calculated using the 'quad2d' function. This function takes in the integrand (the function being integrated) and the limits of integration as inputs and returns the result of the integral. It uses numerical integration methods to approximate the value of the integral.

What is the significance of using MATLAB for 2D surface integrals in finite element analysis?

MATLAB is a powerful computational tool that allows for efficient and accurate calculations of 2D surface integrals in finite element analysis. It provides built-in functions for numerical integration, making it easier to perform complex calculations. Additionally, it allows for visualization of results, which can aid in understanding the data.

Can 2D surface integrals be performed for non-rectangular elements in MATLAB?

Yes, MATLAB allows for 2D surface integrals to be performed on non-rectangular elements. This can be achieved by defining the integrand and limits of integration appropriately for the specific element shape. However, it is important to ensure that the element shape is represented accurately in the calculation to obtain reliable results.

How can I ensure the accuracy of 2D surface integrals calculated in MATLAB?

To ensure the accuracy of 2D surface integrals in MATLAB, it is important to choose appropriate numerical integration methods and refine the mesh used in the calculation. Additionally, it is important to check for convergence of the results by varying the mesh density and comparing the values obtained. Visualizing the results can also help in identifying any errors or discrepancies.

Similar threads

Replies
7
Views
2K
Replies
1
Views
3K
Replies
1
Views
2K
Replies
5
Views
1K
Replies
5
Views
2K
Back
Top