% gdc_demo5: Biperiodic grating comprising cylindrical pillars % % Test case from J. Opt. Soc. Am. A/Vol. 14, No. 10/Oct. 1997, pp. % 2758-2767, Example 2. % % gdc_demo5 covers the following topics: % - biperiodic grating with non-orthogonal period vectors % - approximation of cylindrical structures by block partitioning % - choice of unit cell and stripe orientations % - harmonic indices % - diffraction order selection % - stripe-induced symmetry error % - Compare computation results with published numeric data. % % Documentation references: % GD-Calc_Demo.pdf and GD-Calc.pdf (Part 1) % gdc.m, gdc_plot.m, gdc_eff.m (comment headers) % % % This demo program was tested with MATLAB R14 (SP2) on a Dell Precision % 530 (vintage Feb 2002) with dual 2.2 GHz Xeon P4 processors and 2 Gb RAM. % % Output: % % >> gdc_demo5 % Elapsed time is 68.534834 seconds. % % Diffraction efficiencies (m1, m2, eff2) % R: % -2 -2 0.00072532 % -1 -2 0.00199 % -2 -1 0.0019477 % -1 -1 4.9445e-005 % 0 -1 0.0036358 % -1 0 0.0035422 % 0 0 0.0039243 % 1 0 0.00212 % 0 1 0.0021167 % T: % -2 -4 0.0001972 % -3 -3 0.0098404 % -2 -3 0.01054 % -1 -3 0.0084122 % 0 -3 0.0016975 % -4 -2 0.00020629 % -3 -2 0.010882 % -2 -2 0.010846 % -1 -2 0.022346 % 0 -2 0.029692 % 1 -2 0.0023055 % -3 -1 0.0083492 % -2 -1 0.022085 % -1 -1 0.11022 % 0 -1 0.11016 % 1 -1 0.016087 % -3 0 0.0016559 % -2 0 0.029268 % -1 0 0.10924 % 0 0 0.059547 % 1 0 0.11972 % 2 0 0.0052807 % -2 1 0.0022836 % -1 1 0.015925 % 0 1 0.12041 % 1 1 0.11009 % 2 1 0.013615 % 0 2 0.0053039 % 1 2 0.013745 % Energy loss: % 1.2579e-013 % % % Version 11/05/2005 % Author: Kenneth C. Johnson % software.kjinnovation.com % This file is Public Domain software. demo=true; % true: run gdc_demo_engine; false: run gdc_engine alt_stripe=1; % selector for alternate stripe orientation (1, 2, or 3) % Define parameters for grating structure and incident field: grating_pmt=2.56; % dielectric permittivity wavelength=1; h=wavelength; % grating height d=2*wavelength; % grating period r=0.5*wavelength; % pillar radius theta=30*pi/180; % incidence polar angle from x1 axis phi=30*pi/180; % incidence azimuthal angle around x1 axis (zero on x2 axis) N=1000; % number of partition blocks per semicircle (for pillars) m_max=9; % maximum diffraction order index if ~demo % The following code block is replicated in gdc_demo_engine. % Construct grating. clear grating grating.pmt={1,grating_pmt}; % grating material permittivities grating.pmt_sub_index=2; % substrate permittivity index grating.pmt_sup_index=1; % superstrate permittivity index % Define the x2 and x3 projections of the first grating period % (d21,d31) and second grating period (d22,d32). The second period is % parallel to the x2 axis, and the first period is at an angle zeta to % the x3 axis. zeta=30*pi/180; grating.d21=d*sin(zeta); grating.d31=d*cos(zeta); grating.d22=d; grating.d32=0; clear stratum stratum.type=2; % biperiodic stratum stratum.thick=h; % stratum thickness % The following h11 ... h22 spec defines the stratum's period vectors % (GD-Calc.pdf, equation 3.18) and determines the stripe orientation. if alt_stripe==1 % Stripes are parallel to [grating.d22,grating.d32]. stratum.h11=1; stratum.h12=0; stratum.h21=0; stratum.h22=1; elseif alt_stripe==2 % Stripes are parallel to [grating.d21,grating.d31]. stratum.h11=0; stratum.h12=1; stratum.h21=1; stratum.h22=0; else % alt_stripe==3 % Stripes are parallel to % [grating.d21,grating.d31]-[grating.d22,grating.d32]. stratum.h11=1; stratum.h12=1; stratum.h21=0; stratum.h22=-1; end stratum.stripe=cell(1,2*N); % Define vertex coordinates for block-partitioned unit circle (see % GD-Calc.pdf, Figure 4). The j-th block vertex in the first quadrant % has coordinates [x(j),x(N+1-j)], j=1...N. x(j) is monotonic % decreasing with j. x=circle_partition(N); clear stripe block stripe.type=1; % inhomogeneous stripe % Construct the stratum. (Refer to Figures 3 and 4 in GD-Calc.pdf and % view the grating plot with a small N value to follow the construction % logic.) % The x2, x3 coordinate origin is at the center of a pillar. for n=1:N if n