## Photonics

#### Fraction Integrated in Modal Analysis

• Xuanchang Zhang
Subscriber

Hi,

I am trying to use matlab to plot the distribution of fraction integrated along the x-axis for my laser structure. However, I noticed that this value is not directly exported. Instead, I can see Ex Ey Ez have been exported. I am wondering if there is an algorithm that I can use to find the integrated power.

Many thanks,

Xuanchang

• Guilin Sun
Ansys Employee

For a given region, you can use

getanalysis("fraction integrated");

to get the integrated result.

It seems you want to get results from different regions. In such case I would suggest to get the field data, and do the integration for whatever the region you want with script.

Be aware that, FDE may use non uniform mesh but matlab always assumes uniform mesh. So you might need to interpolate the data into uniform mesh before exporting the data to matlab.

Please refer to this post  https://forum.ansys.com/forums/topic/ansys-insight:--matlabhuatushizhenwenti/

• Xuanchang Zhang
Subscriber

Hi,

Thanks for the quick reply. I am afraid I didn’t express the question very clearly. I am wondering if I can get the value of integrated power of each (x,z) coordinate so that I can plot the distribution of power along x or z axis. In another word, would it be possible to calculate the energy density of each coordinate as shown in this screenshot?

To me, getanalysis is more like obtaining a final value of the selected area.

Thanks

• Guilin Sun
Ansys Employee

Yes, you can. For example, I wrote the following script:

x1=.1e06;

x2=.5e-6;

y1=-2e-6;

y2=1e-6;

setanalysis("integration shape","rectangular");

setanalysis("y1",y1);setanalysis("y2",y2);

setanalysis("x1",x1);setanalysis("x2",x2);

area=getanalysis("fraction integrated");

you can easily convert it to a loop by assigning matrix values to x1,x2,y1 and y2.

However, the Energy density and other values in "component" can only be for the whole mode profile. If you want caculate them differently, please extract the mode profile and calculate the quantity you want.

you can try

E=getresult("mode1","E");

H=getresult("mode1","H");

x=E.x;

E=E.E; #data set

H=H.H;

Ex=pinch(E(:,:,:,1,1));

Ey=pinch(E(:,:,:,1,2));

Please check the dimensions of the matrices and know what do they mean.

E is a 5D matrix:x,y,z,f,{1,2,3}, where {1,2,3} means Ex,Ey and Ez.

• Xuanchang Zhang
Subscriber

Hi,

Thanks for your help. I am wondering how I can extract the refractive index using the same method that you mentioned for the energy density.

Thank you

• Guilin Sun
Ansys Employee

Unfortunately currently FDE does not have output for refractive index. Please file a feature request by referring to this post, please do not reply in the post: