############################################################## # Scriptfile: OLED_hex_simuations # This file performs number of simulations of OLED with PC # where the locations of the dipolea are distriburted # randomly in regions 1' and A' # Also, this performs simulations of OLED without PC ############################################################## #clear; # User Input ndp=4; # total number of locations of dipoles (region 1'+A') randreset(49); #random seed ireg_1p=0; ireg_Ap=0; #calculation of random positions of dipoles for(i=1:ndp) { xr=rand*sqrt(3)/4; yr=rand/4; reg=0; if(yr > xr/sqrt(3)) { xr=sqrt(3)/4+xr; yr=1/4-yr; reg=reg+1; } if(reg == 0) {region="1p";} #1p means region 1' in Fig.1(b) if(reg == 1) {region="Ap";} #Ap means region A' in Fig.1(b) ?region; #ireg_1p (ireg_Ap) counts the number of locations in region 1p (Ap) if(reg == 0) {ireg_1p=ireg_1p+1; i1pAp=ireg_1p;} if(reg == 1) {ireg_Ap=ireg_Ap+1; i1pAp=ireg_Ap;} #rotation of the point by 30 degree alp=30*pi/180; px=cos(alp)*xr-sin(alp)*yr; #x coordinate of the dipole location py=sin(alp)*xr+cos(alp)*yr; #y coordinate of the dipole location #running FDTD simualtions of OLED with PC for(j=1:3) { if(j==1) { load("OLED_3D_hex"); switchtolayout; setnamed("::model","px",px); setnamed("::model","py",py); setnamed("::model","dipole_orientation","x"); save("OLED_hex_simple_"+region+num2str(i1pAp)+"_x"); addjob("OLED_hex_simple_"+region+num2str(i1pAp)+"_x"); } if(j==2) { load("OLED_3D_hex"); switchtolayout; setnamed("::model","px",px); setnamed("::model","py",py); setnamed("::model","dipole_orientation","y"); save("OLED_hex_simple_"+region+num2str(i1pAp)+"_y"); addjob("OLED_hex_simple_"+region+num2str(i1pAp)+"_y"); } if(j==3) { load("OLED_3D_hex"); switchtolayout; setnamed("::model","px",px); setnamed("::model","py",py); setnamed("::model","dipole_orientation","z"); save("OLED_hex_simple_"+region+num2str(i1pAp)+"_z"); addjob("OLED_hex_simple_"+region+num2str(i1pAp)+"_z"); } }#j }#i #running FDTD simualtions of OLED without PC for(i=1:2) { if(i==1) { load("OLED_3D_hex"); switchtolayout; setnamed("::model","add_PC",0); setnamed("::model","px",0); setnamed("::model","py",0); setnamed("::model","dipole_orientation","x"); save("OLED_hex_simple0_x"); addjob("OLED_hex_simple0_x"); } if(i==2) { load("OLED_3D_hex"); switchtolayout; setnamed("::model","add_PC",0); setnamed("::model","px",0); setnamed("::model","py",0); setnamed("::model","dipole_orientation","z"); save("OLED_hex_simple0_z"); addjob("OLED_hex_simple0_z"); } } savedata("num_locs",ireg_1p,ireg_Ap); runjobs;