Normalized intensity

HalimBishoyHalimBishoy Member Posts: 21

If I generate a metalens at broadband 270nm to 380nm. Could I ask about script code to get the normalized intensity as shown in the following figure with a max value equal to one, at different wavelength values (for example 270nm, 298 nm , 334nm , and 380 nm) in that range?


  • gsungsun Posts: 1,102Ansys Employee

    Hi, I think this question appears in different posts. However I do not know what quantity you have at hand in script. In general, you can get the the intensity by use of


    This is in general a 4D matrix: x,y,z, and f, even some of them has only one element, eg, for a 3D simulation, a 2D DFT monitor perpendicular to z axis, E2 would have (please pick up x,y,z, and f from the monitor using script)



    nz=length(z), which is 1



    In order to plot the graph shown above, you will need to find the y value. For example, at y=0, you can use

    E2_x=pinch(E2(:,find(y,0),1,2)) This script picks up the 2nd frequency point (4th dimension), and y=0 plane.

    Then you can plot

    plot(x*1e6, E2_x,"x um","E2");

    You can also plot the normalized result with max=1:

    plot(x*1e6, E2_x/max(E2_x),"x um","E2");

    Please refer the script introduction website and related edu videos for more information.

Sign In or Register to comment.