Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Postprocessing (Integration) of a Far Field.

Maxim Electromobility

Please login with a confirmed email address before reporting spam

Dear colleagues,

SHORT QUESTION:
How to integrate Far Field emw.normEfar over the solid angle defined by inclination (polar) angle theta form 0 to 60 degrees, and azimuthal angle phi from 0 to 360 degrees?

IN DETAILS:
I am simulating a nano-antenna on the dielectric substrate, and managed to calculate the far field and the radiation pattern. In experiment the radiated from the antenna field will be collected by a lens with some numerical aperture. So, I need to calculate how much light is captured by objective, namely within the certain inclination angle, say 60 degree.

In other words I am looking for a way to calculate an integral of (emw.normEfar)^2 over the inclination (polar) angle theta form 0 to 60 degrees, and azimuthal angle phi from 0 to 360 degrees with radius equals to 1.

According to the equation view in the Far Field Domain the emw.normEfar is defined by sqrt(realdot(Efarx(x,y,z),Efarx(x,y,z))+realdot(Efary(x,y,z),Efary(x,y,z))+realdot(Efarz(x,y,z),Efarz(x,y,z))). Here I can replace the Cartesian coordinates with spherical: (x,y,z) -> (sin(phi)*cos(theta),sin(phi)*sin(theta),cos(phi)), and then take the double integral of the above function multiplied by r^2*sin(theta) over two angels.

QUESTIONS:
1) How to do a double integration? Which function to use?
2) Maybe someone knows the easier way to do the integration.

I would really thankful for any hints!
Maxim

5 Replies Last Post 30 set 2016, 10:23 GMT-4
Sergei Yushanov Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 9 giu 2014, 09:33 GMT-4
Maxim,

Try the following:

1. Define variables for azimuthal and polar angles
theta=acos(z/sqrt(x^2+y^2+z^2))
phi=atan2(y,x)

2. Define integration coupling operator intop1() over the surface where far-field is calculated

3. Calculate surface integral over the specified range of polar phi=[phi1,phi2] and azimuthal angles theta=[thet1,thet2] using Boolean algebra
surf_integral=intop1(emw.normEfar^2)*(phi>=phi1)*(phi<=phi2)*(theta>=thet1)*(theta<=thet2)

Regards,
Sergei
Maxim, Try the following: 1. Define variables for azimuthal and polar angles theta=acos(z/sqrt(x^2+y^2+z^2)) phi=atan2(y,x) 2. Define integration coupling operator intop1() over the surface where far-field is calculated 3. Calculate surface integral over the specified range of polar phi=[phi1,phi2] and azimuthal angles theta=[thet1,thet2] using Boolean algebra surf_integral=intop1(emw.normEfar^2)*(phi>=phi1)*(phi=thet1)*(theta

Maxim Electromobility

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 10 giu 2014, 09:14 GMT-4
Dear Sergei,

Thank you very much for the response. I have followed your recommendations, and I have got the following error on the third step, calculating intop1-oiperator as a global expression:


Problem encountered during results while solving.
Failed to evaluate variable.
- Variable: z
- Global scope
Failed to evaluate variable.
- Variable: comp1.theta
- Defined as: (acos((z/sqrt((((x^2)+(y^2))+(z^2)))))*unit rad cf)
Failed to evaluate expression.
- Expression: real(((comp1.theta<=(0.3888888888888889*pi))*((comp1.theta>=0)*((comp1.phi<=pi)*((comp1.phi>=(-pi))*comp1.intop1((comp1.emw.normEfar^2)))))))
Failed to evaluate expression.
- Expression: real(comp1.intop1(comp1.emw.normEfar^2)*(comp1.phi>=-pi)*(comp1.phi<=pi)*(comp1.theta>=0)*(comp1.theta<=0.3888888888888889*pi))


From other side, I managed to integrate the expression (emw.normEfar^2)*(phi>=-pi)*(phi<=pi)*(theta>=0)*(theta<=pi/180*70) under Results->Derived Values->Surface Integration. However when I try to integrate the same expression as a Boundary probe, the calculation never stops, and I have to kill Comsol from task manager.

Additionally, the integration of the Far Field is extremely slow: about 20 min, while the FEM calculation itself takes 5 min. The integration of the Far Field uses only one processor core.

Do you maybe know how to make a parametric sweep with the far field integration in one run? And is it possible to accelerate the Far Field integration, say by reducing the accuracy of the integration, or by forcing Comsol to use all processor cores for integration?

Thanks for the help!

Best regards,
Maxim
Dear Sergei, Thank you very much for the response. I have followed your recommendations, and I have got the following error on the third step, calculating intop1-oiperator as a global expression: [quote] Problem encountered during results while solving. Failed to evaluate variable. - Variable: z - Global scope Failed to evaluate variable. - Variable: comp1.theta - Defined as: (acos((z/sqrt((((x^2)+(y^2))+(z^2)))))*unit rad cf) Failed to evaluate expression. - Expression: real(((comp1.theta=0)*((comp1.phi=(-pi))*comp1.intop1((comp1.emw.normEfar^2))))))) Failed to evaluate expression. - Expression: real(comp1.intop1(comp1.emw.normEfar^2)*(comp1.phi>=-pi)*(comp1.phi=0)*(comp1.theta=-pi)*(phi=0)*(thetaDerived Values->Surface Integration. However when I try to integrate the same expression as a Boundary probe, the calculation never stops, and I have to kill Comsol from task manager. Additionally, the integration of the Far Field is extremely slow: about 20 min, while the FEM calculation itself takes 5 min. The integration of the Far Field uses only one processor core. Do you maybe know how to make a parametric sweep with the far field integration in one run? And is it possible to accelerate the Far Field integration, say by reducing the accuracy of the integration, or by forcing Comsol to use all processor cores for integration? Thanks for the help! Best regards, Maxim

Sergei Yushanov Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 10 giu 2014, 16:38 GMT-4
Maxim,

It is hard to tell were the error is coming from without seeing the model. I used spherical angles quite often and never saw this error.

Far-field is calculated from the near-field on a boundary using Stratton-Chu formula, which is computationally quite extensive – so it is not surprising that far-field evaluation might take longer time than solving problem itself. You might try to partition far-field surface and reduce integration over the smaller boundary instead of integration over the full solid angle 4*pi.

You can increase the number of processors used by changing default setup under
File/Preferences/Multicore and Cluster Computing/Number of processors

Regards,
Sergei

Maxim, It is hard to tell were the error is coming from without seeing the model. I used spherical angles quite often and never saw this error. Far-field is calculated from the near-field on a boundary using Stratton-Chu formula, which is computationally quite extensive – so it is not surprising that far-field evaluation might take longer time than solving problem itself. You might try to partition far-field surface and reduce integration over the smaller boundary instead of integration over the full solid angle 4*pi. You can increase the number of processors used by changing default setup under File/Preferences/Multicore and Cluster Computing/Number of processors Regards, Sergei

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 31 ott 2014, 07:15 GMT-4
Hi Maxim,
Have you found a solution how to integrate Efar over the specified boundary in include light collection lens effect?. I am trying to calculate Efar in 2D for 0.65 NA lens?. I defined phi=asin(y/sqrt(x^2+y^2)) and doing line integration in post processing in results section. I defined line integral as Sergai said expect for 2D. I am but always getting 0 for integration.
I assumed angle calculation starts from first quadrant of the geometry, and given between pi+(pi/2-half angle of lens) to pi+(pi/2+half angle of lens) for back side collection as attached. Can I know my angle definition is correct for attached geometry?


Thanks

Mahendar
Hi Maxim, Have you found a solution how to integrate Efar over the specified boundary in include light collection lens effect?. I am trying to calculate Efar in 2D for 0.65 NA lens?. I defined phi=asin(y/sqrt(x^2+y^2)) and doing line integration in post processing in results section. I defined line integral as Sergai said expect for 2D. I am but always getting 0 for integration. I assumed angle calculation starts from first quadrant of the geometry, and given between pi+(pi/2-half angle of lens) to pi+(pi/2+half angle of lens) for back side collection as attached. Can I know my angle definition is correct for attached geometry? Thanks Mahendar


Please login with a confirmed email address before reporting spam

Posted: 8 years ago 30 set 2016, 10:23 GMT-4
(just in case someone bumps into this old thread as I did)

The solution suggested by Sergei works for me (v4.4) only if the Boolean expression are put *inside* the integral operator. So the formula he suggested should be modified into:
surf_integral=intop1(emw.normEfar^2*(phi>=phi1)*(phi<=phi2)*(theta>=thet1)*(theta<=thet2))

That's why (this pointed me to the right direction), as Maxime noted, the expression works anyway in Results->Derived Values->Surface Integration, where you only define the integration operator argument.

Best,
Attilio
(just in case someone bumps into this old thread as I did) The solution suggested by Sergei works for me (v4.4) only if the Boolean expression are put *inside* the integral operator. So the formula he suggested should be modified into: surf_integral=intop1(emw.normEfar^2*(phi>=phi1)*(phi=thet1)*(theta

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.