1

Let

E1 is electric field distributions of the desired mode.

E2 is the polarized transverse electric field,

where E1 and E2 both are represented by MxM matrices of complex numbers.

How to calculate the Overlap Integral (OI) of E1 and E2 in Matlab

Is it possible to calculate the Overlap Integral (OI) using trapz function in Matlab?

shdotcom
  • 125
  • 1
  • 1
  • 11
  • The expression in that image suggests `E1` and `E2` are supposed to be continuous over some domain (x, y), rather than discrete matrices. If your matrices represent sampled values from the domain you can use some approach to construct approximating functions, then multiply those and do numerical integration of that expression over the domain. – Asad Saeeduddin May 18 '17 at 13:52
  • @AsadSaeeduddin could you please give me an example for the approximating functions. Is it possible to do this (numerical integration) using trapz function in Matlab? – shdotcom May 18 '17 at 14:00
  • You need to have some understanding of the underlying behavior of the function in order to come up with a decent approximation. E.g. if you know that the function behaves as a polynomial of degree n (or similarly enough), you can use polyfitn to get an n-coefficient polynomial from your sample data. – Asad Saeeduddin May 18 '17 at 14:13
  • Of course, this is trivial. Do you expect Asad solve and program your homework for you? Show us your work and we can help you. – Brethlosze May 18 '17 at 21:15
  • @shdotcom You can indeed use `trapz`, although I wasn't familiar with this at the time. The [docs](http://www.mathworks.com/help/matlab/ref/trapz.html) even have an example for using trapz to evaluate a function defined over a 2D space: see the section on "Multiple Numerical Integrations". Note that this assumes your sample is at a fine enough resolution that you can get good results from integrating it directly; using `trapz` is essentially equivalent to approximating the function by linearly interpolating between adjacent points. – Asad Saeeduddin May 19 '17 at 11:48
  • @Asad Saeeduddin I have used trapz with 2D and it works. Thank you Asad – shdotcom May 19 '17 at 22:46

0 Answers0